emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/etags-regen ab5bf3c 01/11: Merge branch 'master' into scratch/et


From: Dmitry Gutov
Subject: scratch/etags-regen ab5bf3c 01/11: Merge branch 'master' into scratch/etags-regen
Date: Sun, 3 Jan 2021 19:06:15 -0500 (EST)

branch: scratch/etags-regen
commit ab5bf3c058c070a467c99120853b04ec8a2c50bd
Merge: 94437f9 f14869c
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Merge branch 'master' into scratch/etags-regen
---
 .clang-format                                      |    2 +-
 .dir-locals.el                                     |    1 +
 .gitattributes                                     |    2 +-
 .gitignore                                         |    2 +-
 .gitlab-ci.yml                                     |    4 +-
 ChangeLog.1                                        |    2 +-
 ChangeLog.2                                        |    2 +-
 ChangeLog.3                                        |    2 +-
 GNUmakefile                                        |    2 +-
 INSTALL                                            |    2 +-
 INSTALL.REPO                                       |    2 +-
 Makefile.in                                        |    2 +-
 README                                             |    2 +-
 admin/ChangeLog.1                                  |    2 +-
 admin/README                                       |    2 +-
 admin/admin.el                                     |    2 +-
 admin/alloc-colors.c                               |    2 +-
 admin/authors.el                                   |   20 +-
 admin/automerge                                    |    2 +-
 admin/build-configs                                |    2 +-
 admin/charsets/Makefile.in                         |    2 +-
 admin/charsets/mapconv                             |    2 +-
 admin/charsets/mapfiles/README                     |    2 +-
 admin/cus-test.el                                  |    2 +-
 admin/diff-tar-files                               |    6 +-
 admin/emake                                        |   85 +
 admin/find-gc.el                                   |    2 +-
 admin/gitmerge.el                                  |    2 +-
 admin/grammars/Makefile.in                         |    2 +-
 admin/grammars/c.by                                |    2 +-
 admin/grammars/grammar.wy                          |    2 +-
 admin/grammars/java-tags.wy                        |    2 +-
 admin/grammars/js.wy                               |    2 +-
 admin/grammars/make.by                             |    2 +-
 admin/grammars/python.wy                           |    2 +-
 admin/grammars/scheme.by                           |    2 +-
 admin/grammars/srecode-template.wy                 |    2 +-
 admin/last-chance.el                               |    2 +-
 admin/make-emacs                                   |    2 +-
 admin/make-manuals                                 |    2 +-
 admin/make-tarball.txt                             |   25 +-
 admin/merge-gnulib                                 |    5 +-
 admin/merge-pkg-config                             |    4 +-
 admin/notes/copyright                              |    2 +-
 admin/notes/emba                                   |    2 +-
 admin/notes/hydra                                  |    2 +-
 admin/notes/multi-tty                              |    2 +-
 admin/notes/unicode                                |    2 +-
 admin/notes/www                                    |    2 +-
 admin/nt/README-UNDUMP.W32                         |    2 +-
 admin/nt/dist-build/README-windows-binaries        |    2 +-
 admin/nt/dist-build/build-dep-zips.py              |    3 +-
 admin/nt/dist-build/build-zips.sh                  |    2 +-
 admin/quick-install-emacs                          |    2 +-
 admin/unidata/Makefile.in                          |    2 +-
 admin/unidata/blocks.awk                           |    2 +-
 admin/unidata/unidata-gen.el                       |    2 +-
 admin/unidata/uvs.el                               |    2 +-
 admin/update-copyright                             |    2 +-
 admin/update_autogen                               |    2 +-
 admin/upload-manuals                               |    2 +-
 autogen.sh                                         |    2 +-
 build-aux/config.guess                             |  224 +-
 build-aux/config.sub                               |   60 +-
 build-aux/git-hooks/commit-msg                     |    2 +-
 build-aux/git-hooks/pre-commit                     |    2 +-
 build-aux/git-hooks/prepare-commit-msg             |    6 +-
 build-aux/gitlog-to-changelog                      |    2 +-
 build-aux/gitlog-to-emacslog                       |    2 +-
 build-aux/install-sh                               |   35 +-
 build-aux/make-info-dir                            |    2 +-
 build-aux/move-if-change                           |    2 +-
 build-aux/msys-to-w32                              |    2 +-
 build-aux/update-copyright                         |    2 +-
 build-aux/update-subdirs                           |    2 +-
 config.bat                                         |    2 +-
 configure.ac                                       |   23 +-
 doc/emacs/ChangeLog.1                              |    2 +-
 doc/emacs/Makefile.in                              |    2 +-
 doc/emacs/abbrevs.texi                             |    2 +-
 doc/emacs/ack.texi                                 |    2 +-
 doc/emacs/anti.texi                                |    2 +-
 doc/emacs/arevert-xtra.texi                        |    2 +-
 doc/emacs/basic.texi                               |    7 +-
 doc/emacs/buffers.texi                             |    2 +-
 doc/emacs/building.texi                            |    2 +-
 doc/emacs/cal-xtra.texi                            |    2 +-
 doc/emacs/calendar.texi                            |    2 +-
 doc/emacs/cmdargs.texi                             |    2 +-
 doc/emacs/commands.texi                            |    2 +-
 doc/emacs/custom.texi                              |    2 +-
 doc/emacs/dired-xtra.texi                          |    2 +-
 doc/emacs/dired.texi                               |    2 +-
 doc/emacs/display.texi                             |    2 +-
 doc/emacs/emacs-xtra.texi                          |    2 +-
 doc/emacs/emacs.texi                               |    2 +-
 doc/emacs/emerge-xtra.texi                         |    2 +-
 doc/emacs/entering.texi                            |    2 +-
 doc/emacs/files.texi                               |    2 +-
 doc/emacs/fixit.texi                               |    2 +-
 doc/emacs/fortran-xtra.texi                        |    2 +-
 doc/emacs/frames.texi                              |    2 +-
 doc/emacs/glossary.texi                            |    2 +-
 doc/emacs/gnu.texi                                 |    2 +-
 doc/emacs/help.texi                                |    2 +-
 doc/emacs/indent.texi                              |    4 +-
 doc/emacs/killing.texi                             |    2 +-
 doc/emacs/kmacro.texi                              |    2 +-
 doc/emacs/m-x.texi                                 |    2 +-
 doc/emacs/macos.texi                               |    2 +-
 doc/emacs/maintaining.texi                         |   12 +-
 doc/emacs/mark.texi                                |    2 +-
 doc/emacs/mini.texi                                |    2 +-
 doc/emacs/misc.texi                                |   28 +-
 doc/emacs/modes.texi                               |    2 +-
 doc/emacs/msdos-xtra.texi                          |    2 +-
 doc/emacs/msdos.texi                               |    2 +-
 doc/emacs/mule.texi                                |    2 +-
 doc/emacs/package.texi                             |    2 +-
 doc/emacs/picture-xtra.texi                        |    2 +-
 doc/emacs/programs.texi                            |    2 +-
 doc/emacs/regs.texi                                |    2 +-
 doc/emacs/rmail.texi                               |   16 +-
 doc/emacs/screen.texi                              |    2 +-
 doc/emacs/search.texi                              |    3 +-
 doc/emacs/sending.texi                             |    2 +-
 doc/emacs/text.texi                                |    2 +-
 doc/emacs/trouble.texi                             |    2 +-
 doc/emacs/vc-xtra.texi                             |    2 +-
 doc/emacs/vc1-xtra.texi                            |    2 +-
 doc/emacs/windows.texi                             |    2 +-
 doc/emacs/xresources.texi                          |    2 +-
 doc/lispintro/ChangeLog.1                          |    2 +-
 doc/lispintro/Makefile.in                          |    2 +-
 doc/lispintro/README                               |    2 +-
 doc/lispintro/cons-1.eps                           |    2 +-
 doc/lispintro/cons-2.eps                           |    2 +-
 doc/lispintro/cons-2a.eps                          |    2 +-
 doc/lispintro/cons-3.eps                           |    2 +-
 doc/lispintro/cons-4.eps                           |    2 +-
 doc/lispintro/cons-5.eps                           |    2 +-
 doc/lispintro/drawers.eps                          |    2 +-
 doc/lispintro/emacs-lisp-intro.texi                |    2 +-
 doc/lispintro/lambda-1.eps                         |    2 +-
 doc/lispintro/lambda-2.eps                         |    2 +-
 doc/lispintro/lambda-3.eps                         |    2 +-
 doc/lispref/ChangeLog.1                            |    2 +-
 doc/lispref/Makefile.in                            |    2 +-
 doc/lispref/README                                 |    2 +-
 doc/lispref/abbrevs.texi                           |    2 +-
 doc/lispref/anti.texi                              |    2 +-
 doc/lispref/back.texi                              |    2 +-
 doc/lispref/backups.texi                           |    8 +-
 doc/lispref/buffers.texi                           |   61 +-
 doc/lispref/commands.texi                          |    9 +-
 doc/lispref/compile.texi                           |    2 +-
 doc/lispref/control.texi                           |    2 +-
 doc/lispref/customize.texi                         |    2 +-
 doc/lispref/debugging.texi                         |   15 +-
 doc/lispref/display.texi                           |   52 +-
 doc/lispref/edebug.texi                            |    2 +-
 doc/lispref/elisp.texi                             |    2 +-
 doc/lispref/errors.texi                            |   13 +-
 doc/lispref/eval.texi                              |    2 +-
 doc/lispref/files.texi                             |    9 +-
 doc/lispref/frames.texi                            |    2 +-
 doc/lispref/functions.texi                         |    2 +-
 doc/lispref/hash.texi                              |    2 +-
 doc/lispref/help.texi                              |    2 +-
 doc/lispref/hooks.texi                             |    2 +-
 doc/lispref/internals.texi                         |   31 +-
 doc/lispref/intro.texi                             |    2 +-
 doc/lispref/keymaps.texi                           |   14 +-
 doc/lispref/lay-flat.texi                          |    2 +-
 doc/lispref/lists.texi                             |    2 +-
 doc/lispref/loading.texi                           |    2 +-
 doc/lispref/macros.texi                            |    2 +-
 doc/lispref/maps.texi                              |    2 +-
 doc/lispref/markers.texi                           |    2 +-
 doc/lispref/minibuf.texi                           |    8 +-
 doc/lispref/modes.texi                             |   27 +-
 doc/lispref/nonascii.texi                          |    2 +-
 doc/lispref/numbers.texi                           |    2 +-
 doc/lispref/objects.texi                           |    2 +-
 doc/lispref/os.texi                                |   31 +-
 doc/lispref/package.texi                           |    2 +-
 doc/lispref/positions.texi                         |    2 +-
 doc/lispref/processes.texi                         |    5 +-
 doc/lispref/records.texi                           |    2 +-
 doc/lispref/searching.texi                         |    2 +-
 doc/lispref/sequences.texi                         |   17 +-
 doc/lispref/streams.texi                           |   20 +-
 doc/lispref/strings.texi                           |   65 +-
 doc/lispref/symbols.texi                           |    2 +-
 doc/lispref/syntax.texi                            |    2 +-
 doc/lispref/text.texi                              |   18 +-
 doc/lispref/threads.texi                           |    2 +-
 doc/lispref/tips.texi                              |    4 +-
 doc/lispref/two-volume-cross-refs.txt              |    2 +-
 doc/lispref/two-volume.make                        |    2 +-
 doc/lispref/variables.texi                         |   14 +-
 doc/lispref/windows.texi                           |    2 +-
 doc/man/ChangeLog.1                                |    2 +-
 doc/man/ebrowse.1                                  |    2 +-
 doc/man/emacs.1.in                                 |    2 +-
 doc/man/etags.1                                    |    2 +-
 doc/misc/ChangeLog.1                               |    2 +-
 doc/misc/Makefile.in                               |    2 +-
 doc/misc/auth.texi                                 |    2 +-
 doc/misc/autotype.texi                             |    2 +-
 doc/misc/bovine.texi                               |    2 +-
 doc/misc/calc.texi                                 |   10 +-
 doc/misc/cc-mode.texi                              |    6 +-
 doc/misc/cl.texi                                   |   15 +-
 doc/misc/dbus.texi                                 |    2 +-
 doc/misc/dired-x.texi                              |    2 +-
 doc/misc/ebrowse.texi                              |    2 +-
 doc/misc/ede.texi                                  |    2 +-
 doc/misc/ediff.texi                                |    2 +-
 doc/misc/edt.texi                                  |    2 +-
 doc/misc/efaq-w32.texi                             |    2 +-
 doc/misc/efaq.texi                                 |  183 +-
 doc/misc/eieio.texi                                |    2 +-
 doc/misc/emacs-gnutls.texi                         |    2 +-
 doc/misc/emacs-mime.texi                           |    2 +-
 doc/misc/epa.texi                                  |    2 +-
 doc/misc/erc.texi                                  |    2 +-
 doc/misc/ert.texi                                  |    2 +-
 doc/misc/eshell.texi                               |    2 +-
 doc/misc/eudc.texi                                 |    2 +-
 doc/misc/eww.texi                                  |    2 +-
 doc/misc/flymake.texi                              |   12 +-
 doc/misc/forms.texi                                |    2 +-
 doc/misc/gnus-coding.texi                          |    2 +-
 doc/misc/gnus-faq.texi                             |   10 +-
 doc/misc/gnus.texi                                 |   57 +-
 doc/misc/htmlfontify.texi                          |    2 +-
 doc/misc/idlwave.texi                              |    2 +-
 doc/misc/ido.texi                                  |    2 +-
 doc/misc/info.texi                                 |    2 +-
 doc/misc/mairix-el.texi                            |    2 +-
 doc/misc/message.texi                              |    2 +-
 doc/misc/mh-e.texi                                 |    2 +-
 doc/misc/modus-themes.texi                         |    2 +-
 doc/misc/newsticker.texi                           |    2 +-
 doc/misc/nxml-mode.texi                            |    2 +-
 doc/misc/octave-mode.texi                          |    2 +-
 doc/misc/org.texi                                  | 1215 +++---
 doc/misc/pcl-cvs.texi                              |    2 +-
 doc/misc/pgg.texi                                  |    2 +-
 doc/misc/rcirc.texi                                |    2 +-
 doc/misc/reftex.texi                               |    2 +-
 doc/misc/remember.texi                             |    2 +-
 doc/misc/sasl.texi                                 |    2 +-
 doc/misc/sc.texi                                   |    2 +-
 doc/misc/sem-user.texi                             |    2 +-
 doc/misc/semantic.texi                             |    2 +-
 doc/misc/ses.texi                                  |    2 +-
 doc/misc/sieve.texi                                |    2 +-
 doc/misc/smtpmail.texi                             |    2 +-
 doc/misc/speedbar.texi                             |    2 +-
 doc/misc/srecode.texi                              |    2 +-
 doc/misc/texinfo.tex                               |   65 +-
 doc/misc/todo-mode.texi                            |    2 +-
 doc/misc/tramp.texi                                |   79 +-
 doc/misc/trampver.texi                             |    4 +-
 doc/misc/url.texi                                  |    2 +-
 doc/misc/vhdl-mode.texi                            |    2 +-
 doc/misc/vip.texi                                  |    2 +-
 doc/misc/viper.texi                                |    2 +-
 doc/misc/widget.texi                               |    2 +-
 doc/misc/wisent.texi                               |    2 +-
 doc/misc/woman.texi                                |    2 +-
 etc/CALC-NEWS                                      |    2 +-
 etc/ChangeLog.1                                    |    2 +-
 etc/DEBUG                                          |    2 +-
 etc/DISTRIB                                        |    2 +-
 etc/ERC-NEWS                                       |    2 +-
 etc/ETAGS.EBNF                                     |    4 +-
 etc/ETAGS.README                                   |    2 +-
 etc/HELLO                                          |    2 +-
 etc/MACHINES                                       |    2 +-
 etc/MH-E-NEWS                                      |    2 +-
 etc/NEWS                                           |  323 +-
 etc/NEWS.1-17                                      |    2 +-
 etc/NEWS.18                                        |    2 +-
 etc/NEWS.19                                        |    2 +-
 etc/NEWS.20                                        |    2 +-
 etc/NEWS.21                                        |    2 +-
 etc/NEWS.22                                        |    2 +-
 etc/NEWS.23                                        |    2 +-
 etc/NEWS.24                                        |    2 +-
 etc/NEWS.25                                        |    2 +-
 etc/NEWS.26                                        |    2 +-
 etc/NEWS.27                                        |    2 +-
 etc/NEXTSTEP                                       |    2 +-
 etc/NXML-NEWS                                      |    2 +-
 etc/ORG-NEWS                                       |  595 ++-
 etc/PROBLEMS                                       |    2 +-
 etc/README                                         |    2 +-
 etc/TERMS                                          |    2 +-
 etc/TODO                                           |   70 +-
 etc/charsets/README                                |    2 +-
 etc/compilation.txt                                |    2 +-
 etc/edt-user.el                                    |    2 +-
 etc/emacs-buffer.gdb                               |    2 +-
 etc/emacs.appdata.xml                              |    2 +-
 etc/emacs.service                                  |    6 +-
 etc/enriched.txt                                   |    2 +-
 etc/forms/forms-d2.el                              |    2 +-
 etc/gnus-tut.txt                                   |    2 +-
 etc/grep.txt                                       |    8 +-
 etc/images/README                                  |    8 +-
 etc/images/checked.xpm                             |    2 +-
 etc/images/custom/README                           |    2 +-
 etc/images/ezimage/README                          |    2 +-
 etc/images/gnus/README                             |    6 +-
 etc/images/gnus/gnus.svg                           |    2 +-
 etc/images/gud/README                              |    6 +-
 etc/images/icons/README                            |    8 +-
 etc/images/icons/hicolor/scalable/apps/emacs.svg   |    2 +-
 etc/images/icons/hicolor/scalable/apps/emacs23.svg |    2 +-
 .../scalable/mimetypes/emacs-document23.svg        |    2 +-
 etc/images/mh-logo.xpm                             |    2 +-
 etc/images/mpc/README                              |    2 +-
 etc/images/newsticker/README                       |    2 +-
 etc/images/smilies/README                          |    2 +-
 etc/images/smilies/grayscale/README                |    2 +-
 etc/images/smilies/medium/README                   |    2 +-
 etc/images/splash.svg                              |    2 +-
 etc/images/tabs/README                             |    2 +-
 etc/images/tree-widget/default/README              |    2 +-
 etc/images/tree-widget/folder/README               |    2 +-
 etc/images/unchecked.xpm                           |    2 +-
 etc/org/README                                     |    2 +-
 etc/ps-prin0.ps                                    |    2 +-
 etc/ps-prin1.ps                                    |    2 +-
 etc/publicsuffix.txt                               |  108 +-
 etc/refcards/Makefile                              |    2 +-
 etc/refcards/README                                |    4 +-
 etc/refcards/calccard.tex                          |    2 +-
 etc/refcards/cs-dired-ref.tex                      |    2 +-
 etc/refcards/cs-refcard.tex                        |    2 +-
 etc/refcards/cs-survival.tex                       |    2 +-
 etc/refcards/de-refcard.tex                        |    2 +-
 etc/refcards/dired-ref.tex                         |    2 +-
 etc/refcards/emacsver.tex.in                       |    2 +-
 etc/refcards/fr-dired-ref.tex                      |    2 +-
 etc/refcards/fr-refcard.tex                        |    2 +-
 etc/refcards/fr-survival.tex                       |    2 +-
 etc/refcards/gnus-logo.eps                         |    2 +-
 etc/refcards/gnus-refcard.tex                      |    2 +-
 etc/refcards/orgcard.tex                           |   11 +-
 etc/refcards/pdflayout.sty                         |    2 +-
 etc/refcards/pl-refcard.tex                        |    2 +-
 etc/refcards/pt-br-refcard.tex                     |    2 +-
 etc/refcards/refcard.tex                           |    2 +-
 etc/refcards/ru-refcard.tex                        |    4 +-
 etc/refcards/sk-dired-ref.tex                      |    2 +-
 etc/refcards/sk-refcard.tex                        |    2 +-
 etc/refcards/sk-survival.tex                       |    2 +-
 etc/refcards/survival.tex                          |    2 +-
 etc/refcards/vipcard.tex                           |    2 +-
 etc/refcards/viperCard.tex                         |    2 +-
 etc/schema/locate.rnc                              |    2 +-
 etc/schema/relaxng.rnc                             |    2 +-
 etc/schema/schemas.xml                             |    2 +-
 etc/ses-example.ses                                |    2 +-
 etc/srecode/c.srt                                  |    2 +-
 etc/srecode/cpp.srt                                |    2 +-
 etc/srecode/default.srt                            |    2 +-
 etc/srecode/doc-cpp.srt                            |    2 +-
 etc/srecode/doc-default.srt                        |    2 +-
 etc/srecode/doc-java.srt                           |    2 +-
 etc/srecode/ede-autoconf.srt                       |    2 +-
 etc/srecode/ede-make.srt                           |    2 +-
 etc/srecode/el.srt                                 |    2 +-
 etc/srecode/getset-cpp.srt                         |    2 +-
 etc/srecode/java.srt                               |    2 +-
 etc/srecode/make.srt                               |    2 +-
 etc/srecode/proj-test.srt                          |    2 +-
 etc/srecode/template.srt                           |    2 +-
 etc/srecode/test.srt                               |    2 +-
 etc/srecode/texi.srt                               |    2 +-
 etc/srecode/wisent.srt                             |    2 +-
 etc/themes/adwaita-theme.el                        |    2 +-
 etc/themes/deeper-blue-theme.el                    |    2 +-
 etc/themes/dichromacy-theme.el                     |    2 +-
 etc/themes/leuven-theme.el                         |    2 +-
 etc/themes/light-blue-theme.el                     |    2 +-
 etc/themes/manoj-dark-theme.el                     |    2 +-
 etc/themes/misterioso-theme.el                     |    2 +-
 etc/themes/modus-operandi-theme.el                 |    2 +-
 etc/themes/modus-vivendi-theme.el                  |    2 +-
 etc/themes/tango-dark-theme.el                     |    2 +-
 etc/themes/tango-theme.el                          |    2 +-
 etc/themes/tsdh-dark-theme.el                      |    2 +-
 etc/themes/tsdh-light-theme.el                     |    2 +-
 etc/themes/wheatgrass-theme.el                     |    2 +-
 etc/themes/whiteboard-theme.el                     |    2 +-
 etc/themes/wombat-theme.el                         |    2 +-
 etc/tutorials/TUTORIAL                             |    2 +-
 etc/tutorials/TUTORIAL.bg                          |    2 +-
 etc/tutorials/TUTORIAL.cn                          |    4 +-
 etc/tutorials/TUTORIAL.cs                          |    2 +-
 etc/tutorials/TUTORIAL.de                          |    2 +-
 etc/tutorials/TUTORIAL.eo                          |    2 +-
 etc/tutorials/TUTORIAL.es                          |    2 +-
 etc/tutorials/TUTORIAL.fr                          |    2 +-
 etc/tutorials/TUTORIAL.he                          |    2 +-
 etc/tutorials/TUTORIAL.it                          |    2 +-
 etc/tutorials/TUTORIAL.ja                          |    2 +-
 etc/tutorials/TUTORIAL.ko                          |    2 +-
 etc/tutorials/TUTORIAL.nl                          |    4 +-
 etc/tutorials/TUTORIAL.pl                          |    2 +-
 etc/tutorials/TUTORIAL.pt_BR                       |    2 +-
 etc/tutorials/TUTORIAL.ro                          |    4 +-
 etc/tutorials/TUTORIAL.ru                          |    2 +-
 etc/tutorials/TUTORIAL.sk                          |    2 +-
 etc/tutorials/TUTORIAL.sl                          |    2 +-
 etc/tutorials/TUTORIAL.sv                          |    2 +-
 etc/tutorials/TUTORIAL.th                          |    2 +-
 etc/tutorials/TUTORIAL.zh                          |    2 +-
 etc/w32-feature.el                                 |    2 +-
 leim/ChangeLog.1                                   |    2 +-
 leim/Makefile.in                                   |    2 +-
 leim/README                                        |    2 +-
 leim/leim-ext.el                                   |    2 +-
 lib-src/ChangeLog.1                                |    2 +-
 lib-src/Makefile.in                                |   11 +-
 lib-src/ebrowse.c                                  |    2 +-
 lib-src/emacsclient.c                              |   41 +-
 lib-src/etags.c                                    |   20 +-
 lib-src/hexl.c                                     |    2 +-
 lib-src/make-docfile.c                             |    2 +-
 lib-src/make-fingerprint.c                         |    2 +-
 lib-src/movemail.c                                 |    2 +-
 lib-src/ntlib.c                                    |    2 +-
 lib-src/ntlib.h                                    |    2 +-
 lib-src/pop.c                                      |    2 +-
 lib-src/pop.h                                      |    2 +-
 lib-src/rcs2log                                    |    4 +-
 lib-src/update-game-score.c                        |    6 +-
 lib/Makefile.in                                    |    8 +-
 lib/_Noreturn.h                                    |    2 +-
 lib/acl-errno-valid.c                              |    2 +-
 lib/acl-internal.c                                 |    2 +-
 lib/acl-internal.h                                 |    2 +-
 lib/acl.h                                          |    2 +-
 lib/acl_entries.c                                  |    2 +-
 lib/alloca.in.h                                    |    2 +-
 lib/allocator.h                                    |    2 +-
 lib/arg-nonnull.h                                  |    2 +-
 lib/at-func.c                                      |    2 +-
 lib/attribute.h                                    |   25 +-
 lib/binary-io.c                                    |    2 +-
 lib/binary-io.h                                    |    2 +-
 lib/byteswap.in.h                                  |    2 +-
 lib/c++defs.h                                      |   10 +-
 lib/c-ctype.h                                      |    2 +-
 lib/c-strcase.h                                    |    2 +-
 lib/c-strcasecmp.c                                 |    2 +-
 lib/c-strncasecmp.c                                |    2 +-
 lib/canonicalize-lgpl.c                            |  495 ++-
 lib/careadlinkat.c                                 |   32 +-
 lib/careadlinkat.h                                 |    2 +-
 lib/cdefs.h                                        |    6 +-
 lib/cloexec.c                                      |    2 +-
 lib/cloexec.h                                      |    2 +-
 lib/close-stream.c                                 |    2 +-
 lib/copy-file-range.c                              |    2 +-
 lib/count-leading-zeros.h                          |    2 +-
 lib/count-one-bits.h                               |    2 +-
 lib/count-trailing-zeros.h                         |    2 +-
 lib/diffseq.h                                      |    2 +-
 lib/dirent.in.h                                    |    2 +-
 lib/dirfd.c                                        |    2 +-
 lib/dtotimespec.c                                  |    2 +-
 lib/dup2.c                                         |    2 +-
 lib/eloop-threshold.h                              |   83 +
 lib/errno.in.h                                     |    2 +-
 lib/euidaccess.c                                   |   11 +-
 lib/execinfo.in.h                                  |    2 +-
 lib/explicit_bzero.c                               |    2 +-
 lib/faccessat.c                                    |    2 +-
 lib/fchmodat.c                                     |    2 +-
 lib/fcntl.c                                        |    6 +-
 lib/fcntl.in.h                                     |   39 +-
 lib/fdopendir.c                                    |    2 +-
 lib/filemode.c                                     |   16 +-
 lib/filemode.h                                     |    2 +-
 lib/filename.h                                     |   22 +-
 lib/filevercmp.c                                   |    2 +-
 lib/filevercmp.h                                   |    2 +-
 lib/fingerprint.c                                  |    2 +-
 lib/fingerprint.h                                  |    2 +-
 lib/flexmember.h                                   |    2 +-
 lib/fpending.c                                     |    9 +-
 lib/fpending.h                                     |    2 +-
 lib/{fpending.h => free.c}                         |   30 +-
 lib/fstatat.c                                      |    2 +-
 lib/fsusage.c                                      |    2 +-
 lib/fsusage.h                                      |    2 +-
 lib/fsync.c                                        |    2 +-
 lib/ftoastr.c                                      |    2 +-
 lib/ftoastr.h                                      |    2 +-
 lib/futimens.c                                     |    2 +-
 lib/get-permissions.c                              |    2 +-
 lib/getdtablesize.c                                |    2 +-
 lib/getgroups.c                                    |    2 +-
 lib/getloadavg.c                                   |    2 +-
 lib/getopt-cdefs.in.h                              |    2 +-
 lib/getopt-core.h                                  |    2 +-
 lib/getopt-ext.h                                   |    2 +-
 lib/getopt-pfx-core.h                              |    2 +-
 lib/getopt-pfx-ext.h                               |    2 +-
 lib/getopt.c                                       |    2 +-
 lib/getopt.in.h                                    |    2 +-
 lib/getopt1.c                                      |    2 +-
 lib/getopt_int.h                                   |    2 +-
 lib/getrandom.c                                    |    2 +-
 lib/gettext.h                                      |    2 +-
 lib/gettime.c                                      |    2 +-
 lib/gettimeofday.c                                 |    2 +-
 lib/gnulib.mk.in                                   |  218 +-
 lib/group-member.c                                 |    2 +-
 lib/idx.h                                          |  114 +
 lib/ieee754.in.h                                   |    2 +-
 lib/ignore-value.h                                 |    2 +-
 lib/intprops.h                                     |   52 +-
 lib/inttypes.in.h                                  |    2 +-
 lib/lchmod.c                                       |    2 +-
 lib/libc-config.h                                  |    2 +-
 lib/limits.in.h                                    |    2 +-
 lib/lstat.c                                        |    2 +-
 lib/malloc/scratch_buffer.h                        |  151 +
 lib/malloc/scratch_buffer_dupfree.c                |   41 +
 lib/malloc/scratch_buffer_grow.c                   |   56 +
 lib/malloc/scratch_buffer_grow_preserve.c          |   67 +
 lib/malloc/scratch_buffer_set_array_size.c         |   64 +
 lib/malloca.c                                      |    3 +-
 lib/malloca.h                                      |    2 +-
 lib/md5.c                                          |    2 +-
 lib/md5.h                                          |    2 +-
 lib/memmem.c                                       |    2 +-
 lib/mempcpy.c                                      |    2 +-
 lib/memrchr.c                                      |    2 +-
 lib/mini-gmp-gnulib.c                              |    2 +-
 lib/mini-gmp.c                                     |   58 +-
 lib/mini-gmp.h                                     |    5 +-
 lib/minmax.h                                       |    2 +-
 lib/mkostemp.c                                     |    2 +-
 lib/mktime.c                                       |    2 +-
 lib/nstrftime.c                                    |    2 +-
 lib/open.c                                         |    2 +-
 lib/openat-priv.h                                  |    2 +-
 lib/openat-proc.c                                  |    2 +-
 lib/openat.h                                       |    2 +-
 lib/pathmax.h                                      |    2 +-
 lib/pipe2.c                                        |    2 +-
 lib/pselect.c                                      |    2 +-
 lib/pthread_sigmask.c                              |    2 +-
 lib/qcopy-acl.c                                    |    2 +-
 lib/{memrchr.c => rawmemchr.c}                     |  107 +-
 lib/rawmemchr.valgrind                             |   28 +
 lib/readlink.c                                     |   50 +-
 lib/readlinkat.c                                   |   49 +-
 lib/regcomp.c                                      |    2 +-
 lib/regex.h                                        |    2 +-
 lib/regex_internal.c                               |   21 +-
 lib/regex_internal.h                               |   10 +-
 lib/root-uid.h                                     |    2 +-
 lib/save-cwd.c                                     |    2 +-
 lib/save-cwd.h                                     |    2 +-
 lib/{strtoll.c => scratch_buffer.h}                |   26 +-
 lib/set-permissions.c                              |    2 +-
 lib/sha1.c                                         |    2 +-
 lib/sha1.h                                         |    2 +-
 lib/sha256.c                                       |    2 +-
 lib/sha256.h                                       |    2 +-
 lib/sha512.c                                       |    2 +-
 lib/sha512.h                                       |    2 +-
 lib/sig2str.c                                      |    2 +-
 lib/sig2str.h                                      |    2 +-
 lib/sigdescr_np.c                                  |    2 +-
 lib/signal.in.h                                    |    8 +-
 lib/stat-time.h                                    |    2 +-
 lib/stdalign.in.h                                  |    2 +-
 lib/stddef.in.h                                    |    2 +-
 lib/stdint.in.h                                    |    7 +-
 lib/stdio-impl.h                                   |    4 +-
 lib/stdio.in.h                                     |  205 +-
 lib/stdlib.in.h                                    |  187 +-
 lib/stpcpy.c                                       |    2 +-
 lib/str-two-way.h                                  |    2 +-
 lib/strftime.h                                     |    2 +-
 lib/string.in.h                                    |   42 +-
 lib/strnlen.c                                      |    2 +-
 lib/strtoimax.c                                    |    2 +-
 lib/strtol.c                                       |    2 +-
 lib/strtoll.c                                      |    2 +-
 lib/symlink.c                                      |    4 +-
 lib/sys_random.in.h                                |    2 +-
 lib/sys_select.in.h                                |   11 +-
 lib/sys_stat.in.h                                  |   91 +-
 lib/sys_time.in.h                                  |    2 +-
 lib/sys_types.in.h                                 |    2 +-
 lib/tempname.c                                     |   51 +-
 lib/tempname.h                                     |    2 +-
 lib/time-internal.h                                |    2 +-
 lib/time.in.h                                      |   25 +-
 lib/time_r.c                                       |    2 +-
 lib/time_rz.c                                      |   18 +-
 lib/timespec-add.c                                 |    2 +-
 lib/timespec-sub.c                                 |    2 +-
 lib/timespec.h                                     |    2 +-
 lib/u64.h                                          |    2 +-
 lib/unistd.in.h                                    |  563 ++-
 lib/unlocked-io.h                                  |    2 +-
 lib/utimens.c                                      |    2 +-
 lib/utimens.h                                      |    2 +-
 lib/utimensat.c                                    |    2 +-
 lib/verify.h                                       |    2 +-
 lib/vla.h                                          |    2 +-
 lib/warn-on-use.h                                  |    2 +-
 lib/xalloc-oversized.h                             |    4 +-
 lisp/ChangeLog.1                                   |    2 +-
 lisp/ChangeLog.10                                  |    2 +-
 lisp/ChangeLog.11                                  |    2 +-
 lisp/ChangeLog.12                                  |    2 +-
 lisp/ChangeLog.13                                  |    2 +-
 lisp/ChangeLog.14                                  |    2 +-
 lisp/ChangeLog.15                                  |    2 +-
 lisp/ChangeLog.16                                  |    2 +-
 lisp/ChangeLog.17                                  |    2 +-
 lisp/ChangeLog.2                                   |    2 +-
 lisp/ChangeLog.3                                   |    2 +-
 lisp/ChangeLog.4                                   |    2 +-
 lisp/ChangeLog.5                                   |    2 +-
 lisp/ChangeLog.6                                   |    2 +-
 lisp/ChangeLog.7                                   |    2 +-
 lisp/ChangeLog.8                                   |    2 +-
 lisp/ChangeLog.9                                   |    2 +-
 lisp/Makefile.in                                   |    2 +-
 lisp/abbrev.el                                     |    2 +-
 lisp/align.el                                      |  160 +-
 lisp/allout-widgets.el                             |    4 +-
 lisp/allout.el                                     |    2 +-
 lisp/ansi-color.el                                 |    2 +-
 lisp/apropos.el                                    |    6 +-
 lisp/arc-mode.el                                   |    2 +-
 lisp/array.el                                      |   60 +-
 lisp/auth-source-pass.el                           |    2 +-
 lisp/auth-source.el                                |   47 +-
 lisp/autoarg.el                                    |    2 +-
 lisp/autoinsert.el                                 |    2 +-
 lisp/autorevert.el                                 |    2 +-
 lisp/avoid.el                                      |    2 +-
 lisp/battery.el                                    |   12 +-
 lisp/bindings.el                                   |    2 +-
 lisp/bookmark.el                                   |    5 +-
 lisp/bs.el                                         |    2 +-
 lisp/buff-menu.el                                  |    6 +-
 lisp/button.el                                     |   16 +-
 lisp/calc/calc-aent.el                             |    2 +-
 lisp/calc/calc-alg.el                              |    2 +-
 lisp/calc/calc-arith.el                            |    2 +-
 lisp/calc/calc-bin.el                              |   50 +-
 lisp/calc/calc-comb.el                             |    2 +-
 lisp/calc/calc-cplx.el                             |    2 +-
 lisp/calc/calc-embed.el                            |    2 +-
 lisp/calc/calc-ext.el                              |    2 +-
 lisp/calc/calc-fin.el                              |    2 +-
 lisp/calc/calc-forms.el                            |    2 +-
 lisp/calc/calc-frac.el                             |    2 +-
 lisp/calc/calc-funcs.el                            |    2 +-
 lisp/calc/calc-graph.el                            |    4 +-
 lisp/calc/calc-help.el                             |    2 +-
 lisp/calc/calc-incom.el                            |    2 +-
 lisp/calc/calc-keypd.el                            |    2 +-
 lisp/calc/calc-lang.el                             |    2 +-
 lisp/calc/calc-macs.el                             |    2 +-
 lisp/calc/calc-map.el                              |    2 +-
 lisp/calc/calc-math.el                             |    2 +-
 lisp/calc/calc-menu.el                             |    2 +-
 lisp/calc/calc-misc.el                             |    2 +-
 lisp/calc/calc-mode.el                             |    2 +-
 lisp/calc/calc-mtx.el                              |    2 +-
 lisp/calc/calc-nlfit.el                            |    2 +-
 lisp/calc/calc-poly.el                             |    2 +-
 lisp/calc/calc-prog.el                             |    2 +-
 lisp/calc/calc-rewr.el                             |    2 +-
 lisp/calc/calc-rules.el                            |    2 +-
 lisp/calc/calc-sel.el                              |    2 +-
 lisp/calc/calc-stat.el                             |    2 +-
 lisp/calc/calc-store.el                            |    2 +-
 lisp/calc/calc-stuff.el                            |    2 +-
 lisp/calc/calc-trail.el                            |    2 +-
 lisp/calc/calc-undo.el                             |    2 +-
 lisp/calc/calc-units.el                            |    4 +-
 lisp/calc/calc-vec.el                              |    2 +-
 lisp/calc/calc-yank.el                             |    2 +-
 lisp/calc/calc.el                                  |   13 +-
 lisp/calc/calcalg2.el                              |    2 +-
 lisp/calc/calcalg3.el                              |    2 +-
 lisp/calc/calccomp.el                              |    2 +-
 lisp/calc/calcsel2.el                              |    2 +-
 lisp/calculator.el                                 |    2 +-
 lisp/calendar/appt.el                              |    2 +-
 lisp/calendar/cal-bahai.el                         |    2 +-
 lisp/calendar/cal-china.el                         |    2 +-
 lisp/calendar/cal-coptic.el                        |    2 +-
 lisp/calendar/cal-dst.el                           |    2 +-
 lisp/calendar/cal-french.el                        |    2 +-
 lisp/calendar/cal-hebrew.el                        |    2 +-
 lisp/calendar/cal-html.el                          |    2 +-
 lisp/calendar/cal-islam.el                         |    2 +-
 lisp/calendar/cal-iso.el                           |    2 +-
 lisp/calendar/cal-julian.el                        |    2 +-
 lisp/calendar/cal-mayan.el                         |    2 +-
 lisp/calendar/cal-menu.el                          |    2 +-
 lisp/calendar/cal-move.el                          |    2 +-
 lisp/calendar/cal-persia.el                        |    2 +-
 lisp/calendar/cal-tex.el                           |    2 +-
 lisp/calendar/cal-x.el                             |    2 +-
 lisp/calendar/calendar.el                          |    4 +-
 lisp/calendar/diary-lib.el                         |   49 +-
 lisp/calendar/holidays.el                          |    2 +-
 lisp/calendar/icalendar.el                         |    2 +-
 lisp/calendar/iso8601.el                           |    2 +-
 lisp/calendar/lunar.el                             |    2 +-
 lisp/calendar/parse-time.el                        |    2 +-
 lisp/calendar/solar.el                             |    2 +-
 lisp/calendar/time-date.el                         |    2 +-
 lisp/calendar/timeclock.el                         |    2 +-
 lisp/calendar/todo-mode.el                         |   29 +-
 lisp/case-table.el                                 |    2 +-
 lisp/cdl.el                                        |    2 +-
 lisp/cedet/ChangeLog.1                             |    2 +-
 lisp/cedet/cedet-cscope.el                         |    2 +-
 lisp/cedet/cedet-files.el                          |    2 +-
 lisp/cedet/cedet-global.el                         |    2 +-
 lisp/cedet/cedet-idutils.el                        |    2 +-
 lisp/cedet/cedet.el                                |    2 +-
 lisp/cedet/data-debug.el                           |    2 +-
 lisp/cedet/ede.el                                  |    2 +-
 lisp/cedet/ede/auto.el                             |    2 +-
 lisp/cedet/ede/autoconf-edit.el                    |    2 +-
 lisp/cedet/ede/base.el                             |    2 +-
 lisp/cedet/ede/config.el                           |    2 +-
 lisp/cedet/ede/cpp-root.el                         |    2 +-
 lisp/cedet/ede/custom.el                           |    2 +-
 lisp/cedet/ede/detect.el                           |    2 +-
 lisp/cedet/ede/dired.el                            |    2 +-
 lisp/cedet/ede/emacs.el                            |    2 +-
 lisp/cedet/ede/files.el                            |    2 +-
 lisp/cedet/ede/generic.el                          |    6 +-
 lisp/cedet/ede/linux.el                            |    2 +-
 lisp/cedet/ede/locate.el                           |    2 +-
 lisp/cedet/ede/make.el                             |    2 +-
 lisp/cedet/ede/makefile-edit.el                    |    2 +-
 lisp/cedet/ede/pconf.el                            |    2 +-
 lisp/cedet/ede/pmake.el                            |    2 +-
 lisp/cedet/ede/proj-archive.el                     |    2 +-
 lisp/cedet/ede/proj-aux.el                         |    2 +-
 lisp/cedet/ede/proj-comp.el                        |    2 +-
 lisp/cedet/ede/proj-elisp.el                       |    5 +-
 lisp/cedet/ede/proj-info.el                        |    2 +-
 lisp/cedet/ede/proj-misc.el                        |    2 +-
 lisp/cedet/ede/proj-obj.el                         |    2 +-
 lisp/cedet/ede/proj-prog.el                        |    2 +-
 lisp/cedet/ede/proj-scheme.el                      |    2 +-
 lisp/cedet/ede/proj-shared.el                      |    2 +-
 lisp/cedet/ede/proj.el                             |    2 +-
 lisp/cedet/ede/project-am.el                       |    2 +-
 lisp/cedet/ede/shell.el                            |    2 +-
 lisp/cedet/ede/simple.el                           |    2 +-
 lisp/cedet/ede/source.el                           |    2 +-
 lisp/cedet/ede/speedbar.el                         |    2 +-
 lisp/cedet/ede/srecode.el                          |    2 +-
 lisp/cedet/ede/system.el                           |    2 +-
 lisp/cedet/ede/util.el                             |    2 +-
 lisp/cedet/inversion.el                            |    2 +-
 lisp/cedet/mode-local.el                           |    2 +-
 lisp/cedet/pulse.el                                |    2 +-
 lisp/cedet/semantic.el                             |    2 +-
 lisp/cedet/semantic/analyze.el                     |    8 +-
 lisp/cedet/semantic/analyze/complete.el            |    2 +-
 lisp/cedet/semantic/analyze/debug.el               |    2 +-
 lisp/cedet/semantic/analyze/fcn.el                 |    2 +-
 lisp/cedet/semantic/analyze/refs.el                |    8 +-
 lisp/cedet/semantic/bovine.el                      |    2 +-
 lisp/cedet/semantic/bovine/c.el                    |    5 +-
 lisp/cedet/semantic/bovine/debug.el                |    2 +-
 lisp/cedet/semantic/bovine/el.el                   |    2 +-
 lisp/cedet/semantic/bovine/gcc.el                  |    2 +-
 lisp/cedet/semantic/bovine/grammar.el              |    2 +-
 lisp/cedet/semantic/bovine/make.el                 |    5 +-
 lisp/cedet/semantic/bovine/scm.el                  |    2 +-
 lisp/cedet/semantic/chart.el                       |    2 +-
 lisp/cedet/semantic/complete.el                    |    2 +-
 lisp/cedet/semantic/ctxt.el                        |    2 +-
 lisp/cedet/semantic/db-debug.el                    |    2 +-
 lisp/cedet/semantic/db-ebrowse.el                  |    2 +-
 lisp/cedet/semantic/db-el.el                       |    2 +-
 lisp/cedet/semantic/db-file.el                     |    2 +-
 lisp/cedet/semantic/db-find.el                     |    2 +-
 lisp/cedet/semantic/db-global.el                   |    2 +-
 lisp/cedet/semantic/db-javascript.el               |    2 +-
 lisp/cedet/semantic/db-mode.el                     |    2 +-
 lisp/cedet/semantic/db-ref.el                      |    2 +-
 lisp/cedet/semantic/db-typecache.el                |    4 +-
 lisp/cedet/semantic/db.el                          |    2 +-
 lisp/cedet/semantic/debug.el                       |    2 +-
 lisp/cedet/semantic/decorate.el                    |    2 +-
 lisp/cedet/semantic/decorate/include.el            |    2 +-
 lisp/cedet/semantic/decorate/mode.el               |    2 +-
 lisp/cedet/semantic/dep.el                         |    2 +-
 lisp/cedet/semantic/doc.el                         |    4 +-
 lisp/cedet/semantic/ede-grammar.el                 |    2 +-
 lisp/cedet/semantic/edit.el                        |    2 +-
 lisp/cedet/semantic/find.el                        |    2 +-
 lisp/cedet/semantic/format.el                      |    2 +-
 lisp/cedet/semantic/fw.el                          |    2 +-
 lisp/cedet/semantic/grammar-wy.el                  |    2 +-
 lisp/cedet/semantic/grammar.el                     |    2 +-
 lisp/cedet/semantic/html.el                        |    2 +-
 lisp/cedet/semantic/ia-sb.el                       |    2 +-
 lisp/cedet/semantic/ia.el                          |    2 +-
 lisp/cedet/semantic/idle.el                        |    2 +-
 lisp/cedet/semantic/imenu.el                       |    5 +-
 lisp/cedet/semantic/java.el                        |    2 +-
 lisp/cedet/semantic/lex-spp.el                     |    2 +-
 lisp/cedet/semantic/lex.el                         |    2 +-
 lisp/cedet/semantic/mru-bookmark.el                |    2 +-
 lisp/cedet/semantic/sb.el                          |    2 +-
 lisp/cedet/semantic/scope.el                       |    2 +-
 lisp/cedet/semantic/senator.el                     |    4 +-
 lisp/cedet/semantic/sort.el                        |    2 +-
 lisp/cedet/semantic/symref.el                      |    9 +-
 lisp/cedet/semantic/symref/cscope.el               |    2 +-
 lisp/cedet/semantic/symref/filter.el               |    2 +-
 lisp/cedet/semantic/symref/global.el               |    2 +-
 lisp/cedet/semantic/symref/grep.el                 |    2 +-
 lisp/cedet/semantic/symref/idutils.el              |    2 +-
 lisp/cedet/semantic/symref/list.el                 |    2 +-
 lisp/cedet/semantic/tag-file.el                    |    2 +-
 lisp/cedet/semantic/tag-ls.el                      |    7 +-
 lisp/cedet/semantic/tag-write.el                   |    2 +-
 lisp/cedet/semantic/tag.el                         |    2 +-
 lisp/cedet/semantic/texi.el                        |    2 +-
 lisp/cedet/semantic/util-modes.el                  |    5 +-
 lisp/cedet/semantic/util.el                        |    2 +-
 lisp/cedet/semantic/wisent.el                      |    2 +-
 lisp/cedet/semantic/wisent/comp.el                 |    2 +-
 lisp/cedet/semantic/wisent/grammar.el              |    2 +-
 lisp/cedet/semantic/wisent/java-tags.el            |    2 +-
 lisp/cedet/semantic/wisent/javascript.el           |    2 +-
 lisp/cedet/semantic/wisent/python.el               |    2 +-
 lisp/cedet/semantic/wisent/wisent.el               |    2 +-
 lisp/cedet/srecode.el                              |    2 +-
 lisp/cedet/srecode/args.el                         |    2 +-
 lisp/cedet/srecode/compile.el                      |    2 +-
 lisp/cedet/srecode/cpp.el                          |    2 +-
 lisp/cedet/srecode/ctxt.el                         |    2 +-
 lisp/cedet/srecode/dictionary.el                   |    2 +-
 lisp/cedet/srecode/document.el                     |    2 +-
 lisp/cedet/srecode/el.el                           |    2 +-
 lisp/cedet/srecode/expandproto.el                  |    2 +-
 lisp/cedet/srecode/extract.el                      |    2 +-
 lisp/cedet/srecode/fields.el                       |    2 +-
 lisp/cedet/srecode/filters.el                      |    2 +-
 lisp/cedet/srecode/find.el                         |    2 +-
 lisp/cedet/srecode/getset.el                       |    2 +-
 lisp/cedet/srecode/insert.el                       |    2 +-
 lisp/cedet/srecode/java.el                         |    2 +-
 lisp/cedet/srecode/map.el                          |    2 +-
 lisp/cedet/srecode/mode.el                         |    2 +-
 lisp/cedet/srecode/semantic.el                     |    2 +-
 lisp/cedet/srecode/srt-mode.el                     |    2 +-
 lisp/cedet/srecode/srt.el                          |    2 +-
 lisp/cedet/srecode/table.el                        |    2 +-
 lisp/cedet/srecode/template.el                     |    2 +-
 lisp/cedet/srecode/texi.el                         |    2 +-
 lisp/char-fold.el                                  |    2 +-
 lisp/chistory.el                                   |    4 +-
 lisp/cmuscheme.el                                  |    2 +-
 lisp/color.el                                      |    2 +-
 lisp/comint.el                                     |   34 +-
 lisp/completion.el                                 |    2 +-
 lisp/composite.el                                  |    2 +-
 lisp/cus-dep.el                                    |    2 +-
 lisp/cus-edit.el                                   |   13 +-
 lisp/cus-face.el                                   |    2 +-
 lisp/cus-start.el                                  |    2 +-
 lisp/cus-theme.el                                  |    2 +-
 lisp/custom.el                                     |    2 +-
 lisp/dabbrev.el                                    |   12 +-
 lisp/delim-col.el                                  |    2 +-
 lisp/delsel.el                                     |    2 +-
 lisp/descr-text.el                                 |    2 +-
 lisp/desktop.el                                    |   10 +-
 lisp/dframe.el                                     |   10 +-
 lisp/dired-aux.el                                  |   16 +-
 lisp/dired-x.el                                    |    6 +-
 lisp/dired.el                                      |   16 +-
 lisp/dirtrack.el                                   |    2 +-
 lisp/disp-table.el                                 |    2 +-
 lisp/display-fill-column-indicator.el              |    2 +-
 lisp/display-line-numbers.el                       |    2 +-
 lisp/dnd.el                                        |    2 +-
 lisp/doc-view.el                                   |    5 +-
 lisp/dom.el                                        |    2 +-
 lisp/dos-fns.el                                    |    2 +-
 lisp/dos-vars.el                                   |    2 +-
 lisp/dos-w32.el                                    |    2 +-
 lisp/double.el                                     |    2 +-
 lisp/dynamic-setting.el                            |    2 +-
 lisp/ebuff-menu.el                                 |    9 +-
 lisp/echistory.el                                  |    2 +-
 lisp/ecomplete.el                                  |    2 +-
 lisp/edmacro.el                                    |    8 +-
 lisp/ehelp.el                                      |    2 +-
 lisp/elec-pair.el                                  |    2 +-
 lisp/electric.el                                   |    2 +-
 lisp/elide-head.el                                 |    2 +-
 lisp/emacs-lisp/advice.el                          |    7 +-
 lisp/emacs-lisp/autoload.el                        |    5 +-
 lisp/emacs-lisp/avl-tree.el                        |    2 +-
 lisp/emacs-lisp/backquote.el                       |    2 +-
 lisp/emacs-lisp/backtrace.el                       |    2 +-
 lisp/emacs-lisp/benchmark.el                       |    2 +-
 lisp/emacs-lisp/bindat.el                          |    2 +-
 lisp/emacs-lisp/byte-opt.el                        |    6 +-
 lisp/emacs-lisp/byte-run.el                        |    2 +-
 lisp/emacs-lisp/bytecomp.el                        |  241 +-
 lisp/emacs-lisp/cconv.el                           |    2 +-
 lisp/emacs-lisp/chart.el                           |    5 +-
 lisp/emacs-lisp/check-declare.el                   |    2 +-
 lisp/emacs-lisp/checkdoc.el                        |    2 +-
 lisp/emacs-lisp/cl-extra.el                        |    2 +-
 lisp/emacs-lisp/cl-generic.el                      |   20 +-
 lisp/emacs-lisp/cl-indent.el                       |    2 +-
 lisp/emacs-lisp/cl-lib.el                          |    2 +-
 lisp/emacs-lisp/cl-macs.el                         |    7 +-
 lisp/emacs-lisp/cl-preloaded.el                    |    2 +-
 lisp/emacs-lisp/cl-print.el                        |    2 +-
 lisp/emacs-lisp/cl-seq.el                          |    2 +-
 lisp/emacs-lisp/copyright.el                       |    2 +-
 lisp/emacs-lisp/crm.el                             |    2 +-
 lisp/emacs-lisp/cursor-sensor.el                   |    2 +-
 lisp/emacs-lisp/debug.el                           |    2 +-
 lisp/emacs-lisp/derived.el                         |   44 +-
 lisp/emacs-lisp/disass.el                          |    2 +-
 lisp/emacs-lisp/easy-mmode.el                      |   41 +-
 lisp/emacs-lisp/easymenu.el                        |    2 +-
 lisp/emacs-lisp/edebug.el                          |    4 +-
 lisp/emacs-lisp/eieio-base.el                      |    2 +-
 lisp/emacs-lisp/eieio-compat.el                    |    2 +-
 lisp/emacs-lisp/eieio-core.el                      |    6 +-
 lisp/emacs-lisp/eieio-custom.el                    |    2 +-
 lisp/emacs-lisp/eieio-datadebug.el                 |    2 +-
 lisp/emacs-lisp/eieio-opt.el                       |    6 +-
 lisp/emacs-lisp/eieio-speedbar.el                  |    2 +-
 lisp/emacs-lisp/eieio.el                           |    2 +-
 lisp/emacs-lisp/eldoc.el                           |    9 +-
 lisp/emacs-lisp/elint.el                           |   14 +-
 lisp/emacs-lisp/elp.el                             |    2 +-
 lisp/emacs-lisp/ert-x.el                           |    2 +-
 lisp/emacs-lisp/ert.el                             |    4 +-
 lisp/emacs-lisp/ewoc.el                            |    2 +-
 lisp/emacs-lisp/faceup.el                          |    2 +-
 lisp/emacs-lisp/find-func.el                       |   69 +-
 lisp/emacs-lisp/float-sup.el                       |    2 +-
 lisp/emacs-lisp/generator.el                       |    2 +-
 lisp/emacs-lisp/generic.el                         |    2 +-
 lisp/emacs-lisp/gv.el                              |    7 +-
 lisp/emacs-lisp/helper.el                          |    2 +-
 lisp/emacs-lisp/hierarchy.el                       |    2 +-
 lisp/emacs-lisp/inline.el                          |    2 +-
 lisp/emacs-lisp/let-alist.el                       |    2 +-
 lisp/emacs-lisp/lisp-mnt.el                        |    4 +-
 lisp/emacs-lisp/lisp-mode.el                       |   10 +-
 lisp/emacs-lisp/lisp.el                            |    2 +-
 lisp/emacs-lisp/macroexp.el                        |    2 +-
 lisp/emacs-lisp/map-ynp.el                         |    2 +-
 lisp/emacs-lisp/map.el                             |    2 +-
 lisp/emacs-lisp/memory-report.el                   |  317 ++
 lisp/emacs-lisp/nadvice.el                         |    2 +-
 lisp/emacs-lisp/package-x.el                       |    2 +-
 lisp/emacs-lisp/package.el                         |  107 +-
 lisp/emacs-lisp/pcase.el                           |    5 +-
 lisp/emacs-lisp/pp.el                              |    2 +-
 lisp/emacs-lisp/radix-tree.el                      |    2 +-
 lisp/emacs-lisp/re-builder.el                      |    2 +-
 lisp/emacs-lisp/regexp-opt.el                      |    2 +-
 lisp/emacs-lisp/regi.el                            |    2 +-
 lisp/emacs-lisp/ring.el                            |    2 +-
 lisp/emacs-lisp/rmc.el                             |    2 +-
 lisp/emacs-lisp/rx.el                              |    2 +-
 lisp/emacs-lisp/seq.el                             |    9 +-
 lisp/emacs-lisp/shadow.el                          |    2 +-
 lisp/emacs-lisp/shortdoc.el                        |   32 +-
 lisp/emacs-lisp/smie.el                            |    2 +-
 lisp/emacs-lisp/subr-x.el                          |   98 +-
 lisp/emacs-lisp/syntax.el                          |    2 +-
 lisp/emacs-lisp/tabulated-list.el                  |    2 +-
 lisp/emacs-lisp/tcover-ses.el                      |    2 +-
 lisp/emacs-lisp/testcover.el                       |    2 +-
 lisp/emacs-lisp/text-property-search.el            |    2 +-
 lisp/emacs-lisp/thunk.el                           |    4 +-
 lisp/emacs-lisp/timer-list.el                      |    2 +-
 lisp/emacs-lisp/timer.el                           |    2 +-
 lisp/emacs-lisp/tq.el                              |    2 +-
 lisp/emacs-lisp/trace.el                           |    2 +-
 lisp/emacs-lisp/unsafep.el                         |    2 +-
 lisp/emacs-lisp/warnings.el                        |    9 +-
 lisp/emacs-lock.el                                 |    2 +-
 lisp/emulation/cua-base.el                         |   12 +-
 lisp/emulation/cua-gmrk.el                         |    2 +-
 lisp/emulation/cua-rect.el                         |    2 +-
 lisp/emulation/edt-lk201.el                        |    2 +-
 lisp/emulation/edt-mapper.el                       |    2 +-
 lisp/emulation/edt-pc.el                           |    2 +-
 lisp/emulation/edt-vt100.el                        |    2 +-
 lisp/emulation/edt.el                              |   14 +-
 lisp/emulation/keypad.el                           |    2 +-
 lisp/emulation/viper-cmd.el                        |    2 +-
 lisp/emulation/viper-ex.el                         |    2 +-
 lisp/emulation/viper-init.el                       |    7 +-
 lisp/emulation/viper-keym.el                       |    4 +-
 lisp/emulation/viper-macs.el                       |    2 +-
 lisp/emulation/viper-mous.el                       |    2 +-
 lisp/emulation/viper-util.el                       |    2 +-
 lisp/emulation/viper.el                            |    2 +-
 lisp/env.el                                        |    2 +-
 lisp/epa-dired.el                                  |    2 +-
 lisp/epa-file.el                                   |    5 +-
 lisp/epa-hook.el                                   |    2 +-
 lisp/epa-mail.el                                   |    4 +-
 lisp/epa.el                                        |    2 +-
 lisp/epg-config.el                                 |    2 +-
 lisp/epg.el                                        |    9 +-
 lisp/erc/ChangeLog.1                               |    2 +-
 lisp/erc/ChangeLog.2                               |    2 +-
 lisp/erc/erc-autoaway.el                           |    2 +-
 lisp/erc/erc-backend.el                            |    2 +-
 lisp/erc/erc-button.el                             |    3 +-
 lisp/erc/erc-capab.el                              |    2 +-
 lisp/erc/erc-dcc.el                                |    5 +-
 lisp/erc/erc-desktop-notifications.el              |    2 +-
 lisp/erc/erc-ezbounce.el                           |    2 +-
 lisp/erc/erc-fill.el                               |    2 +-
 lisp/erc/erc-goodies.el                            |    2 +-
 lisp/erc/erc-ibuffer.el                            |    2 +-
 lisp/erc/erc-identd.el                             |    2 +-
 lisp/erc/erc-imenu.el                              |    2 +-
 lisp/erc/erc-join.el                               |    2 +-
 lisp/erc/erc-lang.el                               |    2 +-
 lisp/erc/erc-list.el                               |    2 +-
 lisp/erc/erc-log.el                                |    2 +-
 lisp/erc/erc-match.el                              |    2 +-
 lisp/erc/erc-menu.el                               |    2 +-
 lisp/erc/erc-netsplit.el                           |    2 +-
 lisp/erc/erc-networks.el                           |    2 +-
 lisp/erc/erc-notify.el                             |    2 +-
 lisp/erc/erc-page.el                               |    2 +-
 lisp/erc/erc-pcomplete.el                          |    2 +-
 lisp/erc/erc-replace.el                            |    2 +-
 lisp/erc/erc-ring.el                               |    2 +-
 lisp/erc/erc-services.el                           |    2 +-
 lisp/erc/erc-sound.el                              |    2 +-
 lisp/erc/erc-speedbar.el                           |    2 +-
 lisp/erc/erc-spelling.el                           |    2 +-
 lisp/erc/erc-stamp.el                              |    2 +-
 lisp/erc/erc-status-sidebar.el                     |    2 +-
 lisp/erc/erc-track.el                              |    2 +-
 lisp/erc/erc-truncate.el                           |    2 +-
 lisp/erc/erc-xdcc.el                               |    2 +-
 lisp/erc/erc.el                                    |    6 +-
 lisp/eshell/em-alias.el                            |    2 +-
 lisp/eshell/em-banner.el                           |    2 +-
 lisp/eshell/em-basic.el                            |    2 +-
 lisp/eshell/em-cmpl.el                             |    2 +-
 lisp/eshell/em-dirs.el                             |    2 +-
 lisp/eshell/em-glob.el                             |    2 +-
 lisp/eshell/em-hist.el                             |    2 +-
 lisp/eshell/em-ls.el                               |    8 +-
 lisp/eshell/em-pred.el                             |    2 +-
 lisp/eshell/em-prompt.el                           |    2 +-
 lisp/eshell/em-rebind.el                           |    2 +-
 lisp/eshell/em-script.el                           |    2 +-
 lisp/eshell/em-smart.el                            |    2 +-
 lisp/eshell/em-term.el                             |    2 +-
 lisp/eshell/em-tramp.el                            |    2 +-
 lisp/eshell/em-unix.el                             |    5 +-
 lisp/eshell/em-xtra.el                             |    2 +-
 lisp/eshell/esh-arg.el                             |    2 +-
 lisp/eshell/esh-cmd.el                             |    2 +-
 lisp/eshell/esh-ext.el                             |    2 +-
 lisp/eshell/esh-io.el                              |    2 +-
 lisp/eshell/esh-mode.el                            |    2 +-
 lisp/eshell/esh-module.el                          |    2 +-
 lisp/eshell/esh-opt.el                             |    2 +-
 lisp/eshell/esh-proc.el                            |    2 +-
 lisp/eshell/esh-util.el                            |    2 +-
 lisp/eshell/esh-var.el                             |    2 +-
 lisp/eshell/eshell.el                              |    2 +-
 lisp/expand.el                                     |    4 +-
 lisp/ezimage.el                                    |    2 +-
 lisp/face-remap.el                                 |   18 +-
 lisp/facemenu.el                                   |    2 +-
 lisp/faces.el                                      |    6 +-
 lisp/ffap.el                                       |    2 +-
 lisp/filecache.el                                  |    2 +-
 lisp/fileloop.el                                   |    2 +-
 lisp/filenotify.el                                 |    2 +-
 lisp/files-x.el                                    |    2 +-
 lisp/files.el                                      |   29 +-
 lisp/filesets.el                                   |    5 +-
 lisp/find-cmd.el                                   |    2 +-
 lisp/find-dired.el                                 |   17 +-
 lisp/find-file.el                                  |    2 +-
 lisp/find-lisp.el                                  |   32 +-
 lisp/finder.el                                     |    4 +-
 lisp/flow-ctrl.el                                  |    2 +-
 lisp/foldout.el                                    |    2 +-
 lisp/follow.el                                     |    2 +-
 lisp/font-core.el                                  |   10 +-
 lisp/font-lock.el                                  |   33 +-
 lisp/format-spec.el                                |  105 +-
 lisp/format.el                                     |    7 +-
 lisp/forms.el                                      |   65 +-
 lisp/frame.el                                      |    2 +-
 lisp/frameset.el                                   |    2 +-
 lisp/fringe.el                                     |    2 +-
 lisp/generic-x.el                                  |    2 +-
 lisp/gnus/ChangeLog.1                              |    2 +-
 lisp/gnus/ChangeLog.2                              |    2 +-
 lisp/gnus/ChangeLog.3                              |    2 +-
 lisp/gnus/canlock.el                               |    2 +-
 lisp/gnus/deuglify.el                              |   14 +-
 lisp/gnus/gmm-utils.el                             |    2 +-
 lisp/gnus/gnus-agent.el                            |   13 +-
 lisp/gnus/gnus-art.el                              |   43 +-
 lisp/gnus/gnus-async.el                            |    2 +-
 lisp/gnus/gnus-bcklg.el                            |    2 +-
 lisp/gnus/gnus-bookmark.el                         |    2 +-
 lisp/gnus/gnus-cache.el                            |    2 +-
 lisp/gnus/gnus-cite.el                             |    2 +-
 lisp/gnus/gnus-cloud.el                            |    2 +-
 lisp/gnus/gnus-cus.el                              |   36 +-
 lisp/gnus/gnus-dbus.el                             |    2 +-
 lisp/gnus/gnus-delay.el                            |    2 +-
 lisp/gnus/gnus-demon.el                            |    2 +-
 lisp/gnus/gnus-diary.el                            |    2 +-
 lisp/gnus/gnus-dired.el                            |    2 +-
 lisp/gnus/gnus-draft.el                            |    2 +-
 lisp/gnus/gnus-dup.el                              |    2 +-
 lisp/gnus/gnus-eform.el                            |    2 +-
 lisp/gnus/gnus-fun.el                              |    2 +-
 lisp/gnus/gnus-gravatar.el                         |    2 +-
 lisp/gnus/gnus-group.el                            |    9 +-
 lisp/gnus/gnus-html.el                             |    2 +-
 lisp/gnus/gnus-icalendar.el                        |    2 +-
 lisp/gnus/gnus-int.el                              |    2 +-
 lisp/gnus/gnus-kill.el                             |    2 +-
 lisp/gnus/gnus-logic.el                            |    2 +-
 lisp/gnus/gnus-mh.el                               |    2 +-
 lisp/gnus/gnus-ml.el                               |    2 +-
 lisp/gnus/gnus-mlspl.el                            |    2 +-
 lisp/gnus/gnus-msg.el                              |   23 +-
 lisp/gnus/gnus-notifications.el                    |    2 +-
 lisp/gnus/gnus-picon.el                            |    2 +-
 lisp/gnus/gnus-range.el                            |    2 +-
 lisp/gnus/gnus-registry.el                         |   74 +-
 lisp/gnus/gnus-rfc1843.el                          |    2 +-
 lisp/gnus/gnus-salt.el                             |   12 +-
 lisp/gnus/gnus-score.el                            |   10 +-
 lisp/gnus/gnus-search.el                           |  109 +-
 lisp/gnus/gnus-sieve.el                            |    2 +-
 lisp/gnus/gnus-spec.el                             |    2 +-
 lisp/gnus/gnus-srvr.el                             |    5 +-
 lisp/gnus/gnus-start.el                            |   15 +-
 lisp/gnus/gnus-sum.el                              |   83 +-
 lisp/gnus/gnus-topic.el                            |   25 +-
 lisp/gnus/gnus-undo.el                             |    6 +-
 lisp/gnus/gnus-util.el                             |    6 +-
 lisp/gnus/gnus-uu.el                               |   17 +-
 lisp/gnus/gnus-vm.el                               |    2 +-
 lisp/gnus/gnus-win.el                              |    6 +-
 lisp/gnus/gnus.el                                  |   63 +-
 lisp/gnus/gssapi.el                                |    2 +-
 lisp/gnus/legacy-gnus-agent.el                     |    2 +-
 lisp/gnus/mail-source.el                           |    2 +-
 lisp/gnus/message.el                               |   99 +-
 lisp/gnus/mm-archive.el                            |    2 +-
 lisp/gnus/mm-bodies.el                             |    2 +-
 lisp/gnus/mm-decode.el                             |    2 +-
 lisp/gnus/mm-encode.el                             |    2 +-
 lisp/gnus/mm-extern.el                             |    2 +-
 lisp/gnus/mm-partial.el                            |    2 +-
 lisp/gnus/mm-url.el                                |    2 +-
 lisp/gnus/mm-util.el                               |    2 +-
 lisp/gnus/mm-uu.el                                 |    2 +-
 lisp/gnus/mm-view.el                               |    4 +-
 lisp/gnus/mml-sec.el                               |    2 +-
 lisp/gnus/mml-smime.el                             |    2 +-
 lisp/gnus/mml.el                                   |    6 +-
 lisp/gnus/mml1991.el                               |    2 +-
 lisp/gnus/mml2015.el                               |    2 +-
 lisp/gnus/nnagent.el                               |    2 +-
 lisp/gnus/nnbabyl.el                               |    2 +-
 lisp/gnus/nndiary.el                               |   10 +-
 lisp/gnus/nndir.el                                 |    2 +-
 lisp/gnus/nndoc.el                                 |    2 +-
 lisp/gnus/nndraft.el                               |    2 +-
 lisp/gnus/nneething.el                             |    2 +-
 lisp/gnus/nnfolder.el                              |    8 +-
 lisp/gnus/nngateway.el                             |    2 +-
 lisp/gnus/nnheader.el                              |    4 +-
 lisp/gnus/nnimap.el                                |   10 +-
 lisp/gnus/nnmail.el                                |    7 +-
 lisp/gnus/nnmairix.el                              |    2 +-
 lisp/gnus/nnmbox.el                                |    2 +-
 lisp/gnus/nnmh.el                                  |    4 +-
 lisp/gnus/nnml.el                                  |    6 +-
 lisp/gnus/nnoo.el                                  |    2 +-
 lisp/gnus/nnregistry.el                            |    2 +-
 lisp/gnus/nnrss.el                                 |    2 +-
 lisp/gnus/nnselect.el                              |    2 +-
 lisp/gnus/nnspool.el                               |    2 +-
 lisp/gnus/nntp.el                                  |    9 +-
 lisp/gnus/nnvirtual.el                             |   19 +-
 lisp/gnus/nnweb.el                                 |    2 +-
 lisp/gnus/score-mode.el                            |    2 +-
 lisp/gnus/smiley.el                                |    2 +-
 lisp/gnus/smime.el                                 |    2 +-
 lisp/gnus/spam-report.el                           |    2 +-
 lisp/gnus/spam-stat.el                             |    2 +-
 lisp/gnus/spam-wash.el                             |    2 +-
 lisp/gnus/spam.el                                  |    2 +-
 lisp/help-at-pt.el                                 |    2 +-
 lisp/help-fns.el                                   |    7 +-
 lisp/help-macro.el                                 |    2 +-
 lisp/help-mode.el                                  |   10 +-
 lisp/help.el                                       |    2 +-
 lisp/hex-util.el                                   |    2 +-
 lisp/hexl.el                                       |   12 +-
 lisp/hfy-cmap.el                                   |    2 +-
 lisp/hi-lock.el                                    |    2 +-
 lisp/hilit-chg.el                                  |    2 +-
 lisp/hippie-exp.el                                 |    2 +-
 lisp/hl-line.el                                    |    2 +-
 lisp/htmlfontify.el                                |    2 +-
 lisp/ibuf-ext.el                                   |    2 +-
 lisp/ibuf-macs.el                                  |    2 +-
 lisp/ibuffer.el                                    |   49 +-
 lisp/icomplete.el                                  |   31 +-
 lisp/ido.el                                        |   20 +-
 lisp/ielm.el                                       |   30 +-
 lisp/iimage.el                                     |    2 +-
 lisp/image-dired.el                                |    2 +-
 lisp/image-file.el                                 |    2 +-
 lisp/image-mode.el                                 |   34 +-
 lisp/image.el                                      |   47 +-
 lisp/image/compface.el                             |    2 +-
 lisp/image/exif.el                                 |    4 +-
 lisp/image/gravatar.el                             |    2 +-
 lisp/image/image-converter.el                      |    2 +-
 lisp/imenu.el                                      |    2 +-
 lisp/indent.el                                     |    2 +-
 lisp/info-look.el                                  |    2 +-
 lisp/info-xref.el                                  |    2 +-
 lisp/info.el                                       |   26 +-
 lisp/informat.el                                   |    2 +-
 lisp/international/ccl.el                          |    2 +-
 lisp/international/characters.el                   |   87 +-
 lisp/international/fontset.el                      |    2 +-
 lisp/international/isearch-x.el                    |   16 +-
 lisp/international/iso-ascii.el                    |    2 +-
 lisp/international/iso-cvt.el                      |    2 +-
 lisp/international/iso-transl.el                   |    2 +-
 lisp/international/ja-dic-cnv.el                   |    2 +-
 lisp/international/kinsoku.el                      |    2 +-
 lisp/international/kkc.el                          |    2 +-
 lisp/international/latexenc.el                     |    2 +-
 lisp/international/latin1-disp.el                  |    2 +-
 lisp/international/mule-cmds.el                    |    4 +-
 lisp/international/mule-conf.el                    |   86 +-
 lisp/international/mule-diag.el                    |    2 +-
 lisp/international/mule-util.el                    |    2 +-
 lisp/international/mule.el                         |   11 +-
 lisp/international/ogonek.el                       |    2 +-
 lisp/international/quail.el                        |    2 +-
 lisp/international/rfc1843.el                      |    2 +-
 lisp/international/robin.el                        |    3 +-
 lisp/international/titdic-cnv.el                   |    2 +-
 lisp/international/ucs-normalize.el                |    2 +-
 lisp/international/utf-7.el                        |    2 +-
 lisp/international/utf7.el                         |    2 +-
 lisp/isearch.el                                    |   49 +-
 lisp/isearchb.el                                   |    2 +-
 lisp/jit-lock.el                                   |    2 +-
 lisp/jka-cmpr-hook.el                              |    2 +-
 lisp/jka-compr.el                                  |    2 +-
 lisp/json.el                                       |    4 +-
 lisp/jsonrpc.el                                    |    2 +-
 lisp/kermit.el                                     |    2 +-
 lisp/kmacro.el                                     |    8 +-
 lisp/language/china-util.el                        |    2 +-
 lisp/language/chinese.el                           |    2 +-
 lisp/language/cyril-util.el                        |    2 +-
 lisp/language/cyrillic.el                          |    2 +-
 lisp/language/czech.el                             |    2 +-
 lisp/language/english.el                           |    2 +-
 lisp/language/ethio-util.el                        |   12 +-
 lisp/language/ethiopic.el                          |    2 +-
 lisp/language/european.el                          |   83 +-
 lisp/language/georgian.el                          |    2 +-
 lisp/language/greek.el                             |    2 +-
 lisp/language/hanja-util.el                        |    2 +-
 lisp/language/hebrew.el                            |    2 +-
 lisp/language/ind-util.el                          |    2 +-
 lisp/language/indian.el                            |    2 +-
 lisp/language/japan-util.el                        |    2 +-
 lisp/language/japanese.el                          |   18 +-
 lisp/language/korea-util.el                        |   17 +-
 lisp/language/korean.el                            |    3 +-
 lisp/language/lao-util.el                          |    2 +-
 lisp/language/lao.el                               |    2 +-
 lisp/language/romanian.el                          |    2 +-
 lisp/language/slovak.el                            |    2 +-
 lisp/language/tai-viet.el                          |    2 +-
 lisp/language/thai-util.el                         |    2 +-
 lisp/language/thai.el                              |    2 +-
 lisp/language/tibet-util.el                        |    2 +-
 lisp/language/tibetan.el                           |    2 +-
 lisp/language/utf-8-lang.el                        |    2 +-
 lisp/language/viet-util.el                         |    2 +-
 lisp/language/vietnamese.el                        |    2 +-
 lisp/ldefs-boot.el                                 |  836 ++--
 lisp/leim/quail/arabic.el                          |    2 +-
 lisp/leim/quail/compose.el                         |    2 +-
 lisp/leim/quail/croatian.el                        |    2 +-
 lisp/leim/quail/cyril-jis.el                       |    2 +-
 lisp/leim/quail/cyrillic.el                        |    2 +-
 lisp/leim/quail/czech.el                           |    2 +-
 lisp/leim/quail/georgian.el                        |    2 +-
 lisp/leim/quail/greek.el                           |    2 +-
 lisp/leim/quail/hangul.el                          |    4 +-
 lisp/leim/quail/hanja.el                           |    2 +-
 lisp/leim/quail/hanja3.el                          |    2 +-
 lisp/leim/quail/indian.el                          |    2 +-
 lisp/leim/quail/ipa-praat.el                       |    2 +-
 lisp/leim/quail/ipa.el                             |    2 +-
 lisp/leim/quail/japanese.el                        |    2 +-
 lisp/leim/quail/latin-alt.el                       |    2 +-
 lisp/leim/quail/latin-ltx.el                       |    2 +-
 lisp/leim/quail/latin-post.el                      |    2 +-
 lisp/leim/quail/latin-pre.el                       |    2 +-
 lisp/leim/quail/lrt.el                             |    2 +-
 lisp/leim/quail/persian.el                         |    2 +-
 lisp/leim/quail/programmer-dvorak.el               |    2 +-
 lisp/leim/quail/py-punct.el                        |    2 +-
 lisp/leim/quail/rfc1345.el                         |    2 +-
 lisp/leim/quail/sami.el                            |    2 +-
 lisp/leim/quail/sgml-input.el                      |    2 +-
 lisp/leim/quail/sisheng.el                         |    2 +-
 lisp/leim/quail/slovak.el                          |    2 +-
 lisp/leim/quail/symbol-ksc.el                      |    2 +-
 lisp/leim/quail/tamil-dvorak.el                    |    2 +-
 lisp/leim/quail/tibetan.el                         |    2 +-
 lisp/leim/quail/uni-input.el                       |    5 +-
 lisp/leim/quail/vntelex.el                         |    2 +-
 lisp/leim/quail/vnvni.el                           |    2 +-
 lisp/leim/quail/welsh.el                           |    2 +-
 lisp/linum.el                                      |    2 +-
 lisp/loadhist.el                                   |    2 +-
 lisp/loadup.el                                     |    2 +-
 lisp/locate.el                                     |   12 +-
 lisp/lpr.el                                        |    2 +-
 lisp/ls-lisp.el                                    |    2 +-
 lisp/macros.el                                     |    2 +-
 lisp/mail/binhex.el                                |    2 +-
 lisp/mail/blessmail.el                             |    2 +-
 lisp/mail/emacsbug.el                              |    2 +-
 lisp/mail/feedmail.el                              |   77 +-
 lisp/mail/flow-fill.el                             |    2 +-
 lisp/mail/footnote.el                              |    2 +-
 lisp/mail/hashcash.el                              |    2 +-
 lisp/mail/ietf-drums.el                            |    2 +-
 lisp/mail/mail-extr.el                             |    2 +-
 lisp/mail/mail-hist.el                             |    2 +-
 lisp/mail/mail-parse.el                            |    2 +-
 lisp/mail/mail-prsvr.el                            |    2 +-
 lisp/mail/mail-utils.el                            |    2 +-
 lisp/mail/mailabbrev.el                            |    2 +-
 lisp/mail/mailalias.el                             |    2 +-
 lisp/mail/mailclient.el                            |    2 +-
 lisp/mail/mailheader.el                            |    2 +-
 lisp/mail/mspools.el                               |    2 +-
 lisp/mail/qp.el                                    |    2 +-
 lisp/mail/reporter.el                              |    2 +-
 lisp/mail/rfc2045.el                               |    2 +-
 lisp/mail/rfc2047.el                               |    2 +-
 lisp/mail/rfc2231.el                               |    2 +-
 lisp/mail/rfc2368.el                               |    2 +-
 lisp/mail/rfc822.el                                |    2 +-
 lisp/mail/rmail-spam-filter.el                     |   19 +-
 lisp/mail/rmail.el                                 |    9 +-
 lisp/mail/rmailedit.el                             |    2 +-
 lisp/mail/rmailkwd.el                              |    2 +-
 lisp/mail/rmailmm.el                               |    2 +-
 lisp/mail/rmailmsc.el                              |    2 +-
 lisp/mail/rmailout.el                              |    2 +-
 lisp/mail/rmailsort.el                             |    2 +-
 lisp/mail/rmailsum.el                              |   14 +-
 lisp/mail/sendmail.el                              |    2 +-
 lisp/mail/smtpmail.el                              |    2 +-
 lisp/mail/supercite.el                             |    2 +-
 lisp/mail/uce.el                                   |    2 +-
 lisp/mail/undigest.el                              |    2 +-
 lisp/mail/unrmail.el                               |    2 +-
 lisp/mail/uudecode.el                              |    2 +-
 lisp/mail/yenc.el                                  |    2 +-
 lisp/makesum.el                                    |    2 +-
 lisp/man.el                                        |   10 +-
 lisp/master.el                                     |    5 +-
 lisp/mb-depth.el                                   |    2 +-
 lisp/md4.el                                        |    2 +-
 lisp/menu-bar.el                                   |    2 +-
 lisp/mh-e/ChangeLog.1                              |    2 +-
 lisp/mh-e/ChangeLog.2                              |    2 +-
 lisp/mh-e/mh-acros.el                              |    2 +-
 lisp/mh-e/mh-alias.el                              |    2 +-
 lisp/mh-e/mh-buffers.el                            |    2 +-
 lisp/mh-e/mh-comp.el                               |    2 +-
 lisp/mh-e/mh-compat.el                             |    2 +-
 lisp/mh-e/mh-e.el                                  |    4 +-
 lisp/mh-e/mh-folder.el                             |    2 +-
 lisp/mh-e/mh-funcs.el                              |    2 +-
 lisp/mh-e/mh-gnus.el                               |    2 +-
 lisp/mh-e/mh-identity.el                           |    2 +-
 lisp/mh-e/mh-inc.el                                |    2 +-
 lisp/mh-e/mh-junk.el                               |    2 +-
 lisp/mh-e/mh-letter.el                             |    2 +-
 lisp/mh-e/mh-limit.el                              |    2 +-
 lisp/mh-e/mh-mime.el                               |    2 +-
 lisp/mh-e/mh-print.el                              |    2 +-
 lisp/mh-e/mh-scan.el                               |    2 +-
 lisp/mh-e/mh-search.el                             |    2 +-
 lisp/mh-e/mh-seq.el                                |    2 +-
 lisp/mh-e/mh-show.el                               |    2 +-
 lisp/mh-e/mh-speed.el                              |    2 +-
 lisp/mh-e/mh-thread.el                             |    2 +-
 lisp/mh-e/mh-tool-bar.el                           |    2 +-
 lisp/mh-e/mh-utils.el                              |    2 +-
 lisp/mh-e/mh-xface.el                              |    5 +-
 lisp/midnight.el                                   |    2 +-
 lisp/minibuf-eldef.el                              |    2 +-
 lisp/minibuffer.el                                 |   76 +-
 lisp/misc.el                                       |    2 +-
 lisp/misearch.el                                   |    2 +-
 lisp/mouse-copy.el                                 |    2 +-
 lisp/mouse-drag.el                                 |    2 +-
 lisp/mouse.el                                      |    2 +-
 lisp/mpc.el                                        |    2 +-
 lisp/msb.el                                        |    2 +-
 lisp/mwheel.el                                     |    2 +-
 lisp/net/ange-ftp.el                               |    4 +-
 lisp/net/browse-url.el                             |    2 +-
 lisp/net/dbus.el                                   |    2 +-
 lisp/net/dictionary-connection.el                  |  155 +
 lisp/net/dictionary.el                             | 1355 ++++++
 lisp/net/dig.el                                    |    2 +-
 lisp/net/dns.el                                    |    2 +-
 lisp/net/eudc-bob.el                               |    2 +-
 lisp/net/eudc-export.el                            |    2 +-
 lisp/net/eudc-hotlist.el                           |    2 +-
 lisp/net/eudc-vars.el                              |    2 +-
 lisp/net/eudc.el                                   |    2 +-
 lisp/net/eudcb-bbdb.el                             |    2 +-
 lisp/net/eudcb-ldap.el                             |    2 +-
 lisp/net/eudcb-mab.el                              |    2 +-
 lisp/net/eudcb-macos-contacts.el                   |    2 +-
 lisp/net/eww.el                                    |    2 +-
 lisp/net/gnutls.el                                 |    2 +-
 lisp/net/goto-addr.el                              |    2 +-
 lisp/net/hmac-def.el                               |    2 +-
 lisp/net/hmac-md5.el                               |    2 +-
 lisp/net/imap.el                                   |    7 +-
 lisp/net/ldap.el                                   |    2 +-
 lisp/net/mailcap.el                                |    5 +-
 lisp/net/mairix.el                                 |    2 +-
 lisp/net/net-utils.el                              |    2 +-
 lisp/net/netrc.el                                  |    2 +-
 lisp/net/network-stream.el                         |    2 +-
 lisp/net/newst-backend.el                          |    2 +-
 lisp/net/newst-plainview.el                        |    2 +-
 lisp/net/newst-reader.el                           |    2 +-
 lisp/net/newst-ticker.el                           |    2 +-
 lisp/net/newst-treeview.el                         |    2 +-
 lisp/net/newsticker.el                             |    2 +-
 lisp/net/nsm.el                                    |    2 +-
 lisp/net/ntlm.el                                   |    2 +-
 lisp/net/pop3.el                                   |    2 +-
 lisp/net/puny.el                                   |    2 +-
 lisp/net/quickurl.el                               |    2 +-
 lisp/net/rcirc.el                                  |   40 +-
 lisp/net/rfc2104.el                                |    2 +-
 lisp/net/rlogin.el                                 |    2 +-
 lisp/net/sasl-cram.el                              |    2 +-
 lisp/net/sasl-digest.el                            |    2 +-
 lisp/net/sasl-ntlm.el                              |    2 +-
 lisp/net/sasl-scram-rfc.el                         |    2 +-
 lisp/net/sasl-scram-sha256.el                      |    2 +-
 lisp/net/sasl.el                                   |    2 +-
 lisp/net/secrets.el                                |    2 +-
 lisp/net/shr-color.el                              |    2 +-
 lisp/net/shr.el                                    |    7 +-
 lisp/net/sieve-manage.el                           |    2 +-
 lisp/net/sieve-mode.el                             |    2 +-
 lisp/net/sieve.el                                  |    6 +-
 lisp/net/snmp-mode.el                              |    2 +-
 lisp/net/soap-client.el                            |    2 +-
 lisp/net/soap-inspect.el                           |    2 +-
 lisp/net/socks.el                                  |    8 +-
 lisp/net/telnet.el                                 |    2 +-
 lisp/net/tramp-adb.el                              |   23 +-
 lisp/net/tramp-archive.el                          |    2 +-
 lisp/net/tramp-cache.el                            |    2 +-
 lisp/net/tramp-cmds.el                             |    5 +-
 lisp/net/tramp-compat.el                           |    2 +-
 lisp/net/tramp-crypt.el                            |    2 +-
 lisp/net/tramp-ftp.el                              |    2 +-
 lisp/net/tramp-gvfs.el                             |   39 +-
 lisp/net/tramp-integration.el                      |    2 +-
 lisp/net/tramp-rclone.el                           |    2 +-
 lisp/net/tramp-sh.el                               |   66 +-
 lisp/net/tramp-smb.el                              |    8 +-
 lisp/net/tramp-sudoedit.el                         |    2 +-
 lisp/net/tramp-uu.el                               |    2 +-
 lisp/net/tramp.el                                  |  152 +-
 lisp/net/trampver.el                               |   18 +-
 lisp/net/webjump.el                                |    2 +-
 lisp/net/zeroconf.el                               |    2 +-
 lisp/newcomment.el                                 |   70 +-
 lisp/notifications.el                              |    2 +-
 lisp/novice.el                                     |    2 +-
 lisp/nxml/nxml-enc.el                              |    2 +-
 lisp/nxml/nxml-maint.el                            |    2 +-
 lisp/nxml/nxml-mode.el                             |    8 +-
 lisp/nxml/nxml-ns.el                               |    2 +-
 lisp/nxml/nxml-outln.el                            |    2 +-
 lisp/nxml/nxml-parse.el                            |    2 +-
 lisp/nxml/nxml-rap.el                              |    2 +-
 lisp/nxml/nxml-util.el                             |    2 +-
 lisp/nxml/rng-cmpct.el                             |    2 +-
 lisp/nxml/rng-dt.el                                |    2 +-
 lisp/nxml/rng-loc.el                               |    2 +-
 lisp/nxml/rng-maint.el                             |    2 +-
 lisp/nxml/rng-match.el                             |    2 +-
 lisp/nxml/rng-nxml.el                              |    2 +-
 lisp/nxml/rng-parse.el                             |    2 +-
 lisp/nxml/rng-pttrn.el                             |    2 +-
 lisp/nxml/rng-uri.el                               |    2 +-
 lisp/nxml/rng-util.el                              |    2 +-
 lisp/nxml/rng-valid.el                             |    2 +-
 lisp/nxml/rng-xsd.el                               |    2 +-
 lisp/nxml/xmltok.el                                |    2 +-
 lisp/nxml/xsd-regexp.el                            |    2 +-
 lisp/obarray.el                                    |    2 +-
 lisp/obsolete/abbrevlist.el                        |    2 +-
 lisp/obsolete/assoc.el                             |    2 +-
 lisp/obsolete/bruce.el                             |    2 +-
 lisp/obsolete/cc-compat.el                         |    2 +-
 lisp/obsolete/cl-compat.el                         |    2 +-
 lisp/obsolete/cl.el                                |    2 +-
 lisp/obsolete/complete.el                          |    2 +-
 lisp/obsolete/crisp.el                             |    2 +-
 lisp/obsolete/cust-print.el                        |    2 +-
 lisp/obsolete/erc-compat.el                        |    2 +-
 lisp/obsolete/erc-hecomplete.el                    |    2 +-
 lisp/obsolete/eudcb-ph.el                          |    2 +-
 lisp/obsolete/fast-lock.el                         |    2 +-
 lisp/obsolete/gs.el                                |    2 +-
 lisp/obsolete/gulp.el                              |    2 +-
 lisp/obsolete/html2text.el                         |    2 +-
 lisp/obsolete/info-edit.el                         |    2 +-
 lisp/obsolete/iswitchb.el                          |    2 +-
 lisp/obsolete/landmark.el                          |    5 +-
 lisp/obsolete/lazy-lock.el                         |    2 +-
 lisp/obsolete/longlines.el                         |    5 +-
 lisp/obsolete/mantemp.el                           |    2 +-
 lisp/obsolete/messcompat.el                        |    2 +-
 lisp/obsolete/metamail.el                          |    2 +-
 lisp/obsolete/mouse-sel.el                         |    2 +-
 lisp/obsolete/nnir.el                              |    2 +-
 lisp/obsolete/old-emacs-lock.el                    |    2 +-
 lisp/obsolete/otodo-mode.el                        |    2 +-
 lisp/obsolete/pc-mode.el                           |    2 +-
 lisp/obsolete/pc-select.el                         |    2 +-
 lisp/obsolete/pgg-def.el                           |    2 +-
 lisp/obsolete/pgg-gpg.el                           |    2 +-
 lisp/obsolete/pgg-parse.el                         |    2 +-
 lisp/obsolete/pgg-pgp.el                           |    2 +-
 lisp/obsolete/pgg-pgp5.el                          |    2 +-
 lisp/obsolete/pgg.el                               |    2 +-
 lisp/obsolete/rcompile.el                          |    2 +-
 lisp/obsolete/s-region.el                          |    2 +-
 lisp/obsolete/sb-image.el                          |    3 +-
 lisp/obsolete/sregex.el                            |    2 +-
 lisp/obsolete/starttls.el                          |    2 +-
 lisp/obsolete/sup-mouse.el                         |    2 +-
 lisp/obsolete/terminal.el                          |    2 +-
 lisp/obsolete/tls.el                               |    8 +-
 lisp/obsolete/tpu-edt.el                           |    2 +-
 lisp/obsolete/tpu-extras.el                        |    2 +-
 lisp/obsolete/tpu-mapper.el                        |    2 +-
 lisp/obsolete/url-ns.el                            |    2 +-
 lisp/obsolete/vc-arch.el                           |    2 +-
 lisp/obsolete/vip.el                               |    2 +-
 lisp/obsolete/ws-mode.el                           |    2 +-
 lisp/obsolete/yow.el                               |    2 +-
 lisp/org/ChangeLog.1                               |    2 +-
 lisp/org/ob-C.el                                   |   12 +-
 lisp/org/ob-J.el                                   |   11 +-
 lisp/org/ob-R.el                                   |   13 +-
 lisp/org/ob-abc.el                                 |    6 +-
 lisp/org/ob-asymptote.el                           |    4 +-
 lisp/org/ob-awk.el                                 |    4 +-
 lisp/org/ob-calc.el                                |    4 +-
 lisp/org/ob-clojure.el                             |  342 +-
 lisp/org/ob-comint.el                              |    4 +-
 lisp/org/ob-coq.el                                 |    4 +-
 lisp/org/ob-core.el                                |  532 ++-
 lisp/org/ob-css.el                                 |    4 +-
 lisp/org/ob-ditaa.el                               |    4 +-
 lisp/org/ob-dot.el                                 |    4 +-
 lisp/org/ob-ebnf.el                                |   28 +-
 lisp/org/ob-emacs-lisp.el                          |   53 +-
 lisp/org/ob-eshell.el                              |    2 +-
 lisp/org/ob-eval.el                                |    4 +-
 lisp/org/ob-exp.el                                 |   10 +-
 lisp/org/ob-forth.el                               |    5 +-
 lisp/org/ob-fortran.el                             |    5 +-
 lisp/org/ob-gnuplot.el                             |    6 +-
 lisp/org/ob-groovy.el                              |    6 +-
 lisp/org/ob-haskell.el                             |   88 +-
 lisp/org/ob-hledger.el                             |    7 +-
 lisp/org/ob-io.el                                  |    5 +-
 lisp/org/ob-java.el                                |    9 +-
 lisp/org/ob-js.el                                  |    6 +-
 lisp/org/ob-latex.el                               |   14 +-
 lisp/org/ob-ledger.el                              |    4 +-
 lisp/org/ob-lilypond.el                            |   15 +-
 lisp/org/ob-lisp.el                                |    4 +-
 lisp/org/ob-lob.el                                 |    2 +-
 lisp/org/ob-lua.el                                 |    7 +-
 lisp/org/ob-makefile.el                            |    4 +-
 lisp/org/ob-matlab.el                              |    4 +-
 lisp/org/ob-maxima.el                              |    7 +-
 lisp/org/ob-mscgen.el                              |    7 +-
 lisp/org/ob-ocaml.el                               |    4 +-
 lisp/org/ob-octave.el                              |   10 +-
 lisp/org/ob-org.el                                 |    4 +-
 lisp/org/ob-perl.el                                |    4 +-
 lisp/org/ob-picolisp.el                            |    4 +-
 lisp/org/ob-plantuml.el                            |  107 +-
 lisp/org/ob-processing.el                          |    2 +-
 lisp/org/ob-python.el                              |  221 +-
 lisp/org/ob-ref.el                                 |    6 +-
 lisp/org/ob-ruby.el                                |   27 +-
 lisp/org/ob-sass.el                                |    4 +-
 lisp/org/ob-scheme.el                              |   13 +-
 lisp/org/ob-screen.el                              |   17 +-
 lisp/org/ob-sed.el                                 |    7 +-
 lisp/org/ob-shell.el                               |   61 +-
 lisp/org/ob-shen.el                                |    3 +-
 lisp/org/ob-sql.el                                 |  123 +-
 lisp/org/ob-sqlite.el                              |    9 +-
 lisp/org/ob-stan.el                                |    3 +-
 lisp/org/ob-table.el                               |    7 +-
 lisp/org/ob-tangle.el                              |   62 +-
 lisp/org/ob-vala.el                                |    2 +-
 lisp/org/ob.el                                     |    2 +-
 lisp/org/ol-bbdb.el                                |   41 +-
 lisp/org/ol-bibtex.el                              |   27 +-
 lisp/org/ol-docview.el                             |    5 +-
 lisp/org/ol-eshell.el                              |    4 +-
 lisp/org/ol-eww.el                                 |   17 +-
 lisp/org/ol-gnus.el                                |   34 +-
 lisp/org/ol-info.el                                |    4 +-
 lisp/org/ol-irc.el                                 |    4 +-
 lisp/org/ol-mhe.el                                 |    4 +-
 lisp/org/ol-rmail.el                               |    8 +-
 lisp/org/ol-w3m.el                                 |    2 +-
 lisp/org/ol.el                                     |  499 ++-
 lisp/org/org-agenda.el                             | 1242 +++---
 lisp/org/org-archive.el                            |   56 +-
 lisp/org/org-attach-git.el                         |    2 +-
 lisp/org/org-attach.el                             |  158 +-
 lisp/org/org-capture.el                            |  138 +-
 lisp/org/org-clock.el                              |  143 +-
 lisp/org/org-colview.el                            |   55 +-
 lisp/org/org-compat.el                             |  139 +-
 lisp/org/org-crypt.el                              |  233 +-
 lisp/org/org-ctags.el                              |    4 +-
 lisp/org/org-datetree.el                           |   31 +-
 lisp/org/org-duration.el                           |   54 +-
 lisp/org/org-element.el                            |  264 +-
 lisp/org/org-entities.el                           |    7 +-
 lisp/org/org-faces.el                              |   31 +-
 lisp/org/org-feed.el                               |    2 +-
 lisp/org/org-footnote.el                           |    2 +-
 lisp/org/org-goto.el                               |   40 +-
 lisp/org/org-habit.el                              |   13 +-
 lisp/org/org-id.el                                 |  133 +-
 lisp/org/org-indent.el                             |   37 +-
 lisp/org/org-inlinetask.el                         |    2 +-
 lisp/org/org-keys.el                               |   22 +-
 lisp/org/org-lint.el                               |   79 +-
 lisp/org/org-list.el                               |  649 +--
 lisp/org/org-macro.el                              |   60 +-
 lisp/org/org-macs.el                               |  129 +-
 lisp/org/org-mobile.el                             |   13 +-
 lisp/org/org-mouse.el                              |   12 +-
 lisp/org/org-num.el                                |    9 +-
 lisp/org/org-pcomplete.el                          |   38 +-
 lisp/org/org-plot.el                               |   48 +-
 lisp/org/org-protocol.el                           |   36 +-
 lisp/org/org-refile.el                             |  742 ++++
 lisp/org/org-src.el                                |   91 +-
 lisp/org/org-table.el                              |  536 ++-
 lisp/org/org-tempo.el                              |    4 +-
 lisp/org/org-timer.el                              |   21 +-
 lisp/org/org-version.el                            |    4 +-
 lisp/org/org.el                                    | 4540 ++++++++++----------
 lisp/org/ox-ascii.el                               |   19 +-
 lisp/org/ox-beamer.el                              |    4 +-
 lisp/org/ox-html.el                                |  355 +-
 lisp/org/ox-icalendar.el                           |   13 +-
 lisp/org/ox-latex.el                               |   88 +-
 lisp/org/ox-man.el                                 |   24 +-
 lisp/org/ox-md.el                                  |  347 +-
 lisp/org/ox-odt.el                                 |   30 +-
 lisp/org/ox-org.el                                 |    6 +-
 lisp/org/ox-publish.el                             |   13 +-
 lisp/org/ox-texinfo.el                             |   25 +-
 lisp/org/ox.el                                     |  320 +-
 lisp/outline.el                                    |    4 +-
 lisp/paren.el                                      |    2 +-
 lisp/password-cache.el                             |    2 +-
 lisp/pcmpl-cvs.el                                  |    2 +-
 lisp/pcmpl-gnu.el                                  |    2 +-
 lisp/pcmpl-linux.el                                |    2 +-
 lisp/pcmpl-rpm.el                                  |    2 +-
 lisp/pcmpl-unix.el                                 |    2 +-
 lisp/pcmpl-x.el                                    |    2 +-
 lisp/pcomplete.el                                  |    6 +-
 lisp/pixel-scroll.el                               |    2 +-
 lisp/play/5x5.el                                   |   24 +-
 lisp/play/animate.el                               |    2 +-
 lisp/play/blackbox.el                              |    2 +-
 lisp/play/bubbles.el                               |    2 +-
 lisp/play/cookie1.el                               |    2 +-
 lisp/play/decipher.el                              |    2 +-
 lisp/play/dissociate.el                            |    2 +-
 lisp/play/doctor.el                                |    2 +-
 lisp/play/dunnet.el                                |  202 +-
 lisp/play/fortune.el                               |    2 +-
 lisp/play/gamegrid.el                              |    2 +-
 lisp/play/gametree.el                              |    2 +-
 lisp/play/gomoku.el                                |    2 +-
 lisp/play/handwrite.el                             |    2 +-
 lisp/play/life.el                                  |    2 +-
 lisp/play/morse.el                                 |    2 +-
 lisp/play/mpuz.el                                  |    2 +-
 lisp/play/pong.el                                  |    2 +-
 lisp/play/snake.el                                 |    2 +-
 lisp/play/solitaire.el                             |    2 +-
 lisp/play/spook.el                                 |    2 +-
 lisp/play/tetris.el                                |   48 +-
 lisp/play/zone.el                                  |    2 +-
 lisp/plstore.el                                    |    2 +-
 lisp/printing.el                                   |    2 +-
 lisp/proced.el                                     |    8 +-
 lisp/profiler.el                                   |   36 +-
 lisp/progmodes/antlr-mode.el                       |    2 +-
 lisp/progmodes/asm-mode.el                         |    2 +-
 lisp/progmodes/autoconf.el                         |    2 +-
 lisp/progmodes/bat-mode.el                         |    2 +-
 lisp/progmodes/bug-reference.el                    |    2 +-
 lisp/progmodes/cc-align.el                         |    2 +-
 lisp/progmodes/cc-awk.el                           |  103 +-
 lisp/progmodes/cc-bytecomp.el                      |    2 +-
 lisp/progmodes/cc-cmds.el                          |    4 +-
 lisp/progmodes/cc-defs.el                          |    4 +-
 lisp/progmodes/cc-engine.el                        |  712 ++-
 lisp/progmodes/cc-fonts.el                         |  144 +-
 lisp/progmodes/cc-guess.el                         |    2 +-
 lisp/progmodes/cc-langs.el                         |   21 +-
 lisp/progmodes/cc-menus.el                         |    2 +-
 lisp/progmodes/cc-mode.el                          |   84 +-
 lisp/progmodes/cc-styles.el                        |    2 +-
 lisp/progmodes/cc-vars.el                          |    5 +-
 lisp/progmodes/cfengine.el                         |   48 +-
 lisp/progmodes/cl-font-lock.el                     |    2 +-
 lisp/progmodes/cmacexp.el                          |    2 +-
 lisp/progmodes/compile.el                          |   80 +-
 lisp/progmodes/cperl-mode.el                       |  233 +-
 lisp/progmodes/cpp.el                              |    2 +-
 lisp/progmodes/cwarn.el                            |    2 +-
 lisp/progmodes/dcl-mode.el                         |   14 +-
 lisp/progmodes/ebnf-abn.el                         |    2 +-
 lisp/progmodes/ebnf-bnf.el                         |    2 +-
 lisp/progmodes/ebnf-dtd.el                         |    2 +-
 lisp/progmodes/ebnf-ebx.el                         |    2 +-
 lisp/progmodes/ebnf-iso.el                         |    2 +-
 lisp/progmodes/ebnf-otz.el                         |    2 +-
 lisp/progmodes/ebnf-yac.el                         |    2 +-
 lisp/progmodes/ebnf2ps.el                          |    2 +-
 lisp/progmodes/ebrowse.el                          |    2 +-
 lisp/progmodes/elisp-mode.el                       |   20 +-
 lisp/progmodes/etags.el                            |   83 +-
 lisp/progmodes/executable.el                       |    2 +-
 lisp/progmodes/f90.el                              |    2 +-
 lisp/progmodes/flymake-cc.el                       |    2 +-
 lisp/progmodes/flymake-proc.el                     |   21 +-
 lisp/progmodes/flymake.el                          |  320 +-
 lisp/progmodes/fortran.el                          |   45 +-
 lisp/progmodes/gdb-mi.el                           |   76 +-
 lisp/progmodes/glasses.el                          |    2 +-
 lisp/progmodes/grep.el                             |   45 +-
 lisp/progmodes/gud.el                              |   10 +-
 lisp/progmodes/hideif.el                           |   24 +-
 lisp/progmodes/hideshow.el                         |    2 +-
 lisp/progmodes/icon.el                             |    2 +-
 lisp/progmodes/idlw-complete-structtag.el          |    2 +-
 lisp/progmodes/idlw-help.el                        |    2 +-
 lisp/progmodes/idlw-shell.el                       |    2 +-
 lisp/progmodes/idlw-toolbar.el                     |    2 +-
 lisp/progmodes/idlwave.el                          |    2 +-
 lisp/progmodes/inf-lisp.el                         |   11 +-
 lisp/progmodes/js.el                               |    2 +-
 lisp/progmodes/ld-script.el                        |    2 +-
 lisp/progmodes/m4-mode.el                          |    2 +-
 lisp/progmodes/make-mode.el                        |   32 +-
 lisp/progmodes/meta-mode.el                        |   52 +-
 lisp/progmodes/mixal-mode.el                       |    2 +-
 lisp/progmodes/octave.el                           |   29 +-
 lisp/progmodes/opascal.el                          |    2 +-
 lisp/progmodes/pascal.el                           |    2 +-
 lisp/progmodes/perl-mode.el                        |    2 +-
 lisp/progmodes/prog-mode.el                        |    2 +-
 lisp/progmodes/project.el                          |  107 +-
 lisp/progmodes/prolog.el                           |    2 +-
 lisp/progmodes/ps-mode.el                          |   28 +-
 lisp/progmodes/python.el                           |  265 +-
 lisp/progmodes/ruby-mode.el                        |   96 +-
 lisp/progmodes/scheme.el                           |    2 +-
 lisp/progmodes/sh-script.el                        |    2 +-
 lisp/progmodes/simula.el                           |    2 +-
 lisp/progmodes/sql.el                              |   65 +-
 lisp/progmodes/subword.el                          |    2 +-
 lisp/progmodes/tcl.el                              |   66 +-
 lisp/progmodes/vera-mode.el                        |    2 +-
 lisp/progmodes/verilog-mode.el                     |   12 +-
 lisp/progmodes/vhdl-mode.el                        |   97 +-
 lisp/progmodes/which-func.el                       |    9 +-
 lisp/progmodes/xref.el                             |  177 +-
 lisp/progmodes/xscheme.el                          |   20 +-
 lisp/ps-bdf.el                                     |    2 +-
 lisp/ps-def.el                                     |    2 +-
 lisp/ps-mule.el                                    |    2 +-
 lisp/ps-print.el                                   |    3 +-
 lisp/ps-samp.el                                    |    2 +-
 lisp/recentf.el                                    |    8 +-
 lisp/rect.el                                       |    2 +-
 lisp/register.el                                   |    2 +-
 lisp/registry.el                                   |    2 +-
 lisp/repeat.el                                     |    2 +-
 lisp/replace.el                                    |    4 +-
 lisp/reposition.el                                 |    2 +-
 lisp/reveal.el                                     |    4 +-
 lisp/rfn-eshadow.el                                |    2 +-
 lisp/rot13.el                                      |    2 +-
 lisp/rtree.el                                      |    2 +-
 lisp/ruler-mode.el                                 |    6 +-
 lisp/savehist.el                                   |    2 +-
 lisp/saveplace.el                                  |    2 +-
 lisp/scroll-all.el                                 |    2 +-
 lisp/scroll-bar.el                                 |    2 +-
 lisp/scroll-lock.el                                |    4 +-
 lisp/select.el                                     |    2 +-
 lisp/server.el                                     |   22 +-
 lisp/ses.el                                        |    5 +-
 lisp/shadowfile.el                                 |    2 +-
 lisp/shell.el                                      |   48 +-
 lisp/simple.el                                     |  103 +-
 lisp/skeleton.el                                   |   15 +-
 lisp/so-long.el                                    |    8 +-
 lisp/sort.el                                       |    2 +-
 lisp/soundex.el                                    |    2 +-
 lisp/speedbar.el                                   |   23 +-
 lisp/startup.el                                    |   12 +-
 lisp/strokes.el                                    |   20 +-
 lisp/subr.el                                       |  254 +-
 lisp/svg.el                                        |   15 +-
 lisp/t-mouse.el                                    |    2 +-
 lisp/tab-bar.el                                    |   38 +-
 lisp/tab-line.el                                   |   67 +-
 lisp/tabify.el                                     |    2 +-
 lisp/talk.el                                       |    2 +-
 lisp/tar-mode.el                                   |   34 +-
 lisp/tempo.el                                      |    2 +-
 lisp/term.el                                       |   45 +-
 lisp/term/AT386.el                                 |    2 +-
 lisp/term/README                                   |    2 +-
 lisp/term/common-win.el                            |    2 +-
 lisp/term/internal.el                              |    2 +-
 lisp/term/iris-ansi.el                             |    2 +-
 lisp/term/konsole.el                               |    2 +-
 lisp/term/news.el                                  |    2 +-
 lisp/term/ns-win.el                                |    2 +-
 lisp/term/pc-win.el                                |    2 +-
 lisp/term/rxvt.el                                  |    2 +-
 lisp/term/screen.el                                |    2 +-
 lisp/term/st.el                                    |    2 +-
 lisp/term/sun.el                                   |    2 +-
 lisp/term/tmux.el                                  |    2 +-
 lisp/term/tty-colors.el                            |    2 +-
 lisp/term/tvi970.el                                |    2 +-
 lisp/term/vt100.el                                 |    2 +-
 lisp/term/w32-win.el                               |    2 +-
 lisp/term/w32console.el                            |    2 +-
 lisp/term/wyse50.el                                |    2 +-
 lisp/term/x-win.el                                 |    2 +-
 lisp/term/xterm.el                                 |    9 +-
 lisp/textmodes/artist.el                           |    2 +-
 lisp/textmodes/bib-mode.el                         |    2 +-
 lisp/textmodes/bibtex-style.el                     |   14 +-
 lisp/textmodes/bibtex.el                           |  587 ++-
 lisp/textmodes/conf-mode.el                        |    2 +-
 lisp/textmodes/css-mode.el                         |    2 +-
 lisp/textmodes/dns-mode.el                         |    2 +-
 lisp/textmodes/enriched.el                         |    2 +-
 lisp/textmodes/fill.el                             |    2 +-
 lisp/textmodes/flyspell.el                         |    2 +-
 lisp/textmodes/ispell.el                           |    2 +-
 lisp/textmodes/less-css-mode.el                    |    2 +-
 lisp/textmodes/makeinfo.el                         |    2 +-
 lisp/textmodes/mhtml-mode.el                       |    2 +-
 lisp/textmodes/nroff-mode.el                       |    2 +-
 lisp/textmodes/page-ext.el                         |    2 +-
 lisp/textmodes/page.el                             |    2 +-
 lisp/textmodes/paragraphs.el                       |    2 +-
 lisp/textmodes/picture.el                          |    2 +-
 lisp/textmodes/po.el                               |    2 +-
 lisp/textmodes/refbib.el                           |    2 +-
 lisp/textmodes/refer.el                            |    2 +-
 lisp/textmodes/refill.el                           |    2 +-
 lisp/textmodes/reftex-auc.el                       |    2 +-
 lisp/textmodes/reftex-cite.el                      |    2 +-
 lisp/textmodes/reftex-dcr.el                       |    2 +-
 lisp/textmodes/reftex-global.el                    |    2 +-
 lisp/textmodes/reftex-index.el                     |    2 +-
 lisp/textmodes/reftex-parse.el                     |    4 +-
 lisp/textmodes/reftex-ref.el                       |    2 +-
 lisp/textmodes/reftex-sel.el                       |    2 +-
 lisp/textmodes/reftex-toc.el                       |    5 +-
 lisp/textmodes/reftex-vars.el                      |   12 +-
 lisp/textmodes/reftex.el                           |    2 +-
 lisp/textmodes/remember.el                         |   13 +-
 lisp/textmodes/rst.el                              |   15 +-
 lisp/textmodes/sgml-mode.el                        |    6 +-
 lisp/textmodes/table.el                            |   31 +-
 lisp/textmodes/tex-mode.el                         |   11 +-
 lisp/textmodes/texinfmt.el                         |    2 +-
 lisp/textmodes/texinfo.el                          |    2 +-
 lisp/textmodes/texnfo-upd.el                       |    2 +-
 lisp/textmodes/text-mode.el                        |    2 +-
 lisp/textmodes/tildify.el                          |    2 +-
 lisp/textmodes/two-column.el                       |    2 +-
 lisp/textmodes/underline.el                        |    2 +-
 lisp/thingatpt.el                                  |    2 +-
 lisp/thread.el                                     |    2 +-
 lisp/thumbs.el                                     |    7 +-
 lisp/time-stamp.el                                 |    2 +-
 lisp/time.el                                       |    2 +-
 lisp/timezone.el                                   |    4 +-
 lisp/tmm.el                                        |    2 +-
 lisp/tool-bar.el                                   |    5 +-
 lisp/tooltip.el                                    |    2 +-
 lisp/tree-widget.el                                |    9 +-
 lisp/tutorial.el                                   |   16 +-
 lisp/type-break.el                                 |    2 +-
 lisp/uniquify.el                                   |    2 +-
 lisp/url/ChangeLog.1                               |    2 +-
 lisp/url/url-about.el                              |    2 +-
 lisp/url/url-auth.el                               |    2 +-
 lisp/url/url-cache.el                              |    2 +-
 lisp/url/url-cid.el                                |    2 +-
 lisp/url/url-cookie.el                             |    2 +-
 lisp/url/url-dav.el                                |    2 +-
 lisp/url/url-dired.el                              |    2 +-
 lisp/url/url-domsuf.el                             |    2 +-
 lisp/url/url-expand.el                             |    2 +-
 lisp/url/url-file.el                               |    2 +-
 lisp/url/url-ftp.el                                |    2 +-
 lisp/url/url-future.el                             |    2 +-
 lisp/url/url-gw.el                                 |    2 +-
 lisp/url/url-handlers.el                           |    6 +-
 lisp/url/url-history.el                            |    2 +-
 lisp/url/url-http.el                               |    2 +-
 lisp/url/url-imap.el                               |    2 +-
 lisp/url/url-irc.el                                |    2 +-
 lisp/url/url-ldap.el                               |    2 +-
 lisp/url/url-mailto.el                             |    2 +-
 lisp/url/url-methods.el                            |    2 +-
 lisp/url/url-misc.el                               |    2 +-
 lisp/url/url-news.el                               |    2 +-
 lisp/url/url-nfs.el                                |    2 +-
 lisp/url/url-parse.el                              |    2 +-
 lisp/url/url-privacy.el                            |    2 +-
 lisp/url/url-proxy.el                              |    4 +-
 lisp/url/url-queue.el                              |    2 +-
 lisp/url/url-tramp.el                              |    2 +-
 lisp/url/url-util.el                               |    2 +-
 lisp/url/url-vars.el                               |    2 +-
 lisp/url/url.el                                    |    2 +-
 lisp/userlock.el                                   |    4 +-
 lisp/vc/add-log.el                                 |    2 +-
 lisp/vc/compare-w.el                               |    2 +-
 lisp/vc/cvs-status.el                              |    2 +-
 lisp/vc/diff-mode.el                               |    2 +-
 lisp/vc/diff.el                                    |    2 +-
 lisp/vc/ediff-diff.el                              |    4 +-
 lisp/vc/ediff-help.el                              |    2 +-
 lisp/vc/ediff-hook.el                              |    2 +-
 lisp/vc/ediff-init.el                              |   14 +-
 lisp/vc/ediff-merg.el                              |    4 +-
 lisp/vc/ediff-mult.el                              |    4 +-
 lisp/vc/ediff-ptch.el                              |    5 +-
 lisp/vc/ediff-util.el                              |    6 +-
 lisp/vc/ediff-vers.el                              |    2 +-
 lisp/vc/ediff-wind.el                              |    4 +-
 lisp/vc/ediff.el                                   |    2 +-
 lisp/vc/log-edit.el                                |   27 +-
 lisp/vc/log-view.el                                |    2 +-
 lisp/vc/pcvs-defs.el                               |    2 +-
 lisp/vc/pcvs-info.el                               |    2 +-
 lisp/vc/pcvs-parse.el                              |    2 +-
 lisp/vc/pcvs-util.el                               |    2 +-
 lisp/vc/pcvs.el                                    |    2 +-
 lisp/vc/smerge-mode.el                             |    4 +-
 lisp/vc/vc-annotate.el                             |    2 +-
 lisp/vc/vc-bzr.el                                  |    2 +-
 lisp/vc/vc-cvs.el                                  |    2 +-
 lisp/vc/vc-dav.el                                  |    2 +-
 lisp/vc/vc-dir.el                                  |    2 +-
 lisp/vc/vc-dispatcher.el                           |    2 +-
 lisp/vc/vc-filewise.el                             |    2 +-
 lisp/vc/vc-git.el                                  |    2 +-
 lisp/vc/vc-hg.el                                   |   13 +-
 lisp/vc/vc-hooks.el                                |    2 +-
 lisp/vc/vc-mtn.el                                  |    2 +-
 lisp/vc/vc-rcs.el                                  |    2 +-
 lisp/vc/vc-sccs.el                                 |    2 +-
 lisp/vc/vc-src.el                                  |    2 +-
 lisp/vc/vc-svn.el                                  |    2 +-
 lisp/vc/vc.el                                      |   26 +-
 lisp/vcursor.el                                    |    2 +-
 lisp/version.el                                    |    2 +-
 lisp/view.el                                       |    5 +-
 lisp/vt-control.el                                 |    2 +-
 lisp/vt100-led.el                                  |    2 +-
 lisp/w32-fns.el                                    |    4 +-
 lisp/w32-vars.el                                   |    2 +-
 lisp/wdired.el                                     |   23 +-
 lisp/whitespace.el                                 |   31 +-
 lisp/wid-browse.el                                 |    2 +-
 lisp/wid-edit.el                                   |    4 +-
 lisp/widget.el                                     |    2 +-
 lisp/windmove.el                                   |    2 +-
 lisp/window.el                                     |    8 +-
 lisp/winner.el                                     |    2 +-
 lisp/woman.el                                      |    2 +-
 lisp/x-dnd.el                                      |    8 +-
 lisp/xdg.el                                        |    2 +-
 lisp/xml.el                                        |    2 +-
 lisp/xt-mouse.el                                   |    2 +-
 lisp/xwidget.el                                    |    4 +-
 lwlib/ChangeLog.1                                  |    2 +-
 lwlib/Makefile.in                                  |    2 +-
 lwlib/deps.mk                                      |    2 +-
 lwlib/lwlib-Xaw.c                                  |    2 +-
 lwlib/lwlib-Xlw.c                                  |    2 +-
 lwlib/lwlib-Xm.c                                   |    2 +-
 lwlib/lwlib-int.h                                  |    2 +-
 lwlib/lwlib-utils.c                                |   17 +-
 lwlib/lwlib-widget.h                               |    2 +-
 lwlib/lwlib.c                                      |    2 +-
 lwlib/lwlib.h                                      |    2 +-
 lwlib/xlwmenu.c                                    |    2 +-
 lwlib/xlwmenu.h                                    |    2 +-
 lwlib/xlwmenuP.h                                   |    2 +-
 m4/00gnulib.m4                                     |    2 +-
 m4/__inline.m4                                     |    2 +-
 m4/absolute-header.m4                              |    2 +-
 m4/acl.m4                                          |    2 +-
 m4/alloca.m4                                       |    6 +-
 m4/builtin-expect.m4                               |    2 +-
 m4/byteswap.m4                                     |    2 +-
 m4/canonicalize.m4                                 |   10 +-
 m4/clock_time.m4                                   |    2 +-
 m4/close-stream.m4                                 |    2 +-
 m4/copy-file-range.m4                              |    2 +-
 m4/d-type.m4                                       |    2 +-
 m4/dirent_h.m4                                     |    2 +-
 m4/dirfd.m4                                        |    2 +-
 m4/double-slash-root.m4                            |    2 +-
 m4/dup2.m4                                         |    2 +-
 m4/eealloc.m4                                      |    2 +-
 m4/environ.m4                                      |    2 +-
 m4/errno_h.m4                                      |    2 +-
 m4/euidaccess.m4                                   |    2 +-
 m4/execinfo.m4                                     |    2 +-
 m4/explicit_bzero.m4                               |    2 +-
 m4/extensions.m4                                   |  162 +-
 m4/extern-inline.m4                                |    2 +-
 m4/faccessat.m4                                    |    6 +-
 m4/fchmodat.m4                                     |    2 +-
 m4/fcntl.m4                                        |   54 +-
 m4/fcntl_h.m4                                      |    7 +-
 m4/fdopendir.m4                                    |    2 +-
 m4/filemode.m4                                     |    5 +-
 m4/flexmember.m4                                   |    2 +-
 m4/fpending.m4                                     |    2 +-
 m4/fpieee.m4                                       |    2 +-
 m4/free.m4                                         |   49 +
 m4/fstatat.m4                                      |    2 +-
 m4/fsusage.m4                                      |    5 +-
 m4/fsync.m4                                        |    2 +-
 m4/futimens.m4                                     |    2 +-
 m4/getdtablesize.m4                                |    2 +-
 m4/getgroups.m4                                    |    2 +-
 m4/getloadavg.m4                                   |    2 +-
 m4/getopt.m4                                       |    2 +-
 m4/getrandom.m4                                    |    2 +-
 m4/gettime.m4                                      |    2 +-
 m4/gettimeofday.m4                                 |    2 +-
 m4/glibc21.m4                                      |    4 +-
 m4/gnulib-common.m4                                |   65 +-
 m4/gnulib-comp.m4                                  |   98 +-
 m4/group-member.m4                                 |    2 +-
 m4/ieee754-h.m4                                    |    2 +-
 m4/include_next.m4                                 |    2 +-
 m4/inttypes.m4                                     |    2 +-
 m4/largefile.m4                                    |    4 +-
 m4/lchmod.m4                                       |    2 +-
 m4/libgmp.m4                                       |    2 +-
 m4/limits-h.m4                                     |    2 +-
 m4/lstat.m4                                        |    2 +-
 m4/malloca.m4                                      |    4 +-
 m4/manywarnings.m4                                 |    2 +-
 m4/mbstate_t.m4                                    |   13 +-
 m4/md5.m4                                          |    2 +-
 m4/memmem.m4                                       |    2 +-
 m4/mempcpy.m4                                      |    2 +-
 m4/memrchr.m4                                      |    2 +-
 m4/minmax.m4                                       |    2 +-
 m4/mkostemp.m4                                     |    2 +-
 m4/mktime.m4                                       |    2 +-
 m4/mode_t.m4                                       |    2 +-
 m4/multiarch.m4                                    |    2 +-
 m4/nocrash.m4                                      |    2 +-
 m4/nstrftime.m4                                    |    2 +-
 m4/off_t.m4                                        |    2 +-
 m4/open-cloexec.m4                                 |    2 +-
 m4/open-slash.m4                                   |    2 +-
 m4/open.m4                                         |    2 +-
 m4/pathmax.m4                                      |    2 +-
 m4/pid_t.m4                                        |   38 +
 m4/pipe2.m4                                        |    2 +-
 m4/pselect.m4                                      |    2 +-
 m4/pthread_sigmask.m4                              |    2 +-
 m4/rawmemchr.m4                                    |   20 +
 m4/readlink.m4                                     |   63 +-
 m4/readlinkat.m4                                   |   15 +-
 m4/regex.m4                                        |    5 +-
 m4/sha1.m4                                         |    2 +-
 m4/sha256.m4                                       |    2 +-
 m4/sha512.m4                                       |    2 +-
 m4/sig2str.m4                                      |    2 +-
 m4/sigdescr_np.m4                                  |    2 +-
 m4/signal_h.m4                                     |    2 +-
 m4/socklen.m4                                      |    2 +-
 m4/ssize_t.m4                                      |    2 +-
 m4/st_dm_mode.m4                                   |    3 +-
 m4/stat-time.m4                                    |    2 +-
 m4/std-gnu11.m4                                    |    7 +-
 m4/stdalign.m4                                     |    2 +-
 m4/stddef_h.m4                                     |    2 +-
 m4/stdint.m4                                       |   12 +-
 m4/stdio_h.m4                                      |   17 +-
 m4/stdlib_h.m4                                     |   44 +-
 m4/stpcpy.m4                                       |    2 +-
 m4/string_h.m4                                     |    7 +-
 m4/strnlen.m4                                      |    2 +-
 m4/strtoimax.m4                                    |    2 +-
 m4/strtoll.m4                                      |    2 +-
 m4/symlink.m4                                      |    2 +-
 m4/sys_random_h.m4                                 |    2 +-
 m4/sys_select_h.m4                                 |    2 +-
 m4/sys_socket_h.m4                                 |    2 +-
 m4/sys_stat_h.m4                                   |    9 +-
 m4/sys_time_h.m4                                   |    2 +-
 m4/sys_types_h.m4                                  |   24 +-
 m4/tempname.m4                                     |    2 +-
 m4/time_h.m4                                       |    6 +-
 m4/time_r.m4                                       |    2 +-
 m4/time_rz.m4                                      |    2 +-
 m4/timegm.m4                                       |    2 +-
 m4/timer_time.m4                                   |    2 +-
 m4/timespec.m4                                     |    2 +-
 m4/tm_gmtoff.m4                                    |    2 +-
 m4/unistd_h.m4                                     |   51 +-
 m4/unlocked-io.m4                                  |    2 +-
 m4/utimens.m4                                      |    2 +-
 m4/utimensat.m4                                    |    2 +-
 m4/utimes.m4                                       |    2 +-
 m4/vararrays.m4                                    |   16 +-
 m4/warnings.m4                                     |    2 +-
 m4/wchar_t.m4                                      |    2 +-
 m4/zzgnulib.m4                                     |    2 +-
 make-dist                                          |   26 +-
 modules/modhelp.py                                 |    2 +-
 msdos/ChangeLog.1                                  |    2 +-
 msdos/INSTALL                                      |    2 +-
 msdos/README                                       |    4 +-
 msdos/autogen/Makefile.in                          |    6 +-
 msdos/autogen/config.in                            |    2 +-
 msdos/depfiles.bat                                 |    2 +-
 msdos/inttypes.h                                   |    2 +-
 msdos/mainmake.v2                                  |    2 +-
 msdos/sed1v2.inp                                   |    2 +-
 msdos/sed1x.inp                                    |    2 +-
 msdos/sed2v2.inp                                   |    4 +-
 msdos/sed2x.inp                                    |    2 +-
 msdos/sed3v2.inp                                   |    2 +-
 msdos/sed4.inp                                     |    2 +-
 msdos/sed5x.inp                                    |    2 +-
 msdos/sed6.inp                                     |    2 +-
 msdos/sedadmin.inp                                 |    2 +-
 msdos/sedalloc.inp                                 |    2 +-
 msdos/sedleim.inp                                  |    2 +-
 msdos/sedlibcf.inp                                 |    2 +-
 msdos/sedlibmk.inp                                 |    2 +-
 msdos/sedlisp.inp                                  |    2 +-
 nextstep/ChangeLog.1                               |    2 +-
 nextstep/INSTALL                                   |    2 +-
 nextstep/Makefile.in                               |    2 +-
 nextstep/README                                    |    2 +-
 nextstep/templates/Info.plist.in                   |    2 +-
 nt/ChangeLog.1                                     |    2 +-
 nt/INSTALL                                         |    2 +-
 nt/INSTALL.W64                                     |    2 +-
 nt/Makefile.in                                     |    2 +-
 nt/README                                          |    2 +-
 nt/README.W32                                      |    2 +-
 nt/addpm.c                                         |    2 +-
 nt/cmdproxy.c                                      |    2 +-
 nt/configure.bat                                   |    2 +-
 nt/ddeclient.c                                     |    2 +-
 nt/emacs.rc.in                                     |    2 +-
 nt/emacsclient.rc.in                               |    2 +-
 nt/epaths.nt                                       |    2 +-
 nt/gnulib-cfg.mk                                   |    2 +-
 nt/icons/README                                    |    6 +-
 nt/inc/grp.h                                       |    2 +-
 nt/inc/inttypes.h                                  |    2 +-
 nt/inc/langinfo.h                                  |    2 +-
 nt/inc/ms-w32.h                                    |    2 +-
 nt/inc/nl_types.h                                  |    2 +-
 nt/inc/stdint.h                                    |    2 +-
 nt/inc/sys/resource.h                              |    2 +-
 nt/inc/sys/socket.h                                |    2 +-
 nt/inc/sys/stat.h                                  |    2 +-
 nt/inc/sys/wait.h                                  |    2 +-
 nt/mingw-cfg.site                                  |    6 +
 nt/preprep.c                                       |    2 +-
 nt/runemacs.c                                      |    2 +-
 oldXMenu/Activate.c                                |    2 +-
 oldXMenu/ChangeLog.1                               |    2 +-
 oldXMenu/Create.c                                  |    2 +-
 oldXMenu/FindSel.c                                 |    2 +-
 oldXMenu/Internal.c                                |    2 +-
 oldXMenu/Makefile.in                               |    2 +-
 oldXMenu/deps.mk                                   |    2 +-
 oldXMenu/insque.c                                  |    2 +-
 src/.gdbinit                                       |    2 +-
 src/ChangeLog.1                                    |    2 +-
 src/ChangeLog.10                                   |    2 +-
 src/ChangeLog.11                                   |    2 +-
 src/ChangeLog.12                                   |    2 +-
 src/ChangeLog.13                                   |    2 +-
 src/ChangeLog.2                                    |    2 +-
 src/ChangeLog.3                                    |    2 +-
 src/ChangeLog.4                                    |    2 +-
 src/ChangeLog.5                                    |    2 +-
 src/ChangeLog.6                                    |    2 +-
 src/ChangeLog.7                                    |    2 +-
 src/ChangeLog.8                                    |    2 +-
 src/ChangeLog.9                                    |    2 +-
 src/Makefile.in                                    |    2 +-
 src/README                                         |    2 +-
 src/alloc.c                                        |   10 +-
 src/atimer.c                                       |    2 +-
 src/atimer.h                                       |    2 +-
 src/bidi.c                                         |    2 +-
 src/bignum.c                                       |    2 +-
 src/bignum.h                                       |    2 +-
 src/blockinput.h                                   |    2 +-
 src/buffer.c                                       |   92 +-
 src/buffer.h                                       |   12 +-
 src/bytecode.c                                     |    2 +-
 src/callint.c                                      |    7 +-
 src/callproc.c                                     |  525 ++-
 src/casefiddle.c                                   |    2 +-
 src/casetab.c                                      |    2 +-
 src/category.c                                     |    2 +-
 src/ccl.c                                          |    4 +-
 src/character.c                                    |    2 +-
 src/charset.c                                      |    6 +-
 src/charset.h                                      |    2 +-
 src/chartab.c                                      |    6 +-
 src/cm.c                                           |    2 +-
 src/cm.h                                           |    2 +-
 src/cmds.c                                         |    2 +-
 src/coding.c                                       |   32 +-
 src/coding.h                                       |    5 +-
 src/commands.h                                     |    2 +-
 src/composite.c                                    |    2 +-
 src/composite.h                                    |    2 +-
 src/conf_post.h                                    |    2 +-
 src/cygw32.c                                       |    2 +-
 src/cygw32.h                                       |    2 +-
 src/data.c                                         |    7 +-
 src/dbusbind.c                                     |   45 +-
 src/decompress.c                                   |    2 +-
 src/deps.mk                                        |    2 +-
 src/dired.c                                        |    2 +-
 src/dispextern.h                                   |    6 +-
 src/dispnew.c                                      |   11 +-
 src/disptab.h                                      |    2 +-
 src/dmpstruct.awk                                  |    2 +-
 src/doc.c                                          |   40 +-
 src/doprnt.c                                       |    2 +-
 src/dosfns.c                                       |    2 +-
 src/dosfns.h                                       |    2 +-
 src/dynlib.c                                       |    2 +-
 src/dynlib.h                                       |    2 +-
 src/editfns.c                                      |   11 +-
 src/emacs-icon.h                                   |    2 +-
 src/emacs-module.c                                 |   10 +-
 src/emacs-module.h.in                              |    2 +-
 src/emacs.c                                        |   15 +-
 src/emacsgtkfixed.c                                |    2 +-
 src/emacsgtkfixed.h                                |    2 +-
 src/epaths.in                                      |    2 +-
 src/eval.c                                         |   23 +-
 src/fileio.c                                       |   22 +-
 src/filelock.c                                     |    2 +-
 src/firstfile.c                                    |    2 +-
 src/floatfns.c                                     |    2 +-
 src/fns.c                                          |  149 +-
 src/font.c                                         |    2 +-
 src/font.h                                         |    2 +-
 src/fontset.c                                      |    2 +-
 src/fontset.h                                      |    2 +-
 src/frame.c                                        |   14 +-
 src/frame.h                                        |    2 +-
 src/fringe.c                                       |    2 +-
 src/ftcrfont.c                                     |    2 +-
 src/ftfont.c                                       |    2 +-
 src/getpagesize.h                                  |    2 +-
 src/gfilenotify.c                                  |    2 +-
 src/gmalloc.c                                      |    2 +-
 src/gnutls.c                                       |    4 +-
 src/gnutls.h                                       |    2 +-
 src/gtkutil.c                                      |    9 +-
 src/gtkutil.h                                      |    2 +-
 src/hbfont.c                                       |    2 +-
 src/image.c                                        |  162 +-
 src/indent.c                                       |    2 +-
 src/indent.h                                       |    2 +-
 src/inotify.c                                      |    2 +-
 src/insdel.c                                       |    2 +-
 src/intervals.c                                    |    2 +-
 src/intervals.h                                    |    2 +-
 src/json.c                                         |    2 +-
 src/keyboard.c                                     |   73 +-
 src/keyboard.h                                     |    3 +-
 src/keymap.c                                       |  251 +-
 src/keymap.h                                       |    2 +-
 src/kqueue.c                                       |    2 +-
 src/lastfile.c                                     |    2 +-
 src/lcms.c                                         |    2 +-
 src/lisp.h                                         |   41 +-
 src/lread.c                                        |    4 +-
 src/macfont.h                                      |    2 +-
 src/macfont.m                                      |    2 +-
 src/macros.c                                       |    2 +-
 src/macros.h                                       |    2 +-
 src/marker.c                                       |    2 +-
 src/menu.c                                         |    2 +-
 src/menu.h                                         |    2 +-
 src/minibuf.c                                      |    4 +-
 src/msdos.c                                        |    2 +-
 src/msdos.h                                        |    2 +-
 src/nsfns.m                                        |   10 +-
 src/nsfont.m                                       |    9 +-
 src/nsgui.h                                        |    2 +-
 src/nsimage.m                                      |   40 +-
 src/nsmenu.m                                       |  643 ++-
 src/nsselect.m                                     |   12 +-
 src/nsterm.h                                       |   48 +-
 src/nsterm.m                                       |  499 ++-
 src/nsxwidget.h                                    |    2 +-
 src/nsxwidget.m                                    |   21 +-
 src/pdumper.c                                      |    4 +-
 src/pdumper.h                                      |    2 +-
 src/print.c                                        |    4 +-
 src/process.c                                      |  294 +-
 src/process.h                                      |    2 +-
 src/profiler.c                                     |    2 +-
 src/puresize.h                                     |    2 +-
 src/ralloc.c                                       |    2 +-
 src/regex-emacs.c                                  |   19 +-
 src/regex-emacs.h                                  |    2 +-
 src/region-cache.c                                 |    2 +-
 src/region-cache.h                                 |    2 +-
 src/scroll.c                                       |    2 +-
 src/search.c                                       |    2 +-
 src/sheap.c                                        |    2 +-
 src/sheap.h                                        |    2 +-
 src/sound.c                                        |    2 +-
 src/syntax.c                                       |    2 +-
 src/syntax.h                                       |    2 +-
 src/sysdep.c                                       |   28 +-
 src/sysselect.h                                    |    2 +-
 src/syssignal.h                                    |    2 +-
 src/sysstdio.h                                     |    2 +-
 src/systhread.c                                    |    2 +-
 src/systhread.h                                    |    2 +-
 src/systime.h                                      |    2 +-
 src/systty.h                                       |    2 +-
 src/syswait.h                                      |    2 +-
 src/term.c                                         |    2 +-
 src/termcap.c                                      |    2 +-
 src/termchar.h                                     |    2 +-
 src/termhooks.h                                    |    3 +-
 src/terminal.c                                     |    2 +-
 src/terminfo.c                                     |    2 +-
 src/termopts.h                                     |    2 +-
 src/textprop.c                                     |    2 +-
 src/thread.c                                       |    2 +-
 src/thread.h                                       |    3 +-
 src/timefns.c                                      |    2 +-
 src/tparam.c                                       |    2 +-
 src/tparam.h                                       |    2 +-
 src/undo.c                                         |    2 +-
 src/unexaix.c                                      |    2 +-
 src/unexcoff.c                                     |    2 +-
 src/unexcw.c                                       |    2 +-
 src/unexelf.c                                      |    2 +-
 src/unexmacosx.c                                   |    2 +-
 src/unexw32.c                                      |    2 +-
 src/vm-limit.c                                     |    2 +-
 src/w16select.c                                    |    2 +-
 src/w32.c                                          |    7 +-
 src/w32.h                                          |    4 +-
 src/w32common.h                                    |    2 +-
 src/w32console.c                                   |    2 +-
 src/w32cygwinx.c                                   |    2 +-
 src/w32fns.c                                       |    4 +-
 src/w32font.c                                      |    2 +-
 src/w32font.h                                      |    2 +-
 src/w32gui.h                                       |    3 +-
 src/w32heap.c                                      |    2 +-
 src/w32heap.h                                      |    2 +-
 src/w32image.c                                     |    2 +-
 src/w32inevt.c                                     |    2 +-
 src/w32inevt.h                                     |    2 +-
 src/w32menu.c                                      |    2 +-
 src/w32notify.c                                    |    2 +-
 src/w32proc.c                                      |    6 +-
 src/w32reg.c                                       |    2 +-
 src/w32select.c                                    |    2 +-
 src/w32select.h                                    |    2 +-
 src/w32term.c                                      |   32 +-
 src/w32term.h                                      |    2 +-
 src/w32uniscribe.c                                 |    2 +-
 src/w32xfns.c                                      |    2 +-
 src/widget.c                                       |    2 +-
 src/widget.h                                       |    2 +-
 src/widgetprv.h                                    |    2 +-
 src/window.c                                       |   63 +-
 src/window.h                                       |    2 +-
 src/xdisp.c                                        |  207 +-
 src/xfaces.c                                       |    2 +-
 src/xfns.c                                         |   33 +-
 src/xfont.c                                        |    2 +-
 src/xftfont.c                                      |    2 +-
 src/xgselect.c                                     |    2 +-
 src/xgselect.h                                     |    2 +-
 src/xmenu.c                                        |    2 +-
 src/xml.c                                          |    2 +-
 src/xrdb.c                                         |    2 +-
 src/xselect.c                                      |    2 +-
 src/xsettings.c                                    |    2 +-
 src/xsettings.h                                    |    2 +-
 src/xsmfns.c                                       |    2 +-
 src/xterm.c                                        |   24 +-
 src/xterm.h                                        |    2 +-
 src/xwidget.c                                      |    5 +-
 src/xwidget.h                                      |    2 +-
 test/ChangeLog.1                                   |    2 +-
 test/Makefile.in                                   |    3 +-
 test/README                                        |    5 +-
 test/lib-src/emacsclient-tests.el                  |    2 +-
 test/lisp/abbrev-tests.el                          |    7 +-
 test/lisp/align-resources/align-post.c             |    3 +
 test/lisp/align-resources/align-post.java          |    9 +
 test/lisp/align-resources/align-pre.c              |    3 +
 test/lisp/align-resources/align-pre.java           |    9 +
 test/lisp/align-tests.el                           |   47 +
 test/lisp/allout-tests.el                          |    8 +-
 test/lisp/allout-widgets-tests.el                  |    2 +-
 test/lisp/ansi-color-tests.el                      |    2 +-
 test/lisp/apropos-tests.el                         |    2 +-
 test/lisp/arc-mode-tests.el                        |    2 +-
 test/lisp/auth-source-pass-tests.el                |    2 +-
 test/lisp/auth-source-tests.el                     |    2 +-
 test/lisp/autoinsert-tests.el                      |    2 +-
 test/lisp/autorevert-tests.el                      |    2 +-
 test/lisp/battery-tests.el                         |    2 +-
 test/lisp/bookmark-tests.el                        |    2 +-
 test/lisp/buff-menu-tests.el                       |    2 +-
 test/lisp/button-tests.el                          |    2 +-
 test/lisp/calc/calc-tests.el                       |    2 +-
 test/lisp/calendar/cal-julian-tests.el             |    2 +-
 test/lisp/calendar/icalendar-tests.el              |    2 +-
 test/lisp/calendar/iso8601-tests.el                |    2 +-
 test/lisp/calendar/lunar-tests.el                  |    2 +-
 test/lisp/calendar/parse-time-tests.el             |    2 +-
 test/lisp/calendar/solar-tests.el                  |    2 +-
 test/lisp/calendar/time-date-tests.el              |    2 +-
 test/lisp/calendar/todo-mode-tests.el              |    2 +-
 test/lisp/cedet/semantic-utest-c.el                |    2 +-
 test/lisp/cedet/semantic-utest-fmt.el              |    2 +-
 test/lisp/cedet/semantic-utest-ia.el               |    4 +-
 test/lisp/cedet/semantic-utest.el                  |    2 +-
 test/lisp/cedet/srecode-utest-getset.el            |    2 +-
 test/lisp/cedet/srecode-utest-template.el          |    2 +-
 test/lisp/char-fold-tests.el                       |    2 +-
 test/lisp/color-tests.el                           |    2 +-
 test/lisp/comint-tests.el                          |    2 +-
 test/lisp/completion-tests.el                      |    2 +-
 test/lisp/cus-edit-tests.el                        |    2 +-
 test/lisp/custom-tests.el                          |    2 +-
 test/lisp/dabbrev-tests.el                         |    2 +-
 test/lisp/delim-col-tests.el                       |    2 +-
 test/lisp/descr-text-tests.el                      |    2 +-
 test/lisp/dired-aux-tests.el                       |    2 +-
 test/lisp/dired-tests.el                           |    2 +-
 test/lisp/dired-x-tests.el                         |    2 +-
 test/lisp/dom-tests.el                             |    2 +-
 test/lisp/electric-tests.el                        |    2 +-
 test/lisp/elide-head-tests.el                      |    2 +-
 test/lisp/emacs-lisp/backquote-tests.el            |    2 +-
 test/lisp/emacs-lisp/backtrace-tests.el            |    2 +-
 test/lisp/emacs-lisp/benchmark-tests.el            |    2 +-
 test/lisp/emacs-lisp/bindat-tests.el               |    2 +-
 .../warn-wide-docstring-autoload.el                |    3 +
 .../warn-wide-docstring-custom-declare-variable.el |    4 +
 .../warn-wide-docstring-defalias.el                |    3 +
 .../warn-wide-docstring-defconst.el                |    3 +
 .../warn-wide-docstring-define-abbrev-table.el     |    3 +
 ...ide-docstring-define-obsolete-function-alias.el |    3 +
 ...ide-docstring-define-obsolete-variable-alias.el |    3 +
 .../warn-wide-docstring-defun.el                   |    3 +
 .../warn-wide-docstring-defvar.el                  |    6 +
 .../warn-wide-docstring-defvaralias.el             |    3 +
 .../warn-wide-docstring-ignore-fill-column.el      |    7 +
 .../warn-wide-docstring-ignore-override.el         |    8 +
 .../warn-wide-docstring-ignore.el                  |    7 +
 .../warn-wide-docstring-multiline-first.el         |    5 +
 .../warn-wide-docstring-multiline.el               |    6 +
 test/lisp/emacs-lisp/bytecomp-tests.el             |  157 +-
 test/lisp/emacs-lisp/cconv-tests.el                |    2 +-
 test/lisp/emacs-lisp/check-declare-tests.el        |    2 +-
 test/lisp/emacs-lisp/checkdoc-tests.el             |    2 +-
 test/lisp/emacs-lisp/cl-extra-tests.el             |    2 +-
 test/lisp/emacs-lisp/cl-generic-tests.el           |    2 +-
 test/lisp/emacs-lisp/cl-lib-tests.el               |    2 +-
 test/lisp/emacs-lisp/cl-macs-tests.el              |    2 +-
 test/lisp/emacs-lisp/cl-preloaded-tests.el         |    2 +-
 test/lisp/emacs-lisp/cl-print-tests.el             |    2 +-
 test/lisp/emacs-lisp/cl-seq-tests.el               |    2 +-
 test/lisp/emacs-lisp/copyright-tests.el            |    2 +-
 test/lisp/emacs-lisp/derived-tests.el              |    2 +-
 test/lisp/emacs-lisp/easy-mmode-tests.el           |    2 +-
 .../edebug-resources/edebug-test-code.el           |    2 +-
 test/lisp/emacs-lisp/edebug-tests.el               |    7 +-
 .../eieio-tests/eieio-test-methodinvoke.el         |    2 +-
 .../emacs-lisp/eieio-tests/eieio-test-persist.el   |    2 +-
 test/lisp/emacs-lisp/eieio-tests/eieio-tests.el    |    2 +-
 test/lisp/emacs-lisp/ert-tests.el                  |   12 +-
 test/lisp/emacs-lisp/ert-x-tests.el                |    2 +-
 .../faceup-resources/faceup-test-mode.el           |    6 +-
 .../faceup-test-this-file-directory.el             |    2 +-
 .../emacs-lisp/faceup-tests/faceup-test-basics.el  |    2 +-
 .../emacs-lisp/faceup-tests/faceup-test-files.el   |    2 +-
 test/lisp/emacs-lisp/find-func-tests.el            |   75 +-
 test/lisp/emacs-lisp/float-sup-tests.el            |    2 +-
 test/lisp/emacs-lisp/generator-tests.el            |    2 +-
 test/lisp/emacs-lisp/gv-tests.el                   |   13 +-
 test/lisp/emacs-lisp/let-alist-tests.el            |    2 +-
 test/lisp/emacs-lisp/lisp-mode-tests.el            |    2 +-
 test/lisp/emacs-lisp/lisp-tests.el                 |    2 +-
 test/lisp/emacs-lisp/map-tests.el                  |    2 +-
 test/lisp/emacs-lisp/memory-report-tests.el        |   57 +
 test/lisp/emacs-lisp/nadvice-tests.el              |    2 +-
 .../package-resources/signed/update-signatures.sh  |    2 +-
 test/lisp/emacs-lisp/package-tests.el              |    8 +-
 test/lisp/emacs-lisp/pcase-tests.el                |    2 +-
 test/lisp/emacs-lisp/pp-tests.el                   |    2 +-
 test/lisp/emacs-lisp/regexp-opt-tests.el           |    2 +-
 test/lisp/emacs-lisp/ring-tests.el                 |    2 +-
 test/lisp/emacs-lisp/rmc-tests.el                  |    2 +-
 test/lisp/emacs-lisp/rx-tests.el                   |    2 +-
 test/lisp/emacs-lisp/seq-tests.el                  |    2 +-
 test/lisp/emacs-lisp/shadow-tests.el               |    2 +-
 test/lisp/emacs-lisp/subr-x-tests.el               |   55 +-
 test/lisp/emacs-lisp/syntax-tests.el               |    2 +-
 test/lisp/emacs-lisp/tabulated-list-test.el        |    2 +-
 .../emacs-lisp/testcover-resources/testcases.el    |    2 +-
 test/lisp/emacs-lisp/testcover-tests.el            |    2 +-
 test/lisp/emacs-lisp/text-property-search-tests.el |    2 +-
 test/lisp/emacs-lisp/thunk-tests.el                |    2 +-
 test/lisp/emacs-lisp/timer-tests.el                |    2 +-
 test/lisp/emacs-lisp/unsafep-tests.el              |    2 +-
 test/lisp/emacs-lisp/warnings-tests.el             |    2 +-
 test/lisp/emulation/viper-tests.el                 |    2 +-
 test/lisp/epg-tests.el                             |    5 +-
 test/lisp/erc/erc-tests.el                         |    2 +-
 test/lisp/erc/erc-track-tests.el                   |    2 +-
 test/lisp/eshell/em-hist-tests.el                  |    2 +-
 test/lisp/eshell/em-ls-tests.el                    |    2 +-
 test/lisp/eshell/esh-opt-tests.el                  |    2 +-
 test/lisp/eshell/eshell-tests.el                   |    2 +-
 test/lisp/faces-resources/faces-test-dark-theme.el |    2 +-
 .../lisp/faces-resources/faces-test-light-theme.el |    2 +-
 test/lisp/faces-tests.el                           |    2 +-
 test/lisp/ffap-tests.el                            |    2 +-
 test/lisp/filenotify-tests.el                      |   82 +-
 test/lisp/files-tests.el                           |    2 +-
 test/lisp/files-x-tests.el                         |    2 +-
 test/lisp/font-lock-tests.el                       |    2 +-
 test/lisp/format-spec-tests.el                     |   12 +-
 test/lisp/gnus/gnus-icalendar-tests.el             |    2 +-
 test/lisp/gnus/gnus-search-tests.el                |    2 +-
 test/lisp/gnus/gnus-test-headers.el                |    2 +-
 test/lisp/gnus/gnus-tests.el                       |    2 +-
 test/lisp/gnus/gnus-util-tests.el                  |    2 +-
 test/lisp/gnus/message-tests.el                    |    2 +-
 test/lisp/gnus/mml-sec-tests.el                    |   12 +-
 test/lisp/gnus/nnrss-tests.el                      |    2 +-
 test/lisp/help-fns-tests.el                        |    2 +-
 test/lisp/help-mode-tests.el                       |    2 +-
 test/lisp/help-tests.el                            |    2 +-
 test/lisp/hfy-cmap-tests.el                        |    2 +-
 test/lisp/hi-lock-tests.el                         |    2 +-
 test/lisp/htmlfontify-tests.el                     |    2 +-
 test/lisp/ibuffer-tests.el                         |    2 +-
 test/lisp/ido-tests.el                             |    2 +-
 test/lisp/image-file-tests.el                      |    2 +-
 test/lisp/image-tests.el                           |    2 +-
 test/lisp/image/exif-tests.el                      |    2 +-
 test/lisp/image/gravatar-tests.el                  |    2 +-
 test/lisp/imenu-tests.el                           |    2 +-
 test/lisp/info-xref-tests.el                       |    2 +-
 test/lisp/international/ccl-tests.el               |    2 +-
 test/lisp/international/mule-tests.el              |    2 +-
 test/lisp/international/mule-util-tests.el         |    2 +-
 test/lisp/international/ucs-normalize-tests.el     |    2 +-
 test/lisp/isearch-tests.el                         |    2 +-
 test/lisp/jit-lock-tests.el                        |    2 +-
 test/lisp/json-tests.el                            |    2 +-
 test/lisp/jsonrpc-tests.el                         |    2 +-
 test/lisp/kmacro-tests.el                          |    2 +-
 test/lisp/ls-lisp-tests.el                         |    2 +-
 test/lisp/mail/flow-fill-tests.el                  |    2 +-
 test/lisp/mail/footnote-tests.el                   |    2 +-
 test/lisp/mail/qp-tests.el                         |    2 +-
 test/lisp/mail/rfc2045-tests.el                    |    2 +-
 test/lisp/mail/rfc2047-tests.el                    |    2 +-
 test/lisp/mail/rfc2368-tests.el                    |    2 +-
 test/lisp/mail/rfc822-tests.el                     |    2 +-
 test/lisp/mail/rmail-tests.el                      |    2 +-
 test/lisp/mail/rmailmm-tests.el                    |    2 +-
 test/lisp/mail/uudecode-tests.el                   |    2 +-
 test/lisp/makesum-tests.el                         |    2 +-
 test/lisp/man-tests.el                             |    2 +-
 test/lisp/md4-tests.el                             |    2 +-
 test/lisp/minibuffer-tests.el                      |    2 +-
 test/lisp/misc-tests.el                            |    2 +-
 test/lisp/mouse-tests.el                           |    2 +-
 test/lisp/mwheel-tests.el                          |    2 +-
 test/lisp/net/browse-url-tests.el                  |    2 +-
 test/lisp/net/dbus-tests.el                        |    2 +-
 test/lisp/net/dig-tests.el                         |    2 +-
 test/lisp/net/gnutls-tests.el                      |    2 +-
 test/lisp/net/hmac-md5-tests.el                    |    2 +-
 test/lisp/net/mailcap-tests.el                     |    2 +-
 test/lisp/net/netrc-tests.el                       |    2 +-
 test/lisp/net/network-stream-tests.el              |    2 +-
 test/lisp/net/newsticker-tests.el                  |    2 +-
 test/lisp/net/nsm-tests.el                         |    2 +-
 test/lisp/net/ntlm-tests.el                        |    2 +-
 test/lisp/net/puny-tests.el                        |    2 +-
 test/lisp/net/rcirc-tests.el                       |   14 +-
 test/lisp/net/rfc2104-tests.el                     |    2 +-
 test/lisp/net/sasl-scram-rfc-tests.el              |    2 +-
 test/lisp/net/secrets-tests.el                     |    2 +-
 test/lisp/net/shr-tests.el                         |    2 +-
 test/lisp/net/tramp-archive-tests.el               |    2 +-
 test/lisp/net/tramp-tests.el                       |  181 +-
 test/lisp/net/webjump-tests.el                     |    2 +-
 test/lisp/nxml/nxml-mode-tests.el                  |    2 +-
 test/lisp/nxml/xsd-regexp-tests.el                 |    2 +-
 test/lisp/obarray-tests.el                         |    2 +-
 test/lisp/obsolete/cl-tests.el                     |    2 +-
 test/lisp/org/org-tests.el                         |    2 +-
 test/lisp/paren-tests.el                           |    2 +-
 test/lisp/password-cache-tests.el                  |    2 +-
 test/lisp/pcmpl-linux-tests.el                     |    2 +-
 test/lisp/play/animate-tests.el                    |    2 +-
 test/lisp/play/dissociate-tests.el                 |    2 +-
 test/lisp/play/fortune-tests.el                    |    2 +-
 test/lisp/play/life-tests.el                       |    2 +-
 test/lisp/play/morse-tests.el                      |    2 +-
 test/lisp/play/studly-tests.el                     |    2 +-
 test/lisp/progmodes/asm-mode-tests.el              |    2 +-
 test/lisp/progmodes/autoconf-tests.el              |    2 +-
 test/lisp/progmodes/bat-mode-tests.el              |    2 +-
 test/lisp/progmodes/cc-mode-tests.el               |    2 +-
 test/lisp/progmodes/compile-tests.el               |    2 +-
 test/lisp/progmodes/cperl-mode-tests.el            |   10 +-
 test/lisp/progmodes/elisp-mode-tests.el            |    2 +-
 test/lisp/progmodes/etags-tests.el                 |    2 +-
 test/lisp/progmodes/f90-tests.el                   |    2 +-
 test/lisp/progmodes/flymake-tests.el               |    2 +-
 test/lisp/progmodes/gdb-mi-tests.el                |    2 +-
 test/lisp/progmodes/glasses-tests.el               |    2 +-
 test/lisp/progmodes/js-tests.el                    |    2 +-
 test/lisp/progmodes/opascal-tests.el               |    2 +-
 test/lisp/progmodes/pascal-tests.el                |    2 +-
 test/lisp/progmodes/perl-mode-tests.el             |    2 +-
 test/lisp/progmodes/ps-mode-tests.el               |    2 +-
 test/lisp/progmodes/python-tests.el                |    2 +-
 test/lisp/progmodes/ruby-mode-resources/ruby.rb    |    8 +
 test/lisp/progmodes/ruby-mode-tests.el             |    2 +-
 test/lisp/progmodes/scheme-tests.el                |    2 +-
 test/lisp/progmodes/sql-tests.el                   |    2 +-
 test/lisp/progmodes/subword-tests.el               |    2 +-
 test/lisp/progmodes/tcl-tests.el                   |    2 +-
 test/lisp/progmodes/xref-tests.el                  |   77 +-
 test/lisp/ps-print-tests.el                        |    2 +-
 test/lisp/register-tests.el                        |    2 +-
 test/lisp/replace-tests.el                         |    2 +-
 test/lisp/rot13-tests.el                           |    2 +-
 test/lisp/saveplace-tests.el                       |    2 +-
 test/lisp/scroll-lock-tests.el                     |    2 +-
 test/lisp/ses-tests.el                             |    2 +-
 test/lisp/shadowfile-tests.el                      |    2 +-
 test/lisp/shell-tests.el                           |    2 +-
 test/lisp/simple-tests.el                          |    2 +-
 .../so-long-tests/autoload-longlines-mode-tests.el |    2 +-
 .../so-long-tests/autoload-major-mode-tests.el     |    2 +-
 .../so-long-tests/autoload-minor-mode-tests.el     |    2 +-
 test/lisp/so-long-tests/so-long-tests-helpers.el   |    2 +-
 test/lisp/so-long-tests/so-long-tests.el           |    2 +-
 test/lisp/so-long-tests/spelling-tests.el          |    2 +-
 test/lisp/sort-tests.el                            |    2 +-
 test/lisp/soundex-tests.el                         |    2 +-
 test/lisp/startup-tests.el                         |    2 +-
 test/lisp/subr-tests.el                            |   34 +-
 test/lisp/tabify-tests.el                          |    2 +-
 test/lisp/tar-mode-tests.el                        |    2 +-
 test/lisp/tempo-tests.el                           |    2 +-
 test/lisp/term-tests.el                            |    2 +-
 test/lisp/term/tty-colors-tests.el                 |    2 +-
 test/lisp/textmodes/bibtex-tests.el                |    2 +-
 test/lisp/textmodes/conf-mode-tests.el             |    2 +-
 test/lisp/textmodes/css-mode-tests.el              |    2 +-
 test/lisp/textmodes/dns-mode-tests.el              |    2 +-
 test/lisp/textmodes/fill-tests.el                  |    2 +-
 test/lisp/textmodes/mhtml-mode-tests.el            |    2 +-
 test/lisp/textmodes/page-tests.el                  |    2 +-
 test/lisp/textmodes/paragraphs-tests.el            |    2 +-
 test/lisp/textmodes/po-tests.el                    |    2 +-
 test/lisp/textmodes/reftex-tests.el                |    2 +-
 test/lisp/textmodes/sgml-mode-tests.el             |    2 +-
 test/lisp/textmodes/tildify-tests.el               |    2 +-
 test/lisp/textmodes/underline-tests.el             |    2 +-
 test/lisp/thingatpt-tests.el                       |    2 +-
 test/lisp/thread-tests.el                          |    2 +-
 test/lisp/time-stamp-tests.el                      |    2 +-
 test/lisp/time-tests.el                            |    2 +-
 test/lisp/timezone-tests.el                        |    2 +-
 test/lisp/url/url-auth-tests.el                    |    2 +-
 test/lisp/url/url-domsuf-tests.el                  |    2 +-
 test/lisp/url/url-expand-tests.el                  |    2 +-
 test/lisp/url/url-file-tests.el                    |    2 +-
 test/lisp/url/url-future-tests.el                  |   10 +-
 test/lisp/url/url-handlers-test.el                 |    2 +-
 test/lisp/url/url-misc-tests.el                    |    2 +-
 test/lisp/url/url-parse-tests.el                   |    2 +-
 test/lisp/url/url-tramp-tests.el                   |    2 +-
 test/lisp/url/url-util-tests.el                    |    2 +-
 test/lisp/vc/add-log-tests.el                      |    2 +-
 test/lisp/vc/diff-mode-tests.el                    |    2 +-
 test/lisp/vc/ediff-diff-tests.el                   |    2 +-
 test/lisp/vc/ediff-ptch-tests.el                   |    2 +-
 test/lisp/vc/log-edit-tests.el                     |    2 +-
 test/lisp/vc/smerge-mode-tests.el                  |    2 +-
 test/lisp/vc/vc-bzr-tests.el                       |    2 +-
 test/lisp/vc/vc-hg-tests.el                        |    2 +-
 test/lisp/vc/vc-tests.el                           |    5 +-
 test/lisp/version-tests.el                         |    2 +-
 test/lisp/wdired-tests.el                          |    2 +-
 test/lisp/whitespace-tests.el                      |    2 +-
 test/lisp/wid-edit-tests.el                        |    2 +-
 test/lisp/xdg-tests.el                             |    2 +-
 test/lisp/xml-tests.el                             |    2 +-
 test/lisp/xt-mouse-tests.el                        |    2 +-
 test/manual/biditest.el                            |    2 +-
 test/manual/cedet/cedet-utests.el                  |    2 +-
 test/manual/cedet/ede-tests.el                     |    2 +-
 test/manual/cedet/semantic-tests.el                |    2 +-
 test/manual/cedet/srecode-tests.el                 |    2 +-
 test/manual/cedet/tests/test-fmt.cpp               |    2 +-
 test/manual/cedet/tests/test-fmt.el                |    2 +-
 test/manual/cedet/tests/test.c                     |    2 +-
 test/manual/cedet/tests/test.el                    |    2 +-
 test/manual/cedet/tests/test.make                  |    2 +-
 test/manual/cedet/tests/test.srt                   |    2 +-
 test/manual/cedet/tests/testdoublens.cpp           |    2 +-
 test/manual/cedet/tests/testdoublens.hpp           |    2 +-
 test/manual/cedet/tests/testjavacomp.java          |    2 +-
 test/manual/cedet/tests/testlocalvars.cpp          |    2 +-
 test/manual/cedet/tests/testnsp.cpp                |    2 +-
 test/manual/cedet/tests/testpolymorph.cpp          |    2 +-
 test/manual/cedet/tests/testspp.c                  |    2 +-
 test/manual/cedet/tests/testsppcomplete.c          |    2 +-
 test/manual/cedet/tests/testsppreplace.c           |    2 +-
 test/manual/cedet/tests/testsppreplaced.c          |    2 +-
 test/manual/cedet/tests/teststruct.cpp             |    2 +-
 test/manual/cedet/tests/testsubclass.cpp           |    2 +-
 test/manual/cedet/tests/testsubclass.hh            |    2 +-
 test/manual/cedet/tests/testtemplates.cpp          |    2 +-
 test/manual/cedet/tests/testtypedefs.cpp           |    2 +-
 test/manual/cedet/tests/testusing.cpp              |    2 +-
 test/manual/cedet/tests/testusing.hh               |    2 +-
 test/manual/cedet/tests/testvarnames.c             |    2 +-
 test/manual/cedet/tests/testvarnames.java          |    2 +-
 test/manual/cedet/tests/testwisent.wy              |    2 +-
 test/manual/etags/c-src/abbrev.c                   |    2 +-
 test/manual/etags/c-src/emacs/src/gmalloc.c        |    2 +-
 test/manual/etags/c-src/emacs/src/keyboard.c       |    2 +-
 test/manual/etags/c-src/emacs/src/lisp.h           |    2 +-
 test/manual/etags/c-src/emacs/src/regex.h          |    2 +-
 test/manual/etags/c-src/etags.c                    |    2 +-
 test/manual/etags/c-src/exit.c                     |    2 +-
 test/manual/etags/c-src/exit.strange_suffix        |    2 +-
 test/manual/etags/c-src/getopt.h                   |    2 +-
 test/manual/etags/c-src/sysdep.h                   |    2 +-
 .../etags/el-src/emacs/lisp/progmodes/etags.el     |    2 +-
 test/manual/etags/tex-src/texinfo.tex              |    2 +-
 test/manual/etags/y-src/cccp.c                     |    2 +-
 test/manual/etags/y-src/parse.c                    |    2 +-
 test/manual/etags/y-src/parse.y                    |    2 +-
 test/manual/image-circular-tests.el                |   87 +-
 test/manual/image-size-tests.el                    |    2 +-
 test/manual/image-transforms-tests.el              |    2 +-
 test/manual/indent/pascal.pas                      |    2 +-
 test/manual/redisplay-testsuite.el                 |    2 +-
 test/manual/scroll-tests.el                        |    2 +-
 test/src/alloc-tests.el                            |    2 +-
 test/src/buffer-tests.el                           |   35 +-
 test/src/callint-tests.el                          |    2 +-
 test/src/callproc-tests.el                         |    2 +-
 test/src/casefiddle-tests.el                       |    5 +-
 test/src/charset-tests.el                          |    2 +-
 test/src/chartab-tests.el                          |   22 +-
 test/src/cmds-tests.el                             |    2 +-
 test/src/coding-tests.el                           |    2 +-
 test/src/data-tests.el                             |    4 +-
 test/src/decompress-tests.el                       |    2 +-
 test/src/editfns-tests.el                          |    2 +-
 test/src/emacs-module-resources/mod-test.c         |   32 +-
 test/src/emacs-module-tests.el                     |   22 +-
 test/src/eval-tests.el                             |   19 +-
 test/src/fileio-tests.el                           |    8 +-
 test/src/floatfns-tests.el                         |    2 +-
 test/src/fns-tests.el                              |   59 +-
 test/src/font-tests.el                             |    2 +-
 test/src/indent-tests.el                           |    2 +-
 test/src/inotify-tests.el                          |    2 +-
 test/src/json-tests.el                             |    2 +-
 test/src/keyboard-tests.el                         |    2 +-
 test/src/keymap-tests.el                           |   15 +-
 test/src/lcms-tests.el                             |    2 +-
 test/src/lread-tests.el                            |    2 +-
 test/src/marker-tests.el                           |    2 +-
 test/src/minibuf-tests.el                          |    2 +-
 test/src/print-tests.el                            |    2 +-
 test/src/process-tests.el                          |  397 +-
 test/src/regex-emacs-tests.el                      |   66 +-
 test/src/syntax-tests.el                           |    2 +-
 test/src/textprop-tests.el                         |    2 +-
 test/src/thread-tests.el                           |    2 +-
 test/src/timefns-tests.el                          |    2 +-
 test/src/undo-tests.el                             |    2 +-
 test/src/xdisp-tests.el                            |    2 +-
 test/src/xfaces-tests.el                           |    2 +-
 test/src/xml-tests.el                              |    2 +-
 2941 files changed, 27040 insertions(+), 16358 deletions(-)

diff --git a/.clang-format b/.clang-format
index 7895ada..9ab09a8 100644
--- a/.clang-format
+++ b/.clang-format
@@ -4,7 +4,7 @@ AlignEscapedNewlinesLeft: true
 AlwaysBreakAfterReturnType: TopLevelDefinitions
 BreakBeforeBinaryOperators: All
 BreakBeforeBraces: GNU
-ColumnLimit: 80
+ColumnLimit: 70
 ContinuationIndentWidth: 2
 ForEachMacros: [FOR_EACH_TAIL, FOR_EACH_TAIL_SAFE]
 IncludeCategories:
diff --git a/.dir-locals.el b/.dir-locals.el
index 27d50c6..b313945 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -9,6 +9,7 @@
             (c-noise-macro-names . ("INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED" 
"UNINIT" "CALLBACK" "ALIGN_STACK"))
             (electric-quote-comment . nil)
             (electric-quote-string . nil)
+            (indent-tabs-mode . t)
            (mode . bug-reference-prog)))
  (objc-mode . ((c-file-style . "GNU")
                (electric-quote-comment . nil)
diff --git a/.gitattributes b/.gitattributes
index 00f434d..a99cf12 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,6 +1,6 @@
 # Attributes of Emacs files in the Git repository.
 
-# Copyright 2015-2020 Free Software Foundation, Inc.
+# Copyright 2015-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/.gitignore b/.gitignore
index bf7e934..dd4eab7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
 # Files that Git should ignore in the Emacs source directory.
 
-# Copyright 2009-2020 Free Software Foundation, Inc.
+# Copyright 2009-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f4e08d5..bc18137 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-# Copyright (C) 2017-2020 Free Software Foundation, Inc.
+# Copyright (C) 2017-2021 Free Software Foundation, Inc.
 #
 #  This file is part of GNU Emacs.
 #
@@ -91,7 +91,7 @@ test-filenotify-gio:
     - ./autogen.sh autoconf
     - ./configure --without-makeinfo --with-file-notification=gfile
     - make bootstrap
-    - make -C test autorevert-tests filenotify-tests
+    - make -k -C test autorevert-tests filenotify-tests
 
 test-gnustep:
   stage: test
diff --git a/ChangeLog.1 b/ChangeLog.1
index b01a316..82e0ad5 100644
--- a/ChangeLog.1
+++ b/ChangeLog.1
@@ -14700,7 +14700,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1993-1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1993-1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/ChangeLog.2 b/ChangeLog.2
index 5e9b8b9..7b40c54 100644
--- a/ChangeLog.2
+++ b/ChangeLog.2
@@ -35787,7 +35787,7 @@ See ChangeLog.1 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2015-2020 Free Software Foundation, Inc.
+  Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/ChangeLog.3 b/ChangeLog.3
index 0f36310..22b45cb 100644
--- a/ChangeLog.3
+++ b/ChangeLog.3
@@ -142485,7 +142485,7 @@ See ChangeLog.2 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2015-2020 Free Software Foundation, Inc.
+  Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/GNUmakefile b/GNUmakefile
index c6407d0..f271638 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,6 +1,6 @@
 # Build Emacs from a fresh tarball or version-control checkout.
 
-# Copyright (C) 2011-2020 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/INSTALL b/INSTALL
index 324ef60..b6f681a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,5 +1,5 @@
 GNU Emacs Installation Guide
-Copyright (C) 1992, 1994, 1996-1997, 2000-2020 Free Software Foundation,
+Copyright (C) 1992, 1994, 1996-1997, 2000-2021 Free Software Foundation,
 Inc.
 See the end of the file for license conditions.
 
diff --git a/INSTALL.REPO b/INSTALL.REPO
index da0c220..da56d76 100644
--- a/INSTALL.REPO
+++ b/INSTALL.REPO
@@ -83,7 +83,7 @@ never platform-specific.
 
 
 
-Copyright (C) 2002-2020 Free Software Foundation, Inc.
+Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/Makefile.in b/Makefile.in
index fbb1891..f963351 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 1992-2020 Free Software Foundation, Inc.
+# Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/README b/README
index 3d499a3..a1d5e2d 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/admin/ChangeLog.1 b/admin/ChangeLog.1
index 64c65bd..f3de691 100644
--- a/admin/ChangeLog.1
+++ b/admin/ChangeLog.1
@@ -2577,7 +2577,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/admin/README b/admin/README
index 67f51a3..312f098 100644
--- a/admin/README
+++ b/admin/README
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/admin/admin.el b/admin/admin.el
index 22d2967..fa96b7e 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -1,6 +1,6 @@
 ;;; admin.el --- utilities for Emacs administration
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/admin/alloc-colors.c b/admin/alloc-colors.c
index 203605c..ea5b750 100644
--- a/admin/alloc-colors.c
+++ b/admin/alloc-colors.c
@@ -1,6 +1,6 @@
 /* Allocate X colors.  Used for testing with dense colormaps.
 
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/admin/authors.el b/admin/authors.el
index cf9cf98..0180ffe 100644
--- a/admin/authors.el
+++ b/admin/authors.el
@@ -1,6 +1,6 @@
 ;;; authors.el --- utility for maintaining Emacs's AUTHORS file
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Gerd Moellmann <gerd@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
@@ -467,7 +467,12 @@ Changes to files matching one of the regexps in this list 
are not listed.")
     "notes/font-backend"
     ;; ada-mode has been deleted, now in GNU ELPA
     "ada-mode.texi"
+    "doc/misc/ada-mode.texi"
+    "lisp/progmodes/ada-mode.el"
+    "lisp/progmodes/ada-prj.el"
+    "lisp/progmodes/ada-xref.el"
     "GNUS-NEWS"
+    "etc/GNUS-NEWS"
     "doc/misc/gnus-news.el"
     "src/fingerprint-dummy.c"
     "src/fingerprint.h"
@@ -878,6 +883,7 @@ Changes to files in this list are not listed.")
     "lisp/obsolete/spell.el"
     "lisp/obsolete/swedish.el"
     "lisp/obsolete/sym-comp.el"
+    "obsolete/sym-comp.el"
     "library-of-babel.org"
     "flymake-elisp.el"
     "flymake-ui.el"
@@ -999,7 +1005,8 @@ in the repository.")
     ("nxml/test.invalid.xml" . "test-invalid.xml")
     ("nxml/test.valid.xml" . "test-valid.xml")
     ("automated/Makefile.in" . "test/Makefile.in")
-    ("test/rmailmm.el" . "rmailmm.el")
+    ("test/rmailmm.el" . "test/manual/rmailmm.el")
+    ("rmailmm.el" . "test/manual/rmailmm.el")
     ;; The one in lisp is eshell/eshell.el.
     ("eshell.el" . "eshell-tests.el")
     ("automated/eshell.el" . "eshell-tests.el")
@@ -1123,10 +1130,13 @@ in the repository.")
     ("lisp/net/starttls.el" . "lisp/obsolete/starttls.el")
     ("url-ns.el" . "lisp/obsolete/url-ns.el")
     ("gnus-news.texi" . "doc/misc/gnus.texi")
-    ("lisp/multifile.el". "lisp/fileloop.el")
-    ("lisp/emacs-lisp/thread.el". "lisp/thread.el")
+    ("lisp/multifile.el" . "lisp/fileloop.el")
+    ("lisp/emacs-lisp/thread.el" . "lisp/thread.el")
+    ("lisp/emacs-lisp/cl.el" . "lisp/emacs-lisp/cl-lib.el")
+    ("lisp/progmodes/mantemp.el" . "lisp/obsolete/mantemp.el")
     ("src/mini-gmp.c" . "lib/mini-gmp.c")
     ("src/mini-gmp.h" . "lib/mini-gmp.h")
+    ("sysdep.c" . "src/sysdep.c")
     )
   "Alist of files which have been renamed during their lifetime.
 Elements are (OLDNAME . NEWNAME).")
@@ -1600,7 +1610,7 @@ and a buffer *Authors Errors* containing references to 
unknown files."
       ;; the versioned ChangeLog.N rather than the unversioned ChangeLog.
       (zerop (call-process "make" nil nil nil
                            "-C" root "change-history-nocommit"))
-      (error "Problem updating ChangeLog"))
+      (error "Problem updating ChangeLog, try \"C-u M-x authors RET\""))
   (let ((logs (process-lines find-program root "-name" "ChangeLog*"))
        (table (make-hash-table :test 'equal))
        (buffer-name "*Authors*")
diff --git a/admin/automerge b/admin/automerge
index cd0f22c..6157058 100755
--- a/admin/automerge
+++ b/admin/automerge
@@ -1,7 +1,7 @@
 #!/bin/bash
 ### automerge - automatically merge the Emacs release branch to master
 
-## Copyright (C) 2018-2020 Free Software Foundation, Inc.
+## Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ## Author: Glenn Morris <rgm@gnu.org>
 ## Maintainer: emacs-devel@gnu.org
diff --git a/admin/build-configs b/admin/build-configs
index dfd037c..2e04e00 100755
--- a/admin/build-configs
+++ b/admin/build-configs
@@ -1,7 +1,7 @@
 #! /usr/bin/perl
 # Build Emacs in several different configurations.
 
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/admin/charsets/Makefile.in b/admin/charsets/Makefile.in
index 3af0f02..0fd130d 100644
--- a/admin/charsets/Makefile.in
+++ b/admin/charsets/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 2015-2020 Free Software Foundation, Inc.
+# Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 #   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/admin/charsets/mapconv b/admin/charsets/mapconv
index ad62f3c..f933c34 100755
--- a/admin/charsets/mapconv
+++ b/admin/charsets/mapconv
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2015-2020 Free Software Foundation, Inc.
+# Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 #   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/admin/charsets/mapfiles/README b/admin/charsets/mapfiles/README
index c320567..60f0912 100644
--- a/admin/charsets/mapfiles/README
+++ b/admin/charsets/mapfiles/README
@@ -1,4 +1,4 @@
-Copyright (C) 2009-2020 Free Software Foundation, Inc.
+Copyright (C) 2009-2021 Free Software Foundation, Inc.
 Copyright (C) 2009, 2010, 2011
   National Institute of Advanced Industrial Science and Technology (AIST)
   Registration Number H13PRO009
diff --git a/admin/cus-test.el b/admin/cus-test.el
index b4e4b42..aca7b68 100644
--- a/admin/cus-test.el
+++ b/admin/cus-test.el
@@ -1,6 +1,6 @@
 ;;; cus-test.el --- tests for custom types and load problems
 
-;; Copyright (C) 1998, 2000, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Markus Rost <rost@math.uni-bielefeld.de>
 ;; Created: 13 Sep 1998
diff --git a/admin/diff-tar-files b/admin/diff-tar-files
index cbcec86..cdcc512 100755
--- a/admin/diff-tar-files
+++ b/admin/diff-tar-files
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -35,7 +35,7 @@ old_tmp=/tmp/old.$$
 new_tmp=/tmp/new.$$
 trap "rm -f $old_tmp $new_tmp; exit 1" 1 2 15
 
-tar tzf $old_tar | sed -e 's,^[^/]*,,' | sort > $old_tmp
-tar tzf $new_tar | sed -e 's,^[^/]*,,' | sort > $new_tmp
+tar tzf "$old_tar" | sed -e 's,^[^/]*,,' | sort > $old_tmp
+tar tzf "$new_tar" | sed -e 's,^[^/]*,,' | sort > $new_tmp
 diff -u $old_tmp $new_tmp
 rm -f $new_tmp $old_tmp
diff --git a/admin/emake b/admin/emake
new file mode 100755
index 0000000..d9aa4ea
--- /dev/null
+++ b/admin/emake
@@ -0,0 +1,85 @@
+#!/bin/bash
+
+# This script is meant to be used as ./admin/emake, and will compile
+# the Emacs tree with virtually all of the informational messages
+# removed, and with errors/warnings highlighted in red.  It'll give a
+# quick overview to confirm that nothing has broken, for instance
+# after doing a "git pull".  It's not meant to be used during actual
+# development, because it removes so much information that commands
+# like `next-error' won't be able to jump to the source code where
+# errors are.
+
+cores=1
+
+# Determine the number of cores.
+if [ -f /proc/cpuinfo ]; then
+    cores=$(($(egrep "^physical id|^cpu cores" /proc/cpuinfo |\
+       awk '{ print $4; }' |\
+       sed '$!N;s/\n/ /' |\
+       uniq |\
+       sed 's/^[0-9]*/+/')))
+fi
+
+make -j$cores "$@" 2>&1 | \
+sed -u 's# \.\./\.\./# #
+s# \.\./# #
+s#^Configuring local git # Configuring local git #
+s#^Installing git hooks...# Installing git hooks...#
+s#^Running # Running #
+s#^Configured for # Configured for #
+s#^./temacs # ./temacs #
+s#^Dumping under the name# Dumping under the name#
+' | \
+egrep --line-buffered -v "^make|\
+^Loading|\
+SCRAPE|\
+INFO.*Scraping.*[.]\$|\
+^Waiting for git|\
+^Finding pointers|\
+^Using load-path|\
+^Adding name|\
+^Dump mode|\
+^Dumping finger|\
+^Byte counts|\
+^Reloc counts|\
+^Pure-hashed|\
+^cp -f temacs|\
+^rm -f bootstrap|\
+^Dump complete|\
+^rm -f emacs|\
+mkdir -p etc|\
+mkdir -p info|\
+mkdir -p lisp|\
+^LC_ALL.*pdump|\
+^cp -f emacs.p|\
+GEN.*loaddefs|\
+^Reloading stale|\
+^Source file.*newer than|\
+^Directories for loaddefs|\
+^./autogen.sh|\
+^[Cc]hecking |\
+^.Read INSTALL.REPO for more|\
+^Your system has the required tools.|\
+^Building aclocal.m4|\
+^ Running 'autoreconf|\
+^You can now run './configure'|\
+^./configure|\
+^configure: creating|\
+^\"configure\" file built.|\
+^There seems to be no|\
+^config.status:|\
+^ *$|\
+^Makefile built|\
+The GNU allocators don't work|\
+^git config |\
+^'\.git/|\
+^\^\(\(|\
+^'build-aux/git-hooks\
+" | \
+while read
+do
+  C=""
+  [[ "X${REPLY:0:1}" != "X " ]] && C="\033[1;31m"
+  [[ "X${REPLY:0:3}" == "X   " ]] && C="\033[1;31m"
+  [[ "X$C" == "X" ]] && printf "%s\n" "$REPLY" || printf "$C%s\033[0m\n" 
"$REPLY"
+done
diff --git a/admin/find-gc.el b/admin/find-gc.el
index 7de2474..c70a051 100644
--- a/admin/find-gc.el
+++ b/admin/find-gc.el
@@ -1,6 +1,6 @@
 ;;; find-gc.el --- detect functions that call the garbage collector
 
-;; Copyright (C) 1992, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 
diff --git a/admin/gitmerge.el b/admin/gitmerge.el
index 18da466..1364bdc 100644
--- a/admin/gitmerge.el
+++ b/admin/gitmerge.el
@@ -1,6 +1,6 @@
 ;;; gitmerge.el --- help merge one Emacs branch into another
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Authors: David Engster <deng@randomsample.de>
 ;;          Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/admin/grammars/Makefile.in b/admin/grammars/Makefile.in
index a170e08..98c9c62 100644
--- a/admin/grammars/Makefile.in
+++ b/admin/grammars/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-## Copyright (C) 2013-2020 Free Software Foundation, Inc.
+## Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ## This file is part of GNU Emacs.
 
diff --git a/admin/grammars/c.by b/admin/grammars/c.by
index d12e6f9..2d04c99 100644
--- a/admin/grammars/c.by
+++ b/admin/grammars/c.by
@@ -1,5 +1,5 @@
 ;;; c.by -- LL grammar for C/C++ language specification
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;;         David Ponce <david@dponce.com>
diff --git a/admin/grammars/grammar.wy b/admin/grammars/grammar.wy
index 1ae2a90..054e85b 100644
--- a/admin/grammars/grammar.wy
+++ b/admin/grammars/grammar.wy
@@ -1,6 +1,6 @@
 ;;; semantic-grammar.wy -- LALR grammar of Semantic input grammars
 ;;
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: 26 Aug 2002
diff --git a/admin/grammars/java-tags.wy b/admin/grammars/java-tags.wy
index 678b36c..486924b 100644
--- a/admin/grammars/java-tags.wy
+++ b/admin/grammars/java-tags.wy
@@ -1,6 +1,6 @@
 ;;; java-tags.wy -- Semantic LALR grammar for Java
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: 26 Aug 2002
diff --git a/admin/grammars/js.wy b/admin/grammars/js.wy
index 94837ba..e85db15 100644
--- a/admin/grammars/js.wy
+++ b/admin/grammars/js.wy
@@ -1,6 +1,6 @@
 ;;; javascript-jv.wy -- LALR grammar for Javascript
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1998-2011 Ecma International.
 
 ;; Author: Joakim Verona
diff --git a/admin/grammars/make.by b/admin/grammars/make.by
index 7573d0c..f66585e 100644
--- a/admin/grammars/make.by
+++ b/admin/grammars/make.by
@@ -1,6 +1,6 @@
 ;;; make.by -- BY notation for Makefiles.
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;;         David Ponce <david@dponce.com>
diff --git a/admin/grammars/python.wy b/admin/grammars/python.wy
index 5790461..aaa25ce 100644
--- a/admin/grammars/python.wy
+++ b/admin/grammars/python.wy
@@ -1,6 +1,6 @@
 ;;; python.wy -- LALR grammar for Python
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 ;; Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
 ;; 2009, 2010 Python Software Foundation; All Rights Reserved
 
diff --git a/admin/grammars/scheme.by b/admin/grammars/scheme.by
index 572cf56..c3abb5a 100644
--- a/admin/grammars/scheme.by
+++ b/admin/grammars/scheme.by
@@ -1,6 +1,6 @@
 ;;; scheme.by -- Scheme BNF language specification
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/admin/grammars/srecode-template.wy 
b/admin/grammars/srecode-template.wy
index c8d1492..868a81c 100644
--- a/admin/grammars/srecode-template.wy
+++ b/admin/grammars/srecode-template.wy
@@ -1,6 +1,6 @@
 ;;; srecode-template.wy --- Semantic Recoder Template parser
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/admin/last-chance.el b/admin/last-chance.el
index 8ee6af5..fd5b8e9 100644
--- a/admin/last-chance.el
+++ b/admin/last-chance.el
@@ -1,6 +1,6 @@
 ;;; last-chance.el --- dangling deterrence     -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Thien-Thi Nguyen <ttn@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/admin/make-emacs b/admin/make-emacs
index 634c226..fa7880b 100755
--- a/admin/make-emacs
+++ b/admin/make-emacs
@@ -2,7 +2,7 @@
 # Build Emacs with various options for profiling, debugging,
 # with and without warnings enabled etc.
 
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/admin/make-manuals b/admin/make-manuals
index 13a8148..f133949 100755
--- a/admin/make-manuals
+++ b/admin/make-manuals
@@ -1,7 +1,7 @@
 #!/bin/bash
 ### make-manuals - create the Emacs manuals to upload to the gnu.org website
 
-## Copyright 2018-2020 Free Software Foundation, Inc.
+## Copyright 2018-2021 Free Software Foundation, Inc.
 
 ## Author: Glenn Morris <rgm@gnu.org>
 ## Maintainer: emacs-devel@gnu.org
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index 2c81a49..5125086 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -33,17 +33,32 @@ General steps (for each step, check for possible errors):
     or some form of "git clean -x".  It's probably simpler and safer to
     make a new working directory exclusively for the release branch.
 
+    Make sure the tree is built, or at least configured.  That's
+    because some of the commands below run Make, so they need
+    Makefiles to be present.
+
 2.  Regenerate the etc/AUTHORS file:
       M-: (require 'authors) RET
       M-x authors RET
 
     (This first updates the current versioned ChangeLog.N)
 
-    If there is an "*Authors Errors*" buffer, address the issues.
-    If there was a ChangeLog typo, fix the relevant entry.
-    If a file was deleted or renamed, consider adding an appropriate
-    entry to authors-ignored-files, authors-valid-file-names, or
-    authors-renamed-files-alist.
+    If this says "Problem updating ChangeLog", find the reason for the
+    failure of the command it runs, viz.:
+
+       make -C ROOT change-history-nocommit
+
+    (where ROOT is the top-level directory where you run this).  It
+    could be because there are uncommitted changes in ChangeLog.N, for
+    example.  One possible way forward is to invoke "C-u M-x authors",
+    which will skip updating the versioned ChangeLog.N file.
+
+    After "M-x authors" finishes, if there is an "*Authors Errors*"
+    buffer, address the issues.  If there was a ChangeLog typo, fix
+    the relevant entry.  If a file was deleted or renamed, consider
+    adding an appropriate entry to variables authors-ignored-files,
+    authors-valid-file-names, or authors-renamed-files-alist in
+    authors.el.
 
     If necessary, repeat 'C-u M-x authors' after making those changes.
     Save the "*Authors*" buffer as etc/AUTHORS.
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index 164300e..1c8b442 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -4,7 +4,7 @@
 #
 #      admin/merge-gnulib
 
-# Copyright 2012-2020 Free Software Foundation, Inc.
+# Copyright 2012-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -34,7 +34,8 @@ GNULIB_MODULES='
   d-type diffseq double-slash-root dtoastr dtotimespec dup2
   environ execinfo explicit_bzero faccessat
   fchmodat fcntl fcntl-h fdopendir
-  filemode filename filevercmp flexmember fpieee fstatat fsusage fsync futimens
+  filemode filename filevercmp flexmember fpieee
+  free-posix fstatat fsusage fsync futimens
   getloadavg getopt-gnu getrandom gettime gettimeofday gitlog-to-changelog
   ieee754-h ignore-value intprops largefile libgmp lstat
   manywarnings memmem-simple mempcpy memrchr minmax mkostemp mktime nstrftime
diff --git a/admin/merge-pkg-config b/admin/merge-pkg-config
index 6ec54ce..1136a30 100755
--- a/admin/merge-pkg-config
+++ b/admin/merge-pkg-config
@@ -4,7 +4,7 @@
 #
 #      admin/merge-pkg-config
 
-# Copyright 2014-2020 Free Software Foundation, Inc.
+# Copyright 2014-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -60,4 +60,4 @@ test -d m4 || {
 
 printf >&2 '%s\n' "$0: copying $dir/pkg.m4 to m4/pkg.m4"
 
-cp $dir/pkg.m4 m4
+cp "$dir"/pkg.m4 m4
diff --git a/admin/notes/copyright b/admin/notes/copyright
index 156eec0..5b00c82 100644
--- a/admin/notes/copyright
+++ b/admin/notes/copyright
@@ -1,4 +1,4 @@
-Copyright (C) 2007-2020 Free Software Foundation, Inc.
+Copyright (C) 2007-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/admin/notes/emba b/admin/notes/emba
index 76b0d3c..adebcef 100644
--- a/admin/notes/emba
+++ b/admin/notes/emba
@@ -1,6 +1,6 @@
 -*- mode: outline; coding: utf-8 -*-
 
-Copyright (C) 2019-2020 Free Software Foundation, Inc.
+Copyright (C) 2019-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 NOTES FOR EMACS CONTINUOUS BUILD ON EMBA
diff --git a/admin/notes/hydra b/admin/notes/hydra
index 1b7d915..62ad7eb 100644
--- a/admin/notes/hydra
+++ b/admin/notes/hydra
@@ -1,6 +1,6 @@
 -*- mode: outline; coding: utf-8 -*-
 
-Copyright (C) 2013-2020 Free Software Foundation, Inc.
+Copyright (C) 2013-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 NOTES FOR EMACS CONTINUOUS BUILD ON HYDRA
diff --git a/admin/notes/multi-tty b/admin/notes/multi-tty
index dee816d..1a337b9 100644
--- a/admin/notes/multi-tty
+++ b/admin/notes/multi-tty
@@ -1,6 +1,6 @@
 -*- coding: utf-8; mode: text; -*-
 
-Copyright (C) 2007-2020 Free Software Foundation, Inc.
+Copyright (C) 2007-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 From README.multi-tty in the multi-tty branch.
diff --git a/admin/notes/unicode b/admin/notes/unicode
index 1e41859..45455d8 100644
--- a/admin/notes/unicode
+++ b/admin/notes/unicode
@@ -1,6 +1,6 @@
                                             -*-mode: text; coding: utf-8;-*-
 
-Copyright (C) 2002-2020 Free Software Foundation, Inc.
+Copyright (C) 2002-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Importing a new Unicode Standard version into Emacs
diff --git a/admin/notes/www b/admin/notes/www
index cfc23ac..524b908 100644
--- a/admin/notes/www
+++ b/admin/notes/www
@@ -1,6 +1,6 @@
 -*- outline -*-
 
-Copyright (C) 2013-2020 Free Software Foundation, Inc.
+Copyright (C) 2013-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 NOTES FOR EMACS WWW PAGES
diff --git a/admin/nt/README-UNDUMP.W32 b/admin/nt/README-UNDUMP.W32
index 7937d65..aaaea3b 100644
--- a/admin/nt/README-UNDUMP.W32
+++ b/admin/nt/README-UNDUMP.W32
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
                           Emacs for Windows
diff --git a/admin/nt/dist-build/README-windows-binaries 
b/admin/nt/dist-build/README-windows-binaries
index 01f7ed9..001bdd7 100644
--- a/admin/nt/dist-build/README-windows-binaries
+++ b/admin/nt/dist-build/README-windows-binaries
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
                      Precompiled Distributions of
diff --git a/admin/nt/dist-build/build-dep-zips.py 
b/admin/nt/dist-build/build-dep-zips.py
index 7047d28..47185db 100755
--- a/admin/nt/dist-build/build-dep-zips.py
+++ b/admin/nt/dist-build/build-dep-zips.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python3
 
-## Copyright (C) 2017-2020 Free Software Foundation, Inc.
+## Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ## This file is part of GNU Emacs.
 
@@ -18,7 +18,6 @@
 ## along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
 import argparse
 import multiprocessing as mp
-import glob
 import os
 import shutil
 import re
diff --git a/admin/nt/dist-build/build-zips.sh 
b/admin/nt/dist-build/build-zips.sh
index 8eaa3a9..809cbc6 100755
--- a/admin/nt/dist-build/build-zips.sh
+++ b/admin/nt/dist-build/build-zips.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-## Copyright (C) 2017-2020 Free Software Foundation, Inc.
+## Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ## This file is part of GNU Emacs.
 
diff --git a/admin/quick-install-emacs b/admin/quick-install-emacs
index 0439c77..475658a 100755
--- a/admin/quick-install-emacs
+++ b/admin/quick-install-emacs
@@ -1,7 +1,7 @@
 #!/bin/sh
 ### quick-install-emacs --- do a halfway-decent job of installing emacs quickly
 
-## Copyright (C) 2001-2020 Free Software Foundation, Inc.
+## Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ## Author: Miles Bader <miles@gnu.org>
 
diff --git a/admin/unidata/Makefile.in b/admin/unidata/Makefile.in
index f3e1c78..f31e1bb 100644
--- a/admin/unidata/Makefile.in
+++ b/admin/unidata/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 2012-2020 Free Software Foundation, Inc.
+# Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
 #   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/admin/unidata/blocks.awk b/admin/unidata/blocks.awk
index 70e96ed..986d299 100755
--- a/admin/unidata/blocks.awk
+++ b/admin/unidata/blocks.awk
@@ -1,6 +1,6 @@
 #!/usr/bin/awk -f
 
-## Copyright (C) 2015-2020 Free Software Foundation, Inc.
+## Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ## Author: Glenn Morris <rgm@gnu.org>
 ## Maintainer: emacs-devel@gnu.org
diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el
index 510bb79..3918853 100644
--- a/admin/unidata/unidata-gen.el
+++ b/admin/unidata/unidata-gen.el
@@ -1,6 +1,6 @@
 ;; unidata-gen.el -- Create files containing character property data  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/admin/unidata/uvs.el b/admin/unidata/uvs.el
index 6b8909c..0141b63 100644
--- a/admin/unidata/uvs.el
+++ b/admin/unidata/uvs.el
@@ -1,6 +1,6 @@
 ;;; uvs.el --- utility for UVS (format 14) cmap subtables in OpenType fonts  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
 
diff --git a/admin/update-copyright b/admin/update-copyright
index a70d7a3..8695383 100755
--- a/admin/update-copyright
+++ b/admin/update-copyright
@@ -7,7 +7,7 @@
 # By default, this script uses the local-time calendar year.
 # Set the UPDATE_COPYRIGHT_YEAR environment variable to override the default.
 
-# Copyright 2013-2020 Free Software Foundation, Inc.
+# Copyright 2013-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/admin/update_autogen b/admin/update_autogen
index d60984e..35c391d 100755
--- a/admin/update_autogen
+++ b/admin/update_autogen
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 ### update_autogen - update some auto-generated files in the Emacs tree
 
-## Copyright (C) 2011-2020 Free Software Foundation, Inc.
+## Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ## Author: Glenn Morris <rgm@gnu.org>
 ## Maintainer: emacs-devel@gnu.org
diff --git a/admin/upload-manuals b/admin/upload-manuals
index b718797..52999c2 100755
--- a/admin/upload-manuals
+++ b/admin/upload-manuals
@@ -2,7 +2,7 @@
 
 ### upload-manuals - upload the Emacs manuals to the gnu.org website
 
-## Copyright 2018-2020 Free Software Foundation, Inc.
+## Copyright 2018-2021 Free Software Foundation, Inc.
 
 ## Author: Glenn Morris <rgm@gnu.org>
 ## Maintainer: emacs-devel@gnu.org
diff --git a/autogen.sh b/autogen.sh
index c5e1490..531e577 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 ### autogen.sh - tool to help build Emacs from a repository checkout
 
-## Copyright (C) 2011-2020 Free Software Foundation, Inc.
+## Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ## Author: Glenn Morris <rgm@gnu.org>
 ## Maintainer: emacs-devel@gnu.org
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 9aff91c..7f74817 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2020 Free Software Foundation, Inc.
 
-timestamp='2020-08-17'
+timestamp='2020-12-22'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -27,12 +27,12 @@ timestamp='2020-08-17'
 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
 #
 # Please send patches to <config-patches@gnu.org>.
 
 
-me=`echo "$0" | sed -e 's,.*/,,'`
+me=$(echo "$0" | sed -e 's,.*/,,')
 
 usage="\
 Usage: $0 [OPTION]
@@ -103,7 +103,7 @@ set_cc_for_build() {
     test "$tmp" && return 0
     : "${TMPDIR=/tmp}"
     # shellcheck disable=SC2039
-    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n 
"$tmp" && test -d "$tmp" ; } ||
+    { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test 
-n "$tmp" && test -d "$tmp" ; } ||
        { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir 
"$tmp" 2>/dev/null) ; } ||
        { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo 
"Warning: creating insecure temp directory" >&2 ; } ||
        { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 
1 ; }
@@ -131,16 +131,14 @@ if test -f /.attbin/uname ; then
        PATH=$PATH:/.attbin ; export PATH
 fi
 
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown
+UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown
+UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown
+UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown
 
 case "$UNAME_SYSTEM" in
 Linux|GNU|GNU/*)
-       # If the system lacks a compiler, then just pick glibc.
-       # We could probably try harder.
-       LIBC=gnu
+       LIBC=unknown
 
        set_cc_for_build
        cat <<-EOF > "$dummy.c"
@@ -149,17 +147,29 @@ Linux|GNU|GNU/*)
        LIBC=uclibc
        #elif defined(__dietlibc__)
        LIBC=dietlibc
-       #else
+       #elif defined(__GLIBC__)
        LIBC=gnu
+       #else
+       #include <stdarg.h>
+       /* First heuristic to detect musl libc.  */
+       #ifdef __DEFINED_va_list
+       LIBC=musl
+       #endif
        #endif
        EOF
-       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, 
,,g'`"
+       eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 
's, ,,g')"
 
-       # If ldd exists, use it to detect musl libc.
-       if command -v ldd >/dev/null && \
-               ldd --version 2>&1 | grep -q ^musl
-       then
-           LIBC=musl
+       # Second heuristic to detect musl libc.
+       if [ "$LIBC" = unknown ] &&
+          command -v ldd >/dev/null &&
+          ldd --version 2>&1 | grep -q ^musl; then
+               LIBC=musl
+       fi
+
+       # If the system lacks a compiler, then just pick glibc.
+       # We could probably try harder.
+       if [ "$LIBC" = unknown ]; then
+               LIBC=gnu
        fi
        ;;
 esac
@@ -179,19 +189,20 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        # Note: NetBSD doesn't particularly care about the vendor
        # portion of the name.  We always set it to "unknown".
        sysctl="sysctl -n hw.machine_arch"
-       UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+       UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
            "/sbin/$sysctl" 2>/dev/null || \
            "/usr/sbin/$sysctl" 2>/dev/null || \
-           echo unknown)`
+           echo unknown))
        case "$UNAME_MACHINE_ARCH" in
+           aarch64eb) machine=aarch64_be-unknown ;;
            armeb) machine=armeb-unknown ;;
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
            sh5el) machine=sh5le-unknown ;;
            earmv*)
-               arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 
's,^e\(armv[0-9]\).*$,\1,'`
-               endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 
's,^.*\(eb\)$,\1,p'`
+               arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 
's,^e\(armv[0-9]\).*$,\1,')
+               endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 
's,^.*\(eb\)$,\1,p')
                machine="${arch}${endian}"-unknown
                ;;
            *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
@@ -222,7 +233,7 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        case "$UNAME_MACHINE_ARCH" in
            earm*)
                expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-               abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
+               abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr")
                ;;
        esac
        # The OS release
@@ -235,7 +246,7 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
                release='-gnu'
                ;;
            *)
-               release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. 
-f1,2`
+               release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. 
-f1,2)
                ;;
        esac
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
@@ -244,15 +255,15 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        echo "$machine-${os}${release}${abi-}"
        exit ;;
     *:Bitrig:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+       UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//')
        echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
        exit ;;
     *:OpenBSD:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+       UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//')
        echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
        exit ;;
     *:LibertyBSD:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+       UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//')
        echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
        exit ;;
     *:MidnightBSD:*:*)
@@ -288,17 +299,17 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
        *4.0)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+               UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}')
                ;;
        *5.*)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}')
                ;;
        esac
        # According to Compaq, /usr/sbin/psrinfo has been available on
        # OSF/1 and Tru64 systems produced since 1995.  I hope that
        # covers most systems running today.  This code pipes the CPU
        # types through head -n 1, so we only detect the type of CPU 0.
-       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) 
processor.*$/\1/p' | head -n 1`
+       ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha 
\(.*\) processor.*$/\1/p' | head -n 1)
        case "$ALPHA_CPU_TYPE" in
            "EV4 (21064)")
                UNAME_MACHINE=alpha ;;
@@ -336,7 +347,7 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        # A Tn.n version is a released field test version.
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
-       echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 
's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
+       echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 
's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)"
        # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
        exitcode=$?
        trap '' 0
@@ -370,7 +381,7 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        exit ;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-       if test "`(/bin/universe) 2>/dev/null`" = att ; then
+       if test "$( (/bin/universe) 2>/dev/null)" = att ; then
                echo pyramid-pyramid-sysv3
        else
                echo pyramid-pyramid-bsd
@@ -383,17 +394,17 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        echo sparc-icl-nx6
        exit ;;
     DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
-       case `/usr/bin/uname -p` in
+       case $(/usr/bin/uname -p) in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
     s390x:SunOS:*:*)
-       echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 
's/[^.]*//'`"
+       echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 
's/[^.]*//')"
        exit ;;
     sun4H:SunOS:5.*:*)
-       echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+       echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
        exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-       echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+       echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
        exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
        echo i386-pc-auroraux"$UNAME_RELEASE"
@@ -412,30 +423,30 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
                SUN_ARCH=x86_64
            fi
        fi
-       echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+       echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 
's/[^.]*//')"
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
        # it's likely to be more like Solaris than SunOS4.
-       echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+       echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
        exit ;;
     sun4*:SunOS:*:*)
-       case "`/usr/bin/arch -k`" in
+       case "$(/usr/bin/arch -k)" in
            Series*|S4*)
-               UNAME_RELEASE=`uname -v`
+               UNAME_RELEASE=$(uname -v)
                ;;
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
-       echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
+       echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')"
        exit ;;
     sun3*:SunOS:*:*)
        echo m68k-sun-sunos"$UNAME_RELEASE"
        exit ;;
     sun*:*:4.2BSD:*)
-       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 
2>/dev/null`
+       UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 
2>/dev/null)
        test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
-       case "`/bin/arch`" in
+       case "$(/bin/arch)" in
            sun3)
                echo m68k-sun-sunos"$UNAME_RELEASE"
                ;;
@@ -515,8 +526,8 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        }
 EOF
        $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
-         dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-         SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
+         dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') &&
+         SYSTEM_NAME=$("$dummy" "$dummyarg") &&
            { echo "$SYSTEM_NAME"; exit; }
        echo mips-mips-riscos"$UNAME_RELEASE"
        exit ;;
@@ -543,7 +554,7 @@ EOF
        exit ;;
     AViiON:dgux:*:*)
        # DG/UX returns AViiON for all architectures
-       UNAME_PROCESSOR=`/usr/bin/uname -p`
+       UNAME_PROCESSOR=$(/usr/bin/uname -p)
        if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = 
mc88110
        then
            if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
@@ -571,17 +582,17 @@ EOF
        echo m68k-tektronix-bsd
        exit ;;
     *:IRIX*:*:*)
-       echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
+       echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')"
        exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
        echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+       exit ;;               # Note that: echo "'$(uname -s)'" gives 'AIX '
     i*86:AIX:*:*)
        echo i386-ibm-aix
        exit ;;
     ia64:AIX:*:*)
        if test -x /usr/bin/oslevel ; then
-               IBM_REV=`/usr/bin/oslevel`
+               IBM_REV=$(/usr/bin/oslevel)
        else
                IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
@@ -601,7 +612,7 @@ EOF
                        exit(0);
                        }
 EOF
-               if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && 
SYSTEM_NAME=`"$dummy"`
+               if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && 
SYSTEM_NAME=$("$dummy")
                then
                        echo "$SYSTEM_NAME"
                else
@@ -614,15 +625,15 @@ EOF
        fi
        exit ;;
     *:AIX:*:[4567])
-       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk 
'{ print $1 }'`
+       IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | 
awk '{ print $1 }')
        if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; 
then
                IBM_ARCH=rs6000
        else
                IBM_ARCH=powerpc
        fi
        if test -x /usr/bin/lslpp ; then
-               IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
-                          awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+               IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc |
+                          awk -F: '{ print $3 }' | sed s/[0-9]*$/0/)
        else
                IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
@@ -650,14 +661,14 @@ EOF
        echo m68k-hp-bsd4.4
        exit ;;
     9000/[34678]??:HP-UX:*:*)
-       HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+       HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
        case "$UNAME_MACHINE" in
            9000/31?)            HP_ARCH=m68000 ;;
            9000/[34]??)         HP_ARCH=m68k ;;
            9000/[678][0-9][0-9])
                if test -x /usr/bin/getconf; then
-                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                   sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                   sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 
2>/dev/null)
+                   sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 
2>/dev/null)
                    case "$sc_cpu_version" in
                      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
                      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
@@ -704,7 +715,7 @@ EOF
                    exit (0);
                }
 EOF
-                   (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 
2>/dev/null) && HP_ARCH=`"$dummy"`
+                   (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 
2>/dev/null) && HP_ARCH=$("$dummy")
                    test -z "$HP_ARCH" && HP_ARCH=hppa
                fi ;;
        esac
@@ -732,7 +743,7 @@ EOF
        echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
        exit ;;
     ia64:HP-UX:*:*)
-       HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+       HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
        echo ia64-hp-hpux"$HPUX_REV"
        exit ;;
     3050*:HI-UX:*:*)
@@ -762,7 +773,7 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
+       $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") &&
                { echo "$SYSTEM_NAME"; exit; }
        echo unknown-hitachi-hiuxwe2
        exit ;;
@@ -831,14 +842,14 @@ EOF
        echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-       FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ 
abcdefghijklmnopqrstuvwxyz`
-       FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ 
abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-       FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
+       FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ 
abcdefghijklmnopqrstuvwxyz)
+       FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ 
abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
+       FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/')
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     5000:UNIX_System_V:4.*:*)
-       FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ 
abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-       FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ 
abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+       FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ 
abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
+       FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ 
abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/')
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
@@ -851,25 +862,25 @@ EOF
        echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
        exit ;;
     arm:FreeBSD:*:*)
-       UNAME_PROCESSOR=`uname -p`
+       UNAME_PROCESSOR=$(uname -p)
        set_cc_for_build
        if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
            | grep -q __ARM_PCS_VFP
        then
-           echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo 
${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo 
${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi
        else
-           echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo 
${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo 
${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf
        fi
        exit ;;
     *:FreeBSD:*:*)
-       UNAME_PROCESSOR=`/usr/bin/uname -p`
+       UNAME_PROCESSOR=$(/usr/bin/uname -p)
        case "$UNAME_PROCESSOR" in
            amd64)
                UNAME_PROCESSOR=x86_64 ;;
            i386)
                UNAME_PROCESSOR=i586 ;;
        esac
-       echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 
's/[-(].*//'`"
+       echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 
's/[-(].*//')"
        exit ;;
     i*:CYGWIN*:*)
        echo "$UNAME_MACHINE"-pc-cygwin
@@ -905,15 +916,15 @@ EOF
        echo x86_64-pc-cygwin
        exit ;;
     prep*:SunOS:5.*:*)
-       echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 
's/[^.]*//'`"
+       echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 
's/[^.]*//')"
        exit ;;
     *:GNU:*:*)
        # the GNU system
-       echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo 
"$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
+       echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo 
"$UNAME_RELEASE"|sed -e 's,/.*$,,')"
        exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
-       echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' 
| tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
+       echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' 
| tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC"
        exit ;;
     *:Minix:*:*)
        echo "$UNAME_MACHINE"-unknown-minix
@@ -926,7 +937,7 @@ EOF
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     alpha:Linux:*:*)
-       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 
2>/dev/null` in
+       case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 
2>/dev/null) in
          EV5)   UNAME_MACHINE=alphaev5 ;;
          EV56)  UNAME_MACHINE=alphaev56 ;;
          PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -985,6 +996,9 @@ EOF
     k1om:Linux:*:*)
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
+    loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
     m32r*:Linux:*:*)
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
@@ -1035,7 +1049,7 @@ EOF
        #endif
        #endif
 EOF
-       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep 
'^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
+       eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep 
'^CPU\|^MIPS_ENDIAN\|^LIBCABI')"
        test "x$CPU" != x && { echo 
"$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
        ;;
     mips64el:Linux:*:*)
@@ -1055,7 +1069,7 @@ EOF
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
-       case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+       case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in
          PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
          PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
          *)    echo hppa-unknown-linux-"$LIBC" ;;
@@ -1145,7 +1159,7 @@ EOF
        echo "$UNAME_MACHINE"-pc-msdosdjgpp
        exit ;;
     i*86:*:4.*:*)
-       UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
+       UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//')
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
                echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
        else
@@ -1154,7 +1168,7 @@ EOF
        exit ;;
     i*86:*:5:[678]*)
        # UnixWare 7.x, OpenUNIX and OpenServer 6.
-       case `/bin/uname -X | grep "^Machine"` in
+       case $(/bin/uname -X | grep "^Machine") in
            *486*)           UNAME_MACHINE=i486 ;;
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
@@ -1163,10 +1177,10 @@ EOF
        exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
-               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+               UNAME_REL=$(sed -n 's/.*Version //p' </usr/options/cb.name)
                echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
-               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //'))
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
                (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
                        && UNAME_MACHINE=i586
@@ -1216,7 +1230,7 @@ EOF
     3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 
3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | 
SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
        OS_REL=''
        test -r /etc/.relid \
-       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
          && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
@@ -1227,7 +1241,7 @@ EOF
     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
        OS_REL='.3'
        test -r /etc/.relid \
-           && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < 
/etc/.relid`
+           && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < 
/etc/.relid)
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
            && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
@@ -1260,7 +1274,7 @@ EOF
        exit ;;
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
-               UNAME_MACHINE=`(uname -p) 2>/dev/null`
+               UNAME_MACHINE=$( (uname -p) 2>/dev/null)
                echo "$UNAME_MACHINE"-sni-sysv4
        else
                echo ns32k-sni-sysv
@@ -1346,7 +1360,7 @@ EOF
        echo aarch64-apple-darwin"$UNAME_RELEASE"
        exit ;;
     *:Darwin:*:*)
-       UNAME_PROCESSOR=`uname -p`
+       UNAME_PROCESSOR=$(uname -p)
        case $UNAME_PROCESSOR in
            unknown) UNAME_PROCESSOR=powerpc ;;
        esac
@@ -1383,7 +1397,7 @@ EOF
        echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
        exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
-       UNAME_PROCESSOR=`uname -p`
+       UNAME_PROCESSOR=$(uname -p)
        if test "$UNAME_PROCESSOR" = x86; then
                UNAME_PROCESSOR=i386
                UNAME_MACHINE=pc
@@ -1451,10 +1465,10 @@ EOF
        echo mips-sei-seiux"$UNAME_RELEASE"
        exit ;;
     *:DragonFly:*:*)
-       echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 
's/[-(].*//'`"
+       echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 
's/[-(].*//')"
        exit ;;
     *:*VMS:*:*)
-       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       UNAME_MACHINE=$( (uname -p) 2>/dev/null)
        case "$UNAME_MACHINE" in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
@@ -1464,7 +1478,7 @@ EOF
        echo i386-pc-xenix
        exit ;;
     i*86:skyos:*:*)
-       echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ 
.*$//'`"
+       echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ 
.*$//')"
        exit ;;
     i*86:rdos:*:*)
        echo "$UNAME_MACHINE"-pc-rdos
@@ -1522,7 +1536,7 @@ main ()
 #define __ARCHITECTURE__ "m68k"
 #endif
   int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 
2>/dev/null);
   if (version < 4)
     printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
   else
@@ -1614,7 +1628,7 @@ main ()
 }
 EOF
 
-$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) &&
        { echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
@@ -1639,14 +1653,14 @@ This script (version $timestamp), has failed to 
recognize the
 operating system you are using. If your script is old, overwrite *all*
 copies of config.guess and config.sub with the latest versions from:
 
-  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
 and
-  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
 EOF
 
-year=`echo $timestamp | sed 's,-.*,,'`
+year=$(echo $timestamp | sed 's,-.*,,')
 # shellcheck disable=SC2003
-if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
+if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then
    cat >&2 <<EOF
 
 If $0 has already been updated, send the following data and any
@@ -1655,20 +1669,20 @@ provide the necessary information to handle your system.
 
 config.guess timestamp = $timestamp
 
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
+uname -m = $( (uname -m) 2>/dev/null || echo unknown)
+uname -r = $( (uname -r) 2>/dev/null || echo unknown)
+uname -s = $( (uname -s) 2>/dev/null || echo unknown)
+uname -v = $( (uname -v) 2>/dev/null || echo unknown)
 
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null)
+/bin/uname -X     = $( (/bin/uname -X) 2>/dev/null)
 
-hostinfo               = `(hostinfo) 2>/dev/null`
-/bin/universe          = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch              = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+hostinfo               = $( (hostinfo) 2>/dev/null)
+/bin/universe          = $( (/bin/universe) 2>/dev/null)
+/usr/bin/arch -k       = $( (/usr/bin/arch -k) 2>/dev/null)
+/bin/arch              = $( (/bin/arch) 2>/dev/null)
+/usr/bin/oslevel       = $( (/usr/bin/oslevel) 2>/dev/null)
+/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null)
 
 UNAME_MACHINE = "$UNAME_MACHINE"
 UNAME_RELEASE = "$UNAME_RELEASE"
diff --git a/build-aux/config.sub b/build-aux/config.sub
index 0753e30..90bb8ae 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2020 Free Software Foundation, Inc.
 
-timestamp='2020-08-17'
+timestamp='2020-12-22'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ timestamp='2020-08-17'
 # Otherwise, we print the canonical config type on stdout and succeed.
 
 # You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
 
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
@@ -50,7 +50,7 @@ timestamp='2020-08-17'
 #      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
 # It is wrong to echo any other type of specification.
 
-me=`echo "$0" | sed -e 's,.*/,,'`
+me=$(echo "$0" | sed -e 's,.*/,,')
 
 usage="\
 Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
@@ -769,22 +769,22 @@ case $basic_machine in
                vendor=hp
                ;;
        i*86v32)
-               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               cpu=$(echo "$1" | sed -e 's/86.*/86/')
                vendor=pc
                basic_os=sysv32
                ;;
        i*86v4*)
-               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               cpu=$(echo "$1" | sed -e 's/86.*/86/')
                vendor=pc
                basic_os=sysv4
                ;;
        i*86v)
-               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               cpu=$(echo "$1" | sed -e 's/86.*/86/')
                vendor=pc
                basic_os=sysv
                ;;
        i*86sol2)
-               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               cpu=$(echo "$1" | sed -e 's/86.*/86/')
                vendor=pc
                basic_os=solaris2
                ;;
@@ -917,7 +917,7 @@ case $basic_machine in
                ;;
        leon-*|leon[3-9]-*)
                cpu=sparc
-               vendor=`echo "$basic_machine" | sed 's/-.*//'`
+               vendor=$(echo "$basic_machine" | sed 's/-.*//')
                ;;
 
        *-*)
@@ -1084,7 +1084,7 @@ case $cpu-$vendor in
                cpu=mipsisa64sb1el
                ;;
        sh5e[lb]-*)
-               cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
+               cpu=$(echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/')
                ;;
        spur-*)
                cpu=spur
@@ -1102,7 +1102,7 @@ case $cpu-$vendor in
                cpu=x86_64
                ;;
        xscale-* | xscalee[bl]-*)
-               cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
+               cpu=$(echo "$cpu" | sed 's/^xscale/arm/')
                ;;
        arm64-*)
                cpu=aarch64
@@ -1185,6 +1185,7 @@ case $cpu-$vendor in
                        | k1om \
                        | le32 | le64 \
                        | lm32 \
+                       | loongarch32 | loongarch64 | loongarchx32 \
                        | m32c | m32r | m32rle \
                        | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | 
m68k \
                        | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
@@ -1241,6 +1242,7 @@ case $cpu-$vendor in
                        | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
                        | spu \
                        | tahoe \
+                       | thumbv7* \
                        | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
                        | tron \
                        | ubicom32 \
@@ -1286,11 +1288,15 @@ then
 case $basic_os in
        gnu/linux*)
                kernel=linux
-               os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'`
+               os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|')
+               ;;
+       os2-emx)
+               kernel=os2
+               os=$(echo $basic_os | sed -e 's|os2-emx|emx|')
                ;;
        nto-qnx*)
                kernel=nto
-               os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'`
+               os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|')
                ;;
        *-*)
                # shellcheck disable=SC2162
@@ -1301,11 +1307,11 @@ EOF
        # Default OS when just kernel was specified
        nto*)
                kernel=nto
-               os=`echo $basic_os | sed -e 's|nto|qnx|'`
+               os=$(echo $basic_os | sed -e 's|nto|qnx|')
                ;;
        linux*)
                kernel=linux
-               os=`echo $basic_os | sed -e 's|linux|gnu|'`
+               os=$(echo $basic_os | sed -e 's|linux|gnu|')
                ;;
        *)
                kernel=
@@ -1326,7 +1332,7 @@ case $os in
                os=cnk
                ;;
        solaris1 | solaris1.*)
-               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+               os=$(echo $os | sed -e 's|solaris1|sunos4|')
                ;;
        solaris)
                os=solaris2
@@ -1355,7 +1361,7 @@ case $os in
                os=sco3.2v4
                ;;
        sco3.2.[4-9]*)
-               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               os=$(echo $os | sed -e 's/sco3.2./sco3.2v/')
                ;;
        sco*v* | scout)
                # Don't match below
@@ -1367,13 +1373,7 @@ case $os in
                os=psos
                ;;
        qnx*)
-               case $cpu in
-                   x86 | i*86)
-                       ;;
-                   *)
-                       os=nto-$os
-                       ;;
-               esac
+               os=qnx
                ;;
        hiux*)
                os=hiuxwe2
@@ -1391,7 +1391,7 @@ case $os in
                os=lynxos
                ;;
        mac[0-9]*)
-               os=`echo "$os" | sed -e 's|mac|macos|'`
+               os=$(echo "$os" | sed -e 's|mac|macos|')
                ;;
        opened*)
                os=openedition
@@ -1400,10 +1400,10 @@ case $os in
                os=os400
                ;;
        sunos5*)
-               os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
+               os=$(echo "$os" | sed -e 's|sunos5|solaris2|')
                ;;
        sunos6*)
-               os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
+               os=$(echo "$os" | sed -e 's|sunos6|solaris3|')
                ;;
        wince*)
                os=wince
@@ -1437,7 +1437,7 @@ case $os in
                ;;
        # Preserve the version number of sinix5.
        sinix5.*)
-               os=`echo $os | sed -e 's|sinix|sysv|'`
+               os=$(echo $os | sed -e 's|sinix|sysv|')
                ;;
        sinix*)
                os=sysv4
@@ -1722,7 +1722,7 @@ case $os in
             | skyos* | haiku* | rdos* | toppers* | drops* | es* \
             | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
             | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
-            | nsk* | powerunix* | genode* | zvmoe* )
+            | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*)
                ;;
        # This one is extra strict with allowed versions
        sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
@@ -1741,6 +1741,8 @@ esac
 case $kernel-$os in
        linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | 
linux-musl* | linux-uclibc* )
                ;;
+       uclinux-uclibc* )
+               ;;
        -dietlibc* | -newlib* | -musl* | -uclibc* )
                # These are just libc implementations, not actual OSes, and thus
                # require a kernel.
@@ -1751,6 +1753,8 @@ case $kernel-$os in
                ;;
        nto-qnx*)
                ;;
+       os2-emx)
+               ;;
        *-eabi* | *-gnueabi*)
                ;;
        -*)
diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg
index e84be4c..cf0f74c 100755
--- a/build-aux/git-hooks/commit-msg
+++ b/build-aux/git-hooks/commit-msg
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Check the format of GNU Emacs change log entries.
 
-# Copyright 2014-2020 Free Software Foundation, Inc.
+# Copyright 2014-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/build-aux/git-hooks/pre-commit b/build-aux/git-hooks/pre-commit
index 59fdaf5..719bfef 100755
--- a/build-aux/git-hooks/pre-commit
+++ b/build-aux/git-hooks/pre-commit
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Check file names in git commits for GNU Emacs.
 
-# Copyright 2014-2020 Free Software Foundation, Inc.
+# Copyright 2014-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/build-aux/git-hooks/prepare-commit-msg 
b/build-aux/git-hooks/prepare-commit-msg
index dbb1264..dd84344 100755
--- a/build-aux/git-hooks/prepare-commit-msg
+++ b/build-aux/git-hooks/prepare-commit-msg
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Check the format of GNU Emacs change log entries.
 
-# Copyright 2019-2020 Free Software Foundation, Inc.
+# Copyright 2019-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -24,9 +24,9 @@ SHA1=$3
 
 # Prefer gawk if available, as it handles NUL bytes properly.
 if type gawk >/dev/null 2>&1; then
-  awk=gawk
+  awk="gawk"
 else
-  awk=awk
+  awk="awk"
 fi
 
 exec $awk '
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index be8082e..de76f65 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -3,7 +3,7 @@
 
 # Convert git log output to ChangeLog format.
 
-# Copyright (C) 2008-2020 Free Software Foundation, Inc.
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/build-aux/gitlog-to-emacslog b/build-aux/gitlog-to-emacslog
index 2370280..30b2d78 100755
--- a/build-aux/gitlog-to-emacslog
+++ b/build-aux/gitlog-to-emacslog
@@ -2,7 +2,7 @@
 
 # Convert git log output to ChangeLog format for GNU Emacs.
 
-# Copyright (C) 2014-2020 Free Software Foundation, Inc.
+# Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 # Author: Paul Eggert
 
diff --git a/build-aux/install-sh b/build-aux/install-sh
index b34a8fc..ec298b5 100755
--- a/build-aux/install-sh
+++ b/build-aux/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2020-07-26.22; # UTC
+scriptversion=2020-11-14.01; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -73,6 +73,7 @@ mode=0755
 # This is like GNU 'install' as of coreutils 8.32 (2020).
 mkdir_umask=22
 
+backupsuffix=
 chgrpcmd=
 chmodcmd=$chmodprog
 chowncmd=
@@ -103,18 +104,28 @@ Options:
      --version  display version info and exit.
 
   -c            (ignored)
-  -C            install only if different (preserve the last data modification 
time)
+  -C            install only if different (preserve data modification time)
   -d            create directories instead of installing files.
   -g GROUP      $chgrpprog installed files to GROUP.
   -m MODE       $chmodprog installed files to MODE.
   -o USER       $chownprog installed files to USER.
+  -p            pass -p to $cpprog.
   -s            $stripprog installed files.
+  -S SUFFIX     attempt to back up existing files, with suffix SUFFIX.
   -t DIRECTORY  install into DIRECTORY.
   -T            report an error if DSTFILE is a directory.
 
 Environment variables override the default commands:
   CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
   RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to bug-automake@gnu.org.
+Automake home page: https://www.gnu.org/software/automake/
 "
 
 while test $# -ne 0; do
@@ -141,8 +152,13 @@ while test $# -ne 0; do
     -o) chowncmd="$chownprog $2"
         shift;;
 
+    -p) cpprog="$cpprog -p";;
+
     -s) stripcmd=$stripprog;;
 
+    -S) backupsuffix="$2"
+        shift;;
+
     -t)
         is_target_a_directory=always
         dst_arg=$2
@@ -259,6 +275,10 @@ do
     dstdir=$dst
     test -d "$dstdir"
     dstdir_status=$?
+    # Don't chown directories that already exist.
+    if test $dstdir_status = 0; then
+      chowncmd=""
+    fi
   else
 
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -473,6 +493,13 @@ do
     then
       rm -f "$dsttmp"
     else
+      # If $backupsuffix is set, and the file being installed
+      # already exists, attempt a backup.  Don't worry if it fails,
+      # e.g., if mv doesn't support -f.
+      if test -n "$backupsuffix" && test -f "$dst"; then
+        $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+      fi
+
       # Rename the file to the real destination.
       $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
 
@@ -487,9 +514,9 @@ do
         # file should still install successfully.
         {
           test ! -f "$dst" ||
-          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          $doit $rmcmd "$dst" 2>/dev/null ||
           { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+            { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
           } ||
           { echo "$0: cannot unlink or rename $dst" >&2
             (exit 1); exit 1
diff --git a/build-aux/make-info-dir b/build-aux/make-info-dir
index ee2197b..ea26479 100755
--- a/build-aux/make-info-dir
+++ b/build-aux/make-info-dir
@@ -2,7 +2,7 @@
 
 ### make-info-dir - create info/dir, for systems without install-info
 
-## Copyright (C) 2013-2020 Free Software Foundation, Inc.
+## Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ## Author: Glenn Morris <rgm@gnu.org>
 ## Maintainer: emacs-devel@gnu.org
diff --git a/build-aux/move-if-change b/build-aux/move-if-change
index 653dc98..e85e90a 100755
--- a/build-aux/move-if-change
+++ b/build-aux/move-if-change
@@ -8,7 +8,7 @@ VERSION='2018-03-07 03:47'; # UTC
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/build-aux/msys-to-w32 b/build-aux/msys-to-w32
index 4e0b2aa..e4e5e08 100755
--- a/build-aux/msys-to-w32
+++ b/build-aux/msys-to-w32
@@ -2,7 +2,7 @@
 # Convert a MSYS path list to Windows-native format.
 # Status is zero if successful, nonzero otherwise.
 
-# Copyright (C) 2013-2020 Free Software Foundation, Inc.
+# Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index d9b7f68..fae3a5f 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -3,7 +3,7 @@
 
 # Update an FSF copyright year list to include the current year.
 
-# Copyright (C) 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/build-aux/update-subdirs b/build-aux/update-subdirs
index c0ecb84..e56eea4 100755
--- a/build-aux/update-subdirs
+++ b/build-aux/update-subdirs
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Write into $1/subdirs.el a list of subdirs of directory $1.
 
-# Copyright (C) 1994-1995, 1997, 1999, 2001-2020 Free Software
+# Copyright (C) 1994-1995, 1997, 1999, 2001-2021 Free Software
 # Foundation, Inc.
 
 # This file is part of GNU Emacs.
diff --git a/config.bat b/config.bat
index 6938e55..cba7336 100644
--- a/config.bat
+++ b/config.bat
@@ -1,7 +1,7 @@
 @echo off
 rem   ----------------------------------------------------------------------
 rem   Configuration script for MSDOS
-rem   Copyright (C) 1994-1999, 2001-2020 Free Software Foundation, Inc.
+rem   Copyright (C) 1994-1999, 2001-2021 Free Software Foundation, Inc.
 
 rem   This file is part of GNU Emacs.
 
diff --git a/configure.ac b/configure.ac
index 888b415..bcc0be7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ dnl     autoconf
 dnl in the directory containing this script.
 dnl If you changed any AC_DEFINES, also run autoheader.
 dnl
-dnl Copyright (C) 1994-1996, 1999-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 1994-1996, 1999-2021 Free Software Foundation, Inc.
 dnl
 dnl  This file is part of GNU Emacs.
 dnl
@@ -3291,7 +3291,12 @@ fi
 # Check for XRender
 HAVE_XRENDER=no
 if test "${HAVE_X11}" = "yes"; then
-  AC_CHECK_HEADER([X11/extensions/Xrender.h],
+  AC_COMPILE_IFELSE(
+    [AC_LANG_PROGRAM(
+       [[#include <X11/Intrinsic.h>
+        #include <X11/extensions/Xrender.h>
+       ]],
+       [[return !XRenderQueryExtension;]])],
     [AC_CHECK_LIB([Xrender], [XRenderQueryExtension], [HAVE_XRENDER=yes])])
   if test $HAVE_XRENDER = yes; then
     XRENDER_LIBS="-lXrender"
@@ -4926,7 +4931,7 @@ case $opsys in
     AC_DEFINE(FIRST_PTY_LETTER, ['z'])
     AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptmx");])
     dnl Push various streams modules onto a PTY channel.  Used in process.c.
-    AC_DEFINE(SETUP_SLAVE_PTY, [if (ioctl (forkin, I_PUSH, "ptem") == -1) 
fatal ("ioctl I_PUSH ptem"); if (ioctl (forkin, I_PUSH, "ldterm") == -1) fatal 
("ioctl I_PUSH ldterm"); if (ioctl (forkin, I_PUSH, "ttcompat") == -1) fatal 
("ioctl I_PUSH ttcompat");], [How to set up a slave PTY, if needed.])
+    AC_DEFINE(SETUP_SLAVE_PTY, [if (ioctl (std_in, I_PUSH, "ptem") == -1) 
fatal ("ioctl I_PUSH ptem"); if (ioctl (std_in, I_PUSH, "ldterm") == -1) fatal 
("ioctl I_PUSH ldterm"); if (ioctl (std_in, I_PUSH, "ttcompat") == -1) fatal 
("ioctl I_PUSH ttcompat");], [How to set up a slave PTY, if needed.])
     ;;
 esac
 
@@ -5215,7 +5220,7 @@ fi
 
 version=$PACKAGE_VERSION
 
-copyright="Copyright (C) 2020 Free Software Foundation, Inc."
+copyright="Copyright (C) 2021 Free Software Foundation, Inc."
 AC_DEFINE_UNQUOTED(COPYRIGHT, ["$copyright"],
   [Short copyright string for this version of Emacs.])
 AC_SUBST(copyright)
@@ -5491,7 +5496,7 @@ case "$opsys" in
    if test "$HAVE_NS" = "yes"; then
      libs_nsgui="-framework AppKit"
      if test "$NS_IMPL_COCOA" = "yes"; then
-        libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon"
+        libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon -framework 
IOSurface"
      fi
    else
      libs_nsgui=
@@ -5589,7 +5594,7 @@ AC_SUBST(WINDOW_SYSTEM_OBJ)
 
 AH_TOP([/* GNU Emacs site configuration template file.
 
-Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2020
+Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2021
   Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -5878,6 +5883,12 @@ if test $AUTO_DEPEND = yes; then
      AS_MKDIR_P([$dir/deps])
    done
 fi
+if $gl_gnulib_enabled_scratch_buffer; then
+  AS_MKDIR_P([lib/malloc])
+  if test $AUTO_DEPEND = yes; then
+    AS_MKDIR_P([lib/deps/malloc])
+  fi
+fi
 
 AC_OUTPUT
 
diff --git a/doc/emacs/ChangeLog.1 b/doc/emacs/ChangeLog.1
index cf641be..bc4dbd4 100644
--- a/doc/emacs/ChangeLog.1
+++ b/doc/emacs/ChangeLog.1
@@ -10919,7 +10919,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1993-1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1993-1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/doc/emacs/Makefile.in b/doc/emacs/Makefile.in
index 53b7d07..2a3f53f 100644
--- a/doc/emacs/Makefile.in
+++ b/doc/emacs/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 1994, 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1996-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi
index e3766aa..c83da8a 100644
--- a/doc/emacs/abbrevs.texi
+++ b/doc/emacs/abbrevs.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Abbrevs
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi
index 4658cd4..d771393 100644
--- a/doc/emacs/ack.texi
+++ b/doc/emacs/ack.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1994--1997, 1999--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1994--1997, 1999--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @c
 @node Acknowledgments
diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi
index d1e67e6..49da473 100644
--- a/doc/emacs/anti.texi
+++ b/doc/emacs/anti.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 2005--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2005--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 
 @node Antinews
diff --git a/doc/emacs/arevert-xtra.texi b/doc/emacs/arevert-xtra.texi
index ef42fb2..5dede62 100644
--- a/doc/emacs/arevert-xtra.texi
+++ b/doc/emacs/arevert-xtra.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 2004--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2004--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @c
 @c This file is included either in emacs-xtra.texi (when producing the
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi
index cd1ffbe..444b28f 100644
--- a/doc/emacs/basic.texi
+++ b/doc/emacs/basic.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Basic
@@ -310,7 +310,10 @@ Scroll one screen backward, and move point onscreen if 
necessary
 @kindex M-g c
 @findex goto-char
 Read a number @var{n} and move point to buffer position @var{n}.
-Position 1 is the beginning of the buffer.
+Position 1 is the beginning of the buffer.  If point is on or just
+after a number in the buffer, that is the default for @var{n}.  Just
+type @key{RET} in the minibuffer to use it.  You can also specify
+@var{n} by giving @kbd{M-g c} a numeric prefix argument.
 
 @item M-g M-g
 @itemx M-g g
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
index 537c653..9cdfa49 100644
--- a/doc/emacs/buffers.texi
+++ b/doc/emacs/buffers.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Buffers
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 91c749a..7194eb9 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Building
diff --git a/doc/emacs/cal-xtra.texi b/doc/emacs/cal-xtra.texi
index 3f11989..aec2e6c 100644
--- a/doc/emacs/cal-xtra.texi
+++ b/doc/emacs/cal-xtra.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.  -*- coding: utf-8 -*-
-@c Copyright (C) 2004--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2004--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @c
 @c This file is included either in emacs-xtra.texi (when producing the
diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi
index e5ee7e9..3750e78 100644
--- a/doc/emacs/calendar.texi
+++ b/doc/emacs/calendar.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.  -*- coding: utf-8 -*-
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Calendar/Diary
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index a828eee..b7f0bda 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Emacs Invocation
diff --git a/doc/emacs/commands.texi b/doc/emacs/commands.texi
index ad0cbc6..82a917c 100644
--- a/doc/emacs/commands.texi
+++ b/doc/emacs/commands.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @iftex
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index fb60caa..ccf5f19 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Customization
diff --git a/doc/emacs/dired-xtra.texi b/doc/emacs/dired-xtra.texi
index 25cffe4..fc8130d 100644
--- a/doc/emacs/dired-xtra.texi
+++ b/doc/emacs/dired-xtra.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 2004--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2004--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @c
 @c This file is included either in emacs-xtra.texi (when producing the
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index fdc4703..34d12ac 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Dired
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 7dadb09..f4b1854 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 
 @c See file emacs.texi for copying conditions.
diff --git a/doc/emacs/emacs-xtra.texi b/doc/emacs/emacs-xtra.texi
index 544b808..2d511bf 100644
--- a/doc/emacs/emacs-xtra.texi
+++ b/doc/emacs/emacs-xtra.texi
@@ -16,7 +16,7 @@
 @copying
 This manual describes specialized features of Emacs.
 
-Copyright @copyright{} 2004--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2004--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index bd40e10..4054b09 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -20,7 +20,7 @@ This is the @cite{GNU Emacs Manual},
 @end ifclear
 updated for Emacs version @value{EMACSVER}.
 
-Copyright @copyright{} 1985--1987, 1993--2020 Free Software Foundation,
+Copyright @copyright{} 1985--1987, 1993--2021 Free Software Foundation,
 Inc.
 
 @quotation
diff --git a/doc/emacs/emerge-xtra.texi b/doc/emacs/emerge-xtra.texi
index d575965..7bf2415 100644
--- a/doc/emacs/emerge-xtra.texi
+++ b/doc/emacs/emerge-xtra.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 2004--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2004--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @c
 @c This file is included either in emacs-xtra.texi (when producing the
diff --git a/doc/emacs/entering.texi b/doc/emacs/entering.texi
index 4cd5c65..0476466 100644
--- a/doc/emacs/entering.texi
+++ b/doc/emacs/entering.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @iftex
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index eb4353b..ede382c 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 1999--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 1999--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Files
diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi
index db77ae4..6b41849 100644
--- a/doc/emacs/fixit.texi
+++ b/doc/emacs/fixit.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Fixit
diff --git a/doc/emacs/fortran-xtra.texi b/doc/emacs/fortran-xtra.texi
index 11222e5..c8efd56 100644
--- a/doc/emacs/fortran-xtra.texi
+++ b/doc/emacs/fortran-xtra.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 2004--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2004--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @c
 @c This file is included either in emacs-xtra.texi (when producing the
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index f5e2e8d..e1a4e64 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 1999--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 1999--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Frames
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi
index 4d622ec..35df065 100644
--- a/doc/emacs/glossary.texi
+++ b/doc/emacs/glossary.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Glossary
diff --git a/doc/emacs/gnu.texi b/doc/emacs/gnu.texi
index 0028b48..4d48dcd 100644
--- a/doc/emacs/gnu.texi
+++ b/doc/emacs/gnu.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 1985--1987, 1993, 1995, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993, 1995, 2001--2021 Free Software
 @c Foundation, Inc.
 @c
 @c Permission is granted to anyone to make or distribute verbatim copies
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index c5b59e5..81cdeb4 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Help
diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi
index d6395ef..df9e67f 100644
--- a/doc/emacs/indent.texi
+++ b/doc/emacs/indent.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Indentation
@@ -255,7 +255,7 @@ indentation; otherwise, it inserts a tab character.
 indent can be further customized via the @code{tab-first-completion}
 variable.  For instance, if that variable is @code{eol}, only complete
 if point is at the end of a line.  @xref{Mode-Specific Indent,,,
-elisp, The Emacs Lisp Reference Manual} for further details.
+elisp, The Emacs Lisp Reference Manual}, for further details.
 
 @cindex Electric Indent mode
 @cindex mode, Electric Indent
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 0bd18fd..9bc786d 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 
diff --git a/doc/emacs/kmacro.texi b/doc/emacs/kmacro.texi
index 7b1d365..adb2ab8 100644
--- a/doc/emacs/kmacro.texi
+++ b/doc/emacs/kmacro.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Keyboard Macros
diff --git a/doc/emacs/m-x.texi b/doc/emacs/m-x.texi
index b18c334..865220f 100644
--- a/doc/emacs/m-x.texi
+++ b/doc/emacs/m-x.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node M-x
diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi
index 00daa8b..cd1db1a 100644
--- a/doc/emacs/macos.texi
+++ b/doc/emacs/macos.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 2000--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2000--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Mac OS / GNUstep
 @appendix Emacs and macOS / GNUstep
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 1f10b68..4158154 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual., Abbrevs, This is part of the Emacs 
manual., Top
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 1999--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 1999--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Maintaining
@@ -2199,12 +2199,22 @@ Display the reference on the current line.
 Move to the next reference and display it in the other window
 (@code{xref-next-line}).
 
+@item N
+@findex xref-next-group
+Move to the first reference of the next reference group and display it
+in the other window (@code{xref-next-group}).
+
 @item p
 @itemx ,
 @findex xref-prev-line
 Move to the previous reference and display it in the other window
 (@code{xref-prev-line}).
 
+@item P
+@findex xref-prev-group
+Move to the first reference of the previous reference group and
+display it in the other window (@code{xref-prev-group}).
+
 @item C-o
 @findex xref-show-location-at-point
 Display the reference on the current line in the other window
diff --git a/doc/emacs/mark.texi b/doc/emacs/mark.texi
index 97aeed8..20cb8ee 100644
--- a/doc/emacs/mark.texi
+++ b/doc/emacs/mark.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Mark
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi
index ede95a2..c7c8fb3 100644
--- a/doc/emacs/mini.texi
+++ b/doc/emacs/mini.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Minibuffer
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 5b5134b..fbb8122 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @iftex
@@ -1709,6 +1709,7 @@ connections.  A setup to use this functionality could be:
 @example
 [Socket]
 ListenStream=/path/to/.emacs.socket
+DirectoryMode=0700
 
 [Install]
 WantedBy=sockets.target
@@ -1893,6 +1894,12 @@ with @kbd{C-x #}.  But @kbd{C-x #} is the way to tell
 window or a frame, @kbd{C-x #} always displays the next server buffer
 in that window or in that frame.
 
+@vindex server-client-instructions
+  When @command{emacsclient} connects, the server will normally output
+a message that says how to exit the client frame.  If
+@code{server-client-instructions} is set to @code{nil}, this message
+is inhibited.
+
 @node emacsclient Options
 @subsection @code{emacsclient} Options
 @cindex @code{emacsclient} options
@@ -2255,13 +2262,18 @@ off.
 @vindex ps-print-color-p
   If your printer doesn't support colors, you should turn off color
 processing by setting @code{ps-print-color-p} to @code{nil}.  By
-default, if the display supports colors, Emacs produces hardcopy output
-with color information; on black-and-white printers, colors are emulated
-with shades of gray.  This might produce illegible output, even if your
-screen colors only use shades of gray.
-
-  Alternatively, you can set @code{ps-print-color-p} to @code{black-white} to
-print colors on black/white printers.
+default, if the display supports colors, Emacs produces hardcopy
+output with color information; on black-and-white printers, colors are
+emulated with shades of gray.  This might produce barely-readable or
+even illegible output, even if your screen colors only use shades of
+gray.
+
+@vindex ps-black-white-faces
+  Alternatively, you can set @code{ps-print-color-p} to @code{black-white}
+to have colors display better on black/white printers.  This works by
+using information in @code{ps-black-white-faces} to express colors by
+customizable list of shades of gray, augmented by bold and italic
+face attributes.
 
 @vindex ps-use-face-background
   By default, PostScript printing ignores the background colors of the
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
index c9c175d..cc25d3e 100644
--- a/doc/emacs/modes.texi
+++ b/doc/emacs/modes.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Modes
diff --git a/doc/emacs/msdos-xtra.texi b/doc/emacs/msdos-xtra.texi
index 045ac6c..fce6ae4 100644
--- a/doc/emacs/msdos-xtra.texi
+++ b/doc/emacs/msdos-xtra.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 2004--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2004--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @c
 @c This file is included either in emacs-xtra.texi (when producing the
diff --git a/doc/emacs/msdos.texi b/doc/emacs/msdos.texi
index 48492ab..4b58f6a 100644
--- a/doc/emacs/msdos.texi
+++ b/doc/emacs/msdos.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Microsoft Windows
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index bf7088d..922eec7 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1997, 1999--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1997, 1999--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node International
 @chapter International Character Set Support
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi
index 4981dd5..038a31a 100644
--- a/doc/emacs/package.texi
+++ b/doc/emacs/package.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Packages
diff --git a/doc/emacs/picture-xtra.texi b/doc/emacs/picture-xtra.texi
index 9decda3..a04b72d 100644
--- a/doc/emacs/picture-xtra.texi
+++ b/doc/emacs/picture-xtra.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 2004--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2004--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @c
 @c This file is included either in emacs-xtra.texi (when producing the
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index f0dd62d..fe3ee57 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 1999--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 1999--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Programs
diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi
index d1b9ea8..59fa0ff 100644
--- a/doc/emacs/regs.texi
+++ b/doc/emacs/regs.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Registers
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index 14ee062..e7ca2ae 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Rmail
@@ -1273,9 +1273,9 @@ temporary buffer to display the current @acronym{MIME} 
message.
 
 @findex rmail-epa-decrypt
 @cindex encrypted mails (reading in Rmail)
-  If the current message is an encrypted one, use the command @kbd{M-x
-rmail-epa-decrypt} to decrypt it, using the EasyPG library
-(@pxref{Top,, EasyPG, epa, EasyPG Assistant User's Manual}).
+  If the current message is an encrypted one, use the command
+@kbd{C-c C-d} (@code{rmail-epa-decrypt}) to decrypt it, using the
+EasyPG library (@pxref{Top,, EasyPG, epa, EasyPG Assistant User's Manual}).
 
   You can highlight and activate URLs in the Rmail buffer using Goto
 Address mode:
@@ -1591,6 +1591,14 @@ value is used.
 Otherwise, Rmail will ask you for the password to use.
 @end enumerate
 
+On some mail servers the usernames include domain information, which
+can mean they contain the @samp{@@} character.  The inbox specifier
+string uses @samp{@@} to signal the start of the mailserver name.
+This creates confusion for movemail.  If your username contains
+@samp{@@} and you're using Mailutils @command{movemail} then you can
+fix this: Replace @code{@@} in the user name with its @acronym{URL}
+encoding @samp{%40}.
+
 @vindex rmail-movemail-flags
   If you need to pass additional command-line flags to @command{movemail},
 set the variable @code{rmail-movemail-flags} a list of the flags you
diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi
index 5c5a5da..2ff808e 100644
--- a/doc/emacs/screen.texi
+++ b/doc/emacs/screen.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Screen
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 5be45ce..637867b 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Search
@@ -1771,6 +1771,7 @@ occurrence of @var{string}.  When done, exit the 
recursive editing level
 with @kbd{C-M-c} to proceed to the next occurrence.
 
 @item e
+@itemx E
 to edit the replacement string in the minibuffer.  When you exit the
 minibuffer by typing @key{RET}, the minibuffer contents replace the
 current occurrence of the pattern.  They also become the new
diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi
index e3f9fbe..174e52a 100644
--- a/doc/emacs/sending.texi
+++ b/doc/emacs/sending.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Sending Mail
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index c77dcf7..54e1669 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Text
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi
index dbd1a07..4da3d4a 100644
--- a/doc/emacs/trouble.texi
+++ b/doc/emacs/trouble.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @iftex
diff --git a/doc/emacs/vc-xtra.texi b/doc/emacs/vc-xtra.texi
index 3780424..51b9d66 100644
--- a/doc/emacs/vc-xtra.texi
+++ b/doc/emacs/vc-xtra.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 2004--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2004--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @c
 @c This file is included in emacs-xtra.texi when producing the printed
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi
index 2619992..4cd00cb 100644
--- a/doc/emacs/vc1-xtra.texi
+++ b/doc/emacs/vc1-xtra.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 2004--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2004--2021 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @c
 @c This file is included either in vc-xtra.texi (when producing the
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi
index 07f8269..e851f1b 100644
--- a/doc/emacs/windows.texi
+++ b/doc/emacs/windows.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2020 Free Software
+@c Copyright (C) 1985--1987, 1993--1995, 1997, 2000--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Windows
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi
index 730cf30..00fa6c0 100644
--- a/doc/emacs/xresources.texi
+++ b/doc/emacs/xresources.texi
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1987, 1993--1995, 1997, 2001--2020 Free Software
+@c Copyright (C) 1987, 1993--1995, 1997, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node X Resources
diff --git a/doc/lispintro/ChangeLog.1 b/doc/lispintro/ChangeLog.1
index 75f5872..bb4323a 100644
--- a/doc/lispintro/ChangeLog.1
+++ b/doc/lispintro/ChangeLog.1
@@ -782,7 +782,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/doc/lispintro/Makefile.in b/doc/lispintro/Makefile.in
index 7a2b6f0..d8b909c 100644
--- a/doc/lispintro/Makefile.in
+++ b/doc/lispintro/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 1994-1999, 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-1999, 2001-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/doc/lispintro/README b/doc/lispintro/README
index 6361f5a..eca19c7 100644
--- a/doc/lispintro/README
+++ b/doc/lispintro/README
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/doc/lispintro/cons-1.eps b/doc/lispintro/cons-1.eps
index c5d414c..4877df7 100644
--- a/doc/lispintro/cons-1.eps
+++ b/doc/lispintro/cons-1.eps
@@ -4,7 +4,7 @@
 %%CreationDate: Wed Mar  8 14:26:58 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
 
-% Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
diff --git a/doc/lispintro/cons-2.eps b/doc/lispintro/cons-2.eps
index f6d97c7..48fdc7e 100644
--- a/doc/lispintro/cons-2.eps
+++ b/doc/lispintro/cons-2.eps
@@ -4,7 +4,7 @@
 %%CreationDate: Wed Mar  8 14:26:39 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
 
-% Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
diff --git a/doc/lispintro/cons-2a.eps b/doc/lispintro/cons-2a.eps
index 57b96eb..81053d3 100644
--- a/doc/lispintro/cons-2a.eps
+++ b/doc/lispintro/cons-2a.eps
@@ -4,7 +4,7 @@
 %%CreationDate: Tue Mar 14 15:09:30 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
 
-% Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
diff --git a/doc/lispintro/cons-3.eps b/doc/lispintro/cons-3.eps
index e51c2c4..e6a80f1 100644
--- a/doc/lispintro/cons-3.eps
+++ b/doc/lispintro/cons-3.eps
@@ -4,7 +4,7 @@
 %%CreationDate: Wed Mar  8 14:25:41 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
 
-% Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
diff --git a/doc/lispintro/cons-4.eps b/doc/lispintro/cons-4.eps
index 1cbf44f..c1aac9c 100644
--- a/doc/lispintro/cons-4.eps
+++ b/doc/lispintro/cons-4.eps
@@ -4,7 +4,7 @@
 %%CreationDate: Wed Mar  8 14:25:06 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
 
-% Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
diff --git a/doc/lispintro/cons-5.eps b/doc/lispintro/cons-5.eps
index 85a553b..a0918a9 100644
--- a/doc/lispintro/cons-5.eps
+++ b/doc/lispintro/cons-5.eps
@@ -4,7 +4,7 @@
 %%CreationDate: Wed Mar  8 14:27:28 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
 
-% Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
diff --git a/doc/lispintro/drawers.eps b/doc/lispintro/drawers.eps
index b71bdb8..725bd97 100644
--- a/doc/lispintro/drawers.eps
+++ b/doc/lispintro/drawers.eps
@@ -9,7 +9,7 @@
 %%EndComments
 %%BeginProlog
 
-% Copyright (C) 2001-2020 Free Software Foundation, Inc.
+% Copyright (C) 2001-2021 Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
diff --git a/doc/lispintro/emacs-lisp-intro.texi 
b/doc/lispintro/emacs-lisp-intro.texi
index b13b162..d5c280b 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -117,7 +117,7 @@ Edition @value{edition-number}, @value{update-date}
 @sp 1
 Distributed with Emacs version @value{EMACSVER}.
 @sp 1
-Copyright @copyright{} 1990--1995, 1997, 2001--2020 Free Software
+Copyright @copyright{} 1990--1995, 1997, 2001--2021 Free Software
 Foundation, Inc.
 @sp 1
 
diff --git a/doc/lispintro/lambda-1.eps b/doc/lispintro/lambda-1.eps
index 08bd600..43b2d08 100644
--- a/doc/lispintro/lambda-1.eps
+++ b/doc/lispintro/lambda-1.eps
@@ -4,7 +4,7 @@
 %%CreationDate: Wed Mar  8 14:31:53 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
 
-% Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
diff --git a/doc/lispintro/lambda-2.eps b/doc/lispintro/lambda-2.eps
index 6ccf999..c6c71f2 100644
--- a/doc/lispintro/lambda-2.eps
+++ b/doc/lispintro/lambda-2.eps
@@ -4,7 +4,7 @@
 %%CreationDate: Wed Mar  8 14:33:09 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
 
-% Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
diff --git a/doc/lispintro/lambda-3.eps b/doc/lispintro/lambda-3.eps
index aac0392..ae939d5 100644
--- a/doc/lispintro/lambda-3.eps
+++ b/doc/lispintro/lambda-3.eps
@@ -4,7 +4,7 @@
 %%CreationDate: Wed Mar  8 14:33:49 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
 
-% Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
diff --git a/doc/lispref/ChangeLog.1 b/doc/lispref/ChangeLog.1
index 8d92a94..bd7a9c4 100644
--- a/doc/lispref/ChangeLog.1
+++ b/doc/lispref/ChangeLog.1
@@ -13989,7 +13989,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1998-2020 Free Software Foundation, Inc.
+  Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/doc/lispref/Makefile.in b/doc/lispref/Makefile.in
index bd65009..271f06e 100644
--- a/doc/lispref/Makefile.in
+++ b/doc/lispref/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 1990-1996, 1998-2020 Free Software Foundation, Inc.
+# Copyright (C) 1990-1996, 1998-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/doc/lispref/README b/doc/lispref/README
index ac0c2b5..9b99837 100644
--- a/doc/lispref/README
+++ b/doc/lispref/README
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.  -*- outline -*-
+Copyright (C) 2001-2021 Free Software Foundation, Inc.  -*- outline -*-
 See the end of the file for license conditions.
 
 
diff --git a/doc/lispref/abbrevs.texi b/doc/lispref/abbrevs.texi
index 575be18..71fac1a 100644
--- a/doc/lispref/abbrevs.texi
+++ b/doc/lispref/abbrevs.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1994, 1999, 2001--2020 Free Software Foundation,
+@c Copyright (C) 1990--1994, 1999, 2001--2021 Free Software Foundation,
 @c Inc.
 @c See the file elisp.texi for copying conditions.
 @node Abbrevs
diff --git a/doc/lispref/anti.texi b/doc/lispref/anti.texi
index a134e88..ced8082 100644
--- a/doc/lispref/anti.texi
+++ b/doc/lispref/anti.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1999, 2002--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1999, 2002--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 
 @c This node must have no pointers.
diff --git a/doc/lispref/back.texi b/doc/lispref/back.texi
index 817249e..c238863 100644
--- a/doc/lispref/back.texi
+++ b/doc/lispref/back.texi
@@ -1,6 +1,6 @@
 \input texinfo  @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 2001--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2001--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @c
 @c %**start of header
diff --git a/doc/lispref/backups.texi b/doc/lispref/backups.texi
index 3792795..c0a4065 100644
--- a/doc/lispref/backups.texi
+++ b/doc/lispref/backups.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1999, 2001--2020 Free Software Foundation,
+@c Copyright (C) 1990--1995, 1999, 2001--2021 Free Software Foundation,
 @c Inc.
 @c See the file elisp.texi for copying conditions.
 @node Backups and Auto-Saving
@@ -706,7 +706,11 @@ contents and the file contents are identical before the 
revert
 operation, reverting preserves all the markers.  If they are not
 identical, reverting does change the buffer; in that case, it preserves
 the markers in the unchanged text (if any) at the beginning and end of
-the buffer.  Preserving any additional markers would be problematical.
+the buffer.  Preserving any additional markers would be problematic.
+
+When reverting from non-file sources, markers are usually not
+preserved, but this is up to the specific @code{revert-buffer-function}
+implementation.
 @end deffn
 
 @defvar revert-buffer-in-progress-p
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi
index 2860343..69733f9 100644
--- a/doc/lispref/buffers.texi
+++ b/doc/lispref/buffers.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Buffers
@@ -225,13 +225,22 @@ current buffer is restored even in case of an abnormal 
exit via
 
 @defmac with-temp-buffer body@dots{}
 @anchor{Definition of with-temp-buffer}
-The @code{with-temp-buffer} macro evaluates the @var{body} forms
-with a temporary buffer as the current buffer.  It saves the identity of
+The @code{with-temp-buffer} macro evaluates the @var{body} forms with
+a temporary buffer as the current buffer.  It saves the identity of
 the current buffer, creates a temporary buffer and makes it current,
 evaluates the @var{body} forms, and finally restores the previous
-current buffer while killing the temporary buffer.  By default, undo
-information (@pxref{Undo}) is not recorded in the buffer created by
-this macro (but @var{body} can enable that, if needed).
+current buffer while killing the temporary buffer.
+
+@cindex undo in temporary buffers
+@cindex @code{kill-buffer-hook} in temporary buffers
+@cindex @code{kill-buffer-query-functions} in temporary buffers
+@cindex @code{buffer-list-update-hook} in temporary buffers
+By default, undo information (@pxref{Undo}) is not recorded in the
+buffer created by this macro (but @var{body} can enable that, if
+needed).  The temporary buffer also does not run the hooks
+@code{kill-buffer-hook}, @code{kill-buffer-query-functions}
+(@pxref{Killing Buffers}), and @code{buffer-list-update-hook}
+(@pxref{Buffer List}).
 
 The return value is the value of the last form in @var{body}.  You can
 return the contents of the temporary buffer by using
@@ -345,9 +354,9 @@ incrementing the number until it is not the name of an 
existing buffer.
 
 If the optional second argument @var{ignore} is non-@code{nil}, it
 should be a string, a potential buffer name.  It means to consider
-that potential buffer acceptable, if it is tried, even it is the name
-of an existing buffer (which would normally be rejected).  Thus, if
-buffers named @samp{foo}, @samp{foo<2>}, @samp{foo<3>} and
+that potential buffer acceptable, if it is tried, even if it is the
+name of an existing buffer (which would normally be rejected).  Thus,
+if buffers named @samp{foo}, @samp{foo<2>}, @samp{foo<3>} and
 @samp{foo<4>} exist,
 
 @example
@@ -932,13 +941,17 @@ window.
 @defvar buffer-list-update-hook
 This is a normal hook run whenever the buffer list changes.  Functions
 (implicitly) running this hook are @code{get-buffer-create}
-(@pxref{Creating Buffers}), @code{rename-buffer} (@pxref{Buffer Names}),
-@code{kill-buffer} (@pxref{Killing Buffers}), @code{bury-buffer} (see
-above) and @code{select-window} (@pxref{Selecting Windows}).
+(@pxref{Creating Buffers}), @code{rename-buffer} (@pxref{Buffer
+Names}), @code{kill-buffer} (@pxref{Killing Buffers}),
+@code{bury-buffer} (see above), and @code{select-window}
+(@pxref{Selecting Windows}).  This hook is not run for internal or
+temporary buffers created by @code{get-buffer-create} or
+@code{generate-new-buffer} with a non-@code{nil} argument
+@var{inhibit-buffer-hooks}.
 
 Functions run by this hook should avoid calling @code{select-window}
-with a nil @var{norecord} argument or @code{with-temp-buffer} since
-either may lead to infinite recursion.
+with a @code{nil} @var{norecord} argument since this may lead to
+infinite recursion.
 @end defvar
 
 @node Creating Buffers
@@ -951,12 +964,20 @@ either may lead to infinite recursion.
 with the specified name; @code{generate-new-buffer} always creates a new
 buffer and gives it a unique name.
 
+  Both functions accept an optional argument @var{inhibit-buffer-hooks}.
+If it is non-@code{nil}, the buffer they create does not run the hooks
+@code{kill-buffer-hook}, @code{kill-buffer-query-functions}
+(@pxref{Killing Buffers}), and @code{buffer-list-update-hook}
+(@pxref{Buffer List}).  This avoids slowing down internal or temporary
+buffers that are never presented to users or passed on to other
+applications.
+
   Other functions you can use to create buffers include
 @code{with-output-to-temp-buffer} (@pxref{Temporary Displays}) and
 @code{create-file-buffer} (@pxref{Visiting Files}).  Starting a
 subprocess can also create a buffer (@pxref{Processes}).
 
-@defun get-buffer-create buffer-or-name
+@defun get-buffer-create buffer-or-name &optional inhibit-buffer-hooks
 This function returns a buffer named @var{buffer-or-name}.  The buffer
 returned does not become the current buffer---this function does not
 change which buffer is current.
@@ -980,7 +1001,7 @@ level; see @ref{Auto Major Mode}.)  If the name begins 
with a space, the
 buffer initially disables undo information recording (@pxref{Undo}).
 @end defun
 
-@defun generate-new-buffer name
+@defun generate-new-buffer name &optional inhibit-buffer-hooks
 This function returns a newly created, empty buffer, but does not make
 it current.  The name of the buffer is generated by passing @var{name}
 to the function @code{generate-new-buffer-name} (@pxref{Buffer
@@ -1092,6 +1113,10 @@ with no arguments.  The buffer being killed is the 
current buffer when
 they are called.  The idea of this feature is that these functions will
 ask for confirmation from the user.  If any of them returns @code{nil},
 @code{kill-buffer} spares the buffer's life.
+
+This hook is not run for internal or temporary buffers created by
+@code{get-buffer-create} or @code{generate-new-buffer} with a
+non-@code{nil} argument @var{inhibit-buffer-hooks}.
 @end defvar
 
 @defvar kill-buffer-hook
@@ -1100,6 +1125,10 @@ questions it is going to ask, just before actually 
killing the buffer.
 The buffer to be killed is current when the hook functions run.
 @xref{Hooks}.  This variable is a permanent local, so its local binding
 is not cleared by changing major modes.
+
+This hook is not run for internal or temporary buffers created by
+@code{get-buffer-create} or @code{generate-new-buffer} with a
+non-@code{nil} argument @var{inhibit-buffer-hooks}.
 @end defvar
 
 @defopt buffer-offer-save
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index ebfda01..6c68f70 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Command Loop
@@ -928,6 +928,13 @@ remapping), and @code{this-original-command} gives the 
command that
 was specified to run but remapped into another command.
 @end defvar
 
+@defvar current-minibuffer-command
+This has the same value as @code{this-command}, but is bound
+recursively when entering a minibuffer.  This variable can be used
+from minibuffer hooks and the like to determine what command opened
+the current minibuffer session.
+@end defvar
+
 @defun this-command-keys
 This function returns a string or vector containing the key sequence
 that invoked the present command.  Any events read by the command
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index 51a4b04..6624234 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1994, 2001--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1990--1994, 2001--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Byte Compilation
 @chapter Byte Compilation
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index d2419f4..55bcddb 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -1,6 +1,6 @@
 @c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Control Structures
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 8591247..8fd12f7 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1997--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1997--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Customization
 @chapter Customization Settings
diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi
index 3fea604..1e779ac 100644
--- a/doc/lispref/debugging.texi
+++ b/doc/lispref/debugging.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1994, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1994, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Debugging
@@ -1009,13 +1009,14 @@ profiling, so we don't recommend leaving it active 
except when you are
 actually running the code you want to examine).
 
 The profiler report buffer shows, on each line, a function that was
-called, followed by how much resources (cpu or memory) it used in
+called, preceded by how much resources (cpu or memory) it used in
 absolute and percentage terms since profiling started.  If a given
-line has a @samp{+} symbol at the left-hand side, you can expand that
-line by typing @kbd{@key{RET}}, in order to see the function(s) called
-by the higher-level function.  Use a prefix argument (@kbd{C-u
-@key{RET}}) to see the whole call tree below a function.  Pressing
-@kbd{@key{RET}} again will collapse back to the original state.
+line has a @samp{+} symbol to the left of the function name, you can
+expand that line by typing @kbd{@key{RET}}, in order to see the
+function(s) called by the higher-level function.  Use a prefix
+argument (@kbd{C-u @key{RET}}) to see the whole call tree below a
+function.  Pressing @kbd{@key{RET}} again will collapse back to the
+original state.
 
 Press @kbd{j} or @kbd{mouse-2} to jump to the definition of a function
 at point.  Press @kbd{d} to view a function's documentation.  You can
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index f86baf5..b149a66 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1,6 +1,6 @@
 @c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1990--1995, 1998--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Display
 @chapter Emacs Display
@@ -2632,10 +2632,12 @@ appearance of @var{face} will again be determined by 
its default face
 spec.
 
 @cindex @code{eval-defun}, and @code{defface} forms
+@cindex @code{eval-last-sexp}, and @code{defface} forms
 As an exception, if you evaluate a @code{defface} form with
-@kbd{C-M-x} in Emacs Lisp mode (@code{eval-defun}), a special feature
-of @code{eval-defun} overrides any custom face specs on the face,
-causing the face to reflect exactly what the @code{defface} says.
+@kbd{C-M-x} (@code{eval-defun}) or with @kbd{C-x C-e}
+(@code{eval-last-sexp}) in Emacs Lisp mode, a special feature of these
+commands overrides any custom face specs on the face, causing the face
+to reflect exactly what the @code{defface} says.
 
 The @var{spec} argument is a @dfn{face spec}, which states how the
 face should appear on different kinds of terminals.  It should be an
@@ -5898,6 +5900,32 @@ string containing the image data as raw bytes.  
@var{image-type} should be a
 @end lisp
 @end defun
 
+@defun svg-embed-base-uri-image svg relative-filename &rest args
+To @var{svg} add an embedded (raster) image placed at
+@var{relative-filename}.  @var{relative-filename} is searched inside
+@code{file-name-directory} of the @code{:base-uri} svg image property.
+@code{:base-uri} specifies a (possibly non-existing) file name of the
+svg image to be created, thus all the embedded files are searched
+relatively to the @code{:base-uri} filename's directory.  If
+@code{:base-uri} is ommited, then filename from where svg image is
+loaded is used.  Using @code{:base-uri} improves the performance of
+embedding large images, comparing to @code{svg-embed}, because all the
+work is done directly by librsvg.
+
+@lisp
+;; Embeding /tmp/subdir/rms.jpg and /tmp/another/rms.jpg
+(svg-embed-base-uri-image svg "subdir/rms.jpg"
+           :width "100px" :height "100px"
+           :x "50px" :y "75px")
+(svg-embed-base-uri-image svg "another/rms.jpg"
+           :width "100px" :height "100px"
+           :x "75px" :y "50px")
+(svg-image svg :scale 1.0
+           :base-uri "/tmp/dummy"
+           :width 175 :height 175)
+@end lisp
+@end defun
+
 @defun svg-clip-path svg &rest args
 Add a clipping path to @var{svg}.  If applied to a shape via the
 @var{:clip-path} property, parts of that shape which lie outside of
@@ -6575,6 +6603,12 @@ except when you explicitly clear it.  This mode can be 
useful for
 debugging.
 @end defvar
 
+@defun image-cache-size
+This function returns the total size of the current image cache, in
+bytes.  An image of size 200x100 with 24 bits per color will have a
+cache size of 60000 bytes, for instance.
+@end defun
+
 @node Xwidgets
 @section Embedded Native Widgets
 @cindex xwidget
@@ -6879,6 +6913,16 @@ This inserts a button with the label @var{label} at 
point, using text
 properties.
 @end defun
 
+@defun button-buttonize string callback &optional data
+Sometimes it's more convenient to make a string into a button without
+inserting it into a buffer immediately, for instance when creating
+data structures that may then, later, be inserted into a buffer.  This
+function makes @var{string} into such a string, and @var{callback}
+will be called when the user clicks on the button.  The optional
+@var{data} parameter will be used as the parameter when @var{callback}
+is called.  If @code{nil}, the button is used as the parameter instead.
+@end defun
+
 @node Manipulating Buttons
 @subsection Manipulating Buttons
 @cindex manipulating buttons
diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi
index b4c631b..569545d 100644
--- a/doc/lispref/edebug.texi
+++ b/doc/lispref/edebug.texi
@@ -1,6 +1,6 @@
 @comment -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1992--1994, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1992--1994, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 9a67967..fa548b5 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -99,7 +99,7 @@ This is the @cite{GNU Emacs Lisp Reference Manual}
 @end ifclear
 corresponding to Emacs version @value{EMACSVER}.
 
-Copyright @copyright{} 1990--1996, 1998--2020 Free Software Foundation,
+Copyright @copyright{} 1990--1996, 1998--2021 Free Software Foundation,
 Inc.
 
 @quotation
diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi
index cd8694b..9ec1271 100644
--- a/doc/lispref/errors.texi
+++ b/doc/lispref/errors.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1993, 1999, 2001--2020 Free Software Foundation,
+@c Copyright (C) 1990--1993, 1999, 2001--2021 Free Software Foundation,
 @c Inc.
 @c See the file elisp.texi for copying conditions.
 @node Standard Errors
@@ -129,9 +129,18 @@ This is a subcategory of @code{file-error}.  
@xref{Modification Time}.
 This is a subcategory of @code{file-error}.  It happens, when a file
 could not be watched for changes.  @xref{File Notifications}.
 
+@item remote-file-error
+This is a subcategory of @code{file-error}, which results from
+problems in accessing a remote file.  @xref{Remote Files,,, emacs, The
+GNU Emacs Manual}.  Often, this error appears when timers, process
+filters, process sentinels or special events in general try to access
+a remote file, and collide with another remote file operation.  In
+general it is a good idea to write a bug report.
+@xref{Bugs,,, emacs, The GNU Emacs Manual}.
+
 @c net/ange-ftp.el
 @item ftp-error
-This is a subcategory of @code{file-error}, which results from
+This is a subcategory of @code{remote-file-error}, which results from
 problems in accessing a remote file using ftp.  @xref{Remote Files,,,
 emacs, The GNU Emacs Manual}.
 
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi
index 39f342a..80e038c 100644
--- a/doc/lispref/eval.texi
+++ b/doc/lispref/eval.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1994, 1998, 2001--2020 Free Software Foundation,
+@c Copyright (C) 1990--1994, 1998, 2001--2021 Free Software Foundation,
 @c Inc.
 @c See the file elisp.texi for copying conditions.
 @node Evaluation
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index d49ac42..4110c51 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Files
@@ -701,8 +701,11 @@ in @var{body}.
 The current buffer is restored even in case of an abnormal exit via
 @code{throw} or error (@pxref{Nonlocal Exits}).
 
-See also @code{with-temp-buffer} in @ref{Definition of
-with-temp-buffer,, The Current Buffer}.
+Like @code{with-temp-buffer} (@pxref{Definition of with-temp-buffer,,
+Current Buffer}), the temporary buffer used by this macro does not run
+the hooks @code{kill-buffer-hook}, @code{kill-buffer-query-functions}
+(@pxref{Killing Buffers}), and @code{buffer-list-update-hook}
+(@pxref{Buffer List}).
 @end defmac
 
 @node File Locks
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index e3d0fde..7f2a6f7 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Frames
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 222a17f..414035f 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -1,6 +1,6 @@
 @c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Functions
diff --git a/doc/lispref/hash.texi b/doc/lispref/hash.texi
index 12781c6..8781fad 100644
--- a/doc/lispref/hash.texi
+++ b/doc/lispref/hash.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1999, 2001--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1999, 2001--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Hash Tables
 @chapter Hash Tables
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index 90406df..2fd05b7 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -1,6 +1,6 @@
 @c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Documentation
diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi
index a8b4d56..b1c7e61 100644
--- a/doc/lispref/hooks.texi
+++ b/doc/lispref/hooks.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1993, 1998, 2001--2020 Free Software Foundation,
+@c Copyright (C) 1990--1993, 1998, 2001--2021 Free Software Foundation,
 @c Inc.
 @c See the file elisp.texi for copying conditions.
 @node Standard Hooks
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index bb25983..4150a2b 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1993, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1993, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node GNU Emacs Internals
@@ -615,6 +615,19 @@ during garbage collection so far in this Emacs session, as 
a
 floating-point number.
 @end defvar
 
+@defun memory-report
+It can sometimes be useful to see where Emacs is using memory (in
+various variables, buffers, and caches).  This command will open a new
+buffer (called @samp{"*Memory Report*"}) that will give an overview,
+in addition to listing the ``largest'' buffers and variables.
+
+All the data here is approximate, because there's really no consistent
+way to compute the size of a variable.  For instance, two variables
+may share parts of a data structure, and this will be counted twice,
+but this command may still give a useful high-level overview of which
+parts of Emacs are using memory.
+@end defun
+
 @node Stack-allocated Objects
 @section Stack-allocated Objects
 
@@ -1851,7 +1864,10 @@ byte, is @var{len}.  The original string in @var{str} 
can be either an
 it can include embedded null bytes, and doesn't have to end in a
 terminating null byte at @code{@var{str}[@var{len}]}.  The function
 raises the @code{overflow-error} error condition if @var{len} is
-negative or exceeds the maximum length of an Emacs string.
+negative or exceeds the maximum length of an Emacs string.  If
+@var{len} is zero, then @var{str} can be @code{NULL}, otherwise it
+must point to valid memory.  For nonzero @var{len}, @code{make_string}
+returns unique mutable string objects.
 @end deftypefn
 
 @deftypefn Function emacs_value make_unibyte_string (emacs_env *@var{env}, 
const char *@var{str}, ptrdiff_t @var{len})
@@ -2375,6 +2391,15 @@ This flag indicates that narrowing has changed in the 
buffer.
 This flag indicates that redisplay optimizations should not be used to
 display this buffer.
 
+@item inhibit_buffer_hooks
+This flag indicates that the buffer should not run the hooks
+@code{kill-buffer-hook}, @code{kill-buffer-query-functions}
+(@pxref{Killing Buffers}), and @code{buffer-list-update-hook}
+(@pxref{Buffer List}).  It is set at buffer creation (@pxref{Creating
+Buffers}), and avoids slowing down internal or temporary buffers, such
+as those created by @code{with-temp-buffer} (@pxref{Definition of
+with-temp-buffer,, Current Buffer}).
+
 @item overlay_center
 This field holds the current overlay center position.  @xref{Managing
 Overlays}.
@@ -2388,8 +2413,6 @@ after the current overlay center.  @xref{Managing 
Overlays}.
 and @code{overlays_after} is sorted in order of increasing beginning
 position.
 
-@c FIXME? the following are now all Lisp_Object BUFFER_INTERNAL_FIELD (foo).
-
 @item name
 A Lisp string that names the buffer.  It is guaranteed to be unique.
 @xref{Buffer Names}.  This and the following fields have their names
diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi
index a4b4795..35f852b 100644
--- a/doc/lispref/intro.texi
+++ b/doc/lispref/intro.texi
@@ -1,6 +1,6 @@
 @c -*-coding: utf-8-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1994, 2001--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1990--1994, 2001--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 
 @node Introduction
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index 130ff0d..37bab7e 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -1,6 +1,6 @@
 @c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1994, 1998--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1990--1994, 1998--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Keymaps
 @chapter Keymaps
@@ -2167,9 +2167,10 @@ string.  Thus, the string need not be a constant.
 
 The third element, @var{real-binding}, can be the command to execute
 (in which case you get a normal menu item).  It can also be a keymap,
-which will result in a submenu.  Finally, it can be @code{nil}, in
-which case you will get a non-selectable menu item.  This is mostly
-useful when creating separator lines and the like.
+which will result in a submenu, and @var{item-name} is used as the
+submenu name.  Finally, it can be @code{nil}, in which case you will
+get a non-selectable menu item.  This is mostly useful when creating
+separator lines and the like.
 
 The tail of the list, @var{item-property-list}, has the form of a
 property list which contains other information.
@@ -2811,6 +2812,11 @@ the shift modifier:
 @xref{Function Keys}, for more information about how to add modifiers to
 function keys.
 
+If you have functions that change whether a tool bar item is enabled
+or not, this status is not necessarily updated visually immediately.
+To force recalculation of the tool bar, call
+@code{force-mode-line-update} (@pxref{Mode Line Format}).
+
 @node Modifying Menus
 @subsection Modifying Menus
 @cindex menu modification
diff --git a/doc/lispref/lay-flat.texi b/doc/lispref/lay-flat.texi
index 3cca518..4ea58e6 100644
--- a/doc/lispref/lay-flat.texi
+++ b/doc/lispref/lay-flat.texi
@@ -1,6 +1,6 @@
 \input texinfo    @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 2001--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2001--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @c
 @comment %**start of header
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index ae793d5..c54496f 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Lists
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index e536415..22f0dde 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Loading
diff --git a/doc/lispref/macros.texi b/doc/lispref/macros.texi
index eeb4152..e56a85c 100644
--- a/doc/lispref/macros.texi
+++ b/doc/lispref/macros.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998, 2001--2020 Free Software Foundation,
+@c Copyright (C) 1990--1995, 1998, 2001--2021 Free Software Foundation,
 @c Inc.
 @c See the file elisp.texi for copying conditions.
 @node Macros
diff --git a/doc/lispref/maps.texi b/doc/lispref/maps.texi
index 1e84f9b..aea0242 100644
--- a/doc/lispref/maps.texi
+++ b/doc/lispref/maps.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1993, 1999, 2001--2020 Free Software Foundation,
+@c Copyright (C) 1990--1993, 1999, 2001--2021 Free Software Foundation,
 @c Inc.
 @c See the file elisp.texi for copying conditions.
 @node Standard Keymaps
diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi
index 686b877..cdd0938 100644
--- a/doc/lispref/markers.texi
+++ b/doc/lispref/markers.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Markers
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 56bc0b8..81139b9 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Minibuffers
@@ -1803,7 +1803,8 @@ The value should be a function to add prefixes and 
suffixes to
 completions.  This function must accept one argument, a list of
 completions, and should return such a list of completions where
 each element contains a list of three elements: a completion,
-a prefix string, and a suffix string.
+a prefix string, and a suffix string.  This function takes priority
+over @code{:annotation-function}.
 
 @item :exit-function
 The value should be a function to run after performing completion.
@@ -1911,7 +1912,8 @@ completions.  The function should take one argument,
 return such a list of @var{completions} where each element contains a list
 of three elements: a completion, a prefix which is displayed before
 the completion string in the @file{*Completions*} buffer, and
-a suffix displayed after the completion string.
+a suffix displayed after the completion string.  This function
+takes priority over @code{annotation-function}.
 
 @item display-sort-function
 The value should be a function for sorting completions.  The function
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 98aa94e..9d38fe6 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Modes
@@ -1930,6 +1930,17 @@ This function also forces an update of the menu bar and 
frame title.
 color using the face @code{mode-line}.  Other windows' mode lines appear
 in the face @code{mode-line-inactive} instead.  @xref{Faces}.
 
+@vindex mode-line-compact
+  Some modes put a lot of data in the mode line, pushing elements at
+the end of the mode line off to the right.  Emacs can ``compress'' the
+mode line if the @code{mode-line-compact} variable is non-@code{nil}
+by turning stretches of spaces into a single space.  If this variable
+is @code{long}, this is only done when the mode line is wider than the
+currently selected window.  (This computation is approximate, based on
+the number of characters, and not their displayed width.)  This
+variable can be buffer-local to only compress mode-lines in certain
+buffers.
+
 @node Mode Line Data
 @subsection The Data Structure of the Mode Line
 @cindex mode line construct
@@ -1982,9 +1993,15 @@ variables without prompting the user.)
 
 @item (@var{string} @var{rest}@dots{})
 @itemx (@var{list} @var{rest}@dots{})
-A list whose first element is a string or list means to process all the
-elements recursively and concatenate the results.  This is the most
-common form of mode line construct.
+A list whose first element is a string or list means to process all
+the elements recursively and concatenate the results.  This is the
+most common form of mode line construct.  (Note that text properties
+are handled specially (for reasons of efficiency) when displaying
+strings in the mode line: Only the text property on the first
+character of the string are considered, and they are then used over
+the entire string.  If you need a string with different text
+properties, you have to use the special @code{:propertize} mode line
+construct.)
 
 @item (:eval @var{form})
 A list whose first element is the symbol @code{:eval} says to evaluate
@@ -2439,7 +2456,7 @@ line:
 @enumerate
 @item
 Put a string with a text property directly into the mode line data
-structure.
+structure, but see @ref{Mode Line Data} for caveats for that.
 
 @item
 Put a text property on a mode line %-construct such as @samp{%12b}; then
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 97bc85f..84f5d2f 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -1,6 +1,6 @@
 @c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1998--1999, 2001--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1998--1999, 2001--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Non-ASCII Characters
 @chapter Non-@acronym{ASCII} Characters
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi
index 9a5bff5..63e3e0b 100644
--- a/doc/lispref/numbers.texi
+++ b/doc/lispref/numbers.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Numbers
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index 8306674..64e7d53 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -1,6 +1,6 @@
 @c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Lisp Data Types
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index f897cfa..37fde0a 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node System Interface
@@ -2106,6 +2106,19 @@ run while waiting.  If a timer function needs to perform 
an action
 after a certain time has elapsed, it can do this by scheduling a new
 timer.
 
+  If a timer function performs a remote file operation, it can be in
+conflict with an already running remote file operation of the same
+connection.  Such conflicts are detected, and they result in a
+@code{remote-file-error} error (@pxref{Standard Errors}).  This should
+be protected by wrapping the timer function body with
+
+@lisp
+@group
+(ignore-error 'remote-file-error
+  @dots{})
+@end group
+@end lisp
+
   If a timer function calls functions that can change the match data,
 it should save and restore the match data.  @xref{Saving Match Data}.
 
@@ -2633,14 +2646,14 @@ calls @var{function} with no arguments, or 
@samp{--eval=@var{form}}.
 
   Any Lisp program output that would normally go to the echo area,
 either using @code{message}, or using @code{prin1}, etc., with
-@code{t} as the stream, goes instead to Emacs's standard descriptors
-when in batch mode: @code{message} writes to the standard error
-descriptor, while @code{prin1} and other print functions write to the
-standard output.  Similarly, input that would normally come from the
-minibuffer is read from the standard input descriptor.  Thus, Emacs
-behaves much like a noninteractive application program.  (The echo
-area output that Emacs itself normally generates, such as command
-echoing, is suppressed entirely.)
+@code{t} as the stream (@pxref{Output Streams}), goes instead to
+Emacs's standard descriptors when in batch mode: @code{message} writes
+to the standard error descriptor, while @code{prin1} and other print
+functions write to the standard output.  Similarly, input that would
+normally come from the minibuffer is read from the standard input
+descriptor.  Thus, Emacs behaves much like a noninteractive
+application program.  (The echo area output that Emacs itself normally
+generates, such as command echoing, is suppressed entirely.)
 
 Non-ASCII text written to the standard output or error descriptors is
 by default encoded using @code{locale-coding-system} (@pxref{Locales})
diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi
index af87479..e8aaa3a 100644
--- a/doc/lispref/package.texi
+++ b/doc/lispref/package.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 2010--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2010--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Packaging
 @chapter Preparing Lisp code for distribution
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi
index 751adcf..dc0c744 100644
--- a/doc/lispref/positions.texi
+++ b/doc/lispref/positions.texi
@@ -1,6 +1,6 @@
 @c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1990--1995, 1998--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Positions
 @chapter Positions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 5fefab9..535cebe 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Processes
@@ -3111,7 +3111,8 @@ signaled. Call @code{puny-encode-domain} on @var{name}
 first if you wish to lookup internationalized hostnames.
 
 If successful it returns a list of Lisp representations of network
-addresses, otherwise it returns @code{nil}.
+addresses, otherwise it returns @code{nil}.  In the latter case, it
+also displays the error message hopefully explaining what went wrong.
 
 By default both IPv4 and IPv6 lookups are attempted.  The optional
 argument @var{family} controls this behavior, specifying the symbol
diff --git a/doc/lispref/records.texi b/doc/lispref/records.texi
index f7a21a4..573caf1 100644
--- a/doc/lispref/records.texi
+++ b/doc/lispref/records.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 2017--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2017--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Records
 @chapter Records
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 35a5188..16a8e56 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Searching and Matching
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 952834b..0c74dbe 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Sequences Arrays Vectors
@@ -116,6 +116,21 @@ If you need to compute the width of a string on display, 
you should use
 since @code{length} only counts the number of characters, but does not
 account for the display width of each character.
 
+@defun length< sequence length
+Return non-@code{nil} if @var{sequence} is shorter than @var{length}.
+This may be more efficient than computing the length of @var{sequence}
+if @var{sequence} is a long list.
+@end defun
+
+@defun length> sequence length
+Return non-@code{nil} if @var{sequence} is longer than @var{length}.
+@end defun
+
+@defun length= sequence length
+Return non-@code{nil} if the length of @var{sequence} is equal to
+@var{length}.
+@end defun
+
 @defun elt sequence index
 @anchor{Definition of elt}
 @cindex elements of sequences
diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi
index 0534afb..535fc95 100644
--- a/doc/lispref/streams.texi
+++ b/doc/lispref/streams.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1994, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1994, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Read and Print
@@ -123,13 +123,13 @@ came from.  In this case, it makes no difference what 
value
 @code{t} used as a stream means that the input is read from the
 minibuffer.  In fact, the minibuffer is invoked once and the text
 given by the user is made into a string that is then used as the
-input stream.  If Emacs is running in batch mode, standard input is used
-instead of the minibuffer.  For example,
+input stream.  If Emacs is running in batch mode (@pxref{Batch Mode}),
+standard input is used instead of the minibuffer.  For example,
 @example
 (message "%s" (read t))
 @end example
-will read a Lisp expression from standard input and print the result
-to standard output.
+will in batch mode read a Lisp expression from standard input and
+print the result to standard output.
 
 @item @code{nil}
 @cindex @code{nil} input stream
@@ -392,13 +392,15 @@ is responsible for storing the characters wherever you 
want to put them.
 
 @item @code{t}
 @cindex @code{t} output stream
-The output characters are displayed in the echo area.
+The output characters are displayed in the echo area.  If Emacs is
+running in batch mode (@pxref{Batch Mode}), the output is written to
+the standard output descriptor instead.
 
 @item @code{nil}
 @cindex @code{nil} output stream
-@code{nil} specified as an output stream means to use the value of
-@code{standard-output} instead; that value is the @dfn{default output
-stream}, and must not be @code{nil}.
+@code{nil} specified as an output stream means to use the value of the
+@code{standard-output} variable instead; that value is the
+@dfn{default output stream}, and must not be @code{nil}.
 
 @item @var{symbol}
 A symbol as output stream is equivalent to the symbol's function
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 0f157c3..897b424 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -1,6 +1,6 @@
 @c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Strings and Characters
@@ -120,7 +120,10 @@ character (i.e., an integer), @code{nil} otherwise.
 @cindex string creation
 
   The following functions create strings, either from scratch, or by
-putting strings together, or by taking them apart.
+putting strings together, or by taking them apart.  (For functions that
+create strings based on searching the contents of other strings (like
+@code{string-replace} and @code{replace-regexp-in-string}), see
+@ref{Search and Replace}.)
 
 @defun make-string count character &optional multibyte
 This function returns a string made up of @var{count} repetitions of
@@ -381,6 +384,52 @@ The default value of @var{separators} for 
@code{split-string}.  Its
 usual value is @w{@code{"[ \f\t\n\r\v]+"}}.
 @end defvar
 
+@defun string-clean-whitespace string
+Clean up the whitespace in @var{string} by collapsing stretches of
+whitespace to a single space character, as well as removing all
+whitespace from the start and the end of @var{string}.
+@end defun
+
+@defun string-fill string length
+Attempt to Word-wrap @var{string} so that no lines are longer than
+@var{length}.  Filling is done on whitespace boundaries only.  If
+there are individual words that are longer than @var{length}, these
+will not be shortened.
+@end defun
+
+@defun string-limit string length &optional end coding-system
+If @var{string} is shorter than @var{length}, @var{string} is returned
+as is.  Otherwise, return a substring of @var{string} consisting of
+the first @var{length} characters.  If the optional @var{end}
+parameter is given, return a string of the @var{length} last
+characters instead.
+
+If @var{coding-system} is non-@code{nil}, @var{string} will be encoded
+before limiting, and the result will be a unibyte string that's
+shorter than @code{length}.  If @var{string} contains characters that
+are encoded into several bytes (for instance, when using
+@code{utf-8}), the resulting unibyte string is never truncated in the
+middle of a character representation.
+@end defun
+
+@defun string-lines string &optional omit-nulls
+Split @var{string} into a list of strings on newline boundaries.  If
+@var{omit-nulls}, remove empty lines from the results.
+@end defun
+
+@defun string-pad string length &optional padding start
+Pad @var{string} to the be of @var{length} using @var{padding} as the
+padding character (defaulting to the space character).  If
+@var{string} is shorter than @var{length}, no padding is done.  If
+@var{start} is @code{nil} (or not present), the padding is done to the
+end of the string, and if it's non-@code{nil}, to the start of the
+string.
+@end defun
+
+@defun string-chop-newline string
+Remove the final newline, if any, from @var{string}.
+@end defun
+
 @node Modifying Strings
 @section Modifying Strings
 @cindex modifying strings
@@ -1167,7 +1216,7 @@ The function @code{format-spec} described in this section 
performs a
 similar function to @code{format}, except it operates on format
 control strings that use arbitrary specification characters.
 
-@defun format-spec template spec-alist &optional ignore-missing
+@defun format-spec template spec-alist &optional ignore-missing split
 This function returns a string produced from the format string
 @var{template} according to conversions specified in @var{spec-alist},
 which is an alist (@pxref{Association Lists}) of the form
@@ -1209,6 +1258,16 @@ any; if it is @code{delete}, those format specifications 
are removed
 from the output; any other non-@code{nil} value is handled like
 @code{ignore}, but any occurrences of @samp{%%} are also left verbatim
 in the output.
+
+If the optional argument @var{split} is non-@code{nil}, instead of
+returning a single string, @code{format-spec} will split the result
+into a list of strings, based on where the substitutions were
+performed.  For instance:
+
+@example
+(format-spec "foo %b bar" '((?b . "zot")) nil t)
+     @result{} ("foo " "zot" " bar")
+@end example
 @end defun
 
 The syntax of format specifications accepted by @code{format-spec} is
diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi
index d6b0494..ed36f51 100644
--- a/doc/lispref/symbols.texi
+++ b/doc/lispref/symbols.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Symbols
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi
index b99b5de..b4bd487 100644
--- a/doc/lispref/syntax.texi
+++ b/doc/lispref/syntax.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Syntax Tables
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index c6ca4ee..0b567d8 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1990--1995, 1998--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Text
 @chapter Text
@@ -2931,6 +2931,22 @@ used instead.  Here is an example:
 @end example
 @end defvar
 
+@defun object-intervals OBJECT
+This function returns a copy of the intervals (i.e., text properties)
+in @var{object} as a list of intervals.  @var{object} must be a string
+or a buffer.  Altering the structure of this list does not change the
+intervals in the object.
+
+@example
+(object-intervals (propertize "foo" 'face 'bold))
+     @result{} ((0 3 (face bold)))
+@end example
+
+Each element in the returned list represents one interval.  Each
+interval has three parts: The first is the start, the second is the
+end, and the third part is the text property itself.
+@end defun
+
 @node Changing Properties
 @subsection Changing Text Properties
 @cindex changing text properties
diff --git a/doc/lispref/threads.texi b/doc/lispref/threads.texi
index de19c06..a06bd3e 100644
--- a/doc/lispref/threads.texi
+++ b/doc/lispref/threads.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 2012--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2012--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Threads
 @chapter Threads
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index c9a43e0..4a7793a 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -1,6 +1,6 @@
 @c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1993, 1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1993, 1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Tips
@@ -989,7 +989,7 @@ explains these conventions, starting with an example:
 @group
 ;;; foo.el --- Support for the Foo programming language  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2010-2020 Your Name
+;; Copyright (C) 2010-2021 Your Name
 @end group
 
 ;; Author: Your Name <yourname@@example.com>
diff --git a/doc/lispref/two-volume-cross-refs.txt 
b/doc/lispref/two-volume-cross-refs.txt
index 63f5563..ad13d98 100644
--- a/doc/lispref/two-volume-cross-refs.txt
+++ b/doc/lispref/two-volume-cross-refs.txt
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See end for copying conditions.
 
 Two Volume Cross References
diff --git a/doc/lispref/two-volume.make b/doc/lispref/two-volume.make
index 133c50b..cf612b1 100644
--- a/doc/lispref/two-volume.make
+++ b/doc/lispref/two-volume.make
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2020 Free Software Foundation, Inc.
+# Copyright (C) 2007-2021 Free Software Foundation, Inc.
 # See end for copying conditions.
 
 # although it would be nice to use tex rather than pdftex to avoid
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 095ea9d..6343817 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1990--1995, 1998--2021 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Variables
 @chapter Variables
@@ -481,10 +481,12 @@ form occurs in a @code{let} form with lexical binding 
enabled), then
 effect until its binding construct exits.  @xref{Variable Scoping}.
 
 @cindex @code{eval-defun}, and @code{defvar} forms
-When you evaluate a top-level @code{defvar} form with @kbd{C-M-x} in
-Emacs Lisp mode (@code{eval-defun}), a special feature of
-@code{eval-defun} arranges to set the variable unconditionally, without
-testing whether its value is void.
+@cindex @code{eval-last-sexp}, and @code{defvar} forms
+When you evaluate a top-level @code{defvar} form with @kbd{C-M-x}
+(@code{eval-defun}) or with @kbd{C-x C-e} (@code{eval-last-sexp}) in
+Emacs Lisp mode, a special feature of these two commands arranges to
+set the variable unconditionally, without testing whether its value is
+void.
 
 If the @var{doc-string} argument is supplied, it specifies the
 documentation string for the variable (stored in the symbol's
@@ -1285,7 +1287,7 @@ be used.)
 
 @subsubheading Cross-file variable checking
 
-@strong{Note:} This is an experimental feature that may change or
+@strong{Caution:} This is an experimental feature that may change or
 disappear without prior notice.
 
 The byte-compiler can also warn about lexical variables that are
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index db80b49..b0906ac 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990--1995, 1998--1999, 2001--2020 Free Software
+@c Copyright (C) 1990--1995, 1998--1999, 2001--2021 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Windows
diff --git a/doc/man/ChangeLog.1 b/doc/man/ChangeLog.1
index 5e23bb3..9ad144a 100644
--- a/doc/man/ChangeLog.1
+++ b/doc/man/ChangeLog.1
@@ -176,7 +176,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2007-2020 Free Software Foundation, Inc.
+  Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/doc/man/ebrowse.1 b/doc/man/ebrowse.1
index 330c1ea..7bb32b8 100644
--- a/doc/man/ebrowse.1
+++ b/doc/man/ebrowse.1
@@ -82,7 +82,7 @@ should give you access to the complete manual.
 was written by Gerd Moellmann.
 .
 .SH COPYING
-Copyright 2008-2020 Free Software Foundation, Inc.
+Copyright 2008-2021 Free Software Foundation, Inc.
 .PP
 Permission is granted to make and distribute verbatim copies of this
 document provided the copyright notice and this permission notice are
diff --git a/doc/man/emacs.1.in b/doc/man/emacs.1.in
index 3a5758e..da912bd 100644
--- a/doc/man/emacs.1.in
+++ b/doc/man/emacs.1.in
@@ -657,7 +657,7 @@ For detailed credits and acknowledgments, see the GNU Emacs 
manual.
 .
 .
 .SH COPYING
-Copyright 1995, 1999-2020 Free Software Foundation, Inc.
+Copyright 1995, 1999-2021 Free Software Foundation, Inc.
 .PP
 Permission is granted to make and distribute verbatim copies of this
 document provided the copyright notice and this permission notice are
diff --git a/doc/man/etags.1 b/doc/man/etags.1
index 8053e86..c5c15fb 100644
--- a/doc/man/etags.1
+++ b/doc/man/etags.1
@@ -281,7 +281,7 @@ Stallman.
 .BR vi ( 1 ).
 
 .SH COPYING
-Copyright 1992, 1999, 2001-2020 Free Software Foundation, Inc.
+Copyright 1992, 1999, 2001-2021 Free Software Foundation, Inc.
 .PP
 Permission is granted to make and distribute verbatim copies of this
 document provided the copyright notice and this permission notice are
diff --git a/doc/misc/ChangeLog.1 b/doc/misc/ChangeLog.1
index f74e51f..c050e5d 100644
--- a/doc/misc/ChangeLog.1
+++ b/doc/misc/ChangeLog.1
@@ -12116,7 +12116,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1993-1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1993-1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index f4fb7d2..d627055 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 1994, 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1996-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi
index f8fcb64..d810f15 100644
--- a/doc/misc/auth.texi
+++ b/doc/misc/auth.texi
@@ -9,7 +9,7 @@
 @copying
 This file describes the Emacs auth-source library.
 
-Copyright @copyright{} 2008--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2008--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/autotype.texi b/doc/misc/autotype.texi
index 7b7f882..72ba736 100644
--- a/doc/misc/autotype.texi
+++ b/doc/misc/autotype.texi
@@ -11,7 +11,7 @@
 @c  @cindex autotypist
 
 @copying
-Copyright @copyright{} 1994--1995, 1999, 2001--2020 Free Software
+Copyright @copyright{} 1994--1995, 1999, 2001--2021 Free Software
 Foundation, Inc.
 
 @quotation
diff --git a/doc/misc/bovine.texi b/doc/misc/bovine.texi
index 8ee9850..780f0ad 100644
--- a/doc/misc/bovine.texi
+++ b/doc/misc/bovine.texi
@@ -24,7 +24,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 1999--2004, 2012--2020 Free Software Foundation,
+Copyright @copyright{} 1999--2004, 2012--2021 Free Software Foundation,
 Inc.
 
 @quotation
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index 6a6f585..c4ccea3 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -95,7 +95,7 @@ This file documents Calc, the GNU Emacs calculator, included 
with
 GNU Emacs @value{EMACSVER}.
 @end ifnotinfo
 
-Copyright @copyright{} 1990--1991, 2001--2020 Free Software Foundation,
+Copyright @copyright{} 1990--1991, 2001--2021 Free Software Foundation,
 Inc.
 
 @quotation
@@ -28047,13 +28047,7 @@ defined as the distance that light will travel in a 
vacuum in
 vacuum is exactly 299792458 m/s.  Many other units have been
 redefined in terms of fundamental physical processes; a second, for
 example, is currently defined as 9192631770 periods of a certain
-radiation related to the cesium-133 atom.  The only SI unit that is not
-based on a fundamental physical process (although there are efforts to
-change this) is the kilogram, which was originally defined as the mass
-of one liter of water, but is now defined as the mass of the
-international prototype of the kilogram (IPK), a cylinder of platinum-iridium
-kept at the Bureau international des poids et mesures in Sèvres,
-France.  (There are several copies of the IPK throughout the world.)
+radiation related to the cesium-133 atom.
 The British imperial units, once defined in terms of physical objects,
 were redefined in 1963 in terms of SI units.  The US customary units,
 which were the same as British units until the British imperial system
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index adc233d..24ab4b7 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -167,7 +167,7 @@ CC Mode
 @copying
 This manual is for CC Mode in Emacs.
 
-Copyright @copyright{} 1995--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1995--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -197,7 +197,7 @@ modify this GNU manual.''
 @titlepage
 @sp 10
 
-@center @titlefont{CC Mode 5.34}
+@center @titlefont{CC Mode 5.35}
 @sp 2
 @center A GNU Emacs mode for editing C and C-like languages
 @sp 2
@@ -388,7 +388,7 @@ was added in version 5.30.
 
 This manual describes @ccmode{}
 @comment The following line must appear on its own, so that the
-version 5.34.
+version 5.35.
 @comment Release.py script can update the version number automatically
 
 @ccmode{} supports the editing of C, C++, Objective-C,
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 084edd1..7464ba2 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -7,7 +7,7 @@
 @copying
 This file documents the GNU Emacs Common Lisp emulation package.
 
-Copyright @copyright{} 1993, 2001--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1993, 2001--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -1097,10 +1097,9 @@ by @var{x} if specified.
 
 @defmac cl-pushnew x place @t{&key :test :test-not :key}
 This macro inserts @var{x} at the front of the list stored in
-@var{place}, but only if @var{x} was not @code{eql} to any
-existing element of the list.  The optional keyword arguments
-are interpreted in the same way as for @code{cl-adjoin}.
-@xref{Lists as Sets}.
+@var{place}, but only if @var{x} isn't present in the list already.
+The optional keyword arguments are interpreted in the same way as for
+@code{cl-adjoin}.  @xref{Lists as Sets}.
 @end defmac
 
 @defmac cl-shiftf place@dots{} newvalue
@@ -3796,8 +3795,10 @@ This is a destructive version of @code{cl-sublis}.
 @section Lists as Sets
 
 @noindent
-These functions perform operations on lists that represent sets
-of elements.
+These functions perform operations on lists that represent sets of
+elements.  All these functions (unless otherwise specified) default to
+using @code{eql} as the test function, but that can be modified by the
+@code{:test} parameter.
 
 @defun cl-member item list @t{&key :test :test-not :key}
 This function searches @var{list} for an element matching @var{item}.
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi
index 5a1dd55..e8e99db 100644
--- a/doc/misc/dbus.texi
+++ b/doc/misc/dbus.texi
@@ -10,7 +10,7 @@
 @syncodeindex fn cp
 
 @copying
-Copyright @copyright{} 2007--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2007--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi
index 243b59b..87a127c 100644
--- a/doc/misc/dired-x.texi
+++ b/doc/misc/dired-x.texi
@@ -20,7 +20,7 @@
 @comment %**end of header (This is for running Texinfo on a region.)
 
 @copying
-Copyright @copyright{} 1994--1995, 1999, 2001--2020 Free Software
+Copyright @copyright{} 1994--1995, 1999, 2001--2021 Free Software
 Foundation, Inc.
 
 @quotation
diff --git a/doc/misc/ebrowse.texi b/doc/misc/ebrowse.texi
index 98c1a79..8962f7c 100644
--- a/doc/misc/ebrowse.texi
+++ b/doc/misc/ebrowse.texi
@@ -11,7 +11,7 @@
 @copying
 This file documents Ebrowse, a C++ class browser for GNU Emacs.
 
-Copyright @copyright{} 2000--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2000--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi
index 63e3595..a53f879 100644
--- a/doc/misc/ede.texi
+++ b/doc/misc/ede.texi
@@ -6,7 +6,7 @@
 @copying
 This file describes EDE, the Emacs Development Environment.
 
-Copyright @copyright{} 1998--2001, 2004--2005, 2008--2020 Free Software
+Copyright @copyright{} 1998--2001, 2004--2005, 2008--2021 Free Software
 Foundation, Inc.
 
 @quotation
diff --git a/doc/misc/ediff.texi b/doc/misc/ediff.texi
index 1ef1371..8162a84 100644
--- a/doc/misc/ediff.texi
+++ b/doc/misc/ediff.texi
@@ -26,7 +26,7 @@
 This file documents Ediff, a comprehensive visual interface to Unix diff
 and patch utilities.
 
-Copyright @copyright{} 1995--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1995--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/edt.texi b/doc/misc/edt.texi
index b0200b4..b4dabdb 100644
--- a/doc/misc/edt.texi
+++ b/doc/misc/edt.texi
@@ -6,7 +6,7 @@
 @copying
 This file documents the EDT emulation package for Emacs.
 
-Copyright @copyright{} 1986, 1992, 1994--1995, 1999--2020 Free Software
+Copyright @copyright{} 1986, 1992, 1994--1995, 1999--2021 Free Software
 Foundation, Inc.
 
 @quotation
diff --git a/doc/misc/efaq-w32.texi b/doc/misc/efaq-w32.texi
index c875d58..2abde2c 100644
--- a/doc/misc/efaq-w32.texi
+++ b/doc/misc/efaq-w32.texi
@@ -15,7 +15,7 @@ Answers to Frequently asked Questions about using Emacs on 
Microsoft Windows.
 @include emacsver.texi
 
 @copying
-Copyright @copyright{} 2008, 2010--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2008, 2010--2021 Free Software Foundation, Inc.
 
 @quotation
 This list of frequently asked questions about GNU Emacs on MS Windows
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 1bc9d41..f26ae63 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -12,7 +12,7 @@
 @c appreciate a notice if you do).
 
 @copying
-Copyright @copyright{} 2001--2020 Free Software Foundation, Inc.@*
+Copyright @copyright{} 2001--2021 Free Software Foundation, Inc.@*
 Copyright @copyright{} 1994, 1995, 1996, 1997, 1998, 1999, 2000
 Reuven M. Lerner@*
 Copyright @copyright{} 1992, 1993 Steven Byrnes@*
@@ -512,10 +512,10 @@ This chapter tells you how to get help with Emacs.
 @cindex Help system, entering the
 
 Type @kbd{C-h t} to invoke the self-paced tutorial.  Just typing
-@kbd{C-h} enters the help system.  Starting with Emacs 22, the tutorial
-is available in many foreign languages such as French, German, Japanese,
-Russian, etc.  Use @kbd{M-x help-with-tutorial-spec-language @key{RET}}
-to choose your language and start the tutorial.
+@kbd{C-h} enters the help system.  The tutorial is available in many
+foreign languages such as French, German, Japanese, Russian, etc.  Use
+@kbd{M-x help-with-tutorial-spec-language @key{RET}} to choose your
+language and start the tutorial.
 
 Your system administrator may have changed @kbd{C-h} to act like
 @key{DEL} to deal with local keyboards.  You can use @kbd{M-x
@@ -594,11 +594,11 @@ You can get a printed reference card listing commands and 
keys to
 invoke them.  You can order one from the FSF for $2 (or 10 for $18),
 or you can print your own from the @file{etc/refcards/refcard.tex} or
 @file{etc/refcards/refcard.pdf} files in the Emacs distribution.
-Beginning with version 21.1, the Emacs distribution comes with
-translations of the reference card into several languages; look for
-files named @file{etc/refcards/@var{lang}-refcard.*}, where @var{lang}
-is a two-letter code of the language.  For example, the German version
-of the reference card is in the files @file{etc/refcards/de-refcard.tex}
+The Emacs distribution comes with translations of the reference card
+into several languages; look for files named
+@file{etc/refcards/@var{lang}-refcard.*}, where @var{lang} is a
+two-letter code of the language.  For example, the German version of
+the reference card is in the files @file{etc/refcards/de-refcard.tex}
 and @file{etc/refcards/de-refcard.pdf}.
 
 @item
@@ -901,6 +901,7 @@ status of its latest version.
 @menu
 * Origin of the term Emacs::
 * Latest version of Emacs::
+* New in Emacs 27::
 * New in Emacs 26::
 * New in Emacs 25::
 * New in Emacs 24::
@@ -951,7 +952,7 @@ conventions}).
 Emacs @value{EMACSVER} is the current version as of this writing.  A version
 number with two components (e.g., @samp{24.5}) indicates a released
 version; three components indicate a development
-version (e.g., @samp{27.0.50} is what will eventually become @samp{27.1}).
+version (e.g., @samp{28.0.50} is what will eventually become @samp{28.1}).
 
 Emacs is under active development, hosted at
 @uref{https://savannah.gnu.org/projects/emacs/, Savannah}.
@@ -966,9 +967,66 @@ latest features, you may want to stick to the releases.
 
 The following sections list some of the major new features in the last
 few Emacs releases.  For full details of the changes in any version of
-Emacs, type @kbd{C-h C-n} (@kbd{M-x view-emacs-news}).  As of Emacs 22,
-you can give this command a prefix argument to read about which features
-were new in older versions.
+Emacs, type @kbd{C-h C-n} (@kbd{M-x view-emacs-news}).  You can give
+this command a prefix argument to read about which features were new
+in older versions.
+
+@node New in Emacs 27
+@section What is different about Emacs 27?
+@cindex Differences between Emacs 26 and Emacs 27
+@cindex Emacs 27, new features in
+
+@itemize
+@cindex bignum support
+@item
+Emacs now uses the GNU Multiple Precision (@acronym{GMP}) library to
+support integers whose size is too large to support natively.  The
+integers supported natively are known as ``fixnums'', while the larger
+ones are ``bignums''.  All the arithmetic, comparison, and logical
+(also known as ``bitwise'') operations where bignums make sense now
+support both fixnums and bignums.
+
+@cindex HarfBuzz
+@item
+Emacs now uses HarfBuzz as its default shaping engine.
+
+@cindex JSON, native parsing
+@item
+Native support for @acronym{JSON} parsing that is much faster than
+@file{json.el}.
+
+@item
+Cairo drawing is no longer experimental.
+
+@cindex portable dumper
+@item
+Emacs now uses a ``portable dumper'' instead of unexec.  This improves
+compatibility with memory allocation on modern systems, and in
+particular better supports the Address Space Layout Randomization
+(@acronym{ASLR}) feature, a security technique used by most modern
+operating systems.
+
+@cindex XDG convention
+@item
+Emacs can now use the @acronym{XDG} convention for init files.
+
+@cindex early init file
+@item
+Emacs can now be configured using an early init file.  The primary
+purpose is to allow customizing how the package system is initialized
+given that initialization now happens before loading the regular init
+file.
+
+@cindex tabs
+@item
+Built-in support for tabs (tab bar and tab line).
+
+@item
+Support for resizing and rotating of images without ImageMagick.
+@end itemize
+
+Consult the Emacs @file{NEWS} file (@kbd{C-h n}) for the full list of
+changes in Emacs 27.
 
 @node New in Emacs 26
 @section What is different about Emacs 26?
@@ -1672,8 +1730,6 @@ would use with @code{display-line-numbers}.
 There is also the @samp{linum} package (distributed with Emacs since
 version 23.1) which will henceforth become obsolete.  Users and
 developers are encouraged to use @samp{display-line-numbers} instead.
-The packages @samp{setnu} and @samp{wb-line-number} (not distributed
-with Emacs) also implement this feature.
 
 @node Displaying the current file name in the titlebar
 @section How can I modify the titlebar to contain the current file name?
@@ -1694,7 +1750,7 @@ machine at which Emacs was invoked.  This is done by 
setting
 @code{frame-title-format} to the default value of
 
 @lisp
-(multiple-frames "%b" ("" invocation-name "@@" (system-name)))
+(multiple-frames "%b" ("" "%b - GNU Emacs at " system-name))
 @end lisp
 
 To modify the behavior such that frame titlebars contain the buffer's
@@ -1725,14 +1781,6 @@ buffer by default, put this in your @file{.emacs} file:
            (setq abbrev-mode t)))
 @end lisp
 
-@noindent If your Emacs version is older then 22.1, you will also need to use:
-
-@lisp
-(condition-case ()
-   (quietly-read-abbrev-file)
-  (file-error nil))
-@end lisp
-
 @node Associating modes with files
 @section How do I make Emacs use a certain major mode for certain files?
 @cindex Associating modes with files
@@ -2583,16 +2631,14 @@ effective way of doing that.  Emacs automatically 
intercepts the compile
 error messages, inserts them into a special buffer called
 @file{*compilation*}, and lets you visit the locus of each message in
 the source.  Type @kbd{C-x `} to step through the offending lines one by
-one (starting with Emacs 22, you can also use @kbd{M-g M-p} and
-@kbd{M-g M-n} to go to the previous and next matches directly).  Click
-@kbd{mouse-2} or press @key{RET} on a message text in the
-@file{*compilation*} buffer to go to the line whose number is mentioned
-in that message.
+one (you can also use @kbd{M-g M-p} and @kbd{M-g M-n} to go to the
+previous and next matches directly).  Click @kbd{mouse-2} or press
+@key{RET} on a message text in the @file{*compilation*} buffer to go
+to the line whose number is mentioned in that message.
 
 But if you indeed need to go to a certain text line, type @kbd{M-g M-g}
-(which is the default binding of the @code{goto-line} function starting
-with Emacs 22).  Emacs will prompt you for the number of the line and go
-to that line.
+(which is the default binding of the @code{goto-line} function).
+Emacs will prompt you for the number of the line and go to that line.
 
 You can do this faster by invoking @code{goto-line} with a numeric
 argument that is the line's number.  For example, @kbd{C-u 286 M-g M-g}
@@ -2825,13 +2871,13 @@ Add the following line to your @file{.emacs} file:
 @cindex @code{ls} in Shell mode
 
 In many systems, @code{ls} is aliased to @samp{ls --color}, which
-prints using ANSI color escape sequences.  Emacs version 21.1 and
-later includes the @code{ansi-color} package, which lets Shell mode
-recognize these escape sequences.  In Emacs 23.2 and later, the
-package is enabled by default; in earlier versions you can enable it
-by typing @kbd{M-x ansi-color-for-comint-mode} in the Shell buffer, or
-by adding @code{(add-hook 'shell-mode-hook
-'ansi-color-for-comint-mode-on)} to your init file.
+prints using ANSI color escape sequences.  Emacs includes the
+@code{ansi-color} package, which lets Shell mode recognize these
+escape sequences.  In Emacs 23.2 and later, the package is enabled by
+default; in earlier versions you can enable it by typing @kbd{M-x
+ansi-color-for-comint-mode} in the Shell buffer, or by adding
+@code{(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)} to
+your init file.
 
 @node Fullscreen mode on MS-Windows
 @section How can I start Emacs in fullscreen mode on MS-Windows?
@@ -3210,12 +3256,11 @@ arbitrary Emacs Lisp code evaluated when the file is 
visited.
 Obviously, there is a potential for Trojan horses to exploit this
 feature.
 
-As of Emacs 22, Emacs has a list of local variables that are known to
-be safe to set.  If a file tries to set any variable outside this
-list, it asks the user to confirm whether the variables should be set.
-You can also tell Emacs whether to allow the evaluation of Emacs Lisp
-code found at the bottom of files by setting the variable
-@code{enable-local-eval}.
+Emacs has a list of local variables that are known to be safe to set.
+If a file tries to set any variable outside this list, it asks the
+user to confirm whether the variables should be set. You can also tell
+Emacs whether to allow the evaluation of Emacs Lisp code found at the
+bottom of files by setting the variable @code{enable-local-eval}.
 
 @xref{File Variables,,, emacs, The GNU Emacs Manual}.
 
@@ -3333,7 +3378,7 @@ the main GNU distribution site, sources are available as
 @c Don't include VER in the file name, because pretests are not there.
 @uref{https://ftp.gnu.org/pub/gnu/emacs/emacs-VERSION.tar.gz}
 
-(Replace @samp{VERSION} with the relevant version number, e.g., @samp{23.1}.)
+(Replace @samp{VERSION} with the relevant version number, e.g., @samp{28.1}.)
 
 @item
 Next uncompress and extract the source files.  This requires
@@ -3403,7 +3448,7 @@ problem (@pxref{Reporting bugs}).
 * Packages that do not come with Emacs::
 * Spell-checkers::
 * Current GNU distributions::
-* Difference between Emacs and XEmacs::
+* What was XEmacs?::
 * Emacs for minimalists::
 * Emacs for MS-DOS::
 * Emacs for MS-Windows::
@@ -3539,35 +3584,21 @@ A list of sites mirroring @samp{ftp.gnu.org} can be 
found at
 
 @uref{https://www.gnu.org/prep/ftp}
 
-@node Difference between Emacs and XEmacs
-@section What is the difference between Emacs and XEmacs (formerly Lucid 
Emacs)?
+@node What was XEmacs?
+@section What was XEmacs?
 @cindex XEmacs
-@cindex Difference Emacs and XEmacs
-@cindex Lucid Emacs
-@cindex Epoch
 
 XEmacs was a branch version of Emacs that is no longer actively
-developed.  XEmacs was first called Lucid Emacs, and was initially
-derived from a prerelease version of Emacs 19.  In this FAQ, we use
-the name ``Emacs'' only for the official version.
-
-XEmacs last released a new version on January 30, 2009, and it lacks
-many important features that exists in Emacs.  In the past, it was not
-uncommon for Emacs packages to include code for compatibility with
-XEmacs.  Nowadays, although some packages still maintain such
-compatibility code, several of the more popular built-in and third
-party packages have either stopped supporting XEmacs or were developed
-exclusively for Emacs.
+developed.  XEmacs last released a new version on January 30, 2009,
+and it lacks many important features that exist in Emacs.  Since its
+development has stopped, we do not expect to see any new releases.
 
-Some XEmacs code has been contributed to Emacs, and we would like to
-use other parts, but the earlier XEmacs maintainers did not always
-keep track of the authors of contributed code, which makes it
-impossible for the FSF to get copyright papers signed for that code.
-(The FSF requires these papers for all the code included in the Emacs
-release, aside from generic C support packages that retain their
-separate identity and are not integrated into the code of Emacs
-proper.)
+In the past, it was not uncommon for Emacs packages to include code
+for compatibility with XEmacs.  Nowadays, most built-in and third party
+packages have either stopped supporting XEmacs or were developed
+exclusively for Emacs.
 
+XEmacs was initially derived from a prerelease version of Emacs 19.
 If you want to talk about these two versions and distinguish them,
 please call them ``Emacs'' and ``XEmacs.''  To contrast ``XEmacs''
 with ``GNU Emacs'' would be misleading, since XEmacs too has its
@@ -3633,8 +3664,8 @@ For MS-DOS, @pxref{Emacs for MS-DOS}.
 @section Where can I get Emacs for GNUstep?
 @cindex GNUstep, Emacs for
 
-Beginning with version 23.1, Emacs supports GNUstep natively.
-See the file @file{nextstep/INSTALL} in the distribution.
+Emacs supports GNUstep natively.  See the file @file{nextstep/INSTALL}
+in the distribution.
 
 @node Emacs for macOS
 @section Where can I get Emacs for macOS?
@@ -3642,8 +3673,8 @@ See the file @file{nextstep/INSTALL} in the distribution.
 @cindex Macintosh, Emacs for
 @cindex macOS, Emacs for
 
-Beginning with version 22.1, Emacs supports macOS natively.
-See the file @file{nextstep/INSTALL} in the distribution.
+Emacs supports macOS natively.  See the file @file{nextstep/INSTALL}
+in the distribution.
 
 @c ------------------------------------------------------------
 @node Key bindings
diff --git a/doc/misc/eieio.texi b/doc/misc/eieio.texi
index 8dd394c..4952e90 100644
--- a/doc/misc/eieio.texi
+++ b/doc/misc/eieio.texi
@@ -12,7 +12,7 @@
 @copying
 This manual documents EIEIO, an object framework for Emacs Lisp.
 
-Copyright @copyright{} 2007--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2007--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/emacs-gnutls.texi b/doc/misc/emacs-gnutls.texi
index bb13ebd..fbc4443 100644
--- a/doc/misc/emacs-gnutls.texi
+++ b/doc/misc/emacs-gnutls.texi
@@ -9,7 +9,7 @@
 @copying
 This file describes the Emacs GnuTLS integration.
 
-Copyright @copyright{} 2012--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2012--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi
index 316a1ba..0cf5ba9 100644
--- a/doc/misc/emacs-mime.texi
+++ b/doc/misc/emacs-mime.texi
@@ -10,7 +10,7 @@
 @copying
 This file documents the Emacs MIME interface functionality.
 
-Copyright @copyright{} 1998--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1998--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/epa.texi b/doc/misc/epa.texi
index fa1833a..cca0d30 100644
--- a/doc/misc/epa.texi
+++ b/doc/misc/epa.texi
@@ -10,7 +10,7 @@
 @copying
 This file describes EasyPG Assistant @value{VERSION}.
 
-Copyright @copyright{} 2007--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2007--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi
index c39d2f9..d635cac 100644
--- a/doc/misc/erc.texi
+++ b/doc/misc/erc.texi
@@ -10,7 +10,7 @@
 @copying
 This manual is for ERC as distributed with Emacs @value{EMACSVER}.
 
-Copyright @copyright{} 2005--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2005--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index bc56a4a..a4e2cb5 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -15,7 +15,7 @@
 @end direntry
 
 @copying
-Copyright @copyright{} 2008, 2010--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2008, 2010--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index 0c5501f..e106f39 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -10,7 +10,7 @@
 @copying
 This manual is for Eshell, the Emacs shell.
 
-Copyright @copyright{} 1999--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1999--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi
index 69a8512..b402770 100644
--- a/doc/misc/eudc.texi
+++ b/doc/misc/eudc.texi
@@ -14,7 +14,7 @@ This file documents EUDC version 1.40.0.
 EUDC is the Emacs Unified Directory Client, a common interface to
 directory servers and contact information.
 
-Copyright @copyright{} 1998, 2000--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1998, 2000--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi
index a2a21f0..6e82a97 100644
--- a/doc/misc/eww.texi
+++ b/doc/misc/eww.texi
@@ -8,7 +8,7 @@
 @copying
 This file documents the GNU Emacs Web Wowser (EWW) package.
 
-Copyright @copyright{} 2014--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2014--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index b475793..9c838a8 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -14,7 +14,7 @@
 This manual is for GNU Flymake (version @value{VERSION}, @value{UPDATED}),
 which is a universal on-the-fly syntax checker for GNU Emacs.
 
-Copyright @copyright{} 2004--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2004--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -213,6 +213,13 @@ This section summarizes customization variables used for 
the
 configuration of the Flymake user interface.
 
 @vtable @code
+@item flymake-mode-line-format
+Format to use for the Flymake mode line indicator.
+
+@item flymake-mode-line-counter-format
+Mode-line construct for formatting Flymake diagnostic counters inside
+the Flymake mode line indicator.
+
 @item flymake-no-changes-timeout
 If any changes are made to the buffer, syntax check is automatically
 started after this many seconds, unless the user makes another change,
@@ -581,7 +588,8 @@ can use the following function:
 Compute @var{buffer}'s region (@var{beg} .  @var{end}) corresponding
 to @var{line} and @var{col}.  If @var{col} is @code{nil}, return a
 region just for @var{line}.  Return @code{nil} if the region is
-invalid.
+invalid.  This function saves match data (@pxref{Saving Match Data,,,
+elisp, The Emacs Lisp Reference Manual}).
 @end deffn
 
 @cindex add a log message
diff --git a/doc/misc/forms.texi b/doc/misc/forms.texi
index 20b0904..3d7ac96 100644
--- a/doc/misc/forms.texi
+++ b/doc/misc/forms.texi
@@ -19,7 +19,7 @@
 @copying
 This file documents Forms mode, a form-editing major mode for GNU Emacs.
 
-Copyright @copyright{} 1989, 1997, 2001--2020 Free Software Foundation,
+Copyright @copyright{} 1989, 1997, 2001--2021 Free Software Foundation,
 Inc.
 
 @quotation
diff --git a/doc/misc/gnus-coding.texi b/doc/misc/gnus-coding.texi
index 9a14a95..94d952b 100644
--- a/doc/misc/gnus-coding.texi
+++ b/doc/misc/gnus-coding.texi
@@ -8,7 +8,7 @@
 @syncodeindex pg cp
 
 @copying
-Copyright @copyright{} 2004--2005, 2007--2020 Free Software Foundation,
+Copyright @copyright{} 2004--2005, 2007--2021 Free Software Foundation,
 Inc.
 
 @quotation
diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi
index adb812f..4c29976 100644
--- a/doc/misc/gnus-faq.texi
+++ b/doc/misc/gnus-faq.texi
@@ -1,7 +1,7 @@
 @c \input texinfo @c -*-texinfo-*-
 @c Uncomment 1st line before texing this file alone.
 @c %**start of header
-@c Copyright (C) 1995, 2001--2020 Free Software Foundation, Inc.
+@c Copyright (C) 1995, 2001--2021 Free Software Foundation, Inc.
 @c
 @c @setfilename gnus-faq.info
 @c @settitle Frequently Asked Questions
@@ -1523,10 +1523,10 @@ Now you only have to tell Gnus to include the X-face in 
your postings by saying
 
 @example
 (setq message-default-headers
-        (with-temp-buffer
-          (insert "X-Face: ")
-          (insert-file-contents "~/.xface")
-          (buffer-string)))
+      (with-temp-buffer
+        (insert "X-Face: ")
+        (insert-file-contents "~/.xface")
+        (buffer-string)))
 @end example
 @noindent
 
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 4aa07ce..797315d 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -8,7 +8,7 @@
 @syncodeindex pg cp
 
 @copying
-Copyright @copyright{} 1995--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1995--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -5028,10 +5028,37 @@ Nothing if the article is a root and lots of spaces if 
it isn't (it
 pushes everything after it off the screen).
 @item [
 Opening bracket, which is normally @samp{[}, but can also be @samp{<}
-for adopted articles (@pxref{Customizing Threading}).
+for adopted articles (@pxref{Customizing Threading}).  This can be
+customized using following settings:
+
+@table @code
+@item gnus-sum-opening-bracket
+@vindex gnus-sum-opening-bracket
+Opening bracket for normal (non-adopted) articles.  The default is
+@samp{[}.
+
+@item gnus-sum-opening-bracket-adopted
+@vindex gnus-sum-opening-bracket-adopted
+Opening bracket for adopted articles.  The default is @samp{<}.
+
+@end table
+
 @item ]
 Closing bracket, which is normally @samp{]}, but can also be @samp{>}
-for adopted articles.
+for adopted articles.  This can be customised using following settings:
+
+@table @code
+@item gnus-sum-closing-bracket
+@vindex gnus-sum-closing-bracket
+Closing bracket for normal (non-adopted) articles.  The default is
+@samp{]}.
+
+@item gnus-sum-closing-bracket-adopted
+@vindex gnus-sum-opening-bracket-adopted
+Closing bracket for adopted articles.  The default is @samp{>}.
+
+@end table
+
 @item >
 One space for each thread level.
 @item <
@@ -26260,6 +26287,16 @@ registry will keep.  If the registry has reached or 
exceeded this
 size, it will reject insertion of new entries.
 @end defvar
 
+@defvar gnus-registry-register-all
+If this option is non-nil, the registry will register all messages, as
+you see them.  This is important to making split-to-parent and
+Message-ID references work correctly, as the registry needs to know
+where all messages are, but it can slow down group opening and the
+saving of Gnus.  If this option is nil, entries must be created
+manually, for instance by storing a custom flag or keyword for the
+message.
+@end defvar
+
 @defvar gnus-registry-prune-factor
 This option (a float between 0 and 1) controls how much the registry
 is cut back during pruning.  In order to prevent constant pruning, the
@@ -26349,8 +26386,14 @@ have to put a rule like this:
       "mail")
 @end lisp
 
-in your fancy split setup.  In addition, you may want to customize the
-following variables.
+in your fancy split setup.
+
+If @code{gnus-registry-register-all} is non-nil (the default), the
+registry will perform splitting for all messages.  If it is nil,
+splitting will only happen for children of messages you've explicitly
+registered.
+
+In addition, you may want to customize the following variables.
 
 @defvar gnus-registry-track-extra
 This is a list of symbols, so it's best to change it from the
@@ -26423,7 +26466,9 @@ Store @code{value} under @code{key} for message 
@code{id}.
 @end defun
 
 @defun gnus-registry-get-id-key (id key)
-Get the data under @code{key} for message @code{id}.
+Get the data under @code{key} for message @code{id}.  If the option
+@code{gnus-registry-register-all} is non-nil, this function will also
+create an entry for @code{id} if one doesn't exist.
 @end defun
 
 @defvar gnus-registry-extra-entries-precious
diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi
index fc4f320..1674565 100644
--- a/doc/misc/htmlfontify.texi
+++ b/doc/misc/htmlfontify.texi
@@ -10,7 +10,7 @@
 This manual documents Htmlfontify, a source code -> crosslinked +
 formatted + syntax colorized html transformer.
 
-Copyright @copyright{} 2002--2003, 2013--2020 Free Software Foundation,
+Copyright @copyright{} 2002--2003, 2013--2021 Free Software Foundation,
 Inc.
 
 @quotation
diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi
index 538c088..3cd53c7 100644
--- a/doc/misc/idlwave.texi
+++ b/doc/misc/idlwave.texi
@@ -23,7 +23,7 @@ Emacs, and interacting with an IDL shell run as a subprocess.
 This is edition @value{EDITION} of the IDLWAVE User Manual for IDLWAVE
 @value{VERSION}.
 
-Copyright @copyright{} 1999--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1999--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/ido.texi b/doc/misc/ido.texi
index 7cc4edd..1c96094 100644
--- a/doc/misc/ido.texi
+++ b/doc/misc/ido.texi
@@ -7,7 +7,7 @@
 @copying
 This file documents the Ido package for GNU Emacs.
 
-Copyright @copyright{} 2013--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2013--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/info.texi b/doc/misc/info.texi
index 85e04a9..27c00f3 100644
--- a/doc/misc/info.texi
+++ b/doc/misc/info.texi
@@ -15,7 +15,7 @@
 This file describes how to use Info, the menu-driven GNU
 documentation system.
 
-Copyright @copyright{} 1989, 1992, 1996--2020 Free Software Foundation,
+Copyright @copyright{} 1989, 1992, 1996--2021 Free Software Foundation,
 Inc.
 
 @quotation
diff --git a/doc/misc/mairix-el.texi b/doc/misc/mairix-el.texi
index 30f5f00..a571c74 100644
--- a/doc/misc/mairix-el.texi
+++ b/doc/misc/mairix-el.texi
@@ -5,7 +5,7 @@
 @include docstyle.texi
 
 @copying
-Copyright @copyright{} 2008--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2008--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/message.texi b/doc/misc/message.texi
index b192822..f2680b4 100644
--- a/doc/misc/message.texi
+++ b/doc/misc/message.texi
@@ -9,7 +9,7 @@
 @copying
 This file documents Message, the Emacs message composition mode.
 
-Copyright @copyright{} 1996--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1996--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/mh-e.texi b/doc/misc/mh-e.texi
index 962f22a..308ea3f 100644
--- a/doc/misc/mh-e.texi
+++ b/doc/misc/mh-e.texi
@@ -25,7 +25,7 @@
 This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
 Manual}, last updated @value{UPDATED}.
 
-Copyright @copyright{} 1995, 2001--2003, 2005--2020 Free Software
+Copyright @copyright{} 1995, 2001--2003, 2005--2021 Free Software
 Foundation, Inc.
 
 @c This dual license has been agreed upon by the FSF.
diff --git a/doc/misc/modus-themes.texi b/doc/misc/modus-themes.texi
index de3ccd2..b16aece 100644
--- a/doc/misc/modus-themes.texi
+++ b/doc/misc/modus-themes.texi
@@ -33,7 +33,7 @@ released on 2020-10-08.  Any reference to a newer feature 
which does
 not yet form part of the latest tagged commit, is explicitly marked as
 such.
 
-Copyright (C) 2020 Free Software Foundation, Inc.
+Copyright (C) 2020--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this
diff --git a/doc/misc/newsticker.texi b/doc/misc/newsticker.texi
index f144975..5d052cc 100644
--- a/doc/misc/newsticker.texi
+++ b/doc/misc/newsticker.texi
@@ -15,7 +15,7 @@ This manual documents Newsticker, a feed reader for Emacs.  It
 corresponds to Emacs version @value{EMACSVER}.
 
 @noindent
-Copyright @copyright{} 2004--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2004--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/nxml-mode.texi b/doc/misc/nxml-mode.texi
index 1741222..3671ac8 100644
--- a/doc/misc/nxml-mode.texi
+++ b/doc/misc/nxml-mode.texi
@@ -9,7 +9,7 @@
 This manual documents nXML mode, an Emacs major mode for editing
 XML with RELAX NG support.
 
-Copyright @copyright{} 2007--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2007--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/octave-mode.texi b/doc/misc/octave-mode.texi
index 2005a8e..1adc268 100644
--- a/doc/misc/octave-mode.texi
+++ b/doc/misc/octave-mode.texi
@@ -6,7 +6,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 1996--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1996--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index b7e05fe..5eeb098 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -7,15 +7,15 @@
 @set txicodequoteundirected
 @set txicodequotebacktick
 @set MAINTAINERSITE @uref{https://orgmode.org,maintainers webpage}
-@set MAINTAINER Carsten Dominik
-@set MAINTAINEREMAIL @email{carsten at orgmode dot org}
-@set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the 
maintainer}
+@set MAINTAINER Bastien Guerry
+@set MAINTAINEREMAIL @email{bzg@gnu.org}
+@set MAINTAINERCONTACT @uref{mailto:bzg@gnu.org,contact the maintainer}
 @c %**end of header
 
 @copying
-This manual is for Org version 9.3.
+This manual is for Org version 9.4.
 
-Copyright @copyright{} 2004--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2004--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -39,7 +39,7 @@ modify this GNU manual.''
 @finalout
 @titlepage
 @title The Org Manual
-@subtitle Release 9.3
+@subtitle Release 9.4
 @author The Org Mode Developers
 @page
 @vskip 0pt plus 1filll
@@ -402,6 +402,10 @@ Texinfo Export
 * Special blocks in Texinfo export:: Special block attributes.
 * A Texinfo example::            Processing Org to Texinfo.
 
+Export in Foreign Buffers
+
+* Bare HTML::                    Exporting HTML without CSS, Javascript, etc.
+
 Publishing
 
 * Configuration::                Defining projects.
@@ -427,6 +431,7 @@ Sample Configuration
 
 Working with Source Code
 
+* Features Overview::            Enjoy the versatility of source blocks.
 * Structure of Code Blocks::     Code block syntax described.
 * Using Header Arguments::       Different ways to set header arguments.
 * Environment of a Code Block::  Arguments, sessions, working directory...
@@ -447,12 +452,13 @@ Miscellaneous
 * Structure Templates::          Quick insertion of structural elements.
 * Speed Keys::                   Electric commands at the beginning of a 
headline.
 * Clean View::                   Getting rid of leading stars in the outline.
+* Execute commands in the active region:: Execute commands on multiple items 
in Org or agenda view.
 * Dynamic Headline Numbering::   Display and update outline numbering.
 * The Very Busy @kbd{C-c C-c} Key:: When in doubt, press @kbd{C-c C-c}.
 * In-buffer Settings::           Overview of keywords.
 * Org Syntax::                   Formal description of Org's syntax.
 * Documentation Access::         Read documentation about current syntax.
-* Escape Character::
+* Escape Character::             Prevent Org from interpreting your writing.
 * Code Evaluation Security::     Org files evaluate in-line code.
 * Interaction::                  With other Emacs packages.
 * TTY Keys::                     Using Org on a tty.
@@ -549,7 +555,7 @@ Markdown.  New export backends can be derived from existing 
ones, or
 defined from scratch.
 
 Org files can include source code blocks, which makes Org uniquely
-suited for authoring technical documents with code examples. Org
+suited for authoring technical documents with code examples.  Org
 source code blocks are fully functional; they can be evaluated in
 place and their results can be captured in the file.  This makes it
 possible to create a single file reproducible research compendium.
@@ -603,7 +609,8 @@ We @strong{strongly recommend} sticking to a single 
installation method.
 @subheading Using Emacs packaging system
 
 Recent Emacs distributions include a packaging system which lets you
-install Elisp libraries.  You can install Org with @kbd{M-x package-install 
@key{RET} org}.
+install Elisp libraries.  You can install Org from the ``package menu'',
+with @kbd{M-x list-packages}.  See @ref{Package Menu,Package Menu,,emacs,}.
 
 @quotation Important
 You need to do this in a session where no @samp{.org} file has been
@@ -619,7 +626,7 @@ page}.
 @subheading Downloading Org as an archive
 
 You can download Org latest release from @uref{https://orgmode.org/, Org's 
website}.  In this case,
-make sure you set the load-path correctly in your Emacs init file:
+make sure you set the load path correctly in your Emacs init file:
 
 @lisp
 (add-to-list 'load-path "~/path/to/orgdir/lisp")
@@ -627,7 +634,7 @@ make sure you set the load-path correctly in your Emacs 
init file:
 
 The downloaded archive contains contributed libraries that are not
 included in Emacs.  If you want to use them, add the @samp{contrib/}
-directory to your load-path:
+directory to your load path:
 
 @lisp
 (add-to-list 'load-path "~/path/to/orgdir/contrib/lisp" t)
@@ -643,7 +650,7 @@ You can clone Org's repository and install Org like this:
 
 @example
 $ cd ~/src/
-$ git clone git@@code.orgmode.org:bzg/org-mode.git
+$ git clone https://code.orgmode.org/bzg/org-mode.git
 $ cd org-mode/
 $ make autoloads
 @end example
@@ -652,7 +659,7 @@ Note that in this case, @samp{make autoloads} is mandatory: 
it defines
 Org's version in @samp{org-version.el} and Org's autoloads in
 @samp{org-loaddefs.el}.
 
-Remember to add the correct load-path as described in the method
+Remember to add the correct load path as described in the method
 above.
 
 You can also compile with @samp{make}, generate the documentation with
@@ -731,7 +738,9 @@ ideas about it, please send an email to the Org mailing list
 @email{emacs-orgmode@@gnu.org}.  You can subscribe to the list 
@uref{https://lists.gnu.org/mailman/listinfo/emacs-orgmode, from this
 web page}.  If you are not a member of the mailing list, your mail will
 be passed to the list after a moderator has approved it@footnote{Please 
consider subscribing to the mailing list in order to
-minimize the work the mailing list moderators have to do.}.
+minimize the work the mailing list moderators have to do.}.  We ask
+you to read and respect the 
@uref{https://www.gnu.org/philosophy/kind-communication.html, GNU Kind 
Communications Guidelines} when
+sending messages on this mailing list.
 
 @findex org-version
 @findex org-submit-bug-report
@@ -827,7 +836,7 @@ or, from the menu: Org @arrow{} Refresh/Reload @arrow{} 
Reload Org uncompiled.
 Then, activate the debugger:
 
 @example
-M-x toggle-debug-or-error <RET>
+M-x toggle-debug-on-error <RET>
 @end example
 
 
@@ -925,13 +934,13 @@ the entire show and hide functionalities into a single 
command,
 @vindex org-special-ctrl-k
 @vindex org-ctrl-k-protect-subtree
 
-Headlines define the structure of an outline tree.  The headlines in
-Org start with one or more stars, on the left margin@footnote{See the 
variables @code{org-special-ctrl-a/e}, @code{org-special-ctrl-k},
+Headlines define the structure of an outline tree.  Org headlines
+start on the left margin@footnote{See the variables 
@code{org-special-ctrl-a/e}, @code{org-special-ctrl-k},
 and @code{org-ctrl-k-protect-subtree} to configure special behavior of
 @kbd{C-a}, @kbd{C-e}, and @kbd{C-k} in headlines.  Note
 also that clocking only works with headings indented less than 30
-stars.}.  For
-example:
+stars.} with one or more stars followed by
+a space.  For example:
 
 @example
 * Top level headline
@@ -1020,10 +1029,12 @@ Point must be on a headline for this to 
work@footnote{See, however, the option @
 '--------------------------------------'
 @end example
 
-When @kbd{S-@key{TAB}} is called with a numeric prefix argument N,
-the CONTENTS view up to headlines of level N are shown.  Note that
-inside tables (see @ref{Tables}), @kbd{S-@key{TAB}} jumps to the previous
-field instead.
+When @kbd{S-@key{TAB}} is called with a numeric prefix argument
+@var{N}, view contents only up to headlines of level
+@var{N}.
+
+Note that inside tables (see @ref{Tables}), @kbd{S-@key{TAB}} jumps to the
+previous field instead.
 
 @vindex org-cycle-global-at-bob
 You can run global cycling using @kbd{@key{TAB}} only if point is at
@@ -1047,9 +1058,9 @@ Show all, including drawers.
 @kindex C-c C-r
 @findex org-reveal
 Reveal context around point, showing the current entry, the
-following heading and the hierarchy above.  Useful for working near
-a location that has been exposed by a sparse tree command (see
-@ref{Sparse Trees}) or an agenda command (see @ref{Agenda Commands}).  With a 
prefix argument show, on each level, all sibling
+following heading and the hierarchy above.  It is useful for working
+near a location that has been exposed by a sparse tree command (see
+@ref{Sparse Trees}) or an agenda command (see @ref{Agenda Commands}).  With a 
prefix argument, show, on each level, all sibling
 headings.  With a double prefix argument, also show the entire
 subtree of the parent.
 
@@ -1057,15 +1068,15 @@ subtree of the parent.
 @cindex show branches, command
 @kindex C-c C-k
 @findex outline-show-branches
-Expose all the headings of the subtree, CONTENTS view for just one
-subtree.
+Expose all the headings of the subtree, but not their bodies.
 
 @item @kbd{C-c @key{TAB}} (@code{outline-show-children})
 @cindex show children, command
 @kindex C-c TAB
 @findex outline-show-children
 Expose all direct children of the subtree.  With a numeric prefix
-argument N, expose all children down to level N@.
+argument @var{N}, expose all children down to level
+@var{N}.
 
 @item @kbd{C-c C-x b} (@code{org-tree-to-indirect-buffer})
 @kindex C-c C-x b
@@ -1074,10 +1085,10 @@ Show the current subtree in an indirect 
buffer@footnote{The indirect buffer cont
 to the current tree.  Editing the indirect buffer also changes the
 original buffer, but without affecting visibility in that buffer.  For
 more information about indirect buffers, see @ref{Indirect Buffers,GNU Emacs 
Manual,,emacs,}.}.  With
-a numeric prefix argument, N, go up to level N and then take that
-tree.  If N is negative then go up that many levels.  With
-a @kbd{C-u} prefix, do not remove the previously used indirect
-buffer.
+a numeric prefix argument @var{N}, go up to level @var{N}
+and then take that tree.  If @var{N} is negative then go up
+that many levels.  With a @kbd{C-u} prefix, do not remove the
+previously used indirect buffer.
 
 @item @kbd{C-c C-x v} (@code{org-copy-visible})
 @kindex C-c C-x v
@@ -1090,10 +1101,10 @@ Copy the @emph{visible} text in the region into the 
kill ring.
 
 @vindex org-startup-folded
 When Emacs first visits an Org file, the global state is set to
-OVERVIEW, i.e., only the top level headlines are visible@footnote{When 
@code{org-agenda-inhibit-startup} is non-@code{nil}, Org does not
+@code{showeverything}, i.e., all file content is visible@footnote{When 
@code{org-agenda-inhibit-startup} is non-@code{nil}, Org does not
 honor the default visibility state when first opening a file for the
-agenda (see @ref{Speeding Up Your Agendas}).}.  This
-can be configured through the variable @code{org-startup-folded}, or on
+agenda (see @ref{Speeding Up Your Agendas}).}.  This can
+be configured through the variable @code{org-startup-folded}, or on
 a per-file basis by adding one of the following lines anywhere in the
 buffer:
 
@@ -1270,14 +1281,22 @@ level.  Yet another @kbd{@key{TAB}}, and you are back 
to the initial
 level.
 
 @item @kbd{M-@key{LEFT}} (@code{org-do-promote})
+@itemx @kbd{M-@key{RIGHT}} (@code{org-do-demote})
 @kindex M-LEFT
 @findex org-do-promote
-Promote current heading by one level.
-
-@item @kbd{M-@key{RIGHT}} (@code{org-do-demote})
 @kindex M-RIGHT
 @findex org-do-demote
-Demote current heading by one level.
+Promote or demote current heading by one level.
+
+@cindex region, active
+@cindex active region
+@cindex transient mark mode
+When there is an active region---i.e., when Transient Mark mode is
+active---promotion and demotion work on all headlines in the region.
+To select a region of headlines, it is best to place both point and
+mark at the beginning of a line, mark at the beginning of the first
+headline, and point at the line just after the last headline to
+change.
 
 @item @kbd{M-S-@key{LEFT}} (@code{org-promote-subtree})
 @kindex M-S-LEFT
@@ -1396,16 +1415,8 @@ Finally, if the first line is a headline, remove the 
stars from all
 headlines in the region.
 @end table
 
-@cindex region, active
-@cindex active region
-@cindex transient mark mode
-When there is an active region---i.e., when Transient Mark mode is
-active---promotion and demotion work on all headlines in the region.
-To select a region of headlines, it is best to place both point and
-mark at the beginning of a line, mark at the beginning of the first
-headline, and point at the line just after the last headline to
-change.  Note that when point is inside a table (see @ref{Tables}), the
-Meta-Cursor keys have different functionality.
+Note that when point is inside a table (see @ref{Tables}), the Meta-Cursor
+keys have different functionality.
 
 @node Sparse Trees
 @section Sparse Trees
@@ -1481,12 +1492,12 @@ matching the string @samp{FIXME}.
 The other sparse tree commands select headings based on TODO keywords,
 tags, or properties and are discussed later in this manual.
 
-@kindex C-c C-e v
+@kindex C-c C-e C-v
 @cindex printing sparse trees
 @cindex visible text, printing
 To print a sparse tree, you can use the Emacs command
 @code{ps-print-buffer-with-faces} which does not print invisible parts of
-the document.  Or you can use the command @kbd{C-c C-e v} to
+the document.  Or you can use the command @kbd{C-c C-e C-v} to
 export only the visible part of the document and print the resulting
 file.
 
@@ -1560,7 +1571,7 @@ My favorite scenes are (in this order)
 But in the end, no individual scenes matter but the film as a whole.
 Important actors in this film are:
 - Elijah Wood :: He plays Frodo
-- Sean Astin :: He plays Sam, Frodo's friend. I still remember him
+- Sean Astin :: He plays Sam, Frodo's friend.  I still remember him
      very well from his role as Mikey Walsh in /The Goonies/.
 @end example
 
@@ -1677,11 +1688,11 @@ bullets (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, 
@samp{1)}) or a subset of them
 on @code{org-plain-list-ordered-item-terminator}, the type of list, and
 its indentation.  With a numeric prefix argument N, select the Nth
 bullet from this list.  If there is an active region when calling
-this, selected text is changed into an item.  With a prefix
-argument, all lines are converted to list items.  If the first line
-already was a list item, any item marker is removed from the list.
-Finally, even without an active region, a normal line is converted
-into a list item.
+this, all lines are converted to list items.  With a prefix
+argument, the selected text is changed into a single item.  If the
+first line already was a list item, any item marker is removed from
+the list.  Finally, even without an active region, a normal line is
+converted into a list item.
 
 @item @kbd{C-c *}
 @kindex C-c *
@@ -1812,7 +1823,7 @@ as the first non-whitespace character is considered part 
of a table.
 @samp{|} is also the column separator@footnote{To insert a vertical bar into a 
table field, use @samp{\vert} or,
 inside a word @samp{abc\vert@{@}def}.}.  Moreover, a line starting
 with @samp{|-} is a horizontal rule.  It separates rows explicitly.  Rows
-before the first horizontal rule are header lines. A table might look
+before the first horizontal rule are header lines.  A table might look
 like this:
 
 @example
@@ -1937,7 +1948,8 @@ Kill the current column.
 @item @kbd{M-S-@key{RIGHT}} (@code{org-table-insert-column})
 @kindex M-S-RIGHT
 @findex org-table-insert-column
-Insert a new column to the left of point position.
+Insert a new column at point position.  Move the recent column and
+all cells to the right of this column to the right.
 
 @item @kbd{M-@key{UP}} (@code{org-table-move-row-up})
 @kindex M-UP
@@ -2121,6 +2133,18 @@ format used to export the file can be configured in the 
variable
 name and the format for table export in a subtree.  Org supports
 quite general formats for exported tables.  The exporter format is
 the same as the format used by Orgtbl radio tables, see @ref{Translator 
functions}, for a detailed description.
+
+@item @kbd{M-x org-table-header-line-mode}
+@findex org-table-header-line-mode
+@vindex org-table-header-line-p
+Turn on the display of the first data row of the table at point in
+the window header line when this first row is not visible anymore in
+the buffer.  You can activate this minor mode by default by setting
+the option @code{org-table-header-line-p} to @code{t}.
+
+@item @kbd{M-x org-table-transpose-table-at-point}
+@findex org-table-transpose-table-at-point
+Transpose the table at point and eliminate hlines.
 @end table
 
 @node Column Width and Alignment
@@ -2163,12 +2187,12 @@ several columns or display them with a fixed width, 
regardless of
 content, as shown in the following example.
 
 @example
-|---+---------------------+--------|           |---+-------…|…|
+|---+---------------------+--------|           |---+-------…+…|
 |   | <6>                 |        |           |   | <6>   …|…|
 | 1 | one                 | some   |   ----\   | 1 | one   …|…|
 | 2 | two                 | boring |   ----/   | 2 | two   …|…|
 | 3 | This is a long text | column |           | 3 | This i…|…|
-|---+---------------------+--------|           |---+-------…|…|
+|---+---------------------+--------|           |---+-------…+…|
 @end example
 
 To set the width of a column, one field anywhere in the column may
@@ -2396,11 +2420,12 @@ Here are a few examples:
 @cindex range references
 @cindex references, to ranges
 You may reference a rectangular range of fields by specifying two
-field references connected by two dots @samp{..}.  If both fields are in
-the current row, you may simply use @samp{$2..$7}, but if at least one
-field is in a different row, you need to use the general @samp{@@ROW$COLUMN}
-format at least for the first field, i.e., the reference must start
-with @samp{@@} in order to be interpreted correctly.  Examples:
+field references connected by two dots @samp{..}.  The ends are included in
+the range.  If both fields are in the current row, you may simply use
+@samp{$2..$7}, but if at least one field is in a different row, you need to
+use the general @samp{@@ROW$COLUMN} format at least for the first field,
+i.e., the reference must start with @samp{@@} in order to be interpreted
+correctly.  Examples:
 
 @multitable @columnfractions 0.2 0.8
 @item @samp{$1..$3}
@@ -2410,7 +2435,7 @@ with @samp{@@} in order to be interpreted correctly.  
Examples:
 @item @samp{$<<<..$>>}
 @tab start in third column, continue to the last but one
 @item @samp{@@2$1..@@4$3}
-@tab six fields between these two fields (same as @samp{A2..C4})
+@tab nine fields between these two fields (same as @samp{A2..C4})
 @item @samp{@@-1$-2..@@-1}
 @tab 3 fields in the row above, starting from 2 columns on the left
 @item @samp{@@I..II}
@@ -2446,7 +2471,7 @@ Insert column number on odd rows, set field to empty on 
even rows.
 Copy text or values of each row of column 1 of the table named
 @var{FOO} into column 2 of the current table.
 
-@item @samp{@@3 = 2 * remote(FOO, @@@@1$$#)}
+@item @samp{@@3 = 2 * remote(FOO, @@1$$#)}
 Insert the doubled value of each column of row 1 of the table
 named @var{FOO} into row 3 of the current table.
 @end table
@@ -3429,29 +3454,26 @@ or alternatively
 
 @cindex escape syntax, for links
 @cindex backslashes, in links
-Some @samp{\} and @samp{]} characters in the @var{LINK} part need to be
-``escaped'', i.e., preceded by another @samp{\} character.  More
-specifically, the following character categories, and only them, must
-be escaped, in order:
+Some @samp{\}, @samp{[} and @samp{]} characters in the @var{LINK} part need to
+be ``escaped'', i.e., preceded by another @samp{\} character.  More
+specifically, the following characters, and only them, must be
+escaped:
 
 @enumerate
 @item
-all consecutive @samp{\} characters at the end of the link,
-@item
-any @samp{]} character at the very end of the link,
+all @samp{[} and @samp{]} characters,
 @item
-all consecutive @samp{\} characters preceding @samp{][} or @samp{]]} patterns,
+every @samp{\} character preceding either @samp{]} or @samp{[},
 @item
-any @samp{]} character followed by either @samp{[} or @samp{]}.
+every @samp{\} character at the end of the link.
 @end enumerate
 
 @findex org-link-escape
-Org takes for granted that such links are correctly escaped.
-Functions inserting links (see @ref{Handling Links}) take care of this.
-You only need to bother about those rules when inserting directly, or
-yanking, a URI within square brackets.  When in doubt, you may use the
-function @code{org-link-escape}, which turns a link string into its
-properly escaped form.
+Functions inserting links (see @ref{Handling Links}) properly escape
+ambiguous characters.  You only need to bother about the rules above
+when inserting directly, or yanking, a URI within square brackets.
+When in doubt, you may use the function @code{org-link-escape}, which turns
+a link string into its escaped form.
 
 Once a link in the buffer is complete, with all brackets present, Org
 changes the display so that @samp{DESCRIPTION} is displayed instead of
@@ -3479,29 +3501,32 @@ Literal links.
 
 @cindex internal links
 @cindex links, internal
-@cindex targets, for links
 
-@cindex @samp{CUSTOM_ID}, property
-If the link does not look like a URL, it is considered to be internal
-in the current file.  The most important case is a link like
-@samp{[[#my-custom-id]]} which links to the entry with the @samp{CUSTOM_ID} 
property
-@samp{my-custom-id}.  You are responsible yourself to make sure these
-custom IDs are unique in a file.
+A link that does not look like a URL---i.e., does not start with
+a known scheme or a file name---refers to the current document.  You
+can follow it with @kbd{C-c C-o} when point is on the link, or
+with a mouse click (see @ref{Handling Links}).
 
-Links such as @samp{[[My Target]]} or @samp{[[My Target][Find my target]]} 
lead to a text search in
-the current file.
+@cindex @samp{CUSTOM_ID}, property
+Org provides several refinements to internal navigation within
+a document.  Most notably, a construct like @samp{[[#my-custom-id]]}
+specifically targets the entry with the @samp{CUSTOM_ID} property set to
+@samp{my-custom-id}.  Also, an internal link looking like @samp{[[*Some
+section]]} points to a headline with the name @samp{Some section}@footnote{To 
insert a link targeting a headline, in-buffer completion
+can be used.  Just type a star followed by a few optional letters into
+the buffer and press @kbd{M-@key{TAB}}.  All headlines in the current
+buffer are offered as completions.}.
 
-The link can be followed with @kbd{C-c C-o} when point is on
-the link, or with a mouse click (see @ref{Handling Links}).  Links to
-custom IDs point to the corresponding headline.  The preferred match
-for a text link is a @emph{dedicated target}: the same string in double
-angular brackets, like @samp{<<My Target>>}.
+@cindex targets, for links
+When the link does not belong to any of the cases above, Org looks for
+a @emph{dedicated target}: the same string in double angular brackets, like
+@samp{<<My Target>>}.
 
 @cindex @samp{NAME}, keyword
 If no dedicated target exists, the link tries to match the exact name
-of an element within the buffer.  Naming is done with the @samp{NAME}
-keyword, which has to be put in the line before the element it refers
-to, as in the following example
+of an element within the buffer.  Naming is done, unsurprisingly, with
+the @samp{NAME} keyword, which has to be put in the line before the element
+it refers to, as in the following example
 
 @example
 #+NAME: My Target
@@ -3510,12 +3535,15 @@ to, as in the following example
 | of | four cells |
 @end example
 
-If none of the above succeeds, Org searches for a headline that is
-exactly the link text but may also include a TODO keyword and
-tags@footnote{To insert a link targeting a headline, in-buffer completion
-can be used.  Just type a star followed by a few optional letters into
-the buffer and press @kbd{M-@key{TAB}}.  All headlines in the current
-buffer are offered as completions.}.
+@vindex org-link-search-must-match-exact-headline
+Ultimately, if none of the above succeeds, Org searches for a headline
+that is exactly the link text but may also include a TODO keyword and
+tags, or initiates a plain text search, according to the value of
+@code{org-link-search-must-match-exact-headline}.
+
+Note that you must make sure custom IDs, dedicated targets, and names
+are unique throughout the document.  Org provides a linter to assist
+you in the process, if needed.  See @ref{Org Syntax}.
 
 During export, internal links are used to mark objects and assign them
 a number.  Marked objects are then referenced by links pointing to
@@ -3673,7 +3701,7 @@ options:
 @item
 @tab @samp{file:projects.org}
 @item
-@tab @samp{file:projects.org::some words} (text search) @footnote{The actual 
behavior of the search depends on the value of the
+@tab @samp{file:projects.org::some words} (text search)@footnote{The actual 
behavior of the search depends on the value of the
 variable @code{org-link-search-must-match-exact-headline}.  If its value is
 @code{nil}, then a fuzzy text search is done.  If it is @code{t}, then only the
 exact headline is matched, ignoring spaces and statistic cookies.  If
@@ -3834,7 +3862,7 @@ user/channel/server under the point.
 For any other file, the link points to the file, with a search
 string (see @ref{Search Options}) pointing to the contents
 of the current line.  If there is an active region, the selected
-words form the basis of the search string. You can write custom Lisp
+words form the basis of the search string.  You can write custom Lisp
 functions to select the search string and perform the search for
 particular file types (see @ref{Custom Searches}).
 
@@ -3980,8 +4008,8 @@ this also to @kbd{M-n} and @kbd{M-p}.
 
 @lisp
 (with-eval-after-load 'org
-  (define-key org-mode-map "\M-n" 'org-next-link)
-  (define-key org-mode-map "\M-p" 'org-previous-link))
+  (define-key org-mode-map (kbd "M-n") 'org-next-link)
+  (define-key org-mode-map (kbd "M-p") 'org-previous-link))
 @end lisp
 @end table
 
@@ -4022,12 +4050,11 @@ replacement text.  Here is an example:
 
 @lisp
 (setq org-link-abbrev-alist
-      '(("bugzilla"  . "http://10.1.2.9/bugzilla/show_bug.cgi?id=";)
-        ("url-to-ja" . "http://translate.google.fr/translate?sl=en&tl=ja&u=%h";)
-        ("google"    . "http://www.google.com/search?q=";)
-        ("gmap"      . "http://maps.google.com/maps?q=%s";)
-        ("omap"      . 
"http://nominatim.openstreetmap.org/search?q=%s&polygon=1";)
-        ("ads"       . 
"https://ui.adsabs.harvard.edu/search/q=%20author%3A\"%s\"";)))
+      '(("bugzilla"        . "http://10.1.2.9/bugzilla/show_bug.cgi?id=";)
+        ("Nu Html Checker" . "https://validator.w3.org/nu/?doc=%h";)
+        ("duckduckgo"      . "https://duckduckgo.com/?q=%s";)
+        ("omap"            . 
"http://nominatim.openstreetmap.org/search?q=%s&polygon=1";)
+        ("ads"             . 
"https://ui.adsabs.harvard.edu/search/q=%20author%3A\"%s\"";)))
 @end lisp
 
 If the replacement text contains the string @samp{%s}, it is replaced with
@@ -4852,8 +4879,8 @@ example.
 
 If you use Org mode extensively, you may end up with enough TODO items
 that it starts to make sense to prioritize them.  Prioritizing can be
-done by placing a @emph{priority cookie} into the headline of a TODO item,
-like this
+done by placing a @emph{priority cookie} into the headline of a TODO item
+right after the TODO keyword, like this:
 
 @example
 *** TODO [#A] Write letter to Sam Fortune
@@ -4864,11 +4891,22 @@ like this
 By default, Org mode supports three priorities: @samp{A}, @samp{B}, and 
@samp{C}.
 @samp{A} is the highest priority.  An entry without a cookie is treated as
 equivalent if it had priority @samp{B}.  Priorities make a difference only
-for sorting in the agenda (see @ref{Weekly/daily agenda}); outside the
+for sorting in the agenda (see @ref{Weekly/daily agenda}).  Outside the
 agenda, they have no inherent meaning to Org mode.  The cookies are
 displayed with the face defined by the variable @code{org-priority-faces},
 which can be customized.
 
+You can also use numeric values for priorities, such as
+
+@example
+*** TODO [#1] Write letter to Sam Fortune
+@end example
+
+
+When using numeric priorities, you need to set @code{org-priority-highest},
+@code{org-priority-lowest} and @code{org-priority-default} to integers, which
+must all be strictly inferior to 65.
+
 Priorities can be attached to any outline node; they do not need to be
 TODO items.
 
@@ -4894,12 +4932,12 @@ that these keys are also used to modify timestamps (see 
@ref{Creating Timestamps
 a discussion of the interaction with shift-selection.
 @end table
 
-@vindex org-highest-priority
-@vindex org-lowest-priority
-@vindex org-default-priority
+@vindex org-priority-highest
+@vindex org-priority-lowest
+@vindex org-priority-default
 You can change the range of allowed priorities by setting the
-variables @code{org-highest-priority}, @code{org-lowest-priority}, and
-@code{org-default-priority}.  For an individual buffer, you may set these
+variables @code{org-priority-highest}, @code{org-priority-lowest}, and
+@code{org-priority-default}.  For an individual buffer, you may set these
 values (highest, lowest, default) like this (please make sure that the
 highest priority is earlier in the alphabet than the lowest priority):
 
@@ -4908,6 +4946,13 @@ highest priority is earlier in the alphabet than the 
lowest priority):
 #+PRIORITIES: A C B
 @end example
 
+
+Or, using numeric values:
+
+@example
+#+PRIORITIES: 1 10 5
+@end example
+
 @node Breaking Down Tasks
 @section Breaking Down Tasks into Subtasks
 
@@ -5061,6 +5106,21 @@ this headline and the next---so @emph{not} the entire 
subtree.
 If there is no active region, just toggle the checkbox at point.
 @end itemize
 
+@item @kbd{C-c C-x C-r} (@code{org-toggle-radio-button})
+@kindex C-c C-x C-r
+@findex org-toggle-radio-button
+@cindex radio button, checkbox as
+Toggle checkbox status by using the checkbox of the item at point as
+a radio button: when the checkbox is turned on, all other checkboxes
+on the same level will be turned off.  With a universal prefix
+argument, toggle the presence of the checkbox.  With a double prefix
+argument, set it to @samp{[-]}.
+
+@findex org-list-checkbox-radio-mode
+@kbd{C-c C-c} can be told to consider checkboxes as radio buttons by
+setting @samp{#+ATTR_ORG: :radio t} right before the list or by calling
+@kbd{M-x org-list-checkbox-radio-mode} to activate this minor mode.
+
 @item @kbd{M-S-@key{RET}} (@code{org-insert-todo-heading})
 @kindex M-S-RET
 @findex org-insert-todo-heading
@@ -5549,7 +5609,7 @@ with many examples, see @ref{Matching tags and 
properties}.
 
 A property is a key-value pair associated with an entry.  Properties
 can be set so they are associated with a single entry, with every
-entry in a tree, or with every entry in an Org file.
+entry in a tree, or with the whole buffer.
 
 There are two main applications for properties in Org mode.  First,
 properties are like tags, but with a value.  Imagine maintaining
@@ -5619,8 +5679,12 @@ disks in a box like this:
   :END:
 @end example
 
-If you want to set properties that can be inherited by any entry in
-a file, use a line like:
+Properties can be inserted on buffer level.  That means they apply
+before the first headline and can be inherited by all entries in a
+file.  Property blocks defined before first headline needs to be
+located at the top of the buffer, allowing only comments above.
+
+Properties can also be defined using lines like:
 
 @cindex @samp{_ALL} suffix, in properties
 @cindex @samp{PROPERTY}, keyword
@@ -5685,7 +5749,8 @@ necessary, the property drawer is created as well.
 @findex org-insert-drawer
 Insert a property drawer into the current entry.  The drawer is
 inserted early in the entry, but after the lines with planning
-information like deadlines.
+information like deadlines.  If before first headline the drawer is
+inserted at the top of the drawer after any potential comments.
 
 @item @kbd{C-c C-c} (@code{org-property-action})
 @kindex C-c C-c
@@ -5767,7 +5832,7 @@ not be used as keys in the properties drawer:
 @item @samp{CLOSED}
 @tab When was this entry closed?
 @item @samp{DEADLINE}
-@tab The deadline time string, without the angular brackets.
+@tab The deadline timestamp.
 @item @samp{FILE}
 @tab The filename the entry is located in.
 @item @samp{ITEM}
@@ -5775,7 +5840,7 @@ not be used as keys in the properties drawer:
 @item @samp{PRIORITY}
 @tab The priority of the entry, a string with a single letter.
 @item @samp{SCHEDULED}
-@tab The scheduling timestamp, without the angular brackets.
+@tab The scheduling timestamp.
 @item @samp{TAGS}
 @tab The tags defined directly in the headline.
 @item @samp{TIMESTAMP}
@@ -5804,7 +5869,7 @@ Create a sparse tree with all matching entries.  With
 a @kbd{C-u} prefix argument, ignore headlines that are not
 a TODO line.
 
-@item @kbd{M-x org-agenda m}, @code{org-tags-view}
+@item @kbd{M-x org-agenda m} (@code{org-tags-view})
 @kindex m @r{(Agenda dispatcher)}
 @findex org-tags-view
 Create a global list of tag/property matches from all agenda files.
@@ -5922,14 +5987,6 @@ done by defining a column format line.
 @node Scope of column definitions
 @subsubsection Scope of column definitions
 
-To define a column format for an entire file, use a line like:
-
-@cindex @samp{COLUMNS}, keyword
-@example
-#+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
-@end example
-
-
 To specify a format that only applies to a specific tree, add
 a @samp{COLUMNS} property to the top node of that tree, for example:
 
@@ -5940,6 +5997,16 @@ a @samp{COLUMNS} property to the top node of that tree, 
for example:
    :END:
 @end example
 
+A @samp{COLUMNS} property within a property drawer before first headline
+will apply to the entire file.  As an addition to property drawers,
+keywords can also be defined for an entire file using a line like:
+
+@cindex @samp{COLUMNS}, keyword
+@example
+#+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
+@end example
+
+
 If a @samp{COLUMNS} property is present in an entry, it defines columns for
 the entry itself, and for the entire subtree below it.  Since the
 column definition is part of the hierarchical structure of the
@@ -6097,15 +6164,16 @@ format is taken from the @samp{#+COLUMNS} line or from 
the variable
 @code{org-columns-default-format}, and column view is established for the
 current entry and its subtree.
 
-@item @kbd{r} or @kbd{g} (@code{org-columns-redo})
+@item @kbd{r} or @kbd{g} on a columns view line (@code{org-columns-redo})
 @kindex r
 @kindex g
 @findex org-columns-redo
 Recreate the column view, to include recent changes made in the
 buffer.
 
-@item @kbd{q} (@code{org-columns-quit})
+@item @kbd{C-c C-c} or @kbd{q} on a columns view line (@code{org-columns-quit})
 @kindex q
+@kindex C-c C-c
 @findex org-columns-quit
 Exit column view.
 @end table
@@ -6141,10 +6209,11 @@ invokes the same interface that you normally use to 
change that
 property.  For example, the tag completion or fast selection
 interface pops up when editing a @samp{TAGS} property.
 
-@item @kbd{C-c C-c} (@code{org-columns-set-tags-or-toggle})
+@item @kbd{C-c C-c} (@code{org-columns-toggle-or-columns-quit})
 @kindex C-c C-c
-@findex org-columns-set-tags-or-toggle
-When there is a checkbox at point, toggle it.
+@findex org-columns-toggle-or-columns-quit
+When there is a checkbox at point, toggle it.  Else exit column
+view.
 
 @item @kbd{v} (@code{org-columns-show-value})
 @kindex v
@@ -6227,6 +6296,14 @@ create a globally unique ID for the current entry and 
copy it to
 the kill-ring.
 @end table
 
+@item @samp{:match}
+When set to a string, use this as a tags/property match filter to
+select only a subset of the headlines in the scope set by the @code{:id}
+parameter.
+@end table
+
+
+@table @asis
 @item @samp{:hlines}
 When @code{t}, insert an hline after every line.  When a number N, insert
 an hline before each headline with level @code{<= N}.
@@ -6256,12 +6333,16 @@ block.
 The following commands insert or update the dynamic block:
 
 @table @asis
-@item @kbd{C-c C-x i} (@code{org-insert-columns-dblock})
-@kindex C-c C-x i
-@findex org-insert-columns-dblock
+@item @code{org-columns-insert-dblock}
+@kindex C-c C-x x
+@findex org-columns-insert-dblock
 Insert a dynamic block capturing a column view.  Prompt for the
 scope or ID of the view.
 
+This command can be invoked by calling
+@code{org-dynamic-block-insert-dblock} (@kbd{C-c C-x x}) and
+selecting ``columnview'' (see @ref{Dynamic Blocks}).
+
 @item @kbd{C-c C-c} @kbd{C-c C-x C-u} (@code{org-dblock-update})
 @kindex C-c C-c
 @kindex C-c C-x C-u
@@ -6634,6 +6715,8 @@ can control the calendar fully from the minibuffer:
 @kindex M-S-RIGHT
 @kindex M-S-LEFT
 @kindex RET
+@kindex .
+@kindex C-.
 @multitable @columnfractions 0.25 0.55
 @item @kbd{@key{RET}}
 @tab Choose date at point in calendar.
@@ -6659,6 +6742,11 @@ can control the calendar fully from the minibuffer:
 @tab Scroll calendar forward by 3 months.
 @item @kbd{C-v}
 @tab Scroll calendar backward by 3 months.
+@item @kbd{C-.}
+@tab Select today's date@footnote{You can also use the calendar command 
@kbd{.} to jump to
+today's date, but if you are inserting an hour specification for your
+timestamp, @kbd{.} will then insert a dot after the hour.  By contrast,
+@kbd{C-.} will always jump to today's date.}
 @end multitable
 
 @vindex org-read-date-display-live
@@ -6898,7 +6986,7 @@ organize such tasks using a so-called repeater in a 
@samp{DEADLINE},
 the @samp{+1m} is a repeater; the intended interpretation is that the task
 has a deadline on @samp{<2005-10-01>} and repeats itself every (one) month
 starting from that time.  You can use yearly, monthly, weekly, daily
-and hourly repeat cookies by using the @samp{y}, @samp{w}, @samp{m}, @samp{d} 
and @samp{h}
+and hourly repeat cookies by using the @samp{y}, @samp{m}, @samp{w}, @samp{d} 
and @samp{h}
 letters.  If you need both a repeater and a special warning period in
 a deadline entry, the repeater should come first and the warning
 period last
@@ -6948,8 +7036,8 @@ if you have not paid the rent for three months, marking 
this entry
 DONE still keeps it as an overdue deadline.  Depending on the task,
 this may not be the best way to handle it.  For example, if you forgot
 to call your father for 3 weeks, it does not make sense to call him
-3 times in a single day to make up for it.  Finally, there are tasks
-like changing batteries which should always repeat a certain time
+3 times in a single day to make up for it.  Finally, there are tasks,
+like changing batteries, which should always repeat a certain time
 @emph{after} the last time you did it.  For these tasks, Org mode has
 special repeaters @samp{++} and @samp{.+}.  For example:
 
@@ -6971,7 +7059,11 @@ special repeaters @samp{++} and @samp{.+}.  For example:
 
 ** TODO Check the batteries in the smoke detectors
    DEADLINE: <2005-11-01 Tue .+1m>
-   Marking this DONE will shift the date to one month after today.
+   Marking this DONE shifts the date to one month after today.
+
+** TODO Wash my hands
+   DEADLINE: <2019-04-05 08:00 Sun .+1h>
+   Marking this DONE shifts the date to exactly one hour from now.
 @end example
 
 @vindex org-agenda-skip-scheduled-if-deadline-is-shown
@@ -7004,7 +7096,7 @@ recorded.  It also computes the total time spent on each
 subtree@footnote{Clocking only works if all headings are indented with less
 than 30 stars.  This is a hard-coded limitation of @code{lmax} in
 @code{org-clock-sum}.} of a project.  And it remembers a history or tasks
-recently clocked, to that you can jump quickly between a number of
+recently clocked, so that you can jump quickly between a number of
 tasks absorbing your time.
 
 To save the clock history across Emacs sessions, use:
@@ -7173,12 +7265,18 @@ Org mode can produce quite complex reports based on the 
time clocking
 information.  Such a report is called a @emph{clock table}, because it is
 formatted as one or several Org tables.
 
-You can insert, or update, a clock table through Org dynamic blocks
-insert command (see @ref{Dynamic Blocks}), by pressing @kbd{C-c C-x x c l o c 
k t a b l e @key{RET}}.  When called with a prefix argument,
+@table @asis
+@item @code{org-clock-report}
+@kindex C-c C-x x
+@findex org-clock-report
+Insert or update a clock table.  When called with a prefix argument,
 jump to the first clock table in the current document and update it.
 The clock table includes archived trees.
 
-@table @asis
+This command can be invoked by calling
+@code{org-dynamic-block-insert-dblock} (@kbd{C-c C-x x}) and
+selecting ``clocktable'' (see @ref{Dynamic Blocks}).
+
 @item @kbd{C-c C-c} or @kbd{C-c C-x C-u} (@code{org-dblock-update})
 @kindex C-c C-c
 @kindex C-c C-x C-u
@@ -7202,7 +7300,7 @@ needs to be in the @samp{#+BEGIN: clocktable} line for 
this command.  If
 @end table
 
 Here is an example of the frame for a clock table as it is inserted
-into the buffer with the @kbd{C-c C-x C-r} command:
+into the buffer by @code{org-clock-report}:
 
 @cindex @samp{BEGIN clocktable}
 @example
@@ -7211,10 +7309,9 @@ into the buffer with the @kbd{C-c C-x C-r} command:
 @end example
 
 @vindex org-clocktable-defaults
-The @samp{#+BEGIN} line and specify a number of options to define the
-scope, structure, and formatting of the report.  Defaults for all
-these options can be configured in the variable
-@code{org-clocktable-defaults}.
+The @samp{#+BEGIN} line contains options to define the scope, structure,
+and formatting of the report.  Defaults for all these options can be
+configured in the variable @code{org-clocktable-defaults}.
 
 First there are options that determine which clock entries are to
 be selected:
@@ -7302,9 +7399,9 @@ The starting day of the week.  The default is 1 for 
Monday.
 The starting day of the month.  The default is 1 for the first.
 
 @item @samp{:step}
-Set to @samp{day}, @samp{week}, @samp{month} or @samp{year} to split the table 
into
-chunks.  To use this, either @samp{:block}, or @samp{:tstart} and @samp{:tend} 
are
-required.
+Set to @samp{day}, @samp{week}, @samp{semimonth}, @samp{month}, or @samp{year} 
to split the
+table into chunks.  To use this, either @samp{:block}, or @samp{:tstart} and
+@samp{:tend} are required.
 
 @item @samp{:stepskip0}
 When non-@code{nil}, do not show steps that have zero time.
@@ -7539,6 +7636,23 @@ If you only want this from time to time, use three 
universal prefix
 arguments with @code{org-clock-in} and two @kbd{C-u C-u} with
 @code{org-clock-in-last}.
 
+@anchor{Clocking out automatically after some idle time}
+@subsubheading Clocking out automatically after some idle time
+
+@cindex auto clocking out after idle time
+
+@vindex org-clock-auto-clockout-timer
+When you often forget to clock out before being idle and you don't
+want to manually set the clocking time to take into account, you can
+set @code{org-clock-auto-clockout-timer} to a number of seconds and add
+@samp{(org-clock-auto-clockout-insinuate)} to your @samp{.emacs} file.
+
+When the clock is running and Emacs is idle for more than this number
+of seconds, the clock will be clocked out automatically.
+
+Use @samp{M-x org-clock-toggle-auto-clockout RET} to temporarily turn this
+on or off.
+
 @node Effort Estimates
 @section Effort Estimates
 
@@ -7551,9 +7665,14 @@ to produce offers with quotations of the estimated work 
effort, you
 may want to assign effort estimates to entries.  If you are also
 clocking your work, you may later want to compare the planned effort
 with the actual working time, a great way to improve planning
-estimates.  Effort estimates are stored in a special property
-@samp{EFFORT}.  You can set the effort for an entry with the following
-commands:
+estimates.
+
+Effort estimates are stored in a special property @samp{EFFORT}.  Multiple
+formats are supported, such as @samp{3:12}, @samp{1:23:45}, or 
@samp{1d3h5min}; see
+the file @samp{org-duration.el} for more detailed information about the
+format.
+
+You can set the effort for an entry with the following commands:
 
 @table @asis
 @item @kbd{C-c C-x e}  (@code{org-set-effort})
@@ -7767,9 +7886,9 @@ Clear the target cache.  Caching of refile targets can be 
turned on
 by setting @code{org-refile-use-cache}.  To make the command see new
 possible targets, you have to clear the cache with this command.
 
-@item @kbd{C-c M-w} (@code{org-copy})
+@item @kbd{C-c M-w} (@code{org-refile-copy})
 @kindex C-c M-w
-@findex org-copy
+@findex org-refile-copy
 Copying works like refiling, except that the original note is not
 deleted.
 @end table
@@ -7860,6 +7979,10 @@ came, its outline path the archiving time etc.  
Configure the variable
 @code{org-archive-save-context-info} to adjust the amount of information
 added.
 
+@vindex org-archive-subtree-save-file-p
+When @code{org-archive-subtree-save-file-p} is non-@code{nil}, save the target
+archive buffer.
+
 @node Internal archiving
 @subsection Internal archiving
 
@@ -7924,7 +8047,7 @@ none is found, the command offers to set the 
@samp{ARCHIVE} tag for the
 child.  If point is @emph{not} on a headline when this command is
 invoked, check the level 1 trees.
 
-@item @kbd{C-@key{TAB}} (@code{org-force-cycle-archived})
+@item @kbd{C-c C-@key{TAB}} (@code{org-force-cycle-archived})
 @kindex C-TAB
 Cycle a tree even if it is tagged with @samp{ARCHIVE}.
 
@@ -8106,7 +8229,7 @@ going through the interactive template selection, you can 
create your
 key binding like this:
 
 @lisp
-(define-key global-map "\C-cx"
+(define-key global-map (kbd "C-c x")
   (lambda () (interactive) (org-capture nil "x")))
 @end lisp
 
@@ -8225,9 +8348,15 @@ file and moves point to the right location.
 The template for creating the capture item.  If you leave this
 empty, an appropriate default template will be used.  Otherwise this
 is a string with escape codes, which will be replaced depending on
-time and context of the capture call.  The string with escapes may
-be loaded from a template file, using the special syntax @samp{(file
-  "template filename")}.  See below for more details.
+time and context of the capture call.  You may also get this
+template string from a file@footnote{When the file name is not absolute, Org 
assumes it is relative
+to @code{org-directory}.}, or dynamically, from a function
+using either syntax:
+
+@example
+(file "/path/to/template-file")
+(function FUNCTION-RETURNING-THE-TEMPLATE)
+@end example
 
 @item properties
 The rest of the entry is a property list of additional options.
@@ -8244,10 +8373,23 @@ When set, do not offer to edit the information, just 
file it away
 immediately.  This makes sense if the template only needs
 information that can be added automatically.
 
+@item @code{:jump-to-captured}
+When set, jump to the captured entry when finished.
+
 @item @code{:empty-lines}
 Set this to the number of lines to insert before and after the new
 item.  Default 0, and the only other common value is 1.
 
+@item @code{:empty-lines-after}
+Set this to the number of lines that should be inserted after the
+new item.  Overrides @code{:empty-lines} for the number of lines
+inserted after.
+
+@item @code{:empty-lines-before}
+Set this to the number of lines that should be inserted before the
+new item.  Overrides @code{:empty-lines} for the number lines inserted
+before.
+
 @item @code{:clock-in}
 Start the clock in this item.
 
@@ -8269,9 +8411,10 @@ you can force the same behavior by calling 
@code{org-capture} with
 a @kbd{C-1} prefix argument.
 
 @item @code{:tree-type}
-When @code{week}, make a week tree instead of the month tree, i.e.,
-place the headings for each day under a heading with the current
-ISO week.
+Use @code{week} to make a week tree instead of the month-day tree,
+i.e., place the headings for each day under a heading with the
+current ISO week.  Use @code{month} to group entries by month
+only.  Default is to group entries by day.
 
 @item @code{:unnarrowed}
 Do not narrow the target buffer, simply show the full buffer.
@@ -8469,8 +8612,8 @@ See the docstring of the variable for more information.
 It is often useful to associate reference material with an outline
 node.  Small chunks of plain text can simply be stored in the subtree
 of a project.  Hyperlinks (see @ref{Hyperlinks}) can establish associations
-with files that live elsewhere on your computer or in the cloud, like
-emails or source code files belonging to a project.
+with files that live elsewhere on a local, or even remote, computer,
+like emails or source code files belonging to a project.
 
 Another method is @emph{attachments}, which are files located in a
 directory belonging to an outline node.  Org uses directories either
@@ -8487,18 +8630,19 @@ named by a unique ID of each entry, or by a @samp{DIR} 
property.
 @node Attachment defaults and dispatcher
 @subsection Attachment defaults and dispatcher
 
-By default, org-attach will use ID properties when adding attachments
-to outline nodes.  This makes working with attachments fully
-automated.  There is no decision needed for folder-name or location.
-ID-based directories are by default located in the @samp{data/} directory,
-which lives in the same directory where your Org file lives@footnote{If you 
move entries or Org files from one directory to
+By default, Org attach uses ID properties when adding attachments to
+outline nodes.  This makes working with attachments fully automated.
+There is no decision needed for folder-name or location.  ID-based
+directories are by default located in the @samp{data/} directory, which
+lives in the same directory where your Org file lives@footnote{If you move 
entries or Org files from one directory to
 another, you may want to configure @code{org-attach-id-dir} to contain
 an absolute path.}.
-For more control over the setup, see @ref{Attachment options}.
 
 When attachments are made using @code{org-attach} a default tag @samp{ATTACH} 
is
 added to the node that gets the attachments.
 
+For more control over the setup, see @ref{Attachment options}.
+
 The following commands deal with attachments:
 
 @table @asis
@@ -8616,11 +8760,11 @@ This option changes that to relative links.
 @vindex org-attach-use-inheritance
 By default folders attached to an outline node are inherited from
 parents according to @code{org-use-property-inheritance}.  If one instead
-want to set inheritance specifically for org-attach that can be done
+want to set inheritance specifically for Org attach that can be done
 using @code{org-attach-use-inheritance}.  Inheriting documents through
-the node hierarchy makes a lot of sense in most cases. Especially
-since the introduction of @ref{Attachment links}.  The following example
-shows one use case for attachment inheritance:
+the node hierarchy makes a lot of sense in most cases.  Especially
+when using attachment links (see @ref{Attachment links}).  The following
+example shows one use case for attachment inheritance:
 
 @example
 * Chapter A ...
@@ -8631,11 +8775,11 @@ shows one use case for attachment inheritance:
 Some text
 
 #+NAME: Image 1
-[[Attachment:image 1.jpg]]
+[[attachment:image 1.jpg]]
 @end example
 
 Without inheritance one would not be able to resolve the link to
-image @samp{1.jpg}, since the link is inside a sub-heading to @samp{Chapter
+@samp{image 1.jpg}, since the link is inside a sub-heading to @samp{Chapter
   A}.
 
 Inheritance works the same way for both @samp{ID} and @samp{DIR} property.  If
@@ -8677,6 +8821,18 @@ structure in any other way.  All functions in this list 
will be
 tried when resolving existing ID's into paths, to maintain backward
 compatibility with existing folders in your system.
 
+@item @code{org-attach-store-link-p}
+@vindex org-attach-store-link-p
+Stores a link to the file that is being attached.  The link is
+stored in @code{org-stored-links} for later insertion with @kbd{C-c C-l} (see 
@ref{Handling Links}).  Depending on what option is set in
+@code{org-attach-store-link-p}, the link is stored to either the original
+location as a file link, the attachment location as an attachment
+link or to the attachment location as a file link.
+
+@item @code{org-attach-commands}
+@vindex org-attach-commands
+List of all commands used in the attach dispatcher.
+
 @item @code{org-attach-expert}
 @vindex org-attach-expert
 Do not show the splash buffer with the attach dispatcher when
@@ -8722,6 +8878,7 @@ the following to your Emacs config:
 
 @cindex attach from Dired
 @findex org-attach-dired-to-subtree
+
 It is possible to attach files to a subtree from a Dired buffer.  To
 use this feature, have one window in Dired mode containing the file(s)
 to be attached and another window with point in the subtree that shall
@@ -9005,9 +9162,11 @@ to specify the number of context lines for each match, 
default is
 @end enumerate
 
 @item @kbd{#}
-@itemx @kbd{!}
 Create a list of stuck projects (see @ref{Stuck projects}).
 
+@item @kbd{!}
+Configure the list of stuck projects (see @ref{Stuck projects}).
+
 @item @kbd{<}
 @kindex < @r{(Agenda dispatcher)}
 Restrict an agenda command to the current buffer@footnote{For backward 
compatibility, you can also press @kbd{1} to
@@ -9755,7 +9914,7 @@ then applied to the view and persists as a basic filter 
through
 refreshes and more secondary filtering.  The filter is a global
 property of the entire agenda view---in a block agenda, you should
 only set this in the global options section, not in the section of an
-individual block.}. You can switch quickly between
+individual block.}.  You can switch quickly between
 different filters without having to recreate the agenda.  @emph{Limits} on
 the other hand take effect before the agenda buffer is populated, so
 they are mostly useful when defined as local variables within custom
@@ -9803,7 +9962,7 @@ again by pressing @kbd{<}.
 @item @kbd{=} (@code{org-agenda-filter-by-regexp})
 @findex org-agenda-filter-by-regexp
 Filter the agenda view by a regular expression: only show agenda
-entries matching the regular expression the user entered. To clear
+entries matching the regular expression the user entered.  To clear
 the filter, call the command again by pressing @kbd{=}.
 
 @item @kbd{_} (@code{org-agenda-filter-by-effort})
@@ -9845,17 +10004,18 @@ in a single string, with full completion support.  For 
example,
 +work-John+<0:10-/plot/
 @end example
 
-selects entries with category `work' and effort estimates below 10
-minutes, and deselects entries with tag `John' or matching the
-regexp `plot'.  `+' can be left out if that does not lead to
+
+selects entries with category @samp{work} and effort estimates below 10
+minutes, and deselects entries with tag @samp{John} or matching the
+regexp @samp{plot}.  You can leave @samp{+} out if that does not lead to
 ambiguities.  The sequence of elements is arbitrary.  The filter
-syntax assumes that there is no overlap between categories and tags
-(tags will take priority).  If you reply to the prompt with the
+syntax assumes that there is no overlap between categories and tags.
+Otherwise, tags take priority.  If you reply to the prompt with the
 empty string, all filtering is removed.  If a filter is specified,
-it replaces all current filters.  But if you call the command with a
-double prefix argument, or if you add an additional `+'
-(e.g. `++work') to the front of the string, the new filter elements
-are added to the active ones.  A single prefix argument applies the
+it replaces all current filters.  But if you call the command with
+a double prefix argument, or if you add an additional @samp{+} (e.g.,
+@samp{++work}) to the front of the string, the new filter elements are
+added to the active ones.  A single prefix argument applies the
 entire filter in a negative sense.
 
 @item @kbd{|} (@code{org-agenda-filter-remove-all})
@@ -9866,35 +10026,34 @@ Remove all filters in the current agenda view.
 @subsubheading Computed tag filtering
 
 @vindex org-agenda-auto-exclude-function
-If the variable @code{org-agenda-auto-exclude-function} is set to a
-user-defined function, that function can select tags that should be
+If the variable @code{org-agenda-auto-exclude-function} is set to
+a user-defined function, that function can select tags that should be
 used as a tag filter when requested.  The function will be called with
-lower-case versions of all tags represented in the current view. The
-function should the return @samp{"-tag"} if the filter should remove
+lower-case versions of all tags represented in the current view.  The
+function should return @samp{"-tag"} if the filter should remove
 entries with that tag, @samp{"+tag"} if only entries with this tag should
-be kept, or @samp{nil} if that tag is irrelevant. For example, let's say
+be kept, or @samp{nil} if that tag is irrelevant.  For example, let's say
 you use a @samp{Net} tag to identify tasks which need network access, an
 @samp{Errand} tag for errands in town, and a @samp{Call} tag for making phone
 calls.  You could auto-exclude these tags based on the availability of
 the Internet, and outside of business hours, with something like this:
 
 @lisp
-(defun org-my-auto-exclude-fn (tag)
-  (if (cond
-       ((string= tag "net")
-        (/= 0 (call-process "/sbin/ping" nil nil nil
-                            "-c1" "-q" "-t1" "mail.gnu.org")))
-       ((member tag '("errand" "call"))
-        (let ((hr (nth 2 (decode-time))))
-          (or (< hr 8) (> hr 21)))))
-      (concat "-" tag)))
-
-(setq org-agenda-auto-exclude-function 'org-my-auto-exclude-fn)
+(defun my-auto-exclude-fn (tag)
+  (when (cond ((string= tag "net")
+               (/= 0 (call-process "/sbin/ping" nil nil nil
+                                   "-c1" "-q" "-t1" "mail.gnu.org")))
+              ((member tag '("errand" "call"))
+               (let ((hr (nth 2 (decode-time))))
+                 (or (< hr 8) (> hr 21)))))
+    (concat "-" tag)))
+
+(setq org-agenda-auto-exclude-function #'my-auto-exclude-fn)
 @end lisp
 
-You can apply this self-adapting filter by using a double prefix
-argument to @code{org-agenda-filter}, i.e. press @kbd{C-u C-u /}, or
-by pressing @kbd{@key{RET}} in @code{org-agenda-filter-by-tag}.
+You can apply this self-adapting filter by using a triple prefix
+argument to @code{org-agenda-filter}, i.e.@tie{}press @kbd{C-u C-u C-u /},
+or by pressing @kbd{@key{RET}} in @code{org-agenda-filter-by-tag}.
 
 @anchor{Setting limits for the agenda}
 @subsubheading Setting limits for the agenda
@@ -10293,7 +10452,7 @@ both in the agenda buffer and in the remote buffer.
 @kindex t
 @findex org-agenda-todo
 Change the TODO state of the item, both in the agenda and in the
-original Org file. A prefix arg is passed through to the @code{org-todo}
+original Org file.  A prefix arg is passed through to the @code{org-todo}
 command, so for example a @kbd{C-u} prefix are will trigger
 taking a note to document the state change.
 
@@ -10370,11 +10529,6 @@ Set the priority for the current item.  Org mode 
prompts for the
 priority character.  If you reply with @kbd{@key{SPC}}, the priority
 cookie is removed from the entry.
 
-@item @kbd{P} (@code{org-agenda-show-priority})
-@kindex P
-@findex org-agenda-show-priority
-Display weighted priority of current item.
-
 @item @kbd{+} or @kbd{S-@key{UP}} (@code{org-agenda-priority-up})
 @kindex +
 @kindex S-UP
@@ -10389,6 +10543,12 @@ in the original buffer, but the agenda is not 
resorted.  Use the
 @findex org-agenda-priority-down
 Decrease the priority of the current item.
 
+@item @kbd{C-c C-x e} or short @kbd{e} (@code{org-agenda-set-effort})
+@kindex e
+@kindex C-c C-x e
+@findex org-agenda-set-effort
+Set the effort property for the current item.
+
 @item @kbd{C-c C-z} or short @kbd{z} (@code{org-agenda-add-note})
 @kindex z
 @kindex C-c C-z
@@ -10806,8 +10966,10 @@ Another possibility is the construction of agenda 
views that comprise
 the results of @emph{several} commands, each of which creates a block in
 the agenda buffer.  The available commands include @code{agenda} for the
 daily or weekly agenda (as created with @kbd{a}) , @code{alltodo} for
-the global TODO list (as constructed with @kbd{t}), and the
+the global TODO list (as constructed with @kbd{t}), @code{stuck} for
+the list of stuck projects (as obtained with @kbd{#}) and the
 matching commands discussed above: @code{todo}, @code{tags}, and 
@code{tags-todo}.
+
 Here are two examples:
 
 @lisp
@@ -11248,6 +11410,13 @@ get in your way.  Configure the variable 
@code{org-use-sub-superscripts} to
 change this convention.  For example, when setting this variable to
 @code{@{@}}, @samp{a_b} is not interpreted as a subscript, but @samp{a_@{b@}} 
is.
 
+You can set @code{org-use-sub-superscripts} in a file using the export
+option @samp{^:} (see @ref{Export Settings}).  For example, @samp{#+OPTIONS: 
^:@{@}}
+sets @code{org-use-sub-superscripts} to @code{@{@}} and limits super- and
+subscripts to the curly bracket notation.
+
+You can also toggle the visual display of super- and subscripts:
+
 @table @asis
 @item @kbd{C-c C-x \} (@code{org-toggle-pretty-entities})
 @kindex C-c C-x \
@@ -11255,6 +11424,13 @@ change this convention.  For example, when setting 
this variable to
 This command formats sub- and superscripts in a WYSIWYM way.
 @end table
 
+@vindex org-pretty-entities
+@vindex org-pretty-entities-include-sub-superscripts
+Set both @code{org-pretty-entities} and
+@code{org-pretty-entities-include-sub-superscripts} to @code{t} to start with
+super- and subscripts @emph{visually} interpreted as specified by the
+option @code{org-use-sub-superscripts}.
+
 @node Special Symbols
 @section Special Symbols
 
@@ -11891,7 +12067,7 @@ back-ends:
 @end itemize
 
 Users can install libraries for additional formats from the Emacs
-packaging system. For easy discovery, these packages have a common
+packaging system.  For easy discovery, these packages have a common
 naming scheme: @code{ox-NAME}, where @var{NAME} is a format.  For
 example, @code{ox-koma-letter} for @emph{koma-letter} back-end.  More libraries
 can be found in the @samp{contrib/} directory (see @ref{Installation}).
@@ -12067,9 +12243,7 @@ The email address (@code{user-mail-address}).
 Language to use for translating certain strings
 (@code{org-export-default-language}).  With @samp{#+LANGUAGE: fr}, for
 example, Org translates @samp{Table of contents} to the French @samp{Table des
-  matières}@footnote{For export to @LaTeX{} format---or @LaTeX{}-related 
formats such as
-Beamer---, the @samp{org-latex-package-alist} variable needs further
-configuration. See @ref{@LaTeX{} specific export settings}.}.
+  matières}@footnote{DEFINITION NOT FOUND@.}.
 
 @item @samp{SELECT_TAGS}
 @cindex @samp{SELECT_TAGS}, keyword
@@ -13399,7 +13573,7 @@ following lines before the table in the Org file:
 @cindex @samp{ATTR_HTML}, keyword
 @example
 #+CAPTION: This is a table with lines around and between cells
-#+ATTR_HTML: border="2" rules="all" frame="border"
+#+ATTR_HTML: :border 2 :rules all :frame border
 @end example
 
 The HTML export back-end preserves column groupings in Org tables (see
@@ -13695,17 +13869,15 @@ simpler ways of customizing as described above.
 @subsection JavaScript supported display of web pages
 
 Sebastian Rose has written a JavaScript program especially designed to
-enhance the web viewing experience of HTML files created with Org.
-This program enhances large files in two different ways of viewing.
-One is an @emph{Info}-like mode where each section is displayed separately
-and navigation can be done with the @kbd{n} and @kbd{p}
-keys, and some other keys as well, press @kbd{?} for an overview
-of the available keys.  The second one has a @emph{folding} view, much like
-Org provides inside Emacs.  The script is available at
-@uref{https://orgmode.org/org-info.js} and the documentation at
-@uref{https://orgmode.org/worg/code/org-info-js/}.  The script is hosted on
-@uref{https://orgmode.org}, but for reliability, prefer installing it on your
-own web server.
+allow two different ways of viewing HTML files created with Org.  One
+is an @emph{Info}-like mode where each section is displayed separately and
+navigation can be done with the @kbd{n} and @kbd{p} keys, and some other
+keys as well, press @kbd{?} for an overview of the available keys.  The
+second one has a @emph{folding} view, much like Org provides inside Emacs.
+The script is available at @uref{https://orgmode.org/org-info.js} and the
+documentation at @uref{https://orgmode.org/worg/code/org-info-js/}.  The
+script is hosted on @uref{https://orgmode.org}, but for reliability, prefer
+installing it on your own web server.
 
 To use this program, just add this line to the Org file:
 
@@ -16269,6 +16441,33 @@ tables and lists in foreign buffers.  For example, in 
an HTML buffer,
 write a list in Org syntax, select it, and convert it to HTML with
 @kbd{M-x org-html-convert-region-to-html}.
 
+@menu
+* Bare HTML::                    Exporting HTML without CSS, Javascript, etc.
+@end menu
+
+@node Bare HTML
+@subsection Exporting to minimal HTML
+
+If you want to output a minimal HTML file, with no CSS, no Javascript,
+no preamble or postamble, here are the variable you would need to set:
+
+@vindex org-html-head
+@vindex org-html-head-extra
+@vindex org-html-head-include-default-style
+@vindex org-html-head-include-scripts
+@vindex org-html-preamble
+@vindex org-html-postamble
+@vindex org-html-use-infojs
+@lisp
+(setq org-html-head ""
+      org-html-head-extra ""
+      org-html-head-include-default-style nil
+      org-html-head-include-scripts nil
+      org-html-preamble nil
+      org-html-postamble nil
+      org-html-use-infojs nil)
+@end lisp
+
 @node Publishing
 @chapter Publishing
 
@@ -16654,6 +16853,8 @@ any, during publishing.  Options set within a file (see 
@ref{Export Settings}),
 @tab @code{org-html-mathjax-options}
 @item @code{:html-mathjax-template}
 @tab @code{org-html-mathjax-template}
+@item @code{:html-equation-reference-format}
+@tab @code{org-html-equation-reference-format}
 @item @code{:html-metadata-timestamp-format}
 @tab @code{org-html-metadata-timestamp-format}
 @item @code{:html-postamble-format}
@@ -17169,6 +17370,34 @@ Here is an example source code block in the Emacs Lisp 
language:
 #+END_SRC
 @end example
 
+Source code blocks are one of many Org block types, which also include
+``center'', ``comment'', ``dynamic'', ``example'', ``export'', ``quote'',
+``special'', and ``verse''.  This section pertains to blocks between
+@samp{#+BEGIN_SRC} and @samp{#+END_SRC}.
+
+Details of Org's facilities for working with source code are described
+in the following sections.
+
+@menu
+* Features Overview::            Enjoy the versatility of source blocks.
+* Structure of Code Blocks::     Code block syntax described.
+* Using Header Arguments::       Different ways to set header arguments.
+* Environment of a Code Block::  Arguments, sessions, working directory...
+* Evaluating Code Blocks::       Place results of evaluation in the Org buffer.
+* Results of Evaluation::        Choosing a results type, post-processing...
+* Exporting Code Blocks::        Export contents and/or results.
+* Extracting Source Code::       Create pure source code files.
+* Languages::                    List of supported code block languages.
+* Editing Source Code::          Language major-mode editing.
+* Noweb Reference Syntax::       Literate programming in Org mode.
+* Library of Babel::             Use and contribute to a library of useful 
code blocks.
+* Key bindings and Useful Functions:: Work quickly with code blocks.
+* Batch Execution::              Call functions from the command line.
+@end menu
+
+@node Features Overview
+@section Features Overview
+
 Org can manage the source code in the block delimited by @samp{#+BEGIN_SRC}
 @dots{} @samp{#+END_SRC} in several ways that can simplify housekeeping tasks
 essential to modern source code maintenance.  Org can edit, format,
@@ -17177,13 +17406,7 @@ and execute a source code block, then capture the 
results.  The Org
 mode literature sometimes refers to source code blocks as @emph{live code}
 blocks because they can alter the content of the Org document or the
 material that it exports.  Users can control how live they want each
-source code block by tweaking the header arguments (see @ref{Using Header 
Arguments}) for compiling, execution, extraction, and
-exporting.
-
-Source code blocks are one of many Org block types, which also include
-``center'', ``comment'', ``dynamic'', ``example'', ``export'', ``quote'',
-``special'', and ``verse''.  This section pertains to blocks between
-@samp{#+BEGIN_SRC} and @samp{#+END_SRC}.
+source code block by tweaking the header arguments (see @ref{Using Header 
Arguments}) for compiling, execution, extraction, and exporting.
 
 For editing and formatting a source code block, Org uses an
 appropriate Emacs major mode that includes features specifically
@@ -17221,25 +17444,6 @@ configuration settings of the execution environment, 
the results of
 the execution, and associated narratives, claims, references, and
 internal and external links in a single Org document.
 
-Details of Org's facilities for working with source code are described
-in the following sections.
-
-@menu
-* Structure of Code Blocks::     Code block syntax described.
-* Using Header Arguments::       Different ways to set header arguments.
-* Environment of a Code Block::  Arguments, sessions, working directory...
-* Evaluating Code Blocks::       Place results of evaluation in the Org buffer.
-* Results of Evaluation::        Choosing a results type, post-processing...
-* Exporting Code Blocks::        Export contents and/or results.
-* Extracting Source Code::       Create pure source code files.
-* Languages::                    List of supported code block languages.
-* Editing Source Code::          Language major-mode editing.
-* Noweb Reference Syntax::       Literate programming in Org mode.
-* Library of Babel::             Use and contribute to a library of useful 
code blocks.
-* Key bindings and Useful Functions:: Work quickly with code blocks.
-* Batch Execution::              Call functions from the command line.
-@end menu
-
 @node Structure of Code Blocks
 @section Structure of Code Blocks
 
@@ -17988,7 +18192,7 @@ variable @code{org-babel-inline-result-wrap}, which by 
default is set to
 This is the name of the code block (see @ref{Structure of Code Blocks})
 to be evaluated in the current document.  If the block is located in
 another file, start @samp{<name>} with the file name followed by
-a colon. For example, in order to execute a block named @samp{clear-data}
+a colon.  For example, in order to execute a block named @samp{clear-data}
 in @samp{file.org}, you can write the following:
 
 @example
@@ -18080,8 +18284,7 @@ A note of warning: when @samp{cache} is used in a 
session, caching may
 cause unexpected results.
 
 When the caching mechanism tests for any source code changes, it does
-not expand Noweb style references (see @ref{Noweb Reference Syntax}).  For
-reasons why, see @uref{http://thread.gmane.org/gmane.emacs.orgmode/79046}.
+not expand noweb style references (see @ref{Noweb Reference Syntax}).
 
 The @samp{cache} header argument can have one of two values: @samp{yes} or 
@samp{no}.
 
@@ -18155,20 +18358,20 @@ they are mutually exclusive.
 
 @table @asis
 @item @samp{value}
-Default.  Functional mode.  Org gets the value by wrapping the code
-in a function definition in the language of the source block.  That
-is why when using @samp{:results value}, code should execute like
-a function and return a value.  For languages like Python, an
-explicit @code{return} statement is mandatory when using @samp{:results
-  value}.  Result is the value returned by the last statement in the
-code block.
+Default for most Babel libraries@footnote{Actually, the constructs 
@samp{call_<name>()} and @samp{src_<lang>@{@}}
+are not evaluated when they appear in a keyword (see @ref{In-buffer 
Settings}).}.  Functional mode.  Org
+gets the value by wrapping the code in a function definition in the
+language of the source block.  That is why when using @samp{:results
+  value}, code should execute like a function and return a value.  For
+languages like Python, an explicit @code{return} statement is mandatory
+when using @samp{:results value}.  Result is the value returned by the
+last statement in the code block.
 
 When evaluating the code block in a session (see @ref{Environment of a Code 
Block}), Org passes the code to an interpreter running as an
-interactive Emacs inferior process. Org gets the value from the
+interactive Emacs inferior process.  Org gets the value from the
 source code interpreter's last statement output.  Org has to use
 language-specific methods to obtain the value.  For example, from
-the variable @code{_} in Python and Ruby, and the value of @code{.Last.value}
-in R@.
+the variable @code{_} in Ruby, and the value of @code{.Last.value} in R@.
 
 @item @samp{output}
 Scripting mode.  Org passes the code to an external process running
@@ -18178,41 +18381,6 @@ stream as text results.
 When using a session, Org passes the code to the interpreter running
 as an interactive Emacs inferior process.  Org concatenates any text
 output from the interpreter and returns the collection as a result.
-
-Note that this collection is not the same as that would be collected
-from stdout of a non-interactive interpreter running as an external
-process.  Compare for example these two blocks:
-
-@example
-#+BEGIN_SRC python :results output
-  print "hello"
-  2
-  print "bye"
-#+END_SRC
-
-#+RESULTS:
-: hello
-: bye
-@end example
-
-In the above non-session mode, the ``2'' is not printed; so it does
-not appear in results.
-
-@example
-#+BEGIN_SRC python :results output :session
-  print "hello"
-  2
-  print "bye"
-#+END_SRC
-
-#+RESULTS:
-: hello
-: 2
-: bye
-@end example
-
-In the above session, the interactive interpreter receives and
-prints ``2''.  Results show that.
 @end table
 
 @anchor{Type}
@@ -18312,14 +18480,25 @@ and the extension are mandatory.
 
 @cindex @samp{file-desc}, header argument
 The @samp{file-desc} header argument defines the description (see
-@ref{Link Format}) for the link.  If @samp{file-desc} has no value, Org
-uses the generated file name for both the ``link'' and
-``description'' parts of the link.
+@ref{Link Format}) for the link.  If @samp{file-desc} is present but has no 
value,
+the @samp{file} value is used as the link description.  When this
+argument is not present, the description is omitted.
 
 @cindex @samp{sep}, header argument
 By default, Org assumes that a table written to a file has
 TAB-delimited output.  You can choose a different separator with
 the @samp{sep} header argument.
+
+@cindex @samp{file-mode}, header argument
+The @samp{file-mode} header argument defines the file permissions.  To
+make it executable, use @samp{:file-mode (identity #o755)}.
+
+@example
+#+BEGIN_SRC shell :results file :file script.sh :file-mode (identity #o755)
+  echo "#!/bin/bash"
+  echo "echo Hello World"
+#+END_SRC
+@end example
 @end table
 
 @anchor{Format}
@@ -18349,13 +18528,13 @@ Results enclosed in a @samp{BEGIN_EXPORT latex} 
block.  Usage example:
 
 @item @samp{link}
 @itemx @samp{graphics}
-Result is a link to the file specified in @samp{:file} header argument.
-However, unlike plain @samp{:file}, nothing is written to the disk.  The
-block is used for its side-effects only, as in the following
-example:
+When used along with @samp{file} type, the result is a link to the file
+specified in @samp{:file} header argument.  However, unlike plain @samp{file}
+type, nothing is written to the disk.  The block is used for its
+side-effects only, as in the following example:
 
 @example
-#+begin_src shell :results link :file "download.tar.gz"
+#+begin_src shell :results file link :file "download.tar.gz"
 wget -c "http://example.com/download.tar.gz";
 #+end_src
 @end example
@@ -18557,7 +18736,7 @@ code.
 When Org tangles code blocks, it expands, merges, and transforms them.
 Then Org recomposes them into one or more separate files, as
 configured through the options.  During this tangling process, Org
-expands variables in the source code, and resolves any Noweb style
+expands variables in the source code, and resolves any noweb style
 references (see @ref{Noweb Reference Syntax}).
 
 @anchor{Header arguments}
@@ -18615,7 +18794,7 @@ the source block.
 Includes both @samp{link} and @samp{org} options.
 
 @item @samp{noweb}
-Includes @samp{link} option, expands Noweb references (see @ref{Noweb 
Reference Syntax}), and wraps them in link comments inside the body
+Includes @samp{link} option, expands noweb references (see @ref{Noweb 
Reference Syntax}), and wraps them in link comments inside the body
 of the code block.
 @end table
 
@@ -18654,7 +18833,7 @@ By default Org expands code blocks during tangling.  
The @samp{no-expand}
 header argument turns off such expansions.  Note that one side-effect
 of expansion by @code{org-babel-expand-src-block} also assigns values (see
 @ref{Environment of a Code Block}) to variables.  Expansions also replace
-Noweb references with their targets (see @ref{Noweb Reference Syntax}).
+noweb references with their targets (see @ref{Noweb Reference Syntax}).
 Some of these expansions may cause premature assignment, hence this
 option.  This option makes a difference only for tangling.  It has no
 effect when exporting since code blocks for execution have to be
@@ -18715,7 +18894,7 @@ file.
 
 Code blocks in the following languages are supported.
 
-@multitable @columnfractions 0.20 0.35 0.20 0.20
+@multitable @columnfractions 0.25 0.25 0.25 0.20
 @headitem Language
 @tab Identifier
 @tab Language
@@ -18915,11 +19094,13 @@ for Python and Emacs Lisp languages.
 @node Noweb Reference Syntax
 @section Noweb Reference Syntax
 
-@cindex code block, Noweb reference
-@cindex syntax, Noweb
-@cindex source code, Noweb reference
+@cindex code block, noweb reference
+@cindex syntax, noweb
+@cindex source code, noweb reference
 
-Org supports named blocks in Noweb@footnote{For Noweb literate programming 
details, see
+@cindex @samp{noweb-ref}, header argument
+Source code blocks can include references to other source code blocks,
+using a noweb@footnote{For noweb literate programming details, see
 @uref{http://www.cs.tufts.edu/~nr/noweb/}.} style syntax:
 
 @example
@@ -18927,42 +19108,48 @@ Org supports named blocks in Noweb@footnote{For Noweb 
literate programming detai
 @end example
 
 
-Org can replace the construct with the source code, or the results of
-evaluation, of the code block identified as @var{CODE-BLOCK-ID}.
+@noindent
+where @var{CODE-BLOCK-ID} refers to either the @samp{NAME} of a single
+source code block, or a collection of one or more source code blocks
+sharing the same @samp{noweb-ref} header argument (see @ref{Using Header 
Arguments}).  Org can replace such references with the source code of
+the block or blocks being referenced, or, in the case of a single
+source code block named with @samp{NAME}, with the results of an evaluation
+of that block.
 
 @cindex @samp{noweb}, header argument
-The @samp{noweb} header argument controls expansion of Noweb syntax
+The @samp{noweb} header argument controls expansion of noweb syntax
 references.  Expansions occur when source code blocks are evaluated,
 tangled, or exported.
 
 @table @asis
 @item @samp{no}
-Default.  No expansion of Noweb syntax references in the body of the
+Default.  No expansion of noweb syntax references in the body of the
 code when evaluating, tangling, or exporting.
 
 @item @samp{yes}
-Expansion of Noweb syntax references in the body of the code block
+Expansion of noweb syntax references in the body of the code block
 when evaluating, tangling, or exporting.
 
 @item @samp{tangle}
-Expansion of Noweb syntax references in the body of the code block
+Expansion of noweb syntax references in the body of the code block
 when tangling.  No expansion when evaluating or exporting.
 
 @item @samp{no-export}
-Expansion of Noweb syntax references in the body of the code block
+Expansion of noweb syntax references in the body of the code block
 when evaluating or tangling.  No expansion when exporting.
 
 @item @samp{strip-export}
-Expansion of Noweb syntax references in the body of the code block
-when expanding prior to evaluating or tangling.  Removes Noweb
+Expansion of noweb syntax references in the body of the code block
+when expanding prior to evaluating or tangling.  Removes noweb
 syntax references when exporting.
 
 @item @samp{eval}
-Expansion of Noweb syntax references in the body of the code block
+Expansion of noweb syntax references in the body of the code block
 only before evaluating.
 @end table
 
-In the following example,
+In the most simple case, the contents of a single source block is
+inserted within other blocks.  Thus, in following example,
 
 @example
 #+NAME: initialization
@@ -18986,88 +19173,11 @@ the second code block is expanded as
 #+END_SRC
 @end example
 
-Noweb insertions honor prefix characters that appear before the Noweb
-syntax reference.  This behavior is illustrated in the following
-example.  Because the @samp{<<example>>} Noweb reference appears behind the
-SQL comment syntax, each line of the expanded Noweb reference is
-commented.  With:
-
-@example
-#+NAME: example
-#+BEGIN_SRC text
-  this is the
-  multi-line body of example
-#+END_SRC
-@end example
-
-@noindent
-this code block:
-
-@example
-#+BEGIN_SRC sql :noweb yes
- ---<<example>>
-#+END_SRC
-@end example
-
-@noindent
-expands to:
-
-@example
-#+BEGIN_SRC sql :noweb yes
- ---this is the
- ---multi-line body of example
-#+END_SRC
-@end example
-
-Since this change does not affect Noweb replacement text without
-newlines in them, inline Noweb references are acceptable.
-
-This feature can also be used for management of indentation in
-exported code snippets.  With:
-
-@example
-#+NAME: if-true
-#+BEGIN_SRC python :exports none
-  print('do things when true')
-#+end_src
-
-#+name: if-false
-#+begin_src python :exports none
-  print('do things when false')
-#+end_src
-@end example
-
-@noindent
-this code block:
-
-@example
-#+begin_src python :noweb yes :results output
-  if true:
-      <<if-true>>
-  else:
-      <<if-false>>
-#+end_src
-@end example
-
-@noindent
-expands to:
-
-@example
-if true:
-    print('do things when true')
-else:
-    print('do things when false')
-@end example
-
-@cindex @samp{noweb-ref}, header argument
-When expanding Noweb style references, Org concatenates code blocks by
-matching the reference name to either the code block name or, if none
-is found, to the @samp{noweb-ref} header argument.
-
-For simple concatenation, set this @samp{noweb-ref} header argument at the
-sub-tree or file level.  In the example Org file shown next, the body
-of the source code in each block is extracted for concatenation to
-a pure code file when tangled.
+You may also include the contents of multiple blocks sharing a common
+@samp{noweb-ref} header argument, which can be set at the file, sub-tree,
+or code block level.  In the example Org file shown next, the body of
+the source code in each block is extracted for concatenation to a pure
+code file when tangled.
 
 @example
 #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh
@@ -19096,24 +19206,25 @@ a pure code file when tangled.
 
 @cindex @samp{noweb-sep}, header argument
 By default a newline separates each noweb reference concatenation.  To
-change this newline separator, edit the @samp{noweb-sep} header argument.
+use a different separator, edit the @samp{noweb-sep} header argument.
 
-Eventually, Org can include the results of a code block rather than
-its body.  To that effect, append parentheses, possibly including
-arguments, to the code block name, as shown below.
+Alternatively, Org can include the results of evaluation of a single
+code block rather than its body.  Evaluation occurs when parentheses,
+possibly including arguments, are appended to the code block name, as
+shown below.
 
 @example
-<<code-block-name(optional arguments)>>
+<<NAME(optional arguments)>>
 @end example
 
 
-Note that when using the above approach to a code block's results, the
-code block name set by @samp{NAME} keyword is required; the reference set
-by @samp{noweb-ref} does not work in that case.
+Note that in this case, a code block name set by @samp{NAME} keyword is
+required; the reference set by @samp{noweb-ref} will not work when
+evaluation is desired.
 
 Here is an example that demonstrates how the exported content changes
-when Noweb style references are used with parentheses versus without.
-With:
+when noweb style references are used with parentheses versus without.
+Given:
 
 @example
 #+NAME: some-code
@@ -19139,7 +19250,7 @@ print(num*10)
 @end example
 
 
-Below, a similar Noweb style reference is used, but with parentheses,
+Below, a similar noweb style reference is used, but with parentheses,
 while setting a variable @samp{num} to 10:
 
 @example
@@ -19149,13 +19260,99 @@ while setting a variable @samp{num} to 10:
 @end example
 
 @noindent
-Note that now the expansion contains the results of the code block
+Note that the expansion now contains the results of the code block
 @samp{some-code}, not the code block itself:
 
 @example
 100
 @end example
 
+
+Noweb insertions honor prefix characters that appear before the noweb
+syntax reference.  This behavior is illustrated in the following
+example.  Because the @samp{<<example>>} noweb reference appears behind the
+SQL comment syntax, each line of the expanded noweb reference is
+commented.  With:
+
+@example
+#+NAME: example
+#+BEGIN_SRC text
+  this is the
+  multi-line body of example
+#+END_SRC
+@end example
+
+@noindent
+this code block:
+
+@example
+#+BEGIN_SRC sql :noweb yes
+ ---<<example>>
+#+END_SRC
+@end example
+
+@noindent
+expands to:
+
+@example
+#+BEGIN_SRC sql :noweb yes
+ ---this is the
+ ---multi-line body of example
+#+END_SRC
+@end example
+
+Since this change does not affect noweb replacement text without
+newlines in them, inline noweb references are acceptable.
+
+This feature can also be used for management of indentation in
+exported code snippets.  With:
+
+@example
+#+NAME: if-true
+#+BEGIN_SRC python :exports none
+  print('do things when true')
+#+end_src
+
+#+name: if-false
+#+begin_src python :exports none
+  print('do things when false')
+#+end_src
+@end example
+
+@noindent
+this code block:
+
+@example
+#+begin_src python :noweb yes :results output
+  if true:
+      <<if-true>>
+  else:
+      <<if-false>>
+#+end_src
+@end example
+
+@noindent
+expands to:
+
+@example
+if true:
+    print('do things when true')
+else:
+    print('do things when false')
+@end example
+
+When in doubt about the outcome of a source code block expansion, you
+can preview the results with the following command:
+
+@table @asis
+@item @kbd{C-c C-v v} or @kbd{C-c C-v C-v} (@code{org-babel-expand-src-block})
+@findex org-babel-expand-src-block
+@kindex C-c C-v v
+@kindex C-c C-v C-v
+Expand the current source code block according to its header
+arguments and pop open the results in a preview buffer.
+@end table
+
 @node Library of Babel
 @section Library of Babel
 
@@ -19357,12 +19554,13 @@ emacs -Q --batch --eval "
 * Structure Templates::          Quick insertion of structural elements.
 * Speed Keys::                   Electric commands at the beginning of a 
headline.
 * Clean View::                   Getting rid of leading stars in the outline.
+* Execute commands in the active region:: Execute commands on multiple items 
in Org or agenda view.
 * Dynamic Headline Numbering::   Display and update outline numbering.
 * The Very Busy @kbd{C-c C-c} Key:: When in doubt, press @kbd{C-c C-c}.
 * In-buffer Settings::           Overview of keywords.
 * Org Syntax::                   Formal description of Org's syntax.
 * Documentation Access::         Read documentation about current syntax.
-* Escape Character::
+* Escape Character::             Prevent Org from interpreting your writing.
 * Code Evaluation Security::     Org files evaluate in-line code.
 * Interaction::                  With other Emacs packages.
 * TTY Keys::                     Using Org on a tty.
@@ -19411,10 +19609,6 @@ At the beginning of an empty headline, complete TODO 
keywords.
 After @samp{\}, complete @TeX{} symbols supported by the exporter.
 
 @item
-After @samp{*}, complete headlines in the current buffer so that they
-can be used in search links like: @samp{[[*find this headline]]}
-
-@item
 After @samp{:} in a headline, complete tags.  Org deduces the list of
 tags from the @samp{TAGS} in-buffer option (see @ref{Setting Tags}), the
 variable @code{org-tag-alist}, or from all tags used in the current
@@ -19426,7 +19620,11 @@ of keys is constructed dynamically from all keys used 
in the
 current buffer.
 
 @item
-After @samp{[}, complete link abbreviations (see @ref{Link Abbreviations}).
+After @samp{[[}, complete link abbreviations (see @ref{Link Abbreviations}).
+
+@item
+After @samp{[[*}, complete headlines in the current buffer so that they
+can be used in search links like: @samp{[[*find this headline]]}
 
 @item
 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
@@ -19580,9 +19778,16 @@ through @code{word-wrap}.}.
 @vindex org-indent-indentation-per-level
 To make more horizontal space, the headlines are shifted by two
 characters.  Configure @code{org-indent-indentation-per-level} variable for
-a different number.  Only one star on each headline is visible, the
-rest are masked with the same font color as the background@footnote{Note that 
turning on Org Indent mode sets
-@code{org-hide-leading-stars} to @code{t} and @code{org-adapt-indentation} to 
@code{nil}.}.
+a different number.
+
+@vindex org-indent-mode-turns-on-hiding-stars
+@vindex org-indent-mode-turns-off-org-adapt-indentation
+By default, Org Indent mode turns off @code{org-adapt-indentation} and does
+hide leading stars by locally setting @code{org-hide-leading-stars} to 
@code{t}:
+only one star on each headline is visible, the rest are masked with
+the same font color as the background.  If you want to customize this
+default behavior, see @code{org-indent-mode-turns-on-hiding-stars} and
+@code{org-indent-mode-turns-off-org-adapt-indentation}.
 
 @vindex org-startup-indented
 To globally turn on Org Indent mode for all files, customize the
@@ -19601,7 +19806,9 @@ It is possible to use hard spaces to achieve the 
indentation instead,
 if the bare ASCII file should have the indented look also outside
 Emacs@footnote{This works, but requires extra effort.  Org Indent mode is
 more convenient for most applications.}.  With Org's support, you have to 
indent all lines to
-line up with the outline headers.  You would use these settings:
+line up with the outline headers.  You would use these
+settings@footnote{@code{org-adapt-indentation} can also be set to 
@samp{'headline-data},
+in which case only data lines below the headline will be indented.}:
 
 @lisp
 (setq org-adapt-indentation t
@@ -19631,7 +19838,7 @@ face @code{org-hide} to them.  For per-file preference, 
use these file
 @item @emph{Odd levels} (@code{org-odd-levels-only})
 @vindex org-odd-levels-only
 The third setting makes Org use only odd levels, 1, 3, 5, @dots{}, in
-the outline to create more indentation.  On a  per-file level,
+the outline to create more indentation.  On a per-file level,
 control this with:
 
 @example
@@ -19643,6 +19850,26 @@ To convert a file between single and double stars 
layouts, use
 @kbd{M-x org-convert-to-odd-levels} and @kbd{M-x 
org-convert-to-oddeven-levels}.
 @end table
 
+@node Execute commands in the active region
+@section Execute commands in the active region
+
+@vindex org-loop-over-headlines-in-active-region
+When in an Org buffer and the region is active, some commands will
+apply to all the subtrees in the active region.  For example, hitting
+@kbd{C-c C-s} when multiple headlines are within the active region will
+successively prompt you for a new schedule date and time.  To disable
+this, set the option @code{org-loop-over-headlines-in-active-region} to
+non-@code{t}, activate the region and run the command normally.
+
+@vindex org-agenda-loop-over-headlines-in-active-region
+@code{org-agenda-loop-over-headlines-in-active-region} is the equivalent
+option of the agenda buffer, where you can also use @ref{Bulk remote editing 
selected entries, , bulk editing of
+selected entries}.
+
+Not all commands can loop in the active region and what subtrees or
+headlines are considered can be refined: see the docstrings of these
+options for more details.
+
 @node Dynamic Headline Numbering
 @section Dynamic Headline Numbering
 
@@ -19671,6 +19898,11 @@ If @code{org-num-skip-footnotes} is non-@code{nil}, 
footnotes sections (see
 You can control how the numbering is displayed by setting
 @code{org-num-face} and @code{org-num-format-function}.
 
+@vindex org-startup-numerated
+You can also turn this mode globally for all Org files by setting the
+option @code{org-startup-numerated} to @samp{t}, or locally on a file by using
+@samp{#+startup: num}.
+
 @node The Very Busy @kbd{C-c C-c} Key
 @section The Very Busy @kbd{C-c C-c} Key
 
@@ -19684,6 +19916,9 @@ manual, but here is a consolidated list for easy 
reference.
 
 @itemize
 @item
+If column view (see @ref{Column View}) is on, exit column view.
+
+@item
 If any highlights shown in the buffer from the creation of a sparse
 tree, or from clock display, remove such highlights.
 
@@ -19753,7 +19988,7 @@ Closing and reopening the Org file in Emacs also 
activates the
 changes.
 
 @table @asis
-@item @samp{#+ARCHIVE: %s_done}
+@item @samp{#+ARCHIVE: %s_done::}
 @cindex @samp{ARCHIVE}, keyword
 @vindex org-archive-location
 Sets the archive location of the agenda file.  The corresponding
@@ -19793,9 +20028,9 @@ corresponding variable is @code{org-link-abbrev-alist}.
 
 @item @samp{#+PRIORITIES: highest lowest default}
 @cindex @samp{PRIORITIES}, keyword
-@vindex org-highest-priority
-@vindex org-lowest-priority
-@vindex org-default-priority
+@vindex org-priority-highest
+@vindex org-priority-lowest
+@vindex org-priority-default
 This line sets the limits and the default for the priorities.  All
 three must be either letters A--Z or numbers 0--9.  The highest
 priority must have a lower ASCII number than the lowest priority.
@@ -19827,8 +20062,8 @@ Startup options Org uses when first visiting a file.
 @vindex org-startup-folded
 The first set of options deals with the initial visibility of the
 outline tree.  The corresponding variable for global default
-settings is @code{org-startup-folded} with a default value of @code{t}, which
-is the same as @code{overview}.
+settings is @code{org-startup-folded} with a default value of
+@code{showeverything}.
 
 @multitable {aaaaaaaaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaa}
 @item @samp{overview}
@@ -19854,6 +20089,17 @@ wraps long lines, including headlines, correctly 
indented.}.
 @tab Start with Org Indent mode turned off.
 @end multitable
 
+@vindex org-startup-numerated
+Dynamic virtual numeration of headlines is controlled by the variable
+@code{org-startup-numerated}.
+
+@multitable {aaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@item @samp{num}
+@tab Start with Org num mode turned on.
+@item @samp{nonum}
+@tab Start with Org num mode turned off.
+@end multitable
+
 @vindex org-startup-align-all-tables
 Aligns tables consistently upon visiting a file.  The
 corresponding variable is @code{org-startup-align-all-tables} with
@@ -20116,8 +20362,10 @@ using it on a headline displays ``Document Structure'' 
section.
 @cindex zero width space
 You may sometimes want to write text that looks like Org syntax, but
 should really read as plain text.  Org may use a specific escape
-character in some situations, e.g., a backslash in macros (see @ref{Macro 
Replacement}) or a comma in source and example blocks (see @ref{Literal 
Examples}).  In the general case, however, we suggest to use the zero
-width space.  You can insert one with any of the following:
+character in some situations, i.e., a backslash in macros (see @ref{Macro 
Replacement}) and links (see @ref{Link Format}), or a comma in source and
+example blocks (see @ref{Literal Examples}).  In the general case, however,
+we suggest to use the zero width space.  You can insert one with any
+of the following:
 
 @example
 C-x 8 <RET> zero width space <RET>
@@ -20617,8 +20865,8 @@ 
javascript:location.href='org-protocol://capture?template=x'+
 
 @vindex org-protocol-default-template-key
 The capture template to be used can be specified in the bookmark (like
-@samp{X} above). If unspecified, the template key is set in the variable
-@code{org-protocol-default-template-key}. The following template
+@samp{X} above).  If unspecified, the template key is set in the variable
+@code{org-protocol-default-template-key}.  The following template
 placeholders are available:
 
 @example
@@ -20778,13 +21026,11 @@ compatible with Org Mobile.  It also describes 
synchronizing changes,
 such as to notes, between the mobile application and the computer.
 
 To change tags and TODO states in the mobile application, first
-customize the variables @code{org-todo-keywords} and @code{org-tag-alist}.
-These should cover all the important tags and TODO keywords, even if
-Org files use only some of them.  Though the mobile application is
-expected to support in-buffer settings, it is required to understand
-TODO states @emph{sets} (see @ref{Per-file keywords}) and
-@emph{mutually exclusive} tags (see @ref{Setting Tags}) only for those set in
-these variables.
+customize the variables @code{org-todo-keywords}, @code{org-tag-alist} and
+@code{org-tag-persistent-alist}.  These should cover all the important tags
+and TODO keywords, even if Org files use only some of them.  Though
+the mobile application is expected to support in-buffer settings, it
+is required to understand TODO states @emph{sets} (see @ref{Per-file 
keywords}) and @emph{mutually exclusive} tags (see @ref{Setting Tags}) only for 
those set in these variables.
 
 @menu
 * Setting up the staging area::  For the mobile device.
@@ -20966,14 +21212,14 @@ process of adding Org links to Unix man pages, which 
look like this
 
 
 @noindent
-The following @samp{org-man.el} file implements it
+The following @samp{ol-man.el} file implements it
 
 @lisp
-;;; org-man.el - Support for links to man pages in Org mode
-(require 'org)
+;;; ol-man.el - Support for links to man pages in Org mode
+(require 'ol)
 
 (org-link-set-parameters "man"
-                         :follow org-man-command
+                         :follow #'org-man-open
                          :export #'org-man-export
                          :store #'org-man-store-link)
 
@@ -20982,6 +21228,11 @@ The following @samp{org-man.el} file implements it
   :group 'org-link
   :type '(choice (const man) (const woman)))
 
+(defun org-man-open (path _)
+  "Visit the manpage on PATH.
+PATH should be a topic that can be thrown at the man command."
+  (funcall org-man-command path))
+
 (defun org-man-store-link ()
   "Store a link to a man page."
   (when (memq major-mode '(Man-mode woman-mode))
@@ -20989,7 +21240,7 @@ The following @samp{org-man.el} file implements it
     (let* ((page (org-man-get-page-name))
            (link (concat "man:" page))
            (description (format "Man page for %s" page)))
-      (org-store-link-props
+      (org-link-store-props
        :type "man"
        :link link
        :description description))))
@@ -21001,7 +21252,7 @@ The following @samp{org-man.el} file implements it
       (match-string 1 (buffer-name))
     (error "Cannot create link to this man page")))
 
-(defun org-man-export (link description format)
+(defun org-man-export (link description format _)
   "Export a man page link from Org files."
   (let ((path (format "http://man.he.net/?topic=%s&section=all"; link))
         (desc (or description link)))
@@ -21012,8 +21263,8 @@ The following @samp{org-man.el} file implements it
       (`ascii (format "%s (%s)" desc path))
       (t path))))
 
-(provide 'org-man)
-;;; org-man.el ends here
+(provide ol-man)
+;;; ol-man.el ends here
 @end lisp
 
 @noindent
@@ -21021,15 +21272,15 @@ To activate links to man pages in Org, enter this in 
the Emacs init
 file:
 
 @lisp
-(require 'org-man)
+(require 'ol-man)
 @end lisp
 
 @noindent
-A review of @samp{org-man.el}:
+A review of @samp{ol-man.el}:
 
 @enumerate
 @item
-First, @samp{(require 'org)} ensures @samp{org.el} is loaded.
+First, @samp{(require 'ol)} ensures that @samp{ol.el} is loaded.
 
 @item
 @findex org-link-set-parameters
@@ -21384,7 +21635,7 @@ Update all dynamic blocks in the current file.
 
 Before updating a dynamic block, Org removes content between the
 @samp{BEGIN} and @samp{END} markers.  Org then reads the parameters on the
-@samp{BEGIN} line for passing to the writer function as a plist. The
+@samp{BEGIN} line for passing to the writer function as a plist.  The
 previous content of the dynamic block becomes erased from the buffer
 and appended to the plist under @code{:content}.
 
@@ -21986,7 +22237,7 @@ a JavaScript program for displaying webpages derived 
from Org using
 an Info-like or a folding interface with single-key navigation.
 @end table
 
-See below for the full list of contributions! Again, please let me
+See below for the full list of contributions!  Again, please let me
 know what I am missing here!
 
 @anchor{From Bastien}
@@ -22043,7 +22294,7 @@ be complete if the ones above were not mentioned in 
this manual.
 
 @itemize
 @item
-Russel Adams came up with the idea for drawers.
+Russell Adams came up with the idea for drawers.
 
 @item
 Thomas Baumann wrote @samp{ol-bbdb.el} and @samp{ol-mhe.el}.
diff --git a/doc/misc/pcl-cvs.texi b/doc/misc/pcl-cvs.texi
index d1951f5..0d4f976 100644
--- a/doc/misc/pcl-cvs.texi
+++ b/doc/misc/pcl-cvs.texi
@@ -7,7 +7,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 1991--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1991--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/pgg.texi b/doc/misc/pgg.texi
index 261897b..8249527 100644
--- a/doc/misc/pgg.texi
+++ b/doc/misc/pgg.texi
@@ -10,7 +10,7 @@
 This file describes PGG @value{VERSION}, an Emacs interface to various
 PGP implementations.
 
-Copyright @copyright{} 2001, 2003--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2001, 2003--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi
index 2054ca5..ff8133b 100644
--- a/doc/misc/rcirc.texi
+++ b/doc/misc/rcirc.texi
@@ -6,7 +6,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 2006--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2006--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi
index 0dab524..599252f 100644
--- a/doc/misc/reftex.texi
+++ b/doc/misc/reftex.texi
@@ -46,7 +46,7 @@ This manual documents @RefTeX{} (version @value{VERSION}), a 
package
 to do labels, references, citations and indices for LaTeX documents
 with Emacs.
 
-Copyright @copyright{} 1997--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1997--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/remember.texi b/doc/misc/remember.texi
index df84537..80065be 100644
--- a/doc/misc/remember.texi
+++ b/doc/misc/remember.texi
@@ -9,7 +9,7 @@
 @copying
 This manual is for Remember Mode, version 2.0
 
-Copyright @copyright{} 2001, 2004--2005, 2007--2020 Free Software
+Copyright @copyright{} 2001, 2004--2005, 2007--2021 Free Software
 Foundation, Inc.
 
 @quotation
diff --git a/doc/misc/sasl.texi b/doc/misc/sasl.texi
index a25f985..847ad5e 100644
--- a/doc/misc/sasl.texi
+++ b/doc/misc/sasl.texi
@@ -9,7 +9,7 @@
 @copying
 This file describes the Emacs SASL library, version @value{VERSION}.
 
-Copyright @copyright{} 2000, 2004--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2000, 2004--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/sc.texi b/doc/misc/sc.texi
index ccf5b9e..3f5b591 100644
--- a/doc/misc/sc.texi
+++ b/doc/misc/sc.texi
@@ -15,7 +15,7 @@
 This document describes Supercite, an Emacs package for citing and
 attributing replies to mail and news messages.
 
-Copyright @copyright{} 1993, 2001--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1993, 2001--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/sem-user.texi b/doc/misc/sem-user.texi
index d151cee..c37291a 100644
--- a/doc/misc/sem-user.texi
+++ b/doc/misc/sem-user.texi
@@ -1,5 +1,5 @@
 @c This is part of the Semantic manual.
-@c Copyright (C) 1999--2005, 2007, 2009--2020 Free Software Foundation,
+@c Copyright (C) 1999--2005, 2007, 2009--2021 Free Software Foundation,
 @c Inc.
 @c See file semantic.texi for copying conditions.
 
diff --git a/doc/misc/semantic.texi b/doc/misc/semantic.texi
index c2b2be2..3c4f2f0 100644
--- a/doc/misc/semantic.texi
+++ b/doc/misc/semantic.texi
@@ -25,7 +25,7 @@
 @copying
 This manual documents the Semantic library and utilities.
 
-Copyright @copyright{} 1999--2005, 2007, 2009--2020 Free Software
+Copyright @copyright{} 1999--2005, 2007, 2009--2021 Free Software
 Foundation, Inc.
 
 @quotation
diff --git a/doc/misc/ses.texi b/doc/misc/ses.texi
index 6edd6a6..b529f0b 100644
--- a/doc/misc/ses.texi
+++ b/doc/misc/ses.texi
@@ -12,7 +12,7 @@
 @copying
 This file documents @acronym{SES}: the Simple Emacs Spreadsheet.
 
-Copyright @copyright{} 2002--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2002--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/sieve.texi b/doc/misc/sieve.texi
index 0813cae..c30409f 100644
--- a/doc/misc/sieve.texi
+++ b/doc/misc/sieve.texi
@@ -10,7 +10,7 @@
 @copying
 This file documents the Emacs Sieve package, for server-side mail filtering.
 
-Copyright @copyright{} 2001--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2001--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/smtpmail.texi b/doc/misc/smtpmail.texi
index f4367b3..dd481d2 100644
--- a/doc/misc/smtpmail.texi
+++ b/doc/misc/smtpmail.texi
@@ -4,7 +4,7 @@
 @include docstyle.texi
 @syncodeindex vr fn
 @copying
-Copyright @copyright{} 2003--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2003--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/speedbar.texi b/doc/misc/speedbar.texi
index c9c3daf..9991917 100644
--- a/doc/misc/speedbar.texi
+++ b/doc/misc/speedbar.texi
@@ -5,7 +5,7 @@
 @syncodeindex fn cp
 
 @copying
-Copyright @copyright{} 1999--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1999--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/srecode.texi b/doc/misc/srecode.texi
index 7973468..a0e999b 100644
--- a/doc/misc/srecode.texi
+++ b/doc/misc/srecode.texi
@@ -16,7 +16,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 2007--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2007--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index 0a26e9f..3c7051d 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2020-06-25.17}
+\def\texinfoversion{2020-10-24.12}
 %
 % Copyright 1985, 1986, 1988, 1990-2020 Free Software Foundation, Inc.
 %
@@ -1088,7 +1088,7 @@ where each line of input produces a line of output.}
     }
     % The -2 in the arguments here gives all the input to TeX catcode 12
     % (other) or 10 (space), preventing undefined control sequence errors. See
-    % https://lists.gnu.org/r/bug-texinfo/2019-08/msg00031.html
+    % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html
     %
   \endgroup
   \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
@@ -3038,10 +3038,18 @@ end
 % arg (if given), and not the url (which is then just the link target).
 \newif\ifurefurlonlylink
 
+% The default \pretolerance setting stops the penalty inserted in
+% \urefallowbreak being a discouragement to line breaking.  Set it to
+% a negative value for this paragraph only.  Hopefully this does not
+% conflict with redefinitions of \par done elsewhere.
+\def\nopretolerance{%
+\pretolerance=-1
+\def\par{\endgraf\pretolerance=100 \let\par\endgraf}%
+}
+
 % The main macro is \urefbreak, which allows breaking at expected
-% places within the url.  (There used to be another version, which
-% didn't support automatic breaking.)
-\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
+% places within the url.
+\def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak}
 \let\uref=\urefbreak
 %
 \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
@@ -3152,14 +3160,14 @@ end
 
 % Allow a ragged right output to aid breaking long URL's.  There can
 % be a break at the \allowbreak with no extra glue (if the existing stretch in
-% the line is sufficient), a break at the \penalty100 with extra glue added
+% the line is sufficient), a break at the \penalty with extra glue added
 % at the end of the line, or no break at all here.
 %   Changing the value of the penalty and/or the amount of stretch affects how
 % preferable one choice is over the other.
 \def\urefallowbreak{%
-  \allowbreak
+  \penalty0\relax
   \hskip 0pt plus 2 em\relax
-  \penalty300
+  \penalty1000\relax
   \hskip 0pt plus -2 em\relax
 }
 
@@ -3356,6 +3364,25 @@ end
 \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
 \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}%
 
+% provide this command from LaTeX as it is very common
+\def\frac#1#2{{{#1}\over{#2}}}
+
+% @displaymath.
+% \globaldefs is needed to recognize the end lines in \tex and
+% \end tex.  Set \thisenv as @end displaymath is seen before @end tex.
+{\obeylines
+\globaldefs=1
+\envdef\displaymath{%
+\tex
+\def\thisenv{\displaymath}%
+$$%
+}
+
+\def\Edisplaymath{$$
+\def\thisenv{\tex}%
+\end tex
+}}
+
 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
 % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
 % except specified as a normal braced arg, so no newlines to worry about.
@@ -7639,7 +7666,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
 \endgroup
 %
 \envdef\verbatim{%
-    \setupverbatim\doverbatim
+    \setnormaldispenv\setupverbatim\doverbatim
 }
 \let\Everbatim = \afterenvbreak
 
@@ -11459,6 +11486,18 @@ directory should work if nowhere else does.}
   \globaldefs = 0
 }}
 
+\def\bsixpaper{{\globaldefs = 1
+  \afourpaper
+  \internalpagesizes{140mm}{100mm}%
+                    {-6.35mm}{-12.7mm}%
+                    {\bindingoffset}{14pt}%
+                    {176mm}{125mm}%
+  \let\SETdispenvsize=\smallword
+  \lispnarrowing = 0.2in
+  \globaldefs = 0
+}}
+
+
 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
 % Perhaps we should allow setting the margins, \topskip, \parskip,
 % and/or leading, also. Or perhaps we should compute them somehow.
@@ -11472,12 +11511,12 @@ directory should work if nowhere else does.}
   \setleading{\textleading}%
   %
   \dimen0 = #1\relax
-  \advance\dimen0 by \voffset
-  \advance\dimen0 by 1in % reference point for DVI is 1 inch from top of page
+  \advance\dimen0 by 2.5in % default 1in margin above heading line
+                           % and 1.5in to include heading, footing and
+                           % bottom margin
   %
   \dimen2 = \hsize
-  \advance\dimen2 by \normaloffset
-  \advance\dimen2 by 1in % reference point is 1 inch from left edge of page
+  \advance\dimen2 by 2in % default to 1 inch margin on each side
   %
   \internalpagesizes{#1}{\hsize}%
                     {\voffset}{\normaloffset}%
diff --git a/doc/misc/todo-mode.texi b/doc/misc/todo-mode.texi
index 428df56..dbd7f3d 100644
--- a/doc/misc/todo-mode.texi
+++ b/doc/misc/todo-mode.texi
@@ -9,7 +9,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 2013--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2013--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 59b8bdb..358f6fc 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -12,7 +12,7 @@
 @footnotestyle end
 
 @copying
-Copyright @copyright{} 1999--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1999--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -558,8 +558,8 @@ of the local file name is the share exported by the remote 
host,
 @cindex method @option{davs}
 @cindex @option{dav} method
 @cindex @option{davs} method
-@cindex method @option{media}
-@cindex @option{media} method
+@cindex method @option{mtp}
+@cindex @option{mtp} method
 
 On systems, which have installed @acronym{GVFS, the GNOME Virtual File
 System}, its offered methods could be used by @value{tramp}.  Examples
@@ -567,7 +567,7 @@ are @file{@trampfn{sftp,user@@host,/path/to/file}},
 @file{@trampfn{afp,user@@host,/path/to/file}} (accessing Apple's AFP
 file system), @file{@trampfn{dav,user@@host,/path/to/file}},
 @file{@trampfn{davs,user@@host,/path/to/file}} (for WebDAV shares) and
-@file{@trampfn{media,device,/path/to/file}} (for media devices).
+@file{@trampfn{mtp,device,/path/to/file}} (for media devices).
 
 
 @anchor{Quick Start Guide: GNOME Online Accounts based methods}
@@ -1246,13 +1246,13 @@ Since Google Drive uses cryptic blob file names 
internally,
 could produce unexpected behavior in case two files in the same
 directory have the same @code{display-name}, such a situation must be avoided.
 
-@item @option{media}
-@cindex method @option{media}
-@cindex @option{media} method
+@item @option{mtp}
+@cindex method @option{mtp}
+@cindex @option{mtp} method
 @cindex media
 
 Media devices, like cell phones, tablets, cameras, can be accessed via
-the @option{media} method.  Just the device name is needed in order to
+the @option{mtp} method.  Just the device name is needed in order to
 specify the host in the file name.  However, the device must already
 be connected via USB, before accessing it.  Possible device names are
 visible via host name completion, @ref{File name completion}.
@@ -1263,7 +1263,7 @@ different parts of their file system.
 
 @value{tramp} does not require a host name as part of the remote file
 name when a single media device is connected.  @value{tramp} instead
-uses @file{@trampfn{media,,}} as the default name.
+uses @file{@trampfn{mtp,,}} as the default name.
 
 @item @option{nextcloud}
 @cindex method @option{nextcloud}
@@ -1289,7 +1289,7 @@ that for security reasons refuse @command{ssh} 
connections.
 @defopt tramp-gvfs-methods
 This user option is a list of external methods for @acronym{GVFS}@.
 By default, this list includes @option{afp}, @option{dav},
-@option{davs}, @option{gdrive}, @option{media}, @option{nextcloud} and
+@option{davs}, @option{gdrive}, @option{mtp}, @option{nextcloud} and
 @option{sftp}.  Other methods to include are @option{ftp},
 @option{http}, @option{https} and @option{smb}.  These methods are not
 intended to be used directly as @acronym{GVFS}-based method.  Instead,
@@ -2508,7 +2508,7 @@ whatever shell is installed on the device with this 
setting:
 @lisp
 @group
 (add-to-list 'tramp-connection-properties
-            (list (regexp-quote "192.168.0.26") "remote-shell" "sh"))
+             (list (regexp-quote "192.168.0.26") "remote-shell" "sh"))
 @end group
 @end lisp
 
@@ -2560,7 +2560,7 @@ the previous example, fix the connection properties as 
follows:
 @lisp
 @group
 (add-to-list 'tramp-connection-properties
-            (list (regexp-quote "android") "remote-shell" "sh"))
+             (list (regexp-quote "android") "remote-shell" "sh"))
 @end group
 @end lisp
 
@@ -3584,9 +3584,6 @@ It does not set process property @code{remote-pid}.
 @item
 It does not use @code{tramp-remote-path} and
 @code{tramp-remote-process-environment}.
-
-@item
-It does not set environment variable @env{INSIDE_EMACS}.
 @end itemize
 
 In order to gain even more performance, it is recommended to bind
@@ -4341,9 +4338,9 @@ configure @file{~/.ssh/config} on the proxy host:
 @example
 @group
 Host *
-     ControlMaster     auto
-     ControlPath       tramp.%C
-     ControlPersist    no
+     ControlMaster      auto
+     ControlPath        tramp.%C
+     ControlPersist     no
 @end group
 @end example
 
@@ -4878,6 +4875,27 @@ In case you have installed it from its Git repository, 
@ref{Recompilation}.
 
 
 @item
+I get an error @samp{Remote file error: Forbidden reentrant call of Tramp}
+
+@vindex remote-file-error
+@vindex debug-ignored-errors
+Timers, process filters and sentinels, and other event based functions
+can run at any time, when a remote file operation is still running.
+This can cause @value{tramp} to block.  When such a situation is
+detected, this error is triggered.  It shall be fixed in the
+respective function (an error report will help), but for the time
+being you can suppress this error by the following code in your
+@file{~/.emacs}:
+
+@lisp
+@group
+(setq debug-ignored-errors
+      (cons 'remote-file-error debug-ignored-errors))
+@end group
+@end lisp
+
+
+@item
 How to disable other packages from calling @value{tramp}?
 
 There are packages that call @value{tramp} without the user ever
@@ -4982,7 +5000,7 @@ handlers.
 
 @node External packages
 @section Integrating with external Lisp packages
-@subsection File name completion.
+@subsection File name completion
 
 @vindex non-essential
 Sometimes, it is not convenient to open a new connection to a remote
@@ -5000,8 +5018,9 @@ bind it to non-@code{nil} value.
 @end lisp
 
 
-@subsection File attributes cache.
+@subsection File attributes cache
 
+@vindex process-file-side-effects
 Keeping a local cache of remote file attributes in sync with the
 remote host is a time-consuming operation.  Flushing and re-querying
 these attributes can tax @value{tramp} to a grinding halt on busy
@@ -5040,6 +5059,26 @@ root-directory, it is most likely sufficient to make the
 @code{default-directory} of the process buffer as the root directory.
 
 
+@subsection Timers
+
+@vindex remote-file-error
+Timers run asynchronously at any time when Emacs is waiting for
+sending a string to a process, or waiting for process output.  They
+can run any remote file operation, which would conflict with the
+already running remote file operation, if the same connection is
+affected.  @value{tramp} detects this situation, and raises the
+@code{remote-file-error} error.  A timer function shall avoid this
+situation.  At least, it shall protect itself against this error, by
+wrapping the timer function body with
+
+@lisp
+@group
+(ignore-error 'remote-file-error
+  @dots{})
+@end group
+@end lisp
+
+
 @node Traces and Profiles
 @chapter How to Customize Traces
 @vindex tramp-verbose
diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi
index dbebbc3..6970c46 100644
--- a/doc/misc/trampver.texi
+++ b/doc/misc/trampver.texi
@@ -2,13 +2,13 @@
 @c texi/trampver.texi.  Generated from trampver.texi.in by configure.
 
 @c This is part of the Emacs manual.
-@c Copyright (C) 2003--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2003--2021 Free Software Foundation, Inc.
 @c See file doclicense.texi for copying conditions.
 
 @c In the Tramp GIT, the version numbers are auto-frobbed from
 @c tramp.el, and the bug report address is auto-frobbed from
 @c configure.ac.
-@set trampver 2.5.0-pre
+@set trampver 2.5.0
 @set trampurl https://www.gnu.org/software/tramp/
 @set tramp-bug-report-address tramp-devel@@gnu.org
 @set emacsver 25.1
diff --git a/doc/misc/url.texi b/doc/misc/url.texi
index 0304ff4..8f15e11 100644
--- a/doc/misc/url.texi
+++ b/doc/misc/url.texi
@@ -21,7 +21,7 @@
 @copying
 This is the manual for the @code{url} Emacs Lisp library.
 
-Copyright @copyright{} 1993--1999, 2002, 2004--2020 Free Software
+Copyright @copyright{} 1993--1999, 2002, 2004--2021 Free Software
 Foundation, Inc.
 
 @quotation
diff --git a/doc/misc/vhdl-mode.texi b/doc/misc/vhdl-mode.texi
index 527302e..fef98a7 100644
--- a/doc/misc/vhdl-mode.texi
+++ b/doc/misc/vhdl-mode.texi
@@ -10,7 +10,7 @@
 @copying
 This file documents VHDL Mode, an Emacs mode for editing VHDL code.
 
-Copyright @copyright{} 1995--2008, 2010, 2012, 2015--2020 Free Software
+Copyright @copyright{} 1995--2008, 2010, 2012, 2015--2021 Free Software
 Foundation, Inc.
 
 @quotation
diff --git a/doc/misc/vip.texi b/doc/misc/vip.texi
index fe50309..92c76ad 100644
--- a/doc/misc/vip.texi
+++ b/doc/misc/vip.texi
@@ -4,7 +4,7 @@
 @include docstyle.texi
 
 @copying
-Copyright @copyright{} 1987, 2001--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1987, 2001--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/viper.texi b/doc/misc/viper.texi
index 661eb7c..e127f62 100644
--- a/doc/misc/viper.texi
+++ b/doc/misc/viper.texi
@@ -8,7 +8,7 @@
 @include docstyle.texi
 
 @copying
-Copyright @copyright{} 1995--1997, 2001--2020 Free Software Foundation,
+Copyright @copyright{} 1995--1997, 2001--2021 Free Software Foundation,
 Inc.
 
 @quotation
diff --git a/doc/misc/widget.texi b/doc/misc/widget.texi
index 83a6c4c..b0254e0 100644
--- a/doc/misc/widget.texi
+++ b/doc/misc/widget.texi
@@ -9,7 +9,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 2000--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2000--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/misc/wisent.texi b/doc/misc/wisent.texi
index 8b6929b..dc5b8e4 100644
--- a/doc/misc/wisent.texi
+++ b/doc/misc/wisent.texi
@@ -24,7 +24,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 1988--1993, 1995, 1998--2004, 2007, 2012--2020
+Copyright @copyright{} 1988--1993, 1995, 1998--2004, 2007, 2012--2021
 Free Software Foundation, Inc.
 
 @c Since we are both GNU manuals, we do not need to ack each other here.
diff --git a/doc/misc/woman.texi b/doc/misc/woman.texi
index a114415..4470afc 100644
--- a/doc/misc/woman.texi
+++ b/doc/misc/woman.texi
@@ -15,7 +15,7 @@
 This file documents WoMan: A program to browse Unix manual pages ``W.O.
 (without) man''.
 
-Copyright @copyright{} 2001--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 2001--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/etc/CALC-NEWS b/etc/CALC-NEWS
index a0b9cdf..da9ed66 100644
--- a/etc/CALC-NEWS
+++ b/etc/CALC-NEWS
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Calc is an advanced desk calculator for GNU Emacs.
diff --git a/etc/ChangeLog.1 b/etc/ChangeLog.1
index 5a7cd59..629ab0b 100644
--- a/etc/ChangeLog.1
+++ b/etc/ChangeLog.1
@@ -6891,7 +6891,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1993-1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1993-1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/etc/DEBUG b/etc/DEBUG
index 7fb7e44..fae8726 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -1,6 +1,6 @@
 Debugging GNU Emacs
 
-Copyright (C) 1985, 2000-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 2000-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 ** Preliminaries
diff --git a/etc/DISTRIB b/etc/DISTRIB
index 767dac6..610c347 100644
--- a/etc/DISTRIB
+++ b/etc/DISTRIB
@@ -1,7 +1,7 @@
                                                -*- text -*-
             GNU Emacs availability information
 
-Copyright (C) 1986-1993, 1995, 1998, 2000-2020 Free Software Foundation,
+Copyright (C) 1986-1993, 1995, 1998, 2000-2021 Free Software Foundation,
 Inc.
 See the end of the file for license conditions.
 
diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS
index 78cb540..8c9306b 100644
--- a/etc/ERC-NEWS
+++ b/etc/ERC-NEWS
@@ -1,6 +1,6 @@
 ERC NEWS                                                       -*- outline -*-
 
-Copyright (C) 2006-2020 Free Software Foundation, Inc.
+Copyright (C) 2006-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 * For changes after ERC 5.3, see the main Emacs NEWS file
diff --git a/etc/ETAGS.EBNF b/etc/ETAGS.EBNF
index 80deb16..c72ac6f 100644
--- a/etc/ETAGS.EBNF
+++ b/etc/ETAGS.EBNF
@@ -52,7 +52,7 @@ pattern ::= regstring                    /* a tag pattern */
 
 tagname ::= regchar regstring             /* a tag name */
 
-position ::= realposition | ","           /* charpos,linepos */
+position ::= realposition | ","           /* linepos,charpos */
 
 realposition ::= "," unsint | unsint "," | unsint "," unsint
 
@@ -94,7 +94,7 @@ those.
 
 ===================== end of discussion of tag names =====================
 
-Copyright (C) 2002-2020 Free Software Foundation, Inc.
+Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 COPYING PERMISSIONS:
 
diff --git a/etc/ETAGS.README b/etc/ETAGS.README
index 314e321..3c56021 100644
--- a/etc/ETAGS.README
+++ b/etc/ETAGS.README
@@ -28,7 +28,7 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
LIABILITY, OR TORT
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2020 Free Software
+Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2021 Free Software
 Foundation, Inc.
 
 This file is not considered part of GNU Emacs.
diff --git a/etc/HELLO b/etc/HELLO
index 9ea7ebc..dec3a77 100644
--- a/etc/HELLO
+++ b/etc/HELLO
@@ -103,7 +103,7 @@ Vietnamese (tiếng Việt)     Chào bạn
 
 
 
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 
 This file is part of GNU Emacs.
diff --git a/etc/MACHINES b/etc/MACHINES
index 78e9cef..9799577 100644
--- a/etc/MACHINES
+++ b/etc/MACHINES
@@ -1,6 +1,6 @@
 Emacs machines list
 
-Copyright (C) 1989-1990, 1992-1993, 1998, 2001-2020 Free Software
+Copyright (C) 1989-1990, 1992-1993, 1998, 2001-2021 Free Software
 Foundation, Inc.
 See the end of the file for license conditions.
 
diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS
index 420ddd0..29c48c7 100644
--- a/etc/MH-E-NEWS
+++ b/etc/MH-E-NEWS
@@ -1,6 +1,6 @@
 * COPYRIGHT
 
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 * Changes in MH-E 8.6
diff --git a/etc/NEWS b/etc/NEWS
index 8390c82..b294ff1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.
 
-Copyright (C) 2017-2020 Free Software Foundation, Inc.
+Copyright (C) 2017-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Emacs bug reports to 'bug-gnu-emacs@gnu.org'.
@@ -85,9 +85,18 @@ useful on systems such as FreeBSD which ships only with 
"etc/termcap".
 
 * Changes in Emacs 28.1
 
+** The new NonGNU ELPA archive is enabled by default alongside GNU ELPA
+
 ** Minibuffer scrolling is now conservative by default.
 This is controlled by the new variable 'scroll-minibuffer-conservatively'.
 
+In addition, there is a new variable
+'redisplay-adhoc-scroll-in-resize-mini-windows' to disable the
+ad-hoc auto-scrolling when resizing minibuffer windows.  It has been
+found that its heuristic can be counter productive in some corner
+cases, tho the cure may be worse than the disease.  This said, the
+effect should be negligible in the vast majority of cases anyway.
+
 +++
 ** Improved handling of minibuffers on switching frames.
 By default, when you switch to another frame, an active minibuffer now
@@ -107,6 +116,12 @@ choosing a group, or clicking a button in the "*Help*" 
buffers when
 looking at the doc string of a function that belongs to one of these
 groups.
 
+---
+** Improved "find definition" feature of *Help* buffers.
+Now clicking on the link to find the definition of functions generated
+by 'cl-defstruct', or variables generated by 'define-derived-mode',
+for example, will go to the exact place where they are defined.
+
 ** New variable 'redisplay-skip-initial-frame' to enable batch redisplay tests.
 Setting it to nil forces the redisplay to do its job even in the
 initial frame used in batch mode.
@@ -192,8 +207,10 @@ have been replaced with "chat.freenode.net" throughout 
Emacs.
 These functions return the connection local value of the respective
 variables.  This can be used for remote hosts.
 
-** Emacs now prints a backtrace when signaling an error in batch mode.  This
-makes debugging Emacs Lisp scripts run in batch mode easier.
+** Emacs now prints a backtrace when signaling an error in batch mode.
+This makes debugging Emacs Lisp scripts run in batch mode easier.  To
+get back the old behavior, set the new variable
+'backtrace-on-error-noninteractive' to a nil value.
 
 
 * Editing Changes in Emacs 28.1
@@ -215,8 +232,9 @@ forms, but this command has now been changed to work more 
like
 ** Standalone 'M-y' uses the minibuffer to complete previous kills.
 When 'M-y' is typed not after a yank command, it activates the minibuffer
 where you can browse previous kills using the minibuffer history or
-completion.  In Isearch 'C-s M-y' uses the minibuffer with completion
-on previous kills to read a string and append it to the search string.
+completion.  In Isearch, you can bind 'C-s M-y' to the command
+`isearch-yank-pop' that uses the minibuffer with completion on
+previous kills to read a string and append it to the search string.
 
 ---
 ** New user options 'copy-region-blink-delay' and 'delete-pair-blink-delay'.
@@ -249,6 +267,10 @@ buffer to be able to move point to the inaccessible 
portion.
 'goto-line-relative' is bound to 'C-x n g'.
 
 +++
+** When called interactively, 'goto-char' now offers the number at
+point as default.
+
++++
 ** When 'suggest-key-bindings' is non-nil, the completion list of 'M-x'
 shows equivalent key bindings for all commands that have them.
 
@@ -273,6 +295,11 @@ preserving markers, properties and overlays.  The new 
variable
 number of seconds that 'revert-buffer-with-fine-grain' should spend
 trying to be non-destructive.
 
++++
+** New command 'memory-report'.
+This command opens a new buffer called "*Memory Report*" and gives a
+summary of where Emacs is using memory currently.
+
 ** Outline
 
 +++
@@ -285,6 +312,26 @@ the buffer cycles the whole buffer between "only top-level 
headings",
 
 * Changes in Specialized Modes and Packages in Emacs 28.1
 
++++
+** profiler.el
+The results displayed by 'profiler-report' now have the usage figures
+at the left hand side followed by the function name.  This is intended
+to make better use of the horizontal space, in particular eliminating
+the truncation of function names.  There is no way to get the former
+layout back.
+
+** Loading dunnet.el in batch mode doesn't start the game any more.
+Instead you need to do "emacs -f dun-batch" to start the game in
+batch mode.
+
+** Emacs Server
+
++++
+*** New user option 'server-client-instructions'.
+When emacsclient connects, Emacs will (by default) output a message
+about how to exit the client frame.  If 'server-client-instructions'
+is set to nil, this message is inhibited.
+
 ** Python mode
 
 *** 'C-c C-r' can now be used on arbitrary regions.
@@ -345,6 +392,18 @@ value of 'tab-bar-show'.
 If your mouse or trackpad supports it, you can now scroll tabs when
 the mouse pointer is in the tab line by scrolling left or right.
 
+---
+*** New tab-line faces and options.
+The face 'tab-line-tab-special' is used for tabs whose buffers are
+special, i.e. not file-backed.  The face
+'tab-line-tab-inactive-alternate' is used to display inactive tabs
+with an alternating background color, making them easier to
+distinguish between, especially if the face 'tab-line-tab' is
+configured to not display with a box; this alternate face is only
+applied when the option 'tab-line-tab-face-functions' is
+so-configured.  That option may also be used to customize tab-line
+faces in other ways.
+
 ** New bindings in occur-mode, 'next-error-no-select' bound to 'n' and
 'previous-error-no-select' bound to 'p'.
 
@@ -492,6 +551,25 @@ tags to be considered as well.
 ** Gnus
 
 +++
+*** New user option 'gnus-registry-register-all'.
+If non-nil (the default), create registry entries for all messages.
+If nil, don't automatically create entries, they must be created
+manually.
+
++++
+*** New user options to customise the summary line specs "%[" and "%]".
+Four new options introduced in customisation group
+'gnus-summary-format'.  These are 'gnus-sum-opening-bracket',
+'gnus-sum-closing-bracket', 'gnus-sum-opening-bracket-adopted', and
+'gnus-sum-closing-bracket-adopted'.  Their default values are "[", "]",
+"<", ">" respectively.  These options control the appearance of "%["
+and "%]" specs in the summary line format.  "%[" will normally display
+the value of 'gnus-sum-opening-bracket', but can also be
+'gnus-sum-opening-bracket-adopted' for the adopted articles.  "%]" will
+normally display the value of 'gnus-sum-closing-bracket', but can also
+be 'gnus-sum-closing-bracket-adopted' for the adopted articles.
+
++++
 *** New user option 'gnus-paging-select-next'.
 This controls what happens when using commands like 'SPC' and 'DEL' to
 page the current article.  If non-nil (the default), go to the
@@ -821,7 +899,7 @@ preferred over the eudcb-mab.el backend.
 ** Tramp
 
 +++
-*** New connection method "media", which allows accessing media devices
+*** New connection method "mtp", which allows accessing media devices
 like cell phones, tablets or cameras.
 
 +++
@@ -1080,6 +1158,22 @@ If 'shr-width' is non-nil, it overrides this variable.
 ** Images
 
 ---
+*** You can explicitly specify base_uri for svg images.
+':base-uri' image property can be used to explicitly specify base_uri
+for embedded images into svg.  ':base-uri' is supported for both file
+and data svg images.
+
++++
+*** 'svg-embed-base-uri-image' added to embed images.
+'svg-embed-base-uri-image' can be used to embed images located
+relatively to 'file-name-directory' of the ':base-uri' svg image property.
+This works much faster then 'svg-embed'.
+
++++
+*** New function 'image-cache-size'.
+This function returns the size of the current image cache, in bytes.
+
+---
 *** Animated images stop automatically under high CPU pressure sooner.
 Previously, an animated image would stop animating if any single image
 took more than two seconds to display.  The new algorithm maintains a
@@ -1190,11 +1284,29 @@ project's root directory, respectively.
 So typing 'C-u RET' in the "*xref*" buffer quits its window
 before navigating to the selected location.
 
-*** New options xref-search-program and xref-search-program-alist.
-So far Grep and ripgrep are supported.  ripgrep seems to offer better
+*** New user options 'xref-search-program' and 'xref-search-program-alist'.
+So far 'grep' and 'ripgrep' are supported.  'ripgrep' seems to offer better
 performance in certain cases, in particular for case-insensitive
 searches.
 
++++
+*** New commands 'xref-prev-group' and 'xref-next-group'.
+These commands are bound respectively to 'P' and 'N', and navigate to
+the first item of the previous or next group in the "*xref*" buffer.
+
+*** New alternative value for 'xref-show-definitions-function':
+'xref-show-definitions-completing-read'.
+
+*** The two existing alternatives for 'xref-show-definitions-function'
+have been renamed to have "proper" public names and documented
+('xref-show-definitions-buffer' and
+'xref-show-definitions-buffer-at-bottom').
+
+---
+*** New value 'project-relative' for 'xref-file-name-display'
+If chosen, file names in *xref* buffers will be displayed relative
+to the 'project-root' of the current project, when available.
+
 ** json.el
 
 ---
@@ -1353,8 +1465,67 @@ This face is used for error messages from 'diff'.
 *** New command 'diff-refresh-hunk'.
 This new command (bound to 'C-c C-l') regenerates the current hunk.
 
+** Buttons
+
++++
+*** New minor mode 'button-mode'.
+This minor mode does nothing else than install 'button-buffer-map' as
+a minor mode map (which binds the 'TAB' / 'S-TAB' key bindings to navigate
+to buttons), and can be used in any view-mode-like buffer that has
+buttons in it.
+
++++
+*** New utility function 'button-buttonize'.
+This function takes a string and returns a string propertized in a way
+that makes it a valid button.
+
+
 ** Miscellaneous
 
++++
+*** 'add-to-ordered-list' can now take a test predicate.
+
++++
+*** New predicate functions 'length<', 'length>' and 'length='.
+Using these functions may be more efficient than using 'length' (if
+the length of a (long) list is being computed just to compare this
+length to a number).
+
+---
+*** 'remove-hook' is now an interactive command.
+
+---
+*** New user option 'authinfo-hide-elements'.
+This can be set to nil to inhibit hiding passwords in ".authinfo" files.
+
++++
+*** A number of new string manipulation functions have been added.
+'string-clean-whitespace', 'string-fill', 'string-limit',
+'string-lines', 'string-pad' and 'string-chop-newline'.
+
++++
+*** New variable 'current-minibuffer-command'.
+This is like 'this-command', but it is bound recursively when entering
+the minibuffer.
+
++++
+*** New function 'object-intervals'.
+This function returns a copy of the list of intervals (i.e., text
+properties) in the object in question (which must either be a string
+or a buffer).
+
+---
+*** 'hexl-mode' scrolling commands now heed 'next-screen-context-lines'.
+Previously, 'hexl-scroll-down' and 'hexl-scroll-up' would scroll
+up/down an entire window, but they now work more like the standard
+scrolling commands.
+
+---
+*** Errors in 'kill-emacs-hook' no longer prevent Emacs from shutting down.
+If a function in that hook signals an error in an interactive Emacs,
+the user will be prompted on whether to continue.  If the user doesn't
+answer within five seconds, Emacs will continue shutting down anyway.
+
 ---
 *** iso-transl is now preloaded.
 This means that keystrokes like 'Alt-[' are defined by default,
@@ -1373,6 +1544,10 @@ completions with more information in completion prefix 
and suffix.
 This new option allows the user to customize how case is converted
 when unifying entries.
 
+---
+*** The user option 'bibtex-maintain-sorted-entries' now permits
+user-defined sorting schemes.
+
 +++
 *** 'format-seconds' can now be used for sub-second times.
 The new optional "," parameter has been added, and
@@ -1449,24 +1624,17 @@ the column number format (when 'column-number-mode' is 
on), and
 both modes are on).
 
 +++
+*** New user option 'mode-line-compact'.
+If non-nil, repeating spaces are compressed into a single space.  If
+'long', this is only done when the mode line is longer than the
+current window width (in characters).
+
++++
 *** New command 'submit-emacs-patch'.
 This works like 'report-emacs-bug', but is more geared towards sending
 patches to the Emacs issue tracker.
 
 +++
-*** New minor mode 'button-mode'.
-This minor mode does nothing else than install 'button-buffer-map' as
-a minor mode map (which binds the 'TAB' / 'S-TAB' key bindings to navigate
-to buttons), and can be used in any view-mode-like buffer that has
-buttons in it.
-
----
-*** 'icomplete-show-matches-on-no-input' behavior change.
-Previously, choosing a different completion with commands like 'C-.'
-and then hitting  'RET' would choose the default completion.  Doing
-this will now choose the completion under point.
-
-+++
 *** The user can now customize how "default" values are prompted for.
 The new utility function 'format-prompt' has been added which uses the
 new 'minibuffer-default-prompt-format' user option to format "default"
@@ -1516,7 +1684,9 @@ horizontally and vertically, respectively.
 *** Change in meaning of 'icomplete-show-matches-on-no-input'.
 Previously, choosing a different completion with commands like 'C-.'
 and then hitting 'RET' would choose the default completion.  Doing this
-will now choose the completion under point instead.
+will now choose the completion under point instead.  Also when this option
+is nil, completions are not shown when the minibuffer reads a file name
+with initial input as the default directory.
 
 ---
 *** The width of the buffer-name column in 'list-buffers' is now dynamic.
@@ -1577,6 +1747,19 @@ height of lines or width of chars.
 When non-nil, use a new xwidget webkit session after bookmark jump.
 Otherwise, it will use 'xwidget-webkit-last-session'.
 
+** Flymake mode
+
++++
+*** New user options to customize Flymake's mode-line.
+
+The new customization variable 'flymake-mode-line-format' is a mix of
+strings and symbols like 'flymake-mode-line-title' ,
+'flymake-mode-line-exception' and 'flymake-mode-line-counters'.  The
+new customization variable 'flymake-mode-line-counter-format' is a mix
+of strings and symbols like 'flymake-mode-line-error-counter',
+'flymake-mode-line-warning-counter' and
+'flymake-mode-line-note-counter'.
+
 ** Flyspell mode
 
 +++
@@ -1664,14 +1847,12 @@ used instead.
 * New Modes and Packages in Emacs 28.1
 
 ** Lisp Data mode
-
 The new command 'lisp-data-mode' enables a major mode for buffers
 composed of Lisp symbolic expressions that do not form a computer
 program.  The ".dir-locals.el" file is automatically set to use this
 mode, as are other data files produced by Emacs.
 
 ** hierarchy.el
-
 It's a library to create, query, navigate and display hierarchy structures.
 
 ** New themes 'modus-vivendi' and 'modus-operandi'.
@@ -1681,6 +1862,14 @@ using 'M-x customize-themes' or 'load-theme' from your 
init file.
 Consult the Modus Themes Info manual for more information on the user
 options they provide.
 
+** Dictionary mode
+This is a mode for searching a RFC 2229 dictionary server.
+'dictionary' opens a buffer for starting operations.
+'dictionary-search' performs a lookup for a word.  It also supports a
+'dictionary-tooltip-mode' which performs a lookup of the word under
+the mouse in 'dictionary-tooltip-dictionary' (which must be customized
+first).
+
 
 * Incompatible Editing Changes in Emacs 28.1
 
@@ -1714,6 +1903,13 @@ modifies the string's text properties; instead, it uses 
and returns
 a copy of the string.  This helps avoid trouble when strings are
 shared or constants.
 
++++
+** Temporary buffers no longer run certain buffer hooks.
+The macros 'with-temp-buffer' and 'with-temp-file' no longer run the
+hooks 'kill-buffer-hook', 'kill-buffer-query-functions', and
+'buffer-list-update-hook' for the temporary buffers they create.  This
+avoids slowing them down when a lot of these hooks are defined.
+
 ---
 ** The obsolete function 'thread-alive-p' has been removed.
 
@@ -1741,11 +1937,6 @@ This is no longer supported, and setting this variable 
has no effect.
 ** The macro 'with-displayed-buffer-window' is now obsolete.
 Use macro 'with-current-buffer-window' with action alist entry 'body-function'.
 
-+++
-** 'byte-compile-file' optional argument LOAD is now obsolete.
-To load the file after byte-compiling, add a call to 'load' from Lisp
-or use 'M-x emacs-lisp-byte-compile-and-load' interactively.
-
 ---
 ** The metamail.el library is now marked obsolete.
 
@@ -1831,7 +2022,7 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
 
 * Lisp Changes in Emacs 28.1
 
-** New function `garbage-collect-maybe` to trigger GC early
+** New function 'garbage-collect-maybe' to trigger GC early.
 
 ---
 ** 'defvar' detects the error of defining a variable currently lexically bound.
@@ -1850,6 +2041,11 @@ If you bind 'help-form' to a non-nil value while calling 
these functions,
 then pressing 'C-h' ('help-char') causes the function to evaluate 'help-form'
 and display the result.
 
+---
+** New variables 'read-char-choice-use-read-key' and 'y-or-n-p-use-read-key'.
+When non-nil, then functions 'read-char-choice' and 'y-or-n-p' (respectively)
+use the function 'read-key' to read a character instead of using the 
minibuffer.
+
 +++
 ** 'set-window-configuration' now takes an optional 'dont-set-frame'
 parameter which, when non-nil, instructs the function not to select
@@ -1863,7 +2059,7 @@ used in.
 +++
 ** 'truncate-string-ellipsis' now uses '…' by default.
 Modes that use 'truncate-string-to-width' with non-nil, non-string
-argument 'ellipsis', will now indicate truncation using '…' when
+argument ELLIPSIS, will now indicate truncation using '…' when
 the selected frame can display it, and using "..." otherwise.
 
 +++
@@ -1900,7 +2096,7 @@ of its file argument.
 
 +++
 ** New utility function 'directory-empty-p'.
-This predicate tests whether a given filename is an accessible
+This predicate tests whether a given file name is an accessible
 directory and whether it contains no other directories or files.
 
 +++
@@ -2011,6 +2207,11 @@ In order for the two functions to behave more 
consistently,
 length, and also supports format specifications that include a
 truncating precision field, such as "%.2a".
 
++++
+** 'format-spec' now takes an optional SPLIT parameter.
+If non-nil, 'format-spec' will split the resulting string into a list
+of strings, based on where the format specs (and expansions) were.
+
 ---
 ** New function 'color-values-from-color-spec'.
 This can be used to parse RGB color specs in several formats and
@@ -2032,17 +2233,29 @@ menu handling.
 +++
 ** 'inhibit-nul-byte-detection' is renamed to 'inhibit-null-byte-detection'.
 
+** Byte compiler
+
 +++
-** New byte-compiler check for missing dynamic variable declarations.
+*** New byte-compiler check for missing dynamic variable declarations.
 It is meant as an (experimental) aid for converting Emacs Lisp code
 to lexical binding, where dynamic (special) variables bound in one
 file can affect code in another.  For details, see the manual section
 "(Elisp) Converting to Lexical Binding".
 
 +++
-** 'byte-recompile-directory' can now compile symlinked ".el" files.
+*** 'byte-recompile-directory' can now compile symlinked ".el" files.
 This is achieved by giving a non-nil FOLLOW-SYMLINKS parameter.
 
+*** The byte-compiler now warns about too wide documentation strings.
+By default, it will warn if a documentation string is wider than the
+largest of 80 characters or 'fill-column'.  This is controlled by the
+new user option 'byte-compile-docstring-max-column'.
+
++++
+*** 'byte-compile-file' optional argument LOAD is now obsolete.
+To load the file after byte-compiling, add a call to 'load' from Lisp
+or use 'M-x emacs-lisp-byte-compile-and-load' interactively.
+
 ---
 ** 'unload-feature' now also tries to undo additions to buffer-local hooks.
 
@@ -2056,6 +2269,48 @@ and 'play-sound-file'.
 If this variable is non-nil, character syntax is used for printing
 numbers when this makes sense, such as '?A' for 65.
 
++++
+** New error 'remote-file-error', a subcategory of 'file-error'.
+It is signaled if a remote file operation fails due to internal
+reasons, and could block Emacs.  It does not replace 'file-error'
+signals for the usual cases.  Timers, process filters and process
+functions, which run remote file operations, shall protect themselves
+against this error.
+
+If such an error occurs, please report this as bug via 'M-x report-emacs-bug'.
+Until it is solved you could ignore such errors by performing
+
+    (setq debug-ignored-errors (cons 'remote-file-error debug-ignored-errors))
+
++++
+** The error 'ftp-error' belongs also to category 'remote-file-error'.
+
++++
+** Buffers can now be created with certain hooks disabled.
+The functions 'get-buffer-create' and 'generate-new-buffer' accept a
+new optional argument INHIBIT-BUFFER-HOOKS.  If non-nil, the new
+buffer does not run the hooks 'kill-buffer-hook',
+'kill-buffer-query-functions', and 'buffer-list-update-hook'.  This
+avoids slowing down internal or temporary buffers that are never
+presented to users or passed on to other applications.
+
+---
+** 'start-process-shell-command' and 'start-file-process-shell-command'
+do not support the old calling conventions any longer.
+
+** Functions operating on local file names now check that the file names
+don't contain any NUL bytes.  This avoids subtle bugs caused by
+silently using only the part of the file name until the first NUL byte.
+
+** New coding-systems for EBCDIC variants.
+New coding-systems 'ibm256', 'ibm273', 'ibm274', 'ibm277', 'ibm278',
+'ibm280', 'ibm281', 'ibm284', 'ibm285', 'ibm290', 'ibm297'.  These are
+variants of the EBCDIC encoding tailored to some European and Japanese
+locales.  They are also available as aliases 'ebcdic-cp-*' (e.g.,
+'ebcdic-cp-fi' for the Finnish variant 'ibm278'), and 'cp2xx' (e.g.,
+'cp278' for 'ibm278').  There are also new charsets 'ibm2xx' to
+support these coding-systems.
+
 
 * Changes in Emacs 28.1 on Non-Free Operating Systems
 
diff --git a/etc/NEWS.1-17 b/etc/NEWS.1-17
index c4ff83b..42a3ced 100644
--- a/etc/NEWS.1-17
+++ b/etc/NEWS.1-17
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.  26-Mar-1986
 
-Copyright (C) 1985-1986, 2006-2020 Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 2006-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/etc/NEWS.18 b/etc/NEWS.18
index e044f66..b11a189 100644
--- a/etc/NEWS.18
+++ b/etc/NEWS.18
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.  17-Aug-1988
 
-Copyright (C) 1988, 2006-2020 Free Software Foundation, Inc.
+Copyright (C) 1988, 2006-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/etc/NEWS.19 b/etc/NEWS.19
index d919608..43235e0 100644
--- a/etc/NEWS.19
+++ b/etc/NEWS.19
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.  1992.
 
-Copyright (C) 1993-1995, 2001, 2006-2020 Free Software Foundation, Inc.
+Copyright (C) 1993-1995, 2001, 2006-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/etc/NEWS.20 b/etc/NEWS.20
index 69ce24a..efd0e5d 100644
--- a/etc/NEWS.20
+++ b/etc/NEWS.20
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.  2006-05-31
 
-Copyright (C) 1999-2001, 2006-2020 Free Software Foundation, Inc.
+Copyright (C) 1999-2001, 2006-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/etc/NEWS.21 b/etc/NEWS.21
index 1228984..b9d5959 100644
--- a/etc/NEWS.21
+++ b/etc/NEWS.21
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.  2006-05-31
 
-Copyright (C) 2000-2020 Free Software Foundation, Inc.
+Copyright (C) 2000-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/etc/NEWS.22 b/etc/NEWS.22
index 4df1792..1f03dc3 100644
--- a/etc/NEWS.22
+++ b/etc/NEWS.22
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.
 
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
diff --git a/etc/NEWS.23 b/etc/NEWS.23
index 331ed28..8611ba5 100644
--- a/etc/NEWS.23
+++ b/etc/NEWS.23
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.
 
-Copyright (C) 2007-2020 Free Software Foundation, Inc.
+Copyright (C) 2007-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
diff --git a/etc/NEWS.24 b/etc/NEWS.24
index 60c2b4d..acf6219 100644
--- a/etc/NEWS.24
+++ b/etc/NEWS.24
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.
 
-Copyright (C) 2010-2020 Free Software Foundation, Inc.
+Copyright (C) 2010-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
diff --git a/etc/NEWS.25 b/etc/NEWS.25
index 8c04d94..c533f27 100644
--- a/etc/NEWS.25
+++ b/etc/NEWS.25
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.
 
-Copyright (C) 2014-2020 Free Software Foundation, Inc.
+Copyright (C) 2014-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
diff --git a/etc/NEWS.26 b/etc/NEWS.26
index c6306a6..05e8672 100644
--- a/etc/NEWS.26
+++ b/etc/NEWS.26
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.
 
-Copyright (C) 2016-2020 Free Software Foundation, Inc.
+Copyright (C) 2016-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Emacs bug reports to 'bug-gnu-emacs@gnu.org'.
diff --git a/etc/NEWS.27 b/etc/NEWS.27
index 4855cd3..9232a30 100644
--- a/etc/NEWS.27
+++ b/etc/NEWS.27
@@ -1,6 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.
 
-Copyright (C) 2017-2020 Free Software Foundation, Inc.
+Copyright (C) 2017-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Emacs bug reports to 'bug-gnu-emacs@gnu.org'.
diff --git a/etc/NEXTSTEP b/etc/NEXTSTEP
index 5ac3b6b..5dd2e64 100644
--- a/etc/NEXTSTEP
+++ b/etc/NEXTSTEP
@@ -1,4 +1,4 @@
-Copyright (C) 2008-2020 Free Software Foundation, Inc.
+Copyright (C) 2008-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 This file contains information about GNU Emacs on "Nextstep" platforms.
diff --git a/etc/NXML-NEWS b/etc/NXML-NEWS
index 5df9790..cdce6e7 100644
--- a/etc/NXML-NEWS
+++ b/etc/NXML-NEWS
@@ -1,4 +1,4 @@
-Copyright (C) 2007-2020 Free Software Foundation, Inc.
+Copyright (C) 2007-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index ce08496..2cae8b9 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -5,11 +5,551 @@ ORG NEWS -- history of user-visible changes.   -*- mode: 
org; coding: utf-8 -*-
 #+LINK: doc https://orgmode.org/worg/doc.html#%s
 #+LINK: git https://code.orgmode.org/bzg/org-mode/commit/%s
 
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
+Copyright (C) 2012-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
 
+* Version 9.4
+** Incompatible changes
+*** Possibly broken internal file links: please check and fix
+
+A bug has been affecting internal links to headlines, like
+
+: [[*Headline][A link to a headline]]
+
+Storing a link to a headline may have been broken in your setup and
+those links may appear as
+
+: [[*TODO Headline][A link to a headline]]
+
+Following the link above will result in an error: the TODO keyword
+should not be part of internal file links.
+
+You can use the following command to fix links in an Org buffer:
+
+#+begin_src emacs-lisp
+(defun org-fix-links ()
+  "Fix ill-formatted internal links.
+E.g. replace [[*TODO Headline][headline]] by [[*Headline][headline]].
+Go through the buffer and ask for the replacement."
+  (interactive)
+  (visible-mode 1)
+  (save-excursion
+    (goto-char (point-min))
+    (let ((regexp (format "\\[\\[\\*%s\\s-+"
+                          (regexp-opt org-todo-keywords-1 t))))
+      (while (re-search-forward regexp nil t)
+        (when (and (save-excursion
+                     (goto-char (match-beginning 0))
+                     (looking-at-p org-link-bracket-re))
+                   (y-or-n-p "Fix link (remove TODO keyword)? "))
+         (replace-match "[[*")))))
+  (visible-mode -1))
+#+end_src
+
+*** Calling conventions changes when opening or exporting custom links
+
+This changes affects export back-ends, and libraries providing new
+link types.
+
+Function used in ~:follow~ link parameter is required to accept a
+second argument.  Likewise, function used in ~:export~ parameter needs
+to accept a fourth argument.  See ~org-link-set-parameters~ for
+details.
+
+Eventually, the function ~org-export-custom-protocol-maybe~ is now
+called with a fourth argument.  Even though the 3-arguments definition
+is still supported, at least for now, we encourage back-end developers
+to switch to the new signature.
+
+*** Python session return values must be top-level expression statements
+
+Python blocks with ~:session :results value~ header arguments now only
+return a value if the last line is a top-level expression statement.
+Also, when a None value is returned, "None" will be printed under
+"#+RESULTS:", as it already did with ~:results value~ for non-session
+blocks.
+
+*** In HTML export, change on how outline-container-* is set
+
+When the headline has a =CUSTOM_ID=, use this custom id to build the
+div id.  For example, if you have =:CUSTOM_ID: my-headline= then the
+resulting <div> will be ~<div id="outline-container-my-headline">~.
+
+You may want to check whether your HTML files are rendered differently
+after this change.
+
+*** New keybinding =<C-c C-TAB>= for ~org-force-cycle-archived~
+
+~org-force-cycle-archived~ used to be associated with =<C-TAB>= but
+this keybinding is used in Emacs for navigating tabs in Emacs.  The
+new keybinding is =<C-c C-TAB>=.
+
+** New default settings for some options
+
+These options now default to =t=:
+
+- ~org-loop-over-headlines-in-active-region~
+- ~org-fontify-done-headline~
+- ~org-src-tab-acts-natively~
+
+You may want to read the docstrings of these options to understand the
+consequences of this change.
+
+Also, ~org-startup-folded~ now defaults to ~showeverything~.
+
+** New features
+
+*** Looping agenda commands over headlines
+
+~org-agenda-loop-over-headlines-in-active-region~ allows you to loop
+agenda commands over the active region.
+
+When set to =t= (the default), loop over all headlines.  When set to
+='start-level=, loop over headlines with the same level as the first
+headline in the region.  When set to a string, loop over lines
+matching this regular expression.
+
+*** New minor mode ~org-table-header-line-mode~
+
+Turn on the display of the first data row of the table at point in the
+window header line when this first row is not visible anymore in the
+buffer.
+
+You can activate this minor mode by default by setting the option
+~org-table-header-line-p~ to =t=.  You can also change the face for
+the header line by customizing the ~org-table-header~ face.
+
+*** New minor mode ~org-list-checkbox-radio-mode~
+
+When this minor mode is on, checkboxes behave as radio buttons: if a
+checkbox is turned on, other checkboxes at the same level are turned
+off.
+
+If you want to occasionally toggle a checkbox as a radio button
+without turning this minor mode on, you can use =<C-c C-x C-r>= to
+call ~org-toggle-radio-button~.
+
+You can also add =#+ATTR_ORG: :radio t= right before the list to tell
+Org to use radio buttons for this list only.
+
+*** New allowed value for ~org-adapt-indentation~
+
+~org-adapt-indentation~ now accepts a new value, ='headline-data=.
+
+When set to this value, Org will only adapt indentation of headline
+data lines, such as planning/clock lines and property/logbook drawers.
+Also, with this setting, =org-indent-mode= will keep these data lines
+correctly aligned with the headline above.
+
+*** Numeric priorities are now allowed (up to 65)
+
+You can now set ~org-priority-highest/lowest/default~ to integers to
+use numeric priorities globally or set, for example
+
+#+PRIORITIES: 1 10 5
+
+to define a buffer-local range and default for priorities.  Priority
+commands should work as usual.  You cannot use numbers superior to 64
+for numeric priorities, as it would clash with priorities like [#A]
+where the "A" is internally converted to its numeric value of 65.
+
+*** Property drawers allowed before first headline
+
+Property drawers are now allowed before the first headline.
+
+Org mode is moving more towards making things before the first
+headline behave just as if it was at outline level 0.  Inheritance for
+properties will work also for this level.  In other words: defining
+things in a property drawer before the first headline will make them
+"inheritable" for all headlines.
+
+*** Refinement in window behavior on exiting Org source buffer
+
+After editing a source block, Org will restore the window layout when
+~org-src-window-setup~ is set to a value that modifies the layout.
+
+*** Display remote inline images
+
+Org now knows how to display remote images inline.
+
+Whether the images are actually displayed is controlled by the new
+option ~org-display-remote-inline-images~.
+
+*** New option to resolve open clock at a provided time
+
+~org-resolve-clocks~ now has a `t' option, which works just like the
+`k' option, but the user specifies a time of day, not a number of
+minutes.
+
+*** New step value =semimonth= accepted for clock tables
+
+*** Allow text rescaling in column view
+
+You can now use =C-x C-+= in column view: the columns face size will
+increase or decrease, together with the column header size.
+
+*** New startup option =#+startup: num=
+
+When this startup option is set, display headings as numerated.
+
+Use =#+startup: nonum= to turn this off.
+
+*** New tool for custom links
+
+Org provides a new tool ~org-link-open-as-file~, useful when defining
+new link types similar to "file"-type links.  See docstring for
+details.
+
+*** New optional numeric argument for ~org-return~
+
+In situations where ~org-return~ calls ~newline~, multiple newlines
+can now be inserted with this prefix argument.
+
+*** New source code block header argument =:file-mode=
+
+Source code block header argument =:file-mode= can set file
+permissions if =:file= argument is provided.
+
+*** =RET= and =C-j= now obey ~electric-indent-mode~
+
+Since Emacs 24.4, ~electric-indent-mode~ is enabled by default.  In
+most major modes, this causes =RET= to reindent the current line and
+indent the new line, and =C-j= to insert a newline without indenting.
+
+Org mode now obeys this minor mode: when ~electric-indent-mode~ is
+enabled, and point is neither in a table nor on a timestamp or a link:
+
+- =RET= (bound to ~org-return~) reindents the current line and indents
+  the new line;
+- =C-j= (bound to the new command ~org-return-and-maybe-indent~)
+  merely inserts a newline.
+
+To get the previous behaviour back, disable ~electric-indent-mode~
+explicitly:
+
+#+begin_src emacs-lisp
+(add-hook 'org-mode-hook (lambda () (electric-indent-local-mode -1)))
+#+end_src
+
+Alternatively, if you wish to keep =RET= as the "smart-return" key,
+but dislike Org's default indentation of sections, you may prefer to
+customize ~org-adapt-indentation~ to either =nil= or ='headline-data=.
+
+*** =ob-C.el= allows the inclusion of non-system header files
+
+In C and C++ blocks, ~:includes~ arguments that do not start with a
+~<~ character will now be formatted as double-quoted ~#include~
+statements.
+
+*** =ob-clojure.el= supports inf-clojure.el and ClojureScript evaluation
+
+You can now set ~(setq org-babel-clojure-backend 'inf-clojure)~ and
+evaluate Clojure source blocks using 
[[https://github.com/clojure-emacs/inf-clojure][inf-clojure]].  With a header
+argument like =:alias "alias"= the Clojure REPL will boot with
+=clojure -Aalias=.  Otherwise Clojure will boot with =lein=, =boot= or
+=tools.deps=, depending on whether the current directory contains a
+=project.clj=, =build.boot= or =deps.edn=, falling back on
+~inf-clojure-generic-cmd~ in case no such file is present.
+
+Also, when using [[https://github.com/clojure-emacs/cider][cider]], you can 
now use =#+begin_src clojurescript= to
+execute ClojureScript code from Org files.  Note that this works only
+if your Org file is associated with a cider session that knows how to
+run ClojureScript code.  A bare =lein repl= session outside of a
+directory configured for ClojureScript will /not/ work.
+
+*** =ob-java.el= supports Java command line arguments
+
+Babel Java blocks recognize header argument =:cmdargs= and pass its
+value in call to =java=.
+
+*** =ob-screen.el= now accepts =:screenrc= header argument
+
+Screen blocks now recognize the =:screenrc= header argument and pass
+its value to the screen command via the "-c" option. The default
+remains =/dev/null= (i.e. a clean screen session)
+
+*** =ob-plantuml=: now supports using PlantUML executable to generate diagrams
+
+Set =org-plantuml-exec-mode= to ='plantuml= in order to use the
+executable instead of JAR. When using an executable it is also
+possible to configure executable location as well as arguments via:
+=org-plantuml-executable-path= and =org-plantuml-executable-args=.
+
+** New commands
+*** ~org-table-header-line-mode~
+
+Turn on a minor mode to display the first data row of the table at
+point in the header-line when the beginning of the table is invisible.
+
+*** ~org-agenda-ctrl-c-ctrl-c~
+
+Hitting =<C-c C-c>= in an agenda view now calls ~org-agenda-set-tags~.
+
+*** ~org-hide-entry~
+
+This command is the counterpart of ~org-show-entry~.
+
+*** ~org-columns-toggle-or-columns-quit~
+
+=<C-c C-c>= bound to ~org-columns-toggle-or-columns-quit~ replaces the
+recent ~org-columns-set-tags-or-toggle~.  Tag setting is still
+possible via column view value edit or with =<C-c C-q>=.
+
+*** ~org-datetree-find-month-create~
+
+Find or create a month entry for a date.
+
+** New options and settings
+*** New option ~org-html-prefer-user-labels~
+
+When non-nil, use =NAME= affiliated keyword, or raw target values, to
+generate anchor's ID.  Otherwise, consistently use internal naming
+scheme.
+
+=CUSTOM_ID= values are still always used, when available.
+*** New option for using tabs in ~org-agenda-window-setup~
+
+Choosing ~other-tab~ for ~org-agenda-window-setup~ will open the
+agenda view in a new tab.  This will work with versions of Emacs since
+27.1 when ~tab-bar-mode~ was introduced.
+
+*** New option ~org-table-header-line-p~
+
+Setting this option to =t= will activate ~org-table-header-line-mode~
+in org-mode buffers.
+
+*** New option ~org-startup-numerated~
+
+When this option is =t=, Org files will start using ~(org-num-mode 1)~
+and headings will be visually numerated.
+
+You can turn this on/off on a per-file basis with =#+startup: num= or
+=#+startup: nonum=.
+
+*** New option ~org-clock-auto-clockout-timer~
+
+When this option is set to a number and the user configuration
+contains =(org-clock-auto-clockout-insinuate)=, Org will clock out the
+currently clocked in task after that number of seconds of idle time.
+
+This is useful when you often forget to clock out before being idle
+and don't want to have to manually set the clocking time to take into
+account.
+
+*** New option to group captured datetime entries by month
+
+A new `:tree-type month' option was added to org-capture-templates to
+group new datetime entries by month.
+
+*** New option to show source buffers using "plain" display-buffer
+
+There is a new option ~plain~ to ~org-src-window-setup~ to show source
+buffers using ~display-buffer~.  This allows users to control how
+source buffers are displayed by modifying ~display-buffer-alist~ or
+~display-buffer-base-action~.
+
+*** New option ~org-archive-subtree-save-file-p~
+
+Archiving a subtree used to always save the target archive buffer.
+Commit [[https://code.orgmode.org/bzg/org-mode/commit/b186d1d7][b186d1d7]] 
changed this behavior by always not saving the target
+buffer, because batch archiving from agenda could take too much time.
+
+This new option ~org-archive-subtree-save-file-p~ defaults to the
+value =from-org= so that archiving a subtree will save the target
+buffer when done from an org-mode buffer, but not from the agenda.
+You can also set this option to =t= or to =from-agenda=.
+
+*** New option ~org-show-notification-timeout~
+
+This option will add a timeout to notifications.
+
+*** New option ~org-latex-to-html-convert-command~
+
+This new option allows you to convert a LaTeX fragment directly into
+HTML.
+
+*** New option ~org-babel-shell-results-defaults-to-output~
+
+By default, source code blocks are executed in "functional mode": it
+means that the results of executing them are the value of their last
+statement (see [[https://orgmode.org/manual/Results-of-Evaluation.html][the 
documentation]].)
+
+The value of a shell script's execution is its exit code.  But most
+users expect the results of executing a shell script to be its output,
+not its exit code.
+
+So we introduced this option, that you can set to =nil= if you want
+to stick using ~:results value~ as the implicit header.
+
+In all Babel libraries, the absence of a ~:results~ header should
+produce the same result than setting ~:results value~, unless there is
+an option to explicitly create an exception.
+
+See 
[[https://orgmode.org/list/CA+A2iZaziAfMeGpBqL6qGrzrWEVvLvC0DUw++T4gCF3NGuW-DQ@mail.gmail.com/][this
 thread]] for more context.
+
+*** New option in ~org-attach-store-link-p~
+
+~org-attach-store-link-p~ has a new option to store a file link to the
+attachment.
+*** New option ~org-fontify-todo-headline~
+
+This feature is the same as ~org-fontify-done-headline~, but for TODO
+headlines instead.  This allows you to distinguish TODO headlines from
+normal headlines.  The face can be customized via ~org-headline-todo~.
+
+*** New default value for ~org-file-apps~
+
+The new value uses Emacs as the application for opening directory.
+
+*** New hook ~org-agenda-filter-hook~
+
+Functions in this hook are run after ~org-agenda-filter~ is called.
+
+** Removed or renamed functions and variables
+*** Deprecated ~org-flag-drawer~ function
+
+Use ~org-hide-drawer-toggle~ instead.
+
+*** Deprecated ~org-hide-block-toggle-maybe~ function
+
+Use ~org-hide-block-toggle~ instead.
+
+*** Deprecated ~org-hide-block-toggle-all~ function
+
+This function was not used in the code base, and has no clear use
+either.  It has been marked for future removal.  Please contact the
+mailing list if you use this function.
+
+*** Deprecated ~org-return-indent~ function
+
+In Elisp code, use ~(org-return t)~ instead.  Interactively, =C-j= is
+now bound to ~org-return-and-maybe-indent~, which indents the new line
+when ~electric-indent-mode~ is disabled.
+
+*** Removed ~org-maybe-keyword-time-regexp~
+
+The variable was not used in the code base.
+
+*** Removed ~org-export-special-keywords~
+
+The variable was not used in the code base.
+
+*** Renamed ~org-at-property-block-p~
+
+The new name is ~org-at-property-drawer-p~, which is less confusing.
+
+*** Renamed ~org-columns-set-tags-or-toggle~
+
+See [[*~org-columns-toggle-or-columns-quit~]].
+
+*** Renamed priority options
+
+From ~org-lowest-priority~ to ~org-priority-lowest~.
+From ~org-default-priority~ to ~org-priority-default~.
+From ~org-highest-priority~ to ~org-priority-highest~.
+From ~org-enable-priority-commands~ to ~org-priority-enable-commands~.
+From ~org-show-priority~ to ~org-priority-show~.
+
+** Miscellaneous
+*** =ob-screen.el= now respects screen =:session= name
+
+Screen babel session are now named based on the =:session= header
+argument (defaults to ~default~).
+
+Previously all session names had  ~org-babel-session-~ prepended.
+
+*** Forward/backward paragraph functions in line with the rest of Emacs
+
+~org-forward-paragraph~ and ~org-backward-paragraph~, bound to
+~<C-UP>~ and ~<C-DOWN>~ functions mimic more closely behaviour of
+~forward-paragraph~ and ~backward-paragraph~ functions when
+available.
+
+They also accept an optional argument for multiple calls.
+
+See their docstring for details.
+*** ~org-table-to-lisp~ no longer checks if point is at a table
+
+The caller is now responsible for the check.  It can use, e.g.,
+~org-at-table-p~.
+
+The function is also much more efficient than it used to be, even on
+very large tables.
+
+*** New function ~org-collect-keywords~
+*** Drawers' folding use an API similar to block's
+
+Tooling for folding drawers interactively or programmatically is now
+on par with block folding.  In particular, ~org-hide-drawer-toggle~,
+a new function, is the central place for drawer folding.
+
+*** Duration can be read and written in compact form
+
+~org-duration-to-minutes~ understands =1d3h5min= as a duration,
+whereas ~org-duration-from-minutes~ can output this compact form if
+the duration format contains the symbol ~compact~.
+
+*** C-n, C-p, SPC and DEL in agenda commands dispatch window
+
+You can now use =<C-n>=, =<C-p>=, =<SPC>= and =<DEL>= key to scroll up
+and down the agenda and attach dispatch window.
+
+*** =<C-c C-c>= in agenda calls ~org-agenda-set-tags~
+
+Both =<C-c C-q>= and =<C-c C-c>= set the tags of the headline in the
+Org buffer.  Both keybindings are now available from the agenda too.
+
+*** Allow to use an empty HTML extension
+
+Using =(setq org-html-extension "")= or setting the HTML extension in
+any fashion will produce the expected output, with no trailing period
+to the resulting HTML file.
+
+*** Handle repeated tasks with =.+= type and hours step
+
+A task using a =.+= repeater and hours step is repeated starting from
+now. E.g.,
+
+#+begin_example
+,,** TODO Wash my hands
+   DEADLINE: <2019-04-05 08:00 Sun .+1h>
+   Marking this DONE shifts the date to exactly one hour from now.
+#+end_example
+
+*** The format of equation reference in HTML export can now be specified
+
+By default, HTML (via MathJax) and LaTeX export equation references
+using different commands. LaTeX must use ~\ref{%s}~ because it is used
+for all labels; however, HTML (via MathJax) uses ~\eqref{%s}~ for
+equations producing inconsistent output. New option
+~org-html-equation-reference-format~ sets the command used in HTML
+export.
+
+*** =ob-haskell.el= supports compilation with =:compile= header argument
+
+By default, Haskell blocks are interpreted. By adding =:compile yes=
+to a Haskell source block, it will be compiled, executed and the
+results will be displayed.
+
+*** Support for ~org-edit-special~ with LaTeX fragments
+
+Calling ~org-edit-special~ on an inline LaTeX fragment calls a new
+function, ~org-edit-latex-fragment~. This functions in a comparable
+manner to editing inline source blocks, bringing up a minibuffer set
+to LaTeX mode. The math-mode deliminators are read only.
+
+*** ~org-capture-current-plist~ is now accessible during 
~org-capture-mode-hook~
+*** New =org-refile.el= file
+
+Org refile variables and functions have been moved to a new file.
+
+*** The end of a 7 years old bug
+
+This bug 
[[https://lists.gnu.org/archive/html/emacs-orgmode/2013-08/msg00072.html][originally
 reported]] by Matt Lundin and investigated by Andrew
+Hyatt has been fixed.  Thanks to both of them.
+
 * Version 9.3
 
 ** Incompatible changes
@@ -19,15 +559,11 @@ Org used to percent-encode sensitive characters in the URI 
part of the
 bracket links.
 
 Now, escaping mechanism uses the usual backslash character, according
-to the following rules, applied in order:
+to the following rules:
 
-1. All consecutive =\= characters at the end of the link must be
-   escaped;
-2. Any =]= character at the very end of the link must be escaped;
-3. All consecutive =\= characters preceding =][= or =]]= patterns must
-   be escaped;
-4. Any =]= character followed by either =[= or =]= must be escaped;
-5. Others =]= and =\= characters need not be escaped.
+1. All =[= and =]= characters in the URI must be escaped;
+2. Every =\= character preceding either =[= or =]= must be escaped;
+3. Every =\= character at the end of the URI must be escaped.
 
 When in doubt, use the function ~org-link-escape~ in order to turn
 a link string into its properly escaped form.
@@ -141,7 +677,7 @@ Export ignore done tasks with a deadline when
 Likewise, scheduled done tasks are also ignored when
 ~org-icalendar-use-scheduled~ contains the same symbol.
 
-*** Add split-window-right option for src block edit window placement
+*** Add ~split-window-right~ option for src block edit window placement
 
 Given the increasing popularity of wide screen monitors, splitting
 horizontally may make more sense than splitting vertically.  An
@@ -364,7 +900,6 @@ the headline to use for making the table of contents.
 ,* Another section
 ,#+TOC: headlines 1 :target "#TargetSection"
 #+end_example
-
 ** New functions
 *** ~org-dynamic-block-insert-dblock~
 
@@ -474,6 +1009,16 @@ I.e. treat the whole file as if it was a subtree.
 
 *** Respect narrowing when agenda command is restricted to buffer
 
+*** ~org-table-insert-column~ inserts the column at point position
+
+Before, the new column was inserted to the right of the column at
+point position.
+
+*** Table column deletion now consistent with row deletion
+
+Point stays in the column at deletion, except when deleting the
+rightmost column.
+
 * Version 9.2
 ** Incompatible changes
 *** Removal of OrgStruct mode mode and radio lists
@@ -484,7 +1029,7 @@ and ~org-list-radio-lists-templates~) are removed from the 
code base.
 Note that only radio /lists/ have been removed, not radio tables.
 
 If you want to manipulate lists like in Org in other modes, we suggest
-to use orgalist.el, which you can install from GNU ELPA.
+to use =orgalist.el=, which you can install from GNU ELPA.
 
 If you want to use Org folding outside of Org buffers, you can have a
 look at the outshine package in the MELPA repository.
@@ -1276,9 +1821,9 @@ removed from Gnus circa September 2010.
 
 *** ~org-agenda-repeating-timestamp-show-all~ is removed.
 
-For an equivalent to a ~nil~ value, set
+For an equivalent to a =nil= value, set
 ~org-agenda-show-future-repeats~ to nil and
-~org-agenda-prefer-last-repeat~ to ~t~.
+~org-agenda-prefer-last-repeat~ to =t=.
 
 *** ~org-gnus-nnimap-query-article-no-from-file~ is removed.
 
@@ -1296,7 +1841,7 @@ equivalent to the removed format string.
 
 *** ~org-enable-table-editor~ is removed.
 
-Setting it to a ~nil~ value broke some other features (e.g., speed
+Setting it to a =nil= value broke some other features (e.g., speed
 keys).
 
 *** ~org-export-use-babel~ cannot be set to ~inline-only~
@@ -1377,16 +1922,20 @@ is now obsolete.
 
 Now ~=...=~ markup uses ~@samp{}~ instead of ~@verb{}~.  You can use
 ~@verb{}~ again by customizing the variable.
+
 *** Texinfo exports example blocks as ~@example~
 *** Texinfo exports inline source blocks as ~@code{}~
 *** Texinfo default table markup is ~@asis~
+
 It used to be ~@samp~ but ~@asis~ is neutral and, therefore, more
 suitable as a default value.
+
 *** Texinfo default process includes ~--no-split~ option
 *** New entities : ~\dollar~ and ~\USD~
 *** Support for date style URLs in =org-protocol://open-source=
-    URLs like =https://cool-blog.com/2017/05/20/cool-post/= are
-    covered by rewrite rules.
+
+URLs like =https://cool-blog.com/2017/05/20/cool-post/= are covered by
+rewrite rules.
 
 *** Add (C) =COMMENT= support to ~org-structure-template-alist~
 
@@ -1476,7 +2025,7 @@ Moreover, ~:export-block~ keyword used in 
~org-export-define-backend~ and
 ~org-export-define-derived-backend~ is no longer used and needs to be
 removed.
 
-*** Footnotes
+*** Footnotes changes
 
 **** [1]-like constructs are not valid footnotes
 
@@ -2216,7 +2765,7 @@ without changing the headline.
 
 *** Hierarchies of tags
 
-The functionality of nesting tags in hierarchies is added to org-mode.
+The functionality of nesting tags in hierarchies is added to Org mode.
 This is the generalization of what was previously called "Tag groups"
 in the manual.  That term is now changed to "Tag hierarchy".
 
@@ -4105,7 +4654,7 @@ See https://orgmode.org/elpa/
 
      You can temporarily activate continuous clocking with =C-u C-u
      C-u M-x= [[doc::org-clock-in][org-clock-in]] =RET= (three universal 
prefix arguments)
-     and =C-u C-u M-x= [[org-clock-in-last][org-clock-in-last]] =RET= (two 
universal prefix
+     and =C-u C-u M-x= [[doc::org-clock-in-last][org-clock-in-last]] =RET= 
(two universal prefix
      arguments).
 
 
@@ -4581,7 +5130,7 @@ that Calc formulas can operate on them.
 
     The new system has a technically cleaner implementation and more
     possibilities for capturing different types of data.  See
-    
[[http://thread.gmane.org/gmane.emacs.orgmode/26441/focus%3D26441][Carsten's 
announcement]] for more details.
+    
[[https://orgmode.org/list/C46F10DC-DE51-43D4-AFFE-F71E440D1E1F@gmail.com][Carsten's
 announcement]] for more details.
 
     To switch over to the new system:
 
@@ -4712,7 +5261,7 @@ that Calc formulas can operate on them.
 
 **** Modified link escaping
 
-     David Maus worked on `org-link-escape'.  See 
[[http://article.gmane.org/gmane.emacs.orgmode/37888][his message]]:
+     David Maus worked on `org-link-escape'.  See 
[[https://orgmode.org/list/87k4gysacq.wl%dmaus@ictsoc.de][his message]]:
 
      : Percent escaping is used in Org mode to escape certain characters
      : in links that would either break the parser (e.g. square brackets
@@ -5151,7 +5700,7 @@ that Calc formulas can operate on them.
 
      Thanks to Nicolas Goaziou for coding these changes.
 
-**** A property value of "nil" now means to unset a property
+**** A property value of =nil= now means to unset a property
 
      This can be useful in particular with property inheritance, if
      some upper level has the property, and some grandchild of it
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index f24c6f0..25e129b 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -1,6 +1,6 @@
 Known Problems with GNU Emacs
 
-Copyright (C) 1987-1989, 1993-1999, 2001-2020 Free Software Foundation,
+Copyright (C) 1987-1989, 1993-1999, 2001-2021 Free Software Foundation,
 Inc.
 See the end of the file for license conditions.
 
diff --git a/etc/README b/etc/README
index b9b4bc4..6d7a15a 100644
--- a/etc/README
+++ b/etc/README
@@ -7,5 +7,5 @@ COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES
 
 File: emacs.icon
   Author: Sun Microsystems, Inc
-  Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1999, 2001-2021 Free Software Foundation, Inc.
   License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/TERMS b/etc/TERMS
index 20c0a9a..80b39c8 100644
--- a/etc/TERMS
+++ b/etc/TERMS
@@ -1,4 +1,4 @@
-Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1999, 2001-2021 Free Software Foundation, Inc.
 See the end of the file for copying permissions.
 
 This file describes what you must or might want to do to termcap entries
diff --git a/etc/TODO b/etc/TODO
index 8e93e7f..9448617 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -1,6 +1,6 @@
 Emacs TODO List                                                   -*-outline-*-
 
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
@@ -242,6 +242,36 @@ https://lists.gnu.org/r/emacs-devel/2013-11/msg00515.html
     processing.  That is why we added text properties and variable
     width fonts.  However, more features are still needed to achieve this.
 
+Specifically, a major mode with the following features and abilities
+should be added to Emacs:
+
+ . import / export MS Office documents
+ . import / export Open Document Format (.odt) files
+ . import / export RTF files
+ . export to a PDF file
+ . select a font and its size
+ . apply a bold / italic / underline / strikethrough effect
+ . superscripts / subscripts
+ . apply a left / center / right / justified effect
+ . change the font color and the background color
+ . pixel-level text fill, justification, and indentation (so that
+   variable-pitch fonts could be freely used)
+ . create a list
+ . insert and change a table
+ . insert a picture
+ . define / use / modify styles
+ . print preview / print, in a way that is similar to what's on screen
+   (e.g., wrt the place where lines wrap)
+ . use footnotes
+ . support for "track changes" markings, including those which come
+   from Office documents
+ . multiple columns
+ . change page headers and footers
+ . save all the properties and settings mentioned above with the text
+   to a file, so that they are restored when later visiting that file
+
+The existing Enriched mode can be used as a starting point.
+
 ** Support ligatures out of the box
 For the list of frequently-used typographical ligatures, see
 
@@ -536,6 +566,42 @@ This should go with point, so that motion commands can 
also move
 through tall images.  This value would be to point as window-vscroll
 is to window-start.
 
+** Make redisplay smarter about which parts to redraw
+Currently, redisplay has only 2 levels of redrawing: either it
+redisplays only the selected window on the selected frame, or it
+redisplays all the windows on all the frames.  This doesn't scale well
+when the number of visible frames is large.
+
+Currently, two variables are used to make the decision what to
+redisplay: update_mode_lines and windows_or_buffers_changed.  These
+are set by various functions called from Lisp, and if redisplay finds
+one of them to be non-zero, it considers all the windows on all the
+frames for redisplay.
+
+The idea is to make the decision which parts need to be redrawn more
+fine-grained.  Instead of simple boolean variables, we could have a
+bitmapped variable which records the kinds of changes done by Lisp
+since the previous redisplay cycle.  Then the decision what exactly
+needs to be redrawn could be made based on the bits that are set.
+
+For example, one reason to consider all frames is that some scrolling
+command sets the update_mode_lines variable non-zero.  This is done
+because the frame title, which doesn't belong to any window, needs to
+be reconsidered when the selected window is scrolled.  But considering
+the frame title doesn't have to redisplay all the other windows on the
+frame, doesn't need to recompute the menu items and the tool-bar
+buttons, and doesn't need to consider frames other than the selected
+one.  Being selective about what parts of the Emacs display need to be
+reconsidered and redrawn given the changes since the last redisplay
+will go along way towards making redisplay more scalable.
+
+One way of making this change is to go through all the places that set
+update_mode_lines and windows_or_buffers_changed, figure out which
+portions of the Emacs display could be affected by each change, and
+then implement the bitmap which will record each of these affected
+display portions.  The logic in redisplay_internal will then need to
+be restructured so as to support this fine-grained redisplay.
+
 ** Address internationalization of symbols names
 Essentially as if they were documentation, e.g. in command names and
 Custom.
@@ -572,8 +638,6 @@ Do this for some or all errors associated with using 
subprocesses.
 ** Maybe reinterpret 'parse-error' as a category of errors
 Put some other errors under it.
 
-** Make byte-compiler warn when a doc string is too wide
-
 ** Make byte-optimization warnings issue accurate line numbers
 
 ** Record the sxhash of the default value for customized variables
diff --git a/etc/charsets/README b/etc/charsets/README
index 3312367..0045a0f 100644
--- a/etc/charsets/README
+++ b/etc/charsets/README
@@ -1,6 +1,6 @@
 # README file for charset mapping files in this directory.
 
-# Copyright (C) 2003-2020 Free Software Foundation, Inc.
+# Copyright (C) 2003-2021 Free Software Foundation, Inc.
 # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 #   National Institute of Advanced Industrial Science and Technology (AIST)
 #   Registration Number H13PRO009
diff --git a/etc/compilation.txt b/etc/compilation.txt
index 7e40638..e56d3b6 100644
--- a/etc/compilation.txt
+++ b/etc/compilation.txt
@@ -676,7 +676,7 @@ Compilation segmentation fault at Thu Jul 13 10:55:49
 Compilation finished at Thu Jul 21 15:02:15
 
 
-Copyright (C) 2004-2020 Free Software Foundation, Inc.
+Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 COPYING PERMISSIONS:
 
diff --git a/etc/edt-user.el b/etc/edt-user.el
index 2852f93..8e1a599 100644
--- a/etc/edt-user.el
+++ b/etc/edt-user.el
@@ -1,6 +1,6 @@
 ;;; edt-user.el --- Sample user customizations for Emacs EDT emulation -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1986, 1992-1993, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1986, 1992-1993, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Kevin Gallagher <kevin.gal@verizon.net>
diff --git a/etc/emacs-buffer.gdb b/etc/emacs-buffer.gdb
index e237742..41af836 100644
--- a/etc/emacs-buffer.gdb
+++ b/etc/emacs-buffer.gdb
@@ -1,6 +1,6 @@
 # emacs-buffer.gdb --- gdb macros for recovering buffers from emacs coredumps
 
-# Copyright (C) 2005-2020 Free Software Foundation, Inc.
+# Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 # Author: Noah Friedman <friedman@splode.com>
 # Created: 2005-04-28
diff --git a/etc/emacs.appdata.xml b/etc/emacs.appdata.xml
index 1b5d7f9..ca6233a 100644
--- a/etc/emacs.appdata.xml
+++ b/etc/emacs.appdata.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2014-2020 Free Software Foundation, Inc. -->
+<!-- Copyright (C) 2014-2021 Free Software Foundation, Inc. -->
 <component type="desktop-application">
  <id>org.gnu.emacs</id>
  <metadata_license>GFDL-1.3+</metadata_license>
diff --git a/etc/emacs.service b/etc/emacs.service
index c99c677..809c49c 100644
--- a/etc/emacs.service
+++ b/etc/emacs.service
@@ -9,7 +9,11 @@ Documentation=info:emacs man:emacs(1) 
https://gnu.org/software/emacs/
 [Service]
 Type=notify
 ExecStart=emacs --fg-daemon
-ExecStop=emacsclient --eval "(kill-emacs)"
+
+# Emacs will exit with status 15 after having received SIGTERM, which
+# is the default "KillSignal" value systemd uses to stop services.
+SuccessExitStatus=15
+
 # The location of the SSH auth socket varies by distribution, and some
 # set it from PAM, so don't override by default.
 # Environment=SSH_AUTH_SOCK=%t/keyring/ssh
diff --git a/etc/enriched.txt b/etc/enriched.txt
index 1e1dc46..dd269e3 100644
--- a/etc/enriched.txt
+++ b/etc/enriched.txt
@@ -253,7 +253,7 @@ it.</indent>
 
 
 
-Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 
 COPYING PERMISSIONS:
 
diff --git a/etc/forms/forms-d2.el b/etc/forms/forms-d2.el
index 1b0d642..cd4231c 100644
--- a/etc/forms/forms-d2.el
+++ b/etc/forms/forms-d2.el
@@ -1,6 +1,6 @@
 ;;; forms-d2.el --- demo forms-mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1991, 1994-1997, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1991, 1994-1997, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Johan Vromans <jvromans@squirrel.nl>
diff --git a/etc/gnus-tut.txt b/etc/gnus-tut.txt
index 2001b91..27e868b 100644
--- a/etc/gnus-tut.txt
+++ b/etc/gnus-tut.txt
@@ -24,7 +24,7 @@ was done by moi, yours truly, your humble servant, Lars Magne
 Ingebrigtsen.  If you have a WWW browser, you can investigate to your
 heart's delight at <URL:http://www.ifi.uio.no/~larsi/larsi.html>.
 
-;; Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
 ;; Keywords: news
diff --git a/etc/grep.txt b/etc/grep.txt
index 19a3b4b..b5b7845 100644
--- a/etc/grep.txt
+++ b/etc/grep.txt
@@ -85,6 +85,12 @@ git --no-pager grep -inH -p -e "org-element-map"
 lisp/org/org.el=20969=(defun org-fill-paragraph (&optional 
justify)
 lisp/org/org.el:21047:               (org-element-map
 
+* ripgrep
+
+rg -nH --color always --no-heading -e grep-match-regexp
+lisp/progmodes/grep.el:608:        (while 
(re-search-forward grep-match-regexp end 1)
+Binary file emacs.info matches (found "\u{0}" byte around offset 2222525)
+
 * unknown greps
 
 grep -nH -e "xyzxyz" ../info/*
@@ -97,7 +103,7 @@ grep -nH -e "xyzxyz" ../info/*
 
 
 
-Copyright (C) 2005-2020 Free Software Foundation, Inc.
+Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 COPYING PERMISSIONS:
 
diff --git a/etc/images/README b/etc/images/README
index 2cee207..00aac4f 100644
--- a/etc/images/README
+++ b/etc/images/README
@@ -27,19 +27,19 @@ COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES
 
 File: mh-logo.xpm
   Author: Satyaki Das
-  Copyright (C) 2003-2020 Free Software Foundation, Inc.
+  Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 Files: gnus.pbm
   Author: Luis Fernandes <elf@ee.ryerson.ca>
-  Copyright (C) 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 Files: splash.png, splash.svg, splash.pbm, splash.xpm
   Author: Francesc Rocher <francesc.rocher@gmail.com>
-  Copyright (C) 2008-2020 Free Software Foundation, Inc.
+  Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 Files: checked.xpm, unchecked.xpm
   Author: Chong Yidong <cyd@stupidchicken.com>
-  Copyright (C) 2010-2020 Free Software Foundation, Inc.
+  Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 
 * The following icons are from GTK+ 2.x. They are not part of Emacs, but
diff --git a/etc/images/checked.xpm b/etc/images/checked.xpm
index 9f60b36..3e7e76f 100644
--- a/etc/images/checked.xpm
+++ b/etc/images/checked.xpm
@@ -1,5 +1,5 @@
 /* XPM */
-/* Copyright (C) 2010-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2021 Free Software Foundation, Inc.
  *
  * Author: Chong Yidong <cyd@stupidchicken.com>
  *
diff --git a/etc/images/custom/README b/etc/images/custom/README
index 7eb87c4..fc9cd8d 100644
--- a/etc/images/custom/README
+++ b/etc/images/custom/README
@@ -6,5 +6,5 @@ COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES
 
 Files: down.xpm down-pushed.xpm right.xpm right-pushed.xpm
 Author: Juri Linkov
-Copyright (C) 2008-2020 Free Software Foundation, Inc.
+Copyright (C) 2008-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/ezimage/README b/etc/images/ezimage/README
index 2aef056..865ce5b 100644
--- a/etc/images/ezimage/README
+++ b/etc/images/ezimage/README
@@ -7,5 +7,5 @@ Files: bits.xpm bitsbang.xpm box-minus.xpm box-plus.xpm
        tag-gt.xpm tag-minus.xpm tag-plus.xpm tag-type.xpm tag-v.xpm
        tag.xpm unlock.xpm
 Author: Eric M. Ludlam
-Copyright (C) 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1999-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/gnus/README b/etc/images/gnus/README
index f9c51f0..4acfc0c 100644
--- a/etc/images/gnus/README
+++ b/etc/images/gnus/README
@@ -7,7 +7,7 @@ COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES
 
 Files: important.xpm, unimportant.xpm
 Author: Simon Josefsson <simon@josefsson.org>
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 Files: catchup.pbm catchup.xpm cu-exit.pbm cu-exit.xpm
   describe-group.pbm describe-group.xpm exit-gnus.pbm exit-gnus.xpm
@@ -21,11 +21,11 @@ Files: catchup.pbm catchup.xpm cu-exit.pbm cu-exit.xpm
   unsubscribe.pbm unsubscribe.xpm uu-decode.pbm uu-decode.xpm
   uu-post.pbm uu-post.xpm
 Author: Luis Fernandes <elf@ee.ryerson.ca>
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 Files: gnus.png, gnus.svg
   Author: Francesc Rocher <rocher@member.fsf.org>
-  Copyright (C) 2008-2020 Free Software Foundation, Inc.
+  Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 
 * The following icons are from GNOME 2.x. They are not part of Emacs,
diff --git a/etc/images/gnus/gnus.svg b/etc/images/gnus/gnus.svg
index 7514f34..362dc16 100644
--- a/etc/images/gnus/gnus.svg
+++ b/etc/images/gnus/gnus.svg
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!-- Gnu Emacs Logo
 
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    Author: Francesc Rocher <f.rocher@member.fsf.org>
 
diff --git a/etc/images/gud/README b/etc/images/gud/README
index 4bf11ec..0ef5258 100644
--- a/etc/images/gud/README
+++ b/etc/images/gud/README
@@ -1,7 +1,7 @@
 COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES
 
 The following icons were created by Nick Roberts <nickrob@snap.net.nz>.
-Copyright (C) 2002-2020 Free Software Foundation, Inc.
+Copyright (C) 2002-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
 
   break.pbm, nexti.pbm, go.pbm, pp.pbm, print.pbm, pstar.pbm, remove.pbm
@@ -31,7 +31,7 @@ their copyright assignment included the icons.
 The following icons are converted from the Insight Windows style icon
 set in src/gdb/gdbtk/library/images2.
 
-Copyright (C) 2002-2020 Free Software Foundation, Inc.
+Copyright (C) 2002-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
 
   cont.pbm and cont.xpm were converted from continue.gif
@@ -47,7 +47,7 @@ License: GNU General Public License version 3 or later (see 
COPYING)
 The following icons are created from the Insight Windows style icon
 set in src/gdb/gdbtk/library/images2.
 
-Copyright (C) 2002-2020 Free Software Foundation, Inc.
+Copyright (C) 2002-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
 
   rcont.xpm rfinish.xpm
diff --git a/etc/images/icons/README b/etc/images/icons/README
index ee25f4a..a0a2e93 100644
--- a/etc/images/icons/README
+++ b/etc/images/icons/README
@@ -6,7 +6,7 @@ Files: hicolor/16x16/apps/emacs.png hicolor/24x24/apps/emacs.png
        hicolor/scalable/mimetypes/emacs-document.svg
 
 Author: Nicolas Petton <nicolas@petton.fr>
-Copyright (C) 2015-2020 Free Software Foundation, Inc.
+Copyright (C) 2015-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
 
 Files: hicolor/16x16/apps/emacs23.png hicolor/24x24/apps/emacs23.png
@@ -14,7 +14,7 @@ Files: hicolor/16x16/apps/emacs23.png 
hicolor/24x24/apps/emacs23.png
        hicolor/128x128/apps/emacs23.png hicolor/scalable/apps/emacs23.svg
 
 Author: Kentaro Ohkouchi <nanasess@fsm.ne.jp>
-Copyright (C) 2007-2020 Free Software Foundation, Inc.
+Copyright (C) 2007-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
 
 
@@ -22,7 +22,7 @@ Files: hicolor/16x16/apps/emacs22.png 
hicolor/24x24/apps/emacs22.png
        hicolor/32x32/apps/emacs22.png hicolor/48x48/apps/emacs22.png
 
 Author: Andrew Zhilin <andrew_zhilin@yahoo.com>
-Copyright (C) 2005-2020 Free Software Foundation, Inc.
+Copyright (C) 2005-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
 
 Files: allout-widgets-dark-bg/closed.png
@@ -71,5 +71,5 @@ Files: allout-widgets-dark-bg/closed.png
        allout-widgets-light-bg/through-descender.xpm
 
 Author: Ken Manheimer <ken.manheimer@gmail.com>
-Copyright (C) 2011-2020 Free Software Foundation, Inc.
+Copyright (C) 2011-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/icons/hicolor/scalable/apps/emacs.svg 
b/etc/images/icons/hicolor/scalable/apps/emacs.svg
index 902ee9d..a2bc441 100644
--- a/etc/images/icons/hicolor/scalable/apps/emacs.svg
+++ b/etc/images/icons/hicolor/scalable/apps/emacs.svg
@@ -15,7 +15,7 @@
      id="metadata70"><rdf:RDF><cc:Work
          rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage"; 
/><dc:title></dc:title></cc:Work></rdf:RDF></metadata><!-- Gnu Emacs Icon
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    Author: Nicolas Petton <nicolas@petton.fr>
 
diff --git a/etc/images/icons/hicolor/scalable/apps/emacs23.svg 
b/etc/images/icons/hicolor/scalable/apps/emacs23.svg
index 6365a4d..31db7b9 100644
--- a/etc/images/icons/hicolor/scalable/apps/emacs23.svg
+++ b/etc/images/icons/hicolor/scalable/apps/emacs23.svg
@@ -10,7 +10,7 @@
    id="svg4768"
    xml:space="preserve">
 <!-- Gnu Emacs Icon
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This file is part of GNU Emacs.
 
diff --git a/etc/images/icons/hicolor/scalable/mimetypes/emacs-document23.svg 
b/etc/images/icons/hicolor/scalable/mimetypes/emacs-document23.svg
index bd3f0c0..b11c5bd 100644
--- a/etc/images/icons/hicolor/scalable/mimetypes/emacs-document23.svg
+++ b/etc/images/icons/hicolor/scalable/mimetypes/emacs-document23.svg
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!-- Gnu Emacs Document Icon
 
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This file is part of GNU Emacs.
 
diff --git a/etc/images/mh-logo.xpm b/etc/images/mh-logo.xpm
index 97848e0..fd7598d 100644
--- a/etc/images/mh-logo.xpm
+++ b/etc/images/mh-logo.xpm
@@ -1,7 +1,7 @@
 /* XPM */
 /* MH-E Logo
  *
- * Copyright (C) 2003-2020 Free Software Foundation, Inc.
+ * Copyright (C) 2003-2021 Free Software Foundation, Inc.
  *
  * Author: Satyaki Das
  *
diff --git a/etc/images/mpc/README b/etc/images/mpc/README
index 709ae07..30e9ac0 100644
--- a/etc/images/mpc/README
+++ b/etc/images/mpc/README
@@ -2,5 +2,5 @@ COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES
 
 Files: add.xpm ffwd.xpm next.xpm pause.xpm play.xpm prev.xpm rewind.xpm 
stop.xpm
 Author: Stefan Monnier <monnier@iro.umontreal.ca>
-Copyright (C) 2009-2020 Free Software Foundation, Inc.
+Copyright (C) 2009-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/newsticker/README b/etc/images/newsticker/README
index 3adf691..30ecabb 100644
--- a/etc/images/newsticker/README
+++ b/etc/images/newsticker/README
@@ -4,5 +4,5 @@ Files: browse-url.xpm get-all.xpm mark-immortal.xpm 
mark-read.xpm
        narrow.xpm next-feed.xpm next-item.xpm prev-feed.xpm
        prev-item.xpm rss-feed.png rss-feed.svg update.xpm
 Author: Ulf Jasper
-Copyright (C) 2011-2020 Free Software Foundation, Inc.
+Copyright (C) 2011-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/smilies/README b/etc/images/smilies/README
index 1563845..9fddcfb 100644
--- a/etc/images/smilies/README
+++ b/etc/images/smilies/README
@@ -3,5 +3,5 @@ Files: blink.pbm blink.xpm braindamaged.xpm cry.xpm dead.xpm 
evil.xpm
        sad.xpm smile.pbm smile.xpm wry.pbm wry.xpm
 Authors: Reiner Steib, Simon Josefsson, Kai Grossjohann, Alex
          Schroeder, Oliver Scholz, Per Abrahamsen, Kim F. Storm.
-Copyright (C) 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1999-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/smilies/grayscale/README 
b/etc/images/smilies/grayscale/README
index c2b0949..5d15f3c 100644
--- a/etc/images/smilies/grayscale/README
+++ b/etc/images/smilies/grayscale/README
@@ -3,5 +3,5 @@ Files: blink.xpm braindamaged.xpm cry.xpm dead.xpm evil.xpm 
forced.xpm
        frown.xpm grin.xpm indifferent.xpm reverse-smile.xpm sad.xpm
        smile.xpm wry.xpm
 Author: Adam Sjøgren
-Copyright (C) 2007-2020 Free Software Foundation, Inc.
+Copyright (C) 2007-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/smilies/medium/README b/etc/images/smilies/medium/README
index c2b0949..5d15f3c 100644
--- a/etc/images/smilies/medium/README
+++ b/etc/images/smilies/medium/README
@@ -3,5 +3,5 @@ Files: blink.xpm braindamaged.xpm cry.xpm dead.xpm evil.xpm 
forced.xpm
        frown.xpm grin.xpm indifferent.xpm reverse-smile.xpm sad.xpm
        smile.xpm wry.xpm
 Author: Adam Sjøgren
-Copyright (C) 2007-2020 Free Software Foundation, Inc.
+Copyright (C) 2007-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/splash.svg b/etc/images/splash.svg
index 5e3ac09..387ffad 100644
--- a/etc/images/splash.svg
+++ b/etc/images/splash.svg
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!-- Gnu Emacs Logo
 
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    Author: Francesc Rocher <francesc.rocher@gmail.com>
    Based on the original work by Luis Fernandes <elf@ee.ryerson.ca>
diff --git a/etc/images/tabs/README b/etc/images/tabs/README
index da149af..f1429ef 100644
--- a/etc/images/tabs/README
+++ b/etc/images/tabs/README
@@ -4,5 +4,5 @@ COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES
 
 Files: close.xpm new.xpm left-arrow.xpm right-arrow.xpm
 Author: Juri Linkov <juri@linkov.net>
-Copyright (C) 2019-2020 Free Software Foundation, Inc.
+Copyright (C) 2019-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/tree-widget/default/README 
b/etc/images/tree-widget/default/README
index 2a7772e..a0c9c8e 100644
--- a/etc/images/tree-widget/default/README
+++ b/etc/images/tree-widget/default/README
@@ -5,5 +5,5 @@ Files: close.png close.xpm empty.png empty.xpm end-guide.png 
end-guide.xpm
        no-guide.png no-guide.xpm no-handle.png no-handle.xpm open.png
        open.xpm
 Author: David Ponce <david.ponce@wanadoo.fr>
-Copyright (C) 2004-2020 Free Software Foundation, Inc.
+Copyright (C) 2004-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/tree-widget/folder/README 
b/etc/images/tree-widget/folder/README
index 5af0e9b..2a9c8a2 100644
--- a/etc/images/tree-widget/folder/README
+++ b/etc/images/tree-widget/folder/README
@@ -5,5 +5,5 @@ Files:  close.png close.xpm empty.png empty.xpm end-guide.png
         leaf.png leaf.xpm no-guide.png no-guide.xpm no-handle.png
         no-handle.xpm open.png open.xpm
 Author: David Ponce <david.ponce@wanadoo.fr>
-Copyright (C) 2004-2020 Free Software Foundation, Inc.
+Copyright (C) 2004-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
diff --git a/etc/images/unchecked.xpm b/etc/images/unchecked.xpm
index 128fcd1..5e18534 100644
--- a/etc/images/unchecked.xpm
+++ b/etc/images/unchecked.xpm
@@ -1,5 +1,5 @@
 /* XPM */
-/* Copyright (C) 2010-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2021 Free Software Foundation, Inc.
  *
  * Author: Chong Yidong <cyd@stupidchicken.com>
  *
diff --git a/etc/org/README b/etc/org/README
index 100c577..07126fc 100644
--- a/etc/org/README
+++ b/etc/org/README
@@ -1,7 +1,7 @@
 The files OrgOdtContentTemplate.xml and OrgOdtStyles.xml have the
 following copyright information:
 
-Copyright (C) 2010-2020 Free Software Foundation, Inc.
+Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 These files are part of GNU Emacs.
 
diff --git a/etc/ps-prin0.ps b/etc/ps-prin0.ps
index d5f8a5e..7204666 100644
--- a/etc/ps-prin0.ps
+++ b/etc/ps-prin0.ps
@@ -1,7 +1,7 @@
 % === BEGIN ps-print prologue 0
 % version: 6.0
 
-% Copyright (C) 2000-2020 Free Software Foundation, Inc.
+% Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 % This file is part of GNU Emacs.
 
diff --git a/etc/ps-prin1.ps b/etc/ps-prin1.ps
index f68174b..d565e33 100644
--- a/etc/ps-prin1.ps
+++ b/etc/ps-prin1.ps
@@ -1,7 +1,7 @@
 % === BEGIN ps-print prologue 1
 % version: 6.1
 
-% Copyright (C) 2000-2020 Free Software Foundation, Inc.
+% Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 % This file is part of GNU Emacs.
 
diff --git a/etc/publicsuffix.txt b/etc/publicsuffix.txt
index bcde672..1ede2b9 100644
--- a/etc/publicsuffix.txt
+++ b/etc/publicsuffix.txt
@@ -1152,7 +1152,7 @@ gov.gr
 // gs : https://en.wikipedia.org/wiki/.gs
 gs
 
-// gt : http://www.gt/politicas_de_registro.html
+// gt : https://www.gt/sitio/registration_policy.php?lang=en
 gt
 com.gt
 edu.gt
@@ -4703,6 +4703,7 @@ nl
 // Norid geographical second level domains : 
https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-b/
 // Norid category second level domains : 
https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-c/
 // Norid category second-level domains managed by parties other than Norid : 
https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-d/
+// RSS feed: https://teknisk.norid.no/en/feed/
 no
 // Norid category second level domains : 
https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-c/
 fhs.no
@@ -7110,7 +7111,7 @@ org.zw
 
 // newGTLDs
 
-// List of new gTLDs imported from 
https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 
2020-10-08T17:45:32Z
+// List of new gTLDs imported from 
https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 
2020-11-30T20:26:10Z
 // This list is auto-generated, don't edit it manually.
 // aaa : 2015-02-26 American Automobile Association, Inc.
 aaa
@@ -7328,7 +7329,7 @@ author
 // auto : 2014-11-13 XYZ.COM LLC
 auto
 
-// autos : 2014-01-09 DERAutos, LLC
+// autos : 2014-01-09 XYZ.COM LLC
 autos
 
 // avianca : 2015-01-08 Avianca Holdings S.A.
@@ -7337,7 +7338,7 @@ avianca
 // aws : 2015-06-25 Amazon Registry Services, Inc.
 aws
 
-// axa : 2013-12-19 AXA SA
+// axa : 2013-12-19 AXA Group Operations SAS
 axa
 
 // azure : 2014-12-18 Microsoft Corporation
@@ -7478,7 +7479,7 @@ bmw
 // bnpparibas : 2014-05-29 BNP Paribas
 bnpparibas
 
-// boats : 2014-12-04 DERBoats, LLC
+// boats : 2014-12-04 XYZ.COM LLC
 boats
 
 // boehringer : 2015-07-09 Boehringer Ingelheim International GmbH
@@ -7517,7 +7518,7 @@ bot
 // boutique : 2013-11-14 Binky Moon, LLC
 boutique
 
-// box : 2015-11-12 .BOX INC.
+// box : 2015-11-12 Intercap Registry Inc.
 box
 
 // bradesco : 2014-12-18 Banco Bradesco S.A.
@@ -8501,7 +8502,7 @@ homedepot
 // homegoods : 2015-07-16 The TJX Companies, Inc.
 homegoods
 
-// homes : 2014-01-09 DERHomes, LLC
+// homes : 2014-01-09 XYZ.COM LLC
 homes
 
 // homesense : 2015-07-16 The TJX Companies, Inc.
@@ -8651,9 +8652,6 @@ java
 // jcb : 2014-11-20 JCB Co., Ltd.
 jcb
 
-// jcp : 2015-04-23 JCP Media, Inc.
-jcp
-
 // jeep : 2015-07-30 FCA US LLC.
 jeep
 
@@ -9077,7 +9075,7 @@ moscow
 // moto : 2015-06-04 Motorola Trademark Holdings, LLC
 moto
 
-// motorcycles : 2014-01-09 DERMotorcycles, LLC
+// motorcycles : 2014-01-09 XYZ.COM LLC
 motorcycles
 
 // mov : 2014-01-30 Charleston Road Registry Inc.
@@ -9242,7 +9240,7 @@ one
 // ong : 2014-03-06 Public Interest Registry
 ong
 
-// onl : 2013-09-16 I-Registry Ltd.
+// onl : 2013-09-16 iRegistry GmbH
 onl
 
 // online : 2015-01-15 DotOnline Inc.
@@ -9539,7 +9537,7 @@ reviews
 // rexroth : 2015-06-18 Robert Bosch GMBH
 rexroth
 
-// rich : 2013-11-21 I-Registry Ltd.
+// rich : 2013-11-21 iRegistry GmbH
 rich
 
 // richardli : 2015-05-14 Pacific Century Asset Management (HK) Limited
@@ -9758,9 +9756,6 @@ show
 // showtime : 2015-08-06 CBS Domains Inc.
 showtime
 
-// shriram : 2014-01-23 Shriram Capital Ltd.
-shriram
-
 // silk : 2015-06-25 Amazon Registry Services, Inc.
 silk
 
@@ -10073,7 +10068,7 @@ travelers
 // travelersinsurance : 2015-03-26 Travelers TLD, LLC
 travelersinsurance
 
-// trust : 2014-10-16 NCC Group Domain Services, Inc.
+// trust : 2014-10-16 UNR Corp.
 trust
 
 // trv : 2015-03-26 Travelers TLD, LLC
@@ -10595,7 +10590,7 @@ vermögensberatung
 // xyz : 2013-12-05 XYZ.COM LLC
 xyz
 
-// yachts : 2014-01-09 DERYachts, LLC
+// yachts : 2014-01-09 XYZ.COM LLC
 yachts
 
 // yahoo : 2015-04-02 Yahoo! Domain Services Inc.
@@ -10680,12 +10675,6 @@ barsy.ca
 // Submitted by Werner Kaltofen <wk@all-inkl.com>
 kasserver.com
 
-// Algorithmia, Inc. : algorithmia.com
-// Submitted by Eli Perelman <eperelman@algorithmia.io>
-*.algorithmia.com
-!teams.algorithmia.com
-!test.algorithmia.com
-
 // Altervista: https://www.altervista.org
 // Submitted by Carlo Cannas <tech_staff@altervista.it>
 altervista.org
@@ -10868,6 +10857,10 @@ bnr.la
 // Submitted by Paul Crowder <paul.crowder@blackbaud.com>
 blackbaudcdn.net
 
+// Blatech : http://www.blatech.net
+// Submitted by Luke Bratch <luke@bratch.co.uk>
+of.je
+
 // Boomla : https://boomla.com
 // Submitted by Tibor Halter <thalter@boomla.com>
 boomla.net
@@ -10981,10 +10974,6 @@ c.la
 // Submitted by B. Blechschmidt <hostmaster@certmgr.org>
 certmgr.org
 
-// Citrix : https://citrix.com
-// Submitted by Alex Stoddard <alex.stoddard@citrix.com>
-xenapponazure.com
-
 // Civilized Discourse Construction Kit, Inc. : https://www.discourse.org/
 // Submitted by Rishabh Nambiar & Michael Brown <team@discourse.org>
 discourse.group
@@ -11073,10 +11062,6 @@ cloudns.pro
 cloudns.pw
 cloudns.us
 
-// Cloudeity Inc : https://cloudeity.com
-// Submitted by Stefan Dimitrov <contact@cloudeity.com>
-cloudeity.net
-
 // CNPY : https://cnpy.gdn
 // Submitted by Angelo Gladding <angelo@lahacker.net>
 cnpy.gdn
@@ -11537,6 +11522,10 @@ ddnss.org
 definima.net
 definima.io
 
+// DigitalOcean : https://digitalocean.com/
+// Submitted by Braxton Huggins <bhuggins@digitalocean.com>
+ondigitalocean.app
+
 // dnstrace.pro : https://dnstrace.pro/
 // Submitted by Chris Partridge <chris@partridge.tech>
 bci.dnstrace.pro
@@ -11802,6 +11791,10 @@ ukco.me
 // submitted by Koen Van Isterdael <k.vanisterdael@fermax.be>
 mydobiss.com
 
+// FH Muenster : https://www.fh-muenster.de
+// Submitted by Robin Naundorf <r.naundorf@fh-muenster.de>
+fh-muenster.io
+
 // Filegear Inc. : https://www.filegear.com
 // Submitted by Jason Zhu <jason@owtware.com>
 filegear.me
@@ -11872,6 +11865,7 @@ usercontent.jp
 gentapps.com
 gentlentapis.com
 lab.ms
+cdn-edges.net
 
 // GitHub, Inc.
 // Submitted by Patrick Toomey <security@github.com>
@@ -11931,9 +11925,10 @@ pagespeedmobilizer.com
 publishproxy.com
 withgoogle.com
 withyoutube.com
-cloudfunctions.net
+*.gateway.dev
 cloud.goog
 translate.goog
+cloudfunctions.net
 
 blogspot.ae
 blogspot.al
@@ -12056,6 +12051,10 @@ ravendb.me
 development.run
 ravendb.run
 
+// Hong Kong Productivity Council: https://www.hkpc.org/
+// Submitted by SECaaS Team <summchan@hkpc.org>
+secaas.hk
+
 // HOSTBIP REGISTRY : https://www.hostbip.com/
 // Submitted by Atanunu Igbunuroghene <publicsuffixlist@hostbip.com>
 bpl.biz
@@ -12165,7 +12164,7 @@ iserv.dev
 // Submitted by Yuji Minagawa <domains-admin@iodata.jp>
 iobb.net
 
-//Jelastic, Inc. : https://jelastic.com/
+// Jelastic, Inc. : https://jelastic.com/
 // Submited by Ihor Kolodyuk <ik@jelastic.com>
 mel.cloudlets.com.au
 cloud.interhostsolutions.be
@@ -12180,6 +12179,9 @@ jele.cloud
 it1.eur.aruba.jenv-aruba.cloud
 it1.jenv-aruba.cloud
 it1-eur.jenv-arubabiz.cloud
+oxa.cloud
+tn.oxa.cloud
+uk.oxa.cloud
 primetel.cloud
 uk.primetel.cloud
 ca.reclaim.cloud
@@ -12250,6 +12252,7 @@ jelastic.regruhosting.ru
 enscaled.sg
 jele.site
 jelastic.team
+orangecloud.tn
 j.layershift.co.uk
 phx.enscaled.us
 mircloud.us
@@ -12327,10 +12330,6 @@ co.technology
 // Submitted by Greg Holland <greg.holland@lmpm.com>
 app.lmpm.com
 
-// Linki Tools UG : https://linki.tools
-// Submitted by Paulo Matos <pmatos@linki.tools>
-linkitools.space
-
 // linkyard ldt: https://www.linkyard.ch/
 // Submitted by Mario Siegenthaler <mario.siegenthaler@linkyard.ch>
 linkyard.cloud
@@ -12369,7 +12368,6 @@ swidnik.pl
 
 // Lug.org.uk : https://lug.org.uk
 // Submitted by Jon Spriggs <admin@lug.org.uk>
-uklugs.org
 glug.org.uk
 lug.org.uk
 lugs.org.uk
@@ -12446,11 +12444,17 @@ eu.meteorapp.com
 co.pl
 
 // Microsoft Corporation : http://microsoft.com
-// Submitted by Mostafa Elzeiny <moelzein@microsoft.com>
+// Submitted by Mitch Webster <miwebst@microsoft.com>
 *.azurecontainer.io
 azurewebsites.net
 azure-mobile.net
 cloudapp.net
+azurestaticapps.net
+centralus.azurestaticapps.net
+eastasia.azurestaticapps.net
+eastus2.azurestaticapps.net
+westeurope.azurestaticapps.net
+westus2.azurestaticapps.net
 
 // minion.systems : http://minion.systems
 // Submitted by Robert Böttinger <r@minion.systems>
@@ -12492,19 +12496,22 @@ cust.retrosnub.co.uk
 ui.nabu.casa
 
 // Names.of.London : https://names.of.london/
-// Submitted by James Stevens <registry@names.of.london> or <james@jrcs.net>
+// Submitted by James Stevens <registry[at]names.of.london> or 
<publiclist[at]jrcs.net>
 pony.club
 of.fashion
-on.fashion
-of.football
 in.london
 of.london
+from.marketing
+with.marketing
 for.men
+repair.men
 and.mom
 for.mom
 for.one
+under.one
 for.sale
-of.work
+that.win
+from.work
 to.work
 
 // NCTU.ME : https://nctu.me/
@@ -12824,6 +12831,12 @@ mypep.link
 // Submitted by Kenneth Van Alstyne <kvanalstyne@perspecta.com>
 perspecta.cloud
 
+// PE Ulyanov Kirill Sergeevich : https://airy.host
+// Submitted by Kirill Ulyanov <k.ulyanov@airy.host>
+lk3.ru
+ra-ru.ru
+zsew.ru
+
 // Planet-Work : https://www.planet-work.com/
 // Submitted by Frédéric VANNIÈRE <f.vanniere@planet-work.com>
 on-web.fr
@@ -12885,6 +12898,10 @@ byen.site
 // Submitted by Kor Nielsen <kor@pubtls.org>
 pubtls.org
 
+// QOTO, Org.
+// Submitted by Jeffrey Phillips Freeman <jeffrey.freeman@qoto.org>
+qoto.io
+
 // Qualifio : https://qualifio.com/
 // Submitted by Xavier De Cock <xdecock@gmail.com>
 qualifioapp.com
@@ -12970,7 +12987,6 @@ hzc.io
 // Revitalised Limited : http://www.revitalised.co.uk
 // Submitted by Jack Price <jack@revitalised.co.uk>
 wellbeingzone.eu
-ptplus.fit
 wellbeingzone.co.uk
 
 // Rochester Institute of Technology : http://www.rit.edu/
@@ -13344,7 +13360,7 @@ wafflecell.com
 // Submitted by Fajar Sodik <official@wapblog.id>
 idnblogger.com
 indowapblog.com
-bloghp.id
+bloger.id
 wblog.id
 wbq.me
 fastblog.net
diff --git a/etc/refcards/Makefile b/etc/refcards/Makefile
index c0f0233..ce2c534 100644
--- a/etc/refcards/Makefile
+++ b/etc/refcards/Makefile
@@ -1,6 +1,6 @@
 ### Makefile for Emacs refcards
 
-## Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+## Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ## This file is part of GNU Emacs.
 #
diff --git a/etc/refcards/README b/etc/refcards/README
index f3de99f..30c82bc 100644
--- a/etc/refcards/README
+++ b/etc/refcards/README
@@ -1,4 +1,4 @@
-Copyright (C) 2013-2020 Free Software Foundation, Inc.
+Copyright (C) 2013-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
@@ -32,7 +32,7 @@ it is reproduced here for convenience.
 
 File: gnus-logo.eps, gnus-logo.pdf
   Author: Luis Fernandes <elf@ee.ryerson.ca>
-  Copyright (C) 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 2001-2021 Free Software Foundation, Inc.
   License: GNU General Public License version 3 or later (see COPYING)
 
 
diff --git a/etc/refcards/calccard.tex b/etc/refcards/calccard.tex
index a562f1e..0260762 100644
--- a/etc/refcards/calccard.tex
+++ b/etc/refcards/calccard.tex
@@ -20,7 +20,7 @@
 % Typical command to format:  tex calccard.tex
 % Typical command to print (3 cols):  dvips -t landscape calccard.dvi
 
-% Copyright (C) 1987, 1992, 2001--2020 Free Software Foundation, Inc.
+% Copyright (C) 1987, 1992, 2001--2021 Free Software Foundation, Inc.
 
 % This document is free software: you can redistribute it and/or modify
 % it under the terms of the GNU General Public License as published by
diff --git a/etc/refcards/cs-dired-ref.tex b/etc/refcards/cs-dired-ref.tex
index 9a37f16..294d11d 100644
--- a/etc/refcards/cs-dired-ref.tex
+++ b/etc/refcards/cs-dired-ref.tex
@@ -1,6 +1,6 @@
 % Reference Card for Dired -*- coding: utf-8 -*-
 
-% Copyright (C) 2000--2020 Free Software Foundation, Inc.
+% Copyright (C) 2000--2021 Free Software Foundation, Inc.
 
 % Author: Evgeny Roubinchtein <eroubinc@u.washington.edu>
 % Czech translation: Pavel Janík <Pavel@Janik.cz>, March 2001
diff --git a/etc/refcards/cs-refcard.tex b/etc/refcards/cs-refcard.tex
index 5a3adb8..4d9a8b3 100644
--- a/etc/refcards/cs-refcard.tex
+++ b/etc/refcards/cs-refcard.tex
@@ -1,6 +1,6 @@
 % Reference Card for GNU Emacs -*- coding: utf-8 -*-
 
-% Copyright (C) 1987, 1993, 1996--1997, 2001--2020 Free Software
+% Copyright (C) 1987, 1993, 1996--1997, 2001--2021 Free Software
 % Foundation, Inc.
 
 % Author: Stephen Gildea <stepheng+emacs@gildea.com>
diff --git a/etc/refcards/cs-survival.tex b/etc/refcards/cs-survival.tex
index 699dd90..75a07ee 100644
--- a/etc/refcards/cs-survival.tex
+++ b/etc/refcards/cs-survival.tex
@@ -1,6 +1,6 @@
 % Title:  GNU Emacs Survival Card -*- coding: utf-8 -*-
 
-% Copyright (C) 2000--2020 Free Software Foundation, Inc.
+% Copyright (C) 2000--2021 Free Software Foundation, Inc.
 
 % Author: Włodek Bzyl <matwb@univ.gda.pl>
 % Czech translation: Pavel Janík <Pavel@Janik.cz>, March 2001
diff --git a/etc/refcards/de-refcard.tex b/etc/refcards/de-refcard.tex
index 29ddf12..c890acb 100644
--- a/etc/refcards/de-refcard.tex
+++ b/etc/refcards/de-refcard.tex
@@ -1,6 +1,6 @@
 % Reference Card for GNU Emacs
 
-% Copyright (C) 1987, 1993, 1996, 2000--2020 Free Software Foundation,
+% Copyright (C) 1987, 1993, 1996, 2000--2021 Free Software Foundation,
 % Inc.
 
 % Author: Stephen Gildea <stepheng+emacs@gildea.com>
diff --git a/etc/refcards/dired-ref.tex b/etc/refcards/dired-ref.tex
index 85a7052..8d5af71 100644
--- a/etc/refcards/dired-ref.tex
+++ b/etc/refcards/dired-ref.tex
@@ -1,6 +1,6 @@
 % Reference Card for Dired
 
-% Copyright (C) 2000--2020 Free Software Foundation, Inc.
+% Copyright (C) 2000--2021 Free Software Foundation, Inc.
 
 % Author: Evgeny Roubinchtein <eroubinc@u.washington.edu>
 
diff --git a/etc/refcards/emacsver.tex.in b/etc/refcards/emacsver.tex.in
index 2f5bfb9..ac80804 100644
--- a/etc/refcards/emacsver.tex.in
+++ b/etc/refcards/emacsver.tex.in
@@ -2,4 +2,4 @@
 \def\versionemacs{@majorversion@}           % major version of emacs
 %% This one should not be automatically updated;
 %% M-x set-copyright in admin.el handles it.
-\def\year{2020}                             % latest copyright year
+\def\year{2021}                             % latest copyright year
diff --git a/etc/refcards/fr-dired-ref.tex b/etc/refcards/fr-dired-ref.tex
index 968c58b..fb8462f 100644
--- a/etc/refcards/fr-dired-ref.tex
+++ b/etc/refcards/fr-dired-ref.tex
@@ -1,6 +1,6 @@
 % Reference Card for Dired -*- coding: utf-8 -*-
 
-% Copyright (C) 2000--2020 Free Software Foundation, Inc.
+% Copyright (C) 2000--2021 Free Software Foundation, Inc.
 
 % Author: Evgeny Roubinchtein <eroubinc@u.washington.edu>
 % French translation: Eric Jacoboni
diff --git a/etc/refcards/fr-refcard.tex b/etc/refcards/fr-refcard.tex
index fe303ee..34d7ebd 100644
--- a/etc/refcards/fr-refcard.tex
+++ b/etc/refcards/fr-refcard.tex
@@ -1,6 +1,6 @@
 % Reference Card for GNU Emacs
 
-% Copyright (C) 1987, 1993, 1996--1997, 2001--2020 Free Software
+% Copyright (C) 1987, 1993, 1996--1997, 2001--2021 Free Software
 % Foundation, Inc.
 
 % Author: Stephen Gildea <stepheng+emacs@gildea.com>
diff --git a/etc/refcards/fr-survival.tex b/etc/refcards/fr-survival.tex
index 1cd6852..e11fe17 100644
--- a/etc/refcards/fr-survival.tex
+++ b/etc/refcards/fr-survival.tex
@@ -1,7 +1,7 @@
 %&tex
 % Title:  GNU Emacs Survival Card
 
-% Copyright (C) 2000--2020 Free Software Foundation, Inc.
+% Copyright (C) 2000--2021 Free Software Foundation, Inc.
 
 % Author: Włodek Bzyl <matwb@univ.gda.pl>
 % French translation:  \'Eric Jacoboni <jaco@teaser.fr>, November 2001
diff --git a/etc/refcards/gnus-logo.eps b/etc/refcards/gnus-logo.eps
index d446b36..eb77461 100644
--- a/etc/refcards/gnus-logo.eps
+++ b/etc/refcards/gnus-logo.eps
@@ -1,5 +1,5 @@
 %!PS-Adobe-2.0 EPSF-2.0
-% Copyright (C) 2000-2020 Free Software Foundation, Inc.
+% Copyright (C) 2000-2021 Free Software Foundation, Inc.
 %
 % Author: Luis Fernandes <elf@ee.ryerson.ca>
 %
diff --git a/etc/refcards/gnus-refcard.tex b/etc/refcards/gnus-refcard.tex
index 895186d..4a1760c 100644
--- a/etc/refcards/gnus-refcard.tex
+++ b/etc/refcards/gnus-refcard.tex
@@ -120,7 +120,7 @@
 %% Gnus logo by Luis Fernandes.
 \newcommand{\Copyright}{%
   \begin{center}
-    Copyright \copyright\ 1995, 2000, 2002--2020 Free Software Foundation, 
Inc.\\*
+    Copyright \copyright\ 1995, 2000, 2002--2021 Free Software Foundation, 
Inc.\\*
   \end{center}
 
   Released under the terms of the GNU General Public License version 3 or 
later.
diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex
index a261cb5..dc28587 100644
--- a/etc/refcards/orgcard.tex
+++ b/etc/refcards/orgcard.tex
@@ -1,5 +1,5 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{9.3}
+\def\orgversionnumber{9.4.2}
 \def\versionyear{2019}          % latest update
 \input emacsver.tex
 
@@ -17,7 +17,7 @@
 \pdflayout=(0l)
 
 % Nothing else needs to be changed below this line.
-% Copyright (C) 1987, 1993, 1996--1997, 2001--2020 Free Software
+% Copyright (C) 1987, 1993, 1996--1997, 2001--2021 Free Software
 % Foundation, Inc.
 
 % This document is free software: you can redistribute it and/or modify
@@ -79,6 +79,9 @@
 \centerline{Released under the terms of the GNU General Public License}
 \centerline{version 3 or later.}
 
+\centerline{For more Emacs documentation, and the \TeX{} source for this card, 
see}
+\centerline{the Emacs distribution, or {\tt 
https://www.gnu.org/software/emacs}}
+
 \endgroup}
 
 % make \bye not \outer so that the \def\bye in the \else clause below
@@ -515,7 +518,7 @@ after  ``{\tt :}'', and dictionary words elsewhere.
 \key{special commands in property lines}{C-c C-c}
 \key{next/previous allowed value}{S-LEFT/RIGHT}
 \key{turn on column view}{C-c C-x C-c}
-\key{capture columns view in dynamic block}{C-c C-x i}
+\key{capture columns view in dynamic block}{C-c C-x x}
 
 \key{quit column view}{q}
 \key{show full value}{v}
@@ -558,7 +561,7 @@ after  ``{\tt :}'', and dictionary words elsewhere.
 \key{stop/cancel clock on current item}{C-c C-x C-o/x}
 \key{display total subtree times}{C-c C-x C-d}
 \key{remove displayed times}{C-c C-c}
-\key{insert/update table with clock report}{C-c C-x C-r}
+\key{insert/update table with clock report}{C-c C-x C-x}
 
 \section{Agenda Views}
 
diff --git a/etc/refcards/pdflayout.sty b/etc/refcards/pdflayout.sty
index de7738c..91e67b1 100644
--- a/etc/refcards/pdflayout.sty
+++ b/etc/refcards/pdflayout.sty
@@ -1,4 +1,4 @@
-% Copyright (C) 2007-2020 Free Software Foundation, Inc.
+% Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 % This file is part of GNU Emacs.
 
diff --git a/etc/refcards/pl-refcard.tex b/etc/refcards/pl-refcard.tex
index 2b92fb5..b31b427 100644
--- a/etc/refcards/pl-refcard.tex
+++ b/etc/refcards/pl-refcard.tex
@@ -1,7 +1,7 @@
 %&mex
 % Reference Card for GNU Emacs
 
-% Copyright (C) 1999, 2001--2020 Free Software Foundation, Inc.
+% Copyright (C) 1999, 2001--2021 Free Software Foundation, Inc.
 
 % Author: Stephen Gildea <stepheng+emacs@gildea.com>
 % Polish translation: Włodek Bzyl <matwb@univ.gda.pl>
diff --git a/etc/refcards/pt-br-refcard.tex b/etc/refcards/pt-br-refcard.tex
index d4e3123..2d6680f 100644
--- a/etc/refcards/pt-br-refcard.tex
+++ b/etc/refcards/pt-br-refcard.tex
@@ -1,6 +1,6 @@
 % Reference Card for GNU Emacs
 
-% Copyright (C) 1987, 1993, 1996--1997, 2002--2004, 2006--2020 Free
+% Copyright (C) 1987, 1993, 1996--1997, 2002--2004, 2006--2021 Free
 % Software Foundation, Inc.
 
 % Author: Stephen Gildea <stepheng+emacs@gildea.com>
diff --git a/etc/refcards/refcard.tex b/etc/refcards/refcard.tex
index 6cac28f..f7b5da4 100644
--- a/etc/refcards/refcard.tex
+++ b/etc/refcards/refcard.tex
@@ -1,6 +1,6 @@
 % Reference Card for GNU Emacs
 
-% Copyright (C) 1987, 1993, 1996--1997, 2001--2020 Free Software
+% Copyright (C) 1987, 1993, 1996--1997, 2001--2021 Free Software
 % Foundation, Inc.
 
 % Author: Stephen Gildea <stepheng+emacs@gildea.com>
diff --git a/etc/refcards/ru-refcard.tex b/etc/refcards/ru-refcard.tex
index 165c00d..179be0a 100644
--- a/etc/refcards/ru-refcard.tex
+++ b/etc/refcards/ru-refcard.tex
@@ -1,4 +1,4 @@
-% Copyright (C) 1997, 2002--2020 Free Software Foundation, Inc.
+% Copyright (C) 1997, 2002--2021 Free Software Foundation, Inc.
 
 % Author: Stephen Gildea <stepheng+emacs@gildea.com>
 % Russian translation: Alex Ott <alexott@gmail.com>
@@ -41,7 +41,7 @@
 \setlength{\ColThreeWidth}{25mm}
 
 \newcommand{\versionemacs}[0]{28} % version of Emacs this is for
-\newcommand{\cyear}[0]{2020}       % copyright year
+\newcommand{\cyear}[0]{2021}       % copyright year
 
 \newcommand\shortcopyrightnotice[0]{\vskip 1ex plus 2 fill
   \centerline{\footnotesize \copyright\ \cyear\ Free Software Foundation, Inc.
diff --git a/etc/refcards/sk-dired-ref.tex b/etc/refcards/sk-dired-ref.tex
index 294c0e5..04db4e3f 100644
--- a/etc/refcards/sk-dired-ref.tex
+++ b/etc/refcards/sk-dired-ref.tex
@@ -1,6 +1,6 @@
 % Reference Card for Dired -*- coding: utf-8 -*-
 
-% Copyright (C) 2000--2020 Free Software Foundation, Inc.
+% Copyright (C) 2000--2021 Free Software Foundation, Inc.
 
 % Author: Evgeny Roubinchtein <eroubinc@u.washington.edu>
 % Czech translation: Pavel Janík <Pavel@Janik.cz>, March 2001
diff --git a/etc/refcards/sk-refcard.tex b/etc/refcards/sk-refcard.tex
index b232ea8..bda808f 100644
--- a/etc/refcards/sk-refcard.tex
+++ b/etc/refcards/sk-refcard.tex
@@ -1,6 +1,6 @@
 % Reference Card for GNU Emacs -*- coding: utf-8 -*-
 
-% Copyright (C) 1987, 1993, 1996--1997, 2001--2020 Free Software
+% Copyright (C) 1987, 1993, 1996--1997, 2001--2021 Free Software
 % Foundation, Inc.
 
 % Author: Stephen Gildea <stepheng+emacs@gildea.com>
diff --git a/etc/refcards/sk-survival.tex b/etc/refcards/sk-survival.tex
index 8e5d85f4..9bf591a 100644
--- a/etc/refcards/sk-survival.tex
+++ b/etc/refcards/sk-survival.tex
@@ -1,6 +1,6 @@
 % Title:  GNU Emacs Survival Card -*- coding: utf-8 -*-
 
-% Copyright (C) 2000--2020 Free Software Foundation, Inc.
+% Copyright (C) 2000--2021 Free Software Foundation, Inc.
 
 % Author: Włodek Bzyl <matwb@univ.gda.pl>
 % Czech translation: Pavel Janík <Pavel@Janik.cz>, March 2001
diff --git a/etc/refcards/survival.tex b/etc/refcards/survival.tex
index 24204e5..a5cd9b7 100644
--- a/etc/refcards/survival.tex
+++ b/etc/refcards/survival.tex
@@ -1,7 +1,7 @@
 %&tex
 % Title:  GNU Emacs Survival Card
 
-% Copyright (C) 2000--2020 Free Software Foundation, Inc.
+% Copyright (C) 2000--2021 Free Software Foundation, Inc.
 
 % Author: Włodek Bzyl <matwb@univ.gda.pl>
 
diff --git a/etc/refcards/vipcard.tex b/etc/refcards/vipcard.tex
index b55612b..c62988a 100644
--- a/etc/refcards/vipcard.tex
+++ b/etc/refcards/vipcard.tex
@@ -1,6 +1,6 @@
 % Quick Reference Card for VIP
 
-% Copyright (C) 1987, 2001--2020 Free Software Foundation, Inc.
+% Copyright (C) 1987, 2001--2021 Free Software Foundation, Inc.
 
 % Author: Masahiko Sato <ms@sail.stanford.edu>, 
<masahiko@sato.riec.tohoku.junet>
 
diff --git a/etc/refcards/viperCard.tex b/etc/refcards/viperCard.tex
index 6476563..24be19f 100644
--- a/etc/refcards/viperCard.tex
+++ b/etc/refcards/viperCard.tex
@@ -1,6 +1,6 @@
 % ViperCard -- The Reference Card for Viper under GNU Emacs
 
-% Copyright (C) 1995--1997, 2001--2020 Free Software Foundation, Inc.
+% Copyright (C) 1995--1997, 2001--2021 Free Software Foundation, Inc.
 
 % Author: Michael Kifer <kifer@cs.stonybrook.edu> (Viper)
 %      Aamod Sane <sane@cs.uiuc.edu> (VIP 4.3)
diff --git a/etc/schema/locate.rnc b/etc/schema/locate.rnc
index d651c82..697d1db 100644
--- a/etc/schema/locate.rnc
+++ b/etc/schema/locate.rnc
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
+# Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/etc/schema/relaxng.rnc b/etc/schema/relaxng.rnc
index 96efe9c..d3a9d96 100644
--- a/etc/schema/relaxng.rnc
+++ b/etc/schema/relaxng.rnc
@@ -1,6 +1,6 @@
 # RELAX NG XML syntax expressed in RELAX NG Compact syntax.
 
-# Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
+# Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/etc/schema/schemas.xml b/etc/schema/schemas.xml
index 40175b0..7fd91b8 100644
--- a/etc/schema/schemas.xml
+++ b/etc/schema/schemas.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!-- Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
+<!-- Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/etc/ses-example.ses b/etc/ses-example.ses
index 2f65d1f..f73fbfb 100644
--- a/etc/ses-example.ses
+++ b/etc/ses-example.ses
@@ -205,7 +205,7 @@ Sales summary - Acme fundraising
 ;;; ses--symbolic-formulas: (("Eastern area") ("West-district") 
("North&South") ("Other"))
 ;;; End:
 
-;;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;;; COPYING PERMISSIONS:
 ;;; 
diff --git a/etc/srecode/c.srt b/etc/srecode/c.srt
index 0942e31..753d1ee 100644
--- a/etc/srecode/c.srt
+++ b/etc/srecode/c.srt
@@ -1,6 +1,6 @@
 ;;; c.srt --- SRecode templates for c-mode
 
-;; Copyright (C) 2007-2010, 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2010, 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/cpp.srt b/etc/srecode/cpp.srt
index aa3bec2..3d1f9cb 100644
--- a/etc/srecode/cpp.srt
+++ b/etc/srecode/cpp.srt
@@ -1,6 +1,6 @@
 ;;; cpp.srt --- SRecode templates for c++-mode
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/default.srt b/etc/srecode/default.srt
index 8df64e0..0dff661 100644
--- a/etc/srecode/default.srt
+++ b/etc/srecode/default.srt
@@ -1,6 +1,6 @@
 ;;; default.srt --- SRecode templates for srecode-template-mode
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/doc-cpp.srt b/etc/srecode/doc-cpp.srt
index ecda96a..0de05ff 100644
--- a/etc/srecode/doc-cpp.srt
+++ b/etc/srecode/doc-cpp.srt
@@ -1,6 +1,6 @@
 ;; doc-c.srt --- SRecode templates for "document" applications
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/doc-default.srt b/etc/srecode/doc-default.srt
index 56a0ae0..4fc00dd 100644
--- a/etc/srecode/doc-default.srt
+++ b/etc/srecode/doc-default.srt
@@ -1,6 +1,6 @@
 ;; doc-default.srt --- SRecode templates for "document" applications
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/doc-java.srt b/etc/srecode/doc-java.srt
index 17086bc..b7eb0db 100644
--- a/etc/srecode/doc-java.srt
+++ b/etc/srecode/doc-java.srt
@@ -1,6 +1,6 @@
 ;; doc-java.srt --- SRecode templates for "document" applications
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/ede-autoconf.srt b/etc/srecode/ede-autoconf.srt
index 197a271..042c05a 100644
--- a/etc/srecode/ede-autoconf.srt
+++ b/etc/srecode/ede-autoconf.srt
@@ -1,6 +1,6 @@
 ;;; ede/templates/autoconf.srt --- Templates for autoconf used by EDE
 
-;; Copyright (C) 2010, 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010, 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/ede-make.srt b/etc/srecode/ede-make.srt
index 259a001..ba380e4 100644
--- a/etc/srecode/ede-make.srt
+++ b/etc/srecode/ede-make.srt
@@ -1,6 +1,6 @@
 ;; ede-make.srt --- SRecode templates for Makefiles used by EDE.
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/el.srt b/etc/srecode/el.srt
index 7d5c64c..a366434 100644
--- a/etc/srecode/el.srt
+++ b/etc/srecode/el.srt
@@ -1,6 +1,6 @@
 ;;; el.srt --- SRecode templates for Emacs Lisp mode
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/getset-cpp.srt b/etc/srecode/getset-cpp.srt
index 16c9d5f..af27cb2 100644
--- a/etc/srecode/getset-cpp.srt
+++ b/etc/srecode/getset-cpp.srt
@@ -1,6 +1,6 @@
 ;;; getset-cpp.srt --- SRecode templates for C++ class getter/setters.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/java.srt b/etc/srecode/java.srt
index 5ff0de3..5d8ce88 100644
--- a/etc/srecode/java.srt
+++ b/etc/srecode/java.srt
@@ -1,6 +1,6 @@
 ;; java.srt
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/make.srt b/etc/srecode/make.srt
index eb48682..f83ecf9 100644
--- a/etc/srecode/make.srt
+++ b/etc/srecode/make.srt
@@ -1,6 +1,6 @@
 ;; make.srt
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/proj-test.srt b/etc/srecode/proj-test.srt
index 65ee979..6825c6b 100644
--- a/etc/srecode/proj-test.srt
+++ b/etc/srecode/proj-test.srt
@@ -1,6 +1,6 @@
 ;; proj-test.srt --- SRecode template for testing project scoping.
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/template.srt b/etc/srecode/template.srt
index ac97c14..5820b1d 100644
--- a/etc/srecode/template.srt
+++ b/etc/srecode/template.srt
@@ -1,6 +1,6 @@
 ;;; template.srt --- Templates for Semantic Recoders
 
-;; Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/test.srt b/etc/srecode/test.srt
index a9d7066..581c295 100644
--- a/etc/srecode/test.srt
+++ b/etc/srecode/test.srt
@@ -1,6 +1,6 @@
 ;; test.srt --- SRecode templates for testing
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/texi.srt b/etc/srecode/texi.srt
index 243a53f..cc4c50c 100644
--- a/etc/srecode/texi.srt
+++ b/etc/srecode/texi.srt
@@ -1,6 +1,6 @@
 ;; texi.srt --- SRecode templates for Texinfo
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/srecode/wisent.srt b/etc/srecode/wisent.srt
index 445152d..4e8f61b 100644
--- a/etc/srecode/wisent.srt
+++ b/etc/srecode/wisent.srt
@@ -1,6 +1,6 @@
 ;; wisent.srt --- SRecode templates for Emacs/WISENT grammar files.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/etc/themes/adwaita-theme.el b/etc/themes/adwaita-theme.el
index 67a3b11..c98bec6 100644
--- a/etc/themes/adwaita-theme.el
+++ b/etc/themes/adwaita-theme.el
@@ -1,6 +1,6 @@
 ;;; adwaita-theme.el --- Tango-based custom theme for faces  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: William Stevenson <yhvh2000@gmail.com>
 
diff --git a/etc/themes/deeper-blue-theme.el b/etc/themes/deeper-blue-theme.el
index 2557918..cfe8a5b 100644
--- a/etc/themes/deeper-blue-theme.el
+++ b/etc/themes/deeper-blue-theme.el
@@ -1,6 +1,6 @@
 ;;; deeper-blue-theme.el --- Custom theme for faces  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Scott Frazer <frazer.scott@gmail.com>
 
diff --git a/etc/themes/dichromacy-theme.el b/etc/themes/dichromacy-theme.el
index 89b5a4e..09f4454 100644
--- a/etc/themes/dichromacy-theme.el
+++ b/etc/themes/dichromacy-theme.el
@@ -1,6 +1,6 @@
 ;;; dichromacy-theme.el --- color theme suitable for color-blind users  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Chong Yidong <cyd@stupidchicken>
 
diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index f104c84..f643dd5 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -1,6 +1,6 @@
 ;;; leuven-theme.el --- Awesome Emacs color theme on white background  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; URL: https://github.com/fniessen/emacs-leuven-theme
diff --git a/etc/themes/light-blue-theme.el b/etc/themes/light-blue-theme.el
index c6d3c92..6252885 100644
--- a/etc/themes/light-blue-theme.el
+++ b/etc/themes/light-blue-theme.el
@@ -1,6 +1,6 @@
 ;;; light-blue-theme.el --- Custom theme for faces  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Drew Adams <drew.adams@oracle.com>
 
diff --git a/etc/themes/manoj-dark-theme.el b/etc/themes/manoj-dark-theme.el
index 195d40d..1f4891c 100644
--- a/etc/themes/manoj-dark-theme.el
+++ b/etc/themes/manoj-dark-theme.el
@@ -1,6 +1,6 @@
 ;;; manoj-dark.el --- A dark theme from Manoj  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Manoj Srivastava <srivasta@ieee.org>
 ;; Keywords: lisp, faces
diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el
index ff9af0c..e7a66c5 100644
--- a/etc/themes/misterioso-theme.el
+++ b/etc/themes/misterioso-theme.el
@@ -1,6 +1,6 @@
 ;;; misterioso-theme.el --- Custom face theme for Emacs  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Sebastian Hermida
 
diff --git a/etc/themes/modus-operandi-theme.el 
b/etc/themes/modus-operandi-theme.el
index db61c97..c7a0f72 100644
--- a/etc/themes/modus-operandi-theme.el
+++ b/etc/themes/modus-operandi-theme.el
@@ -1,6 +1,6 @@
 ;;; modus-operandi-theme.el --- Accessible light theme (WCAG AAA) -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Protesilaos Stavrou <info@protesilaos.com>
 ;; URL: https://gitlab.com/protesilaos/modus-themes
diff --git a/etc/themes/modus-vivendi-theme.el 
b/etc/themes/modus-vivendi-theme.el
index d45c3ca..6e71e8d 100644
--- a/etc/themes/modus-vivendi-theme.el
+++ b/etc/themes/modus-vivendi-theme.el
@@ -1,6 +1,6 @@
 ;;; modus-vivendi-theme.el --- Accessible dark theme (WCAG AAA) -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Protesilaos Stavrou <info@protesilaos.com>
 ;; URL: https://gitlab.com/protesilaos/modus-themes
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index cf1a98b..a8577108 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -1,6 +1,6 @@
 ;;; tango-dark-theme.el --- Tango-based custom theme for faces  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Authors: Chong Yidong <cyd@stupidchicken>
 ;;          Jan Moringen <jan.moringen@uni-bielefeld.de>
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index 6166657..286561e 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -1,6 +1,6 @@
 ;;; tango-theme.el --- Tango-based custom theme for faces  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Authors: Chong Yidong <cyd@stupidchicken>
 ;;          Jan Moringen <jan.moringen@uni-bielefeld.de>
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index f3c9ced..62ed7c8 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -1,6 +1,6 @@
 ;;; tsdh-dark-theme.el --- Tassilo's dark custom theme  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index 46443ed..481a8f3 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -1,6 +1,6 @@
 ;;; tsdh-light-theme.el --- Tassilo's light custom theme  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/etc/themes/wheatgrass-theme.el b/etc/themes/wheatgrass-theme.el
index f1abdb3..162f797 100644
--- a/etc/themes/wheatgrass-theme.el
+++ b/etc/themes/wheatgrass-theme.el
@@ -1,6 +1,6 @@
 ;;; wheatgrass-theme.el --- custom theme for faces  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/etc/themes/whiteboard-theme.el b/etc/themes/whiteboard-theme.el
index ee42e4f..729c082 100644
--- a/etc/themes/whiteboard-theme.el
+++ b/etc/themes/whiteboard-theme.el
@@ -1,6 +1,6 @@
 ;;; whiteboard-theme.el --- Custom theme for faces  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Scott Frazer <frazer.scott@gmail.com>
 
diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el
index 4df5f5a..aaa7cce 100644
--- a/etc/themes/wombat-theme.el
+++ b/etc/themes/wombat-theme.el
@@ -1,6 +1,6 @@
 ;;; wombat-theme.el --- Custom face theme for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Kristoffer Grönlund <krig@koru.se>
 
diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL
index a5b4b76..6194e55 100644
--- a/etc/tutorials/TUTORIAL
+++ b/etc/tutorials/TUTORIAL
@@ -1117,7 +1117,7 @@ starting with the one written by Stuart Cracraft for the 
original Emacs.
 This version of the tutorial is a part of GNU Emacs.  It is copyrighted
 and comes with permission to distribute copies on certain conditions:
 
-  Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation,
+  Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation,
   Inc.
 
   This file is part of GNU Emacs.
diff --git a/etc/tutorials/TUTORIAL.bg b/etc/tutorials/TUTORIAL.bg
index 381c66f..3391e9b 100644
--- a/etc/tutorials/TUTORIAL.bg
+++ b/etc/tutorials/TUTORIAL.bg
@@ -1162,7 +1162,7 @@ Dired ви позволява да гледате списъка от файло
 This version of the tutorial, like GNU Emacs, is copyrighted, and
 comes with permission to distribute copies on certain conditions:
 
-  Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation,
+  Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation,
   Inc.
 
   This file is part of GNU Emacs.
diff --git a/etc/tutorials/TUTORIAL.cn b/etc/tutorials/TUTORIAL.cn
index e7fb9e5..742de09 100644
--- a/etc/tutorials/TUTORIAL.cn
+++ b/etc/tutorials/TUTORIAL.cn
@@ -997,7 +997,7 @@ starting with the one written by Stuart Cracraft for the 
original Emacs.
 This version of the tutorial is a part of GNU Emacs.  It is copyrighted
 and comes with permission to distribute copies on certain conditions:
 
-  Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation,
+  Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation,
   Inc.
 
   This file is part of GNU Emacs.
@@ -1026,7 +1026,7 @@ using, writing, and sharing free software!
 
 本篇指南是 GNU Emacs 的一部分,并允许在下列条件的约束下发行其拷贝:
 
-   Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation,
+   Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation,
    Inc.
 
    本文件为 GNU Emacs 的一部分。
diff --git a/etc/tutorials/TUTORIAL.cs b/etc/tutorials/TUTORIAL.cs
index 161f624..12c0d1e 100644
--- a/etc/tutorials/TUTORIAL.cs
+++ b/etc/tutorials/TUTORIAL.cs
@@ -1015,7 +1015,7 @@ tutoriálem napsaným Stuartem Cracraftem pro původní Emacs.
 Tato verze tutoriálu je, podobně jako GNU Emacs, chráněna copyrightem a
 je šířena se svolením distribuovat kopie za jistých podmínek:
 
-Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation, Inc.
 
    Každému je zaručeno právo vytvářet a distribuovat přesné kopie tohoto
    dokumentu tak, jak jej obdržel, na jakémkoliv médiu, s tím, že bude
diff --git a/etc/tutorials/TUTORIAL.de b/etc/tutorials/TUTORIAL.de
index e5ac254..7793094 100644
--- a/etc/tutorials/TUTORIAL.de
+++ b/etc/tutorials/TUTORIAL.de
@@ -1488,7 +1488,7 @@ Beachten Sie bitte, dass im Zweifelsfalle das englische 
Original
 dieser Urheberrechtsnotiz gültig ist (zu finden in der Datei
 TUTORIAL).
 
-   Copyright (C) 1985, 1996-1997, 2001-2020 Free Software Foundation,
+   Copyright (C) 1985, 1996-1997, 2001-2021 Free Software Foundation,
    Inc.
 
    Diese Datei ist ein Bestandteil von GNU Emacs.
diff --git a/etc/tutorials/TUTORIAL.eo b/etc/tutorials/TUTORIAL.eo
index ef3cf54..a1490cb 100644
--- a/etc/tutorials/TUTORIAL.eo
+++ b/etc/tutorials/TUTORIAL.eo
@@ -1081,7 +1081,7 @@ la dosiero verkita de Stuart Cracraft por la originala 
Emakso.
 kopirajton, kaj venas kun permeso por disdoni kopiojn se certaj
 kondiĉoj estas observataj:
 
-   Copyright (C) 1985, 1999, 2001-2002, 2005, 2007-2020 Free Software
+   Copyright (C) 1985, 1999, 2001-2002, 2005, 2007-2021 Free Software
    Foundation, Inc.
 
    Ĉi tiu dosiero estas parto de "GNU Emacs".
diff --git a/etc/tutorials/TUTORIAL.es b/etc/tutorials/TUTORIAL.es
index faecb26..786a9f4 100644
--- a/etc/tutorials/TUTORIAL.es
+++ b/etc/tutorials/TUTORIAL.es
@@ -1204,7 +1204,7 @@ Por favor, en caso de duda, solo es válido el original en 
inglés de la
 siguiente nota de derechos de reproducción (que puede encontrar en el
 archivo TUTORIAL).
 
-Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation, Inc.
 
    Se permite a cualquiera hacer o distribuir copias literales de este
    documento como se recibe, en cualquier medio, siempre que la nota
diff --git a/etc/tutorials/TUTORIAL.fr b/etc/tutorials/TUTORIAL.fr
index 6dc0651..3c1d87c 100644
--- a/etc/tutorials/TUTORIAL.fr
+++ b/etc/tutorials/TUTORIAL.fr
@@ -1202,7 +1202,7 @@ Cette version du didacticiel, comme GNU Emacs, est placée 
sous
 droit d'auteur, et vous pouvez en distribuer des copies sous certaines
 conditions :
 
-Copyright (C) 1985, 1996, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1996, 2001-2021 Free Software Foundation, Inc.
 
    Chacun peut créer ou distribuer des copies de ce document tel qu'il
    l'a reçu, sur n'importe quel support, pourvu que la note de
diff --git a/etc/tutorials/TUTORIAL.he b/etc/tutorials/TUTORIAL.he
index 1478fde..5cd1cac 100644
--- a/etc/tutorials/TUTORIAL.he
+++ b/etc/tutorials/TUTORIAL.he
@@ -1004,7 +1004,7 @@ find-file.
 גירסה זו של השיעור הינה חלק מחבילת GNU Emacs. היא מוגנת בזכויות יוצרים
 וניתנת להעתקה והפצת עותקים בתנאים מסויימים כדלקמן:
 
-                       Copyright (C) 2010-2020 Free Software Foundation, Inc.
+                       Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ‏GNU Emacs הינו תכנה חפשית; זכותכם להפיצו ו\או לשנותו בכפוף לתנאי
 הרשיון GNU General Public License, כפי שהוא יוצא לאור ע״י Free
diff --git a/etc/tutorials/TUTORIAL.it b/etc/tutorials/TUTORIAL.it
index 448937b..ac59379 100644
--- a/etc/tutorials/TUTORIAL.it
+++ b/etc/tutorials/TUTORIAL.it
@@ -1206,7 +1206,7 @@ distribuito con il permesso di farne copie a determinate 
condizioni:
    indicativo, restando comunque inteso il fatto che è quella
    originale a fare fede.
 
-Copyright (C) 2003-2020 Free Software Foundation, Inc.
+Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
    È permesso a chiunque copiare e distribuire attraverso ogni mezzo
    copie fedeli di questo documento così come viene ricevuto, a
diff --git a/etc/tutorials/TUTORIAL.ja b/etc/tutorials/TUTORIAL.ja
index 0dff756..db1e19b 100644
--- a/etc/tutorials/TUTORIAL.ja
+++ b/etc/tutorials/TUTORIAL.ja
@@ -1062,7 +1062,7 @@ starting with the one written by Stuart Cracraft for the 
original Emacs.
 This version of the tutorial, like GNU Emacs, is copyrighted, and
 comes with permission to distribute copies on certain conditions:
 
-Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation, Inc.
 
    Permission is granted to anyone to make or distribute verbatim copies
    of this document as received, in any medium, provided that the
diff --git a/etc/tutorials/TUTORIAL.ko b/etc/tutorials/TUTORIAL.ko
index 39f503b..d3ec8c2 100644
--- a/etc/tutorials/TUTORIAL.ko
+++ b/etc/tutorials/TUTORIAL.ko
@@ -981,7 +981,7 @@ C-x C-s와 (META쇠나 EDIT쇠 혹은 교체쇠가 있으면) <ESC>v와 같은 
 GNU 이맥스와 같이 이 지침서 판은 저작권이 있으며 특정한 조건을 만족할
 때에 복사본을 배포할 수 있는 허가를 갖고 나온 것이다:
 
-Copyright (C) 1985, 1996, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1996, 2001-2021 Free Software Foundation, Inc.
 
    이 문서는 이 저작권 공고와 허용 공고가 그대로 유지되고, 배포자가
    수취자에게 이 공고에 따라 허용되는 것처럼 또 재분배하는 것을
diff --git a/etc/tutorials/TUTORIAL.nl b/etc/tutorials/TUTORIAL.nl
index c6b801c..0853e5f 100644
--- a/etc/tutorials/TUTORIAL.nl
+++ b/etc/tutorials/TUTORIAL.nl
@@ -1209,7 +1209,7 @@ Deze versie van de inleiding is onderdeel van GNU Emacs.  
Het valt
 onder copyright.  Je mag deze inleiding verspreiden onder bepaalde
 voorwaarden:
 
-  Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation,
+  Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation,
   Inc.
 
   Dit bestand is onderdeel van GNU Emacs.
@@ -1239,7 +1239,7 @@ Engels origineel van de copyrightmelding en condities:
 This version of the tutorial is a part of GNU Emacs.  It is copyrighted
 and comes with permission to distribute copies on certain conditions:
 
-  Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/etc/tutorials/TUTORIAL.pl b/etc/tutorials/TUTORIAL.pl
index f9a7b7b..b5ccccf 100644
--- a/etc/tutorials/TUTORIAL.pl
+++ b/etc/tutorials/TUTORIAL.pl
@@ -1209,7 +1209,7 @@ z pomocą Ryszarda Kubiaka i Janusza S. Bienia 
<jsbien@mail.uw.edu.pl>.
 Ta wersja samouczka, podobnie jak GNU Emacs, jest chroniona prawem
 autorskim, ale wolno ją kopiować pod następującymi warunkami:
 
-Copyright (C) 1985, 1994, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1994, 2001-2021 Free Software Foundation, Inc.
 
 Zezwala się na wykonywanie lub rozpowszechnianie
 wiernych kopii tego dokumentu w otrzymanej formie, na dowolnym
diff --git a/etc/tutorials/TUTORIAL.pt_BR b/etc/tutorials/TUTORIAL.pt_BR
index 8b7583c..65ab3b5 100644
--- a/etc/tutorials/TUTORIAL.pt_BR
+++ b/etc/tutorials/TUTORIAL.pt_BR
@@ -1056,7 +1056,7 @@ Essa versão do tutorial foi originalmente traduzida por 
Marcelo Toledo
 <marcelo@gnu.org> e como o GNU Emacs, tem um copyright, e vem
 com uma permissão de distribuição de cópias nas seguintes condições:
 
-Copyright (C) 2004-2020 Free Software Foundation, Inc.
+Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
    Permissão é garantida a qualquer um para fazer ou distribuir cópias
    integrais deste documento como recebido, em qualquer meio, deixando
diff --git a/etc/tutorials/TUTORIAL.ro b/etc/tutorials/TUTORIAL.ro
index 05d5d8a..f9e67ca 100644
--- a/etc/tutorials/TUTORIAL.ro
+++ b/etc/tutorials/TUTORIAL.ro
@@ -4,7 +4,7 @@ Mulţumiri Aidei Hulubei <aida@chang.pub.ro> pentru corecturi şi 
sugestii.
 
 Această versiune a fost produsă plecând de la versiunea în limba
 engleză, care este
-Copyright (c) 1985, 2013-2020 Free Software Foundation, Inc.
+Copyright (c) 1985, 2013-2021 Free Software Foundation, Inc.
 
 Citiţi acum versiunea românească a tutorialului de Emacs.
 
@@ -1082,7 +1082,7 @@ continuare noţita de copyright originală în limba engleză.
 This version of the tutorial, like GNU Emacs, is copyrighted, and
 comes with permission to distribute copies on certain conditions:
 
-Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
    Permission is granted to anyone to make or distribute verbatim copies
    of this document as received, in any medium, provided that the
diff --git a/etc/tutorials/TUTORIAL.ru b/etc/tutorials/TUTORIAL.ru
index 96a8585..45bee48 100644
--- a/etc/tutorials/TUTORIAL.ru
+++ b/etc/tutorials/TUTORIAL.ru
@@ -1105,7 +1105,7 @@ Dired позволяет вам отображать список файлов 
 (copyrighted) и приходит с ограничениями распространения копий со
 следующими соглашениями:
 
-Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation, Inc.
 
    Permission is granted to anyone to make or distribute verbatim copies
    of this document as received, in any medium, provided that the
diff --git a/etc/tutorials/TUTORIAL.sk b/etc/tutorials/TUTORIAL.sk
index 408de53..525db24 100644
--- a/etc/tutorials/TUTORIAL.sk
+++ b/etc/tutorials/TUTORIAL.sk
@@ -1074,7 +1074,7 @@ tútorialom napísaným Stuartom Cracraftom pre pôvodný 
Emacs.
 Táto verzia tútorialu je, podobne ako GNU Emacs, chránená copyrightom
 a je šírená s povolením distribuovať kópie za istých podmienok:
 
-Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation, Inc.
 
    Každému je zaručené právo vytvárať a distribuovať presné kópie tohto
    dokumentu tak, ako ho dostal, na akomkoľvek médiu, s tým, že bude
diff --git a/etc/tutorials/TUTORIAL.sl b/etc/tutorials/TUTORIAL.sl
index bb8bfe2..be87588 100644
--- a/etc/tutorials/TUTORIAL.sl
+++ b/etc/tutorials/TUTORIAL.sl
@@ -1119,7 +1119,7 @@ Emacs. V slovenščino ga je prevedel Primož Peterlin.
 To besedilo, kot sam GNU Emacs, je avtorsko delo, in njegovo
 razmnoževanje in razširjanje je dovoljeno pod naslednjimi pogoji:
 
-Copyright © 1985, 1996, 1998, 2001-2020 Free Software Foundation, Inc.
+Copyright © 1985, 1996, 1998, 2001-2021 Free Software Foundation, Inc.
 
   Ta datoteka je del paketa GNU Emacs.
 
diff --git a/etc/tutorials/TUTORIAL.sv b/etc/tutorials/TUTORIAL.sv
index fcc388f..1eab267 100644
--- a/etc/tutorials/TUTORIAL.sv
+++ b/etc/tutorials/TUTORIAL.sv
@@ -1139,7 +1139,7 @@ Lidell översatte den till svenska.
 This version of the tutorial, like GNU Emacs, is copyrighted, and
 comes with permission to distribute copies on certain conditions:
 
-Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/etc/tutorials/TUTORIAL.th b/etc/tutorials/TUTORIAL.th
index 46119c0..8bd4f07 100644
--- a/etc/tutorials/TUTORIAL.th
+++ b/etc/tutorials/TUTORIAL.th
@@ -964,7 +964,7 @@ starting with the one written by Stuart Cracraft for the 
original Emacs.
 This version of the tutorial, like GNU Emacs, is copyrighted, and
 comes with permission to distribute copies on certain conditions:
 
-Copyright (C) 1985, 1996, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1996, 2001-2021 Free Software Foundation, Inc.
 
    Permission is granted to anyone to make or distribute verbatim copies
    of this document as received, in any medium, provided that the
diff --git a/etc/tutorials/TUTORIAL.zh b/etc/tutorials/TUTORIAL.zh
index 3b4fb13..a808cf8 100644
--- a/etc/tutorials/TUTORIAL.zh
+++ b/etc/tutorials/TUTORIAL.zh
@@ -1049,7 +1049,7 @@ issue here>」。
 這個版本的快速指南和 GNU Emacs 一樣都是版權化的,並且允許在某些條件下
 散佈其拷貝:
 
-Copyright (C) 1985, 1996, 1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1996, 1998, 2001-2021 Free Software Foundation, Inc.
 
    Permission is granted to anyone to make or distribute verbatim copies
    of this document as received, in any medium, provided that the
diff --git a/etc/w32-feature.el b/etc/w32-feature.el
index 3c0f741..c5f2cd5 100644
--- a/etc/w32-feature.el
+++ b/etc/w32-feature.el
@@ -1,6 +1,6 @@
 ;;; w32-feature.el --- Check Availability of Emacs Features  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Phillip Lord <phillip.lord@russet.org.uk>
 
diff --git a/leim/ChangeLog.1 b/leim/ChangeLog.1
index 20b23ca..e2c0120 100644
--- a/leim/ChangeLog.1
+++ b/leim/ChangeLog.1
@@ -2578,7 +2578,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1997-1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1997-1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/leim/Makefile.in b/leim/Makefile.in
index 171bc71..f3e530a 100644
--- a/leim/Makefile.in
+++ b/leim/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 1997-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 #   2006, 2007, 2008, 2009, 2010, 2011
 #   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/leim/README b/leim/README
index 6b36c44..baaf661 100644
--- a/leim/README
+++ b/leim/README
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/leim/leim-ext.el b/leim/leim-ext.el
index 404d91c..2378f6f 100644
--- a/leim/leim-ext.el
+++ b/leim/leim-ext.el
@@ -1,6 +1,6 @@
 ;; leim-ext.el -- extra leim configuration     -*- coding:utf-8; -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H13PRO009
diff --git a/lib-src/ChangeLog.1 b/lib-src/ChangeLog.1
index 16f5142..3c26980 100644
--- a/lib-src/ChangeLog.1
+++ b/lib-src/ChangeLog.1
@@ -8609,7 +8609,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1988-1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1988-1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index a2d27ea..0a6dd82 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2020 Free Software
+# Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2021 Free Software
 # Foundation, Inc.
 
 # This file is part of GNU Emacs.
@@ -204,14 +204,19 @@ LIBRESOLV=@LIBRESOLV@
 LIBS_MAIL=@LIBS_MAIL@
 ## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME
 LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+## empty or -lbcrypt or -ladvapi32
+LIB_GETRANDOM = @LIB_GETRANDOM@
 ## Whatever libraries are needed for euidaccess
 LIB_EACCESS=@LIB_EACCESS@
 ## empty or -lwsock2 for MinGW
 LIB_WSOCK32=@LIB_WSOCK32@
 
+## Extra libraries for etags
+LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM)
+
 ## Extra libraries to use when linking movemail.
 LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
-            $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32)
+  $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) $(LIBS_ETAGS)
 
 ## Extra libraries when linking emacsclient
 ## (empty or -lcomctl32 for MinGW)
@@ -360,7 +365,7 @@ TAGS: etags${EXEEXT} ${tagsfiles}
        $(MAKE) -C ../lib all
 
 etags_deps = ${srcdir}/etags.c $(NTLIB) $(config_h)
-etags_libs = $(NTLIB) $(LOADLIBES)
+etags_libs = $(NTLIB) $(LOADLIBES) $(LIBS_ETAGS)
 
 etags${EXEEXT}: ${etags_deps}
        $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} -o $@ $< $(etags_libs)
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 7d0650a..436b13a 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -1,6 +1,6 @@
 /* ebrowse.c --- parsing files for the ebrowse C++ browser
 
-Copyright (C) 1992-2020 Free Software Foundation, Inc.
+Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 871fa7a..12ced4a 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1,6 +1,6 @@
 /* Client process that communicates with GNU Emacs acting as server.
 
-Copyright (C) 1986-1987, 1994, 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1986-1987, 1994, 1999-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -251,7 +251,6 @@ get_current_dir_name (void)
   bufsize_max = min (bufsize_max, PATH_MAX);
 #endif
 
-  char *buf;
   struct stat dotstat, pwdstat;
   size_t pwdlen;
   /* If PWD is accurate, use it instead of calling getcwd.  PWD is
@@ -265,37 +264,23 @@ get_current_dir_name (void)
       && stat (".", &dotstat) == 0
       && dotstat.st_ino == pwdstat.st_ino
       && dotstat.st_dev == pwdstat.st_dev)
-    {
-      buf = xmalloc (strlen (pwd) + 1);
-      strcpy (buf, pwd);
-    }
+    return strdup (pwd);
   else
     {
-      size_t buf_size = 1024;
+      ptrdiff_t buf_size = min (bufsize_max, 1024);
       for (;;)
-        {
-         int tmp_errno;
-         buf = malloc (buf_size);
-         if (! buf)
-           break;
-          if (getcwd (buf, buf_size) == buf)
-            break;
-         tmp_errno = errno;
+       {
+         char *buf = malloc (buf_size);
+         if (!buf)
+           return NULL;
+         if (getcwd (buf, buf_size) == buf)
+           return buf;
          free (buf);
-         if (tmp_errno != ERANGE)
-            {
-              errno = tmp_errno;
-              return NULL;
-            }
-          buf_size *= 2;
-         if (! buf_size)
-           {
-             errno = ENOMEM;
-             return NULL;
-           }
-        }
+         if (errno != ERANGE || buf_size == bufsize_max)
+           return NULL;
+         buf_size = buf_size <= bufsize_max / 2 ? 2 * buf_size : bufsize_max;
+       }
     }
-  return buf;
 }
 #endif
 
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 4315771..b5c18e0 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -28,7 +28,7 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN
 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2020 Free Software
+Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2021 Free Software
 Foundation, Inc.
 
 This file is not considered part of GNU Emacs.
@@ -1643,19 +1643,10 @@ process_file_name (char *file, language *lang)
          char *cmd = concat (cmd1, "' > ", tmp_name);
 #endif
          free (cmd1);
-         int tmp_errno;
-         if (system (cmd) == -1)
-           {
-             inf = NULL;
-             tmp_errno = EINVAL;
-           }
-         else
-           {
-             inf = fopen (tmp_name, "r" FOPEN_BINARY);
-             tmp_errno = errno;
-           }
+         inf = (system (cmd) == -1
+                ? NULL
+                : fopen (tmp_name, "r" FOPEN_BINARY));
          free (cmd);
-         errno = tmp_errno;
        }
 
       if (!inf)
@@ -6063,6 +6054,7 @@ Erlang_functions (FILE *inf)
            {
              free (last);
              last = NULL;
+             allocated = lastlen = 0;
            }
        }
       else
@@ -7067,9 +7059,7 @@ etags_mktmp (void)
   int fd = mkostemp (templt, O_CLOEXEC);
   if (fd < 0 || close (fd) != 0)
     {
-      int temp_errno = errno;
       free (templt);
-      errno = temp_errno;
       templt = NULL;
     }
 #if defined (DOS_NT)
diff --git a/lib-src/hexl.c b/lib-src/hexl.c
index b493df9..6486606 100644
--- a/lib-src/hexl.c
+++ b/lib-src/hexl.c
@@ -1,5 +1,5 @@
 /* Convert files for Emacs Hexl mode.
-   Copyright (C) 1989, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1989, 2001-2021 Free Software Foundation, Inc.
 
 Author: Keith Gabryelski (according to authors.el)
 
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index da58358..d17c28b 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -1,6 +1,6 @@
 /* Generate doc-string file for GNU Emacs from source files.
 
-Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2020 Free Software
+Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/lib-src/make-fingerprint.c b/lib-src/make-fingerprint.c
index b72ee90..485dd4b 100644
--- a/lib-src/make-fingerprint.c
+++ b/lib-src/make-fingerprint.c
@@ -1,6 +1,6 @@
 /* Hash inputs and generate C file with the digest.
 
-Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2016, 2018-2020 Free
+Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2016, 2018-2021 Free
 Software Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 4f9abc9..cfdebcc 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -1,7 +1,7 @@
 /* movemail foo bar -- move file foo to file bar,
    locking file foo the way /bin/mail respects.
 
-Copyright (C) 1986, 1992-1994, 1996, 1999, 2001-2020 Free Software
+Copyright (C) 1986, 1992-1994, 1996, 1999, 2001-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index 8f02855..bcbc006 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -1,6 +1,6 @@
 /* Utility and Unix shadow routines for GNU Emacs support programs on NT.
 
-Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 Author: Geoff Voelker (voelker@cs.washington.edu)
 Created: 10-8-94
diff --git a/lib-src/ntlib.h b/lib-src/ntlib.h
index 8771603..d62c19f 100644
--- a/lib-src/ntlib.h
+++ b/lib-src/ntlib.h
@@ -1,5 +1,5 @@
 /* Utility and Unix shadow routines for GNU Emacs support programs on NT.
-   Copyright (C) 1994, 2002-2020 Free Software Foundation, Inc.
+   Copyright (C) 1994, 2002-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 886aa78..27ed89b 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -1,6 +1,6 @@
 /* pop.c: client routines for talking to a POP3-protocol post-office server
 
-Copyright (C) 1991, 1993, 1996-1997, 1999, 2001-2020 Free Software
+Copyright (C) 1991, 1993, 1996-1997, 1999, 2001-2021 Free Software
 Foundation, Inc.
 
 Author: Jonathan Kamens <jik@security.ov.com>
diff --git a/lib-src/pop.h b/lib-src/pop.h
index 638671f..229714b 100644
--- a/lib-src/pop.h
+++ b/lib-src/pop.h
@@ -1,5 +1,5 @@
 /* pop.h: Header file for the "pop.c" client POP3 protocol.
-   Copyright (C) 1991, 1993, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1993, 2001-2021 Free Software Foundation, Inc.
 
 Author: Jonathan Kamens <jik@security.ov.com>
 
diff --git a/lib-src/rcs2log b/lib-src/rcs2log
index ba99538..7a03367 100755
--- a/lib-src/rcs2log
+++ b/lib-src/rcs2log
@@ -2,7 +2,7 @@
 
 # RCS to ChangeLog generator
 
-# Copyright (C) 1992-1998, 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 1992-1998, 2001-2021 Free Software Foundation, Inc.
 
 # Author: Paul Eggert <eggert@cs.ucla.edu>
 
@@ -20,7 +20,7 @@
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 
-Copyright='Copyright (C) 2020 Free Software Foundation, Inc.
+Copyright='Copyright (C) 2021 Free Software Foundation, Inc.
 This program comes with NO WARRANTY, to the extent permitted by law.
 You may redistribute copies of this program
 under the terms of the GNU General Public License.
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index 93aa039..f1242df 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -1,6 +1,6 @@
 /* update-game-score.c --- Update a score file
 
-Copyright (C) 2002-2020 Free Software Foundation, Inc.
+Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 Author: Colin Walters <walters@debian.org>
 
@@ -499,9 +499,9 @@ unlock_file (const char *filename, void *state)
   char *lockpath = (char *) state;
   int saved_errno = errno;
   int ret = unlink (lockpath);
-  int unlink_errno = errno;
+  if (0 <= ret)
+    errno = saved_errno;
   free (lockpath);
-  errno = ret < 0 ? unlink_errno : saved_errno;
   return ret;
 }
 
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 06d8e56..91a6b5f 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright 2017-2020 Free Software Foundation, Inc.
+# Copyright 2017-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -92,7 +92,7 @@ libegnu_a_OBJECTS = $(patsubst %.o,e-%.o,$(for_emacs_OBJECTS))
 $(libegnu_a_OBJECTS) $(libgnu_a_OBJECTS): $(BUILT_SOURCES)
 
 .c.o:
-       $(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
+       $(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
 e-%.o: %.c
        $(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -Demacs -o $@ $<
 
@@ -118,7 +118,7 @@ TAGS: $(ETAGS) $(tagsfiles)
 .PHONY: $(ETAGS) tags
 
 clean:
-       rm -f ./*.[ao] ./*-t \#* $(DEPDIR)/*
+       rm -f ./*.[ao] ./*/*.o ./*-t \#* $(DEPDIR)/*.d $(DEPDIR)/*/*.d
 mostlyclean: clean
        rm -f $(filter-out %-t,$(MOSTLYCLEANFILES))
 distclean bootstrap-clean: mostlyclean
@@ -127,7 +127,7 @@ distclean bootstrap-clean: mostlyclean
 maintainer-clean: distclean
        rm -f TAGS gnulib.mk
 extraclean: distclean
-       -rmdir sys 2>/dev/null
+       -rmdir malloc sys 2>/dev/null
 
 .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
 
diff --git a/lib/_Noreturn.h b/lib/_Noreturn.h
index 394ca3c..38afe1d 100644
--- a/lib/_Noreturn.h
+++ b/lib/_Noreturn.h
@@ -1,5 +1,5 @@
 /* A C macro for declaring that a function does not return.
-   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
diff --git a/lib/acl-errno-valid.c b/lib/acl-errno-valid.c
index cafae0b..af1af82 100644
--- a/lib/acl-errno-valid.c
+++ b/lib/acl-errno-valid.c
@@ -1,6 +1,6 @@
 /* Test whether ACLs are well supported on this system.
 
-   Copyright 2013-2020 Free Software Foundation, Inc.
+   Copyright 2013-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/acl-internal.c b/lib/acl-internal.c
index 1cb77a8..2b212e8 100644
--- a/lib/acl-internal.c
+++ b/lib/acl-internal.c
@@ -1,6 +1,6 @@
 /* Test whether a file has a nontrivial ACL.  -*- coding: utf-8 -*-
 
-   Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/acl-internal.h b/lib/acl-internal.h
index 0e28e1a..ca302bf 100644
--- a/lib/acl-internal.h
+++ b/lib/acl-internal.h
@@ -1,6 +1,6 @@
 /* Internal implementation of access control lists.  -*- coding: utf-8 -*-
 
-   Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/acl.h b/lib/acl.h
index 374c147..7014b82 100644
--- a/lib/acl.h
+++ b/lib/acl.h
@@ -1,6 +1,6 @@
 /* acl.c - access control lists
 
-   Copyright (C) 2002, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/acl_entries.c b/lib/acl_entries.c
index 14fca5f..6f70caf 100644
--- a/lib/acl_entries.c
+++ b/lib/acl_entries.c
@@ -1,6 +1,6 @@
 /* Return the number of entries in an ACL.
 
-   Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/alloca.in.h b/lib/alloca.in.h
index c71e9bf..0a6137e 100644
--- a/lib/alloca.in.h
+++ b/lib/alloca.in.h
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2020 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2021 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
diff --git a/lib/allocator.h b/lib/allocator.h
index 2b03238..cfa0535 100644
--- a/lib/allocator.h
+++ b/lib/allocator.h
@@ -1,6 +1,6 @@
 /* Memory allocators such as malloc+free.
 
-   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/arg-nonnull.h b/lib/arg-nonnull.h
index db9d9ae..5b81b50 100644
--- a/lib/arg-nonnull.h
+++ b/lib/arg-nonnull.h
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific arguments must not be NULL.
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
diff --git a/lib/at-func.c b/lib/at-func.c
index 90022e0..b6d9de7 100644
--- a/lib/at-func.c
+++ b/lib/at-func.c
@@ -1,5 +1,5 @@
 /* Define at-style functions like fstatat, unlinkat, fchownat, etc.
-   Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/attribute.h b/lib/attribute.h
index 2836b99..8224527 100644
--- a/lib/attribute.h
+++ b/lib/attribute.h
@@ -1,6 +1,6 @@
 /* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
 
-   Copyright 2020 Free Software Foundation, Inc.
+   Copyright 2020-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -80,7 +80,7 @@
 /* Attributes for variadic functions.  */
 
 /* The variadic function expects a trailing NULL argument.
-   ATTRIBUTE_SENTINEL () - The last argument is NULL.
+   ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
    ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL.  */
 /* Applies to: functions.  */
 #define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL (pos)
@@ -170,18 +170,21 @@
 /* Applies to: function.  */
 #define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
 
-/* The function does not affect observable state, and always returns a value.
-   Compilers can omit duplicate calls with the same arguments if
-   observable state is not changed between calls.  (This attribute is
-   looser than ATTRIBUTE_CONST.)  */
+/* It is OK for a compiler to omit duplicate calls with the same arguments.
+   This attribute is safe for a function that neither depends on
+   nor affects observable state, and always returns exactly once -
+   e.g., does not loop forever, and does not call longjmp.
+   (This attribute is stricter than ATTRIBUTE_PURE.)  */
 /* Applies to: functions.  */
-#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
+#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
 
-/* The function neither depends on nor affects observable state,
-   and always returns a value.  Compilers can omit duplicate calls with
-   the same arguments.  (This attribute is stricter than ATTRIBUTE_PURE.)  */
+/* It is OK for a compiler to omit duplicate calls with the same
+   arguments if observable state is not changed between calls.
+   This attribute is safe for a function that does not affect
+   observable state, and always returns exactly once.
+   (This attribute is looser than ATTRIBUTE_CONST.)  */
 /* Applies to: functions.  */
-#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
+#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
 
 /* The function is rarely executed.  */
 /* Applies to: functions.  */
diff --git a/lib/binary-io.c b/lib/binary-io.c
index e84e223..f267897 100644
--- a/lib/binary-io.c
+++ b/lib/binary-io.c
@@ -1,5 +1,5 @@
 /* Binary mode I/O.
-   Copyright 2017-2020 Free Software Foundation, Inc.
+   Copyright 2017-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/binary-io.h b/lib/binary-io.h
index d17af7c..8654fd2 100644
--- a/lib/binary-io.h
+++ b/lib/binary-io.h
@@ -1,5 +1,5 @@
 /* Binary mode I/O.
-   Copyright (C) 2001, 2003, 2005, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2005, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/byteswap.in.h b/lib/byteswap.in.h
index e690b3c..2b7d5ab 100644
--- a/lib/byteswap.in.h
+++ b/lib/byteswap.in.h
@@ -1,5 +1,5 @@
 /* byteswap.h - Byte swapping
-   Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc.
    Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/c++defs.h b/lib/c++defs.h
index 6a9bf29..39df1bc 100644
--- a/lib/c++defs.h
+++ b/lib/c++defs.h
@@ -1,5 +1,5 @@
 /* C++ compatible function declaration macros.
-   Copyright (C) 2010-2020 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -181,6 +181,14 @@
     _GL_EXTERN_C int _gl_cxxalias_dummy
 #endif
 
+/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
+   is like  _GL_CXXALIAS_MDA (func, rettype, parameters);
+   except that the C function func may have a slightly different declaration.
+   A cast is used to silence the "invalid conversion" error that would
+   otherwise occur.  */
+#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
+  _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
+
 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
    declares a C++ alias called GNULIB_NAMESPACE::func
    that redirects to the system provided function func, if GNULIB_NAMESPACE
diff --git a/lib/c-ctype.h b/lib/c-ctype.h
index fbd11b3..bf24a88 100644
--- a/lib/c-ctype.h
+++ b/lib/c-ctype.h
@@ -5,7 +5,7 @@
    <ctype.h> functions' behaviour depends on the current locale set via
    setlocale.
 
-   Copyright (C) 2000-2003, 2006, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2006, 2008-2021 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/lib/c-strcase.h b/lib/c-strcase.h
index 3b711f5..089edfe 100644
--- a/lib/c-strcase.h
+++ b/lib/c-strcase.h
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison functions in C locale.
-   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2020 Free Software
+   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/c-strcasecmp.c b/lib/c-strcasecmp.c
index f1a4b98..55479d6 100644
--- a/lib/c-strcasecmp.c
+++ b/lib/c-strcasecmp.c
@@ -1,5 +1,5 @@
 /* c-strcasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/c-strncasecmp.c b/lib/c-strncasecmp.c
index 1d6e141..02bc0f2 100644
--- a/lib/c-strncasecmp.c
+++ b/lib/c-strncasecmp.c
@@ -1,5 +1,5 @@
 /* c-strncasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c
index 0b89d2a..b6dc3a4 100644
--- a/lib/canonicalize-lgpl.c
+++ b/lib/canonicalize-lgpl.c
@@ -1,19 +1,20 @@
 /* Return the canonical absolute name of a given file.
-   Copyright (C) 1996-2020 Free Software Foundation, Inc.
+   Copyright (C) 1996-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
 /* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
@@ -21,37 +22,35 @@
 # define _GL_ARG_NONNULL(params)
 
 # define _GL_USE_STDLIB_ALLOC 1
-# include <config.h>
+# include <libc-config.h>
 #endif
 
-#if !HAVE_CANONICALIZE_FILE_NAME || !FUNC_REALPATH_WORKS || defined _LIBC
-
 /* Specification.  */
 #include <stdlib.h>
 
-#include <alloca.h>
-#include <string.h>
-#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
-#if HAVE_SYS_PARAM_H || defined _LIBC
-# include <sys/param.h>
-#endif
+#include <stdbool.h>
+#include <string.h>
 #include <sys/stat.h>
-#include <errno.h>
-#include <stddef.h>
+#include <unistd.h>
+
+#include <eloop-threshold.h>
+#include <filename.h>
+#include <idx.h>
+#include <intprops.h>
+#include <scratch_buffer.h>
 
 #ifdef _LIBC
 # include <shlib-compat.h>
+# define GCC_LINT 1
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
 #else
-# define SHLIB_COMPAT(lib, introduced, obsoleted) 0
-# define versioned_symbol(lib, local, symbol, version) extern int dummy
-# define compat_symbol(lib, local, symbol, version)
-# define weak_alias(local, symbol)
 # define __canonicalize_file_name canonicalize_file_name
 # define __realpath realpath
 # include "pathmax.h"
-# include "malloca.h"
-# include "filename.h"
+# define __faccessat faccessat
 # if defined _WIN32 && !defined __CYGWIN__
 #  define __getcwd _getcwd
 # elif HAVE_GETCWD
@@ -72,57 +71,141 @@
 # else
 #  define __getcwd(buf, max) getwd (buf)
 # endif
+# define __mempcpy mempcpy
+# define __pathconf pathconf
+# define __rawmemchr rawmemchr
 # define __readlink readlink
-# define __set_errno(e) errno = (e)
-# ifndef MAXSYMLINKS
-#  ifdef SYMLOOP_MAX
-#   define MAXSYMLINKS SYMLOOP_MAX
-#  else
-#   define MAXSYMLINKS 20
-#  endif
-# endif
+# define __stat stat
 #endif
 
-#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
-# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
+/* Suppress bogus GCC -Wmaybe-uninitialized warnings.  */
+#if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
 #endif
 
-/* Define this independently so that stdint.h is not a prerequisite.  */
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
+/* True if adding two valid object sizes might overflow idx_t.
+   As a practical matter, this cannot happen on 64-bit machines.  */
+enum { NARROW_ADDRESSES = IDX_MAX >> 31 >> 31 == 0 };
+
+#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
+# define DOUBLE_SLASH_IS_DISTINCT_ROOT false
 #endif
 
-#if !FUNC_REALPATH_WORKS || defined _LIBC
+#if defined _LIBC || !FUNC_REALPATH_WORKS
 
-static void
-alloc_failed (void)
+/* Return true if FILE's existence can be shown, false (setting errno)
+   otherwise.  Follow symbolic links.  */
+static bool
+file_accessible (char const *file)
 {
-#if defined _WIN32 && ! defined __CYGWIN__
-  /* Avoid errno problem without using the malloc or realloc modules; see:
-     https://lists.gnu.org/r/bug-gnulib/2016-08/msg00025.html  */
-  errno = ENOMEM;
+# if defined _LIBC || HAVE_FACCESSAT
+  return __faccessat (AT_FDCWD, file, F_OK, AT_EACCESS) == 0;
+# else
+  struct stat st;
+  return __stat (file, &st) == 0 || errno == EOVERFLOW;
+# endif
+}
+
+/* True if concatenating END as a suffix to a file name means that the
+   code needs to check that the file name is that of a searchable
+   directory, since the canonicalize_filename_mode_stk code won't
+   check this later anyway when it checks an ordinary file name
+   component within END.  END must either be empty, or start with a
+   slash.  */
+
+static bool _GL_ATTRIBUTE_PURE
+suffix_requires_dir_check (char const *end)
+{
+  /* If END does not start with a slash, the suffix is OK.  */
+  while (ISSLASH (*end))
+    {
+      /* Two or more slashes act like a single slash.  */
+      do
+        end++;
+      while (ISSLASH (*end));
+
+      switch (*end++)
+        {
+        default: return false;  /* An ordinary file name component is OK.  */
+        case '\0': return true; /* Trailing "/" is trouble.  */
+        case '.': break;        /* Possibly "." or "..".  */
+        }
+      /* Trailing "/.", or "/.." even if not trailing, is trouble.  */
+      if (!*end || (*end == '.' && (!end[1] || ISSLASH (end[1]))))
+        return true;
+    }
+
+  return false;
+}
+
+/* Append this to a file name to test whether it is a searchable directory.
+   On POSIX platforms "/" suffices, but "/./" is sometimes needed on
+   macOS 10.13 <https://bugs.gnu.org/30350>, and should also work on
+   platforms like AIX 7.2 that need at least "/.".  */
+
+#if defined _LIBC || defined LSTAT_FOLLOWS_SLASHED_SYMLINK
+static char const dir_suffix[] = "/";
+#else
+static char const dir_suffix[] = "/./";
 #endif
+
+/* Return true if DIR is a searchable dir, false (setting errno) otherwise.
+   DIREND points to the NUL byte at the end of the DIR string.
+   Store garbage into DIREND[0 .. strlen (dir_suffix)].  */
+
+static bool
+dir_check (char *dir, char *dirend)
+{
+  strcpy (dirend, dir_suffix);
+  return file_accessible (dir);
 }
 
-/* Return the canonical absolute name of file NAME.  A canonical name
-   does not contain any ".", ".." components nor any repeated path
-   separators ('/') or symlinks.  All path components must exist.  If
-   RESOLVED is null, the result is malloc'd; otherwise, if the
-   canonical name is PATH_MAX chars or more, returns null with 'errno'
-   set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars,
-   returns the name in RESOLVED.  If the name cannot be resolved and
-   RESOLVED is non-NULL, it contains the path of the first component
-   that cannot be resolved.  If the path can be resolved, RESOLVED
-   holds the same value as the value returned.  */
+static idx_t
+get_path_max (void)
+{
+# ifdef PATH_MAX
+  long int path_max = PATH_MAX;
+# else
+  /* The caller invoked realpath with a null RESOLVED, even though
+     PATH_MAX is not defined as a constant.  The glibc manual says
+     programs should not do this, and POSIX says the behavior is undefined.
+     Historically, glibc here used the result of pathconf, or 1024 if that
+     failed; stay consistent with this (dubious) historical practice.  */
+  int err = errno;
+  long int path_max = __pathconf ("/", _PC_PATH_MAX);
+  __set_errno (err);
+# endif
+  return path_max < 0 ? 1024 : path_max <= IDX_MAX ? path_max : IDX_MAX;
+}
 
-char *
-__realpath (const char *name, char *resolved)
+/* Act like __realpath (see below), with an additional argument
+   rname_buf that can be used as temporary storage.
+
+   If GCC_LINT is defined, do not inline this function with GCC 10.1
+   and later, to avoid creating a pointer to the stack that GCC
+   -Wreturn-local-addr incorrectly complains about.  See:
+   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
+   Although the noinline attribute can hurt performance a bit, no better way
+   to pacify GCC is known; even an explicit #pragma does not pacify GCC.
+   When the GCC bug is fixed this workaround should be limited to the
+   broken GCC versions.  */
+#if __GNUC_PREREQ (10, 1)
+# if defined GCC_LINT || defined lint
+__attribute__ ((__noinline__))
+# elif __OPTIMIZE__ && !__NO_INLINE__
+#  define GCC_BOGUS_WRETURN_LOCAL_ADDR
+# endif
+#endif
+static char *
+realpath_stk (const char *name, char *resolved,
+              struct scratch_buffer *rname_buf)
 {
-  char *rpath, *dest, *extra_buf = NULL;
-  const char *start, *end, *rpath_limit;
-  long int path_max;
+  char *dest;
+  char const *start;
+  char const *end;
   int num_links = 0;
-  size_t prefix_len;
 
   if (name == NULL)
     {
@@ -142,205 +225,148 @@ __realpath (const char *name, char *resolved)
       return NULL;
     }
 
-#ifdef PATH_MAX
-  path_max = PATH_MAX;
-#else
-  path_max = pathconf (name, _PC_PATH_MAX);
-  if (path_max <= 0)
-    path_max = 8192;
-#endif
-
-  if (resolved == NULL)
-    {
-      rpath = malloc (path_max);
-      if (rpath == NULL)
-        {
-          alloc_failed ();
-          return NULL;
-        }
-    }
-  else
-    rpath = resolved;
-  rpath_limit = rpath + path_max;
+  struct scratch_buffer extra_buffer, link_buffer;
+  scratch_buffer_init (&extra_buffer);
+  scratch_buffer_init (&link_buffer);
+  scratch_buffer_init (rname_buf);
+  char *rname_on_stack = rname_buf->data;
+  char *rname = rname_on_stack;
+  bool end_in_extra_buffer = false;
+  bool failed = true;
 
   /* This is always zero for Posix hosts, but can be 2 for MS-Windows
      and MS-DOS X:/foo/bar file names.  */
-  prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
+  idx_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
 
   if (!IS_ABSOLUTE_FILE_NAME (name))
     {
-      if (!__getcwd (rpath, path_max))
+      while (!__getcwd (rname, rname_buf->length))
         {
-          rpath[0] = '\0';
-          goto error;
+          if (errno != ERANGE)
+            {
+              dest = rname;
+              goto error;
+            }
+          if (!scratch_buffer_grow (rname_buf))
+            goto error_nomem;
+          rname = rname_buf->data;
         }
-      dest = strchr (rpath, '\0');
+      dest = __rawmemchr (rname, '\0');
       start = name;
-      prefix_len = FILE_SYSTEM_PREFIX_LEN (rpath);
+      prefix_len = FILE_SYSTEM_PREFIX_LEN (rname);
     }
   else
     {
-      dest = rpath;
-      if (prefix_len)
-        {
-          memcpy (rpath, name, prefix_len);
-          dest += prefix_len;
-        }
+      dest = __mempcpy (rname, name, prefix_len);
       *dest++ = '/';
       if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
         {
-          if (ISSLASH (name[1]) && !ISSLASH (name[2]) && !prefix_len)
+          if (prefix_len == 0 /* implies ISSLASH (name[0]) */
+              && ISSLASH (name[1]) && !ISSLASH (name[2]))
             *dest++ = '/';
           *dest = '\0';
         }
       start = name + prefix_len;
     }
 
-  for (end = start; *start; start = end)
+  for ( ; *start; start = end)
     {
-#ifdef _LIBC
-      struct stat64 st;
-#else
-      struct stat st;
-#endif
-
-      /* Skip sequence of multiple path-separators.  */
+      /* Skip sequence of multiple file name separators.  */
       while (ISSLASH (*start))
         ++start;
 
-      /* Find end of path component.  */
+      /* Find end of component.  */
       for (end = start; *end && !ISSLASH (*end); ++end)
         /* Nothing.  */;
 
-      if (end - start == 0)
+      /* Length of this file name component; it can be zero if a file
+         name ends in '/'.  */
+      idx_t startlen = end - start;
+
+      if (startlen == 0)
         break;
-      else if (end - start == 1 && start[0] == '.')
+      else if (startlen == 1 && start[0] == '.')
         /* nothing */;
-      else if (end - start == 2 && start[0] == '.' && start[1] == '.')
+      else if (startlen == 2 && start[0] == '.' && start[1] == '.')
         {
           /* Back up to previous component, ignore if at root already.  */
-          if (dest > rpath + prefix_len + 1)
-            for (--dest; dest > rpath && !ISSLASH (dest[-1]); --dest)
+          if (dest > rname + prefix_len + 1)
+            for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest)
               continue;
           if (DOUBLE_SLASH_IS_DISTINCT_ROOT
-              && dest == rpath + 1 && !prefix_len
+              && dest == rname + 1 && !prefix_len
               && ISSLASH (*dest) && !ISSLASH (dest[1]))
             dest++;
         }
       else
         {
-          size_t new_size;
-
           if (!ISSLASH (dest[-1]))
             *dest++ = '/';
 
-          if (dest + (end - start) >= rpath_limit)
+          while (rname + rname_buf->length - dest
+                 < startlen + sizeof dir_suffix)
             {
-              ptrdiff_t dest_offset = dest - rpath;
-              char *new_rpath;
-
-              if (resolved)
-                {
-                  __set_errno (ENAMETOOLONG);
-                  if (dest > rpath + prefix_len + 1)
-                    dest--;
-                  *dest = '\0';
-                  goto error;
-                }
-              new_size = rpath_limit - rpath;
-              if (end - start + 1 > path_max)
-                new_size += end - start + 1;
-              else
-                new_size += path_max;
-              new_rpath = (char *) realloc (rpath, new_size);
-              if (new_rpath == NULL)
-                {
-                  alloc_failed ();
-                  goto error;
-                }
-              rpath = new_rpath;
-              rpath_limit = rpath + new_size;
-
-              dest = rpath + dest_offset;
+              idx_t dest_offset = dest - rname;
+              if (!scratch_buffer_grow_preserve (rname_buf))
+                goto error_nomem;
+              rname = rname_buf->data;
+              dest = rname + dest_offset;
             }
 
-#ifdef _LIBC
-          dest = __mempcpy (dest, start, end - start);
-#else
-          memcpy (dest, start, end - start);
-          dest += end - start;
-#endif
+          dest = __mempcpy (dest, start, startlen);
           *dest = '\0';
 
-          /* FIXME: if lstat fails with errno == EOVERFLOW,
-             the entry exists.  */
-#ifdef _LIBC
-          if (__lxstat64 (_STAT_VER, rpath, &st) < 0)
-#else
-          if (lstat (rpath, &st) < 0)
-#endif
-            goto error;
-
-          if (S_ISLNK (st.st_mode))
+          char *buf;
+          ssize_t n;
+          while (true)
             {
-              char *buf;
-              size_t len;
-              ssize_t n;
-
-              if (++num_links > MAXSYMLINKS)
+              buf = link_buffer.data;
+              idx_t bufsize = link_buffer.length;
+              n = __readlink (rname, buf, bufsize - 1);
+              if (n < bufsize - 1)
+                break;
+              if (!scratch_buffer_grow (&link_buffer))
+                goto error_nomem;
+            }
+          if (0 <= n)
+            {
+              if (++num_links > __eloop_threshold ())
                 {
                   __set_errno (ELOOP);
                   goto error;
                 }
 
-              buf = malloca (path_max);
-              if (!buf)
-                {
-                  __set_errno (ENOMEM);
-                  goto error;
-                }
-
-              n = __readlink (rpath, buf, path_max - 1);
-              if (n < 0)
-                {
-                  int saved_errno = errno;
-                  freea (buf);
-                  __set_errno (saved_errno);
-                  goto error;
-                }
               buf[n] = '\0';
 
-              if (!extra_buf)
+              char *extra_buf = extra_buffer.data;
+              idx_t end_idx IF_LINT (= 0);
+              if (end_in_extra_buffer)
+                end_idx = end - extra_buf;
+              size_t len = strlen (end);
+              if (NARROW_ADDRESSES && INT_ADD_OVERFLOW (len, n))
                 {
-                  extra_buf = malloca (path_max);
-                  if (!extra_buf)
-                    {
-                      freea (buf);
-                      __set_errno (ENOMEM);
-                      goto error;
-                    }
+                  __set_errno (ENOMEM);
+                  goto error_nomem;
                 }
-
-              len = strlen (end);
-              /* Check that n + len + 1 doesn't overflow and is <= path_max. */
-              if (n >= SIZE_MAX - len || n + len >= path_max)
+              while (extra_buffer.length <= len + n)
                 {
-                  freea (buf);
-                  __set_errno (ENAMETOOLONG);
-                  goto error;
+                  if (!scratch_buffer_grow_preserve (&extra_buffer))
+                    goto error_nomem;
+                  extra_buf = extra_buffer.data;
                 }
+              if (end_in_extra_buffer)
+                end = extra_buf + end_idx;
 
               /* Careful here, end may be a pointer into extra_buf... */
               memmove (&extra_buf[n], end, len + 1);
               name = end = memcpy (extra_buf, buf, n);
+              end_in_extra_buffer = true;
 
               if (IS_ABSOLUTE_FILE_NAME (buf))
                 {
-                  size_t pfxlen = FILE_SYSTEM_PREFIX_LEN (buf);
+                  idx_t pfxlen = FILE_SYSTEM_PREFIX_LEN (buf);
 
-                  if (pfxlen)
-                    memcpy (rpath, buf, pfxlen);
-                  dest = rpath + pfxlen;
+                  dest = __mempcpy (rname, buf, pfxlen);
                   *dest++ = '/'; /* It's an absolute symlink */
                   if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
                     {
@@ -355,44 +381,67 @@ __realpath (const char *name, char *resolved)
                 {
                   /* Back up to previous component, ignore if at root
                      already: */
-                  if (dest > rpath + prefix_len + 1)
-                    for (--dest; dest > rpath && !ISSLASH (dest[-1]); --dest)
+                  if (dest > rname + prefix_len + 1)
+                    for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest)
                       continue;
-                  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rpath + 1
+                  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1
                       && ISSLASH (*dest) && !ISSLASH (dest[1]) && !prefix_len)
                     dest++;
                 }
             }
-          else if (!S_ISDIR (st.st_mode) && *end != '\0')
-            {
-              __set_errno (ENOTDIR);
-              goto error;
-            }
+          else if (! (suffix_requires_dir_check (end)
+                      ? dir_check (rname, dest)
+                      : errno == EINVAL))
+            goto error;
         }
     }
-  if (dest > rpath + prefix_len + 1 && ISSLASH (dest[-1]))
+  if (dest > rname + prefix_len + 1 && ISSLASH (dest[-1]))
     --dest;
-  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rpath + 1 && !prefix_len
+  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1 && !prefix_len
       && ISSLASH (*dest) && !ISSLASH (dest[1]))
     dest++;
-  *dest = '\0';
+  failed = false;
 
-  if (extra_buf)
-    freea (extra_buf);
+error:
+  *dest++ = '\0';
+  if (resolved != NULL && dest - rname <= get_path_max ())
+    rname = strcpy (resolved, rname);
 
-  return rpath;
+error_nomem:
+  scratch_buffer_free (&extra_buffer);
+  scratch_buffer_free (&link_buffer);
 
-error:
-  {
-    int saved_errno = errno;
-    if (extra_buf)
-      freea (extra_buf);
-    if (resolved == NULL)
-      free (rpath);
-    __set_errno (saved_errno);
-  }
-  return NULL;
+  if (failed || rname == resolved)
+    {
+      scratch_buffer_free (rname_buf);
+      return failed ? NULL : resolved;
+    }
+
+  return scratch_buffer_dupfree (rname_buf, dest - rname);
+}
+
+/* Return the canonical absolute name of file NAME.  A canonical name
+   does not contain any ".", ".." components nor any repeated file name
+   separators ('/') or symlinks.  All file name components must exist.  If
+   RESOLVED is null, the result is malloc'd; otherwise, if the
+   canonical name is PATH_MAX chars or more, returns null with 'errno'
+   set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars,
+   returns the name in RESOLVED.  If the name cannot be resolved and
+   RESOLVED is non-NULL, it contains the name of the first component
+   that cannot be resolved.  If the name can be resolved, RESOLVED
+   holds the same value as the value returned.  */
+
+char *
+__realpath (const char *name, char *resolved)
+{
+  #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
+   #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
+   #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
+  #endif
+  struct scratch_buffer rname_buffer;
+  return realpath_stk (name, resolved, &rname_buffer);
 }
+libc_hidden_def (__realpath)
 versioned_symbol (libc, __realpath, realpath, GLIBC_2_3);
 #endif /* !FUNC_REALPATH_WORKS || defined _LIBC */
 
@@ -420,11 +469,3 @@ __canonicalize_file_name (const char *name)
   return __realpath (name, NULL);
 }
 weak_alias (__canonicalize_file_name, canonicalize_file_name)
-
-#else
-
-/* This declaration is solely to ensure that after preprocessing
-   this file is never empty.  */
-typedef int dummy;
-
-#endif
diff --git a/lib/careadlinkat.c b/lib/careadlinkat.c
index e43aa42..18cfc11 100644
--- a/lib/careadlinkat.c
+++ b/lib/careadlinkat.c
@@ -1,6 +1,6 @@
 /* Read symbolic links into a buffer without size limitation, relative to fd.
 
-   Copyright (C) 2001, 2003-2004, 2007, 2009-2020 Free Software Foundation,
+   Copyright (C) 2001, 2003-2004, 2007, 2009-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -51,8 +51,12 @@ enum { STACK_BUF_SIZE = 1024 };
    to pacify GCC is known; even an explicit #pragma does not pacify GCC.
    When the GCC bug is fixed this workaround should be limited to the
    broken GCC versions.  */
-#if (defined GCC_LINT || defined lint) && _GL_GNUC_PREREQ (10, 1)
+#if _GL_GNUC_PREREQ (10, 1)
+# if defined GCC_LINT || defined lint
 __attribute__ ((__noinline__))
+# elif __OPTIMIZE__ && !__NO_INLINE__
+#  define GCC_BOGUS_WRETURN_LOCAL_ADDR
+# endif
 #endif
 static char *
 readlink_stk (int fd, char const *filename,
@@ -85,18 +89,13 @@ readlink_stk (int fd, char const *filename,
       size_t link_size;
       if (link_length < 0)
         {
-          /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1
-             with errno == ERANGE if the buffer is too small.  */
-          int readlinkat_errno = errno;
-          if (readlinkat_errno != ERANGE)
+          if (buf != buffer)
             {
-              if (buf != buffer)
-                {
-                  alloc->free (buf);
-                  errno = readlinkat_errno;
-                }
-              return NULL;
+              int readlinkat_errno = errno;
+              alloc->free (buf);
+              errno = readlinkat_errno;
             }
+          return NULL;
         }
 
       link_size = link_length;
@@ -180,10 +179,11 @@ careadlinkat (int fd, char const *filename,
   /* Allocate the initial buffer on the stack.  This way, in the
      common case of a symlink of small size, we get away with a
      single small malloc instead of a big malloc followed by a
-     shrinking realloc.
-
-     If GCC -Wreturn-local-addr warns about this buffer, the warning
-     is bogus; see readlink_stk.  */
+     shrinking realloc.  */
+  #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
+   #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
+   #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
+  #endif
   char stack_buf[STACK_BUF_SIZE];
   return readlink_stk (fd, filename, buffer, buffer_size, alloc,
                        preadlinkat, stack_buf);
diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h
index a4a37b2..c506fac 100644
--- a/lib/careadlinkat.h
+++ b/lib/careadlinkat.h
@@ -1,6 +1,6 @@
 /* Read symbolic links into a buffer without size limitation, relative to fd.
 
-   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/cdefs.h b/lib/cdefs.h
index ff7c628..2a3dc96 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -75,11 +75,11 @@
 
 /* GCC can always grok prototypes.  For C++ programs we add throw()
    to help it optimize the function calls.  But this works only with
-   gcc 2.8.x and egcs.  For gcc 3.2 and up we even mark C functions
+   gcc 2.8.x and egcs.  For gcc 3.4 and up we even mark C functions
    as non-throwing using a function attribute since programs can use
    the -fexceptions options for C code as well.  */
 # if !defined __cplusplus \
-     && (__GNUC_PREREQ (3, 3) || __glibc_clang_has_attribute (__nothrow__))
+     && (__GNUC_PREREQ (3, 4) || __glibc_clang_has_attribute (__nothrow__))
 #  define __THROW      __attribute__ ((__nothrow__ __LEAF))
 #  define __THROWNL    __attribute__ ((__nothrow__))
 #  define __NTH(fct)   __attribute__ ((__nothrow__ __LEAF)) fct
diff --git a/lib/cloexec.c b/lib/cloexec.c
index 510be3d..8363dda 100644
--- a/lib/cloexec.c
+++ b/lib/cloexec.c
@@ -1,6 +1,6 @@
 /* cloexec.c - set or clear the close-on-exec descriptor flag
 
-   Copyright (C) 1991, 2004-2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 1991, 2004-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/cloexec.h b/lib/cloexec.h
index f14a997..5ca0e64 100644
--- a/lib/cloexec.h
+++ b/lib/cloexec.h
@@ -1,6 +1,6 @@
 /* cloexec.c - set or clear the close-on-exec descriptor flag
 
-   Copyright (C) 2004, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/close-stream.c b/lib/close-stream.c
index 04bc800..86f6d6e 100644
--- a/lib/close-stream.c
+++ b/lib/close-stream.c
@@ -1,6 +1,6 @@
 /* Close a stream, with nicer error checking than fclose's.
 
-   Copyright (C) 1998-2002, 2004, 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 1998-2002, 2004, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/copy-file-range.c b/lib/copy-file-range.c
index 069f144..e73c78b 100644
--- a/lib/copy-file-range.c
+++ b/lib/copy-file-range.c
@@ -1,5 +1,5 @@
 /* Stub for copy_file_range
-   Copyright 2019-2020 Free Software Foundation, Inc.
+   Copyright 2019-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/count-leading-zeros.h b/lib/count-leading-zeros.h
index 7cf605a..575ec3b 100644
--- a/lib/count-leading-zeros.h
+++ b/lib/count-leading-zeros.h
@@ -1,5 +1,5 @@
 /* count-leading-zeros.h -- counts the number of leading 0 bits in a word.
-   Copyright (C) 2012-2020 Free Software Foundation, Inc.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/count-one-bits.h b/lib/count-one-bits.h
index a9e166a..1a14f11 100644
--- a/lib/count-one-bits.h
+++ b/lib/count-one-bits.h
@@ -1,5 +1,5 @@
 /* count-one-bits.h -- counts the number of 1-bits in a word.
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/count-trailing-zeros.h b/lib/count-trailing-zeros.h
index 727b21d..5a8ef56 100644
--- a/lib/count-trailing-zeros.h
+++ b/lib/count-trailing-zeros.h
@@ -1,5 +1,5 @@
 /* count-trailing-zeros.h -- counts the number of trailing 0 bits in a word.
-   Copyright 2013-2020 Free Software Foundation, Inc.
+   Copyright 2013-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/diffseq.h b/lib/diffseq.h
index 26e10bd..1cac430 100644
--- a/lib/diffseq.h
+++ b/lib/diffseq.h
@@ -1,6 +1,6 @@
 /* Analyze differences between two vectors.
 
-   Copyright (C) 1988-1989, 1992-1995, 2001-2004, 2006-2020 Free Software
+   Copyright (C) 1988-1989, 1992-1995, 2001-2004, 2006-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/dirent.in.h b/lib/dirent.in.h
index 23c4e05..2e2c511 100644
--- a/lib/dirent.in.h
+++ b/lib/dirent.in.h
@@ -1,5 +1,5 @@
 /* A GNU-like <dirent.h>.
-   Copyright (C) 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/dirfd.c b/lib/dirfd.c
index f653977..ced7531 100644
--- a/lib/dirfd.c
+++ b/lib/dirfd.c
@@ -1,6 +1,6 @@
 /* dirfd.c -- return the file descriptor associated with an open DIR*
 
-   Copyright (C) 2001, 2006, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/dtotimespec.c b/lib/dtotimespec.c
index 40adbe5..73061a3 100644
--- a/lib/dtotimespec.c
+++ b/lib/dtotimespec.c
@@ -1,6 +1,6 @@
 /* Convert double to timespec.
 
-   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/dup2.c b/lib/dup2.c
index 323e19b..c4a0a29 100644
--- a/lib/dup2.c
+++ b/lib/dup2.c
@@ -1,6 +1,6 @@
 /* Duplicate an open file descriptor to a specified file descriptor.
 
-   Copyright (C) 1999, 2004-2007, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2004-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/eloop-threshold.h b/lib/eloop-threshold.h
new file mode 100644
index 0000000..27d07a7
--- /dev/null
+++ b/lib/eloop-threshold.h
@@ -0,0 +1,83 @@
+/* Threshold at which to diagnose ELOOP.  Generic version.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _ELOOP_THRESHOLD_H
+#define _ELOOP_THRESHOLD_H      1
+
+#include <limits.h>
+#ifdef _LIBC
+# include <sys/param.h>
+# define _GL_ATTRIBUTE_CONST __attribute__ ((const))
+#else
+# include <unistd.h>
+# include "minmax.h"
+# define __sysconf sysconf
+# if (!defined SYMLOOP_MAX \
+      && ! (defined _SC_SYMLOOP_MAX && defined _POSIX_SYMLOOP_MAX))
+#  define SYMLOOP_MAX 8
+# endif
+#endif
+
+/* POSIX specifies SYMLOOP_MAX as the "Maximum number of symbolic
+   links that can be reliably traversed in the resolution of a
+   pathname in the absence of a loop."  This makes it a minimum that
+   we should certainly accept.  But it leaves open the possibility
+   that more might sometimes work--just not "reliably".
+
+   For example, Linux implements a complex policy whereby there is a
+   small limit on the number of direct symlink traversals (a symlink
+   to a symlink to a symlink), but larger limit on the total number of
+   symlink traversals overall.  Hence the SYMLOOP_MAX number should be
+   the small one, but the limit library functions enforce on users
+   should be the larger one.
+
+   So, we use the larger of the reported SYMLOOP_MAX (if any) and our
+   own constant MIN_ELOOP_THRESHOLD, below.  This constant should be
+   large enough that it never rules out a file name and directory tree
+   that the underlying system (i.e. calls to 'open' et al) would
+   resolve successfully.  It should be small enough that actual loops
+   are detected without a huge number of iterations.  */
+
+#ifndef MIN_ELOOP_THRESHOLD
+# define MIN_ELOOP_THRESHOLD    40
+#endif
+
+/* Return the maximum number of symlink traversals to permit
+   before diagnosing ELOOP.  */
+static inline unsigned int _GL_ATTRIBUTE_CONST
+__eloop_threshold (void)
+{
+#ifdef SYMLOOP_MAX
+  const int symloop_max = SYMLOOP_MAX;
+#else
+  /* The function is marked 'const' even though we use memory and
+     call a function, because sysconf is required to return the
+     same value in every call and so it must always be safe to
+     call __eloop_threshold exactly once and reuse the value.  */
+  static long int sysconf_symloop_max;
+  if (sysconf_symloop_max == 0)
+    sysconf_symloop_max = __sysconf (_SC_SYMLOOP_MAX);
+  const unsigned int symloop_max = (sysconf_symloop_max <= 0
+                                    ? _POSIX_SYMLOOP_MAX
+                                    : sysconf_symloop_max);
+#endif
+
+  return MAX (symloop_max, MIN_ELOOP_THRESHOLD);
+}
+
+#endif  /* eloop-threshold.h */
diff --git a/lib/errno.in.h b/lib/errno.in.h
index c27e0c7..c6ab4e8 100644
--- a/lib/errno.in.h
+++ b/lib/errno.in.h
@@ -1,6 +1,6 @@
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/euidaccess.c b/lib/euidaccess.c
index b352123..ef65961 100644
--- a/lib/euidaccess.c
+++ b/lib/euidaccess.c
@@ -1,6 +1,6 @@
 /* euidaccess -- check if effective user id can access file
 
-   Copyright (C) 1990-1991, 1995, 1998, 2000, 2003-2006, 2008-2020 Free
+   Copyright (C) 1990-1991, 1995, 1998, 2000, 2003-2006, 2008-2021 Free
    Software Foundation, Inc.
 
    This file is part of the GNU C Library.
@@ -107,7 +107,10 @@ euidaccess (const char *file, int mode)
      safe.  */
 
   if (mode == F_OK)
-    return stat (file, &stats);
+    {
+      int result = stat (file, &stats);
+      return result != 0 && errno == EOVERFLOW ? 0 : result;
+    }
   else
     {
       int result;
@@ -142,8 +145,8 @@ euidaccess (const char *file, int mode)
     /* If we are not set-uid or set-gid, access does the same.  */
     return access (file, mode);
 
-  if (stat (file, &stats) != 0)
-    return -1;
+  if (stat (file, &stats) == -1)
+    return mode == F_OK && errno == EOVERFLOW ? 0 : -1;
 
   /* The super-user can read and write any file, and execute any file
      that anyone can execute.  */
diff --git a/lib/execinfo.in.h b/lib/execinfo.in.h
index b2fe44e..790bec0 100644
--- a/lib/execinfo.in.h
+++ b/lib/execinfo.in.h
@@ -1,6 +1,6 @@
 /* Information about executables.
 
-   Copyright (C) 2012-2020 Free Software Foundation, Inc.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c
index b1f5acb..feea444 100644
--- a/lib/explicit_bzero.c
+++ b/lib/explicit_bzero.c
@@ -1,5 +1,5 @@
 /* Erasure of sensitive data, generic implementation.
-   Copyright (C) 2016-2020 Free Software Foundation, Inc.
+   Copyright (C) 2016-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
diff --git a/lib/faccessat.c b/lib/faccessat.c
index 9f6a11b..3a77646 100644
--- a/lib/faccessat.c
+++ b/lib/faccessat.c
@@ -1,5 +1,5 @@
 /* Check the access rights of a file relative to an open directory.
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/fchmodat.c b/lib/fchmodat.c
index eee0a1c..d27c0d7 100644
--- a/lib/fchmodat.c
+++ b/lib/fchmodat.c
@@ -1,5 +1,5 @@
 /* Change the protections of file relative to an open directory.
-   Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/fcntl.c b/lib/fcntl.c
index 8cd1531..9d6b10f 100644
--- a/lib/fcntl.c
+++ b/lib/fcntl.c
@@ -1,6 +1,6 @@
 /* Provide file descriptor control.
 
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -491,7 +491,9 @@ rpl_fcntl_DUPFD_CLOEXEC (int fd, int target)
 #if !HAVE_FCNTL
   result = dupfd (fd, target, O_CLOEXEC);
 #else /* HAVE_FCNTL */
-# if defined __HAIKU__
+# if defined __NetBSD__ || defined __HAIKU__
+  /* On NetBSD 9.0, the system fcntl (fd, F_DUPFD_CLOEXEC, target)
+     has only the same effect as fcntl (fd, F_DUPFD, target).  */
   /* On Haiku, the system fcntl (fd, F_DUPFD_CLOEXEC, target) sets
      the FD_CLOEXEC flag on fd, not on target.  Therefore avoid the
      system fcntl in this case.  */
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index 6f16bc6..0b14467 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -1,6 +1,6 @@
 /* Like <fcntl.h>, but with non-working flags defined to 0.
 
-   Copyright (C) 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -112,9 +112,21 @@ _GL_CXXALIASWARN (creat);
 /* Assume creat is always declared.  */
 _GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - "
                  "use gnulib module creat for portability");
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef creat
-# define creat _creat
+#elif @GNULIB_MDA_CREAT@
+/* On native Windows, map 'creat' to '_creat', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::creat always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef creat
+#   define creat _creat
+#  endif
+/* Need to cast, because in mingw the last argument is 'int mode'.  */
+_GL_CXXALIAS_MDA_CAST (creat, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (creat);
 #endif
 
 #if @GNULIB_FCNTL@
@@ -174,9 +186,22 @@ _GL_CXXALIASWARN (open);
 /* Assume open is always declared.  */
 _GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
                  "use gnulib module open for portability");
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef open
-# define open _open
+#elif @GNULIB_MDA_OPEN@
+/* On native Windows, map 'open' to '_open', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::open always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef open
+#   define open _open
+#  endif
+_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
+# else
+_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+# endif
+# if !defined __hpux
+_GL_CXXALIASWARN (open);
+# endif
 #endif
 
 #if @GNULIB_OPENAT@
diff --git a/lib/fdopendir.c b/lib/fdopendir.c
index 883c0c4..451b4e1 100644
--- a/lib/fdopendir.c
+++ b/lib/fdopendir.c
@@ -1,5 +1,5 @@
 /* provide a replacement fdopendir function
-   Copyright (C) 2004-2020 Free Software Foundation, Inc.
+   Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/filemode.c b/lib/filemode.c
index e1b0690..3575672 100644
--- a/lib/filemode.c
+++ b/lib/filemode.c
@@ -1,6 +1,6 @@
 /* filemode.c -- make a string describing file modes
 
-   Copyright (C) 1985, 1990, 1993, 1998-2000, 2004, 2006, 2009-2020 Free
+   Copyright (C) 1985, 1990, 1993, 1998-2000, 2004, 2006, 2009-2021 Free
    Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -20,17 +20,6 @@
 
 #include "filemode.h"
 
-/* The following is for Cray DMF (Data Migration Facility), which is a
-   HSM file system.  A migrated file has a 'st_dm_mode' that is
-   different from the normal 'st_mode', so any tests for migrated
-   files should use the former.  */
-#if HAVE_ST_DM_MODE
-# define IS_MIGRATED_FILE(statp) \
-    (S_ISOFD (statp->st_dm_mode) || S_ISOFL (statp->st_dm_mode))
-#else
-# define IS_MIGRATED_FILE(statp) 0
-#endif
-
 #if ! HAVE_DECL_STRMODE
 
 /* Return a character indicating the type of file described by
@@ -126,7 +115,6 @@ strmode (mode_t mode, char *str)
         for files whose type cannot be determined solely from st_mode:
 
             'F' semaphore
-            'M' migrated file (Cray DMF)
             'Q' message queue
             'S' shared memory object
             'T' typed memory object
@@ -169,8 +157,6 @@ filemodestring (struct stat const *statp, char *str)
 
   if (S_TYPEISSEM (statp))
     str[0] = 'F';
-  else if (IS_MIGRATED_FILE (statp))
-    str[0] = 'M';
   else if (S_TYPEISMQ (statp))
     str[0] = 'Q';
   else if (S_TYPEISSHM (statp))
diff --git a/lib/filemode.h b/lib/filemode.h
index f84a491..a02facb 100644
--- a/lib/filemode.h
+++ b/lib/filemode.h
@@ -1,6 +1,6 @@
 /* Make a string describing file modes.
 
-   Copyright (C) 1998-1999, 2003, 2006, 2009-2020 Free Software Foundation,
+   Copyright (C) 1998-1999, 2003, 2006, 2009-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/filename.h b/lib/filename.h
index 4598fb1..541ffec 100644
--- a/lib/filename.h
+++ b/lib/filename.h
@@ -1,18 +1,20 @@
 /* Basic filename support macros.
-   Copyright (C) 2001-2004, 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2007-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 /* From Paul Eggert and Jim Meyering.  */
 
diff --git a/lib/filevercmp.c b/lib/filevercmp.c
index 9ecfe29..6b7226d 100644
--- a/lib/filevercmp.c
+++ b/lib/filevercmp.c
@@ -1,7 +1,7 @@
 /*
    Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
    Copyright (C) 2001 Anthony Towns <aj@azure.humbug.org.au>
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/filevercmp.h b/lib/filevercmp.h
index 3d0b6a6..5de212f 100644
--- a/lib/filevercmp.h
+++ b/lib/filevercmp.h
@@ -1,7 +1,7 @@
 /*
    Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
    Copyright (C) 2001 Anthony Towns <aj@azure.humbug.org.au>
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/fingerprint.c b/lib/fingerprint.c
index 2c19a55..7266da9 100644
--- a/lib/fingerprint.c
+++ b/lib/fingerprint.c
@@ -1,6 +1,6 @@
 /* Placeholder fingerprint for Emacs
 
-Copyright 2019-2020 Free Software Foundation, Inc.
+Copyright 2019-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/lib/fingerprint.h b/lib/fingerprint.h
index 2faae8d..6ec0c80 100644
--- a/lib/fingerprint.h
+++ b/lib/fingerprint.h
@@ -1,6 +1,6 @@
 /* Header file for the Emacs build fingerprint.
 
-Copyright (C) 2016, 2018-2020 Free Software Foundation, Inc.
+Copyright (C) 2016, 2018-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/lib/flexmember.h b/lib/flexmember.h
index 0dc77c3..9f6e1bf 100644
--- a/lib/flexmember.h
+++ b/lib/flexmember.h
@@ -1,6 +1,6 @@
 /* Sizes of structs with flexible array members.
 
-   Copyright 2016-2020 Free Software Foundation, Inc.
+   Copyright 2016-2021 Free Software Foundation, Inc.
 
    This file is part of the GNU C Library.
 
diff --git a/lib/fpending.c b/lib/fpending.c
index 802ebcb..7c61f7e 100644
--- a/lib/fpending.c
+++ b/lib/fpending.c
@@ -1,5 +1,5 @@
 /* fpending.c -- return the number of pending output bytes on a stream
-   Copyright (C) 2000, 2004, 2006-2007, 2009-2020 Free Software Foundation,
+   Copyright (C) 2000, 2004, 2006-2007, 2009-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -25,7 +25,8 @@
 #include "stdio-impl.h"
 
 /* This file is not used on systems that already have the __fpending function,
-   namely glibc >= 2.2, Solaris >= 7, Android API >= 23.  */
+   namely glibc >= 2.2, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.34,
+   Android API >= 23.  */
 
 /* Return the number of pending (aka buffered, unflushed)
    bytes on the stream, FP, that is open for writing.  */
@@ -39,13 +40,13 @@ __fpending (FILE *fp)
   /* GNU libc, BeOS, Haiku, Linux libc5 */
   return fp->_IO_write_ptr - fp->_IO_write_base;
 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, 
Android */
   return fp->_p - fp->_bf._base;
 #elif defined __EMX__                /* emx+gcc */
   return fp->_ptr - fp->_buffer;
 #elif defined __minix                /* Minix */
   return fp_->_ptr - fp_->_buf;
-#elif defined _IOERR                 /* AIX, HP-UX, IRIX, OSF/1, Solaris, 
OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */
+#elif defined _IOERR                 /* AIX, HP-UX, IRIX, OSF/1, Solaris, 
OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
   return (fp_->_ptr ? fp_->_ptr - fp_->_base : 0);
 #elif defined __UCLIBC__             /* uClibc */
   return (fp->__modeflags & __FLAG_WRITING ? fp->__bufpos - fp->__bufstart : 
0);
diff --git a/lib/fpending.h b/lib/fpending.h
index a8b8859..016341b 100644
--- a/lib/fpending.h
+++ b/lib/fpending.h
@@ -1,6 +1,6 @@
 /* Declare __fpending.
 
-   Copyright (C) 2000, 2003, 2005-2006, 2009-2020 Free Software Foundation,
+   Copyright (C) 2000, 2003, 2005-2006, 2009-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/fpending.h b/lib/free.c
similarity index 66%
copy from lib/fpending.h
copy to lib/free.c
index a8b8859..135c3eb 100644
--- a/lib/fpending.h
+++ b/lib/free.c
@@ -1,7 +1,6 @@
-/* Declare __fpending.
+/* Make free() preserve errno.
 
-   Copyright (C) 2000, 2003, 2005-2006, 2009-2020 Free Software Foundation,
-   Inc.
+   Copyright (C) 2003, 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -14,16 +13,21 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-   Written by Jim Meyering.  */
+/* written by Paul Eggert */
 
-#include <stddef.h>
-#include <stdio.h>
-#if HAVE_STDIO_EXT_H
-# include <stdio_ext.h>
-#endif
+#include <config.h>
 
-#if !HAVE_DECL___FPENDING
-size_t __fpending (FILE *) _GL_ATTRIBUTE_PURE;
-#endif
+#include <stdlib.h>
+
+#include <errno.h>
+
+void
+rpl_free (void *p)
+#undef free
+{
+  int err = errno;
+  free (p);
+  errno = err;
+}
diff --git a/lib/fstatat.c b/lib/fstatat.c
index 9da1269..640a375 100644
--- a/lib/fstatat.c
+++ b/lib/fstatat.c
@@ -1,6 +1,6 @@
 /* Work around an fstatat bug on Solaris 9.
 
-   Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/fsusage.c b/lib/fsusage.c
index 85bfe0e..35de136 100644
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -1,6 +1,6 @@
 /* fsusage.c -- return space usage of mounted file systems
 
-   Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2020 Free Software
+   Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/fsusage.h b/lib/fsusage.h
index 5e68709..e0657b3 100644
--- a/lib/fsusage.h
+++ b/lib/fsusage.h
@@ -1,6 +1,6 @@
 /* fsusage.h -- declarations for file system space usage info
 
-   Copyright (C) 1991-1992, 1997, 2003-2006, 2009-2020 Free Software
+   Copyright (C) 1991-1992, 1997, 2003-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/fsync.c b/lib/fsync.c
index 2298aad..a5280f2 100644
--- a/lib/fsync.c
+++ b/lib/fsync.c
@@ -7,7 +7,7 @@
 
    Written by Richard W.M. Jones <rjones.at.redhat.com>
 
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
diff --git a/lib/ftoastr.c b/lib/ftoastr.c
index 47a8315..0ee0407 100644
--- a/lib/ftoastr.c
+++ b/lib/ftoastr.c
@@ -1,6 +1,6 @@
 /* floating point to accurate string
 
-   Copyright (C) 2010-2020 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/ftoastr.h b/lib/ftoastr.h
index 78b569f..d7ff9e0 100644
--- a/lib/ftoastr.h
+++ b/lib/ftoastr.h
@@ -1,6 +1,6 @@
 /* floating point to accurate string
 
-   Copyright (C) 2010-2020 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/futimens.c b/lib/futimens.c
index 83fb27c..99eaba9 100644
--- a/lib/futimens.c
+++ b/lib/futimens.c
@@ -1,5 +1,5 @@
 /* Set the access and modification time of an open fd.
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/get-permissions.c b/lib/get-permissions.c
index e1bcd9f..fe376e5 100644
--- a/lib/get-permissions.c
+++ b/lib/get-permissions.c
@@ -1,6 +1,6 @@
 /* Get permissions of a file.  -*- coding: utf-8 -*-
 
-   Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
index 0fe7092..56eaf5d 100644
--- a/lib/getdtablesize.c
+++ b/lib/getdtablesize.c
@@ -1,5 +1,5 @@
 /* getdtablesize() function: Return maximum possible file descriptor value + 1.
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/getgroups.c b/lib/getgroups.c
index 4396b4d..af602a7 100644
--- a/lib/getgroups.c
+++ b/lib/getgroups.c
@@ -1,6 +1,6 @@
 /* provide consistent interface to getgroups for systems that don't allow N==0
 
-   Copyright (C) 1996, 1999, 2003, 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1999, 2003, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/getloadavg.c b/lib/getloadavg.c
index 468e250..d42d0cd 100644
--- a/lib/getloadavg.c
+++ b/lib/getloadavg.c
@@ -1,6 +1,6 @@
 /* Get the system load averages.
 
-   Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2020 Free Software
+   Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2021 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with gnulib.
diff --git a/lib/getopt-cdefs.in.h b/lib/getopt-cdefs.in.h
index 674838c..11fe536 100644
--- a/lib/getopt-cdefs.in.h
+++ b/lib/getopt-cdefs.in.h
@@ -1,5 +1,5 @@
 /* getopt-on-non-glibc compatibility macros.
-   Copyright (C) 1989-2020 Free Software Foundation, Inc.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
    This file is part of gnulib.
    Unlike most of the getopt implementation, it is NOT shared
    with the GNU C Library.
diff --git a/lib/getopt-core.h b/lib/getopt-core.h
index d4d942e..05d16b0 100644
--- a/lib/getopt-core.h
+++ b/lib/getopt-core.h
@@ -1,5 +1,5 @@
 /* Declarations for getopt (basic, portable features only).
-   Copyright (C) 1989-2020 Free Software Foundation, Inc.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library and is also part of gnulib.
    Patches to this file should be submitted to both projects.
 
diff --git a/lib/getopt-ext.h b/lib/getopt-ext.h
index 05f7083..9b11b47 100644
--- a/lib/getopt-ext.h
+++ b/lib/getopt-ext.h
@@ -1,5 +1,5 @@
 /* Declarations for getopt (GNU extensions).
-   Copyright (C) 1989-2020 Free Software Foundation, Inc.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library and is also part of gnulib.
    Patches to this file should be submitted to both projects.
 
diff --git a/lib/getopt-pfx-core.h b/lib/getopt-pfx-core.h
index ec545c1..78990a3 100644
--- a/lib/getopt-pfx-core.h
+++ b/lib/getopt-pfx-core.h
@@ -1,5 +1,5 @@
 /* getopt (basic, portable features) gnulib wrapper header.
-   Copyright (C) 1989-2020 Free Software Foundation, Inc.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
    This file is part of gnulib.
    Unlike most of the getopt implementation, it is NOT shared
    with the GNU C Library.
diff --git a/lib/getopt-pfx-ext.h b/lib/getopt-pfx-ext.h
index 647fae6..61ea8d2 100644
--- a/lib/getopt-pfx-ext.h
+++ b/lib/getopt-pfx-ext.h
@@ -1,5 +1,5 @@
 /* getopt (GNU extensions) gnulib wrapper header.
-   Copyright (C) 1989-2020 Free Software Foundation, Inc.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
    This file is part of gnulib.
    Unlike most of the getopt implementation, it is NOT shared
    with the GNU C Library.
diff --git a/lib/getopt.c b/lib/getopt.c
index a6389d8..dd96c18 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -1,5 +1,5 @@
 /* Getopt for GNU.
-   Copyright (C) 1987-2020 Free Software Foundation, Inc.
+   Copyright (C) 1987-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library and is also part of gnulib.
    Patches to this file should be submitted to both projects.
 
diff --git a/lib/getopt.in.h b/lib/getopt.in.h
index 36e04bb..541fb9d 100644
--- a/lib/getopt.in.h
+++ b/lib/getopt.in.h
@@ -1,5 +1,5 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-2020 Free Software Foundation, Inc.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
    This file is part of gnulib.
    Unlike most of the getopt implementation, it is NOT shared
    with the GNU C Library, which supplies a different version of
diff --git a/lib/getopt1.c b/lib/getopt1.c
index 0902efe..ca24eb8 100644
--- a/lib/getopt1.c
+++ b/lib/getopt1.c
@@ -1,5 +1,5 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987-2020 Free Software Foundation, Inc.
+   Copyright (C) 1987-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library and is also part of gnulib.
    Patches to this file should be submitted to both projects.
 
diff --git a/lib/getopt_int.h b/lib/getopt_int.h
index afcd8a6..b70ff5b 100644
--- a/lib/getopt_int.h
+++ b/lib/getopt_int.h
@@ -1,5 +1,5 @@
 /* Internal declarations for getopt.
-   Copyright (C) 1989-2020 Free Software Foundation, Inc.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library and is also part of gnulib.
    Patches to this file should be submitted to both projects.
 
diff --git a/lib/getrandom.c b/lib/getrandom.c
index f8695ab..41212fb 100644
--- a/lib/getrandom.c
+++ b/lib/getrandom.c
@@ -1,6 +1,6 @@
 /* Obtain a series of random bytes.
 
-   Copyright 2020 Free Software Foundation, Inc.
+   Copyright 2020-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/gettext.h b/lib/gettext.h
index 0bd1e13..3552157 100644
--- a/lib/gettext.h
+++ b/lib/gettext.h
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2020 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/gettime.c b/lib/gettime.c
index f5b8ca5..fb721b2 100644
--- a/lib/gettime.c
+++ b/lib/gettime.c
@@ -1,6 +1,6 @@
 /* gettime -- get the system clock
 
-   Copyright (C) 2002, 2004-2007, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
index 5301e7c..b1c93e1 100644
--- a/lib/gettimeofday.c
+++ b/lib/gettimeofday.c
@@ -1,6 +1,6 @@
 /* Provide gettimeofday for systems that don't have it or for which it's 
broken.
 
-   Copyright (C) 2001-2003, 2005-2007, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 9953198..c457ac6 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -1,5 +1,5 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -103,6 +103,7 @@
 #  filevercmp \
 #  flexmember \
 #  fpieee \
+#  free-posix \
 #  fstatat \
 #  fsusage \
 #  fsync \
@@ -241,7 +242,6 @@ GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
 GETOPT_H = @GETOPT_H@
 GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@
 GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@
-GLIBC21 = @GLIBC21@
 GL_COND_LIBTOOL = @GL_COND_LIBTOOL@
 GL_GENERATE_ALLOCA_H = @GL_GENERATE_ALLOCA_H@
 GL_GENERATE_BYTESWAP_H = @GL_GENERATE_BYTESWAP_H@
@@ -257,6 +257,7 @@ GL_GENERATE_STDINT_H = @GL_GENERATE_STDINT_H@
 GMALLOC_OBJ = @GMALLOC_OBJ@
 GMP_H = @GMP_H@
 GNULIB_ACCESS = @GNULIB_ACCESS@
+GNULIB_ALIGNED_ALLOC = @GNULIB_ALIGNED_ALLOC@
 GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
@@ -275,6 +276,13 @@ GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_EXECL = @GNULIB_EXECL@
+GNULIB_EXECLE = @GNULIB_EXECLE@
+GNULIB_EXECLP = @GNULIB_EXECLP@
+GNULIB_EXECV = @GNULIB_EXECV@
+GNULIB_EXECVE = @GNULIB_EXECVE@
+GNULIB_EXECVP = @GNULIB_EXECVP@
+GNULIB_EXECVPE = @GNULIB_EXECVPE@
 GNULIB_EXPLICIT_BZERO = @GNULIB_EXPLICIT_BZERO@
 GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
@@ -297,6 +305,7 @@ GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
 GNULIB_FREAD = @GNULIB_FREAD@
+GNULIB_FREE_POSIX = @GNULIB_FREE_POSIX@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FSCANF = @GNULIB_FSCANF@
 GNULIB_FSEEK = @GNULIB_FSEEK@
@@ -359,10 +368,51 @@ GNULIB_MBSSPN = @GNULIB_MBSSPN@
 GNULIB_MBSSTR = @GNULIB_MBSSTR@
 GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
 GNULIB_MBTOWC = @GNULIB_MBTOWC@
+GNULIB_MDA_ACCESS = @GNULIB_MDA_ACCESS@
+GNULIB_MDA_CHDIR = @GNULIB_MDA_CHDIR@
+GNULIB_MDA_CHMOD = @GNULIB_MDA_CHMOD@
+GNULIB_MDA_CLOSE = @GNULIB_MDA_CLOSE@
+GNULIB_MDA_CREAT = @GNULIB_MDA_CREAT@
+GNULIB_MDA_DUP = @GNULIB_MDA_DUP@
+GNULIB_MDA_DUP2 = @GNULIB_MDA_DUP2@
+GNULIB_MDA_ECVT = @GNULIB_MDA_ECVT@
+GNULIB_MDA_EXECL = @GNULIB_MDA_EXECL@
+GNULIB_MDA_EXECLE = @GNULIB_MDA_EXECLE@
+GNULIB_MDA_EXECLP = @GNULIB_MDA_EXECLP@
+GNULIB_MDA_EXECV = @GNULIB_MDA_EXECV@
+GNULIB_MDA_EXECVE = @GNULIB_MDA_EXECVE@
+GNULIB_MDA_EXECVP = @GNULIB_MDA_EXECVP@
+GNULIB_MDA_EXECVPE = @GNULIB_MDA_EXECVPE@
+GNULIB_MDA_FCLOSEALL = @GNULIB_MDA_FCLOSEALL@
+GNULIB_MDA_FCVT = @GNULIB_MDA_FCVT@
+GNULIB_MDA_FDOPEN = @GNULIB_MDA_FDOPEN@
+GNULIB_MDA_FILENO = @GNULIB_MDA_FILENO@
+GNULIB_MDA_GCVT = @GNULIB_MDA_GCVT@
+GNULIB_MDA_GETCWD = @GNULIB_MDA_GETCWD@
+GNULIB_MDA_GETPID = @GNULIB_MDA_GETPID@
+GNULIB_MDA_GETW = @GNULIB_MDA_GETW@
+GNULIB_MDA_ISATTY = @GNULIB_MDA_ISATTY@
+GNULIB_MDA_LSEEK = @GNULIB_MDA_LSEEK@
+GNULIB_MDA_MEMCCPY = @GNULIB_MDA_MEMCCPY@
+GNULIB_MDA_MKDIR = @GNULIB_MDA_MKDIR@
+GNULIB_MDA_MKTEMP = @GNULIB_MDA_MKTEMP@
+GNULIB_MDA_OPEN = @GNULIB_MDA_OPEN@
+GNULIB_MDA_PUTENV = @GNULIB_MDA_PUTENV@
+GNULIB_MDA_PUTW = @GNULIB_MDA_PUTW@
+GNULIB_MDA_READ = @GNULIB_MDA_READ@
+GNULIB_MDA_RMDIR = @GNULIB_MDA_RMDIR@
+GNULIB_MDA_STRDUP = @GNULIB_MDA_STRDUP@
+GNULIB_MDA_SWAB = @GNULIB_MDA_SWAB@
+GNULIB_MDA_TEMPNAM = @GNULIB_MDA_TEMPNAM@
+GNULIB_MDA_TZSET = @GNULIB_MDA_TZSET@
+GNULIB_MDA_UMASK = @GNULIB_MDA_UMASK@
+GNULIB_MDA_UNLINK = @GNULIB_MDA_UNLINK@
+GNULIB_MDA_WRITE = @GNULIB_MDA_WRITE@
 GNULIB_MEMCHR = @GNULIB_MEMCHR@
 GNULIB_MEMMEM = @GNULIB_MEMMEM@
 GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
 GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIR = @GNULIB_MKDIR@
 GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
 GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
 GNULIB_MKFIFO = @GNULIB_MKFIFO@
@@ -388,6 +438,7 @@ GNULIB_PERROR = @GNULIB_PERROR@
 GNULIB_PIPE = @GNULIB_PIPE@
 GNULIB_PIPE2 = @GNULIB_PIPE2@
 GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_MEMALIGN = @GNULIB_POSIX_MEMALIGN@
 GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
 GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
@@ -506,6 +557,7 @@ GTK_OBJ = @GTK_OBJ@
 GZIP_PROG = @GZIP_PROG@
 HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
 HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
 HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
 HAVE_ATOLL = @HAVE_ATOLL@
@@ -515,13 +567,18 @@ HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
 HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
 HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
 HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
@@ -557,6 +614,7 @@ HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
 HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
 HAVE_FACCESSAT = @HAVE_FACCESSAT@
 HAVE_FCHDIR = @HAVE_FCHDIR@
@@ -621,6 +679,7 @@ HAVE_PDUMPER = @HAVE_PDUMPER@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_PREAD = @HAVE_PREAD@
@@ -863,6 +922,7 @@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RALLOC_OBJ = @RALLOC_OBJ@
 RANLIB = @RANLIB@
 REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
 REPLACE_CALLOC = @REPLACE_CALLOC@
 REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
 REPLACE_CHOWN = @REPLACE_CHOWN@
@@ -874,6 +934,13 @@ REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
 REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
 REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
@@ -885,6 +952,7 @@ REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
@@ -932,6 +1000,7 @@ REPLACE_OPENAT = @REPLACE_OPENAT@
 REPLACE_OPENDIR = @REPLACE_OPENDIR@
 REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
 REPLACE_PSELECT = @REPLACE_PSELECT@
@@ -1097,6 +1166,7 @@ gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b = 
@gl_GNULIB_ENABLED_260941c0
 gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31 = 
@gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31@
 gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c = 
@gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c@
 gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec = 
@gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec@
+gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c = 
@gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c@
 gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1 = 
@gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1@
 gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36 = 
@gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36@
 gl_GNULIB_ENABLED_cloexec = @gl_GNULIB_ENABLED_cloexec@
@@ -1104,9 +1174,11 @@ gl_GNULIB_ENABLED_dirfd = @gl_GNULIB_ENABLED_dirfd@
 gl_GNULIB_ENABLED_euidaccess = @gl_GNULIB_ENABLED_euidaccess@
 gl_GNULIB_ENABLED_getdtablesize = @gl_GNULIB_ENABLED_getdtablesize@
 gl_GNULIB_ENABLED_getgroups = @gl_GNULIB_ENABLED_getgroups@
+gl_GNULIB_ENABLED_idx = @gl_GNULIB_ENABLED_idx@
 gl_GNULIB_ENABLED_lchmod = @gl_GNULIB_ENABLED_lchmod@
-gl_GNULIB_ENABLED_malloca = @gl_GNULIB_ENABLED_malloca@
 gl_GNULIB_ENABLED_open = @gl_GNULIB_ENABLED_open@
+gl_GNULIB_ENABLED_rawmemchr = @gl_GNULIB_ENABLED_rawmemchr@
+gl_GNULIB_ENABLED_scratch_buffer = @gl_GNULIB_ENABLED_scratch_buffer@
 gl_GNULIB_ENABLED_strtoll = @gl_GNULIB_ENABLED_strtoll@
 gl_GNULIB_ENABLED_utimens = @gl_GNULIB_ENABLED_utimens@
 gl_LIBOBJS = @gl_LIBOBJS@
@@ -1512,6 +1584,17 @@ EXTRA_libgnu_a_SOURCES += dup2.c
 endif
 ## end   gnulib module dup2
 
+## begin gnulib module eloop-threshold
+ifeq (,$(OMIT_GNULIB_MODULE_eloop-threshold))
+
+ifneq (,$(gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c))
+
+endif
+EXTRA_DIST += eloop-threshold.h
+
+endif
+## end   gnulib module eloop-threshold
+
 ## begin gnulib module errno
 ifeq (,$(OMIT_GNULIB_MODULE_errno))
 
@@ -1652,6 +1735,8 @@ fcntl.h: fcntl.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
              -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
              -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
+             -e 's/@''GNULIB_MDA_CREAT''@/$(GNULIB_MDA_CREAT)/g' \
+             -e 's/@''GNULIB_MDA_OPEN''@/$(GNULIB_MDA_OPEN)/g' \
              -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
              -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
              -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \
@@ -1731,6 +1816,17 @@ EXTRA_libgnu_a_SOURCES += fpending.c
 endif
 ## end   gnulib module fpending
 
+## begin gnulib module free-posix
+ifeq (,$(OMIT_GNULIB_MODULE_free-posix))
+
+
+EXTRA_DIST += free.c
+
+EXTRA_libgnu_a_SOURCES += free.c
+
+endif
+## end   gnulib module free-posix
+
 ## begin gnulib module fstatat
 ifeq (,$(OMIT_GNULIB_MODULE_fstatat))
 
@@ -1912,6 +2008,16 @@ EXTRA_libgnu_a_SOURCES += group-member.c
 endif
 ## end   gnulib module group-member
 
+## begin gnulib module idx
+ifeq (,$(OMIT_GNULIB_MODULE_idx))
+
+ifneq (,$(gl_GNULIB_ENABLED_idx))
+libgnu_a_SOURCES += idx.h
+
+endif
+endif
+## end   gnulib module idx
+
 ## begin gnulib module ieee754-h
 ifeq (,$(OMIT_GNULIB_MODULE_ieee754-h))
 
@@ -2094,18 +2200,6 @@ EXTRA_libgnu_a_SOURCES += lstat.c
 endif
 ## end   gnulib module lstat
 
-## begin gnulib module malloca
-ifeq (,$(OMIT_GNULIB_MODULE_malloca))
-
-ifneq (,$(gl_GNULIB_ENABLED_malloca))
-libgnu_a_SOURCES += malloca.c
-
-endif
-EXTRA_DIST += malloca.h
-
-endif
-## end   gnulib module malloca
-
 ## begin gnulib module memmem-simple
 ifeq (,$(OMIT_GNULIB_MODULE_memmem-simple))
 
@@ -2263,6 +2357,19 @@ libgnu_a_SOURCES += qcopy-acl.c
 endif
 ## end   gnulib module qcopy-acl
 
+## begin gnulib module rawmemchr
+ifeq (,$(OMIT_GNULIB_MODULE_rawmemchr))
+
+ifneq (,$(gl_GNULIB_ENABLED_rawmemchr))
+
+endif
+EXTRA_DIST += rawmemchr.c rawmemchr.valgrind
+
+EXTRA_libgnu_a_SOURCES += rawmemchr.c
+
+endif
+## end   gnulib module rawmemchr
+
 ## begin gnulib module readlink
 ifeq (,$(OMIT_GNULIB_MODULE_readlink))
 
@@ -2307,6 +2414,18 @@ EXTRA_DIST += root-uid.h
 endif
 ## end   gnulib module root-uid
 
+## begin gnulib module scratch_buffer
+ifeq (,$(OMIT_GNULIB_MODULE_scratch_buffer))
+
+ifneq (,$(gl_GNULIB_ENABLED_scratch_buffer))
+libgnu_a_SOURCES += malloc/scratch_buffer_dupfree.c                 
malloc/scratch_buffer_grow.c                 
malloc/scratch_buffer_grow_preserve.c                 
malloc/scratch_buffer_set_array_size.c
+
+endif
+EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h
+
+endif
+## end   gnulib module scratch_buffer
+
 ## begin gnulib module sig2str
 ifeq (,$(OMIT_GNULIB_MODULE_sig2str))
 
@@ -2617,8 +2736,15 @@ stdio.h: stdio.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
              -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
              -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GNULIB_MDA_FCLOSEALL)/g' \
+             -e 's/@''GNULIB_MDA_FDOPEN''@/$(GNULIB_MDA_FDOPEN)/g' \
+             -e 's/@''GNULIB_MDA_FILENO''@/$(GNULIB_MDA_FILENO)/g' \
+             -e 's/@''GNULIB_MDA_GETW''@/$(GNULIB_MDA_GETW)/g' \
+             -e 's/@''GNULIB_MDA_PUTW''@/$(GNULIB_MDA_PUTW)/g' \
+             -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GNULIB_MDA_TEMPNAM)/g' \
              < $(srcdir)/stdio.in.h | \
-         sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+         sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
+             -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
              -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
              -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
              -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
@@ -2696,9 +2822,11 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
              -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
+             -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GNULIB_ALIGNED_ALLOC)/g' \
              -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
              -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
              -e 
's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
+             -e 's/@''GNULIB_FREE_POSIX''@/$(GNULIB_FREE_POSIX)/g' \
              -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
              -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
              -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
@@ -2709,6 +2837,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) \
              -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
              -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
              -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
+             -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GNULIB_POSIX_MEMALIGN)/g' \
              -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \
              -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
              -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
@@ -2730,10 +2859,19 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) \
              -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
              -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
              -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
+             -e 's/@''GNULIB_MDA_ECVT''@/$(GNULIB_MDA_ECVT)/g' \
+             -e 's/@''GNULIB_MDA_FCVT''@/$(GNULIB_MDA_FCVT)/g' \
+             -e 's/@''GNULIB_MDA_GCVT''@/$(GNULIB_MDA_GCVT)/g' \
+             -e 's/@''GNULIB_MDA_MKTEMP''@/$(GNULIB_MDA_MKTEMP)/g' \
+             -e 's/@''GNULIB_MDA_PUTENV''@/$(GNULIB_MDA_PUTENV)/g' \
              < $(srcdir)/stdlib.in.h | \
          sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+             -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
              -e 
's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \
+             -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \
+             -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \
              -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
              -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
              -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
@@ -2745,6 +2883,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) \
              -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
              -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
              -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+             -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \
              -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
              -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
              -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
@@ -2767,12 +2906,15 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) \
              -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
              -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
              -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+             -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
              -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
              -e 
's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
              -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
              -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
              -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+             -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
              -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
              -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
@@ -2867,6 +3009,8 @@ string.h: string.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's/@''GNULIB_SIGDESCR_NP''@/$(GNULIB_SIGDESCR_NP)/g' \
              -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
              -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
+             -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GNULIB_MDA_MEMCCPY)/g' \
+             -e 's/@''GNULIB_MDA_STRDUP''@/$(GNULIB_MDA_STRDUP)/g' \
              < $(srcdir)/string.in.h | \
          sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
              -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
@@ -3062,6 +3206,7 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNU
              -e 's/@''GNULIB_GETUMASK''@/$(GNULIB_GETUMASK)/g' \
              -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
              -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
+             -e 's/@''GNULIB_MKDIR''@/$(GNULIB_MKDIR)/g' \
              -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
              -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
              -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
@@ -3070,6 +3215,9 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNU
              -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
              -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \
              -e 
's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GNULIB_OVERRIDES_STRUCT_STAT)/g' \
+             -e 's/@''GNULIB_MDA_CHMOD''@/$(GNULIB_MDA_CHMOD)/g' \
+             -e 's/@''GNULIB_MDA_MKDIR''@/$(GNULIB_MDA_MKDIR)/g' \
+             -e 's/@''GNULIB_MDA_UMASK''@/$(GNULIB_MDA_UMASK)/g' \
              -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
              -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
              -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
@@ -3205,6 +3353,7 @@ time.h: time.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
              -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \
              -e 's/@''GNULIB_TZSET''@/$(GNULIB_TZSET)/g' \
+             -e 's/@''GNULIB_MDA_TZSET''@/$(GNULIB_MDA_TZSET)/g' \
              -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
              -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
              -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
@@ -3333,6 +3482,13 @@ unistd.h: unistd.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
              -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
              -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
+             -e 's/@''GNULIB_EXECL''@/$(GNULIB_EXECL)/g' \
+             -e 's/@''GNULIB_EXECLE''@/$(GNULIB_EXECLE)/g' \
+             -e 's/@''GNULIB_EXECLP''@/$(GNULIB_EXECLP)/g' \
+             -e 's/@''GNULIB_EXECV''@/$(GNULIB_EXECV)/g' \
+             -e 's/@''GNULIB_EXECVE''@/$(GNULIB_EXECVE)/g' \
+             -e 's/@''GNULIB_EXECVP''@/$(GNULIB_EXECVP)/g' \
+             -e 's/@''GNULIB_EXECVPE''@/$(GNULIB_EXECVPE)/g' \
              -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
              -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
              -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
@@ -3378,11 +3534,33 @@ unistd.h: unistd.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
              -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
              -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
+             -e 's/@''GNULIB_MDA_ACCESS''@/$(GNULIB_MDA_ACCESS)/g' \
+             -e 's/@''GNULIB_MDA_CHDIR''@/$(GNULIB_MDA_CHDIR)/g' \
+             -e 's/@''GNULIB_MDA_CLOSE''@/$(GNULIB_MDA_CLOSE)/g' \
+             -e 's/@''GNULIB_MDA_DUP''@/$(GNULIB_MDA_DUP)/g' \
+             -e 's/@''GNULIB_MDA_DUP2''@/$(GNULIB_MDA_DUP2)/g' \
+             -e 's/@''GNULIB_MDA_EXECL''@/$(GNULIB_MDA_EXECL)/g' \
+             -e 's/@''GNULIB_MDA_EXECLE''@/$(GNULIB_MDA_EXECLE)/g' \
+             -e 's/@''GNULIB_MDA_EXECLP''@/$(GNULIB_MDA_EXECLP)/g' \
+             -e 's/@''GNULIB_MDA_EXECV''@/$(GNULIB_MDA_EXECV)/g' \
+             -e 's/@''GNULIB_MDA_EXECVE''@/$(GNULIB_MDA_EXECVE)/g' \
+             -e 's/@''GNULIB_MDA_EXECVP''@/$(GNULIB_MDA_EXECVP)/g' \
+             -e 's/@''GNULIB_MDA_EXECVPE''@/$(GNULIB_MDA_EXECVPE)/g' \
+             -e 's/@''GNULIB_MDA_GETCWD''@/$(GNULIB_MDA_GETCWD)/g' \
+             -e 's/@''GNULIB_MDA_GETPID''@/$(GNULIB_MDA_GETPID)/g' \
+             -e 's/@''GNULIB_MDA_ISATTY''@/$(GNULIB_MDA_ISATTY)/g' \
+             -e 's/@''GNULIB_MDA_LSEEK''@/$(GNULIB_MDA_LSEEK)/g' \
+             -e 's/@''GNULIB_MDA_READ''@/$(GNULIB_MDA_READ)/g' \
+             -e 's/@''GNULIB_MDA_RMDIR''@/$(GNULIB_MDA_RMDIR)/g' \
+             -e 's/@''GNULIB_MDA_SWAB''@/$(GNULIB_MDA_SWAB)/g' \
+             -e 's/@''GNULIB_MDA_UNLINK''@/$(GNULIB_MDA_UNLINK)/g' \
+             -e 's/@''GNULIB_MDA_WRITE''@/$(GNULIB_MDA_WRITE)/g' \
              < $(srcdir)/unistd.in.h | \
          sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
              -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \
              -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
              -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+             -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \
              -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
              -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
              -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
@@ -3412,6 +3590,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+             -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \
              -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
              -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
              -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' 
\
@@ -3430,6 +3609,13 @@ unistd.h: unistd.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
              -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+             -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
+             -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \
+             -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \
+             -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \
+             -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \
+             -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \
+             -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
              -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
              -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
diff --git a/lib/group-member.c b/lib/group-member.c
index 6a6fc56..5215901 100644
--- a/lib/group-member.c
+++ b/lib/group-member.c
@@ -1,6 +1,6 @@
 /* group-member.c -- determine whether group id is in calling user's group list
 
-   Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2020 Free Software
+   Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/idx.h b/lib/idx.h
new file mode 100644
index 0000000..681c8c9
--- /dev/null
+++ b/lib/idx.h
@@ -0,0 +1,114 @@
+/* A type for indices and sizes.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _IDX_H
+#define _IDX_H
+
+/* Get ptrdiff_t.  */
+#include <stddef.h>
+
+/* Get PTRDIFF_MAX.  */
+#include <stdint.h>
+
+/* The type 'idx_t' holds an (array) index or an (object) size.
+   Its implementation promotes to a signed integer type,
+   which can hold the values
+     0..2^63-1 (on 64-bit platforms) or
+     0..2^31-1 (on 32-bit platforms).
+
+   Why a signed integer type?
+
+     * Security: Signed types can be checked for overflow via
+       '-fsanitize=undefined', but unsigned types cannot.
+
+     * Comparisons without surprises: ISO C99 § 6.3.1.8 specifies a few
+       surprising results for comparisons, such as
+
+           (int) -3 < (unsigned long) 7  =>  false
+           (int) -3 < (unsigned int) 7   =>  false
+       and on 32-bit machines:
+           (long) -3 < (unsigned int) 7  =>  false
+
+       This is surprising because the natural comparison order is by
+       value in the realm of infinite-precision signed integers (ℤ).
+
+       The best way to get rid of such surprises is to use signed types
+       for numerical integer values, and use unsigned types only for
+       bit masks and enums.
+
+   Why not use 'size_t' directly?
+
+     * Because 'size_t' is an unsigned type, and a signed type is better.
+       See above.
+
+   Why not use 'ptrdiff_t' directly?
+
+     * Maintainability: When reading and modifying code, it helps to know that
+       a certain variable cannot have negative values.  For example, when you
+       have a loop
+
+         int n = ...;
+         for (int i = 0; i < n; i++) ...
+
+       or
+
+         ptrdiff_t n = ...;
+         for (ptrdiff_t i = 0; i < n; i++) ...
+
+       you have to ask yourself "what if n < 0?".  Whereas in
+
+         idx_t n = ...;
+         for (idx_t i = 0; i < n; i++) ...
+
+       you know that this case cannot happen.
+
+       Similarly, when a programmer writes
+
+         idx_t = ptr2 - ptr1;
+
+       there is an implied assertion that ptr1 and ptr2 point into the same
+       object and that ptr1 <= ptr2.
+
+     * Being future-proof: In the future, range types (integers which are
+       constrained to a certain range of values) may be added to C compilers
+       or to the C standard.  Several programming languages (Ada, Haskell,
+       Common Lisp, Pascal) already have range types.  Such range types may
+       help producing good code and good warnings.  The type 'idx_t' could
+       then be typedef'ed to a range type that is signed after promotion.  */
+
+/* In the future, idx_t could be typedef'ed to a signed range type.
+   The clang "extended integer types", supported in Clang 11 or newer
+   
<https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types>,
+   are a special case of range types.  However, these types don't support 
binary
+   operators with plain integer types (e.g. expressions such as x > 1).
+   Therefore, they don't behave like signed types (and not like unsigned types
+   either).  So, we cannot use them here.  */
+
+/* Use the signed type 'ptrdiff_t'.  */
+/* Note: ISO C does not mandate that 'size_t' and 'ptrdiff_t' have the same
+   size, but it is so on all platforms we have seen since 1990.  */
+typedef ptrdiff_t idx_t;
+
+/* IDX_MAX is the maximum value of an idx_t.  */
+#define IDX_MAX PTRDIFF_MAX
+
+/* So far no need has been found for an IDX_WIDTH macro.
+   Perhaps there should be another macro IDX_VALUE_BITS that does not
+   count the sign bit and is therefore one less than PTRDIFF_WIDTH.  */
+
+#endif /* _IDX_H */
diff --git a/lib/ieee754.in.h b/lib/ieee754.in.h
index d64bb46..ce13efc 100644
--- a/lib/ieee754.in.h
+++ b/lib/ieee754.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
diff --git a/lib/ignore-value.h b/lib/ignore-value.h
index ec3288f..0a3cf1e 100644
--- a/lib/ignore-value.h
+++ b/lib/ignore-value.h
@@ -1,6 +1,6 @@
 /* ignore a function return without a compiler warning.  -*- coding: utf-8 -*-
 
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/intprops.h b/lib/intprops.h
index b27f2ee..2a420ac 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -1,6 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -226,7 +226,9 @@
 
 /* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
    (A, B, P) work when P is non-null.  */
-#if 5 <= __GNUC__ && !defined __ICC
+/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
+   see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>.  */
+#if 7 <= __GNUC__ && !defined __ICC
 # define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
 #elif defined __has_builtin
 # define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -244,7 +246,17 @@
 
 /* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
    __builtin_sub_overflow_p and __builtin_mul_overflow_p.  */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#if defined __clang__ || defined __ICC
+/* Clang 11 lacks __builtin_mul_overflow_p, and even if it did it
+   would presumably run afoul of Clang bug 16404.  ICC 2021.1's
+   __builtin_add_overflow_p etc. are not treated as integral constant
+   expressions even when all arguments are.  */
+# define _GL_HAS_BUILTIN_OVERFLOW_P 0
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p)
+#else
+# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#endif
 
 /* The _GL*_OVERFLOW macros have the same restrictions as the
    *_RANGE_OVERFLOW macros, except that they do not assume that operands
@@ -377,8 +389,9 @@
    _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
 #endif
 #if _GL_HAS_BUILTIN_MUL_OVERFLOW
-# if (9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
-      || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__))
+# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
+       || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
+      && !defined __ICC)
 #  define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
 # else
    /* Work around GCC bug 91450.  */
@@ -585,4 +598,33 @@
          : (tmin) / (a) < (b)) \
       : (tmax) / (b) < (a)))
 
+/* The following macros compute A + B, A - B, and A * B, respectively.
+   If no overflow occurs, they set *R to the result and return 1;
+   otherwise, they return 0 and may modify *R.
+
+   Example usage:
+
+     long int result;
+     if (INT_ADD_OK (a, b, &result))
+       printf ("result is %ld\n", result);
+     else
+       printf ("overflow\n");
+
+   A, B, and *R should be integers; they need not be the same type,
+   and they need not be all signed or all unsigned.
+
+   These macros work correctly on all known practical hosts, and do not rely
+   on undefined behavior due to signed arithmetic overflow.
+
+   These macros are not constant expressions.
+
+   These macros may evaluate their arguments zero or multiple times, so the
+   arguments should not have side effects.
+
+   These macros are tuned for B being a constant.  */
+
+#define INT_ADD_OK(a, b, r) ! INT_ADD_WRAPV (a, b, r)
+#define INT_SUBTRACT_OK(a, b, r) ! INT_SUBTRACT_WRAPV (a, b, r)
+#define INT_MULTIPLY_OK(a, b, r) ! INT_MULTIPLY_WRAPV (a, b, r)
+
 #endif /* _GL_INTPROPS_H */
diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h
index 596a050..e9ee500 100644
--- a/lib/inttypes.in.h
+++ b/lib/inttypes.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Derek Price.
    This file is part of gnulib.
 
diff --git a/lib/lchmod.c b/lib/lchmod.c
index 77a0060..195304f 100644
--- a/lib/lchmod.c
+++ b/lib/lchmod.c
@@ -1,6 +1,6 @@
 /* Implement lchmod on platforms where it does not work correctly.
 
-   Copyright 2020 Free Software Foundation, Inc.
+   Copyright 2020-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/libc-config.h b/lib/libc-config.h
index 1300c3a..d4e2995 100644
--- a/lib/libc-config.h
+++ b/lib/libc-config.h
@@ -1,6 +1,6 @@
 /* System definitions for code taken from the GNU C Library
 
-   Copyright 2017-2020 Free Software Foundation, Inc.
+   Copyright 2017-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
diff --git a/lib/limits.in.h b/lib/limits.in.h
index d25c523..076ab9e 100644
--- a/lib/limits.in.h
+++ b/lib/limits.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <limits.h>.
 
-   Copyright 2016-2020 Free Software Foundation, Inc.
+   Copyright 2016-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
diff --git a/lib/lstat.c b/lib/lstat.c
index f74392b..a584c6a 100644
--- a/lib/lstat.c
+++ b/lib/lstat.c
@@ -1,6 +1,6 @@
 /* Work around a bug of lstat on some systems
 
-   Copyright (C) 1997-2006, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 1997-2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/malloc/scratch_buffer.h b/lib/malloc/scratch_buffer.h
new file mode 100644
index 0000000..26e3062
--- /dev/null
+++ b/lib/malloc/scratch_buffer.h
@@ -0,0 +1,151 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2015-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SCRATCH_BUFFER_H
+#define _SCRATCH_BUFFER_H
+
+/* Scratch buffers with a default stack allocation and fallback to
+   heap allocation.  It is expected that this function is used in this
+   way:
+
+     struct scratch_buffer tmpbuf;
+     scratch_buffer_init (&tmpbuf);
+
+     while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+       if (!scratch_buffer_grow (&tmpbuf))
+        return -1;
+
+     scratch_buffer_free (&tmpbuf);
+     return 0;
+
+   The allocation functions (scratch_buffer_grow,
+   scratch_buffer_grow_preserve, scratch_buffer_set_array_size) make
+   sure that the heap allocation, if any, is freed, so that the code
+   above does not have a memory leak.  The buffer still remains in a
+   state that can be deallocated using scratch_buffer_free, so a loop
+   like this is valid as well:
+
+     struct scratch_buffer tmpbuf;
+     scratch_buffer_init (&tmpbuf);
+
+     while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+       if (!scratch_buffer_grow (&tmpbuf))
+        break;
+
+     scratch_buffer_free (&tmpbuf);
+
+   scratch_buffer_grow and scratch_buffer_grow_preserve are guaranteed
+   to grow the buffer by at least 512 bytes.  This means that when
+   using the scratch buffer as a backing store for a non-character
+   array whose element size, in bytes, is 512 or smaller, the scratch
+   buffer only has to grow once to make room for at least one more
+   element.
+*/
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+/* Scratch buffer.  Must be initialized with scratch_buffer_init
+   before its use.  */
+struct scratch_buffer {
+  void *data;    /* Pointer to the beginning of the scratch area.  */
+  size_t length; /* Allocated space at the data pointer, in bytes.  */
+  union { max_align_t __align; char __c[1024]; } __space;
+};
+
+/* Initializes *BUFFER so that BUFFER->data points to BUFFER->__space
+   and BUFFER->length reflects the available space.  */
+static inline void
+scratch_buffer_init (struct scratch_buffer *buffer)
+{
+  buffer->data = buffer->__space.__c;
+  buffer->length = sizeof (buffer->__space);
+}
+
+/* Deallocates *BUFFER (if it was heap-allocated).  */
+static inline void
+scratch_buffer_free (struct scratch_buffer *buffer)
+{
+  if (buffer->data != buffer->__space.__c)
+    free (buffer->data);
+}
+
+/* Grow *BUFFER by some arbitrary amount.  The buffer contents is NOT
+   preserved.  Return true on success, false on allocation failure (in
+   which case the old buffer is freed).  On success, the new buffer is
+   larger than the previous size.  On failure, *BUFFER is deallocated,
+   but remains in a free-able state, and errno is set.  */
+bool __libc_scratch_buffer_grow (struct scratch_buffer *buffer);
+libc_hidden_proto (__libc_scratch_buffer_grow)
+
+/* Alias for __libc_scratch_buffer_grow.  */
+static __always_inline bool
+scratch_buffer_grow (struct scratch_buffer *buffer)
+{
+  return __glibc_likely (__libc_scratch_buffer_grow (buffer));
+}
+
+/* Like __libc_scratch_buffer_grow, but preserve the old buffer
+   contents on success, as a prefix of the new buffer.  */
+bool __libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer);
+libc_hidden_proto (__libc_scratch_buffer_grow_preserve)
+
+/* Alias for __libc_scratch_buffer_grow_preserve.  */
+static __always_inline bool
+scratch_buffer_grow_preserve (struct scratch_buffer *buffer)
+{
+  return __glibc_likely (__libc_scratch_buffer_grow_preserve (buffer));
+}
+
+/* Grow *BUFFER so that it can store at least NELEM elements of SIZE
+   bytes.  The buffer contents are NOT preserved.  Both NELEM and SIZE
+   can be zero.  Return true on success, false on allocation failure
+   (in which case the old buffer is freed, but *BUFFER remains in a
+   free-able state, and errno is set).  It is unspecified whether this
+   function can reduce the array size.  */
+bool __libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+                                          size_t nelem, size_t size);
+libc_hidden_proto (__libc_scratch_buffer_set_array_size)
+
+/* Alias for __libc_scratch_set_array_size.  */
+static __always_inline bool
+scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+                              size_t nelem, size_t size)
+{
+  return __glibc_likely (__libc_scratch_buffer_set_array_size
+                        (buffer, nelem, size));
+}
+
+/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
+   deallocating *BUFFER if it was heap-allocated.  SIZE must be at
+   most *BUFFER's size.  Return NULL (setting errno) on memory
+   exhaustion.  */
+void *__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer,
+                                     size_t size);
+libc_hidden_proto (__libc_scratch_buffer_dupfree)
+
+/* Alias for __libc_scratch_dupfree.  */
+static __always_inline void *
+scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
+{
+  void *r = __libc_scratch_buffer_dupfree (buffer, size);
+  return __glibc_likely (r != NULL) ? r : NULL;
+}
+
+#endif /* _SCRATCH_BUFFER_H */
diff --git a/lib/malloc/scratch_buffer_dupfree.c 
b/lib/malloc/scratch_buffer_dupfree.c
new file mode 100644
index 0000000..775bff5
--- /dev/null
+++ b/lib/malloc/scratch_buffer_dupfree.c
@@ -0,0 +1,41 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <string.h>
+
+void *
+__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
+{
+  void *data = buffer->data;
+  if (data == buffer->__space.__c)
+    {
+      void *copy = malloc (size);
+      return copy != NULL ? memcpy (copy, data, size) : NULL;
+    }
+  else
+    {
+      void *copy = realloc (data, size);
+      return copy != NULL ? copy : data;
+    }
+}
+libc_hidden_def (__libc_scratch_buffer_dupfree)
diff --git a/lib/malloc/scratch_buffer_grow.c b/lib/malloc/scratch_buffer_grow.c
new file mode 100644
index 0000000..41befe3
--- /dev/null
+++ b/lib/malloc/scratch_buffer_grow.c
@@ -0,0 +1,56 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2015-2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <errno.h>
+
+bool
+__libc_scratch_buffer_grow (struct scratch_buffer *buffer)
+{
+  void *new_ptr;
+  size_t new_length = buffer->length * 2;
+
+  /* Discard old buffer.  */
+  scratch_buffer_free (buffer);
+
+  /* Check for overflow.  */
+  if (__glibc_likely (new_length >= buffer->length))
+    new_ptr = malloc (new_length);
+  else
+    {
+      __set_errno (ENOMEM);
+      new_ptr = NULL;
+    }
+
+  if (__glibc_unlikely (new_ptr == NULL))
+    {
+      /* Buffer must remain valid to free.  */
+      scratch_buffer_init (buffer);
+      return false;
+    }
+
+  /* Install new heap-based buffer.  */
+  buffer->data = new_ptr;
+  buffer->length = new_length;
+  return true;
+}
+libc_hidden_def (__libc_scratch_buffer_grow)
diff --git a/lib/malloc/scratch_buffer_grow_preserve.c 
b/lib/malloc/scratch_buffer_grow_preserve.c
new file mode 100644
index 0000000..aef2329
--- /dev/null
+++ b/lib/malloc/scratch_buffer_grow_preserve.c
@@ -0,0 +1,67 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2015-2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <errno.h>
+#include <string.h>
+
+bool
+__libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer)
+{
+  size_t new_length = 2 * buffer->length;
+  void *new_ptr;
+
+  if (buffer->data == buffer->__space.__c)
+    {
+      /* Move buffer to the heap.  No overflow is possible because
+        buffer->length describes a small buffer on the stack.  */
+      new_ptr = malloc (new_length);
+      if (new_ptr == NULL)
+       return false;
+      memcpy (new_ptr, buffer->__space.__c, buffer->length);
+    }
+  else
+    {
+      /* Buffer was already on the heap.  Check for overflow.  */
+      if (__glibc_likely (new_length >= buffer->length))
+       new_ptr = realloc (buffer->data, new_length);
+      else
+       {
+         __set_errno (ENOMEM);
+         new_ptr = NULL;
+       }
+
+      if (__glibc_unlikely (new_ptr == NULL))
+       {
+         /* Deallocate, but buffer must remain valid to free.  */
+         free (buffer->data);
+         scratch_buffer_init (buffer);
+         return false;
+       }
+    }
+
+  /* Install new heap-based buffer.  */
+  buffer->data = new_ptr;
+  buffer->length = new_length;
+  return true;
+}
+libc_hidden_def (__libc_scratch_buffer_grow_preserve)
diff --git a/lib/malloc/scratch_buffer_set_array_size.c 
b/lib/malloc/scratch_buffer_set_array_size.c
new file mode 100644
index 0000000..5f5e4c2
--- /dev/null
+++ b/lib/malloc/scratch_buffer_set_array_size.c
@@ -0,0 +1,64 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2015-2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <errno.h>
+#include <limits.h>
+
+bool
+__libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+                                     size_t nelem, size_t size)
+{
+  size_t new_length = nelem * size;
+
+  /* Avoid overflow check if both values are small. */
+  if ((nelem | size) >> (sizeof (size_t) * CHAR_BIT / 2) != 0
+      && nelem != 0 && size != new_length / nelem)
+    {
+      /* Overflow.  Discard the old buffer, but it must remain valid
+        to free.  */
+      scratch_buffer_free (buffer);
+      scratch_buffer_init (buffer);
+      __set_errno (ENOMEM);
+      return false;
+    }
+
+  if (new_length <= buffer->length)
+    return true;
+
+  /* Discard old buffer.  */
+  scratch_buffer_free (buffer);
+
+  char *new_ptr = malloc (new_length);
+  if (new_ptr == NULL)
+    {
+      /* Buffer must remain valid to free.  */
+      scratch_buffer_init (buffer);
+      return false;
+    }
+
+  /* Install new heap-based buffer.  */
+  buffer->data = new_ptr;
+  buffer->length = new_length;
+  return true;
+}
+libc_hidden_def (__libc_scratch_buffer_set_array_size)
diff --git a/lib/malloca.c b/lib/malloca.c
index 975b166..d68d233 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -1,5 +1,6 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003, 2006-2007, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2009-2021 Free Software Foundation,
+   Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003, 2018.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/malloca.h b/lib/malloca.h
index ccc485a..a04e545 100644
--- a/lib/malloca.h
+++ b/lib/malloca.h
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/md5.c b/lib/md5.c
index 74cf2c3..e7eeeaa 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -1,6 +1,6 @@
 /* Functions to compute MD5 message digest of files or memory blocks.
    according to the definition of MD5 in RFC 1321 from April 1992.
-   Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2020 Free Software
+   Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2021 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
diff --git a/lib/md5.h b/lib/md5.h
index c728ba1..aa4b080 100644
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -1,6 +1,6 @@
 /* Declaration of functions and data types used for MD5 sum computing
    library functions.
-   Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2020 Free Software
+   Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2021 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
diff --git a/lib/memmem.c b/lib/memmem.c
index 6f65742..87266fa 100644
--- a/lib/memmem.c
+++ b/lib/memmem.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2020 Free Software
+/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2021 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
diff --git a/lib/mempcpy.c b/lib/mempcpy.c
index fe832d7..fea618a 100644
--- a/lib/mempcpy.c
+++ b/lib/mempcpy.c
@@ -1,5 +1,5 @@
 /* Copy memory area and return pointer after last written byte.
-   Copyright (C) 2003, 2007, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/memrchr.c b/lib/memrchr.c
index 7ff32e1..dcd24fa 100644
--- a/lib/memrchr.c
+++ b/lib/memrchr.c
@@ -1,6 +1,6 @@
 /* memrchr -- find the last occurrence of a byte in a memory block
 
-   Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2020 Free Software
+   Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2021 Free Software
    Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
diff --git a/lib/mini-gmp-gnulib.c b/lib/mini-gmp-gnulib.c
index e9e8a17..d46c2b9 100644
--- a/lib/mini-gmp-gnulib.c
+++ b/lib/mini-gmp-gnulib.c
@@ -1,6 +1,6 @@
 /* Tailor mini-gmp.c for Gnulib-using applications.
 
-   Copyright 2018-2020 Free Software Foundation, Inc.
+   Copyright 2018-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/mini-gmp.c b/lib/mini-gmp.c
index 2e0301b..d34fe52 100644
--- a/lib/mini-gmp.c
+++ b/lib/mini-gmp.c
@@ -32,7 +32,7 @@ see https://www.gnu.org/licenses/.  */
 
 /* NOTE: All functions in this file which are not declared in
    mini-gmp.h are internal, and are not intended to be compatible
-   neither with GMP nor with future versions of mini-gmp. */
+   with GMP or with future versions of mini-gmp. */
 
 /* Much of the material copied from GMP files, including: gmp-impl.h,
    longlong.h, mpn/generic/add_n.c, mpn/generic/addmul_1.c,
@@ -1331,29 +1331,26 @@ mpn_set_str_bits (mp_ptr rp, const unsigned char *sp, 
size_t sn,
                  unsigned bits)
 {
   mp_size_t rn;
-  size_t j;
+  mp_limb_t limb;
   unsigned shift;
 
-  for (j = sn, rn = 0, shift = 0; j-- > 0; )
+  for (limb = 0, rn = 0, shift = 0; sn-- > 0; )
     {
-      if (shift == 0)
-       {
-         rp[rn++] = sp[j];
-         shift += bits;
-       }
-      else
+      limb |= (mp_limb_t) sp[sn] << shift;
+      shift += bits;
+      if (shift >= GMP_LIMB_BITS)
        {
-         rp[rn-1] |= (mp_limb_t) sp[j] << shift;
-         shift += bits;
-         if (shift >= GMP_LIMB_BITS)
-           {
-             shift -= GMP_LIMB_BITS;
-             if (shift > 0)
-               rp[rn++] = (mp_limb_t) sp[j] >> (bits - shift);
-           }
+         shift -= GMP_LIMB_BITS;
+         rp[rn++] = limb;
+         /* Next line is correct also if shift == 0,
+            bits == 8, and mp_limb_t == unsigned char. */
+         limb = (unsigned int) sp[sn] >> (bits - shift);
        }
     }
-  rn = mpn_normalized_size (rp, rn);
+  if (limb != 0)
+    rp[rn++] = limb;
+  else
+    rn = mpn_normalized_size (rp, rn);
   return rn;
 }
 
@@ -2723,7 +2720,7 @@ mpz_make_odd (mpz_t r)
 
   assert (r->_mp_size > 0);
   /* Count trailing zeros, equivalent to mpn_scan1, because we know that there 
is a 1 */
-  shift = mpn_common_scan (r->_mp_d[0], 0, r->_mp_d, 0, 0);
+  shift = mpn_scan1 (r->_mp_d, 0);
   mpz_tdiv_q_2exp (r, r, shift);
 
   return shift;
@@ -2780,9 +2777,13 @@ mpz_gcd (mpz_t g, const mpz_t u, const mpz_t v)
 
        if (tv->_mp_size == 1)
          {
-           mp_limb_t vl = tv->_mp_d[0];
-           mp_limb_t ul = mpz_tdiv_ui (tu, vl);
-           mpz_set_ui (g, mpn_gcd_11 (ul, vl));
+           mp_limb_t *gp;
+
+           mpz_tdiv_r (tu, tu, tv);
+           gp = MPZ_REALLOC (g, 1); /* gp = mpz_limbs_modify (g, 1); */
+           *gp = mpn_gcd_11 (tu->_mp_d[0], tv->_mp_d[0]);
+
+           g->_mp_size = *gp != 0; /* mpz_limbs_finish (g, 1); */
            break;
          }
        mpz_sub (tu, tu, tv);
@@ -2871,7 +2872,6 @@ mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, 
const mpz_t v)
    * s0 = 0,    s1 = 2^vz
    */
 
-  mpz_setbit (t0, uz);
   mpz_tdiv_qr (t1, tu, tu, tv);
   mpz_mul_2exp (t1, t1, uz);
 
@@ -2882,8 +2882,7 @@ mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, 
const mpz_t v)
     {
       mp_bitcnt_t shift;
       shift = mpz_make_odd (tu);
-      mpz_mul_2exp (t0, t0, shift);
-      mpz_mul_2exp (s0, s0, shift);
+      mpz_setbit (t0, uz + shift);
       power += shift;
 
       for (;;)
@@ -2921,6 +2920,8 @@ mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, 
const mpz_t v)
          power += shift;
        }
     }
+  else
+    mpz_setbit (t0, uz);
 
   /* Now tv = odd part of gcd, and -s0 and t0 are corresponding
      cofactors. */
@@ -3604,7 +3605,8 @@ mpz_probab_prime_p (const mpz_t n, int reps)
   /* Find q and k, where q is odd and n = 1 + 2**k * q.  */
   mpz_abs (nm1, n);
   nm1->_mp_d[0] -= 1;
-  k = mpz_scan1 (nm1, 0);
+  /* Count trailing zeros, equivalent to mpn_scan1, because we know that there 
is a 1 */
+  k = mpn_scan1 (nm1->_mp_d, 0);
   mpz_tdiv_q_2exp (q, nm1, k);
 
   /* BPSW test */
@@ -4301,7 +4303,7 @@ mpz_get_str (char *sp, int base, const mpz_t u)
 ret:
   sp[sn] = '\0';
   if (osn && osn != sn + 1)
-    sp = gmp_realloc(sp, osn, sn + 1);
+    sp = (char*) gmp_realloc (sp, osn, sn + 1);
   return sp;
 }
 
@@ -4425,6 +4427,8 @@ mpz_out_str (FILE *stream, int base, const mpz_t x)
   size_t len, n;
 
   str = mpz_get_str (NULL, base, x);
+  if (!str)
+    return 0;
   len = strlen (str);
   n = fwrite (str, 1, len, stream);
   gmp_free (str, len + 1);
diff --git a/lib/mini-gmp.h b/lib/mini-gmp.h
index c00568c..59a37e6 100644
--- a/lib/mini-gmp.h
+++ b/lib/mini-gmp.h
@@ -1,6 +1,6 @@
 /* mini-gmp, a minimalistic implementation of a GNU GMP subset.
 
-Copyright 2011-2015, 2017, 2019 Free Software Foundation, Inc.
+Copyright 2011-2015, 2017, 2019-2020 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -295,7 +295,8 @@ int mpz_init_set_str (mpz_t, const char *, int);
   || defined (_MSL_STDIO_H)           /* Metrowerks */          \
   || defined (_STDIO_H_INCLUDED)      /* QNX4 */               \
   || defined (_ISO_STDIO_ISO_H)       /* Sun C++ */            \
-  || defined (__STDIO_LOADED)         /* VMS */
+  || defined (__STDIO_LOADED)         /* VMS */                        \
+  || defined (__DEFINED_FILE)         /* musl */
 size_t mpz_out_str (FILE *, int, const mpz_t);
 #endif
 
diff --git a/lib/minmax.h b/lib/minmax.h
index b947776..eb9fb09 100644
--- a/lib/minmax.h
+++ b/lib/minmax.h
@@ -1,5 +1,5 @@
 /* MIN, MAX macros.
-   Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2020 Free Software
+   Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/mkostemp.c b/lib/mkostemp.c
index 46b58e1..9d733dd 100644
--- a/lib/mkostemp.c
+++ b/lib/mkostemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2020 Free Software
+/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2021 Free Software
    Foundation, Inc.
    This file is derived from the one in the GNU C Library.
 
diff --git a/lib/mktime.c b/lib/mktime.c
index 5b4c144..2c7cd7b 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -1,5 +1,5 @@
 /* Convert a 'struct tm' to a time_t value.
-   Copyright (C) 1993-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Eggert <eggert@twinsun.com>.
 
diff --git a/lib/nstrftime.c b/lib/nstrftime.c
index 7d5a97f..8ba6975 100644
--- a/lib/nstrftime.c
+++ b/lib/nstrftime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
diff --git a/lib/open.c b/lib/open.c
index 0f7c6e9..8599185 100644
--- a/lib/open.c
+++ b/lib/open.c
@@ -1,5 +1,5 @@
 /* Open a descriptor to a file.
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/openat-priv.h b/lib/openat-priv.h
index 5b824f7..5c42d03 100644
--- a/lib/openat-priv.h
+++ b/lib/openat-priv.h
@@ -1,6 +1,6 @@
 /* Internals for openat-like functions.
 
-   Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/openat-proc.c b/lib/openat-proc.c
index b5aaee8..4f8be90 100644
--- a/lib/openat-proc.c
+++ b/lib/openat-proc.c
@@ -1,6 +1,6 @@
 /* Create /proc/self/fd-related names for subfiles of open directories.
 
-   Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/openat.h b/lib/openat.h
index 824ce56..7098124 100644
--- a/lib/openat.h
+++ b/lib/openat.h
@@ -1,5 +1,5 @@
 /* provide a replacement openat function
-   Copyright (C) 2004-2006, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2004-2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/pathmax.h b/lib/pathmax.h
index 15a236f..49cf462 100644
--- a/lib/pathmax.h
+++ b/lib/pathmax.h
@@ -1,5 +1,5 @@
 /* Define PATH_MAX somehow.  Requires sys/types.h.
-   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2020 Free Software
+   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/pipe2.c b/lib/pipe2.c
index 591e94d..41493aa 100644
--- a/lib/pipe2.c
+++ b/lib/pipe2.c
@@ -1,5 +1,5 @@
 /* Create a pipe, with specific opening flags.
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/pselect.c b/lib/pselect.c
index d620524..0fda4ee 100644
--- a/lib/pselect.c
+++ b/lib/pselect.c
@@ -1,6 +1,6 @@
 /* pselect - synchronous I/O multiplexing
 
-   Copyright 2011-2020 Free Software Foundation, Inc.
+   Copyright 2011-2021 Free Software Foundation, Inc.
 
    This file is part of gnulib.
 
diff --git a/lib/pthread_sigmask.c b/lib/pthread_sigmask.c
index 3eb74f2..8a69204 100644
--- a/lib/pthread_sigmask.c
+++ b/lib/pthread_sigmask.c
@@ -1,5 +1,5 @@
 /* POSIX compatible signal blocking for threads.
-   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/qcopy-acl.c b/lib/qcopy-acl.c
index 5408b0f..f274ca8 100644
--- a/lib/qcopy-acl.c
+++ b/lib/qcopy-acl.c
@@ -1,6 +1,6 @@
 /* Copy access control list from one file to another.  -*- coding: utf-8 -*-
 
-   Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/memrchr.c b/lib/rawmemchr.c
similarity index 61%
copy from lib/memrchr.c
copy to lib/rawmemchr.c
index 7ff32e1..bbb250f 100644
--- a/lib/memrchr.c
+++ b/lib/rawmemchr.c
@@ -1,13 +1,5 @@
-/* memrchr -- find the last occurrence of a byte in a memory block
-
-   Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2020 Free Software
-   Foundation, Inc.
-
-   Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
-   with help from Dan Sahlin (dan@sics.se) and
-   commentary by Jim Blandy (jimb@ai.mit.edu);
-   adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
-   and implemented by Roland McGrath (roland@ai.mit.edu).
+/* Searching in a string.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,28 +14,14 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-#if defined _LIBC
-# include <memcopy.h>
-#else
-# include <config.h>
-# define reg_char char
-#endif
+#include <config.h>
 
+/* Specification.  */
 #include <string.h>
-#include <limits.h>
-
-#undef __memrchr
-#ifdef _LIBC
-# undef memrchr
-#endif
 
-#ifndef weak_alias
-# define __memrchr memrchr
-#endif
-
-/* Search no more than N bytes of S for C.  */
+/* Find the first occurrence of C in S.  */
 void *
-__memrchr (void const *s, int c_in, size_t n)
+rawmemchr (const void *s, int c_in)
 {
   /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
      long instead of a 64-bit uintmax_t tends to give better
@@ -56,19 +34,19 @@ __memrchr (void const *s, int c_in, size_t n)
   const longword *longword_ptr;
   longword repeated_one;
   longword repeated_c;
-  unsigned reg_char c;
+  unsigned char c;
 
   c = (unsigned char) c_in;
 
-  /* Handle the last few bytes by reading one byte at a time.
+  /* Handle the first few bytes by reading one byte at a time.
      Do this until CHAR_PTR is aligned on a longword boundary.  */
-  for (char_ptr = (const unsigned char *) s + n;
-       n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
-       --n)
-    if (*--char_ptr == c)
+  for (char_ptr = (const unsigned char *) s;
+       (size_t) char_ptr % sizeof (longword) != 0;
+       ++char_ptr)
+    if (*char_ptr == c)
       return (void *) char_ptr;
 
-  longword_ptr = (const void *) char_ptr;
+  longword_ptr = (const longword *) char_ptr;
 
   /* All these elucidatory comments refer to 4-byte longwords,
      but the theory applies equally well to any size longwords.  */
@@ -95,11 +73,11 @@ __memrchr (void const *s, int c_in, size_t n)
         }
     }
 
-  /* Instead of the traditional loop which tests each byte, we will test a
-     longword at a time.  The tricky part is testing if *any of the four*
-     bytes in the longword in question are equal to c.  We first use an xor
-     with repeated_c.  This reduces the task to testing whether *any of the
-     four* bytes in longword1 is zero.
+  /* Instead of the traditional loop which tests each byte, we will
+     test a longword at a time.  The tricky part is testing if *any of
+     the four* bytes in the longword in question are equal to NUL or
+     c.  We first use an xor with repeated_c.  This reduces the task
+     to testing whether *any of the four* bytes in longword1 is zero.
 
      We compute tmp =
        ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
@@ -123,39 +101,36 @@ __memrchr (void const *s, int c_in, size_t n)
      significant bytes (positions j+1..3), but it does not matter since we
      already have a non-zero bit at position 8*j+7.
 
-     So, the test whether any byte in longword1 is zero is equivalent to
-     testing whether tmp is nonzero.  */
+     The test whether any byte in longword1 is zero is equivalent
+     to testing whether tmp is nonzero.
+
+     This test can read beyond the end of a string, depending on where
+     C_IN is encountered.  However, this is considered safe since the
+     initialization phase ensured that the read will be aligned,
+     therefore, the read will not cross page boundaries and will not
+     cause a fault.  */
 
-  while (n >= sizeof (longword))
+  while (1)
     {
-      longword longword1 = *--longword_ptr ^ repeated_c;
+      longword longword1 = *longword_ptr ^ repeated_c;
 
       if ((((longword1 - repeated_one) & ~longword1)
            & (repeated_one << 7)) != 0)
-        {
-          longword_ptr++;
-          break;
-        }
-      n -= sizeof (longword);
+        break;
+      longword_ptr++;
     }
 
   char_ptr = (const unsigned char *) longword_ptr;
 
-  /* At this point, we know that either n < sizeof (longword), or one of the
-     sizeof (longword) bytes starting at char_ptr is == c.  On little-endian
-     machines, we could determine the first such byte without any further
-     memory accesses, just by looking at the tmp result from the last loop
-     iteration.  But this does not work on big-endian machines.  Choose code
-     that works in both cases.  */
-
-  while (n-- > 0)
-    {
-      if (*--char_ptr == c)
-        return (void *) char_ptr;
-    }
-
-  return NULL;
+  /* At this point, we know that one of the sizeof (longword) bytes
+     starting at char_ptr is == c.  On little-endian machines, we
+     could determine the first such byte without any further memory
+     accesses, just by looking at the tmp result from the last loop
+     iteration.  But this does not work on big-endian machines.
+     Choose code that works in both cases.  */
+
+  char_ptr = (unsigned char *) longword_ptr;
+  while (*char_ptr != c)
+    char_ptr++;
+  return (void *) char_ptr;
 }
-#ifdef weak_alias
-weak_alias (__memrchr, memrchr)
-#endif
diff --git a/lib/rawmemchr.valgrind b/lib/rawmemchr.valgrind
new file mode 100644
index 0000000..087d5e4
--- /dev/null
+++ b/lib/rawmemchr.valgrind
@@ -0,0 +1,28 @@
+# Suppress a valgrind message about use of uninitialized memory in rawmemchr().
+
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+# This use is OK because it provides only a speedup.
+{
+    rawmemchr-value4
+    Memcheck:Value4
+    fun:rawmemchr
+}
+{
+    rawmemchr-value8
+    Memcheck:Value8
+    fun:rawmemchr
+}
diff --git a/lib/readlink.c b/lib/readlink.c
index 4d392ef..c4b635c 100644
--- a/lib/readlink.c
+++ b/lib/readlink.c
@@ -1,5 +1,5 @@
-/* Stub for readlink().
-   Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc.
+/* Read the contents of a symbolic link.
+   Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
    such as DJGPP 2.03 and mingw32.  */
 
 ssize_t
-readlink (const char *name, char *buf _GL_UNUSED,
+readlink (char const *file, char *buf _GL_UNUSED,
           size_t bufsize _GL_UNUSED)
 {
   struct stat statbuf;
@@ -37,7 +37,7 @@ readlink (const char *name, char *buf _GL_UNUSED,
   /* In general we should use lstat() here, not stat().  But on platforms
      without symbolic links, lstat() - if it exists - would be equivalent to
      stat(), therefore we can use stat().  This saves us a configure check.  */
-  if (stat (name, &statbuf) >= 0)
+  if (stat (file, &statbuf) >= 0)
     errno = EINVAL;
   return -1;
 }
@@ -51,24 +51,54 @@ readlink (const char *name, char *buf _GL_UNUSED,
    for Solaris 9.  */
 
 ssize_t
-rpl_readlink (const char *name, char *buf, size_t bufsize)
+rpl_readlink (char const *file, char *buf, size_t bufsize)
 {
 # if READLINK_TRAILING_SLASH_BUG
-  size_t len = strlen (name);
-  if (len && name[len - 1] == '/')
+  size_t file_len = strlen (file);
+  if (file_len && file[file_len - 1] == '/')
     {
-      /* Even if name without the slash is a symlink to a directory,
+      /* Even if FILE without the slash is a symlink to a directory,
          both lstat() and stat() must resolve the trailing slash to
          the directory rather than the symlink.  We can therefore
          safely use stat() to distinguish between EINVAL and
          ENOTDIR/ENOENT, avoiding extra overhead of rpl_lstat().  */
       struct stat st;
-      if (stat (name, &st) == 0)
+      if (stat (file, &st) == 0 || errno == EOVERFLOW)
         errno = EINVAL;
       return -1;
     }
 # endif /* READLINK_TRAILING_SLASH_BUG */
-  return readlink (name, buf, bufsize);
+
+  ssize_t r = readlink (file, buf, bufsize);
+
+# if READLINK_TRUNCATE_BUG
+  if (r < 0 && errno == ERANGE)
+    {
+      /* Try again with a bigger buffer.  This is just for test cases;
+         real code invariably discards short reads.  */
+      char stackbuf[4032];
+      r = readlink (file, stackbuf, sizeof stackbuf);
+      if (r < 0)
+        {
+          if (errno == ERANGE)
+            {
+              /* Clear the buffer, which is good enough for real code.
+                 Thankfully, no test cases try short reads of enormous
+                 symlinks and what would be the point anyway?  */
+              r = bufsize;
+              memset (buf, 0, r);
+            }
+        }
+      else
+        {
+          if (bufsize < r)
+            r = bufsize;
+          memcpy (buf, stackbuf, r);
+        }
+    }
+# endif
+
+  return r;
 }
 
 #endif /* HAVE_READLINK */
diff --git a/lib/readlinkat.c b/lib/readlinkat.c
index 68ec65e..4a29f7a 100644
--- a/lib/readlinkat.c
+++ b/lib/readlinkat.c
@@ -1,5 +1,5 @@
 /* Read a symlink relative to an open directory.
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -28,10 +28,11 @@
 
 #if HAVE_READLINKAT
 
+# undef fstatat
 # undef readlinkat
 
 ssize_t
-rpl_readlinkat (int fd, char const *file, char *buf, size_t len)
+rpl_readlinkat (int fd, char const *file, char *buf, size_t bufsize)
 {
 # if READLINK_TRAILING_SLASH_BUG
   size_t file_len = strlen (file);
@@ -40,15 +41,45 @@ rpl_readlinkat (int fd, char const *file, char *buf, size_t 
len)
       /* Even if FILE without the slash is a symlink to a directory,
          both lstat() and stat() must resolve the trailing slash to
          the directory rather than the symlink.  We can therefore
-         safely use stat() to distinguish between EINVAL and
-         ENOTDIR/ENOENT, avoiding extra overhead of rpl_lstat().  */
+         safely use fstatat(..., 0) to distinguish between EINVAL and
+         ENOTDIR/ENOENT, avoiding extra overhead of rpl_fstatat().  */
       struct stat st;
-      if (stat (file, &st) == 0)
+      if (fstatat (fd, file, &st, 0) == 0 || errno == EOVERFLOW)
         errno = EINVAL;
       return -1;
     }
 # endif /* READLINK_TRAILING_SLASH_BUG */
-  return readlinkat (fd, file, buf, len);
+
+  ssize_t r = readlinkat (fd, file, buf, bufsize);
+
+# if READLINK_TRUNCATE_BUG
+  if (r < 0 && errno == ERANGE)
+    {
+      /* Try again with a bigger buffer.  This is just for test cases;
+         real code invariably discards short reads.  */
+      char stackbuf[4032];
+      r = readlinkat (fd, file, stackbuf, sizeof stackbuf);
+      if (r < 0)
+        {
+          if (errno == ERANGE)
+            {
+              /* Clear the buffer, which is good enough for real code.
+                 Thankfully, no test cases try short reads of enormous
+                 symlinks and what would be the point anyway?  */
+              r = bufsize;
+              memset (buf, 0, r);
+            }
+        }
+      else
+        {
+          if (bufsize < r)
+            r = bufsize;
+          memcpy (buf, stackbuf, r);
+        }
+    }
+# endif
+
+  return r;
 }
 
 #else
@@ -61,7 +92,7 @@ rpl_readlinkat (int fd, char const *file, char *buf, size_t 
len)
    readlinkat worthless since readlink does not guarantee a
    NUL-terminated buffer.  Assume this was a bug in POSIX.  */
 
-/* Read the contents of symlink FILE into buffer BUF of size LEN, in the
+/* Read the contents of symlink FILE into buffer BUF of size BUFSIZE, in the
    directory open on descriptor FD.  If possible, do it without changing
    the working directory.  Otherwise, resort to using save_cwd/fchdir,
    then readlink/restore_cwd.  If either the save_cwd or the restore_cwd
@@ -69,8 +100,8 @@ rpl_readlinkat (int fd, char const *file, char *buf, size_t 
len)
 
 # define AT_FUNC_NAME readlinkat
 # define AT_FUNC_F1 readlink
-# define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t len
-# define AT_FUNC_POST_FILE_ARGS        , buf, len
+# define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t bufsize
+# define AT_FUNC_POST_FILE_ARGS        , buf, bufsize
 # define AT_FUNC_RESULT ssize_t
 # include "at-func.c"
 # undef AT_FUNC_NAME
diff --git a/lib/regcomp.c b/lib/regcomp.c
index a4b95b0..0c31b0e 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
diff --git a/lib/regex.h b/lib/regex.h
index 306521a..d291e38 100644
--- a/lib/regex.h
+++ b/lib/regex.h
@@ -1,6 +1,6 @@
 /* Definitions for data structures and routines for the regular
    expression library.
-   Copyright (C) 1985, 1989-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1989-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
diff --git a/lib/regex_internal.c b/lib/regex_internal.c
index 2e21729..73087c8 100644
--- a/lib/regex_internal.c
+++ b/lib/regex_internal.c
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
@@ -300,18 +300,20 @@ build_wcs_upper_buffer (re_string_t *pstr)
       while (byte_idx < end_idx)
        {
          wchar_t wc;
+         unsigned char ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
 
-         if (isascii (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx])
-             && mbsinit (&pstr->cur_state))
+         if (isascii (ch) && mbsinit (&pstr->cur_state))
            {
-             /* In case of a singlebyte character.  */
-             pstr->mbs[byte_idx]
-               = toupper (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]);
              /* The next step uses the assumption that wchar_t is encoded
                 ASCII-safe: all ASCII values can be converted like this.  */
-             pstr->wcs[byte_idx] = (wchar_t) pstr->mbs[byte_idx];
-             ++byte_idx;
-             continue;
+             wchar_t wcu = __towupper (ch);
+             if (isascii (wcu))
+               {
+                 pstr->mbs[byte_idx] = wcu;
+                 pstr->wcs[byte_idx] = wcu;
+                 byte_idx++;
+                 continue;
+               }
            }
 
          remain_len = end_idx - byte_idx;
@@ -348,7 +350,6 @@ build_wcs_upper_buffer (re_string_t *pstr)
            {
              /* It is an invalid character, an incomplete character
                 at the end of the string, or '\0'.  Just use the byte.  */
-             int ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
              pstr->mbs[byte_idx] = ch;
              /* And also cast it to wide char.  */
              pstr->wcs[byte_idx++] = (wchar_t) ch;
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index 0c72e3f..be2fa4f 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
@@ -77,6 +77,14 @@
 # define isblank(ch) ((ch) == ' ' || (ch) == '\t')
 #endif
 
+/* regex code assumes isascii has its usual numeric meaning,
+   even if the portable character set uses EBCDIC encoding,
+   and even if wint_t is wider than int.  */
+#ifndef _LIBC
+# undef isascii
+# define isascii(c) (((c) & ~0x7f) == 0)
+#endif
+
 #ifdef _LIBC
 # ifndef _RE_DEFINE_LOCALE_FUNCTIONS
 #  define _RE_DEFINE_LOCALE_FUNCTIONS 1
diff --git a/lib/root-uid.h b/lib/root-uid.h
index f0f77c2..cb74a49 100644
--- a/lib/root-uid.h
+++ b/lib/root-uid.h
@@ -1,6 +1,6 @@
 /* The user ID that always has appropriate privileges in the POSIX sense.
 
-   Copyright 2012-2020 Free Software Foundation, Inc.
+   Copyright 2012-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/save-cwd.c b/lib/save-cwd.c
index fc37d4a..9b625c7 100644
--- a/lib/save-cwd.c
+++ b/lib/save-cwd.c
@@ -1,6 +1,6 @@
 /* save-cwd.c -- Save and restore current working directory.
 
-   Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2020 Free Software
+   Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/save-cwd.h b/lib/save-cwd.h
index ec6f74c..e1e69ec 100644
--- a/lib/save-cwd.h
+++ b/lib/save-cwd.h
@@ -1,6 +1,6 @@
 /* Save and restore current working directory.
 
-   Copyright (C) 1995, 1997-1998, 2003, 2009-2020 Free Software
+   Copyright (C) 1995, 1997-1998, 2003, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/strtoll.c b/lib/scratch_buffer.h
similarity index 55%
copy from lib/strtoll.c
copy to lib/scratch_buffer.h
index 3c7e8c0..3e2b5ef 100644
--- a/lib/strtoll.c
+++ b/lib/scratch_buffer.h
@@ -1,7 +1,5 @@
-/* Function to parse a 'long long int' from text.
-   Copyright (C) 1995-1997, 1999, 2001, 2009-2020 Free Software Foundation,
-   Inc.
-   This file is part of the GNU C Library.
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -16,18 +14,16 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-#define QUAD    1
+/* Written by Paul Eggert, 2017.  */
 
-#include <strtol.c>
+#ifndef _GL_SCRATCH_BUFFER_H
+#define _GL_SCRATCH_BUFFER_H
 
-#ifdef _LIBC
-# ifdef SHARED
-#  include <shlib-compat.h>
+#include <libc-config.h>
 
-#  if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
-compat_symbol (libc, __strtoll_internal, __strtoq_internal, GLIBC_2_0);
-#  endif
+#define __libc_scratch_buffer_grow gl_scratch_buffer_grow
+#define __libc_scratch_buffer_grow_preserve gl_scratch_buffer_grow_preserve
+#define __libc_scratch_buffer_set_array_size gl_scratch_buffer_set_array_size
+#include <malloc/scratch_buffer.h>
 
-# endif
-weak_alias (strtoll, strtoq)
-#endif
+#endif /* _GL_SCRATCH_BUFFER_H */
diff --git a/lib/set-permissions.c b/lib/set-permissions.c
index b22ccfd..607983c 100644
--- a/lib/set-permissions.c
+++ b/lib/set-permissions.c
@@ -1,6 +1,6 @@
 /* Set permissions of a file.  -*- coding: utf-8 -*-
 
-   Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/sha1.c b/lib/sha1.c
index bacf29c..612d46d 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -1,7 +1,7 @@
 /* sha1.c - Functions to compute SHA1 message digest of files or
    memory blocks according to the NIST specification FIPS-180-1.
 
-   Copyright (C) 2000-2001, 2003-2006, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2000-2001, 2003-2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
diff --git a/lib/sha1.h b/lib/sha1.h
index b767884..94ccd18 100644
--- a/lib/sha1.h
+++ b/lib/sha1.h
@@ -1,6 +1,6 @@
 /* Declarations of functions and data types used for SHA1 sum
    library functions.
-   Copyright (C) 2000-2001, 2003, 2005-2006, 2008-2020 Free Software
+   Copyright (C) 2000-2001, 2003, 2005-2006, 2008-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
diff --git a/lib/sha256.c b/lib/sha256.c
index c80dea2..129d64b 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -1,7 +1,7 @@
 /* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or
    memory blocks according to the NIST specification FIPS-180-2.
 
-   Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/sha256.h b/lib/sha256.h
index 750d78a..b4bc082 100644
--- a/lib/sha256.h
+++ b/lib/sha256.h
@@ -1,6 +1,6 @@
 /* Declarations of functions and data types used for SHA256 and SHA224 sum
    library functions.
-   Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/sha512.c b/lib/sha512.c
index 518e336..4ac3fa3 100644
--- a/lib/sha512.c
+++ b/lib/sha512.c
@@ -1,7 +1,7 @@
 /* sha512.c - Functions to compute SHA512 and SHA384 message digest of files or
    memory blocks according to the NIST specification FIPS-180-2.
 
-   Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/sha512.h b/lib/sha512.h
index 21c2f58..81b5303 100644
--- a/lib/sha512.h
+++ b/lib/sha512.h
@@ -1,6 +1,6 @@
 /* Declarations of functions and data types used for SHA512 and SHA384 sum
    library functions.
-   Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/sig2str.c b/lib/sig2str.c
index cf7c3bb..c2cc35d 100644
--- a/lib/sig2str.c
+++ b/lib/sig2str.c
@@ -1,6 +1,6 @@
 /* sig2str.c -- convert between signal names and numbers
 
-   Copyright (C) 2002, 2004, 2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/sig2str.h b/lib/sig2str.h
index a0b45da..f736aa1 100644
--- a/lib/sig2str.h
+++ b/lib/sig2str.h
@@ -1,6 +1,6 @@
 /* sig2str.h -- convert between signal names and numbers
 
-   Copyright (C) 2002, 2005, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/sigdescr_np.c b/lib/sigdescr_np.c
index fc9cd3c..6c9bf28 100644
--- a/lib/sigdescr_np.c
+++ b/lib/sigdescr_np.c
@@ -1,5 +1,5 @@
 /* English descriptions of signals.
-   Copyright (C) 2020 Free Software Foundation, Inc.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/signal.in.h b/lib/signal.in.h
index c94b053..ed01d67 100644
--- a/lib/signal.in.h
+++ b/lib/signal.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <signal.h>.
 
-   Copyright (C) 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -55,13 +55,13 @@
 #ifndef _@GUARD_PREFIX@_SIGNAL_H
 #define _@GUARD_PREFIX@_SIGNAL_H
 
-/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android
-   declare pthread_sigmask in <pthread.h>, not in <signal.h>.
+/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android,
+   OS/2 kLIBC declare pthread_sigmask in <pthread.h>, not in <signal.h>.
    But avoid namespace pollution on glibc systems.*/
 #if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
     && ((defined __APPLE__ && defined __MACH__) \
         || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \
-        || defined __sun || defined __ANDROID__) \
+        || defined __sun || defined __ANDROID__ || defined __KLIBC__) \
     && ! defined __GLIBC__
 # include <pthread.h>
 #endif
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 884ffd8..523ed21 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -1,6 +1,6 @@
 /* stat-related time functions.
 
-   Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h
index b5b63e5..eae9d13 100644
--- a/lib/stdalign.in.h
+++ b/lib/stdalign.in.h
@@ -1,6 +1,6 @@
 /* A substitute for ISO C11 <stdalign.h>.
 
-   Copyright 2011-2020 Free Software Foundation, Inc.
+   Copyright 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/stddef.in.h b/lib/stddef.in.h
index 87b46d5..ba7195a 100644
--- a/lib/stddef.in.h
+++ b/lib/stddef.in.h
@@ -1,6 +1,6 @@
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index 63fa1aa..7a8f27c 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2021 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
@@ -579,11 +579,6 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
    <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
    <stdint.h> and assumes its types are already defined.  */
 # if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
-  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-     included before <wchar.h>.  */
-#  include <stddef.h>
-#  include <stdio.h>
-#  include <time.h>
 #  define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
 #  include <wchar.h>
 #  undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 067b95e..2a5db74 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -1,5 +1,5 @@
 /* Implementation details of FILE streams.
-   Copyright (C) 2007-2008, 2010-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008, 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -175,7 +175,7 @@
 #  define fp_ fp
 # endif
 
-# if defined _SCO_DS                /* OpenServer */
+# if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__)  /* 
OpenServer 5, OpenServer 6, UnixWare 7 */
 #  define _cnt __cnt
 #  define _ptr __ptr
 #  define _base __base
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index 6d12cd8..a930840 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -70,30 +70,44 @@
 # endif
 #endif
 
-/* _GL_ATTRIBUTE_FORMAT_PRINTF
-   indicates to GCC that the function takes a format string and arguments,
-   where the format string directives are the ones standardized by ISO C99
-   and POSIX.  */
+/* An __attribute__ __format__ specifier for a function that takes a format
+   string and arguments, where the format string directives are the ones
+   standardized by ISO C99 and POSIX.
+   _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD  */
+/* __gnu_printf__ is supported in GCC >= 4.4.  */
 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
-# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
-   _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, 
first_argument))
+# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__
 #else
-# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
-   _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
+# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__
 #endif
 
-/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
-   except that it indicates to GCC that the supported format string directives
-   are the ones of the system printf(), rather than the ones standardized by
-   ISO C99 and POSIX.  */
+/* An __attribute__ __format__ specifier for a function that takes a format
+   string and arguments, where the format string directives are the ones of the
+   system printf(), rather than the ones standardized by ISO C99 and POSIX.
+   _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM  */
+/* On mingw, Gnulib sets __USE_MINGW_ANSI_STDIO in order to get closer to
+   the standards.  The macro GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU indicates
+   whether this change is effective.  On older mingw, it is not.  */
 #if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
-# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, 
first_argument) \
-  _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument)
+# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD
 #else
-# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, 
first_argument) \
-  _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
+# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM __printf__
 #endif
 
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD
+   indicates to GCC that the function takes a format string and arguments,
+   where the format string directives are the ones standardized by ISO C99
+   and POSIX.  */
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(formatstring_parameter, 
first_argument) \
+  _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 
formatstring_parameter, first_argument))
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like 
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD,
+   except that it indicates to GCC that the supported format string directives
+   are the ones of the system printf(), rather than the ones standardized by
+   ISO C99 and POSIX.  */
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, 
first_argument) \
+  _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 
formatstring_parameter, first_argument))
+
 /* _GL_ATTRIBUTE_FORMAT_SCANF
    indicates to GCC that the function takes a format string and arguments,
    where the format string directives are the ones standardized by ISO C99
@@ -174,13 +188,13 @@
 #   define dprintf rpl_dprintf
 #  endif
 _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...)
-                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                                 _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...));
 # else
 #  if !@HAVE_DPRINTF@
 _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...)
-                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                                 _GL_ARG_NONNULL ((2)));
 #  endif
 _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *restrict format, ...));
@@ -215,9 +229,29 @@ _GL_WARN_ON_USE (fclose, "fclose is not always POSIX 
compliant - "
                  "use gnulib module fclose for portable POSIX compliance");
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef fcloseall
-# define fcloseall _fcloseall
+#if @GNULIB_MDA_FCLOSEALL@
+/* On native Windows, map 'fcloseall' to '_fcloseall', so that -loldnames is
+   not required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::fcloseall on all platforms that have
+   it.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fcloseall
+#   define fcloseall _fcloseall
+#  endif
+_GL_CXXALIAS_MDA (fcloseall, int, (void));
+# else
+#  if @HAVE_DECL_FCLOSEALL@
+#   if defined __FreeBSD__
+_GL_CXXALIAS_SYS (fcloseall, void, (void));
+#   else
+_GL_CXXALIAS_SYS (fcloseall, int, (void));
+#   endif
+#  endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCLOSEALL@
+_GL_CXXALIASWARN (fcloseall);
+# endif
 #endif
 
 #if @GNULIB_FDOPEN@
@@ -244,9 +278,20 @@ _GL_CXXALIASWARN (fdopen);
 /* Assume fdopen is always declared.  */
 _GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX 
compliant - "
                  "use gnulib module fdopen for portability");
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef fdopen
-# define fdopen _fdopen
+#elif @GNULIB_MDA_FDOPEN@
+/* On native Windows, map 'fdopen' to '_fdopen', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::fdopen always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fdopen
+#   define fdopen _fdopen
+#  endif
+_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
+# endif
+_GL_CXXALIASWARN (fdopen);
 #endif
 
 #if @GNULIB_FFLUSH@
@@ -311,9 +356,20 @@ _GL_CXXALIASWARN (fgets);
 # endif
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef fileno
-# define fileno _fileno
+#if @GNULIB_MDA_FILENO@
+/* On native Windows, map 'fileno' to '_fileno', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::fileno always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fileno
+#   define fileno _fileno
+#  endif
+_GL_CXXALIAS_MDA (fileno, int, (FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fileno, int, (FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (fileno);
 #endif
 
 #if @GNULIB_FOPEN@
@@ -351,7 +407,7 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms 
is not POSIX complian
 #  if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
 _GL_FUNCDECL_RPL (fprintf, int,
                   (FILE *restrict fp, const char *restrict format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 #  else
 _GL_FUNCDECL_RPL (fprintf, int,
@@ -843,9 +899,20 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef getw
-# define getw _getw
+#if @GNULIB_MDA_GETW@
+/* On native Windows, map 'getw' to '_getw', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::getw always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getw
+#   define getw _getw
+#  endif
+_GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (getw);
 #endif
 
 #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
@@ -861,7 +928,7 @@ struct obstack;
 #  endif
 _GL_FUNCDECL_RPL (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...));
@@ -869,7 +936,7 @@ _GL_CXXALIAS_RPL (obstack_printf, int,
 #  if !@HAVE_DECL_OBSTACK_PRINTF@
 _GL_FUNCDECL_SYS (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (obstack_printf, int,
@@ -882,7 +949,7 @@ _GL_CXXALIASWARN (obstack_printf);
 #  endif
 _GL_FUNCDECL_RPL (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args));
@@ -890,7 +957,7 @@ _GL_CXXALIAS_RPL (obstack_vprintf, int,
 #  if !@HAVE_DECL_OBSTACK_PRINTF@
 _GL_FUNCDECL_SYS (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (obstack_vprintf, int,
@@ -974,7 +1041,7 @@ _GL_FUNCDECL_RPL_1 (__printf__, int,
                     (const char *restrict format, ...)
                     __asm__ (@ASM_SYMBOL_PREFIX@
                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
-                    _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
+                    _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
                     _GL_ARG_NONNULL ((1)));
 #   else
 _GL_FUNCDECL_RPL_1 (__printf__, int,
@@ -991,7 +1058,7 @@ _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char 
*format, ...));
 #   endif
 _GL_FUNCDECL_RPL (printf, int,
                   (const char *restrict format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
                   _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...));
 #  endif
@@ -1061,9 +1128,20 @@ _GL_CXXALIASWARN (puts);
 # endif
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef putw
-# define putw _putw
+#if @GNULIB_MDA_PUTW@
+/* On native Windows, map 'putw' to '_putw', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::putw always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putw
+#   define putw _putw
+#  endif
+_GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (putw);
 #endif
 
 #if @GNULIB_REMOVE@
@@ -1182,7 +1260,7 @@ _GL_CXXALIASWARN (scanf);
 _GL_FUNCDECL_RPL (snprintf, int,
                   (char *restrict str, size_t size,
                    const char *restrict format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
                   _GL_ARG_NONNULL ((3)));
 _GL_CXXALIAS_RPL (snprintf, int,
                   (char *restrict str, size_t size,
@@ -1192,7 +1270,7 @@ _GL_CXXALIAS_RPL (snprintf, int,
 _GL_FUNCDECL_SYS (snprintf, int,
                   (char *restrict str, size_t size,
                    const char *restrict format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
                   _GL_ARG_NONNULL ((3)));
 #  endif
 _GL_CXXALIAS_SYS (snprintf, int,
@@ -1226,7 +1304,7 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
 #  endif
 _GL_FUNCDECL_RPL (sprintf, int,
                   (char *restrict str, const char *restrict format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (sprintf, int,
                   (char *restrict str, const char *restrict format, ...));
@@ -1245,9 +1323,20 @@ _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX 
compliant - "
                  "POSIX compliance");
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef tempnam
-# define tempnam _tempnam
+#if @GNULIB_MDA_TEMPNAM@
+/* On native Windows, map 'tempnam' to '_tempnam', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::tempnam always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef tempnam
+#   define tempnam _tempnam
+#  endif
+_GL_CXXALIAS_MDA (tempnam, char *, (const char *dir, const char *prefix));
+# else
+_GL_CXXALIAS_SYS (tempnam, char *, (const char *dir, const char *prefix));
+# endif
+_GL_CXXALIASWARN (tempnam);
 #endif
 
 #if @GNULIB_TMPFILE@
@@ -1282,7 +1371,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw 
- "
 #  endif
 _GL_FUNCDECL_RPL (asprintf, int,
                   (char **result, const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (asprintf, int,
                   (char **result, const char *format, ...));
@@ -1290,7 +1379,7 @@ _GL_CXXALIAS_RPL (asprintf, int,
 #  if !@HAVE_VASPRINTF@
 _GL_FUNCDECL_SYS (asprintf, int,
                   (char **result, const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (asprintf, int,
@@ -1303,7 +1392,7 @@ _GL_CXXALIASWARN (asprintf);
 #  endif
 _GL_FUNCDECL_RPL (vasprintf, int,
                   (char **result, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vasprintf, int,
                   (char **result, const char *format, va_list args));
@@ -1311,7 +1400,7 @@ _GL_CXXALIAS_RPL (vasprintf, int,
 #  if !@HAVE_VASPRINTF@
 _GL_FUNCDECL_SYS (vasprintf, int,
                   (char **result, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (vasprintf, int,
@@ -1327,7 +1416,7 @@ _GL_CXXALIASWARN (vasprintf);
 #  endif
 _GL_FUNCDECL_RPL (vdprintf, int,
                   (int fd, const char *restrict format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (vdprintf, int,
                   (int fd, const char *restrict format, va_list args));
@@ -1335,7 +1424,7 @@ _GL_CXXALIAS_RPL (vdprintf, int,
 #  if !@HAVE_VDPRINTF@
 _GL_FUNCDECL_SYS (vdprintf, int,
                   (int fd, const char *restrict format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((2)));
 #  endif
 /* Need to cast, because on Solaris, the third parameter will likely be
@@ -1365,7 +1454,7 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
 _GL_FUNCDECL_RPL (vfprintf, int,
                   (FILE *restrict fp,
                    const char *restrict format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 #  else
 _GL_FUNCDECL_RPL (vfprintf, int,
@@ -1432,7 +1521,7 @@ _GL_CXXALIASWARN (vfscanf);
 #  define GNULIB_overrides_vprintf 1
 #  if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
 _GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
-                                _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
                                 _GL_ARG_NONNULL ((1)));
 #  else
 _GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
@@ -1487,7 +1576,7 @@ _GL_CXXALIASWARN (vscanf);
 _GL_FUNCDECL_RPL (vsnprintf, int,
                   (char *restrict str, size_t size,
                    const char *restrict format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
                   _GL_ARG_NONNULL ((3)));
 _GL_CXXALIAS_RPL (vsnprintf, int,
                   (char *restrict str, size_t size,
@@ -1497,7 +1586,7 @@ _GL_CXXALIAS_RPL (vsnprintf, int,
 _GL_FUNCDECL_SYS (vsnprintf, int,
                   (char *restrict str, size_t size,
                    const char *restrict format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
                   _GL_ARG_NONNULL ((3)));
 #  endif
 _GL_CXXALIAS_SYS (vsnprintf, int,
@@ -1523,7 +1612,7 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
 _GL_FUNCDECL_RPL (vsprintf, int,
                   (char *restrict str,
                    const char *restrict format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vsprintf, int,
                   (char *restrict str,
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 47a1309..49fc44e 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -53,8 +53,8 @@
 # include <sys/loadavg.h>
 #endif
 
-/* Native Windows platforms declare mktemp() in <io.h>.  */
-#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
+/* Native Windows platforms declare _mktemp() in <io.h>.  */
+#if defined _WIN32 && !defined __CYGWIN__
 # include <io.h>
 #endif
 
@@ -149,6 +149,31 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
 #endif
 
 
+/* Allocate memory with indefinite extent and specified alignment.  */
+#if @GNULIB_ALIGNED_ALLOC@
+# if @REPLACE_ALIGNED_ALLOC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef aligned_alloc
+#   define aligned_alloc rpl_aligned_alloc
+#  endif
+_GL_FUNCDECL_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
+_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
+# else
+#  if @HAVE_ALIGNED_ALLOC@
+_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
+#  endif
+# endif
+# if @HAVE_ALIGNED_ALLOC@
+_GL_CXXALIASWARN (aligned_alloc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef aligned_alloc
+# if HAVE_RAW_DECL_ALIGNED_ALLOC
+_GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - "
+                 "use gnulib module aligned_alloc for portability");
+# endif
+#endif
+
 #if @GNULIB_ATOLL@
 /* Parse a signed decimal integer.
    Returns the value of the integer.  Errors are not detected.  */
@@ -217,19 +242,92 @@ _GL_WARN_ON_USE (canonicalize_file_name,
 # endif
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef ecvt
-# define ecvt _ecvt
+#if @GNULIB_MDA_ECVT@
+/* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have
+   it.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ecvt
+#   define ecvt _ecvt
+#  endif
+_GL_CXXALIAS_MDA (ecvt, char *,
+                  (double number, int ndigits, int *decptp, int *signp));
+# else
+#  if @HAVE_DECL_ECVT@
+_GL_CXXALIAS_SYS (ecvt, char *,
+                  (double number, int ndigits, int *decptp, int *signp));
+#  endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_ECVT@
+_GL_CXXALIASWARN (ecvt);
+# endif
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef fcvt
-# define fcvt _fcvt
+#if @GNULIB_MDA_FCVT@
+/* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have
+   it.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fcvt
+#   define fcvt _fcvt
+#  endif
+_GL_CXXALIAS_MDA (fcvt, char *,
+                  (double number, int ndigits, int *decptp, int *signp));
+# else
+#  if @HAVE_DECL_FCVT@
+_GL_CXXALIAS_SYS (fcvt, char *,
+                  (double number, int ndigits, int *decptp, int *signp));
+#  endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCVT@
+_GL_CXXALIASWARN (fcvt);
+# endif
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef gcvt
-# define gcvt _gcvt
+#if @GNULIB_FREE_POSIX@
+# if @REPLACE_FREE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef free
+#   define free rpl_free
+#  endif
+_GL_FUNCDECL_RPL (free, void, (void *ptr));
+_GL_CXXALIAS_RPL (free, void, (void *ptr));
+# else
+_GL_CXXALIAS_SYS (free, void, (void *ptr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (free);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef free
+/* Assume free is always declared.  */
+_GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - "
+                 "use gnulib module free for portability");
+#endif
+
+#if @GNULIB_MDA_GCVT@
+/* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have
+   it.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef gcvt
+#   define gcvt _gcvt
+#  endif
+_GL_CXXALIAS_MDA (gcvt, char *, (double number, int ndigits, char *buf));
+# else
+#  if @HAVE_DECL_GCVT@
+_GL_CXXALIAS_SYS (gcvt, char *, (double number, int ndigits, char *buf));
+#  endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_GCVT@
+_GL_CXXALIASWARN (gcvt);
+# endif
 #endif
 
 #if @GNULIB_GETLOADAVG@
@@ -483,9 +581,49 @@ _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
 # endif
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef mktemp
-# define mktemp _mktemp
+#if @GNULIB_MDA_MKTEMP@
+/* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::mktemp always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mktemp
+#   define mktemp _mktemp
+#  endif
+_GL_CXXALIAS_MDA (mktemp, char *, (char * /*template*/));
+# else
+_GL_CXXALIAS_SYS (mktemp, char *, (char * /*template*/));
+# endif
+_GL_CXXALIASWARN (mktemp);
+#endif
+
+/* Allocate memory with indefinite extent and specified alignment.  */
+#if @GNULIB_POSIX_MEMALIGN@
+# if @REPLACE_POSIX_MEMALIGN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef posix_memalign
+#   define posix_memalign rpl_posix_memalign
+#  endif
+_GL_FUNCDECL_RPL (posix_memalign, int,
+                  (void **memptr, size_t alignment, size_t size)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (posix_memalign, int,
+                  (void **memptr, size_t alignment, size_t size));
+# else
+#  if @HAVE_POSIX_MEMALIGN@
+_GL_CXXALIAS_SYS (posix_memalign, int,
+                  (void **memptr, size_t alignment, size_t size));
+#  endif
+# endif
+# if @HAVE_POSIX_MEMALIGN@
+_GL_CXXALIASWARN (posix_memalign);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_memalign
+# if HAVE_RAW_DECL_POSIX_MEMALIGN
+_GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
+                 "use gnulib module posix_memalign for portability");
+# endif
 #endif
 
 #if @GNULIB_POSIX_OPENPT@
@@ -576,9 +714,22 @@ _GL_CXXALIAS_MDA (putenv, int, (char *string));
 _GL_CXXALIAS_SYS (putenv, int, (char *string));
 # endif
 _GL_CXXALIASWARN (putenv);
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef putenv
-# define putenv _putenv
+#elif @GNULIB_MDA_PUTENV@
+/* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::putenv always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putenv
+#   define putenv _putenv
+#  endif
+/* Need to cast, because on mingw, the parameter is either
+   'const char *string' or 'char *string'.  */
+_GL_CXXALIAS_MDA_CAST (putenv, int, (char *string));
+# else
+_GL_CXXALIAS_SYS (putenv, int, (char *string));
+# endif
+_GL_CXXALIASWARN (putenv);
 #endif
 
 #if @GNULIB_QSORT_R@
diff --git a/lib/stpcpy.c b/lib/stpcpy.c
index 58265f0..a4165ba 100644
--- a/lib/stpcpy.c
+++ b/lib/stpcpy.c
@@ -1,5 +1,5 @@
 /* stpcpy.c -- copy a string and return pointer to end of new string
-   Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2020 Free Software
+   Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2021 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C 
Library.
diff --git a/lib/str-two-way.h b/lib/str-two-way.h
index 6ad0130..005a19f 100644
--- a/lib/str-two-way.h
+++ b/lib/str-two-way.h
@@ -1,5 +1,5 @@
 /* Byte-wise substring search, using the Two-Way algorithm.
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Eric Blake <ebb9@byu.net>, 2008.
 
diff --git a/lib/strftime.h b/lib/strftime.h
index fe0c419..7284f67 100644
--- a/lib/strftime.h
+++ b/lib/strftime.h
@@ -1,6 +1,6 @@
 /* declarations for strftime.c
 
-   Copyright (C) 2002, 2004, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/string.in.h b/lib/string.in.h
index 9724add..9f68e77 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2001-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -123,9 +123,22 @@ _GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the 
ffsll module");
 #endif
 
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef memccpy
-# define memccpy _memccpy
+#if @GNULIB_MDA_MEMCCPY@
+/* On native Windows, map 'memccpy' to '_memccpy', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::memccpy always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef memccpy
+#   define memccpy _memccpy
+#  endif
+_GL_CXXALIAS_MDA (memccpy, void *,
+                  (void *dest, const void *src, int c, size_t n));
+# else
+_GL_CXXALIAS_SYS (memccpy, void *,
+                  (void *dest, const void *src, int c, size_t n));
+# endif
+_GL_CXXALIASWARN (memccpy);
 #endif
 
 
@@ -133,6 +146,7 @@ _GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the 
ffsll module");
 #if @GNULIB_MEMCHR@
 # if @REPLACE_MEMCHR@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef memchr
 #   define memchr rpl_memchr
 #  endif
 _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
@@ -413,9 +427,23 @@ _GL_CXXALIASWARN (strdup);
 _GL_WARN_ON_USE (strdup, "strdup is unportable - "
                  "use gnulib module strdup for portability");
 # endif
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef strdup
-# define strdup _strdup
+#elif @GNULIB_MDA_STRDUP@
+/* On native Windows, map 'creat' to '_creat', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::creat always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strdup
+#   define strdup _strdup
+#  endif
+_GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
+# else
+#  if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
+#   undef strdup
+#  endif
+_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
+# endif
+_GL_CXXALIASWARN (strdup);
 #endif
 
 /* Append no more than N characters from SRC onto DEST.  */
diff --git a/lib/strnlen.c b/lib/strnlen.c
index dcecf08..c27a039 100644
--- a/lib/strnlen.c
+++ b/lib/strnlen.c
@@ -1,5 +1,5 @@
 /* Find the length of STRING, but scan at most MAXLEN characters.
-   Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/strtoimax.c b/lib/strtoimax.c
index a17b2f0..37a25c3 100644
--- a/lib/strtoimax.c
+++ b/lib/strtoimax.c
@@ -1,6 +1,6 @@
 /* Convert string representation of a number into an intmax_t value.
 
-   Copyright (C) 1999, 2001-2004, 2006, 2009-2020 Free Software Foundation,
+   Copyright (C) 1999, 2001-2004, 2006, 2009-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/strtol.c b/lib/strtol.c
index 02aafca..2f2159b 100644
--- a/lib/strtol.c
+++ b/lib/strtol.c
@@ -1,6 +1,6 @@
 /* Convert string representation of a number into an integer value.
 
-   Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2020 Free Software
+   Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2021 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C
diff --git a/lib/strtoll.c b/lib/strtoll.c
index 3c7e8c0..30daefc 100644
--- a/lib/strtoll.c
+++ b/lib/strtoll.c
@@ -1,5 +1,5 @@
 /* Function to parse a 'long long int' from text.
-   Copyright (C) 1995-1997, 1999, 2001, 2009-2020 Free Software Foundation,
+   Copyright (C) 1995-1997, 1999, 2001, 2009-2021 Free Software Foundation,
    Inc.
    This file is part of the GNU C Library.
 
diff --git a/lib/symlink.c b/lib/symlink.c
index e7dbd18..2f6c0d4 100644
--- a/lib/symlink.c
+++ b/lib/symlink.c
@@ -1,5 +1,5 @@
 /* Stub for symlink().
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@ rpl_symlink (char const *contents, char const *name)
   if (len && name[len - 1] == '/')
     {
       struct stat st;
-      if (lstat (name, &st) == 0)
+      if (lstat (name, &st) == 0 || errno == EOVERFLOW)
         errno = EEXIST;
       return -1;
     }
diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h
index a82d716..5b9280d 100644
--- a/lib/sys_random.in.h
+++ b/lib/sys_random.in.h
@@ -1,5 +1,5 @@
 /* Substitute for <sys/random.h>.
-   Copyright (C) 2020 Free Software Foundation, Inc.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index 72cb9ba..1dacb21 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -1,5 +1,5 @@
 /* Substitute for <sys/select.h>.
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -103,9 +103,16 @@
 /* Get definition of 'sigset_t'.
    But avoid namespace pollution on glibc systems and "unknown type
    name" problems on Cygwin.
+   On OS/2 kLIBC, sigset_t is defined in <sys/select.h>, too. In addition,
+   if <sys/param.h> is included, <types.h> -> <sys/types.h> -> <sys/select.h>
+   are included. Then <signal.h> -> <pthread.h> are included by GNULIB. By the
+   way, <pthread.h> requires PAGE_SIZE defined in <sys/param.h>. However,
+   <sys/param.h> has not been processed, yet. As a result, 'PAGE_SIZE'
+   undeclared error occurs in <pthread.h>.
    Do this after the include_next (for the sake of OpenBSD 5.0) but before
    the split double-inclusion guard (for the sake of Solaris).  */
-#if !((defined __GLIBC__ || defined __CYGWIN__) && !defined __UCLIBC__)
+#if !((defined __GLIBC__ || defined __CYGWIN__ || defined __KLIBC__) \
+      && !defined __UCLIBC__)
 # include <signal.h>
 #endif
 
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 3e0e4b2..ccdb5cb 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -1,5 +1,5 @@
 /* Provide a more complete sys/stat.h header file.
-   Copyright (C) 2005-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -375,11 +375,11 @@ struct stat
 # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
 #endif
 
-/* S_IXUGO is a common extension to POSIX.  */
+/* Although S_IXUGO and S_IRWXUGO are not specified by POSIX and are
+   not implemented in GNU/Linux, some Gnulib-using apps use the macros.  */
 #if !S_IXUGO
 # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
 #endif
-
 #ifndef S_IRWXUGO
 # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
 #endif
@@ -391,9 +391,21 @@ struct stat
 #endif
 
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef chmod
-# define chmod _chmod
+#if @GNULIB_MDA_CHMOD@
+/* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::chmod always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef chmod
+#   define chmod _chmod
+#  endif
+/* Need to cast, because in mingw the last argument is 'int mode'.  */
+_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (chmod);
 #endif
 
 
@@ -596,21 +608,20 @@ _GL_WARN_ON_USE (lstat, "lstat is unportable - "
 #endif
 
 
-#if @REPLACE_MKDIR@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#  undef mkdir
-#  define mkdir rpl_mkdir
-# endif
+#if @GNULIB_MKDIR@
+# if @REPLACE_MKDIR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mkdir
+#   define mkdir rpl_mkdir
+#  endif
 _GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
-                              _GL_ARG_NONNULL ((1)));
+                               _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
-#else
+# elif defined _WIN32 && !defined __CYGWIN__
 /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
    Additionally, it declares _mkdir (and depending on compile flags, an
    alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
    which are included above.  */
-# if defined _WIN32 && ! defined __CYGWIN__
-
 #  if !GNULIB_defined_rpl_mkdir
 static int
 rpl_mkdir (char const *name, mode_t mode)
@@ -619,16 +630,44 @@ rpl_mkdir (char const *name, mode_t mode)
 }
 #   define GNULIB_defined_rpl_mkdir 1
 #  endif
-
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mkdir
 #   define mkdir rpl_mkdir
 #  endif
 _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
 # else
 _GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
 # endif
-#endif
 _GL_CXXALIASWARN (mkdir);
+#elif defined GNULIB_POSIXCHECK
+# undef mkdir
+# if HAVE_RAW_DECL_MKDIR
+_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - "
+                 "use gnulib module mkdir for portability");
+# endif
+#elif @GNULIB_MDA_MKDIR@
+/* On native Windows, map 'mkdir' to '_mkdir', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::mkdir always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !GNULIB_defined_rpl_mkdir
+static int
+rpl_mkdir (char const *name, mode_t mode)
+{
+  return _mkdir (name);
+}
+#   define GNULIB_defined_rpl_mkdir 1
+#  endif
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mkdir
+#   define mkdir rpl_mkdir
+#  endif
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkdir);
+#endif
 
 
 #if @GNULIB_MKDIRAT@
@@ -808,9 +847,21 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
 #endif
 
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef umask
-# define umask _umask
+#if @GNULIB_MDA_UMASK@
+/* On native Windows, map 'umask' to '_umask', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::umask always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef umask
+#   define umask _umask
+#  endif
+/* Need to cast, because in mingw the last argument is 'int mode'.  */
+_GL_CXXALIAS_MDA_CAST (umask, mode_t, (mode_t mask));
+# else
+_GL_CXXALIAS_SYS (umask, mode_t, (mode_t mask));
+# endif
+_GL_CXXALIASWARN (umask);
 #endif
 
 
diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
index 1c12d5f..90a67d1 100644
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/time.h.
 
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h
index e7e1a22..654e803 100644
--- a/lib/sys_types.in.h
+++ b/lib/sys_types.in.h
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/types.h.
 
-   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/tempname.c b/lib/tempname.c
index cfb0fc4..3d91dee 100644
--- a/lib/tempname.c
+++ b/lib/tempname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -47,9 +47,11 @@
 #include <string.h>
 
 #include <fcntl.h>
+#include <stdalign.h>
 #include <stdint.h>
 #include <sys/random.h>
 #include <sys/stat.h>
+#include <time.h>
 
 #if _LIBC
 # define struct_stat64 struct stat64
@@ -60,27 +62,33 @@
 # define __mkdir mkdir
 # define __open open
 # define __lxstat64(version, file, buf) lstat (file, buf)
+# define __getrandom getrandom
+# define __clock_gettime64 clock_gettime
+# define __timespec64 timespec
 #endif
 
-#ifdef _LIBC
-# include <random-bits.h>
-# define RANDOM_BITS(Var) ((Var) = random_bits ())
-typedef uint32_t random_value;
-# define RANDOM_VALUE_MAX UINT32_MAX
-# define BASE_62_DIGITS 5 /* 62**5 < UINT32_MAX */
-# define BASE_62_POWER (62 * 62 * 62 * 62 * 62) /* 2**BASE_62_DIGITS */
-#else
 /* Use getrandom if it works, falling back on a 64-bit linear
-   congruential generator that starts with whatever Var's value
-   happens to be.  */
-# define RANDOM_BITS(Var) \
-    ((void) (getrandom (&(Var), sizeof (Var), 0) == sizeof (Var) \
-             || ((Var) = 2862933555777941757 * (Var) + 3037000493)))
+   congruential generator that starts with Var's value
+   mixed in with a clock's low-order bits if available.  */
 typedef uint_fast64_t random_value;
-# define RANDOM_VALUE_MAX UINT_FAST64_MAX
-# define BASE_62_DIGITS 10 /* 62**10 < UINT_FAST64_MAX */
-# define BASE_62_POWER (62LL * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62)
+#define RANDOM_VALUE_MAX UINT_FAST64_MAX
+#define BASE_62_DIGITS 10 /* 62**10 < UINT_FAST64_MAX */
+#define BASE_62_POWER (62LL * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62)
+
+static random_value
+random_bits (random_value var)
+{
+  random_value r;
+  if (__getrandom (&r, sizeof r, 0) == sizeof r)
+    return r;
+#if _LIBC || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
+  /* Add entropy if getrandom is not supported.  */
+  struct __timespec64 tv;
+  __clock_gettime64 (CLOCK_MONOTONIC, &tv);
+  var ^= tv.tv_nsec;
 #endif
+  return 2862933555777941757 * var + 3037000493;
+}
 
 #if _LIBC
 /* Return nonzero if DIR is an existent directory.  */
@@ -250,8 +258,11 @@ try_tempname_len (char *tmpl, int suffixlen, void *args,
   unsigned int attempts = ATTEMPTS_MIN;
 #endif
 
-  /* A random variable.  */
-  random_value v;
+  /* A random variable.  The initial value is used only the for fallback path
+     on 'random_bits' on 'getrandom' failure.  Its initial value tries to use
+     some entropy from the ASLR and ignore possible bits from the stack
+     alignment.  */
+  random_value v = ((uintptr_t) &v) / alignof (max_align_t);
 
   /* How many random base-62 digits can currently be extracted from V.  */
   int vdigits = 0;
@@ -279,7 +290,7 @@ try_tempname_len (char *tmpl, int suffixlen, void *args,
           if (vdigits == 0)
             {
               do
-                RANDOM_BITS (v);
+                v = random_bits (v);
               while (unfair_min <= v);
 
               vdigits = BASE_62_DIGITS;
diff --git a/lib/tempname.h b/lib/tempname.h
index 00dcbe4..a8681fc 100644
--- a/lib/tempname.h
+++ b/lib/tempname.h
@@ -1,6 +1,6 @@
 /* Create a temporary file or directory.
 
-   Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/time-internal.h b/lib/time-internal.h
index 8af3c2c..63a3f9e 100644
--- a/lib/time-internal.h
+++ b/lib/time-internal.h
@@ -1,6 +1,6 @@
 /* Time internal interface
 
-   Copyright 2015-2020 Free Software Foundation, Inc.
+   Copyright 2015-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/time.in.h b/lib/time.in.h
index 32e6ec0..958dc0b 100644
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -1,6 +1,6 @@
 /* A more-standard <time.h>.
 
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -145,9 +145,20 @@ _GL_CXXALIAS_MDA (tzset, void, (void));
 _GL_CXXALIAS_SYS (tzset, void, (void));
 #  endif
 _GL_CXXALIASWARN (tzset);
-# elif defined _WIN32 && !defined __CYGWIN__
-#  undef tzset
-#  define tzset _tzset
+# elif @GNULIB_MDA_TZSET@
+/* On native Windows, map 'tzset' to '_tzset', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::tzset always.  */
+#  if defined _WIN32 && !defined __CYGWIN__
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef tzset
+#    define tzset _tzset
+#   endif
+_GL_CXXALIAS_MDA (tzset, void, (void));
+#  else
+_GL_CXXALIAS_SYS (tzset, void, (void));
+#  endif
+_GL_CXXALIASWARN (tzset);
 # endif
 
 /* Return the 'time_t' representation of TP and normalize TP.  */
@@ -356,17 +367,17 @@ _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in 
some cases - "
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef asctime_r
-_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - "
+_GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
                  "better use strftime (or even sprintf) instead");
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef ctime
-_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - "
+_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
                  "better use strftime (or even sprintf) instead");
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef ctime_r
-_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - "
+_GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - "
                  "better use strftime (or even sprintf) instead");
 # endif
 
diff --git a/lib/time_r.c b/lib/time_r.c
index e8fca2d..d908986 100644
--- a/lib/time_r.c
+++ b/lib/time_r.c
@@ -1,6 +1,6 @@
 /* Reentrant time functions like localtime_r.
 
-   Copyright (C) 2003, 2006-2007, 2010-2020 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2010-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/time_rz.c b/lib/time_rz.c
index 95438cf..65e20cc 100644
--- a/lib/time_rz.c
+++ b/lib/time_rz.c
@@ -1,6 +1,6 @@
 /* Time zone functions such as tzalloc and localtime_rz
 
-   Copyright 2015-2020 Free Software Foundation, Inc.
+   Copyright 2015-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -27,19 +27,15 @@
 #include <time.h>
 
 #include <errno.h>
-#include <limits.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "flexmember.h"
+#include "idx.h"
 #include "time-internal.h"
 
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
-
 /* The approximate size to use for small allocation requests.  This is
    the largest "small" request for the GNU C library malloc.  */
 enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 };
@@ -125,14 +121,8 @@ save_abbr (timezone_t tz, struct tm *tm)
         {
           if (! (*zone_copy || (zone_copy == tz->abbrs && tz->tz_is_set)))
             {
-              size_t zone_size = strlen (zone) + 1;
-              size_t zone_used = zone_copy - tz->abbrs;
-              if (SIZE_MAX - zone_used < zone_size)
-                {
-                  errno = ENOMEM;
-                  return false;
-                }
-              if (zone_used + zone_size < ABBR_SIZE_MIN)
+              idx_t zone_size = strlen (zone) + 1;
+              if (zone_size < tz->abbrs + ABBR_SIZE_MIN - zone_copy)
                 extend_abbrs (zone_copy, zone, zone_size);
               else
                 {
diff --git a/lib/timespec-add.c b/lib/timespec-add.c
index 259c2e9..5460a04 100644
--- a/lib/timespec-add.c
+++ b/lib/timespec-add.c
@@ -1,6 +1,6 @@
 /* Add two struct timespec values.
 
-   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/timespec-sub.c b/lib/timespec-sub.c
index ee827a7..88ef69a 100644
--- a/lib/timespec-sub.c
+++ b/lib/timespec-sub.c
@@ -1,6 +1,6 @@
 /* Subtract two struct timespec values.
 
-   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/timespec.h b/lib/timespec.h
index dc999f9..9a71e9e 100644
--- a/lib/timespec.h
+++ b/lib/timespec.h
@@ -1,6 +1,6 @@
 /* timespec -- System time interface
 
-   Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2020 Free Software
+   Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/u64.h b/lib/u64.h
index a8d4d96..ad719c8 100644
--- a/lib/u64.h
+++ b/lib/u64.h
@@ -1,6 +1,6 @@
 /* uint64_t-like operations that work even on hosts lacking uint64_t
 
-   Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 357a35e..5e9b47d 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2020 Free Software Foundation, Inc.
+   Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -93,20 +93,18 @@
 # undef __need_system_stdlib_h
 #endif
 
-/* Native Windows platforms declare chdir, getcwd, rmdir in
+/* Native Windows platforms declare _chdir, _getcwd, _rmdir in
    <io.h> and/or <direct.h>, not in <unistd.h>.
-   They also declare access(), chmod(), close(), dup(), dup2(), isatty(),
-   lseek(), read(), unlink(), write() in <io.h>.  */
-#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
-      || defined GNULIB_POSIXCHECK) \
-     && (defined _WIN32 && ! defined __CYGWIN__))
-# include <io.h>     /* mingw32, mingw64 */
-# include <direct.h> /* mingw64, MSVC 9 */
-#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \
-       || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ 
\
-       || defined GNULIB_POSIXCHECK) \
-      && (defined _WIN32 && ! defined __CYGWIN__)
+   They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(),
+   _lseek(), _read(), _unlink(), _write() in <io.h>.  */
+#if defined _WIN32 && !defined __CYGWIN__
 # include <io.h>
+# include <direct.h>
+#endif
+
+/* Native Windows platforms declare _execl*, _execv* in <process.h>.  */
+#if defined _WIN32 && !defined __CYGWIN__
+# include <process.h>
 #endif
 
 /* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
@@ -138,11 +136,8 @@
 
 /* MSVC defines off_t in <sys/types.h>.
    May also define off_t to a 64-bit type on native Windows.  */
-/* But avoid namespace pollution on glibc systems.  */
-#ifndef __GLIBC__
-/* Get off_t, ssize_t.  */
-# include <sys/types.h>
-#endif
+/* Get off_t, ssize_t, mode_t.  */
+#include <sys/types.h>
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
@@ -292,9 +287,20 @@ _GL_WARN_ON_USE (access, "access does not always support 
X_OK - "
                  "also, this function is a security risk - "
                  "use the gnulib module faccessat instead");
 # endif
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef access
-# define access _access
+#elif @GNULIB_MDA_ACCESS@
+/* On native Windows, map 'access' to '_access', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::access always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef access
+#   define access _access
+#  endif
+_GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
+# else
+_GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
+# endif
+_GL_CXXALIASWARN (access);
 #endif
 
 
@@ -315,9 +321,20 @@ _GL_CXXALIASWARN (chdir);
 _GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
                  "use gnulib module chdir for portability");
 # endif
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef chdir
-# define chdir _chdir
+#elif @GNULIB_MDA_CHDIR@
+/* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::chdir always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef chdir
+#   define chdir _chdir
+#  endif
+_GL_CXXALIAS_MDA (chdir, int, (const char *file));
+# else
+_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIASWARN (chdir);
 #endif
 
 
@@ -380,9 +397,20 @@ _GL_CXXALIASWARN (close);
 /* Assume close is always declared.  */
 _GL_WARN_ON_USE (close, "close does not portably work on sockets - "
                  "use gnulib module close for portability");
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef close
-# define close _close
+#elif @GNULIB_MDA_CLOSE@
+/* On native Windows, map 'close' to '_close', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::close always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef close
+#   define close _close
+#  endif
+_GL_CXXALIAS_MDA (close, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (close, int, (int fd));
+# endif
+_GL_CXXALIASWARN (close);
 #endif
 
 
@@ -397,10 +425,11 @@ _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, 
off_t *ipos,
 # endif
 _GL_CXXALIASWARN (copy_file_range);
 #elif defined GNULIB_POSIXCHECK
-/* Assume copy_file_range is always declared.  */
+# if HAVE_RAW_DECL_COPY_FILE_RANGE
 _GL_WARN_ON_USE (copy_file_range,
                  "copy_file_range is unportable - "
                  "use gnulib module copy_file_range for portability");
+# endif
 #endif
 
 
@@ -427,9 +456,20 @@ _GL_CXXALIASWARN (dup);
 _GL_WARN_ON_USE (dup, "dup is unportable - "
                  "use gnulib module dup for portability");
 # endif
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef dup
-# define dup _dup
+#elif @GNULIB_MDA_DUP@
+/* On native Windows, map 'dup' to '_dup', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::dup always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef dup
+#   define dup _dup
+#  endif
+_GL_CXXALIAS_MDA (dup, int, (int oldfd));
+# else
+_GL_CXXALIAS_SYS (dup, int, (int oldfd));
+# endif
+_GL_CXXALIASWARN (dup);
 #endif
 
 
@@ -461,9 +501,20 @@ _GL_CXXALIASWARN (dup2);
 _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
                  "use gnulib module dup2 for portability");
 # endif
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef dup2
-# define dup2 _dup2
+#elif @GNULIB_MDA_DUP2@
+/* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::dup2 always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef dup2
+#   define dup2 _dup2
+#  endif
+_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
+# else
+_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
+# endif
+_GL_CXXALIASWARN (dup2);
 #endif
 
 
@@ -564,40 +615,279 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - 
"
 #endif
 
 
-#if defined _WIN32 && !defined __CYGWIN__
+#if @GNULIB_EXECL@
+# if @REPLACE_EXECL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execl
+#   define execl rpl_execl
+#  endif
+_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execl);
+#elif defined GNULIB_POSIXCHECK
 # undef execl
-# define execl _execl
+# if HAVE_RAW_DECL_EXECL
+_GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - "
+                 "use gnulib module execl for portability");
+# endif
+#elif @GNULIB_MDA_EXECL@
+/* On native Windows, map 'execl' to '_execl', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execl always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execl
+#   define execl _execl
+#  endif
+_GL_CXXALIAS_MDA (execl, intptr_t, (const char *program, const char *arg, 
...));
+# else
+_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execl);
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
+#if @GNULIB_EXECLE@
+# if @REPLACE_EXECLE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execle
+#   define execle rpl_execle
+#  endif
+_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execle);
+#elif defined GNULIB_POSIXCHECK
 # undef execle
-# define execle _execle
+# if HAVE_RAW_DECL_EXECLE
+_GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - "
+                 "use gnulib module execle for portability");
+# endif
+#elif @GNULIB_MDA_EXECLE@
+/* On native Windows, map 'execle' to '_execle', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execle always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execle
+#   define execle _execle
+#  endif
+_GL_CXXALIAS_MDA (execle, intptr_t,
+                  (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execle);
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
+#if @GNULIB_EXECLP@
+# if @REPLACE_EXECLP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execlp
+#   define execlp rpl_execlp
+#  endif
+_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execlp);
+#elif defined GNULIB_POSIXCHECK
 # undef execlp
-# define execlp _execlp
+# if HAVE_RAW_DECL_EXECLP
+_GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - "
+                 "use gnulib module execlp for portability");
+# endif
+#elif @GNULIB_MDA_EXECLP@
+/* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execlp always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execlp
+#   define execlp _execlp
+#  endif
+_GL_CXXALIAS_MDA (execlp, intptr_t,
+                  (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execlp);
 #endif
 
 
-#if defined _WIN32 && !defined __CYGWIN__
+#if @GNULIB_EXECV@
+# if @REPLACE_EXECV@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execv
+#   define execv rpl_execv
+#  endif
+_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv)
+                              _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execv);
+#elif defined GNULIB_POSIXCHECK
 # undef execv
-# define execv _execv
+# if HAVE_RAW_DECL_EXECV
+_GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - "
+                 "use gnulib module execv for portability");
+# endif
+#elif @GNULIB_MDA_EXECV@
+/* On native Windows, map 'execv' to '_execv', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execv always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execv
+#   define execv _execv
+#  endif
+_GL_CXXALIAS_MDA_CAST (execv, intptr_t,
+                       (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execv);
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
+#if @GNULIB_EXECVE@
+# if @REPLACE_EXECVE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execve
+#   define execve rpl_execve
+#  endif
+_GL_FUNCDECL_RPL (execve, int,
+                  (const char *program, char * const *argv, char * const *env)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execve, int,
+                  (const char *program, char * const *argv, char * const 
*env));
+# else
+_GL_CXXALIAS_SYS (execve, int,
+                  (const char *program, char * const *argv, char * const 
*env));
+# endif
+_GL_CXXALIASWARN (execve);
+#elif defined GNULIB_POSIXCHECK
 # undef execve
-# define execve _execve
+# if HAVE_RAW_DECL_EXECVE
+_GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - "
+                 "use gnulib module execve for portability");
+# endif
+#elif @GNULIB_MDA_EXECVE@
+/* On native Windows, map 'execve' to '_execve', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execve always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execve
+#   define execve _execve
+#  endif
+_GL_CXXALIAS_MDA_CAST (execve, intptr_t,
+                       (const char *program, char * const *argv,
+                        char * const *env));
+# else
+_GL_CXXALIAS_SYS (execve, int,
+                  (const char *program, char * const *argv, char * const 
*env));
+# endif
+_GL_CXXALIASWARN (execve);
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
+#if @GNULIB_EXECVP@
+# if @REPLACE_EXECVP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execvp
+#   define execvp rpl_execvp
+#  endif
+_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv)
+                               _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execvp);
+#elif defined GNULIB_POSIXCHECK
 # undef execvp
-# define execvp _execvp
+# if HAVE_RAW_DECL_EXECVP
+_GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - "
+                 "use gnulib module execvp for portability");
+# endif
+#elif @GNULIB_MDA_EXECVP@
+/* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execvp always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execvp
+#   define execvp _execvp
+#  endif
+_GL_CXXALIAS_MDA_CAST (execvp, intptr_t,
+                       (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execvp);
 #endif
 
-#if defined _WIN32 && !defined __CYGWIN__
+#if @GNULIB_EXECVPE@
+# if @REPLACE_EXECVPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execvpe
+#   define execvpe rpl_execvpe
+#  endif
+_GL_FUNCDECL_RPL (execvpe, int,
+                  (const char *program, char * const *argv, char * const *env)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execvpe, int,
+                  (const char *program, char * const *argv, char * const 
*env));
+# else
+#  if !@HAVE_DECL_EXECVPE@
+_GL_FUNCDECL_SYS (execvpe, int,
+                  (const char *program, char * const *argv, char * const *env)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (execvpe, int,
+                  (const char *program, char * const *argv, char * const 
*env));
+# endif
+_GL_CXXALIASWARN (execvpe);
+#elif defined GNULIB_POSIXCHECK
 # undef execvpe
-# define execvpe _execvpe
+# if HAVE_RAW_DECL_EXECVPE
+_GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - "
+                 "use gnulib module execvpe for portability");
+# endif
+#elif @GNULIB_MDA_EXECVPE@
+/* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have
+   it.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execvpe
+#   define execvpe _execvpe
+#  endif
+_GL_CXXALIAS_MDA_CAST (execvpe, intptr_t,
+                       (const char *program, char * const *argv,
+                        char * const *env));
+# elif @HAVE_EXECVPE@
+#  if !@HAVE_DECL_EXECVPE@
+_GL_FUNCDECL_SYS (execvpe, int,
+                  (const char *program, char * const *argv, char * const *env)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (execvpe, int,
+                  (const char *program, char * const *argv, char * const 
*env));
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_EXECVPE@
+_GL_CXXALIASWARN (execvpe);
+# endif
 #endif
 
 
@@ -688,7 +978,7 @@ _GL_CXXALIASWARN (fchownat);
 # undef fchownat
 # if HAVE_RAW_DECL_FCHOWNAT
 _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
-                 "use gnulib module openat for portability");
+                 "use gnulib module fchownat for portability");
 # endif
 #endif
 
@@ -794,9 +1084,22 @@ _GL_CXXALIASWARN (getcwd);
 _GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
                  "use gnulib module getcwd for portability");
 # endif
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef getcwd
-# define getcwd _getcwd
+#elif @GNULIB_MDA_GETCWD@
+/* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::getcwd always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getcwd
+#   define getcwd _getcwd
+#  endif
+/* Need to cast, because on mingw, the second parameter is either
+   'int size' or 'size_t size'.  */
+_GL_CXXALIAS_MDA_CAST (getcwd, char *, (char *buf, size_t size));
+# else
+_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
+# endif
+_GL_CXXALIASWARN (getcwd);
 #endif
 
 
@@ -1131,9 +1434,20 @@ _GL_WARN_ON_USE (getpass, "getpass is unportable - "
 #endif
 
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef getpid
-# define getpid _getpid
+#if @GNULIB_MDA_GETPID@
+/* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::getpid always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getpid
+#   define getpid _getpid
+#  endif
+_GL_CXXALIAS_MDA (getpid, int, (void));
+# else
+_GL_CXXALIAS_SYS (getpid, pid_t, (void));
+# endif
+_GL_CXXALIASWARN (getpid);
 #endif
 
 
@@ -1225,9 +1539,20 @@ _GL_CXXALIASWARN (isatty);
 _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
                  "use gnulib module isatty for portability");
 # endif
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef isatty
-# define isatty _isatty
+#elif @GNULIB_MDA_ISATTY@
+/* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::isatty always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef isatty
+#   define isatty _isatty
+#  endif
+_GL_CXXALIAS_MDA (isatty, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (isatty, int, (int fd));
+# endif
+_GL_CXXALIASWARN (isatty);
 #endif
 
 
@@ -1355,9 +1680,20 @@ _GL_CXXALIASWARN (lseek);
 _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
                  "systems - use gnulib module lseek for portability");
 # endif
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef lseek
-# define lseek _lseek
+#elif @GNULIB_MDA_LSEEK@
+/* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::lseek always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef lseek
+#   define lseek _lseek
+#  endif
+_GL_CXXALIAS_MDA (lseek, long, (int fd, long offset, int whence));
+# else
+_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (lseek);
 #endif
 
 
@@ -1497,15 +1833,27 @@ _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, 
size_t count));
 #  endif
 _GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count));
 # else
-/* Need to cast, because on mingw, the third parameter is
-                                                          unsigned int count
-   and the return type is 'int'.  */
-_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count));
+_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (read);
+#elif @GNULIB_MDA_READ@
+/* On native Windows, map 'read' to '_read', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::read always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef read
+#   define read _read
+#  endif
+#  ifdef __MINGW32__
+_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count));
+#  else
+_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count));
+#  endif
+# else
+_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
 # endif
 _GL_CXXALIASWARN (read);
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef read
-# define read _read
 #endif
 
 
@@ -1604,9 +1952,20 @@ _GL_CXXALIASWARN (rmdir);
 _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
                  "use gnulib module rmdir for portability");
 # endif
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef rmdir
-# define rmdir _rmdir
+#elif @GNULIB_MDA_RMDIR@
+/* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::rmdir always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef rmdir
+#   define rmdir _rmdir
+#  endif
+_GL_CXXALIAS_MDA (rmdir, int, (char const *name));
+# else
+_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
+# endif
+_GL_CXXALIASWARN (rmdir);
 #endif
 
 
@@ -1665,9 +2024,20 @@ _GL_WARN_ON_USE (sleep, "sleep is unportable - "
 #endif
 
 
-#if defined _WIN32 && !defined __CYGWIN__
-# undef swab
-# define swab _swab
+#if @GNULIB_MDA_SWAB@
+/* On native Windows, map 'swab' to '_swab', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::creat always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef swab
+#   define swab _swab
+#  endif
+_GL_CXXALIAS_MDA (swab, void, (char *from, char *to, int n));
+# else
+_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));
+# endif
+_GL_CXXALIASWARN (swab);
 #endif
 
 
@@ -1811,9 +2181,20 @@ _GL_CXXALIASWARN (unlink);
 _GL_WARN_ON_USE (unlink, "unlink is not portable - "
                  "use gnulib module unlink for portability");
 # endif
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef unlink
-# define unlink _unlink
+#elif @GNULIB_MDA_UNLINK@
+/* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::unlink always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef unlink
+#   define unlink _unlink
+#  endif
+_GL_CXXALIAS_MDA (unlink, int, (char const *file));
+# else
+_GL_CXXALIAS_SYS (unlink, int, (char const *file));
+# endif
+_GL_CXXALIASWARN (unlink);
 #endif
 
 
@@ -1838,7 +2219,7 @@ _GL_CXXALIASWARN (unlinkat);
 # undef unlinkat
 # if HAVE_RAW_DECL_UNLINKAT
 _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
-                 "use gnulib module openat for portability");
+                 "use gnulib module unlinkat for portability");
 # endif
 #endif
 
@@ -1892,15 +2273,27 @@ _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void 
*buf, size_t count));
 #  endif
 _GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count));
 # else
-/* Need to cast, because on mingw, the third parameter is
-                                                             unsigned int count
-   and the return type is 'int'.  */
-_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t 
count));
+_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (write);
+#elif @GNULIB_MDA_WRITE@
+/* On native Windows, map 'write' to '_write', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::write always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef write
+#   define write _write
+#  endif
+#  ifdef __MINGW32__
+_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count));
+#  else
+_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int 
count));
+#  endif
+# else
+_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
 # endif
 _GL_CXXALIASWARN (write);
-#elif defined _WIN32 && !defined __CYGWIN__
-# undef write
-# define write _write
 #endif
 
 _GL_INLINE_HEADER_END
diff --git a/lib/unlocked-io.h b/lib/unlocked-io.h
index e7f7199..86b91c1 100644
--- a/lib/unlocked-io.h
+++ b/lib/unlocked-io.h
@@ -1,6 +1,6 @@
 /* Prefer faster, non-thread-safe stdio functions if available.
 
-   Copyright (C) 2001-2004, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/utimens.c b/lib/utimens.c
index 3f53942..5bbae05 100644
--- a/lib/utimens.c
+++ b/lib/utimens.c
@@ -1,6 +1,6 @@
 /* Set file access and modification times.
 
-   Copyright (C) 2003-2020 Free Software Foundation, Inc.
+   Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
diff --git a/lib/utimens.h b/lib/utimens.h
index fc22c8a..295d3d7 100644
--- a/lib/utimens.h
+++ b/lib/utimens.h
@@ -1,6 +1,6 @@
 /* Set file access and modification times.
 
-   Copyright 2012-2020 Free Software Foundation, Inc.
+   Copyright 2012-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
diff --git a/lib/utimensat.c b/lib/utimensat.c
index 63788d5..2cea64f 100644
--- a/lib/utimensat.c
+++ b/lib/utimensat.c
@@ -1,5 +1,5 @@
 /* Set the access and modification time of a file relative to directory fd.
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/verify.h b/lib/verify.h
index fa1ed71..3cdcdca 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/vla.h b/lib/vla.h
index 4af7567..333b626 100644
--- a/lib/vla.h
+++ b/lib/vla.h
@@ -1,6 +1,6 @@
 /* vla.h - variable length arrays
 
-   Copyright 2014-2020 Free Software Foundation, Inc.
+   Copyright 2014-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/lib/warn-on-use.h b/lib/warn-on-use.h
index 3f728d1..5d5b17f 100644
--- a/lib/warn-on-use.h
+++ b/lib/warn-on-use.h
@@ -1,5 +1,5 @@
 /* A C macro for emitting warnings if a function is used.
-   Copyright (C) 2010-2020 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
diff --git a/lib/xalloc-oversized.h b/lib/xalloc-oversized.h
index 13ee230..53daf59 100644
--- a/lib/xalloc-oversized.h
+++ b/lib/xalloc-oversized.h
@@ -1,6 +1,6 @@
 /* xalloc-oversized.h -- memory allocation size checking
 
-   Copyright (C) 1990-2000, 2003-2004, 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 1990-2000, 2003-2004, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ typedef size_t __xalloc_count_type;
    positive and N must be nonnegative.  This is a macro, not a
    function, so that it works correctly even when SIZE_MAX < N.  */
 
-#if 7 <= __GNUC__
+#if 7 <= __GNUC__ && !defined __clang__
 # define xalloc_oversized(n, s) \
    __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
 #elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
diff --git a/lisp/ChangeLog.1 b/lisp/ChangeLog.1
index 5ef36f4..9fda59b 100644
--- a/lisp/ChangeLog.1
+++ b/lisp/ChangeLog.1
@@ -3244,7 +3244,7 @@
                Set current buffer variables from defaults
                in case user's init file has changed them.
 
-  Copyright (C) 1985-1986, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1985-1986, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.10 b/lisp/ChangeLog.10
index 177ca08..c8b0bda 100644
--- a/lisp/ChangeLog.10
+++ b/lisp/ChangeLog.10
@@ -23541,7 +23541,7 @@ See ChangeLog.9 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-    Copyright (C) 2001-2020 Free Software Foundation, Inc.
+    Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.11 b/lisp/ChangeLog.11
index 374a566..0c72cb4 100644
--- a/lisp/ChangeLog.11
+++ b/lisp/ChangeLog.11
@@ -14321,7 +14321,7 @@ See ChangeLog.10 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2003-2011, 2013-2020 Free Software Foundation, Inc.
+  Copyright (C) 2003-2011, 2013-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.12 b/lisp/ChangeLog.12
index 40aa8c4..5d42457 100644
--- a/lisp/ChangeLog.12
+++ b/lisp/ChangeLog.12
@@ -33334,7 +33334,7 @@ See ChangeLog.11 for earlier changes.
 ;; add-log-time-zone-rule: t
 ;; End:
 
-    Copyright (C) 2005-2020 Free Software Foundation, Inc.
+    Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.13 b/lisp/ChangeLog.13
index 1a2863a..d849bd8 100644
--- a/lisp/ChangeLog.13
+++ b/lisp/ChangeLog.13
@@ -16697,7 +16697,7 @@ See ChangeLog.12 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2007-2020 Free Software Foundation, Inc.
+  Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.14 b/lisp/ChangeLog.14
index e9c8a8f..edd5bdb 100644
--- a/lisp/ChangeLog.14
+++ b/lisp/ChangeLog.14
@@ -20547,7 +20547,7 @@ See ChangeLog.13 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-    Copyright (C) 2008-2020 Free Software Foundation, Inc.
+    Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.15 b/lisp/ChangeLog.15
index 3a578da..bd1fbe6 100644
--- a/lisp/ChangeLog.15
+++ b/lisp/ChangeLog.15
@@ -22802,7 +22802,7 @@ See ChangeLog.14 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2009-2020 Free Software Foundation, Inc.
+  Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.16 b/lisp/ChangeLog.16
index bb7389c..67b6276 100644
--- a/lisp/ChangeLog.16
+++ b/lisp/ChangeLog.16
@@ -25223,7 +25223,7 @@ See ChangeLog.15 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2011-2020 Free Software Foundation, Inc.
+  Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.17 b/lisp/ChangeLog.17
index 5789445..14a6c5d 100644
--- a/lisp/ChangeLog.17
+++ b/lisp/ChangeLog.17
@@ -26294,7 +26294,7 @@ See ChangeLog.16 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2011-2020 Free Software Foundation, Inc.
+  Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.2 b/lisp/ChangeLog.2
index 274ee99..ea6ddbb 100644
--- a/lisp/ChangeLog.2
+++ b/lisp/ChangeLog.2
@@ -3992,7 +3992,7 @@
 
 See ChangeLog.1 for earlier changes.
 
-    Copyright (C) 1986-1988, 2001-2020 Free Software Foundation, Inc.
+    Copyright (C) 1986-1988, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.3 b/lisp/ChangeLog.3
index ef0e423..a4470b9 100644
--- a/lisp/ChangeLog.3
+++ b/lisp/ChangeLog.3
@@ -12433,7 +12433,7 @@ See ChangeLog.2 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-    Copyright (C) 1989, 1993, 2001-2020 Free Software Foundation, Inc.
+    Copyright (C) 1989, 1993, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.4 b/lisp/ChangeLog.4
index 1f64650..47a8bfd 100644
--- a/lisp/ChangeLog.4
+++ b/lisp/ChangeLog.4
@@ -8934,7 +8934,7 @@ See ChangeLog.3 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-    Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+    Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.5 b/lisp/ChangeLog.5
index cd092bd..1a3a13c 100644
--- a/lisp/ChangeLog.5
+++ b/lisp/ChangeLog.5
@@ -9268,7 +9268,7 @@ See ChangeLog.4 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-    Copyright (C) 1994-1995, 2001-2020 Free Software Foundation, Inc.
+    Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.6 b/lisp/ChangeLog.6
index 87ae38b..492dae1 100644
--- a/lisp/ChangeLog.6
+++ b/lisp/ChangeLog.6
@@ -8021,7 +8021,7 @@ See ChangeLog.5 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-    Copyright (C) 1995-1996, 2001-2020 Free Software Foundation, Inc.
+    Copyright (C) 1995-1996, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.7 b/lisp/ChangeLog.7
index 58a7fa4..3de3f2f 100644
--- a/lisp/ChangeLog.7
+++ b/lisp/ChangeLog.7
@@ -23110,7 +23110,7 @@ See ChangeLog.6 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-       Copyright (C) 1997-1998, 2001-2020 Free Software Foundation,
+       Copyright (C) 1997-1998, 2001-2021 Free Software Foundation,
        Inc.
 
   This file is part of GNU Emacs.
diff --git a/lisp/ChangeLog.8 b/lisp/ChangeLog.8
index e9b2138..3027463 100644
--- a/lisp/ChangeLog.8
+++ b/lisp/ChangeLog.8
@@ -9992,7 +9992,7 @@ See ChangeLog.7 for earlier changes.
 ;; add-log-time-zone-rule: t
 ;; End:
 
-    Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc.
+    Copyright (C) 1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/ChangeLog.9 b/lisp/ChangeLog.9
index 5372b24..a8ef2ff 100644
--- a/lisp/ChangeLog.9
+++ b/lisp/ChangeLog.9
@@ -20685,7 +20685,7 @@ See ChangeLog.8 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-    Copyright (C) 2000-2011, 2013-2020 Free Software Foundation, Inc.
+    Copyright (C) 2000-2011, 2013-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 7c86e89..72f7f16 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 2000-2020 Free Software Foundation, Inc.
+# Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index f35c637..65f7118 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -1,6 +1,6 @@
 ;;; abbrev.el --- abbrev mode commands for Emacs -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1987, 1992, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1985-1987, 1992, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/align.el b/lisp/align.el
index a11d834..1318b73 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -1,6 +1,6 @@
 ;;; align.el --- align text to a specific column, by regexp -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
@@ -397,13 +397,12 @@ The possible settings for `align-region-separate' are:
      (modes    . align-lisp-modes))
 
     (open-comment
-     (regexp   . ,(function
-                  (lambda (end reverse)
-                    (funcall (if reverse 're-search-backward
-                               're-search-forward)
-                             (concat "[^ \t\n\\]"
-                                     (regexp-quote comment-start)
-                                     "\\(.+\\)$") end t))))
+     (regexp   . ,(lambda (end reverse)
+                    (funcall (if reverse 're-search-backward
+                               're-search-forward)
+                             (concat "[^ \t\n\\]"
+                                     (regexp-quote comment-start)
+                                     "\\(.+\\)$") end t)))
      (modes    . align-open-comment-modes))
 
     (c-macro-definition
@@ -411,7 +410,7 @@ The possible settings for `align-region-separate' are:
      (modes    . align-c++-modes))
 
     (c-variable-declaration
-     (regexp   . ,(concat "[*&0-9A-Za-z_]>?[&*]*\\(\\s-+[*&]*\\)"
+     (regexp   . ,(concat "[*&0-9A-Za-z_]>?[][&*]*\\(\\s-+[*&]*\\)"
                          "[A-Za-z_][][0-9A-Za-z:_]*\\s-*\\(\\()\\|"
                          "=[^=\n].*\\|(.*)\\|\\(\\[.*\\]\\)*\\)"
                          "\\s-*[;,]\\|)\\s-*$\\)"))
@@ -419,17 +418,16 @@ The possible settings for `align-region-separate' are:
      (modes    . align-c++-modes)
      (justify  . t)
      (valid
-      . ,(function
-         (lambda ()
-           (not (or (save-excursion
-                      (goto-char (match-beginning 1))
-                      (backward-word 1)
-                      (looking-at
-                       "\\(goto\\|return\\|new\\|delete\\|throw\\)"))
-                    (if (and (boundp 'font-lock-mode) font-lock-mode)
-                        (eq (get-text-property (point) 'face)
-                            'font-lock-comment-face)
-                      (eq (caar (c-guess-basic-syntax)) 'c))))))))
+      . ,(lambda ()
+           (not (or (save-excursion
+                      (goto-char (match-beginning 1))
+                      (backward-word 1)
+                      (looking-at
+                       "\\(goto\\|return\\|new\\|delete\\|throw\\)"))
+                    (if (and (boundp 'font-lock-mode) font-lock-mode)
+                        (eq (get-text-property (point) 'face)
+                            'font-lock-comment-face)
+                      (eq (caar (c-guess-basic-syntax)) 'c)))))))
 
     (c-assignment
      (regexp   . ,(concat "[^-=!^&*+<>/| \t\n]\\(\\s-*[-=!^&*+<>/|]*\\)"
@@ -465,12 +463,11 @@ The possible settings for `align-region-separate' are:
      (modes    . align-c++-modes)
      (run-if   . ,(lambda () current-prefix-arg)))
                                        ;      (valid
-                                       ;       . ,(function
-                                       ;         (lambda ()
+                                        ;       . ,(lambda ()
                                        ;           (memq (caar 
(c-guess-basic-syntax))
                                        ;                 '(brace-list-intro
                                        ;                   brace-list-entry
-                                       ;                   
brace-entry-open))))))
+                                        ;                  
brace-entry-open)))))
 
     ;; With a prefix argument, comma delimiter will be aligned.  Since
     ;; perl-mode doesn't give us enough syntactic information (and we
@@ -486,71 +483,63 @@ The possible settings for `align-region-separate' are:
      (regexp   . "\\(\\s-*\\)\\(//.*\\|/\\*.*\\*/\\s-*\\)$")
      (modes    . align-c++-modes)
      (column   . comment-column)
-     (valid    . ,(function
-                  (lambda ()
-                    (save-excursion
-                      (goto-char (match-beginning 1))
-                      (not (bolp)))))))
+     (valid    . ,(lambda ()
+                    (save-excursion
+                      (goto-char (match-beginning 1))
+                      (not (bolp))))))
 
     (c-chain-logic
      (regexp   . "\\(\\s-*\\)\\(&&\\|||\\|\\<and\\>\\|\\<or\\>\\)")
      (modes    . align-c++-modes)
-     (valid    . ,(function
-                  (lambda ()
-                    (save-excursion
-                      (goto-char (match-end 2))
-                      (looking-at "\\s-*\\(/[*/]\\|$\\)"))))))
+     (valid    . ,(lambda ()
+                    (save-excursion
+                      (goto-char (match-end 2))
+                      (looking-at "\\s-*\\(/[*/]\\|$\\)")))))
 
     (perl-chain-logic
      (regexp   . "\\(\\s-*\\)\\(&&\\|||\\|\\<and\\>\\|\\<or\\>\\)")
      (modes    . align-perl-modes)
-     (valid    . ,(function
-                  (lambda ()
-                    (save-excursion
-                      (goto-char (match-end 2))
-                      (looking-at "\\s-*\\(#\\|$\\)"))))))
+     (valid    . ,(lambda ()
+                    (save-excursion
+                      (goto-char (match-end 2))
+                      (looking-at "\\s-*\\(#\\|$\\)")))))
 
     (python-chain-logic
      (regexp   . "\\(\\s-*\\)\\(\\<and\\>\\|\\<or\\>\\)")
      (modes    . '(python-mode))
-     (valid    . ,(function
-                  (lambda ()
-                    (save-excursion
-                      (goto-char (match-end 2))
-                      (looking-at "\\s-*\\(#\\|$\\|\\\\\\)"))))))
+     (valid    . ,(lambda ()
+                    (save-excursion
+                      (goto-char (match-end 2))
+                      (looking-at "\\s-*\\(#\\|$\\|\\\\\\)")))))
 
     (c-macro-line-continuation
      (regexp   . "\\(\\s-*\\)\\\\$")
      (modes    . align-c++-modes)
      (column   . c-backslash-column))
                                        ;      (valid
-                                       ;       . ,(function
-                                       ;         (lambda ()
+                                        ;       . ,(lambda ()
                                        ;           (memq (caar 
(c-guess-basic-syntax))
-                                       ;                 '(cpp-macro 
cpp-macro-cont))))))
+                                        ;                '(cpp-macro 
cpp-macro-cont)))))
 
     (basic-line-continuation
      (regexp   . "\\(\\s-*\\)\\\\$")
      (modes    . '(python-mode makefile-mode)))
 
     (tex-record-separator
-     (regexp . ,(function
-                (lambda (end reverse)
-                  (align-match-tex-pattern "&" end reverse))))
+     (regexp . ,(lambda (end reverse)
+                  (align-match-tex-pattern "&" end reverse)))
      (group    . (1 2))
      (modes    . align-tex-modes)
      (repeat   . t))
 
     (tex-tabbing-separator
-     (regexp   . ,(function
-                  (lambda (end reverse)
-                    (align-match-tex-pattern "\\\\[=>]" end reverse))))
+     (regexp   . ,(lambda (end reverse)
+                    (align-match-tex-pattern "\\\\[=>]" end reverse)))
      (group    . (1 2))
      (modes    . align-tex-modes)
      (repeat   . t)
-     (run-if   . ,(function
-                  (lambda ()
-                    (eq major-mode 'latex-mode)))))
+     (run-if   . ,(lambda ()
+                    (eq major-mode 'latex-mode))))
 
     (tex-record-break
      (regexp   . "\\(\\s-*\\)\\\\\\\\")
@@ -563,10 +552,9 @@ The possible settings for `align-region-separate' are:
      (group    . 2)
      (modes    . align-text-modes)
      (repeat   . t)
-     (run-if   . ,(function
-                  (lambda ()
-                    (and current-prefix-arg
-                         (not (eq '- current-prefix-arg)))))))
+     (run-if   . ,(lambda ()
+                    (and current-prefix-arg
+                         (not (eq '- current-prefix-arg))))))
 
     ;; With a negative prefix argument, lists of dollar figures will
     ;; be aligned.
@@ -574,9 +562,8 @@ The possible settings for `align-region-separate' are:
      (regexp   . "\\$?\\(\\s-+[0-9]+\\)\\.")
      (modes    . align-text-modes)
      (justify  . t)
-     (run-if   . ,(function
-                  (lambda ()
-                    (eq '- current-prefix-arg)))))
+     (run-if   . ,(lambda ()
+                    (eq '- current-prefix-arg))))
 
     (css-declaration
      (regexp . "^\\s-*\\(?:\\w-?\\)+:\\(\\s-*\\).*;")
@@ -757,13 +744,12 @@ The following attributes are meaningful:
 
     (exc-open-comment
      (regexp
-      . ,(function
-         (lambda (end reverse)
-           (funcall (if reverse 're-search-backward
-                      're-search-forward)
-                    (concat "[^ \t\n\\]"
-                            (regexp-quote comment-start)
-                            "\\(.+\\)$") end t))))
+      . ,(lambda (end reverse)
+           (funcall (if reverse 're-search-backward
+                      're-search-forward)
+                    (concat "[^ \t\n\\]"
+                            (regexp-quote comment-start)
+                            "\\(.+\\)$") end t)))
      (modes  . align-open-comment-modes))
 
     (exc-c-comment
@@ -817,10 +803,9 @@ See the variable `align-exclude-rules-list' for more 
details.")
      (regexp   . "\\(others\\|[^ \t\n=<]\\)\\(\\s-*\\)=>\\(\\s-*\\)\\S-")
      (group    . (2 3))
      (valid
-      . ,(function
-         (lambda ()
-           (not (string= (downcase (match-string 1))
-                         "others"))))))
+      . ,(lambda ()
+           (not (string= (downcase (match-string 1))
+                         "others")))))
 
     (vhdl-colon
      (regexp   . "[^ \t\n:]\\(\\s-*\\):\\(\\s-*\\)[^=\n]")
@@ -1022,21 +1007,20 @@ to be colored."
                 (or align-mode-rules-list align-rules-list)))
      (unless ex-rule (or exclude-rules align-mode-exclude-rules-list
                         align-exclude-rules-list))
-     (function
-      (lambda (b e mode)
-       (if (and mode (listp mode))
-           (if (equal (symbol-name (car mode)) title)
-               (setq face (cons align-highlight-change-face
-                                align-highlight-nochange-face))
-             (setq face nil))
-         (when face
-           (let ((overlay (make-overlay b e)))
-             (setq align-highlight-overlays
-                   (cons overlay align-highlight-overlays))
-             (overlay-put overlay 'face
-                          (if mode
-                              (car face)
-                            (cdr face)))))))))))
+     (lambda (b e mode)
+       (if (and mode (listp mode))
+           (if (equal (symbol-name (car mode)) title)
+               (setq face (cons align-highlight-change-face
+                                align-highlight-nochange-face))
+             (setq face nil))
+         (when face
+           (let ((overlay (make-overlay b e)))
+             (setq align-highlight-overlays
+                   (cons overlay align-highlight-overlays))
+             (overlay-put overlay 'face
+                          (if mode
+                              (car face)
+                            (cdr face))))))))))
 
 ;;;###autoload
 (defun align-unhighlight-rule ()
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index 7e79577..d31083e 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -1,6 +1,6 @@
 ;; allout-widgets.el --- Visually highlight allout outline structure.
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Ken Manheimer <ken dot manheimer at gmail...>
 ;; Version: 1.0
@@ -254,7 +254,7 @@ or deleted while this variable is nil.")
 (defvar allout-widgets-mode-inhibit)    ; defined below
 ;;;_   > allout-widgets-tally-string
 (defun allout-widgets-tally-string ()
-  "Return a string giving the number of tracked widgets, or empty string if 
not tracking.
+  "Return a string with number of tracked widgets, or empty string if not 
tracking.
 
 The string is formed for appending to the allout-mode mode-line lighter.
 
diff --git a/lisp/allout.el b/lisp/allout.el
index 880098c..39aa29b 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -1,6 +1,6 @@
 ;;; allout.el --- extensive outline mode for use alone and with other modes
 
-;; Copyright (C) 1992-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Ken Manheimer <ken dot manheimer at gmail...>
 ;; Created: Dec 1991 -- first release to usenet
diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el
index d5432a6..e5bfccd 100644
--- a/lisp/ansi-color.el
+++ b/lisp/ansi-color.el
@@ -1,6 +1,6 @@
 ;;; ansi-color.el --- translate ANSI escape sequences into faces -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Version: 3.4.2
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 595db1d..86cdf23 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -1,6 +1,6 @@
 ;;; apropos.el --- apropos commands for users and programmers  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1989, 1994-1995, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1989, 1994-1995, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Joe Wells <jbw@bigbird.bu.edu>
@@ -1225,8 +1225,8 @@ as a heading."
          (apropos-print-doc 6 'apropos-face t)
          (apropos-print-doc 5 'apropos-widget t)
          (apropos-print-doc 4 'apropos-plist nil))
-        (set (make-local-variable 'truncate-partial-width-windows) t)
-        (set (make-local-variable 'truncate-lines) t))))
+        (setq-local truncate-partial-width-windows t)
+        (setq-local truncate-lines t))))
   (prog1 apropos-accumulator
     (setq apropos-accumulator ())))    ; permit gc
 
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 3516af6..52908d9 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -1,6 +1,6 @@
 ;;; arc-mode.el --- simple editing of archives  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1995, 1997-1998, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1995, 1997-1998, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Morten Welinder <terra@gnu.org>
diff --git a/lisp/array.el b/lisp/array.el
index 0d1ac74..cd8971b 100644
--- a/lisp/array.el
+++ b/lisp/array.el
@@ -1,6 +1,6 @@
 ;;; array.el --- array editing commands for GNU Emacs
 
-;; Copyright (C) 1987, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1987, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: David M. Brown
 ;; Maintainer: emacs-devel@gnu.org
@@ -817,14 +817,16 @@ The variables are:
 Variables you assign:
      array-max-row:          The number of rows in the array.
      array-max-column:       The number of columns in the array.
-     array-columns-per-line: The number of columns in the array per line of 
buffer.
+     array-columns-per-line: The number of columns in the array
+                             per line of buffer.
      array-field-width:      The width of each field, in characters.
      array-rows-numbered:    A logical variable describing whether to ignore
-                       row numbers in the buffer.
+                             row numbers in the buffer.
 
 Variables which are calculated:
      array-line-length:      The number of characters in a buffer line.
-     array-lines-per-row:    The number of buffer lines used to display each 
row.
+     array-lines-per-row:    The number of buffer lines used to
+                             display each row.
 
   The following commands are available (an asterisk indicates it may
 take a numeric prefix argument):
@@ -834,17 +836,17 @@ take a numeric prefix argument):
     *          \\[array-next-row]        Move down one row.
     *          \\[array-previous-row]    Move up one row.
 
-    *   \\[array-copy-forward]   Copy the current field into the column to the 
right.
-    *   \\[array-copy-backward]          Copy the current field into the 
column to the left.
-    *   \\[array-copy-down]      Copy the current field into the row below.
-    *   \\[array-copy-up]        Copy the current field into the row above.
+    *   \\[array-copy-forward]   Copy current field into the column to the 
right.
+    *   \\[array-copy-backward]          Copy current field into the column to 
the left.
+    *   \\[array-copy-down]      Copy current field into the row below.
+    *   \\[array-copy-up]        Copy current field into the row above.
 
-    *   \\[array-copy-column-forward]   Copy the current column into the 
column to the right.
-    *   \\[array-copy-column-backward]   Copy the current column into the 
column to the left.
+    *   \\[array-copy-column-forward]   Copy current column into the column to 
the right.
+    *   \\[array-copy-column-backward]   Copy current column into the column 
to the left.
     *   \\[array-copy-row-down]   Copy the current row into the row below.
     *   \\[array-copy-row-up]   Copy the current row into the row above.
 
-        \\[array-fill-rectangle]   Copy the field at mark into every cell with 
row and column
+        \\[array-fill-rectangle]   Copy field at mark into every cell with row 
and column
                   between that of point and mark.
 
        \\[array-what-position]   Display the current array row and column.
@@ -855,7 +857,7 @@ take a numeric prefix argument):
         \\[array-expand-rows]   Expand the array (remove row numbers and
                   newlines inside rows)
 
-        \\[array-display-local-variables]   Display the current values of 
local variables.
+        \\[array-display-local-variables]   Display current values of local 
variables.
 
 Entering array mode calls the function `array-mode-hook'."
   (make-local-variable 'array-buffer-line)
@@ -863,25 +865,25 @@ Entering array mode calls the function `array-mode-hook'."
   (make-local-variable 'array-row)
   (make-local-variable 'array-column)
   (make-local-variable 'array-copy-string)
-  (set (make-local-variable 'array-respect-tabs) nil)
-  (set (make-local-variable 'array-max-row)
-       (read-number "Number of array rows: "))
-  (set (make-local-variable 'array-max-column)
-       (read-number "Number of array columns: "))
-  (set (make-local-variable 'array-columns-per-line)
-       (read-number "Array columns per line: "))
-  (set (make-local-variable 'array-field-width)
-       (read-number "Field width: "))
-  (set (make-local-variable 'array-rows-numbered)
-       (y-or-n-p "Rows numbered? "))
-  (set (make-local-variable 'array-line-length)
-       (* array-field-width array-columns-per-line))
-  (set (make-local-variable 'array-lines-per-row)
-       (+ (floor (1- array-max-column) array-columns-per-line)
-          (if array-rows-numbered 2 1)))
+  (setq-local array-respect-tabs nil)
+  (setq-local array-max-row
+              (read-number "Number of array rows: "))
+  (setq-local array-max-column
+              (read-number "Number of array columns: "))
+  (setq-local array-columns-per-line
+              (read-number "Array columns per line: "))
+  (setq-local array-field-width
+              (read-number "Field width: "))
+  (setq-local array-rows-numbered
+              (y-or-n-p "Rows numbered? "))
+  (setq-local array-line-length
+              (* array-field-width array-columns-per-line))
+  (setq-local array-lines-per-row
+              (+ (floor (1- array-max-column) array-columns-per-line)
+                 (if array-rows-numbered 2 1)))
   (message "")
   (force-mode-line-update)
-  (set (make-local-variable 'truncate-lines) t)
+  (setq-local truncate-lines t)
   (setq overwrite-mode 'overwrite-mode-textual))
 
 
diff --git a/lisp/auth-source-pass.el b/lisp/auth-source-pass.el
index ba66d0b..39db1a7 100644
--- a/lisp/auth-source-pass.el
+++ b/lisp/auth-source-pass.el
@@ -1,6 +1,6 @@
 ;;; auth-source-pass.el --- Integrate auth-source with password-store -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2015, 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Damien Cassou <damien@cassou.me>,
 ;;         Nicolas Petton <nicolas@petton.fr>
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index 50795ce..ad3b690 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -1,6 +1,6 @@
 ;;; auth-source.el --- authentication sources for Gnus and Emacs -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Ted Zlatanov <tzz@lifelogs.com>
 ;; Keywords: news
@@ -2408,23 +2408,51 @@ MODE can be \"login\" or \"password\"."
     (list user password auth-info)))
 
 ;;; Tiny mode for editing .netrc/.authinfo modes (that basically just
-;;; hides passwords).
+;;; hides passwords and adds basic syntax highlighting).
 
 (defcustom authinfo-hidden "password"
   "Regexp matching elements in .authinfo/.netrc files that should be hidden."
   :type 'regexp
   :version "27.1")
 
+(defcustom authinfo-hide-elements t
+  "Whether to use `authinfo-hidden' to hide elements in authinfo files."
+  :type 'boolean
+  :version "28.1")
+
+(defvar authinfo--keywords
+  '(("^#.*" . font-lock-comment-face)
+    ("^\\(machine\\)[ \t]+\\([^ \t\n]+\\)"
+     (1 font-lock-variable-name-face)
+     (2 font-lock-builtin-face))
+    ("\\(login\\)[ \t]+\\([^ \t\n]+\\)"
+     (1 font-lock-comment-delimiter-face)
+     (2 font-lock-keyword-face))
+    ("\\(password\\)[ \t]+\\([^ \t\n]+\\)"
+     (1 font-lock-comment-delimiter-face)
+     (2 font-lock-doc-face))
+    ("\\(port\\)[ \t]+\\([^ \t\n]+\\)"
+     (1 font-lock-comment-delimiter-face)
+     (2 font-lock-type-face))
+    ("\\([^ \t\n]+\\)[, \t]+\\([^ \t\n]+\\)"
+     (1 font-lock-constant-face)
+     (2 nil))))
+
 ;;;###autoload
 (define-derived-mode authinfo-mode fundamental-mode "Authinfo"
   "Mode for editing .authinfo/.netrc files.
 
-This is just like `fundamental-mode', but hides passwords.  The
-passwords are revealed when point moved into the password.
+This is just like `fundamental-mode', but has basic syntax
+highlighting and hides passwords.  Passwords are revealed when
+point is moved into the passwords (see `authinfo-hide-elements').
 
 \\{authinfo-mode-map}"
-  (authinfo--hide-passwords (point-min) (point-max))
-  (reveal-mode))
+  (font-lock-add-keywords nil authinfo--keywords)
+  (setq-local comment-start "#")
+  (setq-local comment-end "")
+  (when authinfo-hide-elements
+    (authinfo--hide-passwords (point-min) (point-max))
+    (reveal-mode)))
 
 (defun authinfo--hide-passwords (start end)
   (save-excursion
@@ -2436,14 +2464,15 @@ passwords are revealed when point moved into the 
password.
                                 nil t)
         (when (auth-source-netrc-looking-at-token)
           (let ((overlay (make-overlay (match-beginning 0) (match-end 0))))
-            (overlay-put overlay 'display (propertize "****"
-                                                      'face 'warning))
+            (overlay-put overlay 'display
+                         (propertize "****" 'face 'font-lock-doc-face))
             (overlay-put overlay 'reveal-toggle-invisible
                          #'authinfo--toggle-display)))))))
 
 (defun authinfo--toggle-display (overlay hide)
   (if hide
-      (overlay-put overlay 'display (propertize "****" 'face 'warning))
+      (overlay-put overlay 'display
+                   (propertize "****" 'face 'font-lock-doc-face))
     (overlay-put overlay 'display nil)))
 
 (provide 'auth-source)
diff --git a/lisp/autoarg.el b/lisp/autoarg.el
index d415277..c2cb0c7 100644
--- a/lisp/autoarg.el
+++ b/lisp/autoarg.el
@@ -1,6 +1,6 @@
 ;;; autoarg.el --- make digit keys supply prefix args -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author:  Dave Love <fx@gnu.org>
 ;; Created: 1998-09-04
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index 9bb485f..0392903 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -1,6 +1,6 @@
 ;;; autoinsert.el --- automatic mode-dependent insertion of text into new 
files  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1987, 1994-1995, 1998, 2000-2020 Free Software
+;; Copyright (C) 1985-1987, 1994-1995, 1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Charlie Martin <crm@cs.duke.edu>
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index d5bb75c..1b2d689 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -1,6 +1,6 @@
 ;;; autorevert.el --- revert buffers when files on disk change  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1997-1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Anders Lindgren
 ;; Keywords: convenience
diff --git a/lisp/avoid.el b/lisp/avoid.el
index e94d508..b53584b 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -1,6 +1,6 @@
 ;;; avoid.el --- make mouse pointer stay out of the way of editing
 
-;; Copyright (C) 1993-1994, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Boris Goldowsky <boris@gnu.org>
 ;; Keywords: mouse
diff --git a/lisp/battery.el b/lisp/battery.el
index e568ab5..77ad73d 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -1,6 +1,6 @@
 ;;; battery.el --- display battery status information  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1997-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Ralph Schleicher <rs@ralph-schleicher.de>
 ;; Maintainer: emacs-devel@gnu.org
@@ -661,10 +661,12 @@ Intended as a UPower PropertiesChanged signal handler."
   (cond ((stringp battery-upower-device)
          (list battery-upower-device))
         (battery-upower-device)
-        ((dbus-call-method :system battery-upower-service
-                           battery-upower-path
-                           battery-upower-interface
-                           "EnumerateDevices"))))
+        ((dbus-ignore-errors
+           (dbus-call-method :system battery-upower-service
+                             battery-upower-path
+                             battery-upower-interface
+                             "EnumerateDevices"
+                             :timeout 1000)))))
 
 (defun battery--upower-state (props state)
   "Merge the UPower battery state in PROPS with STATE.
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 250234e..b68d55e 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -1,6 +1,6 @@
 ;;; bindings.el --- define standard key bindings and some variables
 
-;; Copyright (C) 1985-1987, 1992-1996, 1999-2020 Free Software
+;; Copyright (C) 1985-1987, 1992-1996, 1999-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index b9bdbe8..c857c9b 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1,6 +1,6 @@
 ;;; bookmark.el --- set bookmarks, maybe annotate them, jump to them later -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1993-1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Karl Fogel <kfogel@red-bean.com>
 ;; Created: July, 1993
@@ -26,7 +26,8 @@
 ;; This package is for setting "bookmarks" in files.  A bookmark
 ;; associates a string with a location in a certain file.  Thus, you
 ;; can navigate your way to that location by providing the string.
-;; See the "User Variables" section for customizations.
+;;
+;; Type `M-x customize-group RET boomark RET' for user options.
 
 
 ;;; Code:
diff --git a/lisp/bs.el b/lisp/bs.el
index 337d22e..9ed0ee5 100644
--- a/lisp/bs.el
+++ b/lisp/bs.el
@@ -1,6 +1,6 @@
 ;;; bs.el --- menu for selecting and displaying buffers -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 ;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: convenience
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index d06ba28..49f8604 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -1,6 +1,6 @@
 ;;; buff-menu.el --- Interface for viewing and manipulating buffers -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1985-1987, 1993-1995, 2000-2020 Free Software
+;; Copyright (C) 1985-1987, 1993-1995, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -269,8 +269,8 @@ In Buffer Menu mode, the following commands are defined:
 \\[revert-buffer]    Update the list of buffers.
 \\[Buffer-menu-toggle-files-only]    Toggle whether the menu displays only 
file buffers.
 \\[Buffer-menu-bury]    Bury the buffer listed on this line."
-  (set (make-local-variable 'buffer-stale-function)
-       (lambda (&optional _noconfirm) 'fast))
+  (setq-local buffer-stale-function
+              (lambda (&optional _noconfirm) 'fast))
   (add-hook 'tabulated-list-revert-hook 'list-buffers--refresh nil t))
 
 (defun buffer-menu (&optional arg)
diff --git a/lisp/button.el b/lisp/button.el
index ba06823..043de8e 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -1,6 +1,6 @@
 ;;; button.el --- clickable buttons -*- lexical-binding: t -*-
 ;;
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Miles Bader <miles@gnu.org>
 ;; Keywords: extensions, hypermedia
@@ -613,6 +613,20 @@ button at point is the button to describe."
       (button--describe props)
       t)))
 
+(defun button-buttonize (string callback &optional data)
+  "Make STRING into a button and return it.
+When clicked, CALLBACK will be called with the DATA as the
+function argument.  If DATA isn't present (or is nil), the button
+itself will be used instead as the function argument."
+  (propertize string
+              'face 'button
+              'button t
+              'follow-link t
+              'category t
+              'button-data data
+              'keymap button-map
+              'action callback))
+
 (provide 'button)
 
 ;;; button.el ends here
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el
index 338f0ea..1e31c3c 100644
--- a/lisp/calc/calc-aent.el
+++ b/lisp/calc/calc-aent.el
@@ -1,6 +1,6 @@
 ;;; calc-aent.el --- algebraic entry functions for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el
index 53ca01d..1327cf0 100644
--- a/lisp/calc/calc-alg.el
+++ b/lisp/calc/calc-alg.el
@@ -1,6 +1,6 @@
 ;;; calc-alg.el --- algebraic functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-arith.el b/lisp/calc/calc-arith.el
index c11cecf..9787fe0 100644
--- a/lisp/calc/calc-arith.el
+++ b/lisp/calc/calc-arith.el
@@ -1,6 +1,6 @@
 ;;; calc-arith.el --- arithmetic functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el
index e3b1013..503ed77 100644
--- a/lisp/calc/calc-bin.el
+++ b/lisp/calc/calc-bin.el
@@ -1,6 +1,6 @@
 ;;; calc-bin.el --- binary functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
@@ -199,48 +199,16 @@
      (message "Omitting leading zeros on integers"))))
 
 
-(defvar math-power-of-2-cache (list 1 2 4 8 16 32 64 128 256 512 1024))
-(defvar math-big-power-of-2-cache nil)
 (defun math-power-of-2 (n)    ;  [I I] [Public]
-  (if (and (natnump n) (<= n 100))
-      (or (nth n math-power-of-2-cache)
-         (let* ((i (length math-power-of-2-cache))
-                (val (nth (1- i) math-power-of-2-cache)))
-           (while (<= i n)
-             (setq val (math-mul val 2)
-                   math-power-of-2-cache (nconc math-power-of-2-cache
-                                                (list val))
-                   i (1+ i)))
-           val))
-    (let ((found (assq n math-big-power-of-2-cache)))
-      (if found
-         (cdr found)
-       (let ((po2 (math-ipow 2 n)))
-         (setq math-big-power-of-2-cache
-               (cons (cons n po2) math-big-power-of-2-cache))
-         po2)))))
+  (if (natnump n)
+      (ash 1 n)
+    (error "argument must be a natural number")))
 
 (defun math-integer-log2 (n)    ; [I I] [Public]
-  (let ((i 0)
-       (p math-power-of-2-cache)
-       val)
-    (while (and p (< (setq val (car p)) n))
-      (setq p (cdr p)
-           i (1+ i)))
-    (if p
-       (and (equal val n)
-            i)
-      (while (<
-             (prog1
-                 (setq val (math-mul val 2))
-               (setq math-power-of-2-cache (nconc math-power-of-2-cache
-                                                  (list val))))
-             n)
-       (setq i (1+ i)))
-      (and (equal val n)
-          i))))
-
-
+  (and (natnump n)
+       (not (zerop n))
+       (zerop (logand n (1- n)))
+       (logb n)))
 
 
 ;;; Bitwise operations.
@@ -404,7 +372,7 @@
          (math-clip (calcFunc-ash a n (- w)) w)
        (if (Math-integer-negp a)
            (setq a (math-clip a w)))
-       (let ((two-to-sizem1 (math-power-of-2 (1- w)))
+       (let ((two-to-sizem1 (and (not (zerop w)) (math-power-of-2 (1- w))))
              (sh (calcFunc-lsh a n w)))
          (cond ((or (zerop w)
                      (zerop (logand a two-to-sizem1)))
diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el
index 0f6c40a..dc95221 100644
--- a/lisp/calc/calc-comb.el
+++ b/lisp/calc/calc-comb.el
@@ -1,6 +1,6 @@
 ;;; calc-comb.el --- combinatoric functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-cplx.el b/lisp/calc/calc-cplx.el
index 7438f63..0346202 100644
--- a/lisp/calc/calc-cplx.el
+++ b/lisp/calc/calc-cplx.el
@@ -1,6 +1,6 @@
 ;;; calc-cplx.el --- Complex number functions for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index f9c5281..a113572 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -1,6 +1,6 @@
 ;;; calc-embed.el --- embed Calc in a buffer  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 7984c8b..7c319c4 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -1,6 +1,6 @@
 ;;; calc-ext.el --- various extension functions for Calc  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-fin.el b/lisp/calc/calc-fin.el
index ea1ef24..76bb53e7 100644
--- a/lisp/calc/calc-fin.el
+++ b/lisp/calc/calc-fin.el
@@ -1,6 +1,6 @@
 ;;; calc-fin.el --- financial functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el
index 39116bf..ee53b94 100644
--- a/lisp/calc/calc-forms.el
+++ b/lisp/calc/calc-forms.el
@@ -1,6 +1,6 @@
 ;;; calc-forms.el --- data format conversion functions for Calc  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-frac.el b/lisp/calc/calc-frac.el
index 1d6895c..bf3c168 100644
--- a/lisp/calc/calc-frac.el
+++ b/lisp/calc/calc-frac.el
@@ -1,6 +1,6 @@
 ;;; calc-frac.el --- fraction functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-funcs.el b/lisp/calc/calc-funcs.el
index fd544f9..053fa2e 100644
--- a/lisp/calc/calc-funcs.el
+++ b/lisp/calc/calc-funcs.el
@@ -1,6 +1,6 @@
 ;;; calc-funcs.el --- well-known functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el
index 829fa44..4785fb7 100644
--- a/lisp/calc/calc-graph.el
+++ b/lisp/calc/calc-graph.el
@@ -1,6 +1,6 @@
 ;;; calc-graph.el --- graph output functions for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
@@ -351,7 +351,7 @@
         (if (>= ver 3)
             (insert "set surface\nset nocontour\n"
                     "set " (if calc-graph-is-splot "" "no") "parametric\n"
-                    "set notime\nset border\nset ztics\nset zeroaxis\n"
+                    "set notimestamp\nset border\nset ztics\nset zeroaxis\n"
                     "set view 60,30,1,1\nset offsets 0,0,0,0\n"))
         (setq samples-pos (point))
         (insert "\n\n" str))
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index 06b4b96..dd5063f 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -1,6 +1,6 @@
 ;;; calc-help.el --- help display functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-incom.el b/lisp/calc/calc-incom.el
index 2c7a4f0..e27d650 100644
--- a/lisp/calc/calc-incom.el
+++ b/lisp/calc/calc-incom.el
@@ -1,6 +1,6 @@
 ;;; calc-incom.el --- complex data type input functions for Calc  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-keypd.el b/lisp/calc/calc-keypd.el
index 47917dc..1902a4f 100644
--- a/lisp/calc/calc-keypd.el
+++ b/lisp/calc/calc-keypd.el
@@ -1,6 +1,6 @@
 ;;; calc-keypd.el --- mouse-capable keypad input for Calc  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el
index 2830694..b4b2d4c 100644
--- a/lisp/calc/calc-lang.el
+++ b/lisp/calc/calc-lang.el
@@ -1,6 +1,6 @@
 ;;; calc-lang.el --- calc language functions  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-macs.el b/lisp/calc/calc-macs.el
index a15095e..63258cd 100644
--- a/lisp/calc/calc-macs.el
+++ b/lisp/calc/calc-macs.el
@@ -1,6 +1,6 @@
 ;;; calc-macs.el --- important macros for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-map.el b/lisp/calc/calc-map.el
index 3e2869d..16a2bd8 100644
--- a/lisp/calc/calc-map.el
+++ b/lisp/calc/calc-map.el
@@ -1,6 +1,6 @@
 ;;; calc-map.el --- higher-order functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index 1d0d94e..1c2e7bc 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -1,6 +1,6 @@
 ;;; calc-math.el --- mathematical functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-menu.el b/lisp/calc/calc-menu.el
index d593edd..16cca05 100644
--- a/lisp/calc/calc-menu.el
+++ b/lisp/calc/calc-menu.el
@@ -1,6 +1,6 @@
 ;;; calc-menu.el --- a menu for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el
index ada754a..b573c53f 100644
--- a/lisp/calc/calc-misc.el
+++ b/lisp/calc/calc-misc.el
@@ -1,6 +1,6 @@
 ;;; calc-misc.el --- miscellaneous functions for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el
index 358854b..68c8b90 100644
--- a/lisp/calc/calc-mode.el
+++ b/lisp/calc/calc-mode.el
@@ -1,6 +1,6 @@
 ;;; calc-mode.el --- calculator modes for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-mtx.el b/lisp/calc/calc-mtx.el
index bfcd61d..9a08b8c 100644
--- a/lisp/calc/calc-mtx.el
+++ b/lisp/calc/calc-mtx.el
@@ -1,6 +1,6 @@
 ;;; calc-mtx.el --- matrix functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-nlfit.el b/lisp/calc/calc-nlfit.el
index 5ed85fe..11867f1 100644
--- a/lisp/calc/calc-nlfit.el
+++ b/lisp/calc/calc-nlfit.el
@@ -1,6 +1,6 @@
 ;;; calc-nlfit.el --- nonlinear curve fitting for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/calc/calc-poly.el b/lisp/calc/calc-poly.el
index 5928a8e..77587cc 100644
--- a/lisp/calc/calc-poly.el
+++ b/lisp/calc/calc-poly.el
@@ -1,6 +1,6 @@
 ;;; calc-poly.el --- polynomial functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el
index 781ba5c..6ac554e 100644
--- a/lisp/calc/calc-prog.el
+++ b/lisp/calc/calc-prog.el
@@ -1,6 +1,6 @@
 ;;; calc-prog.el --- user programmability functions for Calc  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-rewr.el b/lisp/calc/calc-rewr.el
index 1528e12..e3d4852 100644
--- a/lisp/calc/calc-rewr.el
+++ b/lisp/calc/calc-rewr.el
@@ -1,6 +1,6 @@
 ;;; calc-rewr.el --- rewriting functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-rules.el b/lisp/calc/calc-rules.el
index fe0e8a1..00080b6 100644
--- a/lisp/calc/calc-rules.el
+++ b/lisp/calc/calc-rules.el
@@ -1,6 +1,6 @@
 ;;; calc-rules.el --- rules for simplifying algebraic expressions in Calc  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-sel.el b/lisp/calc/calc-sel.el
index 23c0e01..e6c6337 100644
--- a/lisp/calc/calc-sel.el
+++ b/lisp/calc/calc-sel.el
@@ -1,6 +1,6 @@
 ;;; calc-sel.el --- data selection functions for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-stat.el b/lisp/calc/calc-stat.el
index 196f743..3cf9bec 100644
--- a/lisp/calc/calc-stat.el
+++ b/lisp/calc/calc-stat.el
@@ -1,6 +1,6 @@
 ;;; calc-stat.el --- statistical functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el
index 8f83f34..a5e9012 100644
--- a/lisp/calc/calc-store.el
+++ b/lisp/calc/calc-store.el
@@ -1,6 +1,6 @@
 ;;; calc-store.el --- value storage functions for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-stuff.el b/lisp/calc/calc-stuff.el
index 8df2ed9..9281666 100644
--- a/lisp/calc/calc-stuff.el
+++ b/lisp/calc/calc-stuff.el
@@ -1,6 +1,6 @@
 ;;; calc-stuff.el --- miscellaneous functions for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-trail.el b/lisp/calc/calc-trail.el
index de7205e..2cf5160 100644
--- a/lisp/calc/calc-trail.el
+++ b/lisp/calc/calc-trail.el
@@ -1,6 +1,6 @@
 ;;; calc-trail.el --- functions for manipulating the Calc "trail"  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-undo.el b/lisp/calc/calc-undo.el
index 47971e8..4add99a 100644
--- a/lisp/calc/calc-undo.el
+++ b/lisp/calc/calc-undo.el
@@ -1,6 +1,6 @@
 ;;; calc-undo.el --- undo functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 742b2bb..c3adc3d 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -1,6 +1,6 @@
 ;;; calc-units.el --- unit conversion functions for Calc  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
@@ -2157,7 +2157,7 @@ If non-nil, return a list consisting of the note and the 
cents coefficient."
    (calc-unary-op "midi" 'calcFunc-midi arg)))
 
 (defun calc-spn (arg)
-  "Return the scientific pitch notation corresponding to the expression on the 
stack."
+  "Return scientific pitch notation corresponding to the expression on the 
stack."
   (interactive "P")
   (calc-slow-wrapper
    (calc-unary-op "spn" 'calcFunc-spn arg)))
diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el
index 036f08e..73783dd 100644
--- a/lisp/calc/calc-vec.el
+++ b/lisp/calc/calc-vec.el
@@ -1,6 +1,6 @@
 ;;; calc-vec.el --- vector functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el
index 6186df7..8267340 100644
--- a/lisp/calc/calc-yank.el
+++ b/lisp/calc/calc-yank.el
@@ -1,6 +1,6 @@
 ;;; calc-yank.el --- kill-ring functionality for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 9d869f3..68ae468 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -1,6 +1,6 @@
 ;;; calc.el --- the GNU Emacs calculator  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Keywords: convenience, extensions
@@ -266,18 +266,18 @@
     (sgml-mode    . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
     (xml-mode     . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
     (texinfo-mode . "@c Embed\n\\(@c .*\n\\)*"))
-  "Alist of major modes with appropriate values for 
`calc-embedded-announce-formula'."
+  "Alist of major modes for `calc-embedded-announce-formula'."
   :type '(alist :key-type (symbol :tag "Major mode")
                 :value-type (regexp :tag "Regexp to announce formula")))
 
 (defcustom calc-embedded-open-formula
   
"\\`\\|^\n\\|\\$\\$?\\|\\\\\\[\\|^\\\\begin[^{].*\n\\|^\\\\begin{.*[^x]}.*\n\\|^@.*\n\\|^\\.EQ.*\n\\|\\\\(\\|^%\n\\|^\\.\\\\\"\n"
-  "A regular expression for the opening delimiter of a formula used by 
calc-embedded."
+  "Regexp for the opening delimiter of a formula used by `calc-embedded'."
   :type '(regexp))
 
 (defcustom calc-embedded-close-formula
   
"\\'\\|\n$\\|\\$\\$?\\|\\\\]\\|^\\\\end[^{].*\n\\|^\\\\end{.*[^x]}.*\n\\|^@.*\n\\|^\\.EN.*\n\\|\\\\)\\|\n%\n\\|^\\.\\\\\"\n"
-  "A regular expression for the closing delimiter of a formula used by 
calc-embedded."
+  "Regexp for the closing delimiter of a formula used by calc-embedded."
   :type '(regexp))
 
 (defcustom calc-embedded-open-close-formula-alist
@@ -721,7 +721,8 @@ If nil, computations on numbers always yield numbers where 
possible.")
 (defcalcmodevar calc-matrix-mode nil
   "If `matrix', variables are assumed to be matrix-valued.
 If a number, variables are assumed to be NxN matrices.
-If `sqmatrix', variables are assumed to be square matrices of an unspecified 
size.
+If `sqmatrix', variables are assumed to be square matrices of an
+  unspecified size.
 If `scalar', variables are assumed to be scalar-valued.
 If nil, symbolic math routines make no assumptions about variables.")
 
@@ -2100,7 +2101,7 @@ the United States."
           (set-buffer calc-trail-buffer)
           (unless (derived-mode-p 'calc-trail-mode)
              (calc-trail-mode)
-             (set (make-local-variable 'calc-main-buffer) buf)))))
+             (setq-local calc-main-buffer buf)))))
   (or (and calc-trail-pointer
           (eq (marker-buffer calc-trail-pointer) calc-trail-buffer))
       (with-current-buffer calc-trail-buffer
diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el
index bf4d626..fc6eb74 100644
--- a/lisp/calc/calcalg2.el
+++ b/lisp/calc/calcalg2.el
@@ -1,6 +1,6 @@
 ;;; calcalg2.el --- more algebraic functions for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el
index fdcde95..ee3ae0a 100644
--- a/lisp/calc/calcalg3.el
+++ b/lisp/calc/calcalg3.el
@@ -1,6 +1,6 @@
 ;;; calcalg3.el --- more algebraic functions for Calc  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el
index 0631eb4..07e70ca 100644
--- a/lisp/calc/calccomp.el
+++ b/lisp/calc/calccomp.el
@@ -1,6 +1,6 @@
 ;;; calccomp.el --- composition functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calc/calcsel2.el b/lisp/calc/calcsel2.el
index d6842aa..9c2ac97 100644
--- a/lisp/calc/calcsel2.el
+++ b/lisp/calc/calcsel2.el
@@ -1,6 +1,6 @@
 ;;; calcsel2.el --- selection functions for Calc  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 
diff --git a/lisp/calculator.el b/lisp/calculator.el
index cd92f99..b4c0075 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -1,6 +1,6 @@
 ;;; calculator.el --- a calculator for Emacs  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Eli Barzilay <eli@barzilay.org>
 ;; Keywords: tools, convenience
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index d7bcbb0..29bcd6d 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -1,6 +1,6 @@
 ;;; appt.el --- appointment notification functions  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1989-1990, 1994, 1998, 2001-2020 Free Software
+;; Copyright (C) 1989-1990, 1994, 1998, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Neil Mager <neilm@juliet.ll.mit.edu>
diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el
index 4bfdf3a..22e4cdb 100644
--- a/lisp/calendar/cal-bahai.el
+++ b/lisp/calendar/cal-bahai.el
@@ -1,6 +1,6 @@
 ;;; cal-bahai.el --- calendar functions for the Bahá’í calendar.
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Keywords: calendar
diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el
index 664d05e..7e5d0c4 100644
--- a/lisp/calendar/cal-china.el
+++ b/lisp/calendar/cal-china.el
@@ -1,6 +1,6 @@
 ;;; cal-china.el --- calendar functions for the Chinese calendar
 
-;; Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/calendar/cal-coptic.el b/lisp/calendar/cal-coptic.el
index 9bd9b1d..3461f32 100644
--- a/lisp/calendar/cal-coptic.el
+++ b/lisp/calendar/cal-coptic.el
@@ -1,6 +1,6 @@
 ;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars
 
-;; Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/calendar/cal-dst.el b/lisp/calendar/cal-dst.el
index 05768e1..9e6c295 100644
--- a/lisp/calendar/cal-dst.el
+++ b/lisp/calendar/cal-dst.el
@@ -1,6 +1,6 @@
 ;;; cal-dst.el --- calendar functions for daylight saving rules  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1993-1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Paul Eggert <eggert@cs.ucla.edu>
 ;;         Edward M. Reingold <reingold@cs.uiuc.edu>
diff --git a/lisp/calendar/cal-french.el b/lisp/calendar/cal-french.el
index 4758a95..e759b5d 100644
--- a/lisp/calendar/cal-french.el
+++ b/lisp/calendar/cal-french.el
@@ -1,6 +1,6 @@
 ;;; cal-french.el --- calendar functions for the French Revolutionary calendar
 
-;; Copyright (C) 1988-1989, 1992, 1994-1995, 1997, 2001-2020 Free
+;; Copyright (C) 1988-1989, 1992, 1994-1995, 1997, 2001-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index b8fbf65..bcc80f0 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -1,6 +1,6 @@
 ;;; cal-hebrew.el --- calendar functions for the Hebrew calendar
 
-;; Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu>
 ;;         Edward M. Reingold <reingold@cs.uiuc.edu>
diff --git a/lisp/calendar/cal-html.el b/lisp/calendar/cal-html.el
index a857cd7..3d7cc93 100644
--- a/lisp/calendar/cal-html.el
+++ b/lisp/calendar/cal-html.el
@@ -1,6 +1,6 @@
 ;;; cal-html.el --- functions for printing HTML calendars
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Anna M. Bigatti <bigatti@dima.unige.it>
 ;; Keywords: calendar
diff --git a/lisp/calendar/cal-islam.el b/lisp/calendar/cal-islam.el
index f1c76fa..d256310 100644
--- a/lisp/calendar/cal-islam.el
+++ b/lisp/calendar/cal-islam.el
@@ -1,6 +1,6 @@
 ;;; cal-islam.el --- calendar functions for the Islamic calendar
 
-;; Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/calendar/cal-iso.el b/lisp/calendar/cal-iso.el
index 4b4fee2..956433e 100644
--- a/lisp/calendar/cal-iso.el
+++ b/lisp/calendar/cal-iso.el
@@ -1,6 +1,6 @@
 ;;; cal-iso.el --- calendar functions for the ISO calendar
 
-;; Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/calendar/cal-julian.el b/lisp/calendar/cal-julian.el
index 918995d..235b4d0 100644
--- a/lisp/calendar/cal-julian.el
+++ b/lisp/calendar/cal-julian.el
@@ -1,6 +1,6 @@
 ;;; cal-julian.el --- calendar functions for the Julian calendar  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1995, 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/calendar/cal-mayan.el b/lisp/calendar/cal-mayan.el
index 721f760..8d894eb 100644
--- a/lisp/calendar/cal-mayan.el
+++ b/lisp/calendar/cal-mayan.el
@@ -1,6 +1,6 @@
 ;;; cal-mayan.el --- calendar functions for the Mayan calendars
 
-;; Copyright (C) 1992-1993, 1995, 1997, 2001-2020 Free Software
+;; Copyright (C) 1992-1993, 1995, 1997, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Stewart M. Clamen <clamen@cs.cmu.edu>
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index f4d46e6..a30c681 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -1,6 +1,6 @@
 ;;; cal-menu.el --- calendar functions for menu bar and popup menu support
 
-;; Copyright (C) 1994-1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;;         Lara Rios <lrios@coewl.cen.uiuc.edu>
diff --git a/lisp/calendar/cal-move.el b/lisp/calendar/cal-move.el
index 6345a02..710ce37 100644
--- a/lisp/calendar/cal-move.el
+++ b/lisp/calendar/cal-move.el
@@ -1,6 +1,6 @@
 ;;; cal-move.el --- calendar functions for movement in the calendar
 
-;; Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/calendar/cal-persia.el b/lisp/calendar/cal-persia.el
index 9d1432f..a9c99fe 100644
--- a/lisp/calendar/cal-persia.el
+++ b/lisp/calendar/cal-persia.el
@@ -1,6 +1,6 @@
 ;;; cal-persia.el --- calendar functions for the Persian calendar
 
-;; Copyright (C) 1996-1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index ded0657..9df9f4c 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -1,6 +1,6 @@
 ;;; cal-tex.el --- calendar functions for printing calendars with LaTeX
 
-;; Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Steve Fisk <fisk@bowdoin.edu>
 ;;         Edward M. Reingold <reingold@cs.uiuc.edu>
diff --git a/lisp/calendar/cal-x.el b/lisp/calendar/cal-x.el
index 8cefd4f..1c19a60 100644
--- a/lisp/calendar/cal-x.el
+++ b/lisp/calendar/cal-x.el
@@ -1,6 +1,6 @@
 ;;; cal-x.el --- calendar windows in dedicated frames
 
-;; Copyright (C) 1994-1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;;         Edward M. Reingold <reingold@cs.uiuc.edu>
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index de9b1f3..21cea21 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1,6 +1,6 @@
 ;;; calendar.el --- calendar functions  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1988-1995, 1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1988-1995, 1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
@@ -1788,7 +1788,7 @@ For a complete description, see the info node 
`Calendar/Diary'.
   (setq buffer-read-only t
         buffer-undo-list t
         indent-tabs-mode nil)
-  (set (make-local-variable 'scroll-margin) 0) ; bug#10379
+  (setq-local scroll-margin 0) ; bug#10379
   (calendar-update-mode-line)
   (make-local-variable 'calendar-mark-ring)
   (make-local-variable 'displayed-month) ; month in middle of window
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index fbc13f5..aad7016 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -1,6 +1,6 @@
 ;;; diary-lib.el --- diary functions  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1989-1990, 1992-1995, 2001-2020 Free Software
+;; Copyright (C) 1989-1990, 1992-1995, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
@@ -73,18 +73,18 @@ are holidays."
 ;; follows: the first line matching "^# [tag:value]" defines the value
 ;; for that particular tag.
 (defcustom diary-face-attrs
-  '((" *\\[foreground:\\([-a-z]+\\)\\]$" 1 :foreground string)
-    (" *\\[background:\\([-a-z]+\\)\\]$" 1 :background string)
-    (" *\\[width:\\([-a-z]+\\)\\]$" 1 :width symbol)
-    (" *\\[height:\\([.0-9]+\\)\\]$" 1 :height int)
-    (" *\\[weight:\\([-a-z]+\\)\\]$" 1 :weight symbol)
-    (" *\\[slant:\\([-a-z]+\\)\\]$" 1 :slant symbol)
-    (" *\\[underline:\\([-a-z]+\\)\\]$" 1 :underline stringtnil)
-    (" *\\[overline:\\([-a-z]+\\)\\]$" 1 :overline stringtnil)
-    (" *\\[strike-through:\\([-a-z]+\\)\\]$" 1 :strike-through stringtnil)
-    (" *\\[inverse-video:\\([-a-z]+\\)\\]$" 1 :inverse-video tnil)
-    (" *\\[face:\\([-0-9a-z]+\\)\\]$" 1 :face string)
-    (" *\\[font:\\([-a-z0-9]+\\)\\]$" 1 :font string)
+  '((" *\\[foreground:\\([-a-z]+\\)\\] *" 1 :foreground string)
+    (" *\\[background:\\([-a-z]+\\)\\] *" 1 :background string)
+    (" *\\[width:\\([-a-z]+\\)\\] *" 1 :width symbol)
+    (" *\\[height:\\([.0-9]+\\)\\] *" 1 :height int)
+    (" *\\[weight:\\([-a-z]+\\)\\] *" 1 :weight symbol)
+    (" *\\[slant:\\([-a-z]+\\)\\] *" 1 :slant symbol)
+    (" *\\[underline:\\([-a-z]+\\)\\] *" 1 :underline stringtnil)
+    (" *\\[overline:\\([-a-z]+\\)\\] *" 1 :overline stringtnil)
+    (" *\\[strike-through:\\([-a-z]+\\)\\] *" 1 :strike-through stringtnil)
+    (" *\\[inverse-video:\\([-a-z]+\\)\\] *" 1 :inverse-video tnil)
+    (" *\\[face:\\([-0-9a-z]+\\)\\] *" 1 :face string)
+    (" *\\[font:\\([-a-z0-9]+\\)\\] *" 1 :font string)
     ;; Unsupported.
 ;;;    (" *\\[box:\\([-a-z]+\\)\\]$" 1 :box)
 ;;;    (" *\\[stipple:\\([-a-z]+\\)\\]$" 1 :stipple)
@@ -839,7 +839,7 @@ LIST-ONLY is non-nil, in which case it just returns the 
list."
                     (goto-char (point-min))
                     (unless list-only
                       (let ((ol (make-overlay (point-min) (point-max) nil t 
nil)))
-                        (set (make-local-variable 'diary-selective-display) t)
+                        (setq-local diary-selective-display t)
                         (overlay-put ol 'invisible 'diary)
                         (overlay-put ol 'evaporate t)))
                     (dotimes (_ number)
@@ -2381,10 +2381,9 @@ return a font-lock pattern matching array of MONTHS and 
marking SYMBOL."
 ;;;###autoload
 (define-derived-mode diary-mode fundamental-mode "Diary"
   "Major mode for editing the diary file."
-  (set (make-local-variable 'font-lock-defaults)
-       '(diary-font-lock-keywords t))
-  (set (make-local-variable 'comment-start) diary-comment-start)
-  (set (make-local-variable 'comment-end) diary-comment-end)
+  (setq-local font-lock-defaults '(diary-font-lock-keywords t))
+  (setq-local comment-start diary-comment-start)
+  (setq-local comment-end diary-comment-end)
   (add-to-invisibility-spec '(diary . nil))
   (add-hook 'after-save-hook #'diary-redraw-calendar nil t)
   ;; In case the file was modified externally, refresh the calendar
@@ -2465,13 +2464,13 @@ Fontify the region between BEG and END, quietly unless 
VERBOSE is non-nil."
 (define-derived-mode diary-fancy-display-mode special-mode
   "Diary"
   "Major mode used while displaying diary entries using Fancy Display."
-  (set (make-local-variable 'font-lock-defaults)
-       '(diary-fancy-font-lock-keywords
-         t nil nil nil
-         (font-lock-fontify-region-function
-          . diary-fancy-font-lock-fontify-region-function)))
-  (set (make-local-variable 'minor-mode-overriding-map-alist)
-       (list (cons t diary-fancy-overriding-map)))
+  (setq-local font-lock-defaults
+              '(diary-fancy-font-lock-keywords
+                t nil nil nil
+                (font-lock-fontify-region-function
+                 . diary-fancy-font-lock-fontify-region-function)))
+  (setq-local minor-mode-overriding-map-alist
+              (list (cons t diary-fancy-overriding-map)))
   (view-mode 1))
 
 ;; Following code from Dave Love <fx@gnu.org>.
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el
index 444a0e5..932993b 100644
--- a/lisp/calendar/holidays.el
+++ b/lisp/calendar/holidays.el
@@ -1,6 +1,6 @@
 ;;; holidays.el --- holiday functions for the calendar package  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1989-1990, 1992-1994, 1997, 2001-2020 Free Software
+;; Copyright (C) 1989-1990, 1992-1994, 1997, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index dab2774..1d7de4a 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -1,6 +1,6 @@
 ;;; icalendar.el --- iCalendar implementation -*- lexical-binding: t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author:         Ulf Jasper <ulf.jasper@web.de>
 ;; Created:        August 2002
diff --git a/lisp/calendar/iso8601.el b/lisp/calendar/iso8601.el
index 906c29b..5a109a7 100644
--- a/lisp/calendar/iso8601.el
+++ b/lisp/calendar/iso8601.el
@@ -1,6 +1,6 @@
 ;;; iso8601.el --- parse ISO 8601 date/time strings  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Keywords: dates
 
diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el
index 1c0f4da..dd1d923 100644
--- a/lisp/calendar/lunar.el
+++ b/lisp/calendar/lunar.el
@@ -1,6 +1,6 @@
 ;;; lunar.el --- calendar functions for phases of the moon  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1992-1993, 1995, 1997, 2001-2020 Free Software
+;; Copyright (C) 1992-1993, 1995, 1997, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el
index b199fca..ba7418f 100644
--- a/lisp/calendar/parse-time.el
+++ b/lisp/calendar/parse-time.el
@@ -1,6 +1,6 @@
 ;;; parse-time.el --- parsing time strings -*- lexical-binding: t -*-
 
-;; Copyright (C) 1996, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Erik Naggum <erik@naggum.no>
 ;; Keywords: util
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el
index 07562f6..372490d 100644
--- a/lisp/calendar/solar.el
+++ b/lisp/calendar/solar.el
@@ -1,6 +1,6 @@
 ;;; solar.el --- calendar functions for solar events  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1992-1993, 1995, 1997, 2001-2020 Free Software
+;; Copyright (C) 1992-1993, 1995, 1997, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index cf6c20a..2df57a3 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -1,6 +1,6 @@
 ;;; time-date.el --- Date and time handling functions  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     Masanobu Umeda <umerin@mse.kyutech.ac.jp>
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index 48028dd..0bbaa1e 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -1,6 +1,6 @@
 ;;; timeclock.el --- mode for keeping track of how much you work  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Created: 25 Mar 1999
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 3975a9b..0daa153 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -1,6 +1,6 @@
 ;;; todo-mode.el --- facilities for making and maintaining todo lists  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1997, 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Oliver Seidel <privat@os10000.net>
 ;;     Stephen Berman <stephen.berman@gmx.net>
@@ -2745,9 +2745,10 @@ section in the category moved to."
                (setq ov (make-overlay (save-excursion (todo-item-start))
                                       (save-excursion (todo-item-end))))
                (overlay-put ov 'face 'todo-search))
-             (let* ((pl (if (and marked (> (cdr marked) 1)) "s" ""))
-                    (cat+file (todo-read-category (concat "Move item" pl
-                                                           " to category: ")
+             (let* ((num (if (not marked) 1 (cdr marked)))
+                    (cat+file (todo-read-category
+                                (ngettext "Move item to category: "
+                                          "Move items to category: " num)
                                                    nil file)))
                (while (and (equal (car cat+file) cat1)
                            (equal (cdr cat+file) file1))
@@ -2974,7 +2975,7 @@ comments without asking."
   (interactive)
   (let* ((cat (todo-current-category))
         (marked (assoc cat todo-categories-with-marks))
-        (pl (if (and marked (> (cdr marked) 1)) "s" "")))
+        (num (if (not marked) 1 (cdr marked))))
     (when (or marked (todo-done-item-p))
       (let ((buffer-read-only)
            (opoint (point))
@@ -2982,6 +2983,9 @@ comments without asking."
            (first 'first)
            (item-count 0)
            (diary-count 0)
+            (omit-prompt (ngettext "Omit comment from restored item? "
+                                   "Omit comments from restored items? "
+                           num))
            start end item ov npoint undone)
        (and marked (goto-char (point-min)))
        (catch 'done
@@ -3013,10 +3017,7 @@ comments without asking."
                      (if (eq first 'first)
                          (setq first
                                (if (eq todo-undo-item-omit-comment 'ask)
-                                   (when (todo-y-or-n-p
-                                          (concat "Omit comment" pl
-                                                  " from restored item"
-                                                  pl "? "))
+                                   (when (todo-y-or-n-p omit-prompt)
                                      'omit)
                                  (when todo-undo-item-omit-comment 'omit)))
                        t)
@@ -5782,11 +5783,13 @@ have been removed."
              (delete f todo-category-completions-files))
        (push f deleted)))
     (when deleted
-      (let ((pl (> (length deleted) 1))
+      (let ((ndeleted (length deleted))
            (names (mapconcat (lambda (f) (concat "\"" f "\"")) deleted ", ")))
-       (message (concat "File" (if pl "s" "") " %s ha" (if pl "ve" "s")
-                        " been deleted and removed from\n"
-                        "the list of category completion files")
+       (message (concat
+                  (ngettext "File %s has been deleted and removed from\n"
+                            "Files %s have been deleted and removed from\n"
+                            ndeleted)
+                 "the list of category completion files")
                 names))
       (put 'todo-category-completions-files 'custom-type
            `(set ,@(todo--files-type-list)))
diff --git a/lisp/case-table.el b/lisp/case-table.el
index bdfe5c2..457e026 100644
--- a/lisp/case-table.el
+++ b/lisp/case-table.el
@@ -1,6 +1,6 @@
 ;;; case-table.el --- code to extend the character set and support case tables 
 -*- lexical-binding: t -*-
 
-;; Copyright (C) 1988, 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Howard Gayle
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/cdl.el b/lisp/cdl.el
index c8025a9..0f181ac 100644
--- a/lisp/cdl.el
+++ b/lisp/cdl.el
@@ -1,6 +1,6 @@
 ;;; cdl.el --- Common Data Language (CDL) utility functions for GNU Emacs -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Ata Etemadi <ATAE@spva.physics.imperial.ac.uk>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/cedet/ChangeLog.1 b/lisp/cedet/ChangeLog.1
index a1c0e41..fb3dcd2 100644
--- a/lisp/cedet/ChangeLog.1
+++ b/lisp/cedet/ChangeLog.1
@@ -3460,7 +3460,7 @@
 ;; coding: utf-8
 ;; End:
 
-       Copyright (C) 2009-2020 Free Software Foundation, Inc.
+       Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/cedet/cedet-cscope.el b/lisp/cedet/cedet-cscope.el
index 68eb446..75a69db 100644
--- a/lisp/cedet/cedet-cscope.el
+++ b/lisp/cedet/cedet-cscope.el
@@ -1,6 +1,6 @@
 ;;; cedet-cscope.el --- CScope support for CEDET
 
-;;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Package: cedet
diff --git a/lisp/cedet/cedet-files.el b/lisp/cedet/cedet-files.el
index 212a24f..3160815 100644
--- a/lisp/cedet/cedet-files.el
+++ b/lisp/cedet/cedet-files.el
@@ -1,6 +1,6 @@
 ;;; cedet-files.el --- Common routines dealing with file names.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Package: cedet
diff --git a/lisp/cedet/cedet-global.el b/lisp/cedet/cedet-global.el
index 82751ec..5878ec1 100644
--- a/lisp/cedet/cedet-global.el
+++ b/lisp/cedet/cedet-global.el
@@ -1,6 +1,6 @@
 ;;; cedet-global.el --- GNU Global support for CEDET.
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Package: cedet
diff --git a/lisp/cedet/cedet-idutils.el b/lisp/cedet/cedet-idutils.el
index 0efd7ee..fc5e05a 100644
--- a/lisp/cedet/cedet-idutils.el
+++ b/lisp/cedet/cedet-idutils.el
@@ -1,6 +1,6 @@
 ;;; cedet-idutils.el --- ID Utils support for CEDET.
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Old-Version: 0.2
diff --git a/lisp/cedet/cedet.el b/lisp/cedet/cedet.el
index cb52068..caaec47 100644
--- a/lisp/cedet/cedet.el
+++ b/lisp/cedet/cedet.el
@@ -1,6 +1,6 @@
 ;;; cedet.el --- Setup CEDET environment
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Maintainer: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el
index 8037c31..a062a5a 100644
--- a/lisp/cedet/data-debug.el
+++ b/lisp/cedet/data-debug.el
@@ -1,6 +1,6 @@
 ;;; data-debug.el --- Data structure debugger
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Old-Version: 0.2
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el
index 4125281..1428915 100644
--- a/lisp/cedet/ede.el
+++ b/lisp/cedet/ede.el
@@ -1,6 +1,6 @@
 ;;; ede.el --- Emacs Development Environment gloss
 
-;; Copyright (C) 1998-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
diff --git a/lisp/cedet/ede/auto.el b/lisp/cedet/ede/auto.el
index 50ed462..ee75e29 100644
--- a/lisp/cedet/ede/auto.el
+++ b/lisp/cedet/ede/auto.el
@@ -1,6 +1,6 @@
 ;;; ede/auto.el --- Autoload features for EDE
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/autoconf-edit.el b/lisp/cedet/ede/autoconf-edit.el
index 409e35e..ca8535f 100644
--- a/lisp/cedet/ede/autoconf-edit.el
+++ b/lisp/cedet/ede/autoconf-edit.el
@@ -1,6 +1,6 @@
 ;;; ede/autoconf-edit.el --- Keymap for autoconf
 
-;; Copyright (C) 1998-2000, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2000, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project
diff --git a/lisp/cedet/ede/base.el b/lisp/cedet/ede/base.el
index d371ad7..7799746 100644
--- a/lisp/cedet/ede/base.el
+++ b/lisp/cedet/ede/base.el
@@ -1,6 +1,6 @@
 ;;; ede/base.el --- Baseclasses for EDE.
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/config.el b/lisp/cedet/ede/config.el
index 07260f0..1968621 100644
--- a/lisp/cedet/ede/config.el
+++ b/lisp/cedet/ede/config.el
@@ -1,6 +1,6 @@
 ;;; ede/config.el --- Configuration Handler baseclass
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/cpp-root.el b/lisp/cedet/ede/cpp-root.el
index f0dbccb..41f0c68 100644
--- a/lisp/cedet/ede/cpp-root.el
+++ b/lisp/cedet/ede/cpp-root.el
@@ -1,6 +1,6 @@
 ;;; ede/cpp-root.el --- A simple way to wrap a C++ project with a single root
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/custom.el b/lisp/cedet/ede/custom.el
index 63d8b02..aada872 100644
--- a/lisp/cedet/ede/custom.el
+++ b/lisp/cedet/ede/custom.el
@@ -1,6 +1,6 @@
 ;;; ede/custom.el --- customization of EDE projects.
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/detect.el b/lisp/cedet/ede/detect.el
index fe23501..027d008 100644
--- a/lisp/cedet/ede/detect.el
+++ b/lisp/cedet/ede/detect.el
@@ -1,6 +1,6 @@
 ;;; ede/detect.el --- EDE project detection and file associations
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/dired.el b/lisp/cedet/ede/dired.el
index e8c8027..c85d4ee 100644
--- a/lisp/cedet/ede/dired.el
+++ b/lisp/cedet/ede/dired.el
@@ -1,6 +1,6 @@
 ;;; ede/dired.el --- EDE extensions to dired.
 
-;; Copyright (C) 1998-2000, 2003, 2009-2020 Free Software Foundation,
+;; Copyright (C) 1998-2000, 2003, 2009-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/ede/emacs.el b/lisp/cedet/ede/emacs.el
index a052c5c..1eb4c63 100644
--- a/lisp/cedet/ede/emacs.el
+++ b/lisp/cedet/ede/emacs.el
@@ -1,6 +1,6 @@
 ;;; ede/emacs.el --- Special project for Emacs
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/files.el b/lisp/cedet/ede/files.el
index 1d6a082..cf5396a 100644
--- a/lisp/cedet/ede/files.el
+++ b/lisp/cedet/ede/files.el
@@ -1,6 +1,6 @@
 ;;; ede/files.el --- Associate projects with files and directories.
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/generic.el b/lisp/cedet/ede/generic.el
index b9805f6..3d1e1c5 100644
--- a/lisp/cedet/ede/generic.el
+++ b/lisp/cedet/ede/generic.el
@@ -1,6 +1,6 @@
 ;;; ede/generic.el --- Base Support for generic build systems
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -258,8 +258,8 @@ If one doesn't exist, create a new one for this directory."
 INTERNAL-NAME is obsolete and ignored.
 EXTERNAL-NAME is a human readable name to describe the project; it
 must be unique among all autoloaded projects.
-PROJECTFILE is a file name that identifies a project of this type to EDE, such 
as
-a Makefile, or SConstruct file.
+PROJECTFILE is a file name that identifies a project of this type to EDE, such
+as a Makefile, or SConstruct file.
 CLASS is the EIEIO class that is used to track this project.  It should 
subclass
 `ede-generic-project'."
   (ede-add-project-autoload
diff --git a/lisp/cedet/ede/linux.el b/lisp/cedet/ede/linux.el
index 8ce6b5c..7a1c4c9 100644
--- a/lisp/cedet/ede/linux.el
+++ b/lisp/cedet/ede/linux.el
@@ -1,6 +1,6 @@
 ;;; ede/linux.el --- Special project for Linux
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/locate.el b/lisp/cedet/ede/locate.el
index 160309f..e6a8953 100644
--- a/lisp/cedet/ede/locate.el
+++ b/lisp/cedet/ede/locate.el
@@ -1,6 +1,6 @@
 ;;; ede/locate.el --- Locate support
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/make.el b/lisp/cedet/ede/make.el
index 140e738..863d715 100644
--- a/lisp/cedet/ede/make.el
+++ b/lisp/cedet/ede/make.el
@@ -1,6 +1,6 @@
 ;;; ede/make.el --- General information about "make"
 
-;;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/makefile-edit.el b/lisp/cedet/ede/makefile-edit.el
index 218e75c..43655a5 100644
--- a/lisp/cedet/ede/makefile-edit.el
+++ b/lisp/cedet/ede/makefile-edit.el
@@ -1,6 +1,6 @@
 ;;; makefile-edit.el --- Makefile editing/scanning commands.
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/pconf.el b/lisp/cedet/ede/pconf.el
index b85b397..5bed32f 100644
--- a/lisp/cedet/ede/pconf.el
+++ b/lisp/cedet/ede/pconf.el
@@ -1,6 +1,6 @@
 ;;; ede/pconf.el --- configure.ac maintenance for EDE
 
-;;; Copyright (C) 1998-2000, 2005, 2008-2020 Free Software Foundation,
+;;; Copyright (C) 1998-2000, 2005, 2008-2021 Free Software Foundation,
 ;;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el
index 2e3256f..4c948df 100644
--- a/lisp/cedet/ede/pmake.el
+++ b/lisp/cedet/ede/pmake.el
@@ -1,6 +1,6 @@
 ;;; ede-pmake.el --- EDE Generic Project Makefile code generator.
 
-;; Copyright (C) 1998-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
diff --git a/lisp/cedet/ede/proj-archive.el b/lisp/cedet/ede/proj-archive.el
index 78764e3..2b1e50d 100644
--- a/lisp/cedet/ede/proj-archive.el
+++ b/lisp/cedet/ede/proj-archive.el
@@ -1,6 +1,6 @@
 ;;; ede/proj-archive.el --- EDE Generic Project archive support
 
-;;  Copyright (C) 1998-2001, 2009-2020 Free Software Foundation, Inc.
+;;  Copyright (C) 1998-2001, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
diff --git a/lisp/cedet/ede/proj-aux.el b/lisp/cedet/ede/proj-aux.el
index 0c35647..f5bcebd 100644
--- a/lisp/cedet/ede/proj-aux.el
+++ b/lisp/cedet/ede/proj-aux.el
@@ -1,6 +1,6 @@
 ;;; ede/proj-aux.el --- EDE Generic Project auxiliary file support
 
-;; Copyright (C) 1998-2000, 2007, 2009-2020 Free Software Foundation,
+;; Copyright (C) 1998-2000, 2007, 2009-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/ede/proj-comp.el b/lisp/cedet/ede/proj-comp.el
index 5e9cf49..26aa668 100644
--- a/lisp/cedet/ede/proj-comp.el
+++ b/lisp/cedet/ede/proj-comp.el
@@ -1,6 +1,6 @@
 ;;; ede/proj-comp.el --- EDE Generic Project compiler/rule driver
 
-;; Copyright (C) 1999-2001, 2004-2005, 2007, 2009-2020 Free Software
+;; Copyright (C) 1999-2001, 2004-2005, 2007, 2009-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/ede/proj-elisp.el b/lisp/cedet/ede/proj-elisp.el
index bcd6721..9ec9694 100644
--- a/lisp/cedet/ede/proj-elisp.el
+++ b/lisp/cedet/ede/proj-elisp.el
@@ -1,6 +1,6 @@
 ;;; ede-proj-elisp.el --- EDE Generic Project Emacs Lisp support
 
-;; Copyright (C) 1998-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
@@ -36,7 +36,7 @@
    (keybindings :initform nil)
    (phony :initform t)
    (sourcetype :initform '(ede-source-emacs))
-   (availablecompilers :initform '(ede-emacs-compiler ede-xemacs-compiler))
+   (availablecompilers :initform '(ede-emacs-compiler))
    (aux-packages :initarg :aux-packages
                 :initform nil
                 :type list
@@ -104,6 +104,7 @@ For Emacs Lisp, return addsuffix command on source files."
         :name "xemacs"
         :variables '(("EMACS" . "xemacs")))
   "Compile Emacs Lisp programs with XEmacs.")
+(make-obsolete-variable 'ede-xemacs-compiler 'ede-emacs-compiler "28.1")
 
 ;;; Claiming files
 (cl-defmethod ede-buffer-mine ((this ede-proj-target-elisp) buffer)
diff --git a/lisp/cedet/ede/proj-info.el b/lisp/cedet/ede/proj-info.el
index ee41d0c..3d43701 100644
--- a/lisp/cedet/ede/proj-info.el
+++ b/lisp/cedet/ede/proj-info.el
@@ -1,6 +1,6 @@
 ;;; ede-proj-info.el --- EDE Generic Project texinfo support
 
-;;; Copyright (C) 1998-2001, 2004, 2007-2020 Free Software Foundation,
+;;; Copyright (C) 1998-2001, 2004, 2007-2021 Free Software Foundation,
 ;;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/ede/proj-misc.el b/lisp/cedet/ede/proj-misc.el
index a73d03f..70132af 100644
--- a/lisp/cedet/ede/proj-misc.el
+++ b/lisp/cedet/ede/proj-misc.el
@@ -1,6 +1,6 @@
 ;;; ede-proj-misc.el --- EDE Generic Project Emacs Lisp support
 
-;; Copyright (C) 1998-2001, 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2001, 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
diff --git a/lisp/cedet/ede/proj-obj.el b/lisp/cedet/ede/proj-obj.el
index 22a6cdf..3aa4497 100644
--- a/lisp/cedet/ede/proj-obj.el
+++ b/lisp/cedet/ede/proj-obj.el
@@ -1,6 +1,6 @@
 ;;; ede/proj-obj.el --- EDE Generic Project Object code generation support
 
-;;; Copyright (C) 1998-2000, 2005, 2008-2020 Free Software Foundation,
+;;; Copyright (C) 1998-2000, 2005, 2008-2021 Free Software Foundation,
 ;;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/ede/proj-prog.el b/lisp/cedet/ede/proj-prog.el
index 5a12256..3817cd7 100644
--- a/lisp/cedet/ede/proj-prog.el
+++ b/lisp/cedet/ede/proj-prog.el
@@ -1,6 +1,6 @@
 ;;; ede-proj-prog.el --- EDE Generic Project program support
 
-;; Copyright (C) 1998-2001, 2005, 2008-2020 Free Software Foundation,
+;; Copyright (C) 1998-2001, 2005, 2008-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/ede/proj-scheme.el b/lisp/cedet/ede/proj-scheme.el
index 9afbeb1..51844af 100644
--- a/lisp/cedet/ede/proj-scheme.el
+++ b/lisp/cedet/ede/proj-scheme.el
@@ -1,6 +1,6 @@
 ;;; ede/proj-scheme.el --- EDE Generic Project scheme (guile) support
 
-;; Copyright (C) 1998-2000, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2000, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make, scheme
diff --git a/lisp/cedet/ede/proj-shared.el b/lisp/cedet/ede/proj-shared.el
index 2c87539..130d7b8 100644
--- a/lisp/cedet/ede/proj-shared.el
+++ b/lisp/cedet/ede/proj-shared.el
@@ -1,6 +1,6 @@
 ;;; ede-proj-shared.el --- EDE Generic Project shared library support
 
-;;; Copyright (C) 1998-2000, 2009-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 1998-2000, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
diff --git a/lisp/cedet/ede/proj.el b/lisp/cedet/ede/proj.el
index a6d47e3..59628eb 100644
--- a/lisp/cedet/ede/proj.el
+++ b/lisp/cedet/ede/proj.el
@@ -1,6 +1,6 @@
 ;;; ede/proj.el --- EDE Generic Project file driver
 
-;; Copyright (C) 1998-2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
diff --git a/lisp/cedet/ede/project-am.el b/lisp/cedet/ede/project-am.el
index 9bd3bab..061d1b5 100644
--- a/lisp/cedet/ede/project-am.el
+++ b/lisp/cedet/ede/project-am.el
@@ -1,6 +1,6 @@
 ;;; project-am.el --- A project management scheme based on automake files.
 
-;; Copyright (C) 1998-2000, 2003, 2005, 2007-2020 Free Software
+;; Copyright (C) 1998-2000, 2003, 2005, 2007-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/ede/shell.el b/lisp/cedet/ede/shell.el
index a993650..ba36fcc 100644
--- a/lisp/cedet/ede/shell.el
+++ b/lisp/cedet/ede/shell.el
@@ -1,6 +1,6 @@
 ;;; ede/shell.el --- A shell controlled by EDE.
 ;;
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/simple.el b/lisp/cedet/ede/simple.el
index b1cfd65..ea6162e 100644
--- a/lisp/cedet/ede/simple.el
+++ b/lisp/cedet/ede/simple.el
@@ -1,6 +1,6 @@
 ;;; ede/simple.el --- Overlay an EDE structure on an existing project
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/source.el b/lisp/cedet/ede/source.el
index eed82f7..abdb07f 100644
--- a/lisp/cedet/ede/source.el
+++ b/lisp/cedet/ede/source.el
@@ -1,6 +1,6 @@
 ;; ede/source.el --- EDE source code object
 
-;; Copyright (C) 2000, 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
diff --git a/lisp/cedet/ede/speedbar.el b/lisp/cedet/ede/speedbar.el
index ed33487..48c4a89 100644
--- a/lisp/cedet/ede/speedbar.el
+++ b/lisp/cedet/ede/speedbar.el
@@ -1,6 +1,6 @@
 ;;; ede/speedbar.el --- Speedbar viewing of EDE projects
 
-;; Copyright (C) 1998-2001, 2003, 2005, 2007-2020 Free Software
+;; Copyright (C) 1998-2001, 2003, 2005, 2007-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/ede/srecode.el b/lisp/cedet/ede/srecode.el
index ed85ea9..5dd0a7e 100644
--- a/lisp/cedet/ede/srecode.el
+++ b/lisp/cedet/ede/srecode.el
@@ -1,6 +1,6 @@
 ;;; ede/srecode.el --- EDE utilities on top of SRecoder
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/ede/system.el b/lisp/cedet/ede/system.el
index 5a78dd1..d83d6d1 100644
--- a/lisp/cedet/ede/system.el
+++ b/lisp/cedet/ede/system.el
@@ -1,6 +1,6 @@
 ;;; ede-system.el --- EDE working with the system (VC, FTP, ETC)
 
-;; Copyright (C) 2001-2003, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2003, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make, vc
diff --git a/lisp/cedet/ede/util.el b/lisp/cedet/ede/util.el
index c6da186..80cbc21 100644
--- a/lisp/cedet/ede/util.el
+++ b/lisp/cedet/ede/util.el
@@ -1,6 +1,6 @@
 ;;; ede/util.el --- EDE utilities
 
-;; Copyright (C) 2000, 2005, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2005, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
diff --git a/lisp/cedet/inversion.el b/lisp/cedet/inversion.el
index 113f405..2ef7e0d 100644
--- a/lisp/cedet/inversion.el
+++ b/lisp/cedet/inversion.el
@@ -1,6 +1,6 @@
 ;;; inversion.el --- When you need something in version XX.XX
 
-;;; Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Version: 1.3
diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el
index b965496..d1e528c 100644
--- a/lisp/cedet/mode-local.el
+++ b/lisp/cedet/mode-local.el
@@ -1,6 +1,6 @@
 ;;; mode-local.el --- Support for mode local facilities  -*- lexical-binding:t 
-*-
 ;;
-;; Copyright (C) 2004-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2005, 2007-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: 27 Apr 2004
diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el
index 8649254..aef4fc8 100644
--- a/lisp/cedet/pulse.el
+++ b/lisp/cedet/pulse.el
@@ -1,6 +1,6 @@
 ;;; pulse.el --- Pulsing Overlays
 
-;;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Version: 1.0
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index 805582c..c64a982 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -1,6 +1,6 @@
 ;;; semantic.el --- Semantic buffer evaluator.
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax tools
diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el
index cafdc3b..c0a054d 100644
--- a/lisp/cedet/semantic/analyze.el
+++ b/lisp/cedet/semantic/analyze.el
@@ -1,6 +1,6 @@
 ;;; semantic/analyze.el --- Analyze semantic tags against local context
 
-;; Copyright (C) 2000-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -235,7 +235,8 @@ scoped.  These are not local variables, but symbols 
available in a structure
 which doesn't need to be dereferenced.
 Optional argument TYPERETURN is a symbol in which the types of all found
 will be stored.  If nil, that data is thrown away.
-Optional argument THROWSYM specifies a symbol the throw on non-recoverable 
error.
+Optional argument THROWSYM specifies a symbol the throw on non-recoverable
+error.
 Remaining arguments FLAGS are additional flags to apply when searching.")
 
 (defun semantic-analyze-find-tag-sequence-default
@@ -246,7 +247,8 @@ Remaining arguments FLAGS are additional flags to apply 
when searching.")
 SCOPE are extra tags which are in scope.
 TYPERETURN is a symbol in which to place a list of tag classes that
 are found in SEQUENCE.
-Optional argument THROWSYM specifies a symbol the throw on non-recoverable 
error.
+Optional argument THROWSYM specifies a symbol the throw on non-recoverable
+error.
 Remaining arguments FLAGS are additional flags to apply when searching.
 This function knows of flags:
   `mustbeclassvariable'"
diff --git a/lisp/cedet/semantic/analyze/complete.el 
b/lisp/cedet/semantic/analyze/complete.el
index 8d07958..e8139ab 100644
--- a/lisp/cedet/semantic/analyze/complete.el
+++ b/lisp/cedet/semantic/analyze/complete.el
@@ -1,6 +1,6 @@
 ;;; semantic/analyze/complete.el --- Smart Completions
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/analyze/debug.el 
b/lisp/cedet/semantic/analyze/debug.el
index db5b096..4947368 100644
--- a/lisp/cedet/semantic/analyze/debug.el
+++ b/lisp/cedet/semantic/analyze/debug.el
@@ -1,6 +1,6 @@
 ;;; semantic/analyze/debug.el --- Debug the analyzer
 
-;;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/analyze/fcn.el 
b/lisp/cedet/semantic/analyze/fcn.el
index 44394f6..10d11c3 100644
--- a/lisp/cedet/semantic/analyze/fcn.el
+++ b/lisp/cedet/semantic/analyze/fcn.el
@@ -1,6 +1,6 @@
 ;;; semantic/analyze/fcn.el --- Analyzer support functions.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/analyze/refs.el 
b/lisp/cedet/semantic/analyze/refs.el
index 585f1a7..a39ff6f 100644
--- a/lisp/cedet/semantic/analyze/refs.el
+++ b/lisp/cedet/semantic/analyze/refs.el
@@ -1,6 +1,6 @@
 ;;; semantic/analyze/refs.el --- Analysis of the references between tags.
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -102,7 +102,8 @@ Use `semantic-analyze-current-tag' to debug this fcn."
 ;; into the context.
 (cl-defmethod semantic-analyze-refs-impl ((refs semantic-analyze-references) 
&optional in-buffer)
   "Return the implementations derived in the reference analyzer REFS.
-Optional argument IN-BUFFER indicates that the returned tag should be in an 
active buffer."
+Optional argument IN-BUFFER indicates that the returned tag
+should be in an active buffer."
   (let ((allhits (oref refs rawsearchdata))
        (tag (oref refs tag))
        (impl nil)
@@ -127,7 +128,8 @@ Optional argument IN-BUFFER indicates that the returned tag 
should be in an acti
 
 (cl-defmethod semantic-analyze-refs-proto ((refs semantic-analyze-references) 
&optional in-buffer)
   "Return the prototypes derived in the reference analyzer REFS.
-Optional argument IN-BUFFER indicates that the returned tag should be in an 
active buffer."
+Optional argument IN-BUFFER indicates that the returned tag
+should be in an active buffer."
   (let ((allhits (oref refs rawsearchdata))
        (tag (oref refs tag))
        (proto nil))
diff --git a/lisp/cedet/semantic/bovine.el b/lisp/cedet/semantic/bovine.el
index f999a01..034ecb5 100644
--- a/lisp/cedet/semantic/bovine.el
+++ b/lisp/cedet/semantic/bovine.el
@@ -1,6 +1,6 @@
 ;;; semantic/bovine.el --- LL Parser/Analyzer core.
 
-;; Copyright (C) 1999-2004, 2006-2007, 2009-2020 Free Software
+;; Copyright (C) 1999-2004, 2006-2007, 2009-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index 3649d1c..fb55139 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -1,6 +1,6 @@
 ;;; semantic/bovine/c.el --- Semantic details for C
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -368,7 +368,8 @@ Take the first interesting thing and convert it."
 
 (defun semantic-c-evaluate-symbol-for-hideif (spp-symbol)
   "Lookup the symbol SPP-SYMBOL (a string) to something hideif can use.
-Pulls out the symbol list, and call 
`semantic-c-convert-spp-value-to-hideif-value'."
+Pull out the symbol list, and call
+`semantic-c-convert-spp-value-to-hideif-value'."
   (interactive "sSymbol name: ")
   (when (symbolp spp-symbol) (setq spp-symbol (symbol-name spp-symbol)))
 
diff --git a/lisp/cedet/semantic/bovine/debug.el 
b/lisp/cedet/semantic/bovine/debug.el
index 0f5bc86..8ea9ac2 100644
--- a/lisp/cedet/semantic/bovine/debug.el
+++ b/lisp/cedet/semantic/bovine/debug.el
@@ -1,6 +1,6 @@
 ;;; semantic/bovine/debug.el --- Debugger support for bovinator
 
-;; Copyright (C) 2003, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el
index 2f05b99..dc61734 100644
--- a/lisp/cedet/semantic/bovine/el.el
+++ b/lisp/cedet/semantic/bovine/el.el
@@ -1,6 +1,6 @@
 ;;; semantic/bovine/el.el --- Semantic details for Emacs Lisp
 
-;; Copyright (C) 1999-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/bovine/gcc.el 
b/lisp/cedet/semantic/bovine/gcc.el
index 64f391d..1cfe5a3 100644
--- a/lisp/cedet/semantic/bovine/gcc.el
+++ b/lisp/cedet/semantic/bovine/gcc.el
@@ -1,6 +1,6 @@
 ;;; semantic/bovine/gcc.el --- gcc querying special code for the C parser
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/bovine/grammar.el 
b/lisp/cedet/semantic/bovine/grammar.el
index 10afb06..4914ec9 100644
--- a/lisp/cedet/semantic/bovine/grammar.el
+++ b/lisp/cedet/semantic/bovine/grammar.el
@@ -1,6 +1,6 @@
 ;;; semantic/bovine/grammar.el --- Bovine's input grammar mode
 ;;
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: 26 Aug 2002
diff --git a/lisp/cedet/semantic/bovine/make.el 
b/lisp/cedet/semantic/bovine/make.el
index 07c55b4..8089556 100644
--- a/lisp/cedet/semantic/bovine/make.el
+++ b/lisp/cedet/semantic/bovine/make.el
@@ -1,6 +1,6 @@
 ;;; semantic/bovine/make.el --- Makefile parsing rules.
 
-;; Copyright (C) 2000-2004, 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2004, 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -50,7 +50,8 @@
    nil)
 
 (define-lex-regex-analyzer semantic-lex-make-command
-  "A command in a Makefile consists of a line starting with TAB, and ending at 
the newline."
+  "Regexp for a command in a Makefile.
+It consists of a line starting with TAB, and ending at the newline."
   "^\\(\t\\)"
   (let ((start (match-end 0)))
     (while (progn (end-of-line)
diff --git a/lisp/cedet/semantic/bovine/scm.el 
b/lisp/cedet/semantic/bovine/scm.el
index b2a25bf..aaa86a1 100644
--- a/lisp/cedet/semantic/bovine/scm.el
+++ b/lisp/cedet/semantic/bovine/scm.el
@@ -1,6 +1,6 @@
 ;;; semantic/bovine/scm.el --- Semantic details for Scheme (guile)
 
-;;; Copyright (C) 2001-2004, 2008-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2001-2004, 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/chart.el b/lisp/cedet/semantic/chart.el
index a5f3699..e7848fa 100644
--- a/lisp/cedet/semantic/chart.el
+++ b/lisp/cedet/semantic/chart.el
@@ -1,6 +1,6 @@
 ;;; semantic/chart.el --- Utilities for use with semantic tag tables
 
-;; Copyright (C) 1999-2001, 2003, 2005, 2008-2020 Free Software
+;; Copyright (C) 1999-2001, 2003, 2005, 2008-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index b262ab7..0a80b42 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -1,6 +1,6 @@
 ;;; semantic/complete.el --- Routines for performing tag completion
 
-;; Copyright (C) 2003-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/ctxt.el b/lisp/cedet/semantic/ctxt.el
index f238730..4d2defd 100644
--- a/lisp/cedet/semantic/ctxt.el
+++ b/lisp/cedet/semantic/ctxt.el
@@ -1,6 +1,6 @@
 ;;; semantic/ctxt.el --- Context calculations for Semantic tools.
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/db-debug.el b/lisp/cedet/semantic/db-debug.el
index 65210ed..c553ab4 100644
--- a/lisp/cedet/semantic/db-debug.el
+++ b/lisp/cedet/semantic/db-debug.el
@@ -1,6 +1,6 @@
 ;;; semantic/db-debug.el --- Extra level debugging routines for Semantic
 
-;;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/db-ebrowse.el 
b/lisp/cedet/semantic/db-ebrowse.el
index d63e5bc..946f9ef 100644
--- a/lisp/cedet/semantic/db-ebrowse.el
+++ b/lisp/cedet/semantic/db-ebrowse.el
@@ -1,6 +1,6 @@
 ;;; semantic/db-ebrowse.el --- Semanticdb backend using ebrowse.
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 ;; Authors: Eric M. Ludlam <zappo@gnu.org>
 ;;     Joakim Verona
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el
index 1706988..4699e72 100644
--- a/lisp/cedet/semantic/db-el.el
+++ b/lisp/cedet/semantic/db-el.el
@@ -1,6 +1,6 @@
 ;;; semantic/db-el.el --- Semantic database extensions for Emacs Lisp
 
-;;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: tags
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el
index 9628748..59e9db9 100644
--- a/lisp/cedet/semantic/db-file.el
+++ b/lisp/cedet/semantic/db-file.el
@@ -1,6 +1,6 @@
 ;;; semantic/db-file.el --- Save a semanticdb to a cache file.
 
-;;; Copyright (C) 2000-2005, 2007-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2000-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: tags
diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el
index 86ccf28..14726e5 100644
--- a/lisp/cedet/semantic/db-find.el
+++ b/lisp/cedet/semantic/db-find.el
@@ -1,6 +1,6 @@
 ;;; semantic/db-find.el --- Searching through semantic databases.
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: tags
diff --git a/lisp/cedet/semantic/db-global.el b/lisp/cedet/semantic/db-global.el
index b6f7c2f..2f40082 100644
--- a/lisp/cedet/semantic/db-global.el
+++ b/lisp/cedet/semantic/db-global.el
@@ -1,6 +1,6 @@
 ;;; semantic/db-global.el --- Semantic database extensions for GLOBAL
 
-;; Copyright (C) 2002-2006, 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2006, 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: tags
diff --git a/lisp/cedet/semantic/db-javascript.el 
b/lisp/cedet/semantic/db-javascript.el
index 098ee067..2b13886 100644
--- a/lisp/cedet/semantic/db-javascript.el
+++ b/lisp/cedet/semantic/db-javascript.el
@@ -1,6 +1,6 @@
 ;;; semantic/db-javascript.el --- Semantic database extensions for javascript
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Joakim Verona
 
diff --git a/lisp/cedet/semantic/db-mode.el b/lisp/cedet/semantic/db-mode.el
index 16a30b6..aa4634f 100644
--- a/lisp/cedet/semantic/db-mode.el
+++ b/lisp/cedet/semantic/db-mode.el
@@ -1,6 +1,6 @@
 ;;; semantic/db-mode.el --- Semanticdb Minor Mode
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/db-ref.el b/lisp/cedet/semantic/db-ref.el
index 611275b..da09f98 100644
--- a/lisp/cedet/semantic/db-ref.el
+++ b/lisp/cedet/semantic/db-ref.el
@@ -1,6 +1,6 @@
 ;;; semantic/db-ref.el --- Handle cross-db file references
 
-;;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/db-typecache.el 
b/lisp/cedet/semantic/db-typecache.el
index 09f0e52..8c394cd 100644
--- a/lisp/cedet/semantic/db-typecache.el
+++ b/lisp/cedet/semantic/db-typecache.el
@@ -1,6 +1,6 @@
 ;;; semantic/db-typecache.el --- Manage Datatypes
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -343,7 +343,7 @@ all included files."
   nil)
 
 (cl-defmethod semanticdb-typecache-include-tags ((table semanticdb-table))
-  "Update the typecache for TABLE, and return the merged types from the 
include tags.
+  "Update typecache for TABLE, and return the merged types from the include 
tags.
 Include-tags are the tags brought in via includes, all merged together into
 a master list."
   (let* ((cache (semanticdb-get-typecache table))
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index 60a65b1..b9b1091 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -1,6 +1,6 @@
 ;;; semantic/db.el --- Semantic tag database manager  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: tags
diff --git a/lisp/cedet/semantic/debug.el b/lisp/cedet/semantic/debug.el
index eebdd01..b3e8f07 100644
--- a/lisp/cedet/semantic/debug.el
+++ b/lisp/cedet/semantic/debug.el
@@ -1,6 +1,6 @@
 ;;; semantic/debug.el --- Language Debugger framework
 
-;; Copyright (C) 2003-2005, 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2005, 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/decorate.el b/lisp/cedet/semantic/decorate.el
index da47280..53c54ab 100644
--- a/lisp/cedet/semantic/decorate.el
+++ b/lisp/cedet/semantic/decorate.el
@@ -1,6 +1,6 @@
 ;;; semantic/decorate.el --- Utilities for decorating/highlighting tokens.
 
-;;; Copyright (C) 1999-2003, 2005-2007, 2009-2020 Free Software
+;;; Copyright (C) 1999-2003, 2005-2007, 2009-2021 Free Software
 ;;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/semantic/decorate/include.el 
b/lisp/cedet/semantic/decorate/include.el
index 63e72a5..ee7fad1 100644
--- a/lisp/cedet/semantic/decorate/include.el
+++ b/lisp/cedet/semantic/decorate/include.el
@@ -1,6 +1,6 @@
 ;;; semantic/decorate/include.el --- Decoration modes for include statements
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/decorate/mode.el 
b/lisp/cedet/semantic/decorate/mode.el
index 2936920..884b066 100644
--- a/lisp/cedet/semantic/decorate/mode.el
+++ b/lisp/cedet/semantic/decorate/mode.el
@@ -1,6 +1,6 @@
 ;;; semantic/decorate/mode.el --- Minor mode for decorating tags
 
-;; Copyright (C) 2000-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/dep.el b/lisp/cedet/semantic/dep.el
index 60ab603..0fba2a2 100644
--- a/lisp/cedet/semantic/dep.el
+++ b/lisp/cedet/semantic/dep.el
@@ -1,6 +1,6 @@
 ;;; semantic/dep.el --- Methods for tracking dependencies (include files)
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/doc.el b/lisp/cedet/semantic/doc.el
index 896bc3b..d4dd928 100644
--- a/lisp/cedet/semantic/doc.el
+++ b/lisp/cedet/semantic/doc.el
@@ -1,6 +1,6 @@
 ;;; semantic/doc.el --- Routines for documentation strings
 
-;; Copyright (C) 1999-2003, 2005, 2008-2020 Free Software Foundation,
+;; Copyright (C) 1999-2003, 2005, 2008-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
@@ -40,7 +40,7 @@ TAG might have DOCUMENTATION set in it already.  If not, 
there may be
 some documentation in a comment preceding TAG's definition which we
 can look for.  When appropriate, this can be overridden by a language specific
 enhancement.
-Optional argument NOSNARF means to only return the lexical analyzer token for 
it.
+Optional argument NOSNARF means return only the lexical analyzer token for it.
 If NOSNARF is `lex', then only return the lex token."
   (if (not tag) (setq tag (semantic-current-tag)))
   (save-excursion
diff --git a/lisp/cedet/semantic/ede-grammar.el 
b/lisp/cedet/semantic/ede-grammar.el
index d435ff6..bd0795a 100644
--- a/lisp/cedet/semantic/ede-grammar.el
+++ b/lisp/cedet/semantic/ede-grammar.el
@@ -1,6 +1,6 @@
 ;;; semantic/ede-grammar.el --- EDE support for Semantic Grammar Files
 
-;; Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el
index e4319c7..f39cc09 100644
--- a/lisp/cedet/semantic/edit.el
+++ b/lisp/cedet/semantic/edit.el
@@ -1,6 +1,6 @@
 ;;; semantic/edit.el --- Edit Management for Semantic
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el
index 02c68e7..706892b 100644
--- a/lisp/cedet/semantic/find.el
+++ b/lisp/cedet/semantic/find.el
@@ -1,6 +1,6 @@
 ;;; semantic/find.el --- Search routines for Semantic
 
-;; Copyright (C) 1999-2005, 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2005, 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/format.el b/lisp/cedet/semantic/format.el
index e972015..f9c5365 100644
--- a/lisp/cedet/semantic/format.el
+++ b/lisp/cedet/semantic/format.el
@@ -1,6 +1,6 @@
 ;;; semantic/format.el --- Routines for formatting tags
 
-;; Copyright (C) 1999-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el
index c86cd3a..f034ba0 100644
--- a/lisp/cedet/semantic/fw.el
+++ b/lisp/cedet/semantic/fw.el
@@ -1,6 +1,6 @@
 ;;; semantic/fw.el --- Framework for Semantic
 
-;;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/grammar-wy.el 
b/lisp/cedet/semantic/grammar-wy.el
index 93fbede..12c9c04 100644
--- a/lisp/cedet/semantic/grammar-wy.el
+++ b/lisp/cedet/semantic/grammar-wy.el
@@ -1,6 +1,6 @@
 ;;; semantic/grammar-wy.el --- Generated parser support file
 
-;; Copyright (C) 2002-2004, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2009-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index d337946..7721a83 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -1,6 +1,6 @@
 ;;; semantic/grammar.el --- Major mode framework for Semantic grammars
 
-;; Copyright (C) 2002-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 
diff --git a/lisp/cedet/semantic/html.el b/lisp/cedet/semantic/html.el
index 537bc39..658d218 100644
--- a/lisp/cedet/semantic/html.el
+++ b/lisp/cedet/semantic/html.el
@@ -1,6 +1,6 @@
 ;;; semantic/html.el --- Semantic details for html files
 
-;; Copyright (C) 2004-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/ia-sb.el b/lisp/cedet/semantic/ia-sb.el
index baa6ade..b132d41 100644
--- a/lisp/cedet/semantic/ia-sb.el
+++ b/lisp/cedet/semantic/ia-sb.el
@@ -1,6 +1,6 @@
 ;;; semantic/ia-sb.el --- Speedbar analysis display interactor
 
-;;; Copyright (C) 2002-2004, 2006, 2008-2020 Free Software Foundation,
+;;; Copyright (C) 2002-2004, 2006, 2008-2021 Free Software Foundation,
 ;;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el
index e671160..6d3ec75 100644
--- a/lisp/cedet/semantic/ia.el
+++ b/lisp/cedet/semantic/ia.el
@@ -1,6 +1,6 @@
 ;;; semantic/ia.el --- Interactive Analysis functions
 
-;;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index 8301b19..4898c85 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -1,6 +1,6 @@
 ;;; idle.el --- Schedule parsing tasks in idle time
 
-;; Copyright (C) 2003-2006, 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2006, 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/imenu.el b/lisp/cedet/semantic/imenu.el
index 25f7fdb..2898f37 100644
--- a/lisp/cedet/semantic/imenu.el
+++ b/lisp/cedet/semantic/imenu.el
@@ -1,6 +1,6 @@
 ;;; semantic/imenu.el --- Use Semantic as an imenu tag generator
 
-;; Copyright (C) 2000-2005, 2007-2008, 2010-2020 Free Software
+;; Copyright (C) 2000-2005, 2007-2008, 2010-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
@@ -99,7 +99,8 @@ Overridden to nil if `semantic-imenu-bucketize-file' is nil."
 
 (defcustom semantic-imenu-sort-bucket-function nil
   "Function to use when sorting tags in the buckets of functions.
-See `semantic-bucketize' and the FILTER argument for more details on this 
function."
+See `semantic-bucketize' and the FILTER argument for more details
+on this function."
   :group 'semantic-imenu
   :type '(radio (const :tag "No Sorting" nil)
                (const semantic-sort-tags-by-name-increasing)
diff --git a/lisp/cedet/semantic/java.el b/lisp/cedet/semantic/java.el
index cc53f69..f60f6e8 100644
--- a/lisp/cedet/semantic/java.el
+++ b/lisp/cedet/semantic/java.el
@@ -1,6 +1,6 @@
 ;;; semantic/java.el --- Semantic functions for Java
 
-;;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el
index e6e124e..8b83c09 100644
--- a/lisp/cedet/semantic/lex-spp.el
+++ b/lisp/cedet/semantic/lex-spp.el
@@ -1,6 +1,6 @@
 ;;; semantic/lex-spp.el --- Semantic Lexical Pre-processor
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el
index 809271d..993c1dc 100644
--- a/lisp/cedet/semantic/lex.el
+++ b/lisp/cedet/semantic/lex.el
@@ -1,6 +1,6 @@
 ;;; semantic/lex.el --- Lexical Analyzer builder  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/mru-bookmark.el 
b/lisp/cedet/semantic/mru-bookmark.el
index bd32f98..956eb68 100644
--- a/lisp/cedet/semantic/mru-bookmark.el
+++ b/lisp/cedet/semantic/mru-bookmark.el
@@ -1,6 +1,6 @@
 ;;; semantic/mru-bookmark.el --- Automatic bookmark tracking
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/sb.el b/lisp/cedet/semantic/sb.el
index b038d40..d7cd8e1 100644
--- a/lisp/cedet/semantic/sb.el
+++ b/lisp/cedet/semantic/sb.el
@@ -1,6 +1,6 @@
 ;;; semantic/sb.el --- Semantic tag display for speedbar
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/scope.el b/lisp/cedet/semantic/scope.el
index 7939438..31576d2 100644
--- a/lisp/cedet/semantic/scope.el
+++ b/lisp/cedet/semantic/scope.el
@@ -1,6 +1,6 @@
 ;;; semantic/scope.el --- Analyzer Scope Calculations
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el
index 49c1933..6768b43 100644
--- a/lisp/cedet/semantic/senator.el
+++ b/lisp/cedet/semantic/senator.el
@@ -1,6 +1,6 @@
 ;;; semantic/senator.el --- SEmantic NAvigaTOR
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Maintainer: emacs-devel@gnu.org
@@ -810,7 +810,7 @@ if available."
 (defun senator-lazy-highlight-update ()
   "Force lazy highlight update."
   (lazy-highlight-cleanup t)
-  (set 'isearch-lazy-highlight-last-string nil)
+  (setq isearch-lazy-highlight-last-string nil)
   (setq isearch-adjusted t)
   (isearch-update))
 
diff --git a/lisp/cedet/semantic/sort.el b/lisp/cedet/semantic/sort.el
index a565d87..154a56a 100644
--- a/lisp/cedet/semantic/sort.el
+++ b/lisp/cedet/semantic/sort.el
@@ -1,6 +1,6 @@
 ;;; semantic/sort.el --- Utilities for sorting and re-arranging tag tables.
 
-;;; Copyright (C) 1999-2005, 2007-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 1999-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el
index 6bdec71..d7f9157 100644
--- a/lisp/cedet/semantic/symref.el
+++ b/lisp/cedet/semantic/symref.el
@@ -1,6 +1,6 @@
 ;;; semantic/symref.el --- Symbol Reference API
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -511,9 +511,10 @@ Optional OPEN-BUFFERS, when nil will use a faster version 
of
 `find-file' when a file needs to be opened.  If non-nil, then
 normal buffer initialization will be used.
 This function will leave buffers loaded from a file open, but
-will add buffers that must be opened to 
`semantic-symref-recently-opened-buffers'.
-Any caller MUST deal with that variable, either clearing it, or deleting the
-buffers that were opened."
+will add buffers that must be opened to
+`semantic-symref-recently-opened-buffers'.
+Any caller MUST deal with that variable, either clearing it, or
+deleting the buffers that were opened."
   (let* ((line (car hit))
         (file (cdr hit))
         (buff (find-buffer-visiting file))
diff --git a/lisp/cedet/semantic/symref/cscope.el 
b/lisp/cedet/semantic/symref/cscope.el
index 502d59d..3686e51 100644
--- a/lisp/cedet/semantic/symref/cscope.el
+++ b/lisp/cedet/semantic/symref/cscope.el
@@ -1,6 +1,6 @@
 ;;; semantic/symref/cscope.el --- Semantic-symref support via cscope.
 
-;;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/symref/filter.el 
b/lisp/cedet/semantic/symref/filter.el
index 19ce374..a40ce13 100644
--- a/lisp/cedet/semantic/symref/filter.el
+++ b/lisp/cedet/semantic/symref/filter.el
@@ -1,6 +1,6 @@
 ;;; semantic/symref/filter.el --- Filter symbol reference hits for accuracy.
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/symref/global.el 
b/lisp/cedet/semantic/symref/global.el
index 6bb0929..7f63e4d 100644
--- a/lisp/cedet/semantic/symref/global.el
+++ b/lisp/cedet/semantic/symref/global.el
@@ -1,6 +1,6 @@
 ;;; semantic/symref/global.el --- Use GNU Global for symbol references
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/symref/grep.el 
b/lisp/cedet/semantic/symref/grep.el
index 29e88cd..5f9a3fa 100644
--- a/lisp/cedet/semantic/symref/grep.el
+++ b/lisp/cedet/semantic/symref/grep.el
@@ -1,6 +1,6 @@
 ;;; semantic/symref/grep.el --- Symref implementation using find/grep
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/symref/idutils.el 
b/lisp/cedet/semantic/symref/idutils.el
index 006cc50..4a41355 100644
--- a/lisp/cedet/semantic/symref/idutils.el
+++ b/lisp/cedet/semantic/symref/idutils.el
@@ -1,6 +1,6 @@
 ;;; semantic/symref/idutils.el --- Symref implementation for idutils
 
-;;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/symref/list.el 
b/lisp/cedet/semantic/symref/list.el
index d64d4dd..7d3a5dd 100644
--- a/lisp/cedet/semantic/symref/list.el
+++ b/lisp/cedet/semantic/symref/list.el
@@ -1,6 +1,6 @@
 ;;; semantic/symref/list.el --- Symref Output List UI.
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/tag-file.el b/lisp/cedet/semantic/tag-file.el
index 23f4b29..fc5c277 100644
--- a/lisp/cedet/semantic/tag-file.el
+++ b/lisp/cedet/semantic/tag-file.el
@@ -1,6 +1,6 @@
 ;;; semantic/tag-file.el --- Routines that find files based on tags.
 
-;; Copyright (C) 1999-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/tag-ls.el b/lisp/cedet/semantic/tag-ls.el
index 3ee11df..6cef603 100644
--- a/lisp/cedet/semantic/tag-ls.el
+++ b/lisp/cedet/semantic/tag-ls.el
@@ -1,6 +1,6 @@
 ;;; semantic/tag-ls.el --- Language Specific override functions for tags
 
-;; Copyright (C) 1999-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -93,8 +93,9 @@ for a given mode at a more granular level.
 Note that :type, :name, and anything in IGNORABLE-ATTRIBUTES will
 not be passed to this function.
 
-Modes that override this function can call 
`semantic--tag-attribute-similar-p-default'
-to do the default equality tests if ATTR is not special for that mode.")
+Modes that override this function can call
+`semantic--tag-attribute-similar-p-default' to do the default equality tests if
+ATTR is not special for that mode.")
 
 (defun semantic--tag-attribute-similar-p-default (attr value1 value2 
ignorable-attributes)
   "For ATTR, VALUE1, VALUE2 and IGNORABLE-ATTRIBUTES, test for similarity."
diff --git a/lisp/cedet/semantic/tag-write.el b/lisp/cedet/semantic/tag-write.el
index cd77caa..f705c89 100644
--- a/lisp/cedet/semantic/tag-write.el
+++ b/lisp/cedet/semantic/tag-write.el
@@ -1,6 +1,6 @@
 ;;; semantic/tag-write.el --- Write tags to a text stream
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/tag.el b/lisp/cedet/semantic/tag.el
index 3dadf34..d68ffa5 100644
--- a/lisp/cedet/semantic/tag.el
+++ b/lisp/cedet/semantic/tag.el
@@ -1,6 +1,6 @@
 ;;; semantic/tag.el --- tag creation and access
 
-;; Copyright (C) 1999-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/texi.el b/lisp/cedet/semantic/texi.el
index 8e8d362..377cec5 100644
--- a/lisp/cedet/semantic/texi.el
+++ b/lisp/cedet/semantic/texi.el
@@ -1,6 +1,6 @@
 ;;; semantic/texi.el --- Semantic details for Texinfo files
 
-;; Copyright (C) 2001-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/semantic/util-modes.el 
b/lisp/cedet/semantic/util-modes.el
index 776c6b1..45eef10 100644
--- a/lisp/cedet/semantic/util-modes.el
+++ b/lisp/cedet/semantic/util-modes.el
@@ -1,6 +1,6 @@
 ;;; semantic/util-modes.el --- Semantic minor modes
 
-;; Copyright (C) 2000-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Authors: Eric M. Ludlam <zappo@gnu.org>
 ;;          David Ponce <david@dponce.com>
@@ -837,7 +837,8 @@ Argument EVENT describes the event that caused this 
function to be called."
   "Keymap for highlight-func minor mode.")
 
 (defvar semantic-highlight-func-popup-menu nil
-  "Menu used if the user clicks on the header line used by 
`semantic-highlight-func-mode'.")
+  "Menu used if the user clicks on the header line.
+Used by `semantic-highlight-func-mode'.")
 
 (easy-menu-define
   semantic-highlight-func-popup-menu
diff --git a/lisp/cedet/semantic/util.el b/lisp/cedet/semantic/util.el
index 7df7dfc..7d33d0e 100644
--- a/lisp/cedet/semantic/util.el
+++ b/lisp/cedet/semantic/util.el
@@ -1,6 +1,6 @@
 ;;; semantic/util.el --- Utilities for use with semantic tag tables
 
-;;; Copyright (C) 1999-2005, 2007-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 1999-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/wisent.el b/lisp/cedet/semantic/wisent.el
index 15d1313..fb4d0b0 100644
--- a/lisp/cedet/semantic/wisent.el
+++ b/lisp/cedet/semantic/wisent.el
@@ -1,6 +1,6 @@
 ;;; semantic/wisent.el --- Wisent - Semantic gateway
 
-;; Copyright (C) 2001-2007, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2007, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: 30 Aug 2001
diff --git a/lisp/cedet/semantic/wisent/comp.el 
b/lisp/cedet/semantic/wisent/comp.el
index 42c5756..755d30a 100644
--- a/lisp/cedet/semantic/wisent/comp.el
+++ b/lisp/cedet/semantic/wisent/comp.el
@@ -1,6 +1,6 @@
 ;;; semantic/wisent/comp.el --- GNU Bison for Emacs - Grammar compiler
 
-;; Copyright (C) 1984, 1986, 1989, 1992, 1995, 2000-2007, 2009-2020 Free
+;; Copyright (C) 1984, 1986, 1989, 1992, 1995, 2000-2007, 2009-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
diff --git a/lisp/cedet/semantic/wisent/grammar.el 
b/lisp/cedet/semantic/wisent/grammar.el
index 0ff9cde..cfd4899 100644
--- a/lisp/cedet/semantic/wisent/grammar.el
+++ b/lisp/cedet/semantic/wisent/grammar.el
@@ -1,6 +1,6 @@
 ;;; semantic/wisent/grammar.el --- Wisent's input grammar mode
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: 26 Aug 2002
diff --git a/lisp/cedet/semantic/wisent/java-tags.el 
b/lisp/cedet/semantic/wisent/java-tags.el
index 0eed98c..d455c02 100644
--- a/lisp/cedet/semantic/wisent/java-tags.el
+++ b/lisp/cedet/semantic/wisent/java-tags.el
@@ -1,6 +1,6 @@
 ;;; semantic/wisent/java-tags.el --- Java LALR parser for Emacs
 
-;; Copyright (C) 2001-2006, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2006, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: 15 Dec 2001
diff --git a/lisp/cedet/semantic/wisent/javascript.el 
b/lisp/cedet/semantic/wisent/javascript.el
index 90bf7fa..684eea1 100644
--- a/lisp/cedet/semantic/wisent/javascript.el
+++ b/lisp/cedet/semantic/wisent/javascript.el
@@ -1,6 +1,6 @@
 ;;; semantic/wisent/javascript.el --- javascript parser support
 
-;; Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
diff --git a/lisp/cedet/semantic/wisent/python.el 
b/lisp/cedet/semantic/wisent/python.el
index 66d21f7..7769ad19 100644
--- a/lisp/cedet/semantic/wisent/python.el
+++ b/lisp/cedet/semantic/wisent/python.el
@@ -1,6 +1,6 @@
 ;;; wisent-python.el --- Semantic support for Python
 
-;; Copyright (C) 2002, 2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Richard Kim <emacs18@gmail.com>
 ;; Created: June 2002
diff --git a/lisp/cedet/semantic/wisent/wisent.el 
b/lisp/cedet/semantic/wisent/wisent.el
index a0a8bed..26cf87f 100644
--- a/lisp/cedet/semantic/wisent/wisent.el
+++ b/lisp/cedet/semantic/wisent/wisent.el
@@ -1,6 +1,6 @@
 ;;; semantic/wisent/wisent.el --- GNU Bison for Emacs - Runtime
 
-;;; Copyright (C) 2002-2007, 2009-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2002-2007, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: 30 January 2002
diff --git a/lisp/cedet/srecode.el b/lisp/cedet/srecode.el
index 79c8aff..aa4aa81 100644
--- a/lisp/cedet/srecode.el
+++ b/lisp/cedet/srecode.el
@@ -1,6 +1,6 @@
 ;;; srecode.el --- Semantic buffer evaluator.  -*- lexical-binding: t -*-
 
-;;; Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: codegeneration
diff --git a/lisp/cedet/srecode/args.el b/lisp/cedet/srecode/args.el
index 4ac5047..24c5f22 100644
--- a/lisp/cedet/srecode/args.el
+++ b/lisp/cedet/srecode/args.el
@@ -1,6 +1,6 @@
 ;;; srecode/args.el --- Provide some simple template arguments
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el
index 9f81b2b..7146b64 100644
--- a/lisp/cedet/srecode/compile.el
+++ b/lisp/cedet/srecode/compile.el
@@ -1,6 +1,6 @@
 ;;; srecode/compile --- Compilation of srecode template files.
 
-;; Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: codegeneration
diff --git a/lisp/cedet/srecode/cpp.el b/lisp/cedet/srecode/cpp.el
index 3e40472..1b9610f 100644
--- a/lisp/cedet/srecode/cpp.el
+++ b/lisp/cedet/srecode/cpp.el
@@ -1,6 +1,6 @@
 ;;; srecode/cpp.el --- C++ specific handlers for Semantic Recoder
 
-;; Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;;         Jan Moringen <scymtym@users.sourceforge.net>
diff --git a/lisp/cedet/srecode/ctxt.el b/lisp/cedet/srecode/ctxt.el
index 3d99021..20334f9 100644
--- a/lisp/cedet/srecode/ctxt.el
+++ b/lisp/cedet/srecode/ctxt.el
@@ -1,6 +1,6 @@
 ;;; srecode/ctxt.el --- Derive a context from the source buffer.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/dictionary.el b/lisp/cedet/srecode/dictionary.el
index 4322b09..c1fe4b2 100644
--- a/lisp/cedet/srecode/dictionary.el
+++ b/lisp/cedet/srecode/dictionary.el
@@ -1,6 +1,6 @@
 ;;; srecode/dictionary.el --- Dictionary code for the semantic recoder.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/document.el b/lisp/cedet/srecode/document.el
index fdb4469..0d1a4c0 100644
--- a/lisp/cedet/srecode/document.el
+++ b/lisp/cedet/srecode/document.el
@@ -1,6 +1,6 @@
 ;;; srecode/document.el --- Documentation (comment) generation
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/el.el b/lisp/cedet/srecode/el.el
index 4095b1c..7e9dd10 100644
--- a/lisp/cedet/srecode/el.el
+++ b/lisp/cedet/srecode/el.el
@@ -1,6 +1,6 @@
 ;;; srecode/el.el --- Emacs Lisp specific arguments
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/expandproto.el 
b/lisp/cedet/srecode/expandproto.el
index e7601f5..cdb29d1 100644
--- a/lisp/cedet/srecode/expandproto.el
+++ b/lisp/cedet/srecode/expandproto.el
@@ -1,6 +1,6 @@
 ;;; srecode/expandproto.el --- Expanding prototypes.
 
-;; Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/extract.el b/lisp/cedet/srecode/extract.el
index 51c5fe4..625b854 100644
--- a/lisp/cedet/srecode/extract.el
+++ b/lisp/cedet/srecode/extract.el
@@ -1,6 +1,6 @@
 ;;; srecode/extract.el --- Extract content from previously inserted macro.
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/fields.el b/lisp/cedet/srecode/fields.el
index 87c7c68..71613bc 100644
--- a/lisp/cedet/srecode/fields.el
+++ b/lisp/cedet/srecode/fields.el
@@ -1,6 +1,6 @@
 ;;; srecode/fields.el --- Handling type-in fields in a buffer.
 ;;
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/filters.el b/lisp/cedet/srecode/filters.el
index ee672a5..4a996cf 100644
--- a/lisp/cedet/srecode/filters.el
+++ b/lisp/cedet/srecode/filters.el
@@ -1,6 +1,6 @@
 ;;; srecode/filters.el --- Filters for use in template variables.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/find.el b/lisp/cedet/srecode/find.el
index c6bb62b..aec73dc 100644
--- a/lisp/cedet/srecode/find.el
+++ b/lisp/cedet/srecode/find.el
@@ -1,6 +1,6 @@
 ;;;; srecode/find.el --- Tools for finding templates in the database.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/getset.el b/lisp/cedet/srecode/getset.el
index 2e06381..1e48886 100644
--- a/lisp/cedet/srecode/getset.el
+++ b/lisp/cedet/srecode/getset.el
@@ -1,6 +1,6 @@
 ;;; srecode/getset.el --- Package for inserting new get/set methods.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el
index c28f7be..ab0503c 100644
--- a/lisp/cedet/srecode/insert.el
+++ b/lisp/cedet/srecode/insert.el
@@ -1,6 +1,6 @@
 ;;; srecode/insert.el --- Insert srecode templates to an output stream  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/java.el b/lisp/cedet/srecode/java.el
index fa508df..768d48a 100644
--- a/lisp/cedet/srecode/java.el
+++ b/lisp/cedet/srecode/java.el
@@ -1,6 +1,6 @@
 ;;; srecode/java.el --- Srecode Java support
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el
index dc94920..a94db0b 100644
--- a/lisp/cedet/srecode/map.el
+++ b/lisp/cedet/srecode/map.el
@@ -1,6 +1,6 @@
 ;;; srecode/map.el --- Manage a template file map
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/mode.el b/lisp/cedet/srecode/mode.el
index c94c0fc..159dc7a 100644
--- a/lisp/cedet/srecode/mode.el
+++ b/lisp/cedet/srecode/mode.el
@@ -1,6 +1,6 @@
 ;;; srecode/mode.el --- Minor mode for managing and using SRecode templates
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/semantic.el b/lisp/cedet/srecode/semantic.el
index 5b2dd03..21ed1f9 100644
--- a/lisp/cedet/srecode/semantic.el
+++ b/lisp/cedet/srecode/semantic.el
@@ -1,6 +1,6 @@
 ;;; srecode/semantic.el --- Semantic specific extensions to SRecode.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el
index d82da40..bbe1e5e 100644
--- a/lisp/cedet/srecode/srt-mode.el
+++ b/lisp/cedet/srecode/srt-mode.el
@@ -1,6 +1,6 @@
 ;;; srecode/srt-mode.el --- Major mode for writing screcode macros
 
-;; Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/cedet/srecode/srt.el b/lisp/cedet/srecode/srt.el
index ef0ef0d..e222997 100644
--- a/lisp/cedet/srecode/srt.el
+++ b/lisp/cedet/srecode/srt.el
@@ -1,6 +1,6 @@
 ;;; srecode/srt.el --- argument handlers for SRT files
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/table.el b/lisp/cedet/srecode/table.el
index 55093d6..60a466f 100644
--- a/lisp/cedet/srecode/table.el
+++ b/lisp/cedet/srecode/table.el
@@ -1,6 +1,6 @@
 ;;; srecode/table.el --- Tables of Semantic Recoders
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/cedet/srecode/template.el b/lisp/cedet/srecode/template.el
index 68c2ee7..e9e5115 100644
--- a/lisp/cedet/srecode/template.el
+++ b/lisp/cedet/srecode/template.el
@@ -1,6 +1,6 @@
 ;;; srecode/template.el --- SRecoder template language parser support.
 
-;; Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/cedet/srecode/texi.el b/lisp/cedet/srecode/texi.el
index 3aefcfd..892ae4e 100644
--- a/lisp/cedet/srecode/texi.el
+++ b/lisp/cedet/srecode/texi.el
@@ -1,6 +1,6 @@
 ;;; srecode/texi.el --- Srecode texinfo support.
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/lisp/char-fold.el b/lisp/char-fold.el
index 34561a2..46a3f93 100644
--- a/lisp/char-fold.el
+++ b/lisp/char-fold.el
@@ -1,6 +1,6 @@
 ;;; char-fold.el --- match unicode to similar ASCII -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: matching
diff --git a/lisp/chistory.el b/lisp/chistory.el
index c9aa927..589b5b5 100644
--- a/lisp/chistory.el
+++ b/lisp/chistory.el
@@ -1,6 +1,6 @@
 ;;; chistory.el --- list command history
 
-;; Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: K. Shane Hartman
 ;; Maintainer: emacs-devel@gnu.org
@@ -140,7 +140,7 @@ The buffer is left in Command History mode."
 Keybindings:
 \\{command-history-mode-map}"
   (lisp-mode-variables nil)
-  (set (make-local-variable 'revert-buffer-function) 'command-history-revert)
+  (setq-local revert-buffer-function 'command-history-revert)
   (set-syntax-table emacs-lisp-mode-syntax-table))
 
 (defcustom command-history-hook nil
diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el
index 7191b93..772891d 100644
--- a/lisp/cmuscheme.el
+++ b/lisp/cmuscheme.el
@@ -1,6 +1,6 @@
 ;;; cmuscheme.el --- Scheme process in a buffer. Adapted from tea.el
 
-;; Copyright (C) 1988, 1994, 1997, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1988, 1994, 1997, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Olin Shivers <olin.shivers@cs.cmu.edu>
diff --git a/lisp/color.el b/lisp/color.el
index 48f150d..258acbe 100644
--- a/lisp/color.el
+++ b/lisp/color.el
@@ -1,6 +1,6 @@
 ;;; color.el --- Color manipulation library -*- lexical-binding:t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Authors: Julien Danjou <julien@danjou.info>
 ;;          Drew Adams <drew.adams@oracle.com>
diff --git a/lisp/comint.el b/lisp/comint.el
index 2873416..2e683a7 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1,6 +1,6 @@
 ;;; comint.el --- general command interpreter in a window stuff -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1988, 1990, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1990, 1992-2021 Free Software Foundation, Inc.
 
 ;; Author: Olin Shivers <shivers@cs.cmu.edu>
 ;;     Simon Marshall <simon@gnu.org>
@@ -1224,7 +1224,7 @@ Moves relative to START, or `comint-input-ring-index'."
        (process-mark (get-buffer-process (current-buffer))))
    (point-max)))
 
-(defun comint-previous-matching-input (regexp n)
+(defun comint-previous-matching-input (regexp n &optional restore)
   "Search backwards through input history for match for REGEXP.
 \(Previous history elements are earlier commands.)
 With prefix argument N, search for Nth previous match.
@@ -1235,16 +1235,24 @@ If N is negative, find the next or Nth next match."
     ;; Has a match been found?
     (if (null pos)
        (user-error "Not found")
-      ;; If leaving the edit line, save partial input
-      (if (null comint-input-ring-index)       ;not yet on ring
-         (setq comint-stored-incomplete-input
-               (funcall comint-get-old-input)))
-      (setq comint-input-ring-index pos)
-      (unless isearch-mode
-       (let ((message-log-max nil))    ; Do not write to *Messages*.
-         (message "History item: %d" (1+ pos))))
-      (comint-delete-input)
-      (insert (ring-ref comint-input-ring pos)))))
+      (if (and comint-input-ring-index
+               restore
+               (or (and (< n 0)
+                        (< comint-input-ring-index pos))
+                   (and (> n 0)
+                        (> comint-input-ring-index pos))))
+          ;; We have a wrap; restore contents.
+          (comint-restore-input)
+        ;; If leaving the edit line, save partial input
+        (if (null comint-input-ring-index) ;not yet on ring
+           (setq comint-stored-incomplete-input
+                 (funcall comint-get-old-input)))
+        (setq comint-input-ring-index pos)
+        (unless isearch-mode
+         (let ((message-log-max nil))  ; Do not write to *Messages*.
+           (message "History item: %d" (1+ pos))))
+        (comint-delete-input)
+        (insert (ring-ref comint-input-ring pos))))))
 
 (defun comint-next-matching-input (regexp n)
   "Search forwards through input history for match for REGEXP.
@@ -1272,7 +1280,7 @@ If N is negative, search forwards for the -Nth following 
match."
            comint-input-ring-index nil))
     (comint-previous-matching-input
      (concat "^" (regexp-quote comint-matching-input-from-input-string))
-     n)
+     n t)
     (when (eq comint-move-point-for-matching-input 'after-input)
       (goto-char opoint))))
 
diff --git a/lisp/completion.el b/lisp/completion.el
index 8a4c167..8810a22 100644
--- a/lisp/completion.el
+++ b/lisp/completion.el
@@ -1,6 +1,6 @@
 ;;; completion.el --- dynamic word-completion code
 
-;; Copyright (C) 1990, 1993, 1995, 1997, 2001-2020 Free Software
+;; Copyright (C) 1990, 1993, 1995, 1997, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/composite.el b/lisp/composite.el
index 0a8dcb8..7337605 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -1,6 +1,6 @@
 ;;; composite.el --- support character composition
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
 ;;   2008, 2009, 2010, 2011
diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el
index db2c444..a52d082 100644
--- a/lisp/cus-dep.el
+++ b/lisp/cus-dep.el
@@ -1,6 +1,6 @@
 ;;; cus-dep.el --- find customization dependencies
 ;;
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: internal
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 3a36cb0..e52df4e 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1,6 +1,6 @@
 ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages -*- 
lexical-binding:t -*-
 ;;
-;; Copyright (C) 1996-1997, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 1999-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: emacs-devel@gnu.org
@@ -2734,11 +2734,15 @@ try matching its doc string against 
`custom-guess-doc-alist'."
                 buttons)
           (insert " ")
           (let* ((format (widget-get type :format))
-                 tag-format value-format)
-            (unless (string-match ":" format)
+                  tag-format)
+             ;; We used to drop the widget tag when creating TYPE, passing
+             ;; everything after the colon (including whitespace characters
+             ;; after it) as the :format for TYPE.  We don't drop the tag
+             ;; anymore, but we should keep an immediate whitespace character,
+             ;; if present, and it's easier to do it here.
+             (unless (string-match ":\\s-?" format)
               (error "Bad format"))
             (setq tag-format (substring format 0 (match-end 0)))
-            (setq value-format (substring format (match-end 0)))
             (push (widget-create-child-and-convert
                    widget 'item
                    :format tag-format
@@ -2753,7 +2757,6 @@ try matching its doc string against 
`custom-guess-doc-alist'."
                   buttons)
             (push (widget-create-child-and-convert
                    widget type
-                   :format value-format
                    :value value)
                   children))))
     (unless (eq custom-buffer-style 'tree)
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index 199a76e..7d9d1fe 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -1,6 +1,6 @@
 ;;; cus-face.el --- customization support for faces
 ;;
-;; Copyright (C) 1996-1997, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 1999-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 04fb1dc..85dd14f 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -1,6 +1,6 @@
 ;;; cus-start.el --- define customization properties of builtins  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1997, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: internal
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index dc463e0..a702fed 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -1,6 +1,6 @@
 ;;; cus-theme.el -- custom theme creation user interface  -*- lexical-binding: 
t -*-
 ;;
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/custom.el b/lisp/custom.el
index 0b2b325..dfa8539 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1,6 +1,6 @@
 ;;; custom.el --- tools for declaring and initializing options  -*- 
lexical-binding: t -*-
 ;;
-;; Copyright (C) 1996-1997, 1999, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1996-1997, 1999, 2001-2021 Free Software Foundation,
 ;; Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index a9df031..e113cc9 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -1,6 +1,6 @@
 ;;; dabbrev.el --- dynamic abbreviation package  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1992, 1994, 1996-1997, 2000-2020 Free
+;; Copyright (C) 1985-1986, 1992, 1994, 1996-1997, 2000-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Author: Don Morrison
@@ -45,7 +45,7 @@
 ;; dabbrev-case-replace                nil             t
 ;;
 ;; Set the variables you want special for your mode like this:
-;; (set (make-local-variable 'dabbrev-case-replace) nil)
+;; (setq-local dabbrev-case-replace nil)
 ;; Then you don't interfere with other modes.
 ;;
 ;; If your mode handles buffers that refers to other buffers
@@ -59,10 +59,10 @@
 
 ;; Example for GNUS (when we write a reply, we want dabbrev to look in
 ;; the article for expansion):
-;; (set (make-local-variable 'dabbrev-friend-buffer-function)
-;;      (lambda (buffer)
-;;         (with-current-buffer buffer
-;;           (memq major-mode '(news-reply-mode gnus-article-mode)))))
+;; (setq-local dabbrev-friend-buffer-function
+;;             (lambda (buffer)
+;;                (with-current-buffer buffer
+;;                  (memq major-mode '(news-reply-mode gnus-article-mode)))))
 
 
 ;; Known bugs and limitations.
diff --git a/lisp/delim-col.el b/lisp/delim-col.el
index 1d4358d..cd945d8 100644
--- a/lisp/delim-col.el
+++ b/lisp/delim-col.el
@@ -1,6 +1,6 @@
 ;;; delim-col.el --- prettify all columns in a region or rectangle  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Old-Version: 2.1
diff --git a/lisp/delsel.el b/lisp/delsel.el
index e1087fb..9823203 100644
--- a/lisp/delsel.el
+++ b/lisp/delsel.el
@@ -1,6 +1,6 @@
 ;;; delsel.el --- delete selection if you insert  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1992, 1997-1998, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1992, 1997-1998, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Matthieu Devin <devin@lucid.com>
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 677db2f..85017de 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -1,6 +1,6 @@
 ;;; descr-text.el --- describe text mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1994-1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Boris Goldowsky <boris@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 7a7f1d0..fb7c6c7 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1,6 +1,6 @@
 ;;; desktop.el --- save partial status of Emacs when killed -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1993-1995, 1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1993-1995, 1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Morten Welinder <terra@diku.dk>
@@ -1222,7 +1222,13 @@ This function is a no-op when Emacs is running in batch 
mode.
 It returns t if a desktop file was loaded, nil otherwise.
 \n(fn DIRNAME)"
   (interactive "i\nP")
-  (unless noninteractive
+  (if (or noninteractive
+          (and (desktop-owner)
+               (= (desktop-owner) (emacs-pid))))
+      (message "Not reloading the desktop%s"
+               (if noninteractive
+                   ""
+                 "; already loaded"))
     (setq desktop-dirname
           (file-name-as-directory
            (expand-file-name
diff --git a/lisp/dframe.el b/lisp/dframe.el
index 417477b..09d2fe4 100644
--- a/lisp/dframe.el
+++ b/lisp/dframe.el
@@ -1,6 +1,6 @@
 ;;; dframe --- dedicate frame support modes  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: file, tags, tools
@@ -280,7 +280,7 @@ CREATE-HOOK is a hook to run after creating a frame."
 
       ;; Enable mouse tracking in emacs
       (if dframe-track-mouse-function
-         (set (make-local-variable 'track-mouse) t)) ;this could be messy.
+          (setq-local track-mouse t)) ;this could be messy.
 
       ;; Override `temp-buffer-show-hook' so that help and such
       ;; put their stuff into a frame other than our own.
@@ -290,10 +290,8 @@ CREATE-HOOK is a hook to run after creating a frame."
          ;; FIXME: Doesn't this get us into an inf-loop when the
           ;; `temp-buffer-show-function' runs `temp-buffer-show-hook'
           ;; (as is normally the case)?
-         (progn (make-local-variable 'temp-buffer-show-hook)
-                (setq temp-buffer-show-hook temp-buffer-show-function)))
-      (make-local-variable 'temp-buffer-show-function)
-      (setq temp-buffer-show-function 'dframe-temp-buffer-show-function)
+          (setq-local temp-buffer-show-hook temp-buffer-show-function))
+      (setq-local temp-buffer-show-function 'dframe-temp-buffer-show-function)
       ;; If this buffer is killed, we must make sure that we destroy
       ;; the frame the dedicated window is in.
       (add-hook 'kill-buffer-hook (lambda ()
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 2615519..5a96742 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1,6 +1,6 @@
 ;;; dired-aux.el --- less commonly used parts of dired -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1985-1986, 1992, 1994, 1998, 2000-2020 Free Software
+;; Copyright (C) 1985-1986, 1992, 1994, 1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>.
@@ -145,7 +145,7 @@ substituted, and will be passed through normally to the 
shell.
 (defun dired--no-subst-ask (char nb-occur details)
   (let ((hilit-char (propertize (string char) 'face 'warning))
         (choices `(?y ?n ?? ,@(when details '(?^)))))
-    (read-char-from-minibuffer
+    (read-char-choice
      (format-message
       (ngettext
        "%d occurrence of `%s' will not be substituted.  Proceed? (%s) "
@@ -259,7 +259,7 @@ the string of command switches used as the third argument 
of `diff'."
      (list
       (minibuffer-with-setup-hook
          (lambda ()
-           (set (make-local-variable 'minibuffer-default-add-function) nil)
+            (setq-local minibuffer-default-add-function nil)
            (setq minibuffer-default defaults))
        (read-file-name (format-prompt "Diff %s with" default current)
                        target-dir default t))
@@ -334,7 +334,7 @@ only in the active region if `dired-mark-region' is 
non-nil."
           (defaults (dired-dwim-target-defaults nil target-dir)))
       (minibuffer-with-setup-hook
          (lambda ()
-           (set (make-local-variable 'minibuffer-default-add-function) nil)
+            (setq-local minibuffer-default-add-function nil)
            (setq minibuffer-default defaults))
        (read-directory-name (format "Compare %s with: "
                                     (dired-current-directory))
@@ -1380,7 +1380,7 @@ return t; if SYM is q or ESC, return nil."
                             (format " [Type yn!q or %s] "
                                     (key-description (vector help-char)))
                           " [Type y, n, q or !] ")))
-          (set sym (setq char (read-char-from-minibuffer prompt char-choices)))
+          (set sym (setq char (read-char-choice prompt char-choices)))
           (if (memq char '(?y ?\s ?!)) t)))))
 
 
@@ -2049,7 +2049,7 @@ Optional arg HOW-TO determines how to treat the target.
         (target (expand-file-name ; fluid variable inside dired-create-files
                  (minibuffer-with-setup-hook
                      (lambda ()
-                       (set (make-local-variable 
'minibuffer-default-add-function) nil)
+                        (setq-local minibuffer-default-add-function nil)
                        (setq minibuffer-default defaults))
                    (dired-mark-read-file-name
                      (format "%s %%s %s: "
@@ -3013,14 +3013,14 @@ is part of a file name (i.e., has the text property 
`dired-filename')."
 (defun dired-isearch-filenames ()
   "Search for a string using Isearch only in file names in the Dired buffer."
   (interactive)
-  (set (make-local-variable 'dired-isearch-filenames) t)
+  (setq-local dired-isearch-filenames t)
   (isearch-forward nil t))
 
 ;;;###autoload
 (defun dired-isearch-filenames-regexp ()
   "Search for a regexp using Isearch only in file names in the Dired buffer."
   (interactive)
-  (set (make-local-variable 'dired-isearch-filenames) t)
+  (setq-local dired-isearch-filenames t)
   (isearch-forward-regexp nil t))
 
 
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 55077e7..5a52ecc 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -1,6 +1,6 @@
 ;;; dired-x.el --- extra Dired functionality  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1993-1994, 1997, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1993-1994, 1997, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
@@ -636,7 +636,7 @@ you can relist single subdirs using \\[dired-do-redisplay]."
   (dired-mode dirname (or switches dired-listing-switches))
   (setq mode-name "Virtual Dired"
         revert-buffer-function 'dired-virtual-revert)
-  (set (make-local-variable 'dired-subdir-alist) nil)
+  (setq-local dired-subdir-alist nil)
   (dired-build-subdir-alist)
   (goto-char (point-min))
   (dired-initial-position dirname))
@@ -1226,7 +1226,7 @@ Otherwise obeys the value of 
`dired-vm-read-only-folders'."
                              (and dired-vm-read-only-folders
                                   (not (file-writable-p fil)))))
     ;; So that pressing `v' inside VM does prompt within current directory:
-    (set (make-local-variable 'vm-folder-directory) dir)))
+    (setq-local vm-folder-directory dir)))
 
 (defun dired-rmail ()
   "Run RMAIL on this file."
diff --git a/lisp/dired.el b/lisp/dired.el
index 30b9f5b..3f11936 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1,6 +1,6 @@
 ;;; dired.el --- directory-browsing commands -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1992-1997, 2000-2020 Free Software
+;; Copyright (C) 1985-1986, 1992-1997, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
@@ -2419,6 +2419,10 @@ If the current buffer can be edited with Wdired, (i.e. 
the major
 mode is `dired-mode'), call `wdired-change-to-wdired-mode'.
 Otherwise, toggle `read-only-mode'."
   (interactive)
+  (when (and (not (file-writable-p default-directory))
+             (not (y-or-n-p
+                   "Directory isn't writable; edit anyway? ")))
+    (user-error "Directory %s isn't writable" default-directory))
   (if (derived-mode-p 'dired-mode)
       (wdired-change-to-wdired-mode)
     (read-only-mode 'toggle)))
@@ -2499,6 +2503,10 @@ directory in another window."
 (defun dired-find-file ()
   "In Dired, visit the file or directory named on this line."
   (interactive)
+  (dired--find-file #'find-file (dired-get-file-for-visit)))
+
+(defun dired--find-file (find-file-function file)
+  "Call FIND-FILE-FUNCTION on FILE, but bind some relevant variables."
   ;; Bind `find-file-run-dired' so that the command works on directories
   ;; too, independent of the user's setting.
   (let ((find-file-run-dired t)
@@ -2511,7 +2519,7 @@ directory in another window."
          (if dired-auto-revert-buffer
              nil
            switch-to-buffer-preserve-window-point)))
-    (find-file (dired-get-file-for-visit))))
+    (funcall find-file-function file)))
 
 (defun dired-find-alternate-file ()
   "In Dired, visit file or directory on current line via `find-alternate-file'.
@@ -2547,7 +2555,7 @@ respectively."
              (select-window window)
               (funcall find-dir-func file)))
       (select-window window)
-      (funcall find-file-func (file-name-sans-versions file t)))))
+      (dired--find-file find-file-func (file-name-sans-versions file t)))))
 
 (defun dired-mouse-find-file-other-window (event)
   "In Dired, visit the file or directory name you click on in another window."
@@ -2574,7 +2582,7 @@ Otherwise, display it in another buffer."
 (defun dired-find-file-other-window ()
   "In Dired, visit this file or directory in another window."
   (interactive)
-  (find-file-other-window (dired-get-file-for-visit)))
+  (dired--find-file #'find-file-other-window (dired-get-file-for-visit)))
 
 (defun dired-display-file ()
   "In Dired, display this file or directory in another window."
diff --git a/lisp/dirtrack.el b/lisp/dirtrack.el
index ad0c18d..795f1dd 100644
--- a/lisp/dirtrack.el
+++ b/lisp/dirtrack.el
@@ -1,6 +1,6 @@
 ;;; dirtrack.el --- Directory Tracking by watching the prompt
 
-;; Copyright (C) 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Sun Nov 17 1996
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index 70343a3..6de14b1 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -1,6 +1,6 @@
 ;;; disp-table.el --- functions for dealing with char tables
 
-;; Copyright (C) 1987, 1994-1995, 1999, 2001-2020 Free Software
+;; Copyright (C) 1987, 1994-1995, 1999, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Erik Naggum <erik@naggum.no>
diff --git a/lisp/display-fill-column-indicator.el 
b/lisp/display-fill-column-indicator.el
index 5fd9f07..50252af 100644
--- a/lisp/display-fill-column-indicator.el
+++ b/lisp/display-fill-column-indicator.el
@@ -1,6 +1,6 @@
 ;;; display-fill-column-indicator.el --- interface for 
display-fill-column-indicator -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: convenience
diff --git a/lisp/display-line-numbers.el b/lisp/display-line-numbers.el
index 022ed12..a6fa813 100644
--- a/lisp/display-line-numbers.el
+++ b/lisp/display-line-numbers.el
@@ -1,6 +1,6 @@
 ;;; display-line-numbers.el --- interface for display-line-numbers -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: convenience
diff --git a/lisp/dnd.el b/lisp/dnd.el
index 815a4af..7319a27 100644
--- a/lisp/dnd.el
+++ b/lisp/dnd.el
@@ -1,6 +1,6 @@
 ;;; dnd.el --- drag and drop support  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Jan Djärv <jan.h.d@swipnet.se>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 9997c1a..f6fcfae 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -1,6 +1,6 @@
 ;;; doc-view.el --- Document viewer for Emacs -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Tassilo Horn <tsdh@gnu.org>
 ;; Keywords: files, pdf, ps, dvi
@@ -432,6 +432,7 @@ Typically \"page-%s.png\".")
     (define-key map "P"               'doc-view-fit-page-to-window)
     (define-key map "F"               'doc-view-fit-window-to-page) ;F = frame
     ;; Killing the buffer (and the process)
+    (define-key map (kbd "k")         'image-kill-buffer)
     (define-key map (kbd "K")         'doc-view-kill-proc)
     ;; Slicing the image
     (define-key map (kbd "c s")       'doc-view-set-slice)
@@ -2055,7 +2056,7 @@ See the command `doc-view-mode' for more information on 
this mode."
   :init-value nil :keymap doc-view-presentation-mode-map
   (if doc-view-presentation-mode
       (progn
-        (set (make-local-variable 'mode-line-format) nil)
+        (setq-local mode-line-format nil)
         (doc-view-fit-page-to-window)
         ;; (doc-view-convert-all-pages)
         )
diff --git a/lisp/dom.el b/lisp/dom.el
index bf4a56a..71793c0 100644
--- a/lisp/dom.el
+++ b/lisp/dom.el
@@ -1,6 +1,6 @@
 ;;; dom.el --- XML/HTML (etc.) DOM manipulation and searching functions -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: xml, html
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el
index d96599d..5d4aa78 100644
--- a/lisp/dos-fns.el
+++ b/lisp/dos-fns.el
@@ -1,6 +1,6 @@
 ;;; dos-fns.el --- MS-Dos specific functions
 
-;; Copyright (C) 1991, 1993, 1995-1996, 2001-2020 Free Software
+;; Copyright (C) 1991, 1993, 1995-1996, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/dos-vars.el b/lisp/dos-vars.el
index 47d1f83..2f7b376 100644
--- a/lisp/dos-vars.el
+++ b/lisp/dos-vars.el
@@ -1,6 +1,6 @@
 ;;; dos-vars.el --- MS-Dos specific user options  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
diff --git a/lisp/dos-w32.el b/lisp/dos-w32.el
index 8c2cad6..e902491 100644
--- a/lisp/dos-w32.el
+++ b/lisp/dos-w32.el
@@ -1,6 +1,6 @@
 ;; dos-w32.el --- Functions shared among MS-DOS and W32 (NT/95) platforms
 
-;; Copyright (C) 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: Geoff Voelker <voelker@cs.washington.edu>
 ;; Keywords: internal
diff --git a/lisp/double.el b/lisp/double.el
index 8e50900..8bbbaa5 100644
--- a/lisp/double.el
+++ b/lisp/double.el
@@ -1,6 +1,6 @@
 ;;; double.el --- support for keyboard remapping with double clicking
 
-;; Copyright (C) 1994, 1997-1998, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1994, 1997-1998, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
diff --git a/lisp/dynamic-setting.el b/lisp/dynamic-setting.el
index ce7e9fc..d6952ed 100644
--- a/lisp/dynamic-setting.el
+++ b/lisp/dynamic-setting.el
@@ -1,6 +1,6 @@
 ;;; dynamic-setting.el --- Support dynamic changes
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Jan Djärv <jan.h.d@swipnet.se>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el
index 079fce8..fb73b2d 100644
--- a/lisp/ebuff-menu.el
+++ b/lisp/ebuff-menu.el
@@ -1,6 +1,6 @@
 ;;; ebuff-menu.el --- electric-buffer-list mode
 
-;; Copyright (C) 1985-1986, 1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1985-1986, 1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Richard Mlynarik <mly@ai.mit.edu>
@@ -202,8 +202,7 @@ Electric Buffer Menu mode is a minor mode which is 
automatically
 enabled and disabled by the \\[electric-buffer-list] command.
 See the documentation of `electric-buffer-list' for details."
   (setq mode-line-buffer-identification "Electric Buffer List")
-  (set (make-local-variable 'Helper-return-blurb)
-       "return to buffer editing"))
+  (setq-local Helper-return-blurb "return to buffer editing"))
 
 (define-obsolete-function-alias 'Electric-buffer-menu-mode
   'electric-buffer-menu-mode "24.3")
@@ -270,8 +269,8 @@ Return to Electric Buffer Menu when done."
   (when (derived-mode-p 'electric-buffer-menu-mode)
     ;; Make sure we have an overlay to use.
     (or electric-buffer-overlay
-       (set (make-local-variable 'electric-buffer-overlay)
-            (make-overlay (point) (point))))
+        (setq-local electric-buffer-overlay
+                    (make-overlay (point) (point))))
     (move-overlay electric-buffer-overlay
                  (line-beginning-position)
                  (line-end-position))
diff --git a/lisp/echistory.el b/lisp/echistory.el
index e311ee1..8f787e7 100644
--- a/lisp/echistory.el
+++ b/lisp/echistory.el
@@ -1,6 +1,6 @@
 ;;; echistory.el --- Electric Command History Mode
 
-;; Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: K. Shane Hartman
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/ecomplete.el b/lisp/ecomplete.el
index 831491c..105edc4 100644
--- a/lisp/ecomplete.el
+++ b/lisp/ecomplete.el
@@ -1,6 +1,6 @@
 ;;; ecomplete.el --- electric completion of addresses and the like  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: mail
diff --git a/lisp/edmacro.el b/lisp/edmacro.el
index 44cf5aa..3d7db44 100644
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -1,6 +1,6 @@
 ;;; edmacro.el --- keyboard macro editor
 
-;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Keywords: abbrev
@@ -151,9 +151,9 @@ With a prefix argument, format the macro in a more concise 
way."
        (setq buffer-read-only nil)
        (setq major-mode 'edmacro-mode)
        (setq mode-name "Edit Macro")
-       (set (make-local-variable 'edmacro-original-buffer) oldbuf)
-       (set (make-local-variable 'edmacro-finish-hook) finish-hook)
-       (set (make-local-variable 'edmacro-store-hook) store-hook)
+        (setq-local edmacro-original-buffer oldbuf)
+        (setq-local edmacro-finish-hook finish-hook)
+        (setq-local edmacro-store-hook store-hook)
        (erase-buffer)
        (insert ";; Keyboard Macro Editor.  Press C-c C-c to finish; "
                "press C-x k RET to cancel.\n")
diff --git a/lisp/ehelp.el b/lisp/ehelp.el
index 7da9aed..996b7db 100644
--- a/lisp/ehelp.el
+++ b/lisp/ehelp.el
@@ -1,6 +1,6 @@
 ;;; ehelp.el --- bindings for electric-help mode -*- lexical-binding: t -*-
 
-;; Copyright (C) 1986, 1995, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1986, 1995, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Richard Mlynarik
 ;; (according to ack.texi and authors.el)
diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el
index 6c47bea..d8c377a 100644
--- a/lisp/elec-pair.el
+++ b/lisp/elec-pair.el
@@ -1,6 +1,6 @@
 ;;; elec-pair.el --- Automatic parenthesis pairing  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: João Távora <joaotavora@gmail.com>
 
diff --git a/lisp/electric.el b/lisp/electric.el
index 50ddf52..506e9aa 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -1,6 +1,6 @@
 ;;; electric.el --- window maker and Command loop for `electric' modes
 
-;; Copyright (C) 1985-1986, 1995, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1985-1986, 1995, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: K. Shane Hartman
diff --git a/lisp/elide-head.el b/lisp/elide-head.el
index a892754..c0857e3 100644
--- a/lisp/elide-head.el
+++ b/lisp/elide-head.el
@@ -1,6 +1,6 @@
 ;;; elide-head.el --- hide headers in files  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: outlines tools
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index c8a6676..b9a3a32 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -1,6 +1,6 @@
 ;;; advice.el --- An overloading mechanism for Emacs Lisp functions  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1993-1994, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Hans Chalupsky <hans@cs.buffalo.edu>
 ;; Maintainer: emacs-devel@gnu.org
@@ -2405,8 +2405,9 @@ as if they had been supplied to a function with 
TARGET-ARGLIST directly.
 Excess source arguments will be neglected, missing source arguments will be
 supplied as nil.  Returns a `funcall' or `apply' form with the second element
 being `function' which has to be replaced by an actual function argument.
-Example: (ad-map-arglists \\='(a &rest args) \\='(w x y z)) will return
-         (funcall ad--addoit-function a (car args) (car (cdr args)) (nth 2 
args))."
+Example:
+   (ad-map-arglists \\='(a &rest args) \\='(w x y z)) will return
+   (funcall ad--addoit-function a (car args) (car (cdr args)) (nth 2 args))."
   (let* ((parsed-source-arglist (ad-parse-arglist source-arglist))
         (source-reqopt-args (append (nth 0 parsed-source-arglist)
                                     (nth 1 parsed-source-arglist)))
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 07bda53..1786b5c 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -1,6 +1,6 @@
 ;;; autoload.el --- maintain autoloads in loaddefs.el  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1991-1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991-1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Roland McGrath <roland@gnu.org>
 ;; Keywords: maint
@@ -368,7 +368,8 @@ FILE's name."
   (let ((basename (file-name-nondirectory file))
        (lp (if (equal type "package") (setq type "autoloads"))))
     (concat ";;; " basename
-           " --- automatically extracted " (or type "autoloads") "\n"
+            " --- automatically extracted " (or type "autoloads")
+            "  -*- lexical-binding: t -*-\n"
            ";;\n"
            ";;; Code:\n\n"
            (if lp
diff --git a/lisp/emacs-lisp/avl-tree.el b/lisp/emacs-lisp/avl-tree.el
index 3657c42..75c7322 100644
--- a/lisp/emacs-lisp/avl-tree.el
+++ b/lisp/emacs-lisp/avl-tree.el
@@ -1,6 +1,6 @@
 ;;; avl-tree.el --- balanced binary trees, AVL-trees  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1995, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Per Cederqvist <ceder@lysator.liu.se>
 ;;         Inge Wallin <inge@lysator.liu.se>
diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el
index 5413022..173c116 100644
--- a/lisp/emacs-lisp/backquote.el
+++ b/lisp/emacs-lisp/backquote.el
@@ -1,6 +1,6 @@
 ;;; backquote.el --- implement the ` Lisp construct  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1990, 1992, 1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1990, 1992, 1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Rick Sladkey <jrs@world.std.com>
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index 5874ba7..3e1c329 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -1,6 +1,6 @@
 ;;; backtrace.el --- generic major mode for Elisp backtraces -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Gemini Lasswell
 ;; Keywords: lisp, tools, maint
diff --git a/lisp/emacs-lisp/benchmark.el b/lisp/emacs-lisp/benchmark.el
index 8cf1f54..14bc281 100644
--- a/lisp/emacs-lisp/benchmark.el
+++ b/lisp/emacs-lisp/benchmark.el
@@ -1,6 +1,6 @@
 ;;; benchmark.el --- support for benchmarking code  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: lisp, extensions
diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el
index 0fd273a..5f432b8 100644
--- a/lisp/emacs-lisp/bindat.el
+++ b/lisp/emacs-lisp/bindat.el
@@ -1,6 +1,6 @@
 ;;; bindat.el --- binary data structure packing and unpacking.
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Kim F. Storm <storm@cua.dk>
 ;; Assignment name: struct.el
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 469bbe6..cf89456 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1,6 +1,6 @@
 ;;; byte-opt.el --- the optimization passes of the emacs-lisp byte compiler 
-*- lexical-binding: t -*-
 
-;; Copyright (C) 1991, 1994, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1994, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Jamie Zawinski <jwz@lucid.com>
 ;;     Hallvard Furuseth <hbf@ulrik.uio.no>
@@ -1169,7 +1169,9 @@
         hash-table-count
         int-to-string intern-soft isnan
         keymap-parent
-         lax-plist-get ldexp length line-beginning-position line-end-position
+         lax-plist-get ldexp
+         length length< length> length=
+         line-beginning-position line-end-position
         local-variable-if-set-p local-variable-p locale-info
         log log10 logand logb logcount logior lognot logxor lsh
         make-byte-code make-list make-string make-symbol marker-buffer max
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 27f54d0..8334c09 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -1,6 +1,6 @@
 ;;; byte-run.el --- byte-compiler support for inlining  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1992, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Jamie Zawinski <jwz@lucid.com>
 ;;     Hallvard Furuseth <hbf@ulrik.uio.no>
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 0acd527..7645781 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1,6 +1,6 @@
 ;;; bytecomp.el --- compilation of Lisp code into byte code -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1985-1987, 1992, 1994, 1998, 2000-2020 Free Software
+;; Copyright (C) 1985-1987, 1992, 1994, 1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Jamie Zawinski <jwz@lucid.com>
@@ -144,7 +144,7 @@ is hard-coded in various places in Emacs.)"
   ;; Eg is_elc in Fload.
   :type 'regexp)
 
-(defcustom byte-compile-dest-file-function nil
+(defcustom byte-compile-dest-file-function #'byte-compile--default-dest-file
   "Function for the function `byte-compile-dest-file' to call.
 It should take one argument, the name of an Emacs Lisp source
 file name, and return the name of the compiled file.
@@ -177,14 +177,16 @@ function to do the work.  Otherwise, if FILENAME matches
 `emacs-lisp-file-regexp' (by default, files with the extension \".el\"),
 replaces the matching part (and anything after it) with \".elc\";
 otherwise adds \".elc\"."
-  (if byte-compile-dest-file-function
-      (funcall byte-compile-dest-file-function filename)
-    (setq filename (file-name-sans-versions
-                   (byte-compiler-base-file-name filename)))
-    (cond ((string-match emacs-lisp-file-regexp filename)
-          (concat (substring filename 0 (match-beginning 0)) ".elc"))
-         (t (concat filename ".elc")))))
-)
+  (funcall (or byte-compile-dest-file-function
+               #'byte-compile--default-dest-file)
+           filename)))
+
+(defun byte-compile--default-dest-file (filename)
+  (setq filename (file-name-sans-versions
+                 (byte-compiler-base-file-name filename)))
+  (cond ((string-match emacs-lisp-file-regexp filename)
+        (concat (substring filename 0 (match-beginning 0)) ".elc"))
+       (t (concat filename ".elc"))))
 
 ;; This can be the 'byte-compile property of any symbol.
 (autoload 'byte-compile-inline-expand "byte-opt")
@@ -297,7 +299,8 @@ The information is logged to `byte-compile-log-buffer'."
 (defconst byte-compile-warning-types
   '(redefine callargs free-vars unresolved
              obsolete noruntime interactive-only
-            make-local mapcar constants suspicious lexical lexical-dynamic)
+             make-local mapcar constants suspicious lexical lexical-dynamic
+             docstrings)
   "The list of warning types used when `byte-compile-warnings' is t.")
 (defcustom byte-compile-warnings t
   "List of warnings that the byte-compiler should issue (t for all).
@@ -320,6 +323,8 @@ Elements of the list may be:
   make-local  calls to make-variable-buffer-local that may be incorrect.
   mapcar      mapcar called for effect.
   constants   let-binding of, or assignment to, constants/nonvariables.
+  docstrings  docstrings that are too wide (longer than 80 characters,
+              or `fill-column', whichever is bigger)
   suspicious  constructs that usually don't do what the coder wanted.
 
 If the list begins with `not', then the remaining elements specify warnings to
@@ -705,7 +710,8 @@ Each element is (INDEX . VALUE)")
 
 ;; These store their argument in the next two bytes
 (byte-defop 129  1 byte-constant2
-   "for reference to a constant with vector index >= byte-constant-limit")
+   "for reference to a constant with vector
+index >= byte-constant-limit")
 (byte-defop 130  0 byte-goto "for unconditional jump")
 (byte-defop 131 -1 byte-goto-if-nil "to pop value and jump if it's nil")
 (byte-defop 132 -1 byte-goto-if-not-nil "to pop value and jump if it's not 
nil")
@@ -725,11 +731,14 @@ otherwise pop it")
 (byte-defop 139  0 byte-save-window-excursion-OBSOLETE
   "to make a binding to record entire window configuration")
 (byte-defop 140  0 byte-save-restriction
-  "to make a binding to record the current buffer clipping restrictions")
+  "to make a binding to record the current buffer clipping
+restrictions")
 (byte-defop 141 -1 byte-catch-OBSOLETE   ; Not generated since Emacs 25.
-  "for catch.  Takes, on stack, the tag and an expression for the body")
+  "for catch.  Takes, on stack, the tag and an expression for
+the body")
 (byte-defop 142 -1 byte-unwind-protect
-  "for unwind-protect.  Takes, on stack, an expression for the unwind-action")
+  "for unwind-protect.  Takes, on stack, an expression for
+the unwind-action")
 
 ;; For condition-case.  Takes, on stack, the variable to bind,
 ;; an expression for the body, and a list of clauses.
@@ -789,8 +798,8 @@ otherwise pop it")
 (defconst byte-discardN-preserve-tos byte-discardN)
 
 (byte-defop 183 -2 byte-switch
- "to take a hash table and a value from the stack, and jump to the address
-the value maps to, if any.")
+ "to take a hash table and a value from the stack, and jump to
+the address the value maps to, if any.")
 
 ;; unused: 182-191
 
@@ -1557,6 +1566,81 @@ extra args."
            (if (equal sig1 '(1 . 1)) "argument" "arguments")
            (byte-compile-arglist-signature-string sig2)))))))
 
+(defvar byte-compile--wide-docstring-substitution-len 3
+  "Substitution width used in `byte-compile--wide-docstring-p'.
+This is a heuristic for guessing the width of a documentation
+string: `byte-compile--wide-docstring-p' assumes that any
+`substitute-command-keys' command substitutions are this long.")
+
+(defun byte-compile--wide-docstring-p (docstring col)
+  "Return t if string DOCSTRING is wider than COL.
+Ignore all `substitute-command-keys' substitutions, except for
+the `\\\\=[command]' ones that are assumed to be of length
+`byte-compile--wide-docstring-substitution-len'.  Also ignore
+URLs."
+  (string-match
+   (format "^.\\{%s,\\}$" (int-to-string (1+ col)))
+   (replace-regexp-in-string
+    (rx (or
+         ;; Ignore some URLs.
+         (seq "http" (? "s") "://" (* anychar))
+         ;; Ignore these `substitute-command-keys' substitutions.
+         (seq "\\" (or "="
+                       (seq "<" (* (not ">")) ">")
+                       (seq "{" (* (not "}")) "}")))))
+    ""
+    ;; Heuristic: assume these substitutions are of some length N.
+    (replace-regexp-in-string
+     (rx "\\" (or (seq "[" (* (not "]")) "]")))
+     (make-string byte-compile--wide-docstring-substitution-len ?x)
+     docstring))))
+
+(defcustom byte-compile-docstring-max-column 80
+  "Recommended maximum width of doc string lines.
+The byte-compiler will emit a warning for documentation strings
+containing lines wider than this.  If `fill-column' has a larger
+value, it will override this variable."
+  :group 'bytecomp
+  :type 'integer
+  :safe #'integerp
+  :version "28.1")
+
+(defun byte-compile-docstring-length-warn (form)
+  "Warn if documentation string of FORM is too wide.
+It is too wide if it has any lines longer than the largest of
+`fill-column' and `byte-compile-docstring-max-column'."
+  ;; This has some limitations that it would be nice to fix:
+  ;; 1. We don't try to handle defuns.  It is somewhat tricky to get
+  ;;    it right since `defun' is a macro.  Also, some macros
+  ;;    themselves produce defuns (e.g. `define-derived-mode').
+  ;; 2. We assume that any `subsititute-command-keys' command replacement has a
+  ;;    given length.  We can't reliably do these replacements, since the value
+  ;;    of the keymaps in general can't be known at compile time.
+  (when (byte-compile-warning-enabled-p 'docstrings)
+    (let ((col (max byte-compile-docstring-max-column fill-column))
+          kind name docs)
+      (pcase (car form)
+        ((or 'autoload 'custom-declare-variable 'defalias
+             'defconst 'define-abbrev-table
+             'defvar 'defvaralias)
+         (setq kind (nth 0 form))
+         (setq name (nth 1 form))
+         (setq docs (nth 3 form)))
+        ;; Here is how one could add lambda's here:
+        ;; ('lambda
+        ;;   (setq kind "")   ; can't be "function", unfortunately
+        ;;   (setq docs (and (stringp (nth 2 form))
+        ;;                   (nth 2 form))))
+        )
+      (when (and (consp name) (eq (car name) 'quote))
+        (setq name (cadr name)))
+      (setq name (if name (format " `%s'" name) ""))
+      (when (and kind docs (stringp docs)
+                 (byte-compile--wide-docstring-p docs col))
+        (byte-compile-warn "%s%s docstring wider than %s characters"
+                           kind name col))))
+  form)
+
 (defun byte-compile-print-syms (str1 strn syms)
   (when syms
     (byte-compile-set-symbol-position (car syms) t))
@@ -1809,24 +1893,23 @@ If compilation is needed, this functions returns the 
result of
   (let ((dest (byte-compile-dest-file filename))
         ;; Expand now so we get the current buffer's defaults
         (filename (expand-file-name filename)))
-    (if (if (file-exists-p dest)
-            ;; File was already compiled
-            ;; Compile if forced to, or filename newer
-            (or force
-                (file-newer-than-file-p filename dest))
-          (and arg
-               (or (eq 0 arg)
-                   (y-or-n-p (concat "Compile "
-                                     filename "? ")))))
-        (progn
-          (if (and noninteractive (not byte-compile-verbose))
-              (message "Compiling %s..." filename))
-          (byte-compile-file filename)
-          (when load
-            (load (if (file-exists-p dest) dest filename))))
+    (prog1
+        (if (if (and dest (file-exists-p dest))
+                ;; File was already compiled
+                ;; Compile if forced to, or filename newer
+                (or force
+                    (file-newer-than-file-p filename dest))
+              (and arg
+                   (or (eq 0 arg)
+                       (y-or-n-p (concat "Compile "
+                                         filename "? ")))))
+            (progn
+              (if (and noninteractive (not byte-compile-verbose))
+                  (message "Compiling %s..." filename))
+              (byte-compile-file filename))
+         'no-byte-compile)
       (when load
-       (load (if (file-exists-p dest) dest filename)))
-      'no-byte-compile)))
+        (load (if (and dest (file-exists-p dest)) dest filename))))))
 
 (defun byte-compile--load-dynvars (file)
   (and file (not (equal file ""))
@@ -1936,7 +2019,7 @@ See also `emacs-lisp-byte-compile-and-load'."
          ;; (message "%s not compiled because of `no-byte-compile: %s'"
          ;;       (byte-compile-abbreviate-file filename)
          ;;       (with-current-buffer input-buffer no-byte-compile))
-         (when (file-exists-p target-file)
+         (when (and target-file (file-exists-p target-file))
            (message "%s deleted because of `no-byte-compile: %s'"
                     (byte-compile-abbreviate-file target-file)
                     (buffer-local-value 'no-byte-compile input-buffer))
@@ -1960,36 +2043,54 @@ See also `emacs-lisp-byte-compile-and-load'."
        (with-current-buffer output-buffer
          (goto-char (point-max))
          (insert "\n")                 ; aaah, unix.
-         (if (file-writable-p target-file)
-             ;; We must disable any code conversion here.
-             (progn
-               (let* ((coding-system-for-write 'no-conversion)
-                      ;; Write to a tempfile so that if another Emacs
-                      ;; process is trying to load target-file (eg in a
-                      ;; parallel bootstrap), it does not risk getting a
-                      ;; half-finished file.  (Bug#4196)
-                      (tempfile
-                       (make-temp-file (expand-file-name target-file)))
-                      (default-modes (default-file-modes))
-                      (temp-modes (logand default-modes #o600))
-                      (desired-modes (logand default-modes #o666))
-                      (kill-emacs-hook
-                       (cons (lambda () (ignore-errors
-                                          (delete-file tempfile)))
-                             kill-emacs-hook)))
-                 (unless (= temp-modes desired-modes)
-                   (set-file-modes tempfile desired-modes 'nofollow))
-                 (write-region (point-min) (point-max) tempfile nil 1)
-                 ;; This has the intentional side effect that any
-                 ;; hard-links to target-file continue to
-                 ;; point to the old file (this makes it possible
-                 ;; for installed files to share disk space with
-                 ;; the build tree, without causing problems when
-                 ;; emacs-lisp files in the build tree are
-                 ;; recompiled).  Previously this was accomplished by
-                 ;; deleting target-file before writing it.
-                 (rename-file tempfile target-file t))
-               (or noninteractive (message "Wrote %s" target-file)))
+         (cond
+          ((null target-file) nil)     ;We only wanted the warnings!
+          ((and (file-writable-p target-file)
+                 ;; We attempt to create a temporary file in the
+                 ;; target directory, so the target directory must be
+                 ;; writable.
+                 (file-writable-p
+                  (file-name-directory
+                   ;; Need to expand in case TARGET-FILE doesn't
+                   ;; include a directory (Bug#45287).
+                   (expand-file-name target-file))))
+           ;; We must disable any code conversion here.
+           (let* ((coding-system-for-write 'no-conversion)
+                  ;; Write to a tempfile so that if another Emacs
+                  ;; process is trying to load target-file (eg in a
+                  ;; parallel bootstrap), it does not risk getting a
+                  ;; half-finished file.  (Bug#4196)
+                  (tempfile
+                   (make-temp-file (expand-file-name target-file)))
+                  (default-modes (default-file-modes))
+                  (temp-modes (logand default-modes #o600))
+                  (desired-modes (logand default-modes #o666))
+                  (kill-emacs-hook
+                   (cons (lambda () (ignore-errors
+                                 (delete-file tempfile)))
+                         kill-emacs-hook)))
+             (unless (= temp-modes desired-modes)
+               (set-file-modes tempfile desired-modes 'nofollow))
+             (write-region (point-min) (point-max) tempfile nil 1)
+             ;; This has the intentional side effect that any
+             ;; hard-links to target-file continue to
+             ;; point to the old file (this makes it possible
+             ;; for installed files to share disk space with
+             ;; the build tree, without causing problems when
+             ;; emacs-lisp files in the build tree are
+             ;; recompiled).  Previously this was accomplished by
+             ;; deleting target-file before writing it.
+             (rename-file tempfile target-file t))
+           (or noninteractive (message "Wrote %s" target-file)))
+           ((file-writable-p target-file)
+            ;; In case the target directory isn't writable (see e.g. 
Bug#44631),
+            ;; try writing to the output file directly.  We must disable any
+            ;; code conversion here.
+            (let ((coding-system-for-write 'no-conversion))
+              (with-file-modes (logand (default-file-modes) #o666)
+                (write-region (point-min) (point-max) target-file nil 1)))
+            (or noninteractive (message "Wrote %s" target-file)))
+          (t
            ;; This is just to give a better error message than write-region
            (let ((exists (file-exists-p target-file)))
              (signal (if exists 'file-error 'file-missing)
@@ -1997,7 +2098,7 @@ See also `emacs-lisp-byte-compile-and-load'."
                            (if exists
                                "Cannot overwrite file"
                              "Directory not writable or nonexistent")
-                           target-file))))
+                           target-file)))))
          (kill-buffer (current-buffer)))
        (if (and byte-compile-generate-call-tree
                 (or (eq t byte-compile-generate-call-tree)
@@ -2387,7 +2488,8 @@ list that represents a doc string reference.
              (delq (assq funsym byte-compile-unresolved-functions)
                    byte-compile-unresolved-functions)))))
   (if (stringp (nth 3 form))
-      form
+      (prog1 form
+        (byte-compile-docstring-length-warn form))
     ;; No doc string, so we can compile this as a normal form.
     (byte-compile-keep-pending form 'byte-compile-normal-call)))
 
@@ -2415,6 +2517,7 @@ list that represents a doc string reference.
   (if (and (null (cddr form))          ;No `value' provided.
            (eq (car form) 'defvar))     ;Just a declaration.
       nil
+    (byte-compile-docstring-length-warn form)
     (cond ((consp (nth 2 form))
            (setq form (copy-sequence form))
            (setcar (cdr (cdr form))
@@ -2438,6 +2541,7 @@ list that represents a doc string reference.
        (if (byte-compile-warning-enabled-p 'suspicious)
            (byte-compile-warn
             "Alias for `%S' should be declared before its referent" 
newname)))))
+  (byte-compile-docstring-length-warn form)
   (byte-compile-keep-pending form))
 
 (put 'custom-declare-variable 'byte-hunk-handler
@@ -2821,6 +2925,7 @@ for symbols generated by the byte compiler itself."
     (unless (eq 'lambda (car-safe fun))
       (error "Not a lambda list: %S" fun))
     (byte-compile-set-symbol-position 'lambda))
+  (byte-compile-docstring-length-warn fun)
   (byte-compile-check-lambda-list (nth 1 fun))
   (let* ((arglist (nth 1 fun))
          (arglistvars (byte-compile-arglist-vars arglist))
@@ -4601,6 +4706,7 @@ binding slots have been popped."
              (byte-compile-warning-enabled-p 'lexical (nth 1 form)))
     (byte-compile-warn "global/dynamic var `%s' lacks a prefix"
                        (nth 1 form)))
+  (byte-compile-docstring-length-warn form)
   (let ((fun (nth 0 form))
        (var (nth 1 form))
        (value (nth 2 form))
@@ -4675,6 +4781,7 @@ binding slots have been popped."
       ;; - `arg' is the expression to which it is defined.
       ;; - `rest' is the rest of the arguments.
       (`(,_ ',name ,arg . ,rest)
+       (byte-compile-docstring-length-warn form)
        (pcase-let*
            ;; `macro' is non-nil if it defines a macro.
            ;; `fun' is the function part of `arg' (defaults to `arg').
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index 351a097..e795839 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -1,6 +1,6 @@
 ;;; cconv.el --- Closure conversion for statically scoped Emacs lisp. -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Igor Kuzmin <kzuminig@iro.umontreal.ca>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el
index c1c6e3b..2cd7322 100644
--- a/lisp/emacs-lisp/chart.el
+++ b/lisp/emacs-lisp/chart.el
@@ -1,6 +1,6 @@
 ;;; chart.el --- Draw charts (bar charts, etc)  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1996, 1998-1999, 2001, 2004-2005, 2007-2020 Free
+;; Copyright (C) 1996, 1998-1999, 2001, 2004-2005, 2007-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
@@ -333,7 +333,8 @@ Automatically compensates for direction."
 (cl-defmethod chart-axis-draw ((a chart-axis-names) &optional dir margin zone 
_start _end)
   "Draw axis information based upon A range to be spread along the edge.
 Optional argument DIR is the direction of the chart.
-Optional arguments MARGIN, ZONE, START and END specify boundaries of the 
drawing."
+Optional arguments MARGIN, ZONE, START and END specify boundaries
+of the drawing."
   (cl-call-next-method)
   ;; We prefer about 5 spaces between each value
   (let* ((i 0)
diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
index 208214f..7c2b23b 100644
--- a/lisp/emacs-lisp/check-declare.el
+++ b/lisp/emacs-lisp/check-declare.el
@@ -1,6 +1,6 @@
 ;;; check-declare.el --- Check declare-function statements  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Glenn Morris <rgm@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 61384c0..2e204ff 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1,6 +1,6 @@
 ;;; checkdoc.el --- check documentation strings for style requirements  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Old-Version: 0.6.2
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index a55d78d..28ce6b1 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -1,6 +1,6 @@
 ;;; cl-extra.el --- Common Lisp features, part 2  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1993, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Keywords: extensions
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 02da07d..19dd54c 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -1,6 +1,6 @@
 ;;; cl-generic.el --- CLOS-style generic functions for Elisp  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Version: 1.0
@@ -410,8 +410,18 @@ the specializer used will be the one returned by BODY."
 ;;;###autoload
 (defmacro cl-defmethod (name args &rest body)
   "Define a new method for generic function NAME.
-I.e. it defines the implementation of NAME to use for invocations where the
-values of the dispatch arguments match the specified TYPEs.
+This it defines an implementation of NAME to use for invocations
+of specific types of arguments.
+
+ARGS is a list of dispatch arguments (see `cl-defun'), but where
+each variable element is either just a single variable name VAR,
+or a list on the form (VAR TYPE).
+
+For instance:
+
+  (cl-defmethod foo (bar (format-string string) &optional zot)
+    (format format-string bar))
+
 The dispatch arguments have to be among the mandatory arguments, and
 all methods of NAME have to use the same set of arguments for dispatch.
 Each dispatch argument and TYPE are specified in ARGS where the corresponding
@@ -801,8 +811,8 @@ It should return a function that expects the same arguments 
as the methods, and
 GENERIC is the generic function (mostly used for its name).
 METHODS is the list of the selected methods.
 The METHODS list is sorted from most specific first to most generic last.
-The function can use `cl-generic-call-method' to create functions that call 
those
-methods.")
+The function can use `cl-generic-call-method' to create functions that call
+those methods.")
 
 (unless (ignore-errors (cl-generic-generalizers t))
   ;; Temporary definition to let the next defmethod succeed.
diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el
index 66502da..7d0bfc8 100644
--- a/lisp/emacs-lisp/cl-indent.el
+++ b/lisp/emacs-lisp/cl-indent.el
@@ -1,6 +1,6 @@
 ;;; cl-indent.el --- Enhanced lisp-indent mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1987, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1987, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Richard Mlynarik <mly@eddie.mit.edu>
 ;; Created: July 1987
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index 86ee94e..3bf3fd2 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -1,6 +1,6 @@
 ;;; cl-lib.el --- Common Lisp extensions for Emacs  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Version: 1.0
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 14b65ef..1cb195d 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1,6 +1,6 @@
 ;;; cl-macs.el --- Common Lisp macros  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Old-Version: 2.02
@@ -900,7 +900,8 @@ This is compatible with Common Lisp, but note that `defun' 
and
   "The Common Lisp `loop' macro.
 Valid clauses include:
   For clauses:
-    for VAR from/upfrom/downfrom EXPR1 to/upto/downto/above/below EXPR2 [by 
EXPR3]
+    for VAR from/upfrom/downfrom EXPR1 to/upto/downto/above/below EXPR2
+        [by EXPR3]
     for VAR = EXPR1 then EXPR2
     for VAR in/on/in-ref LIST [by FUNC]
     for VAR across/across-ref ARRAY
@@ -2698,7 +2699,7 @@ Each SLOT may instead take the form (SNAME SDEFAULT 
SOPTIONS...), where
 SDEFAULT is the default value of that slot and SOPTIONS are keyword-value
 pairs for that slot.
 Supported keywords for slots are:
-- `:read-only':  If this has a non-nil value, that slot cannot be set via 
`setf'.
+- `:read-only': If this has a non-nil value, that slot cannot be set via 
`setf'.
 - `:documentation': this is a docstring describing the slot.
 - `:type': the type of the field; currently only used for documentation.
 
diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el
index eed43c5..7365e23 100644
--- a/lisp/emacs-lisp/cl-preloaded.el
+++ b/lisp/emacs-lisp/cl-preloaded.el
@@ -1,6 +1,6 @@
 ;;; cl-preloaded.el --- Preloaded part of the CL library  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Package: emacs
diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el
index 0375c57..348da59 100644
--- a/lisp/emacs-lisp/cl-print.el
+++ b/lisp/emacs-lisp/cl-print.el
@@ -1,6 +1,6 @@
 ;;; cl-print.el --- CL-style generic printing  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords:
diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el
index 8cfdd14..329bd7c 100644
--- a/lisp/emacs-lisp/cl-seq.el
+++ b/lisp/emacs-lisp/cl-seq.el
@@ -1,6 +1,6 @@
 ;;; cl-seq.el --- Common Lisp features, part 3  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Old-Version: 2.02
diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el
index edeeb03..a9baef3 100644
--- a/lisp/emacs-lisp/copyright.el
+++ b/lisp/emacs-lisp/copyright.el
@@ -1,6 +1,6 @@
 ;;; copyright.el --- update the copyright notice in current buffer  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1991-1995, 1998, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1991-1995, 1998, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index 89d106e..eb3193c 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -1,6 +1,6 @@
 ;;; crm.el --- read multiple strings with completion
 
-;; Copyright (C) 1985-1986, 1993-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1993-2021 Free Software Foundation, Inc.
 
 ;; Author: Sen Nagata <sen@eccosys.com>
 ;; Keywords: completion, minibuffer, multiple elements
diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el
index d50f7ad..ffeddad 100644
--- a/lisp/emacs-lisp/cursor-sensor.el
+++ b/lisp/emacs-lisp/cursor-sensor.el
@@ -1,6 +1,6 @@
 ;;; cursor-sensor.el --- React to cursor movement  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords:
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 11ef836..d9da0db 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -1,6 +1,6 @@
 ;;; debug.el --- debuggers and related commands for Emacs  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1985-1986, 1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 6a11f1c..4252842 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -1,7 +1,7 @@
 ;;; derived.el --- allow inheritance of major modes
 ;; (formerly mode-clone.el)
 
-;; Copyright (C) 1993-1994, 1999, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1993-1994, 1999, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: David Megginson (dmeggins@aix1.uottawa.ca)
@@ -306,11 +306,13 @@ No problems result if this variable is not bound.
       ;; Use a default docstring.
       (setq docstring
            (if (null parent)
-               ;; FIXME filling.
-               (format "Major-mode.\nUses keymap `%s'%s%s." map
-                       (if abbrev (format "%s abbrev table `%s'"
-                                          (if syntax "," " and") abbrev) "")
-                       (if syntax (format " and syntax-table `%s'" syntax) ""))
+                (concat
+                 "Major-mode.\n"
+                 (internal--format-docstring-line
+                  "Uses keymap `%s'%s%s." map
+                  (if abbrev (format "%s abbrev table `%s'"
+                                     (if syntax "," " and") abbrev) "")
+                  (if syntax (format " and syntax-table `%s'" syntax) "")))
              (format "Major mode derived from `%s' by `define-derived-mode'.
 It inherits all of the parent's attributes, but has its own keymap%s:
 
@@ -336,20 +338,22 @@ which more-or-less shadow%s %s's corresponding table%s."
     (unless (string-match (regexp-quote (symbol-name hook)) docstring)
       ;; Make sure the docstring mentions the mode's hook.
       (setq docstring
-           (concat docstring
-                   (if (null parent)
-                       "\n\nThis mode "
-                     (concat
-                      "\n\nIn addition to any hooks its parent mode "
-                      (if (string-match (format "[`‘]%s['’]"
-                                                 (regexp-quote
-                                                 (symbol-name parent)))
-                                        docstring)
-                           nil
-                        (format "`%s' " parent))
-                      "might have run,\nthis mode "))
-                   (format "runs the hook `%s'" hook)
-                   ", as the final or penultimate step\nduring 
initialization.")))
+            (concat docstring "\n\n"
+                    (internal--format-docstring-line
+                     "%s%s%s"
+                     (if (null parent)
+                         "This mode "
+                       (concat
+                        "In addition to any hooks its parent mode "
+                        (if (string-match (format "[`‘]%s['’]"
+                                                  (regexp-quote
+                                                   (symbol-name parent)))
+                                          docstring)
+                            nil
+                          (format "`%s' " parent))
+                        "might have run, this mode "))
+                     (format "runs the hook `%s'" hook)
+                     ", as the final or penultimate step during 
initialization."))))
 
     (unless (string-match "\\\\[{[]" docstring)
       ;; And don't forget to put the mode's keymap.
diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el
index c2faac8..0d28909 100644
--- a/lisp/emacs-lisp/disass.el
+++ b/lisp/emacs-lisp/disass.el
@@ -1,6 +1,6 @@
 ;;; disass.el --- disassembler for compiled Emacs Lisp code  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1986, 1991, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1986, 1991, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Doug Cutting <doug@csli.stanford.edu>
 ;;     Jamie Zawinski <jwz@lucid.com>
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 261f250..f4dbcee 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -1,6 +1,6 @@
 ;;; easy-mmode.el --- easy definition for major and minor modes  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Georges Brun-Cottan <Georges.Brun-Cottan@inria.fr>
 ;; Maintainer: Stefan Monnier <monnier@gnu.org>
@@ -278,8 +278,10 @@ For example, you could write
          ((not globalp)
           `(progn
              :autoload-end
-             (defvar ,mode ,init-value ,(format "Non-nil if %s is enabled.
-Use the command `%s' to change this variable." pretty-name mode))
+             (defvar ,mode ,init-value
+               ,(concat (format "Non-nil if %s is enabled.\n" pretty-name)
+                        (internal--format-docstring-line
+                         "Use the command `%s' to change this variable." 
mode)))
              (make-variable-buffer-local ',mode)))
          (t
          (let ((base-doc-string
@@ -455,24 +457,23 @@ on if the hook has explicitly disabled it.
          (make-variable-buffer-local ',MODE-major-mode))
        ;; The actual global minor-mode
        (define-minor-mode ,global-mode
-        ;; Very short lines to avoid too long lines in the generated
-        ;; doc string.
-        ,(format "Toggle %s in all buffers.
-With prefix ARG, enable %s if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
-
-%s is enabled in all buffers where
-`%s' would do it.
-
-See `%s' for more information on
-%s.%s"
-                 pretty-name pretty-global-name
-                 pretty-name turn-on mode pretty-name
+         ,(concat (format "Toggle %s in all buffers.\n" pretty-name)
+                  (internal--format-docstring-line
+                   "With prefix ARG, enable %s if ARG is positive; otherwise, \
+disable it.  If called from Lisp, enable the mode if ARG is omitted or 
nil.\n\n"
+                   pretty-global-name)
+                  (internal--format-docstring-line
+                   "%s is enabled in all buffers where `%s' would do it.\n\n"
+                   pretty-name turn-on)
+                  (internal--format-docstring-line
+                   "See `%s' for more information on %s."
+                   mode pretty-name)
                   (if predicate
-                      (format "\n\n`%s' is used to control which modes
-this minor mode is used in."
-                              MODE-predicate)
+                      (concat
+                       "\n\n"
+                       (internal--format-docstring-line
+                        "`%s' is used to control which modes this minor mode 
is used in."
+                        MODE-predicate))
                     ""))
          :global t ,@group ,@(nreverse extra-keywords)
 
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 7a24af7..5303da3 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -1,6 +1,6 @@
 ;;; easymenu.el --- support the easymenu interface for defining a menu  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1994, 1996, 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1996, 1998-2021 Free Software Foundation, Inc.
 
 ;; Keywords: emulations
 ;; Author: Richard Stallman <rms@gnu.org>
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index f242e92..1ded0e7 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -1,6 +1,6 @@
 ;;; edebug.el --- a source-level debugger for Emacs Lisp  -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 1988-1995, 1997, 1999-2020 Free Software Foundation,
+;; Copyright (C) 1988-1995, 1997, 1999-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Daniel LaLiberte <liberte@holonexus.org>
@@ -592,7 +592,7 @@ already is one.)"
   "A list of entries associating symbols with buffer regions.
 Each entry is an `edebug--form-data' struct with fields:
 SYMBOL, BEGIN-MARKER, and END-MARKER.  The markers
-are at the beginning and end of an entry level form and SYMBOL is
+are at the beginning and end of an instrumented form and SYMBOL is
 a symbol that holds all edebug related information for the form on its
 property list.
 
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index a484c2f..4ba72ae 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -1,6 +1,6 @@
 ;;; eieio-base.el --- Base classes for EIEIO.  -*- lexical-binding:t -*-
 
-;;; Copyright (C) 2000-2002, 2004-2005, 2007-2020 Free Software
+;;; Copyright (C) 2000-2002, 2004-2005, 2007-2021 Free Software
 ;;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/emacs-lisp/eieio-compat.el b/lisp/emacs-lisp/eieio-compat.el
index 2a896f0..db97d4c 100644
--- a/lisp/emacs-lisp/eieio-compat.el
+++ b/lisp/emacs-lisp/eieio-compat.el
@@ -1,6 +1,6 @@
 ;;; eieio-compat.el --- Compatibility with Older EIEIO versions  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1995-1996, 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1996, 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: OO, lisp
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
index 3bc65d0..3e5e9b9 100644
--- a/lisp/emacs-lisp/eieio-core.el
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -1,6 +1,6 @@
 ;;; eieio-core.el --- Core implementation for eieio  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1995-1996, 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1996, 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Version: 1.4
@@ -587,8 +587,8 @@ If SKIPNIL is non-nil, then if default value is nil return 
t instead."
 (defun eieio--add-new-slot (newc slot init alloc
                                 &optional defaultoverride skipnil)
   "Add into NEWC attribute SLOT.
-If a slot of that name already exists in NEWC, then do nothing.  If it doesn't 
exist,
-INIT is the initarg, if any.
+If a slot of that name already exists in NEWC, then do nothing.
+If it doesn't exist, INIT is the initarg, if any.
 Argument ALLOC specifies if the slot is allocated per instance, or per class.
 If optional DEFAULTOVERRIDE is non-nil, then if A exists in NEWC,
 we must override its value for a default.
diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el
index c1378cb..184b99f 100644
--- a/lisp/emacs-lisp/eieio-custom.el
+++ b/lisp/emacs-lisp/eieio-custom.el
@@ -1,6 +1,6 @@
 ;;; eieio-custom.el -- eieio object customization  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2001, 2005, 2007-2020 Free Software Foundation,
+;; Copyright (C) 1999-2001, 2005, 2007-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/emacs-lisp/eieio-datadebug.el 
b/lisp/emacs-lisp/eieio-datadebug.el
index 94b289b..9e89ce8 100644
--- a/lisp/emacs-lisp/eieio-datadebug.el
+++ b/lisp/emacs-lisp/eieio-datadebug.el
@@ -1,6 +1,6 @@
 ;;; eieio-datadebug.el --- EIEIO extensions to the data debugger.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: OO, lisp
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 59af7e1..edf4d34 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -1,6 +1,6 @@
 ;;; eieio-opt.el -- eieio optional functions (debug, printing, speedbar)
 
-;; Copyright (C) 1996, 1998-2003, 2005, 2008-2020 Free Software
+;; Copyright (C) 1996, 1998-2003, 2005, 2008-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
@@ -136,9 +136,9 @@ are not abstract."
          (def (symbol-function ctr)))
       (goto-char (point-min))
       (prin1 ctr)
-      (insert (format " is an %s object constructor function"
+      (insert (format " is an %sobject constructor function"
                      (if (autoloadp def)
-                         "autoloaded"
+                         "autoloaded "
                        "")))
       (when (and (autoloadp def)
                 (null location))
diff --git a/lisp/emacs-lisp/eieio-speedbar.el 
b/lisp/emacs-lisp/eieio-speedbar.el
index 5c6e0e5..8bf77e2 100644
--- a/lisp/emacs-lisp/eieio-speedbar.el
+++ b/lisp/emacs-lisp/eieio-speedbar.el
@@ -1,6 +1,6 @@
 ;;; eieio-speedbar.el -- Classes for managing speedbar displays.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1999-2002, 2005, 2007-2020 Free Software Foundation,
+;; Copyright (C) 1999-2002, 2005, 2007-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 810affa..a095ad0 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -1,7 +1,7 @@
 ;;; eieio.el --- Enhanced Implementation of Emacs Interpreted Objects  -*- 
lexical-binding:t -*-
 ;;;              or maybe Eric's Implementation of Emacs Interpreted Objects
 
-;; Copyright (C) 1995-1996, 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1996, 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Version: 1.4
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index d81060e..90e075b 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -1,6 +1,6 @@
 ;;; eldoc.el --- Show function arglist or variable docstring in echo area  -*- 
lexical-binding:t; -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Noah Friedman <friedman@splode.com>
 ;; Keywords: extensions
@@ -467,7 +467,6 @@ This holds the results of the last documentation request."
 
 (defun eldoc--format-doc-buffer (docs)
   "Ensure DOCS are displayed in an *eldoc* buffer."
-  (interactive (list t))
   (with-current-buffer (if (buffer-live-p eldoc--doc-buffer)
                            eldoc--doc-buffer
                          (setq eldoc--doc-buffer
@@ -868,11 +867,7 @@ the docstrings eventually produced, using
                        eldoc--last-request-state))
            (let ((non-essential t))
              (setq eldoc--last-request-state token)
-             ;; Only keep looking for the info as long as the user hasn't
-             ;; requested our attention.  This also locally disables
-             ;; inhibit-quit.
-             (while-no-input
-               (eldoc--invoke-strategy nil)))))))
+             (eldoc--invoke-strategy nil))))))
 
 
 ;; This section only affects ElDoc output to the echo area, as in
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el
index ef97c82..0fba593 100644
--- a/lisp/emacs-lisp/elint.el
+++ b/lisp/emacs-lisp/elint.el
@@ -1,6 +1,6 @@
 ;;; elint.el --- Lint Emacs Lisp -*- lexical-binding: t -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Peter Liljenberg <petli@lysator.liu.se>
 ;; Created: May 1997
@@ -521,7 +521,7 @@ Return nil if there are no more forms, t otherwise."
   "The currently linted top form, or nil.")
 
 (defvar elint-top-form-logged nil
-  "The value t if the currently linted top form has been mentioned in the log 
buffer.")
+  "Non-nil if the currently linted top form has been mentioned in the log 
buffer.")
 
 (defun elint-top-form (form)
   "Lint a top FORM."
@@ -558,7 +558,8 @@ Return nil if there are no more forms, t otherwise."
     (when . elint-check-conditional-form)
     (unless . elint-check-conditional-form)
     (and . elint-check-conditional-form)
-    (or . elint-check-conditional-form))
+    (or . elint-check-conditional-form)
+    (require . elint-require-form))
   "Functions to call when some special form should be linted.")
 
 (defun elint-form (form env &optional nohandler)
@@ -953,6 +954,13 @@ Does basic handling of `featurep' tests."
           (elint-form form env t))))
   env)
 
+(defun elint-require-form (form _env)
+  "Load `require'd files."
+  (pcase form
+    (`(require ',x)
+     (require x)))
+  nil)
+
 ;;;
 ;;; Message functions
 ;;;
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index a94978a..f551c0c 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -1,6 +1,6 @@
 ;;; elp.el --- Emacs Lisp Profiler  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1994-1995, 1997-1998, 2001-2020 Free Software
+;; Copyright (C) 1994-1995, 1997-1998, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Barry A. Warsaw
diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el
index a8da2c4..d058d3d 100644
--- a/lisp/emacs-lisp/ert-x.el
+++ b/lisp/emacs-lisp/ert-x.el
@@ -1,6 +1,6 @@
 ;;; ert-x.el --- Staging area for experimental extensions to ERT  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2008, 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008, 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Lennart Borgman (lennart O borgman A gmail O com)
 ;;         Christian Ohler <ohler@gnu.org>
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 5f29c26..5851754 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1,6 +1,6 @@
 ;;; ert.el --- Emacs Lisp Regression Testing  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-2008, 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2008, 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Christian Ohler <ohler@gnu.org>
 ;; Keywords: lisp, tools
@@ -274,7 +274,7 @@ DATA is displayed to the user and should state the reason 
for skipping."
 It should only be stopped when ran from inside ert--run-test-internal."
   (when (and (not (symbolp debugger))   ; only run on anonymous debugger
              (memq error-symbol '(ert-test-failed ert-test-skipped)))
-    (funcall debugger 'error data)))
+    (funcall debugger 'error (list error-symbol data))))
 
 (defun ert--special-operator-p (thing)
   "Return non-nil if THING is a symbol naming a special operator."
diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el
index 5112322..d3ace97 100644
--- a/lisp/emacs-lisp/ewoc.el
+++ b/lisp/emacs-lisp/ewoc.el
@@ -1,6 +1,6 @@
 ;;; ewoc.el --- utility to maintain a view of a list of objects in a buffer  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 1991-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2021 Free Software Foundation, Inc.
 
 ;; Author: Per Cederqvist <ceder@lysator.liu.se>
 ;;     Inge Wallin <inge@lysator.liu.se>
diff --git a/lisp/emacs-lisp/faceup.el b/lisp/emacs-lisp/faceup.el
index 9900136..6c3931f 100644
--- a/lisp/emacs-lisp/faceup.el
+++ b/lisp/emacs-lisp/faceup.el
@@ -1,6 +1,6 @@
 ;;; faceup.el --- Markup language for faces and font-lock regression testing  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Anders Lindgren
 ;; Version: 0.0.6
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index ee94e1f..c399a68 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -1,6 +1,6 @@
 ;;; find-func.el --- find the definition of the Emacs Lisp function near point 
 -*- lexical-binding:t -*-
 
-;; Copyright (C) 1997, 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Jens Petersen <petersen@kurims.kyoto-u.ac.jp>
 ;; Keywords: emacs-lisp, functions, variables
@@ -103,7 +103,7 @@ Please send improvements and fixes to the maintainer."
 
 (defcustom find-feature-regexp
   (concat ";;; Code:")
-  "The regexp used by `xref-find-definitions' when searching for a feature 
definition.
+  "Regexp used by `xref-find-definitions' when searching for a feature 
definition.
 Note it may contain up to one `%s' at the place where `format'
 should insert the feature name."
   ;; We search for ";;; Code" rather than (feature '%s) because the
@@ -389,7 +389,70 @@ The search is done in the source for library LIBRARY."
                   (progn
                     (beginning-of-line)
                     (cons (current-buffer) (point)))
-                (cons (current-buffer) nil)))))))))
+                ;; If the regexp search didn't find the location of
+                ;; the symbol (for example, because it is generated by
+                ;; a macro), try a slightly more expensive search that
+                ;; expands macros until it finds the symbol.
+                (cons (current-buffer)
+                      (find-function--search-by-expanding-macros
+                       (current-buffer) symbol type))))))))))
+
+(defun find-function--try-macroexpand (form)
+  "Try to macroexpand FORM in full or partially.
+This is a best-effort operation in which if macroexpansion fails,
+this function returns FORM as is."
+  (ignore-errors
+    (or
+     (macroexpand-all form)
+     (macroexpand-1 form)
+     form)))
+
+(defun find-function--any-subform-p (form pred)
+  "Walk FORM and apply PRED to its subexpressions.
+Return t if any PRED returns t."
+  (cond
+   ((not (consp form)) nil)
+   ((funcall pred form) t)
+   (t
+    (cl-destructuring-bind (left-child . right-child) form
+      (or
+       (find-function--any-subform-p left-child pred)
+       (find-function--any-subform-p right-child pred))))))
+
+(defun find-function--search-by-expanding-macros (buf symbol type)
+  "Expand macros in BUF to search for the definition of SYMBOL of TYPE."
+  (catch 'found
+    (with-current-buffer buf
+      (save-excursion
+        (goto-char (point-min))
+        (condition-case nil
+            (while t
+              (let ((form (read (current-buffer)))
+                    (expected-symbol-p
+                      (lambda (form)
+                        (cond
+                         ((null type)
+                          ;; Check if a given form is a `defalias' to
+                          ;; SYM, the function name we are searching
+                          ;; for.  All functions in Emacs Lisp
+                          ;; ultimately expand to a `defalias' form
+                          ;; after several steps of macroexpansion.
+                          (and (eq (car-safe form) 'defalias)
+                               (equal (car-safe (cdr form))
+                                      `(quote ,symbol))))
+                         ((eq type 'defvar)
+                          ;; Variables generated by macros ultimately
+                          ;; expand to `defvar'.
+                          (and (eq (car-safe form) 'defvar)
+                               (eq (car-safe (cdr form)) symbol)))
+                         (t nil)))))
+                (when (find-function--any-subform-p
+                       (find-function--try-macroexpand form)
+                       expected-symbol-p)
+                  ;; We want to return the location at the beginning
+                  ;; of the macro, so move back one sexp.
+                  (throw 'found (progn (backward-sexp) (point))))))
+          (end-of-file nil))))))
 
 (defun find-function-library (function &optional lisp-only verbose)
   "Return the pair (ORIG-FUNCTION . LIBRARY) for FUNCTION.
diff --git a/lisp/emacs-lisp/float-sup.el b/lisp/emacs-lisp/float-sup.el
index d92ca5b..4256bd5 100644
--- a/lisp/emacs-lisp/float-sup.el
+++ b/lisp/emacs-lisp/float-sup.el
@@ -1,6 +1,6 @@
 ;;; float-sup.el --- define some constants useful for floating point numbers.  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1987, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1987, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el
index c95c758..9eb6d95 100644
--- a/lisp/emacs-lisp/generator.el
+++ b/lisp/emacs-lisp/generator.el
@@ -1,6 +1,6 @@
 ;;; generator.el --- generators  -*- lexical-binding: t -*-
 
-;;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel Colascione <dancol@dancol.org>
 ;; Keywords: extensions, elisp
diff --git a/lisp/emacs-lisp/generic.el b/lisp/emacs-lisp/generic.el
index 3bc6d02..93f780e 100644
--- a/lisp/emacs-lisp/generic.el
+++ b/lisp/emacs-lisp/generic.el
@@ -1,6 +1,6 @@
 ;;; generic.el --- defining simple major modes with comment and font-lock
 ;;
-;; Copyright (C) 1997, 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999, 2001-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Fri Sep 27 1996
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el
index 5470b85..29f8230 100644
--- a/lisp/emacs-lisp/gv.el
+++ b/lisp/emacs-lisp/gv.el
@@ -1,6 +1,6 @@
 ;;; gv.el --- generalized variables  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: extensions
@@ -504,6 +504,11 @@ The return value is the last VAL in the list.
              (funcall do `(funcall (car ,gv))
                       (lambda (v) `(funcall (cdr ,gv) ,v))))))))
 
+(put 'error 'gv-expander
+     (lambda (do &rest args)
+       (funcall do `(error . ,args)
+                (lambda (v) `(progn ,v (error . ,args))))))
+
 (defmacro gv-synthetic-place (getter setter)
   "Special place described by its setter and getter.
 GETTER and SETTER (typically obtained via `gv-letplace') get and
diff --git a/lisp/emacs-lisp/helper.el b/lisp/emacs-lisp/helper.el
index a2f6fde..737f3ec 100644
--- a/lisp/emacs-lisp/helper.el
+++ b/lisp/emacs-lisp/helper.el
@@ -1,6 +1,6 @@
 ;;; helper.el --- utility help package supporting help in electric modes
 
-;; Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: K. Shane Hartman
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/emacs-lisp/hierarchy.el b/lisp/emacs-lisp/hierarchy.el
index 8cef029..7466fc8 100644
--- a/lisp/emacs-lisp/hierarchy.el
+++ b/lisp/emacs-lisp/hierarchy.el
@@ -1,6 +1,6 @@
 ;;; hierarchy.el --- Library to create and display hierarchy structures  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Damien Cassou <damien@cassou.me>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/emacs-lisp/inline.el b/lisp/emacs-lisp/inline.el
index 0825871..d6106fe 100644
--- a/lisp/emacs-lisp/inline.el
+++ b/lisp/emacs-lisp/inline.el
@@ -1,6 +1,6 @@
 ;;; inline.el --- Define functions by their inliner  -*- lexical-binding:t; -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 
diff --git a/lisp/emacs-lisp/let-alist.el b/lisp/emacs-lisp/let-alist.el
index 867ff85..433b37d 100644
--- a/lisp/emacs-lisp/let-alist.el
+++ b/lisp/emacs-lisp/let-alist.el
@@ -1,6 +1,6 @@
 ;;; let-alist.el --- Easily let-bind values of an assoc-list by their names 
-*- lexical-binding: t; -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Artur Malabarba <emacs@endlessparentheses.com>
 ;; Package-Requires: ((emacs "24.1"))
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index 0d57bc1..adb9cb2 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -1,6 +1,6 @@
 ;;; lisp-mnt.el --- utility functions for Emacs Lisp maintainers  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1992, 1994, 1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1992, 1994, 1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
@@ -208,6 +208,7 @@ a section."
     (when start
       (save-excursion
         (goto-char start)
+        (looking-at outline-regexp)
         (let ((level (lisp-outline-level))
               (case-fold-search t)
               next-section-found)
@@ -218,6 +219,7 @@ a section."
                              nil t))
                       (> (save-excursion
                            (beginning-of-line)
+                           (looking-at outline-regexp)
                            (lisp-outline-level))
                          level)))
          (min (if next-section-found
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 081ef8d..1ae216c 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1,6 +1,6 @@
 ;;; lisp-mode.el --- Lisp mode, and its idiosyncratic commands  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1999-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: lisp, languages
@@ -38,7 +38,7 @@
 (define-abbrev-table 'lisp-mode-abbrev-table ()
   "Abbrev table for Lisp mode.")
 
-(defvar lisp--mode-syntax-table
+(defvar lisp-data-mode-syntax-table
   (let ((table (make-syntax-table))
         (i 0))
     (while (< i ?0)
@@ -77,11 +77,13 @@
     (modify-syntax-entry ?\\ "\\   " table)
     (modify-syntax-entry ?\( "()  " table)
     (modify-syntax-entry ?\) ")(  " table)
+    (modify-syntax-entry ?\[ "(]" table)
+    (modify-syntax-entry ?\] ")[" table)
     table)
   "Parent syntax table used in Lisp modes.")
 
 (defvar lisp-mode-syntax-table
-  (let ((table (make-syntax-table lisp--mode-syntax-table)))
+  (let ((table (make-syntax-table lisp-data-mode-syntax-table)))
     (modify-syntax-entry ?\[ "_   " table)
     (modify-syntax-entry ?\] "_   " table)
     (modify-syntax-entry ?# "' 14" table)
@@ -669,7 +671,7 @@ font-lock keywords will not be case sensitive."
 (define-derived-mode lisp-data-mode prog-mode "Lisp-Data"
   "Major mode for buffers holding data written in Lisp syntax."
   :group 'lisp
-  (lisp-mode-variables t t nil)
+  (lisp-mode-variables nil t nil)
   (setq-local electric-quote-string t)
   (setq imenu-case-fold-search nil))
 
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 1249001..46ca948 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -1,6 +1,6 @@
 ;;; lisp.el --- Lisp editing commands for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1994, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1985-1986, 1994, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 88825fc..82a8cd2 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -1,6 +1,6 @@
 ;;; macroexp.el --- Additional macro-expansion support -*- lexical-binding: t 
-*-
 ;;
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Miles Bader <miles@gnu.org>
 ;; Keywords: lisp, compiler, macros
diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el
index c35db7a..14112a1 100644
--- a/lisp/emacs-lisp/map-ynp.el
+++ b/lisp/emacs-lisp/map-ynp.el
@@ -1,6 +1,6 @@
 ;;; map-ynp.el --- general-purpose boolean question-asker  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1991-1995, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991-1995, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Roland McGrath <roland@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el
index 9c23344..46a1bd2 100644
--- a/lisp/emacs-lisp/map.el
+++ b/lisp/emacs-lisp/map.el
@@ -1,6 +1,6 @@
 ;;; map.el --- Map manipulation functions  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Petton <nicolas@petton.fr>
 ;; Keywords: convenience, map, hash-table, alist, array
diff --git a/lisp/emacs-lisp/memory-report.el b/lisp/emacs-lisp/memory-report.el
new file mode 100644
index 0000000..3d6ca95
--- /dev/null
+++ b/lisp/emacs-lisp/memory-report.el
@@ -0,0 +1,317 @@
+;;; memory-report.el --- Short function summaries  -*- lexical-binding: t -*-
+
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+;; Keywords: lisp, help
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Todo (possibly): Font cache, regexp cache, bidi cache, various
+;; buffer caches (newline cache, free_region_cache, etc), composition
+;; cache, face cache.
+
+;;; Code:
+
+(require 'seq)
+(require 'subr-x)
+(eval-when-compile (require 'cl-lib))
+
+(defvar memory-report--type-size (make-hash-table))
+
+;;;###autoload
+(defun memory-report ()
+  "Generate a report of how Emacs is using memory.
+
+This report is approximate, and will commonly over-count memory
+usage by variables, because shared data structures will usually
+by counted more than once."
+  (interactive)
+  (pop-to-buffer "*Memory Report*")
+  (special-mode)
+  (button-mode 1)
+  (setq truncate-lines t)
+  (message "Gathering data...")
+  (let ((reports (append (memory-report--garbage-collect)
+                         (memory-report--image-cache)
+                         (memory-report--symbol-plist)
+                         (memory-report--buffers)
+                         (memory-report--largest-variables)))
+        (inhibit-read-only t)
+        summaries details)
+    (message "Gathering data...done")
+    (erase-buffer)
+    (insert (propertize "Estimated Emacs Memory Usage\n\n" 'face 'bold))
+    (dolist (report reports)
+      (if (listp report)
+          (push report summaries)
+        (push report details)))
+    (dolist (summary (seq-sort (lambda (e1 e2)
+                                 (> (cdr e1) (cdr e2)))
+                               summaries))
+      (insert (format "%s  %s\n"
+                      (memory-report--format (cdr summary))
+                      (car summary))))
+    (insert "\n")
+    (dolist (detail (nreverse details))
+      (insert detail "\n")))
+  (goto-char (point-min)))
+
+(defun memory-report-object-size (object)
+  "Return the size of OBJECT in bytes."
+  (unless memory-report--type-size
+    (memory-report--garbage-collect))
+  (memory-report--object-size (make-hash-table :test #'eq) object))
+
+(defun memory-report--size (type)
+  (or (gethash type memory-report--type-size)
+      (gethash 'object memory-report--type-size)))
+
+(defun memory-report--set-size (elems)
+  (setf (gethash 'string memory-report--type-size)
+        (cadr (assq 'strings elems)))
+  (setf (gethash 'cons memory-report--type-size)
+        (cadr (assq 'conses elems)))
+  (setf (gethash 'symbol memory-report--type-size)
+        (cadr (assq 'symbols elems)))
+  (setf (gethash 'object memory-report--type-size)
+        (cadr (assq 'vectors elems)))
+  (setf (gethash 'float memory-report--type-size)
+        (cadr (assq 'floats elems)))
+  (setf (gethash 'buffer memory-report--type-size)
+        (cadr (assq 'buffers elems))))
+
+(defun memory-report--garbage-collect ()
+  (let ((elems (garbage-collect)))
+    (memory-report--set-size elems)
+    (let ((data (list
+                 (list 'strings
+                       (+ (memory-report--gc-elem elems 'strings)
+                          (memory-report--gc-elem elems 'string-bytes)))
+                 (list 'vectors
+                       (+ (memory-report--gc-elem elems 'vectors)
+                          (memory-report--gc-elem elems 'vector-slots)))
+                 (list 'floats (memory-report--gc-elem elems 'floats))
+                 (list 'conses (memory-report--gc-elem elems 'conses))
+                 (list 'symbols (memory-report--gc-elem elems 'symbols))
+                 (list 'intervals (memory-report--gc-elem elems 'intervals))
+                 (list 'buffer-objects
+                       (memory-report--gc-elem elems 'buffers)))))
+      (list (cons "Overall Object Memory Usage"
+                  (seq-reduce #'+ (mapcar (lambda (elem)
+                                            (* (nth 1 elem) (nth 2 elem)))
+                                          elems)
+                              0))
+            (cons "Reserved (But Unused) Object Memory"
+                  (seq-reduce #'+ (mapcar (lambda (elem)
+                                            (if (nth 3 elem)
+                                                (* (nth 1 elem) (nth 3 elem))
+                                              0))
+                                          elems)
+                              0))
+            (with-temp-buffer
+              (insert (propertize "Object Storage\n\n" 'face 'bold))
+              (dolist (object (seq-sort (lambda (e1 e2)
+                                          (> (cadr e1) (cadr e2)))
+                                        data))
+                (insert (format "%s  %s\n"
+                                (memory-report--format (cadr object))
+                                (capitalize (symbol-name (car object))))))
+              (buffer-string))))))
+
+(defun memory-report--largest-variables ()
+  (let ((variables nil))
+    (mapatoms
+     (lambda (symbol)
+       (when (boundp symbol)
+         (let ((size (memory-report--object-size
+                      (make-hash-table :test #'eq)
+                      (symbol-value symbol))))
+           (when (> size 1000)
+             (push (cons symbol size) variables)))))
+     obarray)
+    (list
+     (cons (propertize "Memory Used By Global Variables"
+                       'help-echo "Upper bound; mutually overlapping data from 
different variables are counted several times")
+           (seq-reduce #'+ (mapcar #'cdr variables) 0))
+     (with-temp-buffer
+       (insert (propertize "Largest Variables\n\n" 'face 'bold))
+       (cl-loop for i from 1 upto 20
+                for (symbol . size) in (seq-sort (lambda (e1 e2)
+                                                   (> (cdr e1) (cdr e2)))
+                                                 variables)
+                do (insert (memory-report--format size)
+                           "  "
+                           (symbol-name symbol)
+                           "\n"))
+       (buffer-string)))))
+
+(defun memory-report--symbol-plist ()
+  (let ((counted (make-hash-table :test #'eq))
+        (total 0))
+    (mapatoms
+     (lambda (symbol)
+       (cl-incf total (memory-report--object-size
+                       counted (symbol-plist symbol))))
+     obarray)
+    (list
+     (cons "Memory Used By Symbol Plists" total))))
+
+(defun memory-report--object-size (counted value)
+  (if (gethash value counted)
+      0
+    (setf (gethash value counted) t)
+    (memory-report--object-size-1 counted value)))
+
+(cl-defgeneric memory-report--object-size-1 (_counted _value)
+  0)
+
+(cl-defmethod memory-report--object-size-1 (_ (value symbol))
+  ;; Don't count global symbols -- makes sizes of lists of symbols too
+  ;; heavey.
+  (if (intern-soft value obarray)
+      0
+    (memory-report--size 'symbol)))
+
+(cl-defmethod memory-report--object-size-1 (_ (_value buffer))
+  (memory-report--size 'buffer))
+
+(cl-defmethod memory-report--object-size-1 (counted (value string))
+  (+ (memory-report--size 'string)
+     (string-bytes value)
+     (memory-report--interval-size counted (object-intervals value))))
+
+(defun memory-report--interval-size (counted intervals)
+  ;; We get a list back of intervals, but only count the "inner list"
+  ;; (i.e., the actual text properties), and add the size of the
+  ;; intervals themselves.
+  (+ (* (memory-report--size 'interval) (length intervals))
+     (seq-reduce #'+ (mapcar
+                      (lambda (interval)
+                        (memory-report--object-size counted (nth 2 interval)))
+                      intervals)
+                 0)))
+
+(cl-defmethod memory-report--object-size-1 (counted (value list))
+  (let ((total 0)
+        (size (memory-report--size 'cons)))
+    (while value
+      (cl-incf total size)
+      (setf (gethash value counted) t)
+      (when (car value)
+        (cl-incf total (memory-report--object-size counted (car value))))
+      (if (cdr value)
+          (if (consp (cdr value))
+              (if (gethash (cdr value) counted)
+                  (setq value nil)
+                (setq value (cdr value)))
+            (cl-incf total (memory-report--object-size counted (cdr value)))
+            (setq value nil))
+        (setq value nil)))
+    total))
+
+(cl-defmethod memory-report--object-size-1 (counted (value vector))
+  (let ((total (+ (memory-report--size 'vector)
+                  (* (memory-report--size 'object) (length value)))))
+    (cl-loop for elem across value
+             do (setf (gethash elem counted) t)
+             (cl-incf total (memory-report--object-size counted elem)))
+    total))
+
+(cl-defmethod memory-report--object-size-1 (counted (value hash-table))
+  (let ((total (+ (memory-report--size 'vector)
+                  (* (memory-report--size 'object) (hash-table-size value)))))
+    (maphash
+     (lambda (key elem)
+       (setf (gethash key counted) t)
+       (setf (gethash elem counted) t)
+       (cl-incf total (memory-report--object-size counted key))
+       (cl-incf total (memory-report--object-size counted elem)))
+     value)
+    total))
+
+(defun memory-report--format (bytes)
+  (setq bytes (/ bytes 1024.0))
+  (let ((units '("KiB" "MiB" "GiB" "TiB")))
+    (while (>= bytes 1024)
+      (setq bytes (/ bytes 1024.0))
+      (setq units (cdr units)))
+    (format "%6.1f %s" bytes (car units))))
+
+(defun memory-report--gc-elem (elems type)
+  (* (nth 1 (assq type elems))
+     (nth 2 (assq type elems))))
+
+(defun memory-report--buffers ()
+  (let ((buffers (mapcar (lambda (buffer)
+                           (cons buffer (memory-report--buffer buffer)))
+                         (buffer-list))))
+    (list (cons "Total Buffer Memory Usage"
+                (seq-reduce #'+ (mapcar #'cdr buffers) 0))
+          (with-temp-buffer
+            (insert (propertize "Largest Buffers\n\n" 'face 'bold))
+            (cl-loop for i from 1 upto 20
+                     for (buffer . size) in (seq-sort (lambda (e1 e2)
+                                                        (> (cdr e1) (cdr e2)))
+                                                      buffers)
+                     do (insert (memory-report--format size)
+                                "  "
+                                (button-buttonize
+                                 (buffer-name buffer)
+                                 #'memory-report--buffer-details buffer)
+                                "\n"))
+            (buffer-string)))))
+
+(defun memory-report--buffer-details (buffer)
+  (with-current-buffer buffer
+    (apply
+     #'message
+     "Buffer text: %s; variables: %s; text properties: %s; overlays: %s"
+     (mapcar #'string-trim (mapcar #'memory-report--format
+                                   (memory-report--buffer-data buffer))))))
+
+(defun memory-report--buffer (buffer)
+  (seq-reduce #'+ (memory-report--buffer-data buffer) 0))
+
+(defun memory-report--buffer-data (buffer)
+  (with-current-buffer buffer
+    (list (save-restriction
+            (widen)
+            (+ (position-bytes (point-max))
+              (- (position-bytes (point-min)))
+              (gap-size)))
+          (seq-reduce #'+ (mapcar (lambda (elem)
+                                    (if (cdr elem)
+                                        (memory-report--object-size
+                                         (make-hash-table :test #'eq)
+                                         (cdr elem))
+                                      0))
+                                  (buffer-local-variables buffer))
+                      0)
+          (memory-report--object-size (make-hash-table :test #'eq)
+                                      (object-intervals buffer))
+          (memory-report--object-size (make-hash-table :test #'eq)
+                                      (overlay-lists)))))
+
+(defun memory-report--image-cache ()
+  (list (cons "Total Image Cache Size" (if (fboundp 'image-cache-size)
+                                           (image-cache-size)
+                                         0))))
+
+(provide 'memory-report)
+
+;;; memory-report.el ends here
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index b779aa2..afdd372 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -1,6 +1,6 @@
 ;;; nadvice.el --- Light-weight advice primitives for Elisp functions  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: extensions, lisp, tools
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el
index c01b6ef..8a0853c 100644
--- a/lisp/emacs-lisp/package-x.el
+++ b/lisp/emacs-lisp/package-x.el
@@ -1,6 +1,6 @@
 ;;; package-x.el --- Package extras
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Tom Tromey <tromey@redhat.com>
 ;; Created: 10 Mar 2007
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 9c37ce4..40ba135 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1,6 +1,6 @@
 ;;; package.el --- Simple package system for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Tom Tromey <tromey@redhat.com>
 ;;         Daniel Hackney <dan@haxney.org>
@@ -203,6 +203,9 @@ If VERSION is nil, the package is not made available (it is 
\"disabled\")."
 
 (defcustom package-archives `(("gnu" .
                                ,(format "http%s://elpa.gnu.org/packages/"
+                                        (if (gnutls-available-p) "s" "")))
+                              ("nongnu" .
+                               ,(format "http%s://elpa.nongnu.org/nongnu/"
                                         (if (gnutls-available-p) "s" ""))))
   "An alist of archives from which to fetch.
 The default value points to the GNU Emacs package repository.
@@ -825,40 +828,45 @@ correspond to previously loaded files (those returned by
 
 (declare-function find-library-name "find-func" (library))
 
+(defun package--files-load-history ()
+  (delq nil
+        (mapcar (lambda (x)
+                  (let ((f (car x)))
+                    (and (stringp f)
+                         (file-name-sans-extension (file-truename f)))))
+                load-history)))
+
+(defun package--list-of-conflicts (dir history)
+   (delq
+    nil
+    (mapcar
+     (lambda (x) (let* ((file (file-relative-name x dir))
+                        ;; Previously loaded file, if any.
+                        (previous
+                         (ignore-errors
+                           (file-name-sans-extension
+                            (file-truename (find-library-name file)))))
+                        (pos (when previous (member previous history))))
+                   ;; Return (RELATIVE-FILENAME . HISTORY-POSITION)
+                   (when pos
+                     (cons (file-name-sans-extension file) (length pos)))))
+     (directory-files-recursively dir "\\`[^\\.].*\\.el\\'"))))
+
 (defun package--list-loaded-files (dir)
   "Recursively list all files in DIR which correspond to loaded features.
 Returns the `file-name-sans-extension' of each file, relative to
 DIR, sorted by most recently loaded last."
-  (let* ((history (delq nil
-                        (mapcar (lambda (x)
-                                  (let ((f (car x)))
-                                    (and (stringp f)
-                                         (file-name-sans-extension f))))
-                                load-history)))
+  (let* ((history (package--files-load-history))
          (dir (file-truename dir))
          ;; List all files that have already been loaded.
-         (list-of-conflicts
-          (delq
-           nil
-           (mapcar
-               (lambda (x) (let* ((file (file-relative-name x dir))
-                             ;; Previously loaded file, if any.
-                             (previous
-                              (ignore-errors
-                                (file-name-sans-extension
-                                 (file-truename (find-library-name file)))))
-                             (pos (when previous (member previous history))))
-                        ;; Return (RELATIVE-FILENAME . HISTORY-POSITION)
-                        (when pos
-                          (cons (file-name-sans-extension file) (length 
pos)))))
-             (directory-files-recursively dir "\\`[^\\.].*\\.el\\'")))))
+         (list-of-conflicts (package--list-of-conflicts dir history)))
     ;; Turn the list of (FILENAME . POS) back into a list of features.  Files 
in
     ;; subdirectories are returned relative to DIR (so not actually features).
     (let ((default-directory (file-name-as-directory dir)))
       (mapcar (lambda (x) (file-truename (car x)))
-        (sort list-of-conflicts
-              ;; Sort the files by ascending HISTORY-POSITION.
-              (lambda (x y) (< (cdr x) (cdr y))))))))
+              (sort list-of-conflicts
+                    ;; Sort the files by ascending HISTORY-POSITION.
+                    (lambda (x y) (< (cdr x) (cdr y))))))))
 
 ;;;; `package-activate'
 ;; This function activates a newer version of a package if an older
@@ -1115,14 +1123,15 @@ boundaries."
     ;; Use some headers we've invented to drive the process.
     (let* (;; Prefer Package-Version; if defined, the package author
            ;; probably wants us to use it.  Otherwise try Version.
-           (pkg-version
-            (or (package-strip-rcs-id (lm-header "package-version"))
-                (package-strip-rcs-id (lm-header "version"))))
+           (version-info
+            (or (lm-header "package-version") (lm-header "version")))
+           (pkg-version (package-strip-rcs-id version-info))
            (keywords (lm-keywords-list))
            (homepage (lm-homepage)))
       (unless pkg-version
-        (error
-            "Package lacks a \"Version\" or \"Package-Version\" header"))
+         (if version-info
+             (error "Unrecognized package version: %s" version-info)
+           (error "Package lacks a \"Version\" or \"Package-Version\" 
header")))
       (package-desc-from-define
        file-name pkg-version desc
        (and-let* ((require-lines (lm-header-multiline "package-requires")))
@@ -1614,18 +1623,22 @@ that code in the early init-file."
   "Activate all installed packages.
 The variable `package-load-list' controls which packages to load."
   (setq package--activated t)
-  (if (file-readable-p package-quickstart-file)
-      ;; Skip load-source-file-function which would slow us down by a factor
-      ;; 2 (this assumes we were careful to save this file so it doesn't need
-      ;; any decoding).
-      (let ((load-source-file-function nil))
-        (load package-quickstart-file nil 'nomessage))
-    (dolist (elt (package--alist))
-      (condition-case err
-          (package-activate (car elt))
-        ;; Don't let failure of activation of a package arbitrarily stop
-        ;; activation of further packages.
-        (error (message "%s" (error-message-string err)))))))
+  (let* ((elc (concat package-quickstart-file "c"))
+         (qs (if (file-readable-p elc) elc
+               (if (file-readable-p package-quickstart-file)
+                   package-quickstart-file))))
+    (if qs
+        ;; Skip load-source-file-function which would slow us down by a factor
+        ;; 2 when loading the .el file (this assumes we were careful to
+        ;; save this file so it doesn't need any decoding).
+        (let ((load-source-file-function nil))
+          (load qs nil 'nomessage))
+      (dolist (elt (package--alist))
+        (condition-case err
+            (package-activate (car elt))
+          ;; Don't let failure of activation of a package arbitrarily stop
+          ;; activation of further packages.
+          (error (message "%s" (error-message-string err))))))))
 
 ;;;; Populating `package-archive-contents' from archives
 ;; This subsection populates the variables listed above from the
@@ -2112,7 +2125,10 @@ Otherwise return nil."
   (when str
     (when (string-match "\\`[ \t]*[$]Revision:[ \t]+" str)
       (setq str (substring str (match-end 0))))
-    (if (version-to-list str) str)))
+    (let ((l (version-to-list str)))
+      ;; Don't return `str' but (package-version-join (version-to-list str))
+      ;; to make sure we use a "canonical name"!
+      (if l (package-version-join l)))))
 
 (declare-function lm-homepage "lisp-mnt" (&optional file))
 
@@ -4037,6 +4053,7 @@ activations need to be changed, such as when 
`package-load-list' is modified."
       ;; FIXME: Delay refresh in case we're installing/deleting
       ;; several packages!
       (package-quickstart-refresh)
+    (delete-file (concat package-quickstart-file "c"))
     (delete-file package-quickstart-file)))
 
 (defun package-quickstart-refresh ()
@@ -4091,10 +4108,10 @@ activations need to be changed, such as when 
`package-load-list' is modified."
       (insert "
 ;; Local\sVariables:
 ;; version-control: never
-;;\sno-byte-compile: t
 ;; no-update-autoloads: t
 ;; End:
-"))))
+"))
+    (byte-compile-file package-quickstart-file)))
 
 (defun package--imenu-prev-index-position-function ()
   "Move point to previous line in package-menu buffer.
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index e603900..8fb79d2 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -1,6 +1,6 @@
 ;;; pcase.el --- ML-style pattern-matching macro for Elisp -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: extensions
@@ -409,7 +409,8 @@ of the elements of LIST is performed as if by `pcase-let'.
       (dolist (case cases)
         (unless (or (memq case used-cases)
                     (memq (car case) pcase--dontwarn-upats))
-          (message "Redundant pcase pattern: %S" (car case))))
+          (message "pcase pattern %S shadowed by previous pcase pattern"
+                   (car case))))
       (macroexp-let* defs main))))
 
 (defun pcase--macroexpand (pat)
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index de7d202..ef4c960 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -1,6 +1,6 @@
 ;;; pp.el --- pretty printer for Emacs Lisp  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1989, 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Randal Schwartz <merlyn@stonehenge.com>
 ;; Keywords: lisp
diff --git a/lisp/emacs-lisp/radix-tree.el b/lisp/emacs-lisp/radix-tree.el
index 48aedb2..6a483a6 100644
--- a/lisp/emacs-lisp/radix-tree.el
+++ b/lisp/emacs-lisp/radix-tree.el
@@ -1,6 +1,6 @@
 ;;; radix-tree.el --- A simple library of radix trees  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords:
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index ffbf3b4..23221a2 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -1,6 +1,6 @@
 ;;; re-builder.el --- building Regexps with visual feedback -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Detlev Zundel <dzu@gnu.org>
 ;; Keywords: matching, lisp, tools
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el
index 35a5fda..2a40290 100644
--- a/lisp/emacs-lisp/regexp-opt.el
+++ b/lisp/emacs-lisp/regexp-opt.el
@@ -1,6 +1,6 @@
 ;;; regexp-opt.el --- generate efficient regexps to match strings -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Marshall <simon@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/emacs-lisp/regi.el b/lisp/emacs-lisp/regi.el
index 2e6e2b7..38b202f 100644
--- a/lisp/emacs-lisp/regi.el
+++ b/lisp/emacs-lisp/regi.el
@@ -1,6 +1,6 @@
 ;;; regi.el --- REGular expression Interpreting engine
 
-;; Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: 1993 Barry A. Warsaw, Century Computing, Inc. <bwarsaw@cen.com>
 ;; Created:       24-Feb-1993
diff --git a/lisp/emacs-lisp/ring.el b/lisp/emacs-lisp/ring.el
index 624efd6..9689465 100644
--- a/lisp/emacs-lisp/ring.el
+++ b/lisp/emacs-lisp/ring.el
@@ -1,6 +1,6 @@
 ;;; ring.el --- handle rings of items   -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1992, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: extensions
diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el
index 9b253b8..bedf598 100644
--- a/lisp/emacs-lisp/rmc.el
+++ b/lisp/emacs-lisp/rmc.el
@@ -1,6 +1,6 @@
 ;;; rmc.el --- read from a multiple choice question -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 6d33299..b29b870 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -1,6 +1,6 @@
 ;;; rx.el --- S-exp notation for regexps           --*- lexical-binding: t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index 4656277..31c15fe 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -1,6 +1,6 @@
 ;;; seq.el --- Sequence manipulation functions  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Petton <nicolas@petton.fr>
 ;; Keywords: sequences
@@ -317,7 +317,7 @@ list."
 
 ;;;###autoload
 (cl-defgeneric seq-filter (pred sequence)
-  "Return a list of all the elements for which (PRED element) is non-nil in 
SEQUENCE."
+  "Return a list of all elements for which (PRED element) is non-nil in 
SEQUENCE."
   (let ((exclude (make-symbol "exclude")))
     (delq exclude (seq-map (lambda (elt)
                              (if (funcall pred elt)
@@ -411,7 +411,8 @@ Equality is defined by TESTFN if non-nil or by `equal' if 
nil."
       nil))
 
 (cl-defgeneric seq-set-equal-p (sequence1 sequence2 &optional testfn)
-  "Return non-nil if SEQUENCE1 and SEQUENCE2 contain the same elements, 
regardless of order.
+  "Return non-nil if SEQUENCE1 and SEQUENCE2 contain the same elements.
+This does not depend on the order of the elements.
 Equality is defined by TESTFN if non-nil or by `equal' if nil."
   (and (seq-every-p (lambda (item1) (seq-contains-p sequence2 item1 testfn)) 
sequence1)
        (seq-every-p (lambda (item2) (seq-contains-p sequence1 item2 testfn)) 
sequence2)))
@@ -444,7 +445,7 @@ The result is a sequence of type TYPE, or a list if TYPE is 
nil."
          (seq-map function sequence)))
 
 (cl-defgeneric seq-partition (sequence n)
-  "Return a list of the elements of SEQUENCE grouped into sub-sequences of 
length N.
+  "Return list of elements of SEQUENCE grouped into sub-sequences of length N.
 The last sequence may contain less than N elements.  If N is a
 negative integer or 0, nil is returned."
   (unless (< n 1)
diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el
index 68f58f6..168e5e4 100644
--- a/lisp/emacs-lisp/shadow.el
+++ b/lisp/emacs-lisp/shadow.el
@@ -1,6 +1,6 @@
 ;;; shadow.el --- locate Emacs Lisp file shadowings
 
-;; Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Terry Jones <terry@santafe.edu>
 ;; Keywords: lisp
diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index 37d6170..698467e 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -1,6 +1,6 @@
 ;;; shortdoc.el --- Short function summaries  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Keywords: lisp, help
 ;; Package: emacs
@@ -131,6 +131,10 @@ There can be any number of :example/:result elements."
   (mapconcat
    :eval (mapconcat (lambda (a) (concat "[" a "]"))
                     '("foo" "bar" "zot") " "))
+  (string-pad
+   :eval (string-pad "foo" 5)
+   :eval (string-pad "foobar" 5)
+   :eval (string-pad "foo" 5 ?- t))
   (mapcar
    :eval (mapcar #'identity "123"))
   (format
@@ -139,10 +143,21 @@ There can be any number of :example/:result elements."
   (substring
    :eval (substring "foobar" 0 3)
    :eval (substring "foobar" 3))
+  (string-limit
+   :eval (string-limit "foobar" 3)
+   :eval (string-limit "foobar" 3 t)
+   :eval (string-limit "foobar" 10)
+   :eval (string-limit "fo好" 3 nil 'utf-8))
+  (truncate-string-to-width
+   :eval (truncate-string-to-width "foobar" 3)
+   :eval (truncate-string-to-width "你好bar" 5))
   (split-string
    :eval (split-string "foo bar")
    :eval (split-string "|foo|bar|" "|")
    :eval (split-string "|foo|bar|" "|" t))
+  (string-lines
+   :eval (string-lines "foo\n\nbar")
+   :eval (string-lines "foo\n\nbar" t))
   (string-replace
    :eval (string-replace "foo" "bar" "foozot"))
   (replace-regexp-in-string
@@ -167,10 +182,19 @@ There can be any number of :example/:result elements."
   (string-remove-prefix
    :no-manual t
    :eval (string-remove-prefix "foo" "foobar"))
+  (string-chop-newline
+   :eval (string-chop-newline "foo\n"))
+  (string-clean-whitespace
+   :eval (string-clean-whitespace " foo   bar   "))
+  (string-fill
+   :eval (string-fill "Three short words" 12)
+   :eval (string-fill "Long-word" 3))
   (reverse
    :eval (reverse "foo"))
   (substring-no-properties
    :eval (substring-no-properties (propertize "foobar" 'face 'bold) 0 3))
+  (try-completion
+   :eval (try-completion "foo" '("foobar" "foozot" "gazonk")))
   "Predicates for Strings"
   (string-equal
    :eval (string-equal "foo" "foo"))
@@ -594,6 +618,12 @@ There can be any number of :example/:result elements."
   "Data About Lists"
   (length
    :eval (length '(a b c)))
+  (length<
+   :eval (length< '(a b c) 1))
+  (length>
+   :eval (length> '(a b c) 1))
+  (length=
+   :eval (length> '(a b c) 3))
   (safe-length
    :eval (safe-length '(a b c))))
 
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 355dd0f..44be9af 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1,6 +1,6 @@
 ;;; smie.el --- Simple Minded Indentation Engine -*- lexical-binding: t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: languages, lisp, internal, parsing, indentation
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index e6abb39..b90227d 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -1,6 +1,6 @@
 ;;; subr-x.el --- extra Lisp functions  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: convenience
@@ -264,6 +264,102 @@ carriage return."
       (substring string 0 (- (length string) (length suffix)))
     string))
 
+(defun string-clean-whitespace (string)
+  "Clean up whitespace in STRING.
+All sequences of whitespaces in STRING are collapsed into a
+single space character, and leading/trailing whitespace is
+removed."
+  (let ((blank "[[:blank:]\r\n]+"))
+    (string-trim (replace-regexp-in-string blank " " string t t)
+                 blank blank)))
+
+(defun string-fill (string length)
+  "Try to word-wrap STRING so that no lines are longer than LENGTH.
+Wrapping is done where there is whitespace.  If there are
+individual words in STRING that are longer than LENGTH, the
+result will have lines that are longer than LENGTH."
+  (with-temp-buffer
+    (insert string)
+    (goto-char (point-min))
+    (let ((fill-column length)
+          (adaptive-fill-mode nil))
+      (fill-region (point-min) (point-max)))
+    (buffer-string)))
+
+(defun string-limit (string length &optional end coding-system)
+  "Return (up to) a LENGTH substring of STRING.
+If STRING is shorter than or equal to LENGTH, the entire string
+is returned unchanged.
+
+If STRING is longer than LENGTH, return a substring consisting of
+the first LENGTH characters of STRING.  If END is non-nil, return
+the last LENGTH characters instead.
+
+If CODING-SYSTEM is non-nil, STRING will be encoded before
+limiting, and LENGTH is interpreted as the number of bytes to
+limit the string to.  The result will be a unibyte string that is
+shorter than LENGTH, but will not contain \"partial\" characters,
+even if CODING-SYSTEM encodes characters with several bytes per
+character.
+
+When shortening strings for display purposes,
+`truncate-string-to-width' is almost always a better alternative
+than this function."
+  (unless (natnump length)
+    (signal 'wrong-type-argument (list 'natnump length)))
+  (if coding-system
+      (let ((result nil)
+            (result-length 0)
+            (index (if end (1- (length string)) 0)))
+        (while (let ((encoded (encode-coding-char
+                               (aref string index) coding-system)))
+                 (and (<= (+ (length encoded) result-length) length)
+                      (progn
+                        (push encoded result)
+                        (cl-incf result-length (length encoded))
+                        (setq index (if end (1- index)
+                                      (1+ index))))
+                      (if end (> index -1)
+                        (< index (length string)))))
+          ;; No body.
+          )
+        (apply #'concat (if end result (nreverse result))))
+    (cond
+     ((<= (length string) length) string)
+     (end (substring string (- (length string) length)))
+     (t (substring string 0 length)))))
+
+(defun string-lines (string &optional omit-nulls)
+  "Split STRING into a list of lines.
+If OMIT-NULLS, empty lines will be removed from the results."
+  (split-string string "\n" omit-nulls))
+
+(defun string-pad (string length &optional padding start)
+  "Pad STRING to LENGTH using PADDING.
+If PADDING is nil, the space character is used.  If not nil, it
+should be a character.
+
+If STRING is longer than the absolute value of LENGTH, no padding
+is done.
+
+If START is nil (or not present), the padding is done to the end
+of the string, and if non-nil, padding is done to the start of
+the string."
+  (unless (natnump length)
+    (signal 'wrong-type-argument (list 'natnump length)))
+  (let ((pad-length (- length (length string))))
+    (if (< pad-length 0)
+        string
+      (concat (and start
+                   (make-string pad-length (or padding ?\s)))
+              string
+              (and (not start)
+                   (make-string pad-length (or padding ?\s)))))))
+
+(defun string-chop-newline (string)
+  "Remove the final newline (if any) from STRING."
+  (string-remove-suffix "\n" string))
+
 (defun replace-region-contents (beg end replace-fn
                                     &optional max-secs max-costs)
   "Replace the region between BEG and END using REPLACE-FN.
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index e35f9d8..62f213c 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -1,6 +1,6 @@
 ;;; syntax.el --- helper functions to find syntactic context  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
diff --git a/lisp/emacs-lisp/tabulated-list.el 
b/lisp/emacs-lisp/tabulated-list.el
index ae3ed05..0c299b4 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -1,6 +1,6 @@
 ;;; tabulated-list.el --- generic major mode for tabulated lists -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Chong Yidong <cyd@stupidchicken.com>
 ;; Keywords: extensions, lisp
diff --git a/lisp/emacs-lisp/tcover-ses.el b/lisp/emacs-lisp/tcover-ses.el
index cfc00f5..7de9d54 100644
--- a/lisp/emacs-lisp/tcover-ses.el
+++ b/lisp/emacs-lisp/tcover-ses.el
@@ -1,6 +1,6 @@
 ;;;; testcover-ses.el -- Example use of `testcover' to test "SES"
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Jonathan Yavner <jyavner@member.fsf.org>
 ;; Keywords: spreadsheet lisp utility
diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el
index 7980163..312e387 100644
--- a/lisp/emacs-lisp/testcover.el
+++ b/lisp/emacs-lisp/testcover.el
@@ -1,6 +1,6 @@
 ;;;; testcover.el -- Visual code-coverage tool  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Jonathan Yavner <jyavner@member.fsf.org>
 ;; Keywords: lisp utility
diff --git a/lisp/emacs-lisp/text-property-search.el 
b/lisp/emacs-lisp/text-property-search.el
index d7dc7da..e909e4b 100644
--- a/lisp/emacs-lisp/text-property-search.el
+++ b/lisp/emacs-lisp/text-property-search.el
@@ -1,6 +1,6 @@
 ;;; text-property-search.el --- search for text properties  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: convenience
diff --git a/lisp/emacs-lisp/thunk.el b/lisp/emacs-lisp/thunk.el
index c8e483e..83e0fa7 100644
--- a/lisp/emacs-lisp/thunk.el
+++ b/lisp/emacs-lisp/thunk.el
@@ -1,6 +1,6 @@
 ;;; thunk.el --- Lazy form evaluation  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Petton <nicolas@petton.fr>
 ;; Keywords: sequences
@@ -122,7 +122,7 @@ Using `thunk-let' and `thunk-let*' requires 
`lexical-binding'."
   (declare (indent 1) (debug let))
   (cl-reduce
    (lambda (expr binding) `(thunk-let (,binding) ,expr))
-   (nreverse bindings)
+   (reverse bindings)
    :initial-value (macroexp-progn body)))
 
 ;; (defalias 'lazy-let  #'thunk-let)
diff --git a/lisp/emacs-lisp/timer-list.el b/lisp/emacs-lisp/timer-list.el
index 024f003..d5bbe7d 100644
--- a/lisp/emacs-lisp/timer-list.el
+++ b/lisp/emacs-lisp/timer-list.el
@@ -1,6 +1,6 @@
 ;;; timer-list.el --- list active timers in a buffer  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Package: emacs
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index 61fd05c..36de29a 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -1,6 +1,6 @@
 ;;; timer.el --- run a function with args at some time in future -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Package: emacs
diff --git a/lisp/emacs-lisp/tq.el b/lisp/emacs-lisp/tq.el
index 2780140..e02f4e4 100644
--- a/lisp/emacs-lisp/tq.el
+++ b/lisp/emacs-lisp/tq.el
@@ -1,6 +1,6 @@
 ;;; tq.el --- utility to maintain a transaction queue  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1985-1987, 1992, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1985-1987, 1992, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Scott Draves <spot@cs.cmu.edu>
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index 28e964e..fa07d62 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -1,6 +1,6 @@
 ;;; trace.el --- tracing facility for Emacs Lisp functions  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1993, 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Hans Chalupsky <hans@cs.buffalo.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el
index c4db86a..f46d9c7 100644
--- a/lisp/emacs-lisp/unsafep.el
+++ b/lisp/emacs-lisp/unsafep.el
@@ -1,6 +1,6 @@
 ;;;; unsafep.el -- Determine whether a Lisp form is safe to evaluate
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Jonathan Yavner <jyavner@member.fsf.org>
 ;; Keywords: safety lisp utility
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index f525ea43..67de690 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -1,6 +1,6 @@
 ;;; warnings.el --- log and display warnings  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
@@ -67,6 +67,7 @@ Level :debug is ignored by default (see 
`warning-minimum-level').")
 Each element looks like (ALIAS . LEVEL) and defines ALIAS as
 equivalent to LEVEL.  LEVEL must be defined in `warning-levels';
 it may not itself be an alias.")
+(make-obsolete-variable 'warning-level-aliases 'warning-levels "28.1")
 
 (define-obsolete-variable-alias 'display-warning-minimum-level
   'warning-minimum-level "28.1")
@@ -256,8 +257,10 @@ entirely by setting `warning-suppress-types' or
       (setq level :warning))
     (unless buffer-name
       (setq buffer-name "*Warnings*"))
-    (if (assq level warning-level-aliases)
-       (setq level (cdr (assq level warning-level-aliases))))
+    (with-suppressed-warnings ((obsolete warning-level-aliases))
+      (when-let ((new (cdr (assq level warning-level-aliases))))
+        (warn "Warning level `%s' is obsolete; use `%s' instead" level new)
+        (setq level new)))
     (or (< (warning-numeric-level level)
           (warning-numeric-level warning-minimum-log-level))
        (warning-suppress-p type warning-suppress-log-types)
diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el
index ba75a93..5c436f5 100644
--- a/lisp/emacs-lock.el
+++ b/lisp/emacs-lock.el
@@ -1,6 +1,6 @@
 ;;; emacs-lock.el --- protect buffers against killing or exiting -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Juanma Barranquero <lekktu@gmail.com>
 ;; Inspired by emacs-lock.el by Tom Wurgler <twurgler@goodyear.com>
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 926305e..881eff7 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -1,6 +1,6 @@
 ;;; cua-base.el --- emulate CUA key bindings
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Kim F. Storm <storm@cua.dk>
 ;; Keywords: keyboard emulations convenience cua
@@ -375,11 +375,11 @@ managers, so try setting this to nil, if prefix override 
doesn't work."
 
 (defcustom cua-paste-pop-rotate-temporarily nil
   "If non-nil, \\[cua-paste-pop] only rotates the kill-ring temporarily.
-This means that both \\[yank] and the first \\[yank-pop] in a sequence always 
insert
-the most recently killed text.  Each immediately following \\[cua-paste-pop] 
replaces
-the previous text with the next older element on the `kill-ring'.
-With prefix arg, \\[universal-argument] \\[yank-pop] inserts the same text as 
the most
-recent \\[yank-pop] (or \\[yank]) command."
+This means that both \\[yank] and the first \\[yank-pop] in a sequence always
+insert the most recently killed text.  Each immediately following 
\\[cua-paste-pop]
+replaces the previous text with the next older element on the `kill-ring'.
+With prefix arg, \\[universal-argument] \\[yank-pop] inserts the same text as 
the
+most recent \\[yank-pop] (or \\[yank]) command."
   :type 'boolean
   :group 'cua)
 
diff --git a/lisp/emulation/cua-gmrk.el b/lisp/emulation/cua-gmrk.el
index cd36072..195bba1 100644
--- a/lisp/emulation/cua-gmrk.el
+++ b/lisp/emulation/cua-gmrk.el
@@ -1,6 +1,6 @@
 ;;; cua-gmrk.el --- CUA unified global mark support
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Kim F. Storm <storm@cua.dk>
 ;; Keywords: keyboard emulations convenience cua mark
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 7ca9dc1..ea5dad2 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -1,6 +1,6 @@
 ;;; cua-rect.el --- CUA unified rectangle support
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Kim F. Storm <storm@cua.dk>
 ;; Keywords: keyboard emulations convenience CUA
diff --git a/lisp/emulation/edt-lk201.el b/lisp/emulation/edt-lk201.el
index f7b2c0c..b616fdf 100644
--- a/lisp/emulation/edt-lk201.el
+++ b/lisp/emulation/edt-lk201.el
@@ -1,6 +1,6 @@
 ;;; edt-lk201.el --- enhanced EDT keypad mode emulation for LK-201 keyboards  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 1986, 1992-1993, 1995, 2001-2020 Free Software
+;; Copyright (C) 1986, 1992-1993, 1995, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Kevin Gallagher <kevin.gal@verizon.net>
diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el
index 5dd81fa..98085c6 100644
--- a/lisp/emulation/edt-mapper.el
+++ b/lisp/emulation/edt-mapper.el
@@ -1,6 +1,6 @@
 ;;; edt-mapper.el --- create an EDT LK-201 map file for X-Windows Emacs
 
-;; Copyright (C) 1994-1995, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Kevin Gallagher <kevin.gal@verizon.net>
 ;; Keywords: emulations
diff --git a/lisp/emulation/edt-pc.el b/lisp/emulation/edt-pc.el
index 53fc988..3131c8f 100644
--- a/lisp/emulation/edt-pc.el
+++ b/lisp/emulation/edt-pc.el
@@ -1,6 +1,6 @@
 ;;; edt-pc.el --- enhanced EDT keypad mode emulation for PC 101 keyboards  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1986, 1994-1995, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1986, 1994-1995, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Kevin Gallagher <kevin.gal@verizon.net>
diff --git a/lisp/emulation/edt-vt100.el b/lisp/emulation/edt-vt100.el
index 420d29b..8174d83 100644
--- a/lisp/emulation/edt-vt100.el
+++ b/lisp/emulation/edt-vt100.el
@@ -1,6 +1,6 @@
 ;;; edt-vt100.el --- enhanced EDT keypad mode emulation for VT series 
terminals  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1986, 1992-1993, 1995, 2002-2020 Free Software
+;; Copyright (C) 1986, 1992-1993, 1995, 2002-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Kevin Gallagher <kevin.gal@verizon.net>
diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el
index f61de92..7760a7f 100644
--- a/lisp/emulation/edt.el
+++ b/lisp/emulation/edt.el
@@ -1,6 +1,6 @@
 ;;; edt.el --- enhanced EDT keypad mode emulation for GNU Emacs
 
-;; Copyright (C) 1986, 1992-1995, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1986, 1992-1995, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Kevin Gallagher <kevin.gal@verizon.net>
@@ -691,7 +691,7 @@ Optional argument FIND is t if this function is called from 
`edt-find'."
 (defun edt-find ()
   "Find first occurrence of string in current direction and save it."
   (interactive)
-  (set 'edt-find-last-text (read-string "Search: "))
+  (setq edt-find-last-text (read-string "Search: "))
   (if (equal edt-direction-string edt-forward-string)
       (edt-find-forward t)
       (edt-find-backward t)))
@@ -1321,8 +1321,8 @@ Definition is stored in 
`edt-last-replaced-key-definition'."
   (if edt-last-replaced-key-definition
       (progn
         (let (edt-key-definition)
-          (set 'edt-key-definition
-               (read-key-sequence "Press the key to be restored: "))
+          (setq edt-key-definition
+                (read-key-sequence "Press the key to be restored: "))
           (if (string-equal "\C-m" edt-key-definition)
               (message "Key not restored")
            (progn
@@ -1639,12 +1639,12 @@ Argument NUM is the number of times to duplicate the 
line."
     (progn
       (end-kbd-macro nil)
       (let (edt-key-definition)
-       (set 'edt-key-definition
-            (read-key-sequence "Enter key for binding: "))
+        (setq edt-key-definition
+              (read-key-sequence "Enter key for binding: "))
        (if (string-equal "\C-m" edt-key-definition)
            (message "Key sequence not remembered")
          (progn
-           (set 'edt-learn-macro-count (+ edt-learn-macro-count 1))
+            (setq edt-learn-macro-count (+ edt-learn-macro-count 1))
            (setq edt-last-replaced-key-definition
                  (lookup-key (current-global-map)
                              edt-key-definition))
diff --git a/lisp/emulation/keypad.el b/lisp/emulation/keypad.el
index f7bebf7..e4f3c4d 100644
--- a/lisp/emulation/keypad.el
+++ b/lisp/emulation/keypad.el
@@ -1,6 +1,6 @@
 ;;; keypad.el --- simplified keypad bindings
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Kim F. Storm <storm@cua.dk>
 ;; Keywords: keyboard convenience
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 938ebb1..1e23583 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -1,6 +1,6 @@
 ;;; viper-cmd.el --- Vi command support for Viper  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: viper
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index 929b7a0..238faed 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -1,6 +1,6 @@
 ;;; viper-ex.el --- functions implementing the Ex commands for Viper
 
-;; Copyright (C) 1994-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: viper
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 6c4afe5..cede99b 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -1,6 +1,6 @@
 ;;; viper-init.el --- some common definitions for Viper
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: viper
@@ -475,7 +475,8 @@ text."
 
 ;; Fast keyseq and ESC keyseq timeouts
 (defcustom viper-fast-keyseq-timeout 200
-  "Key sequence separated by no more than this many milliseconds is viewed as 
a Vi-style macro, if such a macro is defined.
+  "Max milliseconds for a key sequence to be regarded as a Vi-style macro.
+Only regard key sequence as a macro if it is defined.
 Setting this too high may slow down your typing.  Setting this value too low
 will make it hard to use Vi-style timeout macros."
   :type 'integer
@@ -705,7 +706,7 @@ If nil, the cursor will move backwards without deleting 
anything."
 
 (viper-deflocalvar viper-related-files-and-buffers-ring nil "")
 (defcustom viper-related-files-and-buffers-ring nil
-  "List of file and buffer names that are considered to be related to the 
current buffer.
+  "List of file and buffer names to consider related to the current buffer.
 Related buffers can be cycled through via :R and :P commands."
   :type 'boolean
   :group 'viper-misc)
diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el
index d76cf71..7209dc6 100644
--- a/lisp/emulation/viper-keym.el
+++ b/lisp/emulation/viper-keym.el
@@ -1,6 +1,6 @@
 ;;; viper-keym.el --- Viper keymaps  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1994-1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: viper
@@ -69,7 +69,7 @@ major mode in effect."
   :group 'viper)
 
 (defcustom viper-want-ctl-h-help nil
-  "If non-nil, C-h gets bound to help-command; otherwise, C-h gets the usual 
Vi bindings."
+  "If non-nil, bind C-h to help-command; otherwise, C-h gets the usual Vi 
bindings."
   :type 'boolean
   :group 'viper)
 
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el
index ac03cf9..039ddab 100644
--- a/lisp/emulation/viper-macs.el
+++ b/lisp/emulation/viper-macs.el
@@ -1,6 +1,6 @@
 ;;; viper-macs.el --- functions implementing keyboard macros for Viper  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1994-1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: viper
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index 928a3ef..eec83dd 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -1,6 +1,6 @@
 ;;; viper-mous.el --- mouse support for Viper
 
-;; Copyright (C) 1994-1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: viper
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 208a2ee..07a234b 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -1,6 +1,6 @@
 ;;; viper-util.el --- Utilities used by viper.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1994-1997, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1997, 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: viper
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 8510928..6c94280 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -3,7 +3,7 @@
 ;;              and a venomous VI PERil.
 ;;              Viper Is also a Package for Emacs Rebels.
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Keywords: emulations
diff --git a/lisp/env.el b/lisp/env.el
index 6de9038..51247f1 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -1,6 +1,6 @@
 ;;; env.el --- functions to manipulate environment variables  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1991, 1994, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1994, 2000-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: processes, unix
diff --git a/lisp/epa-dired.el b/lisp/epa-dired.el
index 4ff1ba3..8a4f893 100644
--- a/lisp/epa-dired.el
+++ b/lisp/epa-dired.el
@@ -1,6 +1,6 @@
 ;;; epa-dired.el --- the EasyPG Assistant, dired extension -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Keywords: PGP, GnuPG
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index 7fd4178..e46e368 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -1,6 +1,6 @@
 ;;; epa-file.el --- the EasyPG Assistant, transparent file encryption -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Keywords: PGP, GnuPG
@@ -309,7 +309,8 @@ encryption is used."
 If no one is selected, symmetric encryption will be performed.  "
                    recipients)
                 (if epa-file-encrypt-to
-                    (epg-list-keys context recipients)))))
+                     (epg--filter-revoked-keys
+                     (epg-list-keys context recipients))))))
       (error
        (epa-display-error context)
        (if (setq entry (assoc file epa-file-passphrase-alist))
diff --git a/lisp/epa-hook.el b/lisp/epa-hook.el
index 6f12f8a..9ad952c 100644
--- a/lisp/epa-hook.el
+++ b/lisp/epa-hook.el
@@ -1,6 +1,6 @@
 ;;; epa-hook.el --- preloaded code to enable epa-file.el -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Keywords: PGP, GnuPG
diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el
index dd171ab..7e10056 100644
--- a/lisp/epa-mail.el
+++ b/lisp/epa-mail.el
@@ -1,6 +1,6 @@
 ;;; epa-mail.el --- the EasyPG Assistant, minor-mode for mail composer -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Keywords: PGP, GnuPG, mail, message
@@ -243,7 +243,7 @@ If no one is selected, symmetric encryption will be 
performed.  "
       (setq epa-last-coding-system-specified
            (or coding-system-for-write
                (select-safe-coding-system (point) (point-max)))))
- 
+
     ;; Insert contents of requested attachments, if any.
     (when (and (eq major-mode 'mail-mode) mail-encode-mml)
       (mml-to-mime)
diff --git a/lisp/epa.el b/lisp/epa.el
index d6c7946..db2b127 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -1,6 +1,6 @@
 ;;; epa.el --- the EasyPG Assistant -*- lexical-binding: t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Keywords: PGP, GnuPG
diff --git a/lisp/epg-config.el b/lisp/epg-config.el
index 9f0c7e4..59d097c 100644
--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -1,6 +1,6 @@
 ;;; epg-config.el --- configuration of the EasyPG Library
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Keywords: PGP, GnuPG
diff --git a/lisp/epg.el b/lisp/epg.el
index 920b853..b1f37cb 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -1,6 +1,6 @@
 ;;; epg.el --- the EasyPG Library -*- lexical-binding: t -*-
 
-;; Copyright (C) 1999-2000, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2000, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Keywords: PGP, GnuPG
@@ -1382,6 +1382,13 @@ NAME is either a string or a list of strings."
       (setq pointer (cdr pointer)))
     keys))
 
+(defun epg--filter-revoked-keys (keys)
+  (seq-remove (lambda (key)
+                (seq-find (lambda (user)
+                            (eq (epg-user-id-validity user) 'revoked))
+                          (epg-key-user-id-list key)))
+              keys))
+
 (defun epg--args-from-sig-notations (notations)
   (apply #'nconc
         (mapcar
diff --git a/lisp/erc/ChangeLog.1 b/lisp/erc/ChangeLog.1
index fdf5195..26c1bd6 100644
--- a/lisp/erc/ChangeLog.1
+++ b/lisp/erc/ChangeLog.1
@@ -11702,7 +11702,7 @@
 
        * erc-speak.el, erc.el: New file.
 
-  Copyright (C) 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/erc/ChangeLog.2 b/lisp/erc/ChangeLog.2
index 5ab459d..b54e3b9 100644
--- a/lisp/erc/ChangeLog.2
+++ b/lisp/erc/ChangeLog.2
@@ -757,7 +757,7 @@
 
 See ChangeLog.1 for earlier changes.
 
-  Copyright (C) 2009-2020 Free Software Foundation, Inc.
+  Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el
index 0923ed6..a008566 100644
--- a/lisp/erc/erc-autoaway.el
+++ b/lisp/erc/erc-autoaway.el
@@ -1,6 +1,6 @@
 ;;; erc-autoaway.el --- Provides autoaway for ERC
 
-;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Jorgen Schaefer <forcer@forcix.cx>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index f99088d..487dc76 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -1,6 +1,6 @@
 ;;; erc-backend.el --- Backend network communication for ERC  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Filename: erc-backend.el
 ;; Author: Lawrence Mitchell <wence@gmx.li>
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index b799b24..71ff408 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -1,6 +1,6 @@
 ;; erc-button.el --- A way of buttonizing certain things in ERC buffers  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1996-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
@@ -242,7 +242,6 @@ global-level ERC button keys yet.")
 
 (defun erc-button-setup ()
   "Add ERC mode-level button movement keys.  This is only done once."
-  ;; Make XEmacs use `erc-button-face'.
   ;; Add keys.
   (unless erc-button-keys-added
     (define-key erc-mode-map (kbd "<backtab>") 'erc-button-previous)
diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el
index 4afe6a7..06d4fbd 100644
--- a/lisp/erc/erc-capab.el
+++ b/lisp/erc/erc-capab.el
@@ -1,6 +1,6 @@
 ;;; erc-capab.el --- support for dancer-ircd and hyperion's CAPAB
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
 
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index 1bce986..590785e 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -1,6 +1,6 @@
 ;;; erc-dcc.el --- CTCP DCC module for ERC
 
-;; Copyright (C) 1993-1995, 1998, 2002-2004, 2006-2020 Free Software
+;; Copyright (C) 1993-1995, 1998, 2002-2004, 2006-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu>
@@ -83,7 +83,8 @@ All values of the list must be uppercase strings.")
 
 (defvar erc-dcc-list nil
   "List of DCC connections. Looks like:
-  ((:nick \"nick!user@host\" :type GET :peer proc :parent proc :size size 
:file file)
+  ((:nick \"nick!user@host\" :type GET :peer proc
+    :parent proc :size size :file file)
    (:nick \"nick!user@host\" :type CHAT :peer proc :parent proc)
    (:nick \"nick\" :type SEND :peer server-proc :parent parent-proc :file
    file :sent <marker> :confirmed <marker>))
diff --git a/lisp/erc/erc-desktop-notifications.el 
b/lisp/erc/erc-desktop-notifications.el
index 3a9a4a4..056fb23 100644
--- a/lisp/erc/erc-desktop-notifications.el
+++ b/lisp/erc/erc-desktop-notifications.el
@@ -1,6 +1,6 @@
 ;; erc-desktop-notifications.el -- Send notification on PRIVMSG or mentions 
-*- lexical-binding:t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Julien Danjou <julien@danjou.info>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el
index 5c2faff..62238dd 100644
--- a/lisp/erc/erc-ezbounce.el
+++ b/lisp/erc/erc-ezbounce.el
@@ -1,6 +1,6 @@
 ;;; erc-ezbounce.el ---  Handle EZBounce bouncer commands
 
-;; Copyright (C) 2002, 2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index d09caf7..83ef5f9 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -1,6 +1,6 @@
 ;;; erc-fill.el --- Filling IRC messages in various ways
 
-;; Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
 ;;         Mario Lang <mlang@delysid.org>
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index 350eb89..aef6881 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -1,6 +1,6 @@
 ;; erc-goodies.el --- Collection of ERC modules
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Jorgen Schaefer <forcer@forcix.cx>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-ibuffer.el b/lisp/erc/erc-ibuffer.el
index 556a25e..5a002cc 100644
--- a/lisp/erc/erc-ibuffer.el
+++ b/lisp/erc/erc-ibuffer.el
@@ -1,6 +1,6 @@
 ;;; erc-ibuffer.el --- ibuffer integration with ERC
 
-;; Copyright (C) 2002, 2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el
index e2115f5..5f1aab1 100644
--- a/lisp/erc/erc-identd.el
+++ b/lisp/erc/erc-identd.el
@@ -1,6 +1,6 @@
 ;;; erc-identd.el --- RFC1413 (identd authentication protocol) server
 
-;; Copyright (C) 2003, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el
index c05633a..1a2d8e2 100644
--- a/lisp/erc/erc-imenu.el
+++ b/lisp/erc/erc-imenu.el
@@ -1,6 +1,6 @@
 ;;; erc-imenu.el -- Imenu support for ERC
 
-;; Copyright (C) 2001-2002, 2004, 2006-2020 Free Software Foundation,
+;; Copyright (C) 2001-2002, 2004, 2006-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el
index 79c1110..947b294 100644
--- a/lisp/erc/erc-join.el
+++ b/lisp/erc/erc-join.el
@@ -1,6 +1,6 @@
 ;;; erc-join.el --- autojoin channels on connect and reconnects
 
-;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-lang.el b/lisp/erc/erc-lang.el
index 95b94f6..b86a8d0 100644
--- a/lisp/erc/erc-lang.el
+++ b/lisp/erc/erc-lang.el
@@ -1,6 +1,6 @@
 ;;; erc-lang.el --- provide the LANG command to ERC
 
-;; Copyright (C) 2002, 2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el
index ae7c2e5..cf150e7 100644
--- a/lisp/erc/erc-list.el
+++ b/lisp/erc/erc-list.el
@@ -1,6 +1,6 @@
 ;;; erc-list.el --- /list support for ERC  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Tom Tromey <tromey@redhat.com>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index 7eddb5f..4540ec6 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -1,6 +1,6 @@
 ;;; erc-log.el --- Logging facilities for ERC.
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Lawrence Mitchell <wence@gmx.li>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index b314567..153742a 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -1,6 +1,6 @@
 ;;; erc-match.el --- Highlight messages matching certain regexps
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el
index b36a1cb..4c092c8 100644
--- a/lisp/erc/erc-menu.el
+++ b/lisp/erc/erc-menu.el
@@ -1,6 +1,6 @@
 ;; erc-menu.el -- Menu-bar definitions for ERC
 
-;; Copyright (C) 2001-2002, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2002, 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el
index e3dc52b..9fd3cfe 100644
--- a/lisp/erc/erc-netsplit.el
+++ b/lisp/erc/erc-netsplit.el
@@ -1,6 +1,6 @@
 ;;; erc-netsplit.el --- Reduce JOIN/QUIT messages on netsplits
 
-;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el
index d957fce..9c2bb9d 100644
--- a/lisp/erc/erc-networks.el
+++ b/lisp/erc/erc-networks.el
@@ -1,6 +1,6 @@
 ;;; erc-networks.el --- IRC networks
 
-;; Copyright (C) 2002, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@lexx.delysid.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el
index 144a981..098049e 100644
--- a/lisp/erc/erc-notify.el
+++ b/lisp/erc/erc-notify.el
@@ -1,6 +1,6 @@
 ;;; erc-notify.el --- Online status change notification  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@lexx.delysid.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el
index 339beb0..0cb60f5 100644
--- a/lisp/erc/erc-page.el
+++ b/lisp/erc/erc-page.el
@@ -1,6 +1,6 @@
 ;; erc-page.el - CTCP PAGE support for ERC
 
-;; Copyright (C) 2002, 2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
 
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el
index c4932f2..ab4c7c5 100644
--- a/lisp/erc/erc-pcomplete.el
+++ b/lisp/erc/erc-pcomplete.el
@@ -1,6 +1,6 @@
 ;;; erc-pcomplete.el --- Provides programmable completion for ERC
 
-;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Sacha Chua <sacha@free.net.ph>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el
index 8bd97be..91fafbb 100644
--- a/lisp/erc/erc-replace.el
+++ b/lisp/erc/erc-replace.el
@@ -1,6 +1,6 @@
 ;; erc-replace.el -- wash and massage messages inserted into the buffer
 
-;; Copyright (C) 2001-2002, 2004, 2006-2020 Free Software Foundation,
+;; Copyright (C) 2001-2002, 2004, 2006-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el
index bc5f0ed..3813eaf 100644
--- a/lisp/erc/erc-ring.el
+++ b/lisp/erc/erc-ring.el
@@ -1,6 +1,6 @@
 ;; erc-ring.el -- Command history handling for erc using ring.el
 
-;; Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el
index c0011f9..4f9b0b1 100644
--- a/lisp/erc/erc-services.el
+++ b/lisp/erc/erc-services.el
@@ -1,6 +1,6 @@
 ;;; erc-services.el --- Identify to NickServ  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
 ;; URL: https://www.emacswiki.org/emacs/ErcNickserv
diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el
index 91ce1c6..edde973 100644
--- a/lisp/erc/erc-sound.el
+++ b/lisp/erc/erc-sound.el
@@ -1,6 +1,6 @@
 ;;; erc-sound.el --- CTCP SOUND support for ERC
 
-;; Copyright (C) 2002-2003, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2003, 2006-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
 ;; URL: https://www.emacswiki.org/emacs/ErcSound
diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el
index b64e42b..c2be239 100644
--- a/lisp/erc/erc-speedbar.el
+++ b/lisp/erc/erc-speedbar.el
@@ -1,6 +1,6 @@
 ;;; erc-speedbar.el --- Speedbar support for ERC
 
-;; Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Contributor: Eric M. Ludlam <zappo@gnu.org>
diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el
index cedffbc..44a3e35 100644
--- a/lisp/erc/erc-spelling.el
+++ b/lisp/erc/erc-spelling.el
@@ -1,6 +1,6 @@
 ;;; erc-spelling.el --- use flyspell in ERC
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Jorgen Schaefer <forcer@forcix.cx>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index 08970f2..c7dfb08 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -1,6 +1,6 @@
 ;;; erc-stamp.el --- Timestamping for ERC messages  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-status-sidebar.el b/lisp/erc/erc-status-sidebar.el
index 08dc8d6..ff51026 100644
--- a/lisp/erc/erc-status-sidebar.el
+++ b/lisp/erc/erc-status-sidebar.el
@@ -1,6 +1,6 @@
 ;;; erc-status-sidebar.el --- HexChat-like activity overview for ERC
 
-;; Copyright (C) 2017, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Andrew Barbarello
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 60f0cfa..d6ad847 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -1,6 +1,6 @@
 ;;; erc-track.el --- Track modified channel buffers  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el
index fff073a..f4514ca 100644
--- a/lisp/erc/erc-truncate.el
+++ b/lisp/erc/erc-truncate.el
@@ -1,6 +1,6 @@
 ;;; erc-truncate.el --- Functions for truncating ERC buffers
 
-;; Copyright (C) 2003-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc-xdcc.el b/lisp/erc/erc-xdcc.el
index 2a236d2..6808f24 100644
--- a/lisp/erc/erc-xdcc.el
+++ b/lisp/erc/erc-xdcc.el
@@ -1,6 +1,6 @@
 ;;; erc-xdcc.el --- XDCC file-server support for ERC
 
-;; Copyright (C) 2003-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index d0b511d..1044acf 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1,6 +1,6 @@
 ;; erc.el --- An Emacs Internet Relay Chat client  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Alexander L. Belikoff (alexander@belikoff.net)
 ;; Contributors: Sergey Berezin (sergey.berezin@cs.cmu.edu),
@@ -2861,7 +2861,9 @@ need this when pasting multiple lines of text."
   (if (string-match "^\\s-*$" line)
       nil
     (string-match "^ ?\\(.*\\)" line)
-    (erc-process-input-line (match-string 1 line) nil t)))
+    (let ((msg (match-string 1 line)))
+      (erc-display-msg msg)
+      (erc-process-input-line msg nil t))))
 (put 'erc-cmd-SAY 'do-not-parse-args t)
 
 (defun erc-cmd-SET (line)
diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el
index 67e0c3f..ee7f463 100644
--- a/lisp/eshell/em-alias.el
+++ b/lisp/eshell/em-alias.el
@@ -1,6 +1,6 @@
 ;;; em-alias.el --- creation and management of command aliases  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-banner.el b/lisp/eshell/em-banner.el
index 53d5fb2..034fa05 100644
--- a/lisp/eshell/em-banner.el
+++ b/lisp/eshell/em-banner.el
@@ -1,6 +1,6 @@
 ;;; em-banner.el --- sample module that displays a login banner  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-basic.el b/lisp/eshell/em-basic.el
index e54eab5..64fc7e7 100644
--- a/lisp/eshell/em-basic.el
+++ b/lisp/eshell/em-basic.el
@@ -1,6 +1,6 @@
 ;;; em-basic.el --- basic shell builtin commands  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el
index d0d7aff..0200631 100644
--- a/lisp/eshell/em-cmpl.el
+++ b/lisp/eshell/em-cmpl.el
@@ -1,6 +1,6 @@
 ;;; em-cmpl.el --- completion using the TAB key  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index c0c2539..c702ee1 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -1,6 +1,6 @@
 ;;; em-dirs.el --- directory navigation commands  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el
index 9ae2dd9..316094b 100644
--- a/lisp/eshell/em-glob.el
+++ b/lisp/eshell/em-glob.el
@@ -1,6 +1,6 @@
 ;;; em-glob.el --- extended file name globbing  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index 490b8b6..0d09ef4 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -1,6 +1,6 @@
 ;;; em-hist.el --- history list management  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index 6b306f7..e942ae2 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -1,6 +1,6 @@
 ;;; em-ls.el --- implementation of ls in Lisp  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
@@ -274,9 +274,9 @@ instead."
             (font-lock-mode -1)
             (setq font-lock-defaults nil)
             (if (boundp 'font-lock-buffers)
-                (set 'font-lock-buffers
-                     (delq (current-buffer)
-                           (symbol-value 'font-lock-buffers)))))
+                (setq font-lock-buffers
+                      (delq (current-buffer)
+                            (symbol-value 'font-lock-buffers)))))
           (require 'em-glob)
           (let* ((insert-func 'insert)
                  (error-func 'insert)
diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el
index 7b95039..aecc8bb 100644
--- a/lisp/eshell/em-pred.el
+++ b/lisp/eshell/em-pred.el
@@ -1,6 +1,6 @@
 ;;; em-pred.el --- argument predicates and modifiers (ala zsh)  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index c6afc5a..aa96166 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -1,6 +1,6 @@
 ;;; em-prompt.el --- command prompts  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el
index ab10211..fa61fff 100644
--- a/lisp/eshell/em-rebind.el
+++ b/lisp/eshell/em-rebind.el
@@ -1,6 +1,6 @@
 ;;; em-rebind.el --- rebind keys when point is at current input  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el
index 857ae6a..aecc486 100644
--- a/lisp/eshell/em-script.el
+++ b/lisp/eshell/em-script.el
@@ -1,6 +1,6 @@
 ;;; em-script.el --- Eshell script files  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el
index 8bc88f2..d1c83db 100644
--- a/lisp/eshell/em-smart.el
+++ b/lisp/eshell/em-smart.el
@@ -1,6 +1,6 @@
 ;;; em-smart.el --- smart display of output  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el
index be91cf7..d199a93 100644
--- a/lisp/eshell/em-term.el
+++ b/lisp/eshell/em-term.el
@@ -1,6 +1,6 @@
 ;;; em-term.el --- running visual commands  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/em-tramp.el b/lisp/eshell/em-tramp.el
index c2d3c3e..e29e9e3 100644
--- a/lisp/eshell/em-tramp.el
+++ b/lisp/eshell/em-tramp.el
@@ -1,6 +1,6 @@
 ;;; em-tramp.el --- Eshell features that require TRAMP  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Aidan Gauland <aidalgol@no8wireless.co.nz>
 
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index 2d6bd32..7e48a9c 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -1,6 +1,6 @@
 ;;; em-unix.el --- UNIX command aliases  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
@@ -169,7 +169,8 @@ Otherwise, Emacs will attempt to use rsh to invoke du on 
the remote machine."
   `info'           => goes to top info window
   `info arg1'      => IF arg1 is a file, then visits arg1
   `info arg1'      => OTHERWISE goes to top info window and then menu item arg1
-  `info arg1 arg2' => does action for arg1 (either visit-file or menu-item) 
and then menu item arg2
+  `info arg1 arg2' => does action for arg1 (either visit-file or menu-item) and
+                      then menu item arg2
   etc."
   (eval-and-compile (require 'info))
   (let ((file (cond
diff --git a/lisp/eshell/em-xtra.el b/lisp/eshell/em-xtra.el
index 3c038ed..fa3218b 100644
--- a/lisp/eshell/em-xtra.el
+++ b/lisp/eshell/em-xtra.el
@@ -1,6 +1,6 @@
 ;;; em-xtra.el --- extra alias functions  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el
index cecb6f7..3cf80e4 100644
--- a/lisp/eshell/esh-arg.el
+++ b/lisp/eshell/esh-arg.el
@@ -1,6 +1,6 @@
 ;;; esh-arg.el --- argument processing  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 8112441..4d63467 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -1,6 +1,6 @@
 ;;; esh-cmd.el --- command invocation  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index c88d3c9..9930e08 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -1,6 +1,6 @@
 ;;; esh-ext.el --- commands external to Eshell  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index de41fcc..0e98aa0 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -1,6 +1,6 @@
 ;;; esh-io.el --- I/O management  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 81d0ec2..d29b010 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -1,6 +1,6 @@
 ;;; esh-mode.el --- user interface  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el
index 10994ba..7031795 100644
--- a/lisp/eshell/esh-module.el
+++ b/lisp/eshell/esh-module.el
@@ -1,6 +1,6 @@
 ;;; esh-module.el --- Eshell modules  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2000, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2000, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Keywords: processes
diff --git a/lisp/eshell/esh-opt.el b/lisp/eshell/esh-opt.el
index dc89188..c1db484 100644
--- a/lisp/eshell/esh-opt.el
+++ b/lisp/eshell/esh-opt.el
@@ -1,6 +1,6 @@
 ;;; esh-opt.el --- command options processing  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el
index 4a1001b..3693829 100644
--- a/lisp/eshell/esh-proc.el
+++ b/lisp/eshell/esh-proc.el
@@ -1,6 +1,6 @@
 ;;; esh-proc.el --- process management  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 9268921..872e3b5 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -1,6 +1,6 @@
 ;;; esh-util.el --- general utilities  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 9aea543..a09c47c 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -1,6 +1,6 @@
 ;;; esh-var.el --- handling of variables  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index 6698ca4..3aaf2fb 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -1,6 +1,6 @@
 ;;; eshell.el --- the Emacs command shell  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Version: 2.4.2
diff --git a/lisp/expand.el b/lisp/expand.el
index 77e4fc2..5c0b5f4 100644
--- a/lisp/expand.el
+++ b/lisp/expand.el
@@ -1,6 +1,6 @@
 ;;; expand.el --- make abbreviations more usable
 
-;; Copyright (C) 1995-1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Frederic Lepied <Frederic.Lepied@sugix.frmug.org>
 ;; Maintainer: emacs-devel@gnu.org
@@ -290,7 +290,7 @@ If ARG is omitted, point is placed at the end of the 
expanded text."
 (defvar expand-list nil "Temporary variable used by the Expand package.")
 
 (defvar expand-pos nil
-  "If non-nil, stores a vector containing markers to positions defined by the 
last expansion.")
+  "If non-nil, store a vector with position markers defined by the last 
expansion.")
 (make-variable-buffer-local 'expand-pos)
 
 (defvar expand-index 0
diff --git a/lisp/ezimage.el b/lisp/ezimage.el
index dcedd8a..9c1d859 100644
--- a/lisp/ezimage.el
+++ b/lisp/ezimage.el
@@ -1,6 +1,6 @@
 ;;; ezimage --- Generalized Image management
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: file, tags, tools
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 4ccd463..c53b20f 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -1,6 +1,6 @@
 ;;; face-remap.el --- Functions for managing `face-remapping-alist'  -*- 
lexical-binding: t -*-
 ;;
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Miles Bader <miles@gnu.org>
 ;; Keywords: faces, face remapping, display, user commands
@@ -33,7 +33,7 @@
 ;;
 ;;   (face RELATIVE_SPECS_1 RELATIVE_SPECS_2 ... BASE_SPECS)
 ;;
-;; The "specs" values are a lists of face names or face attribute-value
+;; The "specs" values are lists of face names or face attribute-value
 ;; pairs, and are merged together, with earlier values taking precedence.
 ;;
 ;; The RELATIVE_SPECS_* values are added by `face-remap-add-relative'
@@ -183,13 +183,13 @@ to apply on top of the normal definition of FACE."
 This causes the remappings specified by `face-remap-add-relative'
 to apply on top of the face specification given by SPECS.
 
-The remaining arguments, SPECS, should form a list of faces.
-Each list element should be either a face name or a property list
+The remaining arguments, SPECS, specify the base of the remapping.
+Each one of SPECS should be either a face name or a property list
 of face attribute/value pairs, like in a `face' text property.
 
-If SPECS is empty, call `face-remap-reset-base' to use the normal
-definition of FACE as the base remapping; note that this is
-different from SPECS containing a single value nil, which means
+If SPECS is empty or a single face `eq' to FACE, call `face-remap-reset-base'
+to use the normal definition of FACE as the base remapping; note that
+this is different from SPECS containing a single value nil, which means
 not to inherit from the global definition of FACE at all."
   (while (and (consp specs) (not (null (car specs))) (null (cdr specs)))
     (setq specs (car specs)))
@@ -446,7 +446,7 @@ local, and sets it to FACE."
     (setq specs (car specs)))
   (if (null specs)
       (buffer-face-mode 0)
-    (set (make-local-variable 'buffer-face-mode-face) specs)
+    (setq-local buffer-face-mode-face specs)
     (buffer-face-mode t)))
 
 ;;;###autoload
@@ -470,7 +470,7 @@ buffer local, and set it to SPECS."
   (if (or (null specs)
          (and buffer-face-mode (equal buffer-face-mode-face specs)))
       (buffer-face-mode 0)
-    (set (make-local-variable 'buffer-face-mode-face) specs)
+    (setq-local buffer-face-mode-face specs)
     (buffer-face-mode t)))
 
 (defun buffer-face-mode-invoke (specs arg &optional interactive)
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index cdff4b8..d362adc 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -1,6 +1,6 @@
 ;;; facemenu.el --- create a face menu for interactively adding fonts to text
 
-;; Copyright (C) 1994-1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Boris Goldowsky <boris@gnu.org>
 ;; Keywords: faces
diff --git a/lisp/faces.el b/lisp/faces.el
index 7355e1d..4e98338 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1,6 +1,6 @@
 ;;; faces.el --- Lisp faces -*- lexical-binding: t -*-
 
-;; Copyright (C) 1992-1996, 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1996, 1998-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
@@ -272,7 +272,7 @@ of a face name is the same for all frames."
 (defun face-equal (face1 face2 &optional frame)
   "Non-nil if faces FACE1 and FACE2 are equal.
 Faces are considered equal if all their attributes are equal.
-If the optional argument FRAME is given, report on FACE1 and FACE2 in that 
frame.
+If optional argument FRAME is given, report on FACE1 and FACE2 in that frame.
 If FRAME is t, report on the defaults for FACE1 and FACE2 (for new frames).
 If FRAME is omitted or nil, use the selected frame."
   (internal-lisp-face-equal-p face1 face2 frame))
@@ -484,7 +484,7 @@ FACES may be either a single face or a list of faces.
 
 
 (defmacro face-attribute-specified-or (value &rest body)
-  "Return VALUE, unless it's `unspecified', in which case evaluate BODY and 
return the result."
+  "Return VALUE or, if it's `unspecified', the result of evaluating BODY."
   (let ((temp (make-symbol "value")))
     `(let ((,temp ,value))
        (if (not (eq ,temp 'unspecified))
diff --git a/lisp/ffap.el b/lisp/ffap.el
index d4bddd0..1f43baf 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1,6 +1,6 @@
 ;;; ffap.el --- find file (or url) at point  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1995-1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Michelangelo Grigni <mic@mathcs.emory.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/filecache.el b/lisp/filecache.el
index 00c5313..67d2939 100644
--- a/lisp/filecache.el
+++ b/lisp/filecache.el
@@ -1,6 +1,6 @@
 ;;; filecache.el --- find files using a pre-loaded cache  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1996, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Sun Nov 10 1996
diff --git a/lisp/fileloop.el b/lisp/fileloop.el
index b778eca..cb9fe8f 100644
--- a/lisp/fileloop.el
+++ b/lisp/fileloop.el
@@ -1,6 +1,6 @@
 ;;; fileloop.el --- Operations on multiple files  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 8aa7f3c..7857177 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -1,6 +1,6 @@
 ;;; filenotify.el --- watch files for changes on disk  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
diff --git a/lisp/files-x.el b/lisp/files-x.el
index 620a2e2..628bf18 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -1,6 +1,6 @@
 ;;; files-x.el --- extended file handling commands
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Juri Linkov <juri@jurta.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/files.el b/lisp/files.el
index 2cf77d5..d2e5413 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1,6 +1,6 @@
 ;;; files.el --- file input and output commands for Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1985-1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Package: emacs
@@ -597,7 +597,7 @@ settings being applied, but still respect file-local ones.")
 
 ;; This is an odd variable IMO.
 ;; You might wonder why it is needed, when we could just do:
-;; (set (make-local-variable 'enable-local-variables) nil)
+;; (setq-local enable-local-variables nil)
 ;; These two are not precisely the same.
 ;; Setting this variable does not cause -*- mode settings to be
 ;; ignored, whereas setting enable-local-variables does.
@@ -1850,6 +1850,10 @@ expand wildcards (if any) and replace the file with 
multiple files."
 The buffer being killed is current while the hook is running.
 See `kill-buffer'.
 
+This hook is not run for internal or temporary buffers created by
+`get-buffer-create' or `generate-new-buffer' with argument
+INHIBIT-BUFFER-HOOKS non-nil.
+
 Note: Be careful with let-binding this hook considering it is
 frequently used for cleanup.")
 
@@ -1951,7 +1955,7 @@ this function prepends a \"|\" to the final result if 
necessary."
   (let ((lastname (file-name-nondirectory filename)))
     (if (string= lastname "")
        (setq lastname filename))
-    (generate-new-buffer (if (string-match-p "\\` " lastname)
+    (generate-new-buffer (if (string-prefix-p " " lastname)
                             (concat "|" lastname)
                           lastname))))
 
@@ -2137,7 +2141,7 @@ think it does, because \"free\" is pretty hard to define 
in practice."
                                       ("Yes" . ?y)
                                       ("No" . ?n)
                                       ("Open literally" . ?l)))
-                (read-char-from-minibuffer
+                (read-char-choice
                  (concat prompt " (y)es or (n)o or (l)iterally ")
                  '(?y ?Y ?n ?N ?l ?L)))))
         (cond ((memq choice '(?y ?Y)) nil)
@@ -2419,9 +2423,7 @@ Do you want to revisit the file normally now? ")))
       ;; this is a permanent local, the major mode won't eliminate it.
       (and backup-enable-predicate
           (not (funcall backup-enable-predicate buffer-file-name))
-          (progn
-            (make-local-variable 'backup-inhibited)
-            (setq backup-inhibited t)))
+           (setq-local backup-inhibited t))
       (if rawfile
          (progn
            (set-buffer-multibyte nil)
@@ -3520,7 +3522,7 @@ n  -- to ignore the local variables list.")
          (let ((print-escape-newlines t))
            (prin1 (cdr elt) buf))
          (insert "\n"))
-       (set (make-local-variable 'cursor-type) nil)
+        (setq-local cursor-type nil)
        (set-buffer-modified-p nil)
        (goto-char (point-min)))
 
@@ -3536,7 +3538,7 @@ n  -- to ignore the local variables list.")
                                 ", or C-v/M-v to scroll")))
               char)
          (if offer-save (push ?! exit-chars))
-         (setq char (read-char-from-minibuffer prompt exit-chars))
+         (setq char (read-char-choice prompt exit-chars))
          (when (and offer-save (= char ?!) unsafe-vars)
            (customize-push-and-save 'safe-local-variable-values unsafe-vars))
          (prog1 (memq char '(?! ?\s ?y))
@@ -4492,9 +4494,7 @@ the old visited file has been renamed to the new name 
FILENAME."
     (and buffer-file-name
         backup-enable-predicate
         (not (funcall backup-enable-predicate buffer-file-name))
-        (progn
-          (make-local-variable 'backup-inhibited)
-          (setq backup-inhibited t)))
+         (setq-local backup-inhibited t))
     (let ((oauto buffer-auto-save-file-name))
       (cond ((null filename)
             (setq buffer-auto-save-file-name nil))
@@ -6123,6 +6123,9 @@ This undoes all changes since the file was visited or 
saved.
 With a prefix argument, offer to revert from latest auto-save file, if
 that is more recent than the visited file.
 
+Reverting a buffer will try to preserve markers in the buffer;
+see the Info node `(elisp)Reverting' for details.
+
 This command also implements an interface for special buffers
 that contain text that doesn't come from a file, but reflects
 some other data instead (e.g. Dired buffers, `buffer-list'
@@ -6219,7 +6222,7 @@ Non-file buffers need a custom function."
                ;; Run after-revert-hook as it was before we reverted.
                (setq-default revert-buffer-internal-hook global-hook)
                (if local-hook
-                   (set (make-local-variable 'revert-buffer-internal-hook)
+                   (setq-local revert-buffer-internal-hook
                         local-hook)
                  (kill-local-variable 'revert-buffer-internal-hook))
                (run-hooks 'revert-buffer-internal-hook))
diff --git a/lisp/filesets.el b/lisp/filesets.el
index 883871c..7c01b15 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -1,6 +1,6 @@
 ;;; filesets.el --- handle group of files
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Thomas Link <sanobast-emacs@yahoo.de>
 ;; Maintainer: emacs-devel@gnu.org
@@ -1336,8 +1336,7 @@ Use the viewer defined in EV-ENTRY (a valid element of
              (progn
                (switch-to-buffer (format "Filesets: %s %s" vwr file))
                (insert output)
-               (make-local-variable 'filesets-output-buffer-flag)
-               (setq filesets-output-buffer-flag t)
+                (setq-local filesets-output-buffer-flag t)
                (set-visited-file-name file t)
                (when oh
                  (run-hooks 'oh))
diff --git a/lisp/find-cmd.el b/lisp/find-cmd.el
index 13b4116..5866b30 100644
--- a/lisp/find-cmd.el
+++ b/lisp/find-cmd.el
@@ -1,6 +1,6 @@
 ;;; find-cmd.el --- Build a valid find(1) command with sexps
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Philip Jackson <phil@shellarchive.co.uk>
 ;; Version: 0.6
diff --git a/lisp/find-dired.el b/lisp/find-dired.el
index 18330d8..adc5672 100644
--- a/lisp/find-dired.el
+++ b/lisp/find-dired.el
@@ -1,6 +1,6 @@
 ;;; find-dired.el --- run a `find' command and dired the output  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1992, 1994-1995, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1992, 1994-1995, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Roland McGrath <roland@gnu.org>,
@@ -223,11 +223,10 @@ it finishes, type \\[kill-find]."
       (set-keymap-parent map (current-local-map))
       (define-key map "\C-c\C-k" 'kill-find)
       (use-local-map map))
-    (make-local-variable 'dired-sort-inhibit)
-    (setq dired-sort-inhibit t)
-    (set (make-local-variable 'revert-buffer-function)
-        `(lambda (ignore-auto noconfirm)
-           (find-dired ,dir ,find-args)))
+    (setq-local dired-sort-inhibit t)
+    (setq-local revert-buffer-function
+                `(lambda (ignore-auto noconfirm)
+                   (find-dired ,dir ,find-args)))
     ;; Set subdir-alist so that Tree Dired will work:
     (if (fboundp 'dired-simple-subdir-alist)
        ;; will work even with nested dired format (dired-nstd.el,v 1.15
@@ -235,9 +234,9 @@ it finishes, type \\[kill-find]."
        (dired-simple-subdir-alist)
       ;; else we have an ancient tree dired (or classic dired, where
       ;; this does no harm)
-      (set (make-local-variable 'dired-subdir-alist)
-          (list (cons default-directory (point-min-marker)))))
-    (set (make-local-variable 'dired-subdir-switches) find-ls-subdir-switches)
+      (setq-local dired-subdir-alist
+                  (list (cons default-directory (point-min-marker)))))
+    (setq-local dired-subdir-switches find-ls-subdir-switches)
     (setq buffer-read-only nil)
     ;; Subdir headlerline must come first because the first marker in
     ;; subdir-alist points there.
diff --git a/lisp/find-file.el b/lisp/find-file.el
index 84d02cb..8cc9c97 100644
--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -4,7 +4,7 @@
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: c, matching, tools
 
-;; Copyright (C) 1994-1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/lisp/find-lisp.el b/lisp/find-lisp.el
index c1be5ff..2f43293 100644
--- a/lisp/find-lisp.el
+++ b/lisp/find-lisp.el
@@ -4,7 +4,7 @@
 ;; Created: Fri Mar 26 1999
 ;; Keywords: unix
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -212,21 +212,17 @@ It is a function which takes two arguments, the directory 
and its parent."
 
     (use-local-map (append (make-sparse-keymap) (current-local-map)))
 
-    (make-local-variable 'find-lisp-file-predicate)
-    (setq find-lisp-file-predicate file-predicate)
-    (make-local-variable 'find-lisp-directory-predicate)
-    (setq find-lisp-directory-predicate directory-predicate)
-    (make-local-variable 'find-lisp-regexp)
-    (setq find-lisp-regexp regexp)
-
-    (make-local-variable 'revert-buffer-function)
-    (setq revert-buffer-function
-          (lambda (_ignore1 _ignore2)
-            (find-lisp-insert-directory
-             default-directory
-             find-lisp-file-predicate
-             find-lisp-directory-predicate
-             'ignore)))
+    (setq-local find-lisp-file-predicate file-predicate)
+    (setq-local find-lisp-directory-predicate directory-predicate)
+    (setq-local find-lisp-regexp regexp)
+
+    (setq-local revert-buffer-function
+                (lambda (_ignore1 _ignore2)
+                  (find-lisp-insert-directory
+                   default-directory
+                   find-lisp-file-predicate
+                   find-lisp-directory-predicate
+                   'ignore)))
 
     ;; Set subdir-alist so that Tree Dired will work:
     (if (fboundp 'dired-simple-subdir-alist)
@@ -235,8 +231,8 @@ It is a function which takes two arguments, the directory 
and its parent."
        (dired-simple-subdir-alist)
       ;; else we have an ancient tree dired (or classic dired, where
       ;; this does no harm)
-      (set (make-local-variable 'dired-subdir-alist)
-          (list (cons default-directory (point-min-marker)))))
+      (setq-local dired-subdir-alist
+                  (list (cons default-directory (point-min-marker)))))
     (find-lisp-insert-directory
      dir file-predicate directory-predicate 'ignore)
     (goto-char (point-min))
diff --git a/lisp/finder.el b/lisp/finder.el
index a59a185..15c3fcb 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -1,6 +1,6 @@
 ;;; finder.el --- topic & keyword-based code finder
 
-;; Copyright (C) 1992, 1997-1999, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1992, 1997-1999, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
@@ -448,7 +448,7 @@ FILE should be in a form suitable for passing to 
`locate-library'."
   :syntax-table finder-mode-syntax-table
   (setq buffer-read-only t
        buffer-undo-list t)
-  (set (make-local-variable 'finder-headmark) nil))
+  (setq-local finder-headmark nil))
 
 (defun finder-summary ()
   "Summarize basic Finder commands."
diff --git a/lisp/flow-ctrl.el b/lisp/flow-ctrl.el
index b679af8..656edf2 100644
--- a/lisp/flow-ctrl.el
+++ b/lisp/flow-ctrl.el
@@ -1,6 +1,6 @@
 ;;; flow-ctrl.el --- help for lusers on cu(1) or ttys with wired-in ^S/^Q flow 
control
 
-;; Copyright (C) 1990-1991, 1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1990-1991, 1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Kevin Gallagher
diff --git a/lisp/foldout.el b/lisp/foldout.el
index 58455c2..771b81e 100644
--- a/lisp/foldout.el
+++ b/lisp/foldout.el
@@ -1,6 +1,6 @@
 ;;; foldout.el --- folding extensions for outline-mode and outline-minor-mode
 
-;; Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Kevin Broadey <KevinB@bartley.demon.co.uk>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/follow.el b/lisp/follow.el
index f1d823d..292dc4a 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -1,6 +1,6 @@
 ;;; follow.el --- synchronize windows showing the same buffer
 
-;; Copyright (C) 1995-1997, 1999, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1995-1997, 1999, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Anders Lindgren
diff --git a/lisp/font-core.el b/lisp/font-core.el
index 098253e..38307bb 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -1,6 +1,6 @@
 ;;; font-core.el --- Core interface to font-lock
 
-;; Copyright (C) 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: languages, faces
@@ -160,8 +160,8 @@ this function onto `change-major-mode-hook'."
 (defun font-lock-default-function (mode)
   ;; Turn on Font Lock mode.
   (when mode
-    (set (make-local-variable 'char-property-alias-alist)
-        (copy-tree char-property-alias-alist))
+    (setq-local char-property-alias-alist
+                (copy-tree char-property-alias-alist))
     ;; Add `font-lock-face' as an alias for the `face' property.
     (let ((elt (assq 'face char-property-alias-alist)))
       (if elt
@@ -171,8 +171,8 @@ this function onto `change-major-mode-hook'."
   ;; Turn off Font Lock mode.
   (unless mode
     ;; Remove `font-lock-face' as an alias for the `face' property.
-    (set (make-local-variable 'char-property-alias-alist)
-        (copy-tree char-property-alias-alist))
+    (setq-local char-property-alias-alist
+                (copy-tree char-property-alias-alist))
     (let ((elt (assq 'face char-property-alias-alist)))
       (when elt
        (setcdr elt (remq 'font-lock-face (cdr elt)))
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index e708e69..a51434c 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1,6 +1,6 @@
 ;;; font-lock.el --- Electric font lock mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
 ;; Author: Jamie Zawinski
 ;;     Richard Stallman
@@ -152,8 +152,8 @@
 ;;
 ;;  (add-hook 'foo-mode-hook
 ;;   (lambda ()
-;;     (set (make-local-variable 'font-lock-defaults)
-;;          '(foo-font-lock-keywords t))))
+;;     (setq-local font-lock-defaults
+;;                 '(foo-font-lock-keywords t))))
 
 ;;;; Adding Font Lock support for modes:
 
@@ -173,8 +173,8 @@
 ;;
 ;; and within `bar-mode' there could be:
 ;;
-;;  (set (make-local-variable 'font-lock-defaults)
-;;       '(bar-font-lock-keywords nil t))
+;;  (setq-local font-lock-defaults
+;;              '(bar-font-lock-keywords nil t))
 
 ;; What is fontification for?  You might say, "It's to make my code look nice."
 ;; I think it should be for adding information in the form of cues.  These cues
@@ -733,7 +733,7 @@ see the variables `c-font-lock-extra-types', 
`c++-font-lock-extra-types',
            ;; font-lock-mode it only enabled the font-core.el part, not the
            ;; font-lock-mode-internal.  Try again.
            (font-lock-mode -1)
-           (set (make-local-variable 'font-lock-defaults) '(nil t))
+           (setq-local font-lock-defaults '(nil t))
            (font-lock-mode 1))
         ;; Otherwise set or add the keywords now.
         ;; This is a no-op if it has been done already in this buffer
@@ -933,18 +933,15 @@ The value of this variable is used when Font Lock mode is 
turned on."
      ;; Prepare for jit-lock
      (remove-hook 'after-change-functions
                   #'font-lock-after-change-function t)
-     (set (make-local-variable 'font-lock-flush-function)
-          #'jit-lock-refontify)
-     (set (make-local-variable 'font-lock-ensure-function)
-          #'jit-lock-fontify-now)
+     (setq-local font-lock-flush-function #'jit-lock-refontify)
+     (setq-local font-lock-ensure-function #'jit-lock-fontify-now)
      ;; Prevent font-lock-fontify-buffer from fontifying eagerly the whole
      ;; buffer.  This is important for things like CWarn mode which
      ;; adds/removes a few keywords and does a refontify (which takes ages on
      ;; large files).
-     (set (make-local-variable 'font-lock-fontify-buffer-function)
-          #'jit-lock-refontify)
+     (setq-local font-lock-fontify-buffer-function #'jit-lock-refontify)
      ;; Don't fontify eagerly (and don't abort if the buffer is large).
-     (set (make-local-variable 'font-lock-fontified) t)
+     (setq-local font-lock-fontified t)
      ;; Use jit-lock.
      (jit-lock-register #'font-lock-fontify-region
                         (not font-lock-keywords-only))
@@ -1558,7 +1555,7 @@ START should be at the beginning of a line."
   (unless parse-sexp-lookup-properties
     ;; We wouldn't go through so much trouble if we didn't intend to use those
     ;; properties, would we?
-    (set (make-local-variable 'parse-sexp-lookup-properties) t))
+    (setq-local parse-sexp-lookup-properties t))
   ;; If `font-lock-syntactic-keywords' is a symbol, get the real keywords.
   (when (symbolp font-lock-syntactic-keywords)
     (setq font-lock-syntactic-keywords (font-lock-eval-keywords
@@ -1942,8 +1939,8 @@ Sets various variables using `font-lock-defaults' and
        (set (make-local-variable (car x)) (cdr x)))
       ;; Set up `font-lock-keywords' last because its value might depend
       ;; on other settings.
-      (set (make-local-variable 'font-lock-keywords)
-          (font-lock-eval-keywords keywords))
+      (setq-local font-lock-keywords
+                  (font-lock-eval-keywords keywords))
       ;; Local fontification?
       (while local
        (font-lock-add-keywords nil (car (car local)) (cdr (car local)))
@@ -2283,8 +2280,8 @@ This function could be MATCHER in a MATCH-ANCHORED 
`font-lock-keywords' item."
 ;;                      "ifndef" "import" "include" "line" "pragma" "undef" 
"warning")))
 ;;
 (defconst cpp-font-lock-keywords-source-depth 0
-  "An integer representing regular expression depth of 
`cpp-font-lock-keywords-source-directives'.
-Used in `cpp-font-lock-keywords'.")
+  "Regular expression depth of `cpp-font-lock-keywords-source-directives'.
+This should be an integer.  Used in `cpp-font-lock-keywords'.")
 
 (defconst cpp-font-lock-keywords
   (let* ((directives cpp-font-lock-keywords-source-directives)
diff --git a/lisp/format-spec.el b/lisp/format-spec.el
index 6af79a4..202d65d 100644
--- a/lisp/format-spec.el
+++ b/lisp/format-spec.el
@@ -1,6 +1,6 @@
 ;;; format-spec.el --- format arbitrary formatting strings -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: tools
@@ -25,7 +25,7 @@
 ;;; Code:
 
 ;;;###autoload
-(defun format-spec (format specification &optional ignore-missing)
+(defun format-spec (format specification &optional ignore-missing split)
   "Return a string based on FORMAT and SPECIFICATION.
 FORMAT is a string containing `format'-like specs like \"su - %u %k\".
 SPECIFICATION is an alist mapping format specification characters
@@ -68,50 +68,65 @@ error; if it is the symbol `ignore', leave those %-specs 
verbatim
 in the result, including their text properties, if any; if it is
 the symbol `delete', remove those %-specs from the result;
 otherwise do the same as for the symbol `ignore', but also leave
-any occurrences of \"%%\" in FORMAT verbatim in the result."
+any occurrences of \"%%\" in FORMAT verbatim in the result.
+
+If SPLIT, instead of returning a single string, a list of strings
+is returned, where each format spec is its own element."
   (with-temp-buffer
-    (insert format)
-    (goto-char (point-min))
-    (while (search-forward "%" nil t)
-      (cond
-       ;; Quoted percent sign.
-       ((= (following-char) ?%)
-        (when (memq ignore-missing '(nil ignore delete))
-          (delete-char 1)))
-       ;; Valid format spec.
-       ((looking-at (rx (? (group (+ (in " 0<>^_-"))))
-                        (? (group (+ digit)))
-                        (? (group ?. (+ digit)))
-                        (group alpha)))
-        (let* ((beg (point))
-               (end (match-end 0))
-               (flags (match-string 1))
-               (width (match-string 2))
-               (trunc (match-string 3))
-               (char (string-to-char (match-string 4)))
-               (text (assq char specification)))
-          (cond (text
-                 ;; Handle flags.
-                 (setq text (format-spec--do-flags
-                             (format "%s" (cdr text))
-                             (format-spec--parse-flags flags)
-                             (and width (string-to-number width))
-                             (and trunc (car (read-from-string trunc 1)))))
-                 ;; Insert first, to preserve text properties.
-                 (insert-and-inherit text)
-                 ;; Delete the specifier body.
-                 (delete-region (point) (+ end (length text)))
-                 ;; Delete the percent sign.
-                 (delete-region (1- beg) beg))
-                ((eq ignore-missing 'delete)
-                 ;; Delete the whole format spec.
-                 (delete-region (1- beg) end))
-                ((not ignore-missing)
-                 (error "Invalid format character: `%%%c'" char)))))
-       ;; Signal an error on bogus format strings.
-       ((not ignore-missing)
-        (error "Invalid format string"))))
-    (buffer-string)))
+    (let ((split-start (point-min))
+          (split-result nil))
+      (insert format)
+      (goto-char (point-min))
+      (while (search-forward "%" nil t)
+        (cond
+         ;; Quoted percent sign.
+         ((= (following-char) ?%)
+          (when (memq ignore-missing '(nil ignore delete))
+            (delete-char 1)))
+         ;; Valid format spec.
+         ((looking-at (rx (? (group (+ (in " 0<>^_-"))))
+                          (? (group (+ digit)))
+                          (? (group ?. (+ digit)))
+                          (group alpha)))
+          (let* ((beg (point))
+                 (end (match-end 0))
+                 (flags (match-string 1))
+                 (width (match-string 2))
+                 (trunc (match-string 3))
+                 (char (string-to-char (match-string 4)))
+                 (text (assq char specification)))
+            (when (and split
+                       (not (= (1- beg) split-start)))
+              (push (buffer-substring split-start (1- beg)) split-result))
+            (cond (text
+                   ;; Handle flags.
+                   (setq text (format-spec--do-flags
+                               (format "%s" (cdr text))
+                               (format-spec--parse-flags flags)
+                               (and width (string-to-number width))
+                               (and trunc (car (read-from-string trunc 1)))))
+                   ;; Insert first, to preserve text properties.
+                   (insert-and-inherit text)
+                   ;; Delete the specifier body.
+                   (delete-region (point) (+ end (length text)))
+                   ;; Delete the percent sign.
+                   (delete-region (1- beg) beg))
+                  ((eq ignore-missing 'delete)
+                   ;; Delete the whole format spec.
+                   (delete-region (1- beg) end))
+                  ((not ignore-missing)
+                   (error "Invalid format character: `%%%c'" char)))
+            (when split
+              (push (buffer-substring (1- beg) (point)) split-result)
+              (setq split-start (point)))))
+         ;; Signal an error on bogus format strings.
+         ((not ignore-missing)
+          (error "Invalid format string"))))
+      (if (not split)
+          (buffer-string)
+        (unless (= split-start (point-max))
+          (push (buffer-substring split-start (point-max)) split-result))
+        (nreverse split-result)))))
 
 (defun format-spec--do-flags (str flags width trunc)
   "Return STR formatted according to FLAGS, WIDTH, and TRUNC.
diff --git a/lisp/format.el b/lisp/format.el
index 905ca2d..df3bc46 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -1,6 +1,6 @@
 ;;; format.el --- read and save files in multiple formats
 
-;; Copyright (C) 1994-1995, 1997, 1999, 2001-2020 Free Software
+;; Copyright (C) 1994-1995, 1997, 1999, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Boris Goldowsky <boris@gnu.org>
@@ -237,9 +237,8 @@ For most purposes, consider using `format-encode-region' 
instead."
                   ;; delete the buffer once the write is done, but do
                   ;; it after running to-fn so it doesn't affect
                   ;; write-region calls in to-fn.
-                  (set (make-local-variable
-                        'write-region-post-annotation-function)
-                       'kill-buffer)))
+                  (setq-local write-region-post-annotation-function
+                              #'kill-buffer)))
              nil)
          ;; Otherwise just call function, it will return annotations.
          (funcall to-fn from to orig-buf)))))
diff --git a/lisp/forms.el b/lisp/forms.el
index 8974f99..5d7e6dd 100644
--- a/lisp/forms.el
+++ b/lisp/forms.el
@@ -1,6 +1,6 @@
 ;;; forms.el --- Forms mode: edit a file as a form to fill in
 
-;; Copyright (C) 1991, 1994-1997, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1991, 1994-1997, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Johan Vromans <jvromans@squirrel.nl>
@@ -436,6 +436,14 @@ Also, initial position is at last record."
 
 (defvar read-file-filter) ; bound in forms--intuit-from-file
 
+;; The code used to use `run-hooks' but in a way that's actually
+;; incompatible with hooks (and with lexical scoping), so this function
+;; approximates the actual behavior that `run-hooks' provided.
+(defun forms--run-functions (functions)
+  (if (functionp functions)
+      (funcall functions)
+    (mapc #'funcall functions)))
+
 ;;;###autoload
 (defun forms-mode (&optional primary)
   ;; FIXME: use define-derived-mode
@@ -547,8 +555,6 @@ Commands:                        Equivalent keys in 
read-only mode:
                                   "`forms-multi-line' is equal to 
`forms-field-sep'")))
              (error (concat "Forms control file error: "
                             "`forms-multi-line' must be nil or a one-character 
string"))))
-       (or (fboundp 'set-text-properties)
-           (setq forms-use-text-properties nil))
 
        ;; Validate and process forms-format-list.
        ;;(message "forms: pre-processing format list...")
@@ -568,12 +574,12 @@ Commands:                        Equivalent keys in 
read-only mode:
 
        ;; Check if record filters are defined.
        (if (and forms-new-record-filter
-                (not (fboundp forms-new-record-filter)))
+                (not (functionp forms-new-record-filter)))
            (error (concat "Forms control file error: "
                           "`forms-new-record-filter' is not a function")))
 
        (if (and forms-modified-record-filter
-                (not (fboundp forms-modified-record-filter)))
+                (not (functionp forms-modified-record-filter)))
            (error (concat "Forms control file error: "
                           "`forms-modified-record-filter' is not a function")))
 
@@ -647,7 +653,7 @@ Commands:                        Equivalent keys in 
read-only mode:
        (with-current-buffer forms--file-buffer
          (let ((inhibit-read-only t)
                (file-modified (buffer-modified-p)))
-           (mapc #'funcall read-file-filter)
+           (forms--run-functions read-file-filter)
            (if (not file-modified) (set-buffer-modified-p nil)))
          (if write-file-filter
              (add-hook 'write-file-functions write-file-filter nil t)))
@@ -875,8 +881,7 @@ Commands:                        Equivalent keys in 
read-only mode:
           (list 'face forms--rw-face 'front-sticky '(face))))
 
        ;; Enable `post-command-hook' to restore the properties.
-       (setq post-command-hook
-             (append (list 'forms--iif-post-command-hook) post-command-hook)))
+       (add-hook 'post-command-hook #'forms--iif-post-command-hook))
 
     ;; No action needed.  Clear marker.
     (setq forms--iif-start nil)))
@@ -885,8 +890,7 @@ Commands:                        Equivalent keys in 
read-only mode:
   "`post-command-hook' function for read-only segments."
 
   ;; Disable `post-command-hook'.
-  (setq post-command-hook
-       (delq 'forms--iif-hook-post-command-hook post-command-hook))
+  (remove-hook 'post-command-hook #'forms--iif-post-command-hook)
 
   ;; Restore properties.
   (if forms--iif-start
@@ -916,7 +920,7 @@ Commands:                        Equivalent keys in 
read-only mode:
      (if forms-use-text-properties
         `(lambda (arg)
            (let ((inhibit-read-only t))
-             ,@(apply 'append
+             ,@(apply #'append
                       (mapcar #'forms--make-format-elt-using-text-properties
                               forms-format-list))
              ;; Prevent insertion before the first text.
@@ -929,7 +933,7 @@ Commands:                        Equivalent keys in 
read-only mode:
                                       '(rear-nonsticky nil)))
            (setq forms--iif-start nil))
        `(lambda (arg)
-         ,@(apply 'append
+         ,@(apply #'append
                   (mapcar #'forms--make-format-elt forms-format-list)))))
 
     ;; We have tallied the number of markers and dynamic texts,
@@ -1100,7 +1104,7 @@ Commands:                        Equivalent keys in 
read-only mode:
        `(lambda nil
          (let (here)
            (goto-char (point-min))
-           ,@(apply 'append
+           ,@(apply #'append
                     (mapcar
                      #'forms--make-parser-elt
                      (append forms-format-list (list nil)))))))))
@@ -1219,7 +1223,7 @@ Commands:                        Equivalent keys in 
read-only mode:
          (setq the-record
                (with-current-buffer forms--file-buffer
                  (let ((inhibit-read-only t))
-                   (run-hooks 'read-file-filter))
+                   (forms--run-functions read-file-filter))
                  (goto-char (point-min))
                  (forms--get-record)))
 
@@ -1427,7 +1431,7 @@ Commands:                        Equivalent keys in 
read-only mode:
   ;;
   ;; We have our own revert function - use it.
   (make-local-variable 'revert-buffer-function)
-  (setq revert-buffer-function 'forms--revert-buffer)
+  (setq revert-buffer-function #'forms--revert-buffer)
 
   t)
 
@@ -1900,7 +1904,7 @@ after writing out the data."
        ;; Write file hooks are run via write-file-functions.
        ;; (if write-file-filter
        ;;  (save-excursion
-       ;;   (run-hooks 'write-file-filter)))
+       ;;   (forms--run-functions write-file-filter)))
 
        ;; If they have a write-file-filter, force the buffer to be
        ;; saved even if it doesn't seem to be changed.  First, they
@@ -1912,7 +1916,7 @@ after writing out the data."
        (save-buffer args)
        (if read-file-filter
           (save-excursion
-            (run-hooks 'read-file-filter)))
+            (forms--run-functions read-file-filter)))
        (set-buffer-modified-p nil)))
     ;; Make sure we end up with the same record number as we started.
     ;; Since read-file-filter may perform arbitrary transformations on
@@ -2037,20 +2041,19 @@ Usage: (setq forms-number-of-fields
 (defun forms--debug (&rest args)
   "Internal debugging routine."
   (if forms--debug
-      (let ((ret nil))
-       (while args
-         (let ((el (car-safe args)))
-           (setq args (cdr-safe args))
-           (if (stringp el)
-               (setq ret (concat ret el))
-             (setq ret (concat ret (prin1-to-string el) " = "))
-             (if (boundp el)
-                 (let ((vel (eval el)))
-                   (setq ret (concat ret (prin1-to-string vel) "\n")))
-               (setq ret (concat ret "<unbound>" "\n")))
-             (if (fboundp el)
-                 (setq ret (concat ret (prin1-to-string (symbol-function el))
-                                   "\n"))))))
+      (let ((ret
+            (mapconcat
+             (lambda (el)
+               (if (stringp el) el
+                 (concat (prin1-to-string el) " = "
+                         (if (boundp el)
+                             (prin1-to-string (eval el))
+                           "<unbound>")
+                         "\n"
+                         (if (fboundp el)
+                             (concat (prin1-to-string (symbol-function el))
+                                     "\n")))))
+             args "")))
        (with-current-buffer (get-buffer-create "*forms-mode debug*")
          (if (zerop (buffer-size))
              (emacs-lisp-mode))
diff --git a/lisp/frame.el b/lisp/frame.el
index 772ba3d..c712762 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1,6 +1,6 @@
 ;;; frame.el --- multi-frame management independent of window systems  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1993-1994, 1996-1997, 2000-2020 Free Software
+;; Copyright (C) 1993-1994, 1996-1997, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/frameset.el b/lisp/frameset.el
index 0462d77..e698d54 100644
--- a/lisp/frameset.el
+++ b/lisp/frameset.el
@@ -1,6 +1,6 @@
 ;;; frameset.el --- save and restore frame and window setup -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Juanma Barranquero <lekktu@gmail.com>
 ;; Keywords: convenience
diff --git a/lisp/fringe.el b/lisp/fringe.el
index 422d014..e2d7968 100644
--- a/lisp/fringe.el
+++ b/lisp/fringe.el
@@ -1,6 +1,6 @@
 ;;; fringe.el --- fringe setup and control  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index 5875dce..f3ea22a 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -1,6 +1,6 @@
 ;;; generic-x.el --- A collection of generic modes
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Tue Oct 08 1996
diff --git a/lisp/gnus/ChangeLog.1 b/lisp/gnus/ChangeLog.1
index e326530..6ad87f0 100644
--- a/lisp/gnus/ChangeLog.1
+++ b/lisp/gnus/ChangeLog.1
@@ -3702,7 +3702,7 @@
        * gnus.el: Quassia Gnus v0.1 is released.
 
 
-  Copyright (C) 1997-2020 Free Software Foundation, Inc.
+  Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/gnus/ChangeLog.2 b/lisp/gnus/ChangeLog.2
index 533ceb8..35402df 100644
--- a/lisp/gnus/ChangeLog.2
+++ b/lisp/gnus/ChangeLog.2
@@ -18538,7 +18538,7 @@
 
 See ChangeLog.1 for earlier changes.
 
-  Copyright (C) 2000-2002, 2004-2020 Free Software Foundation, Inc.
+  Copyright (C) 2000-2002, 2004-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/gnus/ChangeLog.3 b/lisp/gnus/ChangeLog.3
index 582c9bd..2aba3a5 100644
--- a/lisp/gnus/ChangeLog.3
+++ b/lisp/gnus/ChangeLog.3
@@ -26325,7 +26325,7 @@
 
 See ChangeLog.2 for earlier changes.
 
-  Copyright (C) 2004-2020 Free Software Foundation, Inc.
+  Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/gnus/canlock.el b/lisp/gnus/canlock.el
index ed0a89c..6c8c1a5 100644
--- a/lisp/gnus/canlock.el
+++ b/lisp/gnus/canlock.el
@@ -1,6 +1,6 @@
 ;;; canlock.el --- functions for Cancel-Lock feature
 
-;; Copyright (C) 1998-1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Katsumi Yamaoka <yamaoka@jpl.org>
 ;; Keywords: news, cancel-lock, hmac, sha1, rfc2104
diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el
index 647f643..b77dcdd 100644
--- a/lisp/gnus/deuglify.el
+++ b/lisp/gnus/deuglify.el
@@ -1,6 +1,6 @@
 ;;; deuglify.el --- deuglify broken Outlook (Express) articles
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Raymond Scholz <rscholz@zonix.de>
 ;;         Thomas Steffen
@@ -250,21 +250,25 @@
   :group 'gnus-outlook-deuglify)
 
 (defcustom gnus-outlook-deuglify-unwrap-stop-chars nil ;; ".?!" or nil
-  "Characters that inhibit unwrapping if they are the last one on the cited 
line above the possible wrapped line."
+  "Characters that, when at end of cited line, inhibit unwrapping.
+When one of these characters is the last one on the cited line
+above the possibly wrapped line, it disallows unwrapping."
   :version "22.1"
   :type '(radio (const :format "None  " nil)
                (string :value ".?!"))
   :group 'gnus-outlook-deuglify)
 
 (defcustom gnus-outlook-deuglify-no-wrap-chars "`"
-  "Characters that inhibit unwrapping if they are the first one in the 
possibly wrapped line."
+  "Characters that, when at beginning of line, inhibit unwrapping.
+When one of these characters is the first one in the possibly
+wrapped line, it disallows unwrapping."
   :version "22.1"
   :type 'string
   :group 'gnus-outlook-deuglify)
 
 (defcustom  gnus-outlook-deuglify-attrib-cut-regexp
   "\\(On \\|Am \\)?\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\),[^,]+, "
-  "Regular expression matching the beginning of an attribution line that 
should be cut off."
+  "Regexp matching beginning of attribution line that should be cut off."
   :version "22.1"
   :type 'regexp
   :group 'gnus-outlook-deuglify)
@@ -338,7 +342,7 @@ NODISPLAY is non-nil, don't redisplay the article buffer."
   (unless nodisplay (gnus-outlook-display-article-buffer)))
 
 (defun gnus-outlook-rearrange-article (attr-start)
-  "Put the text from ATTR-START to the end of buffer at the top of the article 
buffer."
+  "Put text from ATTR-START to the end of buffer at the top of the article 
buffer."
   ;; FIXME: 1.  (*) text/plain          ( ) text/html
   (let ((inhibit-read-only t)
        (cite-marks gnus-outlook-deuglify-cite-marks))
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el
index 6d24b40..ab97c59 100644
--- a/lisp/gnus/gmm-utils.el
+++ b/lisp/gnus/gmm-utils.el
@@ -1,6 +1,6 @@
 ;;; gmm-utils.el --- Utility functions for Gnus, Message and MML
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Reiner Steib <reiner.steib@gmx.de>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 053e7ea..56640ea 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -1,6 +1,6 @@
 ;;; gnus-agent.el --- unplugged support for Gnus
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
@@ -454,7 +454,7 @@ manipulated as follows:
                                      (symbol-name major-mode))
                        (match-string 1 (symbol-name major-mode))))
         (mode (intern (format "gnus-agent-%s-mode" buffer))))
-    (set (make-local-variable 'gnus-agent-mode) t)
+    (setq-local gnus-agent-mode t)
     (set mode nil)
     (set (make-local-variable mode) t)
     ;; Set up the menu.
@@ -1056,8 +1056,8 @@ article's mark is toggled."
 (defun gnus-agent-get-undownloaded-list ()
   "Construct list of articles that have not been downloaded."
   (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name)))
-    (when (set (make-local-variable 'gnus-newsgroup-agentized)
-               (gnus-agent-method-p gnus-command-method))
+    (when (setq-local gnus-newsgroup-agentized
+                      (gnus-agent-method-p gnus-command-method))
       (let* ((alist (gnus-agent-load-alist gnus-newsgroup-name))
              (headers (sort (mapcar (lambda (h)
                                       (mail-header-number h))
@@ -1440,7 +1440,7 @@ downloaded into the agent."
     (let ((file (gnus-agent-lib-file "history")))
       (when (file-exists-p file)
        (nnheader-insert-file-contents file))
-      (set (make-local-variable 'gnus-agent-file-name) file))))
+      (setq-local gnus-agent-file-name file))))
 
 (defun gnus-agent-close-history ()
   (when (gnus-buffer-live-p gnus-agent-current-history)
@@ -1901,7 +1901,8 @@ article numbers will be returned."
     articles))
 
 (defsubst gnus-agent-read-article-number ()
-  "Reads the article number at point.  Returns nil when a valid article number 
can not be read."
+  "Read the article number at point.
+Return nil when a valid article number can not be read."
 
   (when (looking-at "[0-9]+\t")
     (read (current-buffer))))
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 7f594c9..4ade36f 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1,6 +1,6 @@
 ;;; gnus-art.el --- article mode commands for Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -289,7 +289,9 @@ asynchronously.  The compressed face will be piped to this 
command."
 (defcustom gnus-article-banner-alist nil
   "Banner alist for stripping.
 For example,
-     ((egroups . \"^[ \\t\\n]*-------------------+\\\\( \\\\(e\\\\|Yahoo! 
\\\\)Groups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))"
+     ((egroups . (concat \"^[ \\t\\n]*-------------------+\\\\\"
+                         \"( \\\\(e\\\\|Yahoo! \\\\)Groups Sponsor -+\\\\)?\"
+                         \"....\\n\\\\(.+\\n\\\\)+\")))"
   :version "21.1"
   :type '(repeat (cons symbol regexp))
   :group 'gnus-article-washing)
@@ -1059,7 +1061,7 @@ used."
     ("view the part" . gnus-mime-view-part)
     ("pipe to command" . gnus-mime-pipe-part)
     ("toggle display" . gnus-article-press-button)
-    ("toggle display" . gnus-article-view-part-as-charset)
+    ("view as charset" . gnus-mime-view-part-as-charset)
     ("view as type" . gnus-mime-view-part-as-type)
     ("view internally" . gnus-mime-view-part-internally)
     ("view externally" . gnus-mime-view-part-externally))
@@ -3850,8 +3852,7 @@ This format is defined by the `gnus-article-time-format' 
variable."
   (unless gnus-article-emphasis-alist
     (let ((name (and gnus-newsgroup-name
                     (gnus-group-real-name gnus-newsgroup-name))))
-      (make-local-variable 'gnus-article-emphasis-alist)
-      (setq gnus-article-emphasis-alist
+      (setq-local gnus-article-emphasis-alist
            (nconc
             (let ((alist gnus-group-highlight-words-alist) elem highlight)
               (while (setq elem (pop alist))
@@ -4495,10 +4496,10 @@ commands:
   (when (gnus-visual-p 'article-menu 'menu)
     (gnus-article-make-menu-bar)
     (when gnus-summary-tool-bar-map
-      (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map)))
+      (setq-local tool-bar-map gnus-summary-tool-bar-map)))
   (gnus-update-format-specifications nil 'article-mode)
-  (set (make-local-variable 'page-delimiter) gnus-page-delimiter)
-  (set (make-local-variable 'gnus-page-broken) nil)
+  (setq-local page-delimiter gnus-page-delimiter)
+  (setq-local gnus-page-broken nil)
   (make-local-variable 'gnus-article-current-summary)
   (make-local-variable 'gnus-article-mime-handles)
   (make-local-variable 'gnus-article-decoded-p)
@@ -4507,13 +4508,12 @@ commands:
   (make-local-variable 'gnus-article-image-alist)
   (make-local-variable 'gnus-article-charset)
   (make-local-variable 'gnus-article-ignored-charsets)
-  (set (make-local-variable 'bookmark-make-record-function)
-       'gnus-summary-bookmark-make-record)
+  (setq-local bookmark-make-record-function 'gnus-summary-bookmark-make-record)
   ;; Prevent Emacs from displaying non-break space with
   ;; `nobreak-space' face.
-  (set (make-local-variable 'nobreak-char-display) nil)
+  (setq-local nobreak-char-display nil)
   ;; Enable `gnus-article-remove-images' to delete images shr.el renders.
-  (set (make-local-variable 'shr-put-image-function) 'gnus-shr-put-image)
+  (setq-local shr-put-image-function 'gnus-shr-put-image)
   (unless gnus-article-show-cursor
     (setq cursor-in-non-selected-windows nil))
   (gnus-set-default-directory)
@@ -4557,7 +4557,7 @@ commands:
                 t)))
        (let ((summary gnus-summary-buffer))
          (with-current-buffer name
-           (set (make-local-variable 'gnus-article-edit-mode) nil)
+            (setq-local gnus-article-edit-mode nil)
            (gnus-article-stop-animations)
            (when gnus-article-mime-handles
              (mm-destroy-parts gnus-article-mime-handles)
@@ -4568,14 +4568,14 @@ commands:
            (setq buffer-read-only t)
            (unless (derived-mode-p 'gnus-article-mode)
              (gnus-article-mode))
-           (set (make-local-variable 'gnus-summary-buffer) summary)
+            (setq-local gnus-summary-buffer summary)
            (setq truncate-lines gnus-article-truncate-lines)
            (current-buffer)))
       (let ((summary gnus-summary-buffer))
        (with-current-buffer (gnus-get-buffer-create name)
          (gnus-article-mode)
          (setq truncate-lines gnus-article-truncate-lines)
-         (set (make-local-variable 'gnus-summary-buffer) summary)
+          (setq-local gnus-summary-buffer summary)
          (gnus-summary-set-local-parameters gnus-newsgroup-name)
          (when article-lapsed-timer
            (gnus-stop-date-timer))
@@ -5036,7 +5036,7 @@ and `gnus-mime-delete-part', and not provided at run-time 
normally."
          (setq gnus-article-mime-handles nil)
          (let ((mbl1 mml-buffer-list))
            (setq mml-buffer-list mbl)
-           (set (make-local-variable 'mml-buffer-list) mbl1))
+            (setq-local mml-buffer-list mbl1))
          (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))
      `(lambda (no-highlight)
        (let ((mail-parse-charset (or gnus-article-charset
@@ -6902,8 +6902,8 @@ then we display only bindings that start with that 
prefix."
        (setq draft gnus-draft-mode)))
     (with-temp-buffer
       (use-local-map keymap)
-      (set (make-local-variable 'gnus-agent-summary-mode) agent)
-      (set (make-local-variable 'gnus-draft-mode) draft)
+      (setq-local gnus-agent-summary-mode agent)
+      (setq-local gnus-draft-mode draft)
       (describe-bindings prefix))
     (let ((item `((lambda (prefix)
                    (with-current-buffer ,(current-buffer)
@@ -7247,10 +7247,9 @@ This is an extended text-mode.
 \\{gnus-article-edit-mode-map}"
   (make-local-variable 'gnus-article-edit-done-function)
   (make-local-variable 'gnus-prev-winconf)
-  (set (make-local-variable 'font-lock-defaults)
-       '(message-font-lock-keywords t))
-  (set (make-local-variable 'mail-header-separator) "")
-  (set (make-local-variable 'gnus-article-edit-mode) t)
+  (setq-local font-lock-defaults '(message-font-lock-keywords t))
+  (setq-local mail-header-separator "")
+  (setq-local gnus-article-edit-mode t)
   (mml-mode)
   (setq buffer-read-only nil)
   (buffer-enable-undo)
diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el
index 9b08e6a..fefd02c 100644
--- a/lisp/gnus/gnus-async.el
+++ b/lisp/gnus/gnus-async.el
@@ -1,6 +1,6 @@
 ;;; gnus-async.el --- asynchronous support for Gnus  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-bcklg.el b/lisp/gnus/gnus-bcklg.el
index d28ae85..d6f53e4 100644
--- a/lisp/gnus/gnus-bcklg.el
+++ b/lisp/gnus/gnus-bcklg.el
@@ -1,6 +1,6 @@
 ;;; gnus-bcklg.el --- backlog functions for Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-bookmark.el b/lisp/gnus/gnus-bookmark.el
index 4f85349..57859d8 100644
--- a/lisp/gnus/gnus-bookmark.el
+++ b/lisp/gnus/gnus-bookmark.el
@@ -1,6 +1,6 @@
 ;;; gnus-bookmark.el --- Bookmarks in Gnus
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Bastien Guerry <bzg AT altern DOT org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index c31d97d..36657e4 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -1,6 +1,6 @@
 ;;; gnus-cache.el --- cache interface for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el
index 912671a..d02e898 100644
--- a/lisp/gnus/gnus-cite.el
+++ b/lisp/gnus/gnus-cite.el
@@ -1,6 +1,6 @@
 ;;; gnus-cite.el --- parse citations in articles for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 
diff --git a/lisp/gnus/gnus-cloud.el b/lisp/gnus/gnus-cloud.el
index 3e23e26..f7c71f4 100644
--- a/lisp/gnus/gnus-cloud.el
+++ b/lisp/gnus/gnus-cloud.el
@@ -1,6 +1,6 @@
 ;;; gnus-cloud.el --- storing and retrieving data via IMAP
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: mail
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el
index f0c4d07..dc14943 100644
--- a/lisp/gnus/gnus-cus.el
+++ b/lisp/gnus/gnus-cus.el
@@ -1,6 +1,6 @@
 ;;; gnus-cus.el --- customization commands for Gnus
 
-;; Copyright (C) 1996, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: news
@@ -49,18 +49,15 @@ if that value is non-nil."
   ;; Emacs stuff:
   (when (and (facep 'custom-button-face)
             (facep 'custom-button-pressed-face))
-    (set (make-local-variable 'widget-button-face)
-        'custom-button-face)
-    (set (make-local-variable 'widget-button-pressed-face)
-        'custom-button-pressed-face)
-    (set (make-local-variable 'widget-mouse-face)
-        'custom-button-pressed-face))
+    (setq-local widget-button-face 'custom-button-face)
+    (setq-local widget-button-pressed-face 'custom-button-pressed-face)
+    (setq-local widget-mouse-face 'custom-button-pressed-face))
   (when (and (boundp 'custom-raised-buttons)
             (symbol-value 'custom-raised-buttons))
-    (set (make-local-variable 'widget-push-button-prefix) "")
-    (set (make-local-variable 'widget-push-button-suffix) "")
-    (set (make-local-variable 'widget-link-prefix) "")
-    (set (make-local-variable 'widget-link-suffix) "")))
+    (setq-local widget-push-button-prefix "")
+    (setq-local widget-push-button-suffix "")
+    (setq-local widget-link-prefix "")
+    (setq-local widget-link-suffix "")))
 
 ;;; Group Customization:
 
@@ -380,10 +377,8 @@ category."))
     (gnus-kill-buffer "*Gnus Customize*")
     (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*"))
     (gnus-custom-mode)
-    (make-local-variable 'gnus-custom-group)
-    (setq gnus-custom-group group)
-    (make-local-variable 'gnus-custom-topic)
-    (setq gnus-custom-topic topic)
+    (setq-local gnus-custom-group group)
+    (setq-local gnus-custom-topic topic)
     (buffer-disable-undo)
     (widget-insert "Customize the ")
     (if group
@@ -848,8 +843,7 @@ This can be changed using the 
`\\[gnus-score-change-score-file]' command."
     (kill-buffer (gnus-get-buffer-create "*Gnus Customize*"))
     (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*"))
     (gnus-custom-mode)
-    (make-local-variable 'gnus-custom-score-alist)
-    (setq gnus-custom-score-alist scores)
+    (setq-local gnus-custom-score-alist scores)
     (widget-insert "Customize the ")
     (widget-create 'info-link
                   :help-echo "Push me to learn more."
@@ -867,8 +861,7 @@ Check the [ ] for the entries you want to apply to this 
score file, then
 edit the value to suit your taste.  Don't forget to mark the checkbox,
 if you do all your changes will be lost.  ")
     (widget-insert "\n\n")
-    (make-local-variable 'gnus-custom-scores)
-    (setq gnus-custom-scores
+    (setq-local gnus-custom-scores
          (widget-create 'group
                         :value scores
                         `(checklist :inline t
@@ -1052,10 +1045,9 @@ articles in the thread.
          "\n    Note: Empty fields default to the customizable global\
  variables.\n\n")
 
-        (set (make-local-variable 'gnus-agent-cat-name)
-             name))
+        (setq-local gnus-agent-cat-name name))
 
-      (set (make-local-variable 'category-fields) nil)
+      (setq-local category-fields nil)
       (gnus-agent-cat-prepare-category-field agent-predicate)
 
       (gnus-agent-cat-prepare-category-field agent-score)
diff --git a/lisp/gnus/gnus-dbus.el b/lisp/gnus/gnus-dbus.el
index 8fbeffb..12bf7bb 100644
--- a/lisp/gnus/gnus-dbus.el
+++ b/lisp/gnus/gnus-dbus.el
@@ -1,6 +1,6 @@
 ;;; gnus-dbus.el --- DBUS integration for Gnus       -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020  Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
 
diff --git a/lisp/gnus/gnus-delay.el b/lisp/gnus/gnus-delay.el
index 63e938e..477ad88 100644
--- a/lisp/gnus/gnus-delay.el
+++ b/lisp/gnus/gnus-delay.el
@@ -1,6 +1,6 @@
 ;;; gnus-delay.el --- Delayed posting of articles
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
 ;; Keywords: mail, news, extensions
diff --git a/lisp/gnus/gnus-demon.el b/lisp/gnus/gnus-demon.el
index 99a736f..219f15e 100644
--- a/lisp/gnus/gnus-demon.el
+++ b/lisp/gnus/gnus-demon.el
@@ -1,6 +1,6 @@
 ;;; gnus-demon.el --- daemonic Gnus behavior
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-diary.el b/lisp/gnus/gnus-diary.el
index b36faa8..78f1e53 100644
--- a/lisp/gnus/gnus-diary.el
+++ b/lisp/gnus/gnus-diary.el
@@ -1,6 +1,6 @@
 ;;; gnus-diary.el --- Wrapper around the NNDiary Gnus back end
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author:        Didier Verna <didier@didierverna.net>
 ;; Created:       Tue Jul 20 10:42:55 1999
diff --git a/lisp/gnus/gnus-dired.el b/lisp/gnus/gnus-dired.el
index 0063ed2..6f231c4 100644
--- a/lisp/gnus/gnus-dired.el
+++ b/lisp/gnus/gnus-dired.el
@@ -1,6 +1,6 @@
 ;;; gnus-dired.el --- utility functions where gnus and dired meet
 
-;; Copyright (C) 1996-1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Authors: Benjamin Rutt <brutt@bloomington.in.us>,
 ;;          Shenghuo Zhu <zsh@cs.rochester.edu>
diff --git a/lisp/gnus/gnus-draft.el b/lisp/gnus/gnus-draft.el
index 3a9bf2a..5f7ed38 100644
--- a/lisp/gnus/gnus-draft.el
+++ b/lisp/gnus/gnus-draft.el
@@ -1,6 +1,6 @@
 ;;; gnus-draft.el --- draft message support for Gnus
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-dup.el b/lisp/gnus/gnus-dup.el
index 1f247aa..f7d61bb 100644
--- a/lisp/gnus/gnus-dup.el
+++ b/lisp/gnus/gnus-dup.el
@@ -1,6 +1,6 @@
 ;;; gnus-dup.el --- suppression of duplicate articles in Gnus  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-eform.el b/lisp/gnus/gnus-eform.el
index 1bc1261e..feee732 100644
--- a/lisp/gnus/gnus-eform.el
+++ b/lisp/gnus/gnus-eform.el
@@ -1,6 +1,6 @@
 ;;; gnus-eform.el --- a mode for editing forms for Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-fun.el b/lisp/gnus/gnus-fun.el
index b6d6aa4..615f4a5 100644
--- a/lisp/gnus/gnus-fun.el
+++ b/lisp/gnus/gnus-fun.el
@@ -1,6 +1,6 @@
 ;;; gnus-fun.el --- various frivolous extension functions to Gnus
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el
index 9c24de4..a7ca733 100644
--- a/lisp/gnus/gnus-gravatar.el
+++ b/lisp/gnus/gnus-gravatar.el
@@ -1,6 +1,6 @@
 ;;; gnus-gravatar.el --- Gnus Gravatar support -*- lexical-binding: t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Julien Danjou <julien@danjou.info>
 ;; Keywords: multimedia, news
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 73fda66..ff792c5 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1,6 +1,6 @@
 ;;; gnus-group.el --- group mode commands for Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -60,7 +60,7 @@
   :type 'string)
 
 (defcustom gnus-keep-same-level nil
-  "Non-nil means that the next newsgroup after the current will be on the same 
level.
+  "Non-nil means that the newsgroup after this one will be on the same level.
 When you type, for instance, `n' after reading the last article in the
 current newsgroup, you will go to the next newsgroup.  If this variable
 is nil, the next newsgroup will be the next from the group
@@ -1098,7 +1098,7 @@ When FORCE, rebuild the tool bar."
                                        gnus-group-tool-bar-zap-list
                                        'gnus-group-mode-map)))
       (if map
-         (set (make-local-variable 'tool-bar-map) map))))
+         (setq-local tool-bar-map map))))
   gnus-group-tool-bar-map)
 
 (define-derived-mode gnus-group-mode gnus-mode "Group"
@@ -1745,7 +1745,8 @@ already.  If INFO-UNCHANGED is non-nil, dribble buffer is 
not updated."
        (prog1
            (setq mode-line-buffer-identification
                  (gnus-mode-line-buffer-identification
-                  (list mode-string)))
+                  (list (propertize mode-string
+                                    'face 'mode-line-buffer-id))))
          (set-buffer-modified-p modified))))))
 
 (defun gnus-group-group-name ()
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index 002a1c1..bb1ee5a 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -1,6 +1,6 @@
 ;;; gnus-html.el --- Render HTML in a buffer.
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: html, web
diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 389bce8..1e0e207 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -1,6 +1,6 @@
 ;;; gnus-icalendar.el --- reply to iCalendar meeting requests  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Jan Tatarik <Jan.Tatarik@gmail.com>
 ;; Keywords: mail, icalendar, org
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index b8be766..9c68773 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -1,6 +1,6 @@
 ;;; gnus-int.el --- backend interface functions for Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-kill.el b/lisp/gnus/gnus-kill.el
index a772281..7e59202 100644
--- a/lisp/gnus/gnus-kill.el
+++ b/lisp/gnus/gnus-kill.el
@@ -1,6 +1,6 @@
 ;;; gnus-kill.el --- kill commands for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
diff --git a/lisp/gnus/gnus-logic.el b/lisp/gnus/gnus-logic.el
index a29772f..105222d 100644
--- a/lisp/gnus/gnus-logic.el
+++ b/lisp/gnus/gnus-logic.el
@@ -1,6 +1,6 @@
 ;;; gnus-logic.el --- advanced scoring code for Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-mh.el b/lisp/gnus/gnus-mh.el
index 6433369..b26b736 100644
--- a/lisp/gnus/gnus-mh.el
+++ b/lisp/gnus/gnus-mh.el
@@ -1,6 +1,6 @@
 ;;; gnus-mh.el --- mh-e interface for Gnus
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
diff --git a/lisp/gnus/gnus-ml.el b/lisp/gnus/gnus-ml.el
index acef537..a47c155 100644
--- a/lisp/gnus/gnus-ml.el
+++ b/lisp/gnus/gnus-ml.el
@@ -1,6 +1,6 @@
 ;;; gnus-ml.el --- Mailing list minor mode for Gnus
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Julien Gilles <jgilles@free.fr>
 ;; Keywords: news, mail
diff --git a/lisp/gnus/gnus-mlspl.el b/lisp/gnus/gnus-mlspl.el
index 8cbe858..ed8d15a 100644
--- a/lisp/gnus/gnus-mlspl.el
+++ b/lisp/gnus/gnus-mlspl.el
@@ -1,6 +1,6 @@
 ;;; gnus-mlspl.el --- a group params-based mail splitting mechanism
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
 ;; Keywords: news, mail
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 465871e..419b5ea 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1,6 +1,6 @@
 ;;; gnus-msg.el --- mail and post interface for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -464,8 +464,7 @@ only affect the Gcc copy, but not the original message."
         (gnus-inews-add-send-actions ,winconf ,buffer ,oarticle ,config
                                      ,yanked ,winconf-name)
         (setq gnus-message-buffer (current-buffer))
-        (set (make-local-variable 'gnus-message-group-art)
-             (cons ,group ,article))
+         (setq-local gnus-message-group-art (cons ,group ,article))
          ;; Enable highlighting of different citation levels
          (when gnus-message-highlight-citation
            (gnus-message-citation-mode 1))
@@ -473,7 +472,7 @@ only affect the Gcc copy, but not the original message."
          (if (eq major-mode 'message-mode)
              (let ((mbl1 mml-buffer-list))
                (setq mml-buffer-list mbl)  ;; Global value
-               (set (make-local-variable 'mml-buffer-list) mbl1);; Local value
+               (setq-local mml-buffer-list mbl1) ;; Local value
                (add-hook 'change-major-mode-hook 'mml-destroy-buffers nil t)
                (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))
            (mml-destroy-buffers)
@@ -724,10 +723,10 @@ network.  The corresponding back end must have a 
`request-post' method."
          (gnus-setup-message 'message
            (progn
              (message-news (gnus-group-real-name gnus-newsgroup-name))
-             (set (make-local-variable 'gnus-discouraged-post-methods)
-                  (remove
-                   (car (gnus-find-method-for-group gnus-newsgroup-name))
-                   gnus-discouraged-post-methods)))))))))
+              (setq-local gnus-discouraged-post-methods
+                          (remove
+                           (car (gnus-find-method-for-group 
gnus-newsgroup-name))
+                           gnus-discouraged-post-methods)))))))))
 
 (defun gnus-summary-post-news (&optional arg)
   "Start composing a message.  Post to the current group by default.
@@ -1926,8 +1925,8 @@ this is a reply."
                         (message-goto-body)
                         (insert ,(cdr result)))))
                   ((eq 'signature (car result))
-                   (set (make-local-variable 'message-signature) nil)
-                   (set (make-local-variable 'message-signature-file) nil)
+                    (setq-local message-signature nil)
+                    (setq-local message-signature-file nil)
                    (if (not (cdr result))
                        'ignore
                      `(lambda ()
@@ -1953,8 +1952,8 @@ this is a reply."
       (when (or name address)
        (add-hook 'message-setup-hook
                  `(lambda ()
-                    (set (make-local-variable 'user-mail-address)
-                         ,(or (cdr address) user-mail-address))
+                     (setq-local user-mail-address
+                                 ,(or (cdr address) user-mail-address))
                     (let ((user-full-name ,(or (cdr name) (user-full-name)))
                           (user-mail-address
                            ,(or (cdr address) user-mail-address)))
diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el
index 90e4a98..e772dd8 100644
--- a/lisp/gnus/gnus-notifications.el
+++ b/lisp/gnus/gnus-notifications.el
@@ -1,6 +1,6 @@
 ;; gnus-notifications.el -- Send notification on new message in Gnus
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Julien Danjou <julien@danjou.info>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-picon.el b/lisp/gnus/gnus-picon.el
index a4d2d99..92def9a 100644
--- a/lisp/gnus/gnus-picon.el
+++ b/lisp/gnus/gnus-picon.el
@@ -1,6 +1,6 @@
 ;;; gnus-picon.el --- displaying pretty icons in Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news xpm annotation glyph faces
diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el
index 57a9793..1e5d2a06 100644
--- a/lisp/gnus/gnus-range.el
+++ b/lisp/gnus/gnus-range.el
@@ -1,6 +1,6 @@
 ;;; gnus-range.el --- range and sequence functions for Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index 65bcd0e..068066e 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -1,6 +1,6 @@
 ;;; gnus-registry.el --- article registry for Gnus  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Ted Zlatanov <tzz@lifelogs.com>
 ;; Keywords: news registry
@@ -54,6 +54,9 @@
 
 ;; (: gnus-registry-split-fancy-with-parent)
 
+;; This won't work as expected unless `gnus-registry-register-all'
+;; is set to t.
+
 ;; You should also consider using the nnregistry backend to look up
 ;; articles.  See the Gnus manual for more information.
 
@@ -160,6 +163,11 @@ nnmairix groups are specifically excluded because they are 
ephemeral."
                  (const :tag "Always Install" t)
                  (const :tag "Ask Me" ask)))
 
+(defcustom gnus-registry-register-all t
+  "If non-nil, register all articles in the registry."
+  :type 'boolean
+  :version "28.1")
+
 (defvar gnus-registry-enabled nil)
 
 (defvar gnus-summary-misc-menu) ;; Avoid byte compiler warning.
@@ -478,8 +486,8 @@ This is not required after changing 
`gnus-registry-cache-file'."
   (let ((db gnus-registry-db)
         ;; if the group is ignored, set the destination to nil (same as delete)
         (to (if (gnus-registry-ignore-group-p to) nil to))
-        ;; safe if not found
-        (entry (gnus-registry-get-or-make-entry id))
+        ;; Only retrieve an existing entry, don't create a new one.
+        (entry (gnus-registry-get-or-make-entry id t))
         (subject (gnus-string-remove-all-properties
                   (gnus-registry-simplify-subject subject)))
         (sender (gnus-string-remove-all-properties sender)))
@@ -488,29 +496,30 @@ This is not required after changing 
`gnus-registry-cache-file'."
     ;; several times but it's better to bunch the transactions
     ;; together
 
-    (registry-delete db (list id) nil)
-    (when from
-      (setq entry (cons (delete from (assoc 'group entry))
-                        (assq-delete-all 'group entry))))
-    ;; Only keep the entry if the message is going to a new group, or
-    ;; it's still in some previous group.
-    (when (or to (alist-get 'group entry))
-      (dolist (kv `((group ,to)
-                    (sender ,sender)
-                    (recipient ,@recipients)
-                    (subject ,subject)))
-       (when (cadr kv)
-          (let ((new (or (assq (car kv) entry)
-                        (list (car kv)))))
-            (dolist (toadd (cdr kv))
-              (unless (member toadd new)
-               (setq new (append new (list toadd)))))
-            (setq entry (cons new
-                              (assq-delete-all (car kv) entry))))))
-      (gnus-message 10 "Gnus registry: new entry for %s is %S"
-                    id
-                    entry)
-      (gnus-registry-insert db id entry))))
+    (when entry
+      (registry-delete db (list id) nil)
+      (when from
+       (setq entry (cons (delete from (assoc 'group entry))
+                          (assq-delete-all 'group entry))))
+      ;; Only keep the entry if the message is going to a new group, or
+      ;; it's still in some previous group.
+      (when (or to (alist-get 'group entry))
+       (dolist (kv `((group ,to)
+                      (sender ,sender)
+                      (recipient ,@recipients)
+                      (subject ,subject)))
+         (when (cadr kv)
+            (let ((new (or (assq (car kv) entry)
+                          (list (car kv)))))
+              (dolist (toadd (cdr kv))
+               (unless (member toadd new)
+                 (setq new (append new (list toadd)))))
+              (setq entry (cons new
+                               (assq-delete-all (car kv) entry))))))
+       (gnus-message 10 "Gnus registry: new entry for %s is %S"
+                      id
+                      entry)
+       (gnus-registry-insert db id entry)))))
 
 ;; Function for nn{mail|imap}-split-fancy: look up all references in
 ;; the cache and if a match is found, return that group.
@@ -846,7 +855,8 @@ Overrides existing keywords with FORCE set non-nil."
 
 (defun gnus-registry-register-message-ids ()
   "Register the Message-ID of every article in the group."
-  (unless (gnus-parameter-registry-ignore gnus-newsgroup-name)
+  (unless (or (gnus-parameter-registry-ignore gnus-newsgroup-name)
+             (null gnus-registry-register-all))
     (dolist (article gnus-newsgroup-articles)
       (let* ((id (gnus-registry-fetch-message-id-fast article))
              (groups (gnus-registry-get-id-key id 'group)))
@@ -1082,12 +1092,15 @@ only the last one's marks are returned."
   "Get the number of groups of a message, based on the message ID."
   (length (gnus-registry-get-id-key id 'group)))
 
-(defun gnus-registry-get-or-make-entry (id)
+(defun gnus-registry-get-or-make-entry (id &optional no-create)
+  "Return registry entry for ID.
+If entry is not found, create a new one, unless NO-CREATE is
+non-nil."
   (let* ((db gnus-registry-db)
          ;; safe if not found
          (entries (registry-lookup db (list id))))
 
-    (when (null entries)
+    (unless (or entries no-create)
       (gnus-registry-insert db id (list (list 'creation-time (current-time))
                                         '(group) '(sender) '(subject)))
       (setq entries (registry-lookup db (list id))))
@@ -1098,7 +1111,8 @@ only the last one's marks are returned."
   (registry-delete gnus-registry-db idlist nil))
 
 (defun gnus-registry-get-id-key (id key)
-  (cdr-safe (assq key (gnus-registry-get-or-make-entry id))))
+  (cdr-safe (assq key (gnus-registry-get-or-make-entry
+                      id (null gnus-registry-register-all)))))
 
 (defun gnus-registry-set-id-key (id key vals)
   (let* ((db gnus-registry-db)
diff --git a/lisp/gnus/gnus-rfc1843.el b/lisp/gnus/gnus-rfc1843.el
index 45a6aff..107e963 100644
--- a/lisp/gnus/gnus-rfc1843.el
+++ b/lisp/gnus/gnus-rfc1843.el
@@ -1,6 +1,6 @@
 ;;; gnus-rfc1843.el --- HZ (rfc1843) decoding interface functions for Gnus
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: news HZ HZ+ mail i18n
diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el
index 8d58cd5..abaa844 100644
--- a/lisp/gnus/gnus-salt.el
+++ b/lisp/gnus/gnus-salt.el
@@ -1,6 +1,6 @@
 ;;; gnus-salt.el --- alternate summary mode interfaces for Gnus
 
-;; Copyright (C) 1996-1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -106,7 +106,7 @@ It accepts the same format specs that 
`gnus-summary-line-format' does."
     (remove-hook 'gnus-message-setup-hook 'gnus-pick-setup-message))
    (t
     ;; Make sure that we don't select any articles upon group entry.
-    (set (make-local-variable 'gnus-auto-select-first) nil)
+    (setq-local gnus-auto-select-first nil)
     ;; Change line format.
     (setq gnus-summary-line-format gnus-summary-pick-line-format)
     (setq gnus-summary-line-format-spec nil)
@@ -114,7 +114,7 @@ It accepts the same format specs that 
`gnus-summary-line-format' does."
     (gnus-update-summary-mark-positions)
     ;; FIXME: a buffer-local minor mode adding globally to a hook??
     (add-hook 'gnus-message-setup-hook 'gnus-pick-setup-message)
-    (set (make-local-variable 'gnus-summary-goto-unread) 'never)
+    (setq-local gnus-summary-goto-unread 'never)
     ;; Set up the menu.
     (when (gnus-visual-p 'pick-menu 'menu)
       (gnus-pick-make-menu-bar)))))
@@ -333,10 +333,8 @@ This must be bound to a button-down mouse event."
    ((not (derived-mode-p 'gnus-summary-mode)) (setq gnus-binary-mode nil))
    (gnus-binary-mode
     ;; Make sure that we don't select any articles upon group entry.
-    (make-local-variable 'gnus-auto-select-first)
-    (setq gnus-auto-select-first nil)
-    (make-local-variable 'gnus-summary-display-article-function)
-    (setq gnus-summary-display-article-function 'gnus-binary-display-article)
+    (setq-local gnus-auto-select-first nil)
+    (setq-local gnus-summary-display-article-function 
'gnus-binary-display-article)
     ;; Set up the menu.
     (when (gnus-visual-p 'binary-menu 'menu)
       (gnus-binary-make-menu-bar)))))
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index 2e3abe7..e74c498 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -1,6 +1,6 @@
 ;;; gnus-score.el --- scoring code for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <amanda@iesd.auc.dk>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -248,7 +248,7 @@ If you use score decays, you might want to set values 
higher than
                                     (integer :tag "Score"))))))
 
 (defcustom gnus-adaptive-word-length-limit nil
-  "Words of a length lesser than this limit will be ignored when doing 
adaptive scoring."
+  "Words shorter than this limit will be ignored when doing adaptive scoring."
   :version "22.1"
   :group 'gnus-score-adapt
   :type '(radio (const :format "Unlimited " nil)
@@ -1117,8 +1117,7 @@ EXTRA is the possible non-standard header."
       (gnus-configure-windows 'edit-score)
       (gnus-score-mode)
       (setq gnus-score-edit-exit-function 'gnus-score-edit-done)
-      (make-local-variable 'gnus-prev-winconf)
-      (setq gnus-prev-winconf winconf))
+      (setq-local gnus-prev-winconf winconf))
     (gnus-message
      4 "%s" (substitute-command-keys
             "\\<gnus-score-mode-map>\\[gnus-score-edit-exit] to save edits"))))
@@ -1145,8 +1144,7 @@ EXTRA is the possible non-standard header."
     (gnus-configure-windows 'edit-score)
     (gnus-score-mode)
     (setq gnus-score-edit-exit-function 'gnus-score-edit-done)
-    (make-local-variable 'gnus-prev-winconf)
-    (setq gnus-prev-winconf winconf))
+    (setq-local gnus-prev-winconf winconf))
   (gnus-message
    4 "%s" (substitute-command-keys
           "\\<gnus-score-mode-map>\\[gnus-score-edit-exit] to save edits")))
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index 89d8cff..44f43b0 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -1,6 +1,6 @@
 ;;; gnus-search.el --- Search facilities for Gnus    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020  Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
 
@@ -105,6 +105,8 @@
 
 (define-error 'gnus-search-parse-error "Gnus search parsing error")
 
+(define-error 'gnus-search-config-error "Gnus search configuration error")
+
 ;;; User Customizable Variables:
 
 (defgroup gnus-search nil
@@ -1048,6 +1050,7 @@ Responsible for handling and, or, and parenthetical 
expressions.")
          (grouplist (or groups (gnus-search-get-active srv)))
          q-string artlist group)
       (message "Opening server %s" server)
+      (gnus-open-server srv)
       ;; We should only be doing this once, in
       ;; `nnimap-open-connection', but it's too frustrating to try to
       ;; get to the server from the process buffer.
@@ -1069,7 +1072,7 @@ Responsible for handling and, or, and parenthetical 
expressions.")
       ;; A bit of backward-compatibility slash convenience: if the
       ;; query string doesn't start with any known IMAP search
       ;; keyword, assume it is a "TEXT" search.
-      (unless (and (string-match "\\`[[:word:]]+" q-string)
+      (unless (and (string-match "\\`[^[:blank:]]+" q-string)
                   (memql (intern-soft (downcase
                                        (match-string 0 q-string)))
                          gnus-search-imap-search-keys))
@@ -1250,44 +1253,41 @@ means (usually the \"mark\" keyword)."
                    (gnus-search-imap-handle-string engine (cdr expr))))))))))
 
 (cl-defmethod gnus-search-imap-handle-date ((_engine gnus-search-imap)
-                                    (date list))
+                                           (date list))
   "Turn DATE into a date string recognizable by IMAP.
 While other search engines can interpret partially-qualified
 dates such as a plain \"January\", IMAP requires an absolute
 date.
 
 DATE is a list of (dd mm yyyy), any element of which could be
-nil.  Massage those numbers into the most recent past occurrence
-of whichever date elements are present."
-  (let ((now (decode-time (current-time))))
-    ;; Set nil values to 1, current-month, current-year, or else 1, 1,
-    ;; current-year, depending on what we think the user meant.
-    (unless (seq-elt date 1)
-      (setf (seq-elt date 1)
-           (if (seq-elt date 0)
-               (seq-elt now 4)
-             1)))
-    (unless (seq-elt date 0)
-      (setf (seq-elt date 0) 1))
-    (unless (seq-elt date 2)
-      (setf (seq-elt date 2)
-           (seq-elt now 5)))
-    ;; Fiddle with the date until it's in the past.  There
-    ;; must be a way to combine all these steps.
-    (unless (< (seq-elt date 2)
-              (seq-elt now 5))
-      (when (< (seq-elt now 3)
-              (seq-elt date 0))
-       (cl-decf (seq-elt date 1)))
-      (cond ((zerop (seq-elt date 1))
-            (setf (seq-elt date 1) 1)
-            (cl-decf (seq-elt date 2)))
-           ((< (seq-elt now 4)
-               (seq-elt date 1))
-            (cl-decf (seq-elt date 2))))))
-  (format-time-string "%e-%b-%Y" (apply #'encode-time
-                                       (append '(0 0 0)
-                                               date))))
+nil (except that (dd nil yyyy) is not allowed).  Massage those
+numbers into the most recent past occurrence of whichever date
+elements are present."
+  (pcase-let ((`(,nday ,nmonth ,nyear)
+              (seq-subseq (decode-time (current-time))
+                          3 6))
+             (`(,dday ,dmonth ,dyear) date))
+    (unless (and dday dmonth dyear)
+      (unless dday (setq dday 1))
+      (if dyear
+         ;; If we have a year, then leave everything else as is or set
+         ;; to 1.
+         (setq dmonth (or dmonth 1))
+       (if dmonth
+           (setq dyear
+                 (if (or (> dmonth nmonth)
+                         (and (= dmonth nmonth)
+                              (> dday nday)))
+                     ;; If our day/month combo is ahead of "now",
+                     ;; move the year back.
+                     (1- nyear)
+                   nyear))
+         (setq dmonth 1))))
+    (format-time-string
+     "%e-%b-%Y"
+     (apply #'encode-time
+           (append '(0 0 0)
+                   (list dday dmonth dyear))))))
 
 (cl-defmethod gnus-search-imap-handle-string ((engine gnus-search-imap)
                                              (str string))
@@ -1425,7 +1425,7 @@ Returns a list of [group article score] vectors."
                        (string-to-number article)
                      (nnmaildir-base-name-to-article-number
                       (substring article 0 (string-match ":" article))
-                      group nil))
+                      group (string-remove-prefix "nnmaildir:" server)))
                    (if (numberp score)
                        score
                      (string-to-number score)))
@@ -1852,8 +1852,10 @@ Assume \"size\" key is equal to \"larger\"."
         (grouplist (or groups (gnus-search-get-active server)))
         (buffer (slot-value engine 'proc-buffer)))
     (unless directory
-      (error "No directory found in method specification of server %s"
-            server))
+      (signal 'gnus-search-config-error
+             (list (format-message
+                    "No directory found in definition of server %s"
+                    server))))
     (apply
      'vconcat
      (mapcar (lambda (x)
@@ -1885,7 +1887,9 @@ Assume \"size\" key is equal to \"larger\"."
                                            group nil t)))
                                    group))))))
                     (unless group
-                      (error "Cannot locate directory for group"))
+                      (signal 'gnus-search-config-error
+                              (list
+                               "Cannot locate directory for group")))
                     (save-excursion
                       (apply
                        'call-process "find" nil t
@@ -1934,12 +1938,19 @@ Assume \"size\" key is equal to \"larger\"."
         (limit (alist-get 'limit prepared-query)))
     (mapc
      (pcase-lambda (`(,server . ,groups))
-       (let ((search-engine (gnus-search-server-to-engine server)))
-        (setq results
-              (vconcat
-               (gnus-search-run-search
-                search-engine server prepared-query groups)
-               results))))
+       (condition-case err
+          (let ((search-engine (gnus-search-server-to-engine server)))
+            (setq results
+                  (vconcat
+                   (gnus-search-run-search
+                    search-engine server prepared-query groups)
+                   results)))
+        (gnus-search-config-error
+         (if (< 1 (length (alist-get 'search-group-spec specs)))
+             (apply #'nnheader-message 4
+                    "Search engine for %s improperly configured: %s"
+                    server (cdr err))
+           (signal 'gnus-search-config-error err)))))
      (alist-get 'search-group-spec specs))
     ;; Some search engines do their own limiting, but some don't, so
     ;; do it again here.  This is bad because, if the user is
@@ -1949,7 +1960,7 @@ Assume \"size\" key is equal to \"larger\"."
     ;; from a later group entirely.
     (if limit
        (seq-subseq results 0 (min limit (length results)))
-     results)))
+      results)))
 
 (defun gnus-search-prepare-query (query-spec)
   "Accept a search query in raw format, and prepare it.
@@ -2023,11 +2034,13 @@ remaining string, then adds all that to the top-level 
spec."
              (condition-case nil
                  (setf (slot-value inst key) value)
                ((invalid-slot-name invalid-slot-type)
-                (nnheader-message
-                 5 "Invalid search engine parameter: (%s %s)"
+                (nnheader-report 'search
+                 "Invalid search engine parameter: (%s %s)"
                  key value)))))
          (push (cons srv inst) gnus-search-engine-instance-alist))
-      (error "No search engine defined for %s" srv))
+      (signal 'gnus-search-config-error
+             (list (format-message
+                    "No search engine configured for %s" srv))))
     inst))
 
 (declare-function gnus-registry-get-id-key "gnus-registry" (id key))
diff --git a/lisp/gnus/gnus-sieve.el b/lisp/gnus/gnus-sieve.el
index 5d8f9b5..3b79d57 100644
--- a/lisp/gnus/gnus-sieve.el
+++ b/lisp/gnus/gnus-sieve.el
@@ -1,6 +1,6 @@
 ;;; gnus-sieve.el --- Utilities to manage sieve scripts for Gnus
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: NAGY Andras <nagya@inf.elte.hu>,
 ;;     Simon Josefsson <simon@josefsson.org>
diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el
index 6e3e802..a522855 100644
--- a/lisp/gnus/gnus-spec.el
+++ b/lisp/gnus/gnus-spec.el
@@ -1,6 +1,6 @@
 ;;; gnus-spec.el --- format spec functions for Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index 6beb543..34e5ceb 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -1,6 +1,6 @@
 ;;; gnus-srvr.el --- virtual server support for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -262,8 +262,7 @@ The following commands are available:
   (setq mode-line-process nil)
   (buffer-disable-undo)
   (setq truncate-lines t)
-  (set (make-local-variable 'font-lock-defaults)
-       '(gnus-server-font-lock-keywords t)))
+  (setq-local font-lock-defaults '(gnus-server-font-lock-keywords t)))
 
 
 (defun gnus-server-insert-server-line (name method)
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 615f8df..fbdbf41 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -1,6 +1,6 @@
 ;;; gnus-start.el --- startup functions for Gnus -*- lexical-binding:t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -741,8 +741,7 @@ of an NNTP server to use.  As opposed to \\[gnus], this 
command
 will not connect to the local server."
   (let ((val (or arg (1- gnus-level-default-subscribed))))
     (gnus val t child)
-    (make-local-variable 'gnus-group-use-permanent-levels)
-    (setq gnus-group-use-permanent-levels val)))
+    (setq-local gnus-group-use-permanent-levels val)))
 
 (defun gnus-1 (&optional arg dont-connect child)
   "Read network news.
@@ -875,13 +874,13 @@ If REGEXP is given, lines that match it will be deleted."
     (with-current-buffer (setq gnus-dribble-buffer
                               (gnus-get-buffer-create
                                (file-name-nondirectory dribble-file)))
-      (set (make-local-variable 'file-precious-flag) t)
+      (setq-local file-precious-flag t)
       (setq buffer-save-without-query t)
       (erase-buffer)
       (setq buffer-file-name dribble-file)
       ;; The buffer may be shrunk a lot when deleting old entries.
       ;; It caused the auto-saving to stop.
-      (set (make-local-variable 'auto-save-include-big-deletions) t)
+      (setq-local auto-save-include-big-deletions t)
       (auto-save-mode t)
       (buffer-disable-undo)
       (bury-buffer (current-buffer))
@@ -2763,8 +2762,7 @@ values from `gnus-newsrc-hashtb', and write a new value of
 
          ;; Save .newsrc.eld.
          (set-buffer (gnus-get-buffer-create " *Gnus-newsrc*"))
-         (make-local-variable 'version-control)
-         (setq version-control gnus-backup-startup-file)
+          (setq-local version-control gnus-backup-startup-file)
          (setq buffer-file-name
                (concat gnus-current-startup-file ".eld"))
          (setq default-directory (file-name-directory buffer-file-name))
@@ -2973,8 +2971,7 @@ SPECIFIC-VARIABLES, or those in `gnus-variable-list'."
                (when ranges
                  (insert ",")))))
          (insert "\n")))
-      (make-local-variable 'version-control)
-      (setq version-control 'never)
+      (setq-local version-control 'never)
       ;; It has been reported that sometime the modtime on the .newsrc
       ;; file seems to be off.  We really do want to overwrite it, so
       ;; we clear the modtime here before saving.  It's a bit odd,
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 469fa36..b0f9ed4 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1,6 +1,6 @@
 ;;; gnus-sum.el --- summary mode commands for Gnus  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -744,7 +744,8 @@ string with the suggested prefix."
   :type '(repeat character))
 
 (defcustom gnus-inhibit-user-auto-expire t
-  "If non-nil, user marking commands will not mark an article as expirable, 
even if the group has auto-expire turned on."
+  "If non-nil, user marking commands will not mark an article as expirable.
+This is true even if the group has auto-expire turned on."
   :version "21.1"
   :group 'gnus-summary
   :type 'boolean)
@@ -1399,7 +1400,7 @@ the normal Gnus MIME machinery."
 (defvar gnus-thread-indent-array nil)
 (defvar gnus-thread-indent-array-level gnus-thread-indent-level)
 (defvar gnus-sort-gathered-threads-function #'gnus-thread-sort-by-number
-  "Function called to sort the articles within a thread after it has been 
gathered together.")
+  "Function to sort articles within a thread after it has been gathered 
together.")
 
 (defvar gnus-summary-save-parts-type-history nil)
 (defvar gnus-summary-save-parts-last-directory mm-default-directory)
@@ -1460,8 +1461,8 @@ the normal Gnus MIME machinery."
     (?I gnus-tmp-indentation ?s)
     (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s)
     (?R gnus-tmp-replied ?c)
-    (?\[ gnus-tmp-opening-bracket ?c)
-    (?\] gnus-tmp-closing-bracket ?c)
+    (?\[ gnus-tmp-opening-bracket ?s)
+    (?\] gnus-tmp-closing-bracket ?s)
     (?\> (make-string gnus-tmp-level ? ) ?s)
     (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s)
     (?i gnus-tmp-score ?d)
@@ -1525,7 +1526,7 @@ the type of the variable (string, integer, character, 
etc).")
   "Default shell command on article.")
 
 (defvar gnus-newsgroup-agentized nil
-  "Locally bound in each summary buffer to indicate whether the server has 
been agentized.")
+  "Locally bound in each summary buffer to indicate if server has been 
agentized.")
 (defvar gnus-newsgroup-begin nil)
 (defvar gnus-newsgroup-end nil)
 (defvar gnus-newsgroup-last-rmail nil)
@@ -1555,7 +1556,7 @@ the type of the variable (string, integer, character, 
etc).")
 (defvar gnus-newsgroup-expunged-tally nil)
 
 (defvar gnus-newsgroup-marked nil
-  "Sorted list of ticked articles in the current newsgroup (a subset of unread 
art).")
+  "Sorted list of ticked articles in current newsgroup (a subset of unread 
art).")
 
 (defvar gnus-newsgroup-spam-marked nil
   "List of ranges of articles that have been marked as spam.")
@@ -3038,7 +3039,7 @@ When FORCE, rebuild the tool bar."
        ;; Need to set `gnus-summary-tool-bar-map' because `gnus-article-mode'
        ;; uses its value.
        (setq gnus-summary-tool-bar-map map))))
-  (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map))
+  (setq-local tool-bar-map gnus-summary-tool-bar-map))
 
 (defun gnus-make-score-map (type)
   "Make a summary score map of type TYPE."
@@ -3174,8 +3175,8 @@ The following commands are available:
   (make-local-variable 'gnus-original-article-buffer)
   (add-hook 'pre-command-hook #'gnus-set-global-variables nil t)
   (mm-enable-multibyte)
-  (set (make-local-variable 'bookmark-make-record-function)
-       #'gnus-summary-bookmark-make-record))
+  (setq-local bookmark-make-record-function
+              #'gnus-summary-bookmark-make-record))
 
 (defun gnus-summary-make-local-variables ()
   "Make all the local summary buffer variables."
@@ -3547,7 +3548,7 @@ Returns non-nil if the setup was successful."
       (let ((gnus-summary-mode-group group))
        (gnus-summary-mode))
       (when (gnus-group-quit-config group)
-       (set (make-local-variable 'gnus-single-article-buffer) nil))
+        (setq-local gnus-single-article-buffer nil))
       (turn-on-gnus-mailing-list-mode)
       ;; These functions don't currently depend on GROUP, but might in
       ;; the future.
@@ -3657,6 +3658,7 @@ buffer that was in action when the last article was 
fetched."
               ;; so we don't call gnus-data-<field> accessors on nil.
               (gnus-newsgroup-data gnus--dummy-data-list)
              (gnus-newsgroup-downloadable '(0))
+             (gnus-visual nil)
              case-fold-search ignores)
          ;; Here, all marks are bound to Z.
          (gnus-summary-insert-line gnus--dummy-mail-header
@@ -3748,6 +3750,30 @@ buffer that was in action when the last article was 
fetched."
       (inline
        (gnus-summary-extract-address-component gnus-tmp-from))))))
 
+(defcustom gnus-sum-opening-bracket "["
+  "With %[ spec, used to identify normal (non-adopted) articles."
+  :version "28.1"
+  :type 'string
+  :group 'gnus-summary-format)
+
+(defcustom gnus-sum-closing-bracket "]"
+  "With %] spec, used to identify normal (non-adopted) articles."
+  :version "28.1"
+  :type 'string
+  :group 'gnus-summary-format)
+
+(defcustom gnus-sum-opening-bracket-adopted "<"
+  "With %[ spec, used to identify adopted articles."
+  :version "28.1"
+  :type 'string
+  :group 'gnus-summary-format)
+
+(defcustom gnus-sum-closing-bracket-adopted ">"
+  "With %] spec, used to identify adopted articles."
+  :version "28.1"
+  :type 'string
+  :group 'gnus-summary-format)
+
 (defun gnus-summary-insert-line (header level current undownloaded
                                  unread replied expirable subject-or-nil
                                 &optional dummy score process)
@@ -3805,8 +3831,14 @@ buffer that was in action when the last article was 
fetched."
                       (1+ (match-beginning 0)) (1- (match-end 0))))
           (t gnus-tmp-from)))
         (gnus-tmp-subject (mail-header-subject gnus-tmp-header))
-        (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[))
-        (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\]))
+        (gnus-tmp-opening-bracket
+         (if gnus-tmp-dummy
+             gnus-sum-opening-bracket-adopted
+           gnus-sum-opening-bracket))
+        (gnus-tmp-closing-bracket
+         (if gnus-tmp-dummy
+             gnus-sum-closing-bracket-adopted
+           gnus-sum-closing-bracket))
         (inhibit-read-only t))
     (when (string= gnus-tmp-name "")
       (setq gnus-tmp-name gnus-tmp-from))
@@ -4070,8 +4102,6 @@ If SELECT-ARTICLES, only select those articles from 
GROUP."
      ;; The group was successfully selected.
      (t
       (gnus-set-global-variables)
-      (when (boundp 'gnus-pick-line-number)
-       (setq gnus-pick-line-number 0))
       (when (boundp 'spam-install-hooks)
        (spam-initialize))
       ;; Save the active value in effect when the group was entered.
@@ -4196,6 +4226,8 @@ If SELECT-ARTICLES, only select those articles from 
GROUP."
          gnus-newsgroup-data-reverse nil)
     (gnus-run-hooks 'gnus-summary-generate-hook)
     ;; Generate the buffer, either with threads or without.
+    (when (boundp 'gnus-pick-line-number)
+      (setq gnus-pick-line-number 0))
     (when gnus-newsgroup-headers
       (gnus-summary-prepare-threads
        (if gnus-show-threads
@@ -5439,10 +5471,10 @@ or a straight list of headers."
            (if (and (eq gnus-summary-make-false-root 'adopt)
                     (= gnus-tmp-level 1)
                     (memq number gnus-tmp-gathered))
-               (setq gnus-tmp-opening-bracket ?\<
-                     gnus-tmp-closing-bracket ?\>)
-             (setq gnus-tmp-opening-bracket ?\[
-                   gnus-tmp-closing-bracket ?\]))
+               (setq gnus-tmp-opening-bracket gnus-sum-opening-bracket-adopted
+                     gnus-tmp-closing-bracket gnus-sum-closing-bracket-adopted)
+             (setq gnus-tmp-opening-bracket gnus-sum-opening-bracket
+                   gnus-tmp-closing-bracket gnus-sum-closing-bracket))
            (if (>= gnus-tmp-level (length gnus-thread-indent-array))
                (gnus-make-thread-indent-array
                 (max (* 2 (length gnus-thread-indent-array))
@@ -5670,8 +5702,8 @@ If SELECT-ARTICLES, only select those articles from 
GROUP."
         articles fetched-articles cached)
 
     (unless (gnus-check-server
-            (set (make-local-variable 'gnus-current-select-method)
-                 (gnus-find-method-for-group group)))
+             (setq-local gnus-current-select-method
+                         (gnus-find-method-for-group group)))
       (error "Couldn't open server"))
 
     (or (and entry (not (eq (car entry) t))) ; Either it's active...
@@ -6254,7 +6286,9 @@ If WHERE is `summary', the summary mode line format will 
be used."
                   mode-string (- max-len 3) nil nil t)))))
       ;; Update the mode line.
       (setq mode-line-buffer-identification
-           (gnus-mode-line-buffer-identification (list mode-string)))
+           (gnus-mode-line-buffer-identification
+            (list (propertize mode-string
+                              'face 'mode-line-buffer-id))))
       (set-buffer-modified-p t))))
 
 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads)
@@ -10638,7 +10672,7 @@ groups."
                 (mime-to-mml current-handles))
               (let ((mbl1 mml-buffer-list))
                 (setq mml-buffer-list mbl)
-                (set (make-local-variable 'mml-buffer-list) mbl1))
+                 (setq-local mml-buffer-list mbl1))
               (add-hook 'kill-buffer-hook #'mml-destroy-buffers t t))))
         `(lambda (no-highlight)
            (let ((mail-parse-charset ',gnus-newsgroup-charset)
@@ -12846,8 +12880,7 @@ UNREAD is a sorted list."
                (and gnus-newsgroup-name
                     (gnus-parameter-charset gnus-newsgroup-name))
                gnus-default-charset))
-      (set (make-local-variable 'gnus-newsgroup-ignored-charsets)
-          ignored-charsets))))
+      (setq-local gnus-newsgroup-ignored-charsets ignored-charsets))))
 
 ;;;
 ;;; Mime Commands
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index c913002..8a77c53 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -1,6 +1,6 @@
 ;;; gnus-topic.el --- a folding minor mode for Gnus group buffers
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Ilja Weis <kult@uni-paderborn.de>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -1129,18 +1129,17 @@ articles in the topic and its subtopics."
        (gnus-topic-make-menu-bar))
       (gnus-set-format 'topic t)
       (add-hook 'gnus-group-catchup-group-hook 'gnus-topic-update-topic)
-      (set (make-local-variable 'gnus-group-prepare-function)
-          'gnus-group-prepare-topics)
-      (set (make-local-variable 'gnus-group-get-parameter-function)
-          'gnus-group-topic-parameters)
-      (set (make-local-variable 'gnus-group-goto-next-group-function)
-          'gnus-topic-goto-next-group)
-      (set (make-local-variable 'gnus-group-indentation-function)
-          'gnus-topic-group-indentation)
-      (set (make-local-variable 'gnus-group-update-group-function)
-          'gnus-topic-update-topics-containing-group)
-      (set (make-local-variable 'gnus-group-sort-alist-function)
-          'gnus-group-sort-topic)
+      (setq-local gnus-group-prepare-function
+                 'gnus-group-prepare-topics)
+      (setq-local gnus-group-get-parameter-function
+                 'gnus-group-topic-parameters)
+      (setq-local gnus-group-goto-next-group-function
+                 'gnus-topic-goto-next-group)
+      (setq-local gnus-group-indentation-function
+                  'gnus-topic-group-indentation)
+      (setq-local gnus-group-update-group-function
+                 'gnus-topic-update-topics-containing-group)
+      (setq-local gnus-group-sort-alist-function 'gnus-group-sort-topic)
       (setq gnus-group-change-level-function 'gnus-topic-change-level)
       (setq gnus-goto-missing-group-function 'gnus-topic-goto-missing-group)
       (add-hook 'gnus-check-bogus-groups-hook 'gnus-topic-clean-alist
diff --git a/lisp/gnus/gnus-undo.el b/lisp/gnus/gnus-undo.el
index 3f2b576..b1c1fb8 100644
--- a/lisp/gnus/gnus-undo.el
+++ b/lisp/gnus/gnus-undo.el
@@ -1,6 +1,6 @@
 ;;; gnus-undo.el --- minor mode for undoing in Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -100,8 +100,8 @@
 
 \\{gnus-undo-mode-map}"
   :keymap gnus-undo-mode-map
-  (set (make-local-variable 'gnus-undo-actions) nil)
-  (set (make-local-variable 'gnus-undo-boundary) t)
+  (setq-local gnus-undo-actions nil)
+  (setq-local gnus-undo-boundary t)
   (when gnus-undo-mode
     ;; Set up the menu.
     (when (gnus-visual-p 'undo-menu 'menu)
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index ef811c6..de3c854 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1,6 +1,6 @@
 ;;; gnus-util.el --- utility functions for Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -785,7 +785,7 @@ If there's no subdirectory, delete DIRECTORY as well."
   string)
 
 (defsubst gnus-put-text-property-excluding-newlines (beg end prop val)
-  "The same as `put-text-property', but don't put this prop on any newlines in 
the region."
+  "Like `put-text-property', but don't put this prop on any newlines in the 
region."
   (save-match-data
     (save-excursion
       (save-restriction
@@ -796,7 +796,7 @@ If there's no subdirectory, delete DIRECTORY as well."
        (put-text-property beg (point) prop val)))))
 
 (defsubst gnus-put-overlay-excluding-newlines (beg end prop val)
-  "The same as `put-text-property', but don't put this prop on any newlines in 
the region."
+  "Like `put-text-property', but don't put this prop on any newlines in the 
region."
   (save-match-data
     (save-excursion
       (save-restriction
diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el
index 70aeac0..db0ffc6 100644
--- a/lisp/gnus/gnus-uu.el
+++ b/lisp/gnus/gnus-uu.el
@@ -1,6 +1,6 @@
 ;;; gnus-uu.el --- extract (uu)encoded files in Gnus
 
-;; Copyright (C) 1985-1987, 1993-1998, 2000-2020 Free Software
+;; Copyright (C) 1985-1987, 1993-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -162,7 +162,7 @@ Note that this variable can be used in conjunction with the
                 (regexp :format "%v")))
 
 (defcustom gnus-uu-ignore-files-by-type nil
-  "A regular expression saying what files that shouldn't be viewed, based on 
MIME file type.
+  "Regexp matching files that shouldn't be viewed, based on MIME file type.
 If, for instance, you want gnus-uu to ignore all audio files and all mpegs,
 you could say something like
 
@@ -224,7 +224,7 @@ Default is \"/tmp/\"."
   :type 'directory)
 
 (defcustom gnus-uu-do-not-unpack-archives nil
-  "Non-nil means that gnus-uu won't peek inside archives looking for files to 
display.
+  "If non-nil, gnus-uu won't peek inside archives looking for files to display.
 Default is nil."
   :group 'gnus-extract-archive
   :type 'boolean)
@@ -265,19 +265,19 @@ it nil."
   :type 'boolean)
 
 (defcustom gnus-uu-unmark-articles-not-decoded nil
-  "Non-nil means that gnus-uu will mark articles that were unsuccessfully 
decoded as unread.
+  "If non-nil, gnus-uu will mark unsuccessfully decoded articles as unread.
 Default is nil."
   :group 'gnus-extract
   :type 'boolean)
 
 (defcustom gnus-uu-correct-stripped-uucode nil
-  "Non-nil means that gnus-uu will *try* to fix uuencoded files that have had 
trailing spaces deleted.
+  "If non-nil, *try* to fix uuencoded files that have had trailing spaces 
deleted.
 Default is nil."
   :group 'gnus-extract
   :type 'boolean)
 
 (defcustom gnus-uu-save-in-digest nil
-  "Non-nil means that gnus-uu, when asked to save without decoding, will save 
in digests.
+  "If non-nil, gnus-uu, when asked to save without decoding, will save in 
digests.
 If this variable is nil, gnus-uu will just save everything in a
 file without any embellishments.  The digesting almost conforms to RFC1153 -
 no easy way to specify any meaningful volume and issue numbers were found,
@@ -1587,8 +1587,7 @@ Gnus might fail to display all of it.")
          (save-excursion
            (switch-to-buffer (current-buffer))
            (delete-other-windows)
-           (let ((buffer (get-buffer-create (generate-new-buffer-name
-                                             "*Warning*"))))
+            (let ((buffer (generate-new-buffer "*Warning*")))
              (unless
                  (unwind-protect
                      (with-current-buffer buffer
@@ -1858,7 +1857,7 @@ uuencode and adds MIME headers."
                (function :tag "Other")))
 
 (defcustom gnus-uu-post-include-before-composing nil
-  "Non-nil means that gnus-uu will ask for a file to encode before you compose 
the article.
+  "If non-nil, gnus-uu asks for a file to encode before you compose the 
article.
 If this variable is t, you can either include an encoded file with
 \\[gnus-uu-post-insert-binary-in-article] or have one included for you when 
you post the article."
   :group 'gnus-extract-post
diff --git a/lisp/gnus/gnus-vm.el b/lisp/gnus/gnus-vm.el
index 08f6ce6..533b1e2 100644
--- a/lisp/gnus/gnus-vm.el
+++ b/lisp/gnus/gnus-vm.el
@@ -1,6 +1,6 @@
 ;;; gnus-vm.el --- vm interface for Gnus
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Per Persson <pp@gnu.ai.mit.edu>
 ;; Keywords: news, mail
diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el
index baa3146..18924a3 100644
--- a/lisp/gnus/gnus-win.el
+++ b/lisp/gnus/gnus-win.el
@@ -1,6 +1,6 @@
 ;;; gnus-win.el --- window configuration functions for Gnus
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -68,7 +68,7 @@ used to display Gnus windows."
   :type 'boolean)
 
 (defvar gnus-buffer-configuration
-  '((group
+  `((group
      (vertical 1.0
               (group 1.0 point)))
     (summary
@@ -142,7 +142,7 @@ used to display Gnus windows."
     (pipe
      (vertical 1.0
               (summary 0.25 point)
-              (shell-command-buffer-name 1.0)))
+               (,shell-command-buffer-name 1.0)))
     (bug
      (vertical 1.0
               (if gnus-bug-create-help-buffer '("*Gnus Help Bug*" 0.5))
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index c1cfddc..3b172db 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1,6 +1,6 @@
 ;;; gnus.el --- a newsreader for GNU Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1987-1990, 1993-1998, 2000-2020 Free Software
+;; Copyright (C) 1987-1990, 1993-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
@@ -309,34 +309,29 @@ be set in `.emacs' instead."
   :group 'gnus-start
   :type 'boolean)
 
-(defvar gnus-mode-line-image-cache t)
-
-(eval-and-compile
-  (if (fboundp 'find-image)
-      (defun gnus-mode-line-buffer-identification (line)
-       (let ((str (car-safe line))
-             (load-path (append (mm-image-load-path) load-path)))
-         (if (and (display-graphic-p)
-                  (stringp str)
-                  (string-match "^Gnus:" str))
-             (progn (add-text-properties
-                     0 5
-                     (list 'display
-                           (if (eq t gnus-mode-line-image-cache)
-                               (setq gnus-mode-line-image-cache
-                                     (find-image
-                                      '((:type xpm :file "gnus-pointer.xpm"
-                                               :ascent center)
-                                        (:type xbm :file "gnus-pointer.xbm"
-                                               :ascent center))))
-                             gnus-mode-line-image-cache)
-                           'help-echo (format
-                                       "This is %s, %s."
-                                       gnus-version (gnus-emacs-version)))
-                     str)
-                    (list str))
-           line)))
-    (defalias 'gnus-mode-line-buffer-identification 'identity)))
+(defun gnus-mode-line-buffer-identification (line)
+  (let ((str (car-safe line)))
+    (if (or (not (fboundp 'find-image))
+           (not (display-graphic-p))
+           (not (stringp str))
+           (not (string-match "^Gnus:" str)))
+       line
+      (let ((load-path (append (mm-image-load-path) load-path)))
+       ;; Add the Gnus logo.
+       (add-text-properties
+        0 5
+        (list 'display
+              (find-image
+               '((:type xpm :file "gnus-pointer.xpm"
+                        :ascent center)
+                 (:type xbm :file "gnus-pointer.xbm"
+                        :ascent center))
+               t)
+              'help-echo (format
+                          "This is %s, %s."
+                          gnus-version (gnus-emacs-version)))
+        str)
+       (list str)))))
 
 ;; We define these group faces here to avoid the display
 ;; update forced when creating new faces.
@@ -1200,7 +1195,7 @@ Also see `gnus-large-ephemeral-newsgroup'."
                 integer))
 
 (defcustom gnus-use-long-file-name (not (memq system-type '(usg-unix-v)))
-  "Non-nil means that the default name of a file to save articles in is the 
group name.
+  "Non-nil means that the default file name to save articles in is the group 
name.
 If it's nil, the directory form of the group name is used instead.
 
 If this variable is a list, and the list contains the element
@@ -1550,7 +1545,7 @@ Use with caution.")
    ("\\(^\\|:\\)soc.culture.vietnamese\\>" vietnamese-viqr)
    ("\\(^\\|:\\)\\(comp\\|rec\\|alt\\|sci\\|soc\\|news\\|gnu\\|bofh\\)\\>" 
iso-8859-1))
  :variable-document
- "Alist of regexps (to match group names) and default charsets to be used when 
reading."
+ "Alist of regexps (to match group names) and charsets to be used when 
reading."
  :variable-group gnus-charset
  :variable-type '(repeat (list (regexp :tag "Group")
                               (symbol :tag "Charset")))
@@ -1623,7 +1618,8 @@ total number of articles in the group.")
 ;; group parameters for spam processing added by Ted Zlatanov 
<tzz@lifelogs.com>
 (defcustom gnus-install-group-spam-parameters t
   "Disable the group parameters for spam detection.
-Enable if `G c' in XEmacs is giving you trouble, and make sure to submit a bug 
report."
+Enable if `G c' in XEmacs is giving you trouble, and make sure to
+submit a bug report."
   :version "22.1"
   :type 'boolean
   :group 'gnus-start)
@@ -3175,8 +3171,7 @@ that that variable is buffer-local to the summary 
buffers."
   "Make mode lines a bit simpler."
   (setq mode-line-modified "--")
   (when (listp mode-line-format)
-    (make-local-variable 'mode-line-format)
-    (setq mode-line-format (copy-sequence mode-line-format))
+    (setq-local mode-line-format (copy-sequence mode-line-format))
     (when (equal (nth 3 mode-line-format) "   ")
       (setcar (nthcdr 3 mode-line-format) " "))))
 
diff --git a/lisp/gnus/gssapi.el b/lisp/gnus/gssapi.el
index 485d58a..20562fb 100644
--- a/lisp/gnus/gssapi.el
+++ b/lisp/gnus/gssapi.el
@@ -1,6 +1,6 @@
 ;;; gssapi.el --- GSSAPI/Kerberos 5 interface for Emacs
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;;         Lars Magne Ingebrigtsen <larsi@gnus.org>
diff --git a/lisp/gnus/legacy-gnus-agent.el b/lisp/gnus/legacy-gnus-agent.el
index 44b6c29..b47e69f 100644
--- a/lisp/gnus/legacy-gnus-agent.el
+++ b/lisp/gnus/legacy-gnus-agent.el
@@ -1,6 +1,6 @@
 ;;; gnus-agent.el --- Legacy unplugged support for Gnus
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Kevin Greiner <kgreiner@xpediantsolutions.com>
 ;; Keywords: news
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el
index 4318072..5247019 100644
--- a/lisp/gnus/mail-source.el
+++ b/lisp/gnus/mail-source.el
@@ -1,6 +1,6 @@
 ;;; mail-source.el --- functions for fetching mail
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news, mail
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 2ab3eb6..3ff3d29 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1,6 +1,6 @@
 ;;; message.el --- composing mail and news messages -*- lexical-binding: t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: mail, news
@@ -1155,7 +1155,7 @@ Note: Many newsgroups frown upon nontraditional reply 
styles.
 You probably want to set this variable only for specific groups,
 e.g. using `gnus-posting-styles':
 
-  (eval (set (make-local-variable \\='message-cite-reply-position) \\='above))"
+  (eval (setq-local message-cite-reply-position \\='above))"
   :version "24.1"
   :type '(choice (const :tag "Reply inline" traditional)
                 (const :tag "Reply above" above)
@@ -1172,7 +1172,8 @@ Presets to impersonate popular mail agents are found in 
the
 message-cite-style-* variables.  This variable is intended for
 use in `gnus-posting-styles', such as:
 
-  ((posting-from-work-p) (eval (set (make-local-variable 
\\='message-cite-style) message-cite-style-outlook)))"
+  ((posting-from-work-p) (eval (setq-local message-cite-style
+                                           message-cite-style-outlook)))"
   :version "24.1"
   :group 'message-insertion
   :type '(choice (const :tag "Do not override variables" :value nil)
@@ -1199,7 +1200,8 @@ use in `gnus-posting-styles', such as:
     (message-yank-cited-prefix  ">")
     (message-yank-empty-prefix  ">")
     (message-citation-line-format "On %D %R %p, %N wrote:"))
-  "Message citation style used by Mozilla Thunderbird.  Use with 
`message-cite-style'.")
+  "Message citation style used by Mozilla Thunderbird.
+Use with `message-cite-style'.")
 
 (defconst message-cite-style-gmail
   '((message-cite-function  'message-cite-original)
@@ -2667,7 +2669,7 @@ Point is left at the beginning of the narrowed-to region."
         10000))))
 
 (defun message-sort-headers ()
-  "Sort the headers of the current message according to 
`message-header-format-alist'."
+  "Sort headers of the current message according to 
`message-header-format-alist'."
   (interactive)
   (save-excursion
     (save-restriction
@@ -3078,44 +3080,43 @@ See also `message-forbidden-properties'."
 Like `text-mode', but with these additional commands:
 
 \\{message-mode-map}"
-  (set (make-local-variable 'message-reply-buffer) nil)
-  (set (make-local-variable 'message-inserted-headers) nil)
-  (set (make-local-variable 'message-send-actions) nil)
-  (set (make-local-variable 'message-return-action) nil)
-  (set (make-local-variable 'message-exit-actions) nil)
-  (set (make-local-variable 'message-kill-actions) nil)
-  (set (make-local-variable 'message-postpone-actions) nil)
-  (set (make-local-variable 'message-draft-article) nil)
+  (setq-local message-reply-buffer nil)
+  (setq-local message-inserted-headers nil)
+  (setq-local message-send-actions nil)
+  (setq-local message-return-action nil)
+  (setq-local message-exit-actions nil)
+  (setq-local message-kill-actions nil)
+  (setq-local message-postpone-actions nil)
+  (setq-local message-draft-article nil)
   (setq buffer-offer-save t)
-  (set (make-local-variable 'facemenu-add-face-function)
+  (setq-local facemenu-add-face-function
        (lambda (face end)
         (let ((face-fun (cdr (assq face message-face-alist))))
           (if face-fun
               (funcall face-fun (point) end)
             (error "Face %s not configured for %s mode" face mode-name)))
         ""))
-  (set (make-local-variable 'facemenu-remove-face-function) t)
-  (set (make-local-variable 'message-reply-headers) nil)
+  (setq-local facemenu-remove-face-function t)
+  (setq-local message-reply-headers nil)
   (make-local-variable 'message-newsreader)
   (make-local-variable 'message-mailer)
   (make-local-variable 'message-post-method)
-  (set (make-local-variable 'message-sent-message-via) nil)
-  (set (make-local-variable 'message-checksum) nil)
-  (set (make-local-variable 'message-mime-part) 0)
+  (setq-local message-sent-message-via nil)
+  (setq-local message-checksum nil)
+  (setq-local message-mime-part 0)
   (message-setup-fill-variables)
   (when message-fill-column
     (setq fill-column message-fill-column)
     (turn-on-auto-fill))
   ;; Allow using comment commands to add/remove quoting.
-  ;; (set (make-local-variable 'comment-start) message-yank-prefix)
+  ;; (setq-local comment-start message-yank-prefix)
   (when message-yank-prefix
-    (set (make-local-variable 'comment-start) message-yank-prefix)
-    (set (make-local-variable 'comment-start-skip)
-        (concat "^" (regexp-quote message-yank-prefix) "[ \t]*")))
-  (set (make-local-variable 'font-lock-defaults)
-       '(message-font-lock-keywords t))
+    (setq-local comment-start message-yank-prefix)
+    (setq-local comment-start-skip
+                (concat "^" (regexp-quote message-yank-prefix) "[ \t]*")))
+  (setq-local font-lock-defaults '(message-font-lock-keywords t))
   (if (boundp 'tool-bar-map)
-      (set (make-local-variable 'tool-bar-map) (message-make-tool-bar)))
+      (setq-local tool-bar-map (message-make-tool-bar)))
   ;; Mmmm... Forbidden properties...
   (add-hook 'after-change-functions #'message-strip-forbidden-properties
            nil 'local)
@@ -3134,45 +3135,41 @@ Like `text-mode', but with these additional commands:
     ;; Don't enable multibyte on an indirect buffer.  Maybe enabling
     ;; multibyte is not necessary at all. -- zsh
     (mm-enable-multibyte))
-  (set (make-local-variable 'indent-tabs-mode) nil) ;No tabs for indentation.
+  (setq-local indent-tabs-mode nil) ; No tabs for indentation.
   (mml-mode)
   ;; Syntactic fontification. Helps `show-paren-mode',
   ;; `electric-pair-mode', and C-M-* navigation by syntactically
   ;; excluding citations and other artifacts.
   ;;
-  (set (make-local-variable 'syntax-propertize-function) 
'message--syntax-propertize)
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  (setq-local syntax-propertize-function 'message--syntax-propertize)
+  (setq-local parse-sexp-ignore-comments t)
   (setq-local message-encoded-mail-cache nil))
 
 (defun message-setup-fill-variables ()
   "Setup message fill variables."
-  (set (make-local-variable 'fill-paragraph-function)
-       'message-fill-paragraph)
-  (make-local-variable 'paragraph-separate)
-  (make-local-variable 'paragraph-start)
-  (make-local-variable 'adaptive-fill-regexp)
+  (setq-local fill-paragraph-function 'message-fill-paragraph)
   (make-local-variable 'adaptive-fill-first-line-regexp)
   (let ((quote-prefix-regexp
         ;; User should change message-cite-prefix-regexp if
         ;; message-yank-prefix is set to an abnormal value.
         (concat "\\(" message-cite-prefix-regexp "\\)[ \t]*")))
-    (setq paragraph-start
-         (concat
-          (regexp-quote mail-header-separator) "$\\|"
-          "[ \t]*$\\|"                 ; blank lines
-          "-- $\\|"                    ; signature delimiter
-          "---+$\\|"              ; delimiters for forwarded messages
-          page-delimiter "$\\|"        ; spoiler warnings
-          ".*wrote:$\\|"               ; attribution lines
-          quote-prefix-regexp "$\\|"   ; empty lines in quoted text
-                                       ; mml tags
-          "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)"))
-    (setq paragraph-separate paragraph-start)
-    (setq adaptive-fill-regexp
-         (concat quote-prefix-regexp "\\|" adaptive-fill-regexp))
-    (setq adaptive-fill-first-line-regexp
-         (concat quote-prefix-regexp "\\|"
-                 adaptive-fill-first-line-regexp)))
+    (setq-local paragraph-start
+                (concat
+                 (regexp-quote mail-header-separator) "$\\|"
+                 "[ \t]*$\\|"                  ; blank lines
+                 "-- $\\|"                     ; signature delimiter
+                 "---+$\\|"               ; delimiters for forwarded messages
+                 page-delimiter "$\\|" ; spoiler warnings
+                 ".*wrote:$\\|"                ; attribution lines
+                 quote-prefix-regexp "$\\|"    ; empty lines in quoted text
+                                        ; mml tags
+                 "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)"))
+    (setq-local paragraph-separate paragraph-start)
+    (setq-local adaptive-fill-regexp
+                (concat quote-prefix-regexp "\\|" adaptive-fill-regexp))
+    (setq-local adaptive-fill-first-line-regexp
+                (concat quote-prefix-regexp "\\|"
+                        adaptive-fill-first-line-regexp)))
   (setq-local auto-fill-inhibit-regexp nil)
   (setq-local normal-auto-fill-function 'message-do-auto-fill))
 
diff --git a/lisp/gnus/mm-archive.el b/lisp/gnus/mm-archive.el
index 56253af..635e7f4 100644
--- a/lisp/gnus/mm-archive.el
+++ b/lisp/gnus/mm-archive.el
@@ -1,6 +1,6 @@
 ;;; mm-archive.el --- Functions for parsing archive files as MIME
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
diff --git a/lisp/gnus/mm-bodies.el b/lisp/gnus/mm-bodies.el
index 3533210..f35ba3a 100644
--- a/lisp/gnus/mm-bodies.el
+++ b/lisp/gnus/mm-bodies.el
@@ -1,6 +1,6 @@
 ;;; mm-bodies.el --- Functions for decoding MIME things
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     MORIOKA Tomohiko <morioka@jaist.ac.jp>
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 1bce6ca..61946aa 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1,6 +1,6 @@
 ;;; mm-decode.el --- Functions for decoding MIME things  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     MORIOKA Tomohiko <morioka@jaist.ac.jp>
diff --git a/lisp/gnus/mm-encode.el b/lisp/gnus/mm-encode.el
index d66ae60..8bd3e0b 100644
--- a/lisp/gnus/mm-encode.el
+++ b/lisp/gnus/mm-encode.el
@@ -1,6 +1,6 @@
 ;;; mm-encode.el --- Functions for encoding MIME things
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     MORIOKA Tomohiko <morioka@jaist.ac.jp>
diff --git a/lisp/gnus/mm-extern.el b/lisp/gnus/mm-extern.el
index 96f2a78..4099a10 100644
--- a/lisp/gnus/mm-extern.el
+++ b/lisp/gnus/mm-extern.el
@@ -1,6 +1,6 @@
 ;;; mm-extern.el --- showing message/external-body  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: message external-body
diff --git a/lisp/gnus/mm-partial.el b/lisp/gnus/mm-partial.el
index 9bf4968..165c191 100644
--- a/lisp/gnus/mm-partial.el
+++ b/lisp/gnus/mm-partial.el
@@ -1,6 +1,6 @@
 ;;; mm-partial.el --- showing message/partial
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: message partial
diff --git a/lisp/gnus/mm-url.el b/lisp/gnus/mm-url.el
index 4d56b19..412a474 100644
--- a/lisp/gnus/mm-url.el
+++ b/lisp/gnus/mm-url.el
@@ -1,6 +1,6 @@
 ;;; mm-url.el --- a wrapper of url functions/commands for Gnus
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 958e24c..db42bfa 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -1,6 +1,6 @@
 ;;; mm-util.el --- Utility functions for Mule and low level things  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     MORIOKA Tomohiko <morioka@jaist.ac.jp>
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index aedd6c9..9d4c4bf 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -1,6 +1,6 @@
 ;;; mm-uu.el --- Return uu stuff as mm handles  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: postscript uudecode binhex shar forward gnatsweb pgp
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index ca61001..0683703 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -1,6 +1,6 @@
 ;;; mm-view.el --- functions for viewing MIME objects
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
@@ -486,7 +486,7 @@ If MODE is not set, try to find mode automatically."
         ;; support modes, but now that we use font-lock-ensure, support modes
         ;; aren't a problem any more.  So we could probably get rid of this
         ;; setting now, but it seems harmless and potentially still useful.
-       (set (make-local-variable 'font-lock-mode-hook) nil)
+       (setq-local font-lock-mode-hook nil)
         (setq buffer-file-name (mm-handle-filename handle))
        (with-demoted-errors
            (if mode
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index 74af99d..c117a38 100644
--- a/lisp/gnus/mml-sec.el
+++ b/lisp/gnus/mml-sec.el
@@ -1,6 +1,6 @@
 ;;; mml-sec.el --- A package with security functions for MML documents
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 
diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el
index acddb30..5baeaff 100644
--- a/lisp/gnus/mml-smime.el
+++ b/lisp/gnus/mml-smime.el
@@ -1,6 +1,6 @@
 ;;; mml-smime.el --- S/MIME support for MML
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;; Keywords: Gnus, MIME, S/MIME, MML
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 067396f..424215d 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -1,6 +1,6 @@
 ;;; mml.el --- A package for parsing and validating MML documents
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
@@ -1266,8 +1266,8 @@ See Info node `(emacs-mime)Composing'.
   :lighter " MML" :keymap mml-mode-map
   (when mml-mode
     (when (boundp 'dnd-protocol-alist)
-      (set (make-local-variable 'dnd-protocol-alist)
-          (append mml-dnd-protocol-alist dnd-protocol-alist)))))
+      (setq-local dnd-protocol-alist
+                  (append mml-dnd-protocol-alist dnd-protocol-alist)))))
 
 ;;;
 ;;; Helper functions for reading MIME stuff from the minibuffer and
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index 88864ea..a87e642 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -1,6 +1,6 @@
 ;;; mml1991.el --- Old PGP message format (RFC 1991) support for MML
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Sascha Lüdecke <sascha@meta-x.de>,
 ;;     Simon Josefsson <simon@josefsson.org> (Mailcrypt interface, Gnus glue)
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index 0765d7b..8eda593 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -1,6 +1,6 @@
 ;;; mml2015.el --- MIME Security with Pretty Good Privacy (PGP)
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: PGP MIME MML
diff --git a/lisp/gnus/nnagent.el b/lisp/gnus/nnagent.el
index 1b5b975..f2acea4 100644
--- a/lisp/gnus/nnagent.el
+++ b/lisp/gnus/nnagent.el
@@ -1,6 +1,6 @@
 ;;; nnagent.el --- offline backend for Gnus
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news, mail
diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el
index 480d794..130f56a 100644
--- a/lisp/gnus/nnbabyl.el
+++ b/lisp/gnus/nnbabyl.el
@@ -1,6 +1,6 @@
 ;;; nnbabyl.el --- rmail mbox access for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el
index ccd1774..b3e83e4 100644
--- a/lisp/gnus/nndiary.el
+++ b/lisp/gnus/nndiary.el
@@ -1,6 +1,6 @@
 ;;; nndiary.el --- A diary back end for Gnus
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author:        Didier Verna <didier@didierverna.net>
 ;; Created:       Fri Jul 16 18:55:42 1999
@@ -1002,10 +1002,10 @@ all.  This may very well take some time.")
       (let ((buffer (gnus-get-buffer-create
                      (format " *nndiary overview %s*" group))))
        (with-current-buffer buffer
-         (set (make-local-variable 'nndiary-nov-buffer-file-name)
-              (expand-file-name
-               nndiary-nov-file-name
-               (nnmail-group-pathname group nndiary-directory)))
+         (setq-local nndiary-nov-buffer-file-name
+                     (expand-file-name
+                      nndiary-nov-file-name
+                      (nnmail-group-pathname group nndiary-directory)))
          (erase-buffer)
          (when (file-exists-p nndiary-nov-buffer-file-name)
            (nnheader-insert-file-contents nndiary-nov-buffer-file-name)))
diff --git a/lisp/gnus/nndir.el b/lisp/gnus/nndir.el
index 32d6c0f..46351d0 100644
--- a/lisp/gnus/nndir.el
+++ b/lisp/gnus/nndir.el
@@ -1,6 +1,6 @@
 ;;; nndir.el --- single directory newsgroup access for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/nndoc.el b/lisp/gnus/nndoc.el
index 8143127..a3a6645 100644
--- a/lisp/gnus/nndoc.el
+++ b/lisp/gnus/nndoc.el
@@ -1,6 +1,6 @@
 ;;; nndoc.el --- single file access for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el
index a3c26ea..1f87bed 100644
--- a/lisp/gnus/nndraft.el
+++ b/lisp/gnus/nndraft.el
@@ -1,6 +1,6 @@
 ;;; nndraft.el --- draft article access for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/nneething.el b/lisp/gnus/nneething.el
index 9f1fdba..014ad3a 100644
--- a/lisp/gnus/nneething.el
+++ b/lisp/gnus/nneething.el
@@ -1,6 +1,6 @@
 ;;; nneething.el --- arbitrary file access for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el
index 6ff9905..9a0219c 100644
--- a/lisp/gnus/nnfolder.el
+++ b/lisp/gnus/nnfolder.el
@@ -1,6 +1,6 @@
 ;;; nnfolder.el --- mail folder access for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;;      ShengHuo Zhu <zsh@cs.rochester.edu> (adding NOV)
@@ -1083,7 +1083,7 @@ This command does not work if you use short group names."
       (let ((coding-system-for-write
             (or nnfolder-file-coding-system-for-write
                 nnfolder-file-coding-system)))
-       (set (make-local-variable 'copyright-update) nil)
+        (setq-local copyright-update nil)
        (save-buffer)))
     (unless (or gnus-nov-is-evil nnfolder-nov-is-evil)
       (nnfolder-save-nov))))
@@ -1098,8 +1098,8 @@ This command does not work if you use short group names."
   (or (cdr (assoc group nnfolder-nov-buffer-alist))
       (let ((buffer (gnus-get-buffer-create (format " *nnfolder overview %s*" 
group))))
        (with-current-buffer buffer
-         (set (make-local-variable 'nnfolder-nov-buffer-file-name)
-              (nnfolder-group-nov-pathname group))
+          (setq-local nnfolder-nov-buffer-file-name
+                      (nnfolder-group-nov-pathname group))
          (erase-buffer)
          (when (file-exists-p nnfolder-nov-buffer-file-name)
            (nnheader-insert-file-contents nnfolder-nov-buffer-file-name)))
diff --git a/lisp/gnus/nngateway.el b/lisp/gnus/nngateway.el
index 13cc65b..15e4876 100644
--- a/lisp/gnus/nngateway.el
+++ b/lisp/gnus/nngateway.el
@@ -1,6 +1,6 @@
 ;;; nngateway.el --- posting news via mail gateways
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news, mail
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index 2952e20..a381720 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -1,6 +1,6 @@
 ;;; nnheader.el --- header access macros for Gnus and its backends
 
-;; Copyright (C) 1987-1990, 1993-1998, 2000-2020 Free Software
+;; Copyright (C) 1987-1990, 1993-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
@@ -568,7 +568,7 @@ the line could be found."
     (mm-enable-multibyte)
     (kill-all-local-variables)
     (setq case-fold-search t)          ;Should ignore case.
-    (set (make-local-variable 'nntp-process-response) nil)
+    (setq-local nntp-process-response nil)
     t))
 
 ;;; Various functions the backends use.
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index c8b700e..1215131 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -1,6 +1,6 @@
 ;;; nnimap.el --- IMAP interface for Gnus
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;         Simon Josefsson <simon@josefsson.org>
@@ -376,10 +376,10 @@ during splitting, which may be slow."
     (mm-disable-multibyte)
     (buffer-disable-undo)
     (gnus-add-buffer)
-    (set (make-local-variable 'after-change-functions) nil) ;FIXME: Why?
-    (set (make-local-variable 'nnimap-object)
-        (make-nnimap :server (nnoo-current-server 'nnimap)
-                     :initial-resync 0))
+    (setq-local after-change-functions nil) ;FIXME: Why?
+    (setq-local nnimap-object
+                (make-nnimap :server (nnoo-current-server 'nnimap)
+                             :initial-resync 0))
     (push (list buffer (current-buffer)) nnimap-connection-alist)
     (push (current-buffer) nnimap-process-buffers)
     (current-buffer)))
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index 57801d6..d043ae1 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1,6 +1,6 @@
 ;;; nnmail.el --- mail support functions for the Gnus mail backends
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news, mail
@@ -115,7 +115,7 @@ If nil, the first match found will be used."
   :type 'boolean)
 
 (defcustom nnmail-split-fancy-with-parent-ignore-groups nil
-  "Regexp that matches group names to be ignored when applying 
`nnmail-split-fancy-with-parent'.
+  "Regexp matching group names ignored by `nnmail-split-fancy-with-parent'.
 This can also be a list of regexps."
   :version "22.1"
   :group 'nnmail-split
@@ -124,7 +124,8 @@ This can also be a list of regexps."
                 (repeat :value (".*") regexp)))
 
 (defcustom nnmail-cache-ignore-groups nil
-  "Regexp that matches group names to be ignored when inserting message ids 
into the cache (`nnmail-cache-insert').
+  "Regexp matching group ignored when inserting message ids into the cache.
+This is used by `nnmail-cache-insert'.
 This can also be a list of regexps."
   :version "22.1"
   :group 'nnmail-split
diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el
index e53e000..c061031 100644
--- a/lisp/gnus/nnmairix.el
+++ b/lisp/gnus/nnmairix.el
@@ -1,6 +1,6 @@
 ;;; nnmairix.el --- Mairix back end for Gnus, the Emacs newsreader
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: David Engster <deng@randomsample.de>
 ;; Keywords: mail searching
diff --git a/lisp/gnus/nnmbox.el b/lisp/gnus/nnmbox.el
index 8b3d802..a4863c3 100644
--- a/lisp/gnus/nnmbox.el
+++ b/lisp/gnus/nnmbox.el
@@ -1,6 +1,6 @@
 ;;; nnmbox.el --- mail mbox access for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
diff --git a/lisp/gnus/nnmh.el b/lisp/gnus/nnmh.el
index 581a408..82ed091 100644
--- a/lisp/gnus/nnmh.el
+++ b/lisp/gnus/nnmh.el
@@ -1,6 +1,6 @@
 ;;; nnmh.el --- mhspool access for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
@@ -46,7 +46,7 @@
   "Hook run narrowed to an article before saving.")
 
 (defvoo nnmh-be-safe nil
-  "If non-nil, nnmh will check all articles to make sure whether they are new 
or not.
+  "If non-nil, nnmh will check all articles to make sure if they are new or 
not.
 Go through the .nnmh-articles file and compare with the actual
 articles in this folder.  The articles that are \"new\" will be marked
 as unread by Gnus.")
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index ad608b6..ebececa 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -1,6 +1,6 @@
 ;;; nnml.el --- mail spool access for Gnus
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Authors: Didier Verna <didier@didierverna.net> (adding compaction)
 ;;     Simon Josefsson <simon@josefsson.org>
@@ -778,8 +778,8 @@ article number.  This function is called narrowed to an 
article."
                         group)))
         (file-name-coding-system nnmail-pathname-coding-system))
     (with-current-buffer buffer
-      (set (make-local-variable 'nnml-nov-buffer-file-name)
-          (nnmail-group-pathname group nnml-directory nnml-nov-file-name))
+      (setq-local nnml-nov-buffer-file-name
+                  (nnmail-group-pathname group nnml-directory 
nnml-nov-file-name))
       (erase-buffer)
       (when (and (not incrementalp)
                 (file-exists-p nnml-nov-buffer-file-name))
diff --git a/lisp/gnus/nnoo.el b/lisp/gnus/nnoo.el
index ba527a1..9bb86d6 100644
--- a/lisp/gnus/nnoo.el
+++ b/lisp/gnus/nnoo.el
@@ -1,6 +1,6 @@
 ;;; nnoo.el --- OO Gnus Backends
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/nnregistry.el b/lisp/gnus/nnregistry.el
index 29ca568..e78f93d 100644
--- a/lisp/gnus/nnregistry.el
+++ b/lisp/gnus/nnregistry.el
@@ -1,7 +1,7 @@
 ;;; nnregistry.el --- access to articles via Gnus' message-id registry
 ;;; -*- coding: utf-8 -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Ludovic Courtès <ludo@gnu.org>
 ;; Keywords: news, mail
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index 48c07da..f9e0a08 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -1,6 +1,6 @@
 ;;; nnrss.el --- interfacing with RSS
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: RSS
diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el
index e4753fe..ba0e60a 100644
--- a/lisp/gnus/nnselect.el
+++ b/lisp/gnus/nnselect.el
@@ -1,6 +1,6 @@
 ;;; nnselect.el --- a virtual group backend   -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Andrew Cohen <cohen@andy.bu.edu>
 ;; Keywords: news mail
diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el
index 0b6bba5..9de59d8 100644
--- a/lisp/gnus/nnspool.el
+++ b/lisp/gnus/nnspool.el
@@ -1,6 +1,6 @@
 ;;; nnspool.el --- spool access for GNU Emacs
 
-;; Copyright (C) 1988-1990, 1993-1998, 2000-2020 Free Software
+;; Copyright (C) 1988-1990, 1993-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index a5c8244..7e10e15 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -1,6 +1,6 @@
 ;;; nntp.el --- nntp access for Gnus  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1987-1990, 1992-1998, 2000-2020 Free Software
+;; Copyright (C) 1987-1990, 1992-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -600,7 +600,7 @@ retried once before actually displaying the error report."
     nil)))
 
 (defun nntp-with-open-group-function (group server connectionless bodyfun)
-  "Protect against servers that don't like clients that keep idle connections 
opens.
+  "Protect against servers that don't like clients that keep idle connections 
open.
 The problem being that these servers may either close a connection or
 simply ignore any further requests on a connection.  Closed
 connections are not detected until `accept-process-output' has updated
@@ -651,7 +651,7 @@ command whose response triggered the error."
     nntp-with-open-group-internal))
 
 (defmacro nntp-with-open-group (group server &optional connectionless &rest 
forms)
-  "Protect against servers that don't like clients that keep idle connections 
opens.
+  "Protect against servers that don't like clients that keep idle connections 
open.
 The problem being that these servers may either close a connection or
 simply ignore any further requests on a connection.  Closed
 connections are not detected until `accept-process-output' has updated
@@ -1751,7 +1751,8 @@ If SEND-IF-FORCE, only send authinfo to the server if the
 ;; ==========================================================================
 
 (defvoo nntp-open-telnet-envuser nil
-  "If non-nil, telnet session (client and server both) will support the 
ENVIRON option and not prompt for login name.")
+  "If non-nil, telnet session supports the ENVIRON option.
+Don't prompt for login name.  This applies to both client and server.")
 
 (defvoo nntp-telnet-shell-prompt "bash\\|[$>] *\r?$"
   "Regular expression to match the shell prompt on the remote machine.")
diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el
index 54c2f7b..1e2feda 100644
--- a/lisp/gnus/nnvirtual.el
+++ b/lisp/gnus/nnvirtual.el
@@ -1,6 +1,6 @@
 ;;; nnvirtual.el --- virtual newsgroups access for Gnus
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: David Moore <dmoore@ucsd.edu>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -61,22 +61,27 @@ component group will show up when you enter the virtual 
group.")
 (defvoo nnvirtual-current-group nil)
 
 (defvoo nnvirtual-mapping-table nil
-  "Table of rules on how to map between component group and article number to 
virtual article number.")
+  "Table of rules for mapping groups and articles to virtual article numbers.
+These rules determine how to map between component group and article number
+on the one hand, and virtual article number on the other hand.")
 
 (defvoo nnvirtual-mapping-offsets nil
-  "Table indexed by component group to an offset to be applied to article 
numbers in that group.")
+  "Table of mapping offsets to be applied to article numbers in a group.
+The table is indexed by component group number of the group.")
 
 (defvoo nnvirtual-mapping-len 0
   "Number of articles in this virtual group.")
 
 (defvoo nnvirtual-mapping-reads nil
-  "Compressed sequence of read articles on the virtual group as computed from 
the unread status of individual component groups.")
+  "Compressed sequence of read articles on the virtual group.
+It is computed from the unread status of individual component groups.")
 
 (defvoo nnvirtual-mapping-marks nil
-  "Compressed marks alist for the virtual group as computed from the marks of 
individual component groups.")
+  "Compressed marks alist for the virtual group.
+It is computed from the marks of individual component groups.")
 
 (defvoo nnvirtual-info-installed nil
-  "T if we have already installed the group info for this group, and shouldn't 
blast over it again.")
+  "t if the group info for this group is already installed.")
 
 (defvoo nnvirtual-status-string "")
 
@@ -662,7 +667,7 @@ the result."
 
 
 (defun nnvirtual-create-mapping (dont-check)
-  "Build the tables necessary to map between component (group, article) to 
virtual article.
+  "Build tables to map between component (group, article) to virtual article.
 Generate the set of read messages and marks for the virtual group
 based on the marks on the component groups."
   (let ((cnt 0)
diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el
index 64b6f49..b8fb4a8 100644
--- a/lisp/gnus/nnweb.el
+++ b/lisp/gnus/nnweb.el
@@ -1,6 +1,6 @@
 ;;; nnweb.el --- retrieving articles via web search engines
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/gnus/score-mode.el b/lisp/gnus/score-mode.el
index d8d8af8..b8726c0 100644
--- a/lisp/gnus/score-mode.el
+++ b/lisp/gnus/score-mode.el
@@ -1,6 +1,6 @@
 ;;; score-mode.el --- mode for editing Gnus score files
 
-;; Copyright (C) 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news, mail
diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el
index 3edae04..d9e04f3 100644
--- a/lisp/gnus/smiley.el
+++ b/lisp/gnus/smiley.el
@@ -1,6 +1,6 @@
 ;;; smiley.el --- displaying smiley faces
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: news mail multimedia
diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el
index 08d45e5..ae5d171 100644
--- a/lisp/gnus/smime.el
+++ b/lisp/gnus/smime.el
@@ -1,6 +1,6 @@
 ;;; smime.el --- S/MIME support library  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;; Keywords: SMIME X.509 PEM OpenSSL
diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el
index f414c1e..8c148ce 100644
--- a/lisp/gnus/spam-report.el
+++ b/lisp/gnus/spam-report.el
@@ -1,6 +1,6 @@
 ;;; spam-report.el --- Reporting spam
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Ted Zlatanov <tzz@lifelogs.com>
 ;; Keywords: network, spam, mail, gmane, report
diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el
index bf59386..3662ade 100644
--- a/lisp/gnus/spam-stat.el
+++ b/lisp/gnus/spam-stat.el
@@ -1,6 +1,6 @@
 ;;; spam-stat.el --- detecting spam based on statistics
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Keywords: network
diff --git a/lisp/gnus/spam-wash.el b/lisp/gnus/spam-wash.el
index 7ce0ce2..1d00a39 100644
--- a/lisp/gnus/spam-wash.el
+++ b/lisp/gnus/spam-wash.el
@@ -1,6 +1,6 @@
 ;;; spam-wash.el --- wash spam before analysis
 
-;; Copyright (C) 2004, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Andrew Cohen <cohen@andy.bu.edu>
 ;; Keywords: mail
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index e74aef3..2281033 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -1,6 +1,6 @@
 ;;; spam.el --- Identifying spam
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Maintainer: Ted Zlatanov <tzz@lifelogs.com>
diff --git a/lisp/help-at-pt.el b/lisp/help-at-pt.el
index 1d9e051..e17bd0a 100644
--- a/lisp/help-at-pt.el
+++ b/lisp/help-at-pt.el
@@ -1,6 +1,6 @@
 ;;; help-at-pt.el --- local help through the keyboard
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Luc Teirlinck <teirllm@auburn.edu>
 ;; Keywords: help
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 1c55d0e..afbb5e3 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1,6 +1,6 @@
 ;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1993-1994, 1998-2020 Free Software
+;; Copyright (C) 1985-1986, 1993-1994, 1998-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -653,7 +653,7 @@ FILE is the file where FUNCTION was probably defined."
   ;; of the *packages* in which the function is defined.
   (let* ((name (symbol-name symbol))
          (re (concat "\\_<" (regexp-quote name) "\\_>"))
-         (news (directory-files data-directory t "\\`NEWS\\($\\|\\.\\)"))
+         (news (directory-files data-directory t "\\`NEWS\\(\\'\\|\\.\\)"))
          (place nil)
          (first nil))
     (with-temp-buffer
@@ -1137,8 +1137,7 @@ it is displayed along with the global value."
                (when (looking-at "value is") (replace-match ""))
                (save-excursion
                  (insert "\n\nValue:")
-                 (set (make-local-variable 'help-button-cache)
-                      (point-marker)))
+                  (setq-local help-button-cache (point-marker)))
                (insert "value is shown ")
                (insert-button "below"
                               'action help-button-cache
diff --git a/lisp/help-macro.el b/lisp/help-macro.el
index 877de78..791b10a 100644
--- a/lisp/help-macro.el
+++ b/lisp/help-macro.el
@@ -1,6 +1,6 @@
 ;;; help-macro.el --- makes command line help such as help-for-help
 
-;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Lynn Slater <lrs@indetech.com>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 732e6cc..cd08b2b 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -1,6 +1,6 @@
 ;;; help-mode.el --- `help-mode' used by *Help* buffers  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 1985-1986, 1993-1994, 1998-2020 Free Software
+;; Copyright (C) 1985-1986, 1993-1994, 1998-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -319,10 +319,10 @@ The format is (FUNCTION ARGS...).")
 Entry to this mode runs the normal hook `help-mode-hook'.
 Commands:
 \\{help-mode-map}"
-  (set (make-local-variable 'revert-buffer-function)
-       'help-mode-revert-buffer)
-  (set (make-local-variable 'bookmark-make-record-function)
-       'help-bookmark-make-record))
+  (setq-local revert-buffer-function
+              #'help-mode-revert-buffer)
+  (setq-local bookmark-make-record-function
+              #'help-bookmark-make-record))
 
 ;;;###autoload
 (defun help-mode-setup ()
diff --git a/lisp/help.el b/lisp/help.el
index ac5c2f1..084e941 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1,6 +1,6 @@
 ;;; help.el --- help commands for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1993-1994, 1998-2020 Free Software
+;; Copyright (C) 1985-1986, 1993-1994, 1998-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/hex-util.el b/lisp/hex-util.el
index d3ea705..41bdc39 100644
--- a/lisp/hex-util.el
+++ b/lisp/hex-util.el
@@ -1,6 +1,6 @@
 ;;; hex-util.el --- Functions to encode/decode hexadecimal string -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
 ;; Keywords: data
diff --git a/lisp/hexl.el b/lisp/hexl.el
index 5d813c4..8d3cfe6 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -1,6 +1,6 @@
 ;;; hexl.el --- edit a file in a hex dump format using the hexl filter -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1989, 1994, 1998, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1989, 1994, 1998, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Keith Gabryelski <ag@wheaties.ai.mit.edu>
@@ -722,7 +722,10 @@ With prefix arg N, puts point N bytes of the way from the 
true beginning."
   "Scroll hexl buffer window upward ARG lines; or near full window if no ARG."
   (interactive "P")
   (setq arg (if (null arg)
-                (1- (window-height))
+                (- (window-height)
+                   1
+                   (if ruler-mode 1 0)
+                   next-screen-context-lines)
               (prefix-numeric-value arg)))
   (hexl-scroll-up (- arg)))
 
@@ -731,7 +734,10 @@ With prefix arg N, puts point N bytes of the way from the 
true beginning."
 If there's no byte at the target address, move to the first or last line."
   (interactive "P")
   (setq arg (if (null arg)
-                (1- (window-height))
+                (- (window-height)
+                   1
+                   (if ruler-mode 1 0)
+                   next-screen-context-lines)
               (prefix-numeric-value arg)))
   (let* ((movement (* arg 16))
         (address (hexl-current-address))
diff --git a/lisp/hfy-cmap.el b/lisp/hfy-cmap.el
index a3398f6..b7de65f 100644
--- a/lisp/hfy-cmap.el
+++ b/lisp/hfy-cmap.el
@@ -1,6 +1,6 @@
 ;;; hfy-cmap.el --- Fallback color name -> rgb mapping for `htmlfontify'  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2002-2003, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2003, 2009-2021 Free Software Foundation, Inc.
 
 ;; Emacs Lisp Archive Entry
 ;; Package: htmlfontify
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 51887b7..e214ab6 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -1,6 +1,6 @@
 ;;; hi-lock.el --- minor mode for interactive automatic highlighting  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: David M. Koppelman <koppel@ece.lsu.edu>
 ;; Keywords: faces, minor-mode, matching, display
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index ae97bb0..fb33cd9 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -1,6 +1,6 @@
 ;;; hilit-chg.el --- minor mode displaying buffer changes with special face
 
-;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Richard Sharman <rsharman@pobox.com>
 ;; Keywords: faces
diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el
index b521dda..4d02023 100644
--- a/lisp/hippie-exp.el
+++ b/lisp/hippie-exp.el
@@ -1,6 +1,6 @@
 ;;; hippie-exp.el --- expand text trying various ways to find its expansion
 
-;; Copyright (C) 1992, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Anders Holst <aho@sans.kth.se>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/hl-line.el b/lisp/hl-line.el
index fe7e03f..73870f9 100644
--- a/lisp/hl-line.el
+++ b/lisp/hl-line.el
@@ -1,6 +1,6 @@
 ;;; hl-line.el --- highlight the current line  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index c9ede65..bfbe0ee 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -1,6 +1,6 @@
 ;;; htmlfontify.el --- htmlize a buffer/source tree with optional hyperlinks 
-*- lexical-binding: t -*-
 
-;; Copyright (C) 2002-2003, 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2003, 2009-2021 Free Software Foundation, Inc.
 
 ;; Emacs Lisp Archive Entry
 ;; Package: htmlfontify
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 7934297..7be1b3d 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -1,6 +1,6 @@
 ;;; ibuf-ext.el --- extensions for ibuffer  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Colin Walters <walters@verbum.org>
 ;; Maintainer: John Paul Wallington <jpw@gnu.org>
diff --git a/lisp/ibuf-macs.el b/lisp/ibuf-macs.el
index 0d5fd9c..be09c65 100644
--- a/lisp/ibuf-macs.el
+++ b/lisp/ibuf-macs.el
@@ -1,6 +1,6 @@
 ;;; ibuf-macs.el --- macros for ibuffer  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Colin Walters <walters@verbum.org>
 ;; Maintainer: John Paul Wallington <jpw@gnu.org>
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 00ba868..4800e02 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1,6 +1,6 @@
 ;;; ibuffer.el --- operate on buffers like dired  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Colin Walters <walters@verbum.org>
 ;; Maintainer: John Paul Wallington <jpw@gnu.org>
@@ -2464,7 +2464,7 @@ FORMATS is the value to use for `ibuffer-formats'.
          (require 'ibuf-ext)
          (setq ibuffer-filter-groups filter-groups))
        (when formats
-         (set (make-local-variable 'ibuffer-formats) formats))
+         (setq-local ibuffer-formats formats))
        (ibuffer-update nil)
        ;; Skip the group name by default.
        (ibuffer-forward-line 0 t)
@@ -2683,7 +2683,7 @@ You may rearrange filter groups by using the usual pair
 `\\[ibuffer-kill-line]' and `\\[ibuffer-yank]'.  Yanked groups
 will be inserted before the group at point."
   ;; Include state info next to the mode name.
-  (set (make-local-variable 'mode-line-process)
+  (setq-local mode-line-process
         '(" by "
           (ibuffer-sorting-mode (:eval (symbol-name ibuffer-sorting-mode))
                                 "view time")
@@ -2712,28 +2712,27 @@ will be inserted before the group at point."
   (setq show-trailing-whitespace nil)
   ;; disable `show-paren-mode' buffer-locally
   (if (bound-and-true-p show-paren-mode)
-      (set (make-local-variable 'show-paren-mode) nil))
-  (set (make-local-variable 'revert-buffer-function)
-       #'ibuffer-update)
-  (set (make-local-variable 'ibuffer-sorting-mode)
-       ibuffer-default-sorting-mode)
-  (set (make-local-variable 'ibuffer-sorting-reversep)
-       ibuffer-default-sorting-reversep)
-  (set (make-local-variable 'ibuffer-shrink-to-minimum-size)
-       ibuffer-default-shrink-to-minimum-size)
-  (set (make-local-variable 'ibuffer-display-maybe-show-predicates)
-       ibuffer-default-display-maybe-show-predicates)
-  (set (make-local-variable 'ibuffer-filtering-qualifiers) nil)
-  (set (make-local-variable 'ibuffer-filter-groups) nil)
-  (set (make-local-variable 'ibuffer-filter-group-kill-ring) nil)
-  (set (make-local-variable 'ibuffer-hidden-filter-groups) nil)
-  (set (make-local-variable 'ibuffer-compiled-formats) nil)
-  (set (make-local-variable 'ibuffer-cached-formats) nil)
-  (set (make-local-variable 'ibuffer-cached-eliding-string) nil)
-  (set (make-local-variable 'ibuffer-current-format) nil)
-  (set (make-local-variable 'ibuffer-did-modification) nil)
-  (set (make-local-variable 'ibuffer-tmp-hide-regexps) nil)
-  (set (make-local-variable 'ibuffer-tmp-show-regexps) nil)
+      (setq-local show-paren-mode nil))
+  (setq-local revert-buffer-function #'ibuffer-update)
+  (setq-local ibuffer-sorting-mode
+              ibuffer-default-sorting-mode)
+  (setq-local ibuffer-sorting-reversep
+              ibuffer-default-sorting-reversep)
+  (setq-local ibuffer-shrink-to-minimum-size
+              ibuffer-default-shrink-to-minimum-size)
+  (setq-local ibuffer-display-maybe-show-predicates
+              ibuffer-default-display-maybe-show-predicates)
+  (setq-local ibuffer-filtering-qualifiers nil)
+  (setq-local ibuffer-filter-groups nil)
+  (setq-local ibuffer-filter-group-kill-ring nil)
+  (setq-local ibuffer-hidden-filter-groups nil)
+  (setq-local ibuffer-compiled-formats nil)
+  (setq-local ibuffer-cached-formats nil)
+  (setq-local ibuffer-cached-eliding-string nil)
+  (setq-local ibuffer-current-format nil)
+  (setq-local ibuffer-did-modification nil)
+  (setq-local ibuffer-tmp-hide-regexps nil)
+  (setq-local ibuffer-tmp-show-regexps nil)
   (define-key ibuffer-mode-map [menu-bar edit] 'undefined)
   (define-key ibuffer-mode-map [menu-bar operate] (cons "Operate" 
ibuffer-mode-operate-map))
   (ibuffer-update-format)
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 9c14708..da589c0 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -1,6 +1,6 @@
 ;;; icomplete.el --- minibuffer completion incremental feedback -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1992-1994, 1997, 1999, 2001-2020 Free Software
+;; Copyright (C) 1992-1994, 1997, 1999, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Ken Manheimer <ken dot manheimer at gmail...>
@@ -75,12 +75,9 @@ everything preceding the ~/ is discarded so the interactive
 selection process starts again from the user's $HOME.")
 
 (defcustom icomplete-show-matches-on-no-input nil
-  "If nil, don't wait for completions before showing the prompt.
-Instead, when there's no input, completions may be displayed
-asynchronously later, when the completions have been computed.
-
-If non-nil, always compute the completions first.
-
+  "When non-nil, show completions when first prompting for input.
+This means to show completions even when the current minibuffer contents
+is the same as was the initial input after minibuffer activation.
 This also means that if you traverse the list of completions with
 commands like `C-.' and just hit RET without typing any
 characters, the match under point will be chosen instead of the
@@ -151,6 +148,10 @@ icompletion is occurring."
 (defvar icomplete-overlay (make-overlay (point-min) (point-min) nil t t)
   "Overlay used to display the list of completions.")
 
+(defvar icomplete--initial-input nil
+  "Initial input in the minibuffer when icomplete-mode was activated.
+Used to implement the option `icomplete-show-matches-on-no-input'.")
+
 (defun icomplete-pre-command-hook ()
  (let ((non-essential t))
    (icomplete-tidy)))
@@ -174,7 +175,7 @@ icompletion is occurring."
   (interactive)
   (if (and icomplete-show-matches-on-no-input
            (car completion-all-sorted-completions)
-           (eql (icomplete--field-end) (icomplete--field-beg)))
+           (equal (icomplete--field-string) icomplete--initial-input))
       (icomplete-force-complete-and-exit)
     (minibuffer-complete-and-exit)))
 
@@ -194,7 +195,7 @@ the default otherwise."
   (if (or
        ;; there's some input, meaning the default in off the table by
        ;; definition; OR
-       (> (icomplete--field-end) (icomplete--field-beg))
+       (not (equal (icomplete--field-string) icomplete--initial-input))
        ;; there's no input, but there's also no minibuffer default
        ;; (and the user really wants to see completions on no input,
        ;; meaning he expects a "force" to be at least attempted); OR
@@ -446,7 +447,8 @@ Conditions are:
   "Run in minibuffer on activation to establish incremental completion.
 Usually run by inclusion in `minibuffer-setup-hook'."
   (when (and icomplete-mode (icomplete-simple-completing-p))
-    (set (make-local-variable 'completion-show-inline-help) nil)
+    (setq-local icomplete--initial-input (icomplete--field-string))
+    (setq-local completion-show-inline-help nil)
     (use-local-map (make-composed-keymap icomplete-minibuffer-map
                                         (current-local-map)))
     (add-hook 'pre-command-hook  #'icomplete-pre-command-hook  nil t)
@@ -469,7 +471,7 @@ Usually run by inclusion in `minibuffer-setup-hook'."
   (when (and completion-in-region-mode
             icomplete-mode (icomplete-simple-completing-p))
     (setq icomplete--in-region-buffer (current-buffer))
-    (set (make-local-variable 'completion-show-inline-help) nil)
+    (setq-local completion-show-inline-help nil)
     (let ((tem (assq 'completion-in-region-mode
                     minor-mode-overriding-map-alist)))
       (unless (memq icomplete-minibuffer-map (cdr tem))
@@ -491,7 +493,7 @@ Usually run by inclusion in `minibuffer-setup-hook'."
        ;; `completing-read' invocations, described below:
        for fn in (cond ((and minibuffer-default
                              (stringp minibuffer-default) ; bug#38992
-                             (= (icomplete--field-end) (icomplete--field-beg)))
+                             (equal (icomplete--field-string) 
icomplete--initial-input))
                         ;; Here, we have a non-nil string default and
                         ;; no input whatsoever.  We want to make sure
                         ;; that the default is bubbled to the top so
@@ -584,7 +586,8 @@ See `icomplete-mode' and `minibuffer-setup-hook'."
         (goto-char (point-max))
                                         ; Insert the match-status information:
         (when (and (or icomplete-show-matches-on-no-input
-                       (> (icomplete--field-end) (icomplete--field-beg)))
+                       (not (equal (icomplete--field-string)
+                                   icomplete--initial-input)))
                    (or
                     ;; Don't bother with delay after certain number of chars:
                     (> (- (point) (icomplete--field-beg))
@@ -607,7 +610,7 @@ See `icomplete-mode' and `minibuffer-setup-hook'."
                  (or (>= (- (point) (overlay-end rfn-eshadow-overlay)) 2)
                      (eq ?/ (char-before (- (point) 2)))))
             (delete-region (overlay-start rfn-eshadow-overlay)
-                           (overlay-end rfn-eshadow-overlay)) )
+                           (overlay-end rfn-eshadow-overlay)))
           (let* ((field-string (icomplete--field-string))
                  ;; Not sure why, but such requests seem to come
                  ;; every once in a while.  It's not fully
diff --git a/lisp/ido.el b/lisp/ido.el
index c83b700..89b6a62 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1,6 +1,6 @@
 ;;; ido.el --- interactively do things with buffers and files -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Kim F. Storm <storm@cua.dk>
 ;; Based on: iswitchb by Stephen Eglen <stephen@cns.ed.ac.uk>
@@ -842,7 +842,7 @@ variables:
   max-width - the max width of the resulting dirname; nil means no limit
   prompt    - the basic prompt (e.g. \"Find File: \")
   literal   - the string shown if doing \"literal\" find; set to nil to omit
-  vc-off    - the string shown if version control is inhibited; set to nil to 
omit
+  vc-off    - the string shown if version control is inhibited; use nil to omit
   prefix    - either nil or a fixed prefix for the dirname
 
 The following variables are available, but should not be changed:
@@ -2367,7 +2367,16 @@ If cursor is not at the end of the user input, move to 
end of input."
              (read-file-name-function nil))
          (setq this-command (or ido-fallback fallback 'find-file))
          (run-hook-with-args 'ido-before-fallback-functions this-command)
-         (call-interactively this-command)))
+          (if (eq this-command 'write-file)
+              (write-file (read-file-name
+                           "Write file: "
+                           default-directory
+                           (and buffer-file-name
+                                (expand-file-name
+                                 (file-name-nondirectory buffer-file-name)
+                                 default-directory)))
+                          t)
+           (call-interactively this-command))))
 
        ((eq ido-exit 'switch-to-buffer)
        (ido-buffer-internal
@@ -3966,7 +3975,7 @@ If `ido-change-word-sub' cannot be found in WORD, return 
nil."
                      (boundp 'ido-completion-buffer-full))
                  (set-window-start win (point-min))
                (with-no-warnings
-                 (set (make-local-variable 'ido-completion-buffer-full) t))
+                  (setq-local ido-completion-buffer-full t))
                (setq full-list t
                      display-it t))
            (scroll-other-window))
@@ -4810,8 +4819,7 @@ Modified from `icomplete-completions'."
            (delete-region ido-eoinput (point-max))))
 
       ;; Reestablish the local variable 'cause minibuffer-setup is weird:
-      (make-local-variable 'ido-eoinput)
-      (setq ido-eoinput 1))))
+      (setq-local ido-eoinput 1))))
 
 (defun ido-summary-buffers-to-end ()
   ;; Move the summaries to the end of the buffer list.
diff --git a/lisp/ielm.el b/lisp/ielm.el
index 91d025d..fd8dac7 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -1,6 +1,6 @@
 ;;; ielm.el --- interaction mode for Emacs Lisp  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Smith <maa036@lancaster.ac.uk>
 ;; Maintainer: emacs-devel@gnu.org
@@ -529,8 +529,8 @@ Customized bindings may be defined in `ielm-map', which 
currently contains:
   :syntax-table emacs-lisp-mode-syntax-table
 
   (setq comint-prompt-regexp (concat "^" (regexp-quote ielm-prompt)))
-  (set (make-local-variable 'paragraph-separate) "\\'")
-  (set (make-local-variable 'paragraph-start) comint-prompt-regexp)
+  (setq-local paragraph-separate "\\'")
+  (setq-local paragraph-start comint-prompt-regexp)
   (setq comint-input-sender 'ielm-input-sender)
   (setq comint-process-echoes nil)
   (dolist (f '(elisp-completion-at-point
@@ -541,28 +541,28 @@ Customized bindings may be defined in `ielm-map', which 
currently contains:
             #'elisp-eldoc-var-docstring nil t)
   (add-hook 'eldoc-documentation-functions
             #'elisp-eldoc-funcall nil t)
-  (set (make-local-variable 'ielm-prompt-internal) ielm-prompt)
-  (set (make-local-variable 'comint-prompt-read-only) ielm-prompt-read-only)
+  (setq-local ielm-prompt-internal ielm-prompt)
+  (setq-local comint-prompt-read-only ielm-prompt-read-only)
   (setq comint-get-old-input 'ielm-get-old-input)
-  (set (make-local-variable 'comint-completion-addsuffix) '("/" . ""))
+  (setq-local comint-completion-addsuffix '("/" . ""))
   (setq mode-line-process '(":%s on " (:eval (buffer-name 
ielm-working-buffer))))
   ;; Useful for `hs-minor-mode'.
   (setq-local comment-start ";")
   (setq-local comment-use-syntax t)
   (setq-local lexical-binding t)
 
-  (set (make-local-variable 'indent-line-function) #'ielm-indent-line)
-  (set (make-local-variable 'ielm-working-buffer) (current-buffer))
-  (set (make-local-variable 'fill-paragraph-function) #'lisp-fill-paragraph)
+  (setq-local indent-line-function #'ielm-indent-line)
+  (setq-local ielm-working-buffer (current-buffer))
+  (setq-local fill-paragraph-function #'lisp-fill-paragraph)
 
   ;; Value holders
-  (set (make-local-variable '*) nil)
-  (set (make-local-variable '**) nil)
-  (set (make-local-variable '***) nil)
-  (set (make-local-variable 'ielm-match-data) nil)
+  (setq-local * nil)
+  (setq-local ** nil)
+  (setq-local *** nil)
+  (setq-local ielm-match-data nil)
 
   ;; font-lock support
-  (set (make-local-variable 'font-lock-defaults)
+  (setq-local font-lock-defaults
        '(ielm-font-lock-keywords nil nil ((?: . "w") (?- . "w") (?* . "w"))))
 
   ;; A dummy process to keep comint happy. It will never get any input
@@ -577,7 +577,7 @@ Customized bindings may be defined in `ielm-map', which 
currently contains:
 
     ;; Lisp output can include raw characters that confuse comint's
     ;; carriage control code.
-    (set (make-local-variable 'comint-inhibit-carriage-motion) t)
+    (setq-local comint-inhibit-carriage-motion t)
 
     ;; Add a silly header
     (insert ielm-header)
diff --git a/lisp/iimage.el b/lisp/iimage.el
index 07c1886..cc1461d 100644
--- a/lisp/iimage.el
+++ b/lisp/iimage.el
@@ -1,6 +1,6 @@
 ;;; iimage.el --- Inline image minor mode.
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: KOSEKI Yoshinori <kose@meadowy.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index a29adde..48f9cd0 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1,6 +1,6 @@
 ;;; image-dired.el --- use dired to browse and manipulate your images -*- 
lexical-binding: t -*-
 ;;
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 ;;
 ;; Version: 0.4.11
 ;; Keywords: multimedia
diff --git a/lisp/image-file.el b/lisp/image-file.el
index 3b4f572..fbc9eaa 100644
--- a/lisp/image-file.el
+++ b/lisp/image-file.el
@@ -1,6 +1,6 @@
 ;;; image-file.el --- support for visiting image files  -*- lexical-binding:t 
-*-
 ;;
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Miles Bader <miles@gnu.org>
 ;; Keywords: multimedia
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 032ebf3..9ed295e 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -1,6 +1,6 @@
 ;;; image-mode.el --- support for visiting image files  -*- lexical-binding: t 
-*-
 ;;
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Richard Stallman <rms@gnu.org>
 ;; Keywords: multimedia
@@ -667,6 +667,9 @@ Key bindings:
   (when image-auto-resize-on-window-resize
     (add-hook 'window-state-change-functions #'image--window-state-change nil 
t))
 
+  (add-function :before-while (local 'isearch-filter-predicate)
+                #'image-mode-isearch-filter)
+
   (run-mode-hooks 'image-mode-hook)
   (let ((image (image-get-display-property))
        (msg1 (substitute-command-keys
@@ -782,6 +785,14 @@ Remove text properties that display the image."
     (if (called-interactively-p 'any)
        (message "Repeat this command to go back to displaying the image"))))
 
+(defun image-mode-isearch-filter (_beg _end)
+  "Show image as text when trying to search/replace in the image buffer."
+  (save-match-data
+    (when (and (derived-mode-p 'image-mode)
+               (image-get-display-property))
+      (image-mode-as-text)))
+  t)
+
 (defvar archive-superior-buffer)
 (defvar tar-superior-buffer)
 (declare-function image-flush "image.c" (spec &optional frame))
@@ -942,6 +953,9 @@ Otherwise, display the image by calling `image-mode'."
           (get-buffer-window-list (current-buffer) 'nomini 'visible))
     (image-toggle-display-image)))
 
+(defvar image-auto-resize-timer nil
+  "Timer for `image-auto-resize-on-window-resize' option.")
+
 (defun image--window-state-change (window)
   ;; Wait for a bit of idle-time before actually performing the change,
   ;; so as to batch together sequences of closely consecutive size changes.
@@ -950,8 +964,14 @@ Otherwise, display the image by calling `image-mode'."
   ;; consecutive calls happen without any redisplay between them,
   ;; the costly operation of image resizing should happen only once.
   (when (numberp image-auto-resize-on-window-resize)
-    (run-with-idle-timer image-auto-resize-on-window-resize nil
-                         #'image-fit-to-window window)))
+    (when image-auto-resize-timer
+      (cancel-timer image-auto-resize-timer))
+    (setq image-auto-resize-timer
+          (run-with-idle-timer image-auto-resize-on-window-resize nil
+                               #'image-fit-to-window window))))
+
+(defvar image-fit-to-window-lock nil
+  "Lock for `image-fit-to-window' timer function.")
 
 (defun image-fit-to-window (window)
   "Adjust size of image to display it exactly in WINDOW boundaries."
@@ -968,7 +988,13 @@ Otherwise, display the image by calling `image-mode'."
               (when (and image-width image-height
                          (or (not (= image-width  window-width))
                              (not (= image-height window-height))))
-                (image-toggle-display-image)))))))))
+                (unless image-fit-to-window-lock
+                  (unwind-protect
+                      (progn
+                        (setq-local image-fit-to-window-lock t)
+                        (ignore-error 'remote-file-error
+                          (image-toggle-display-image)))
+                    (setq image-fit-to-window-lock nil)))))))))))
 
 
 ;;; Animated images
diff --git a/lisp/image.el b/lisp/image.el
index 9ebb603..8140355 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -1,6 +1,6 @@
 ;;; image.el --- image API  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: multimedia
@@ -679,8 +679,10 @@ BUFFER nil or omitted means use the current buffer."
       (setq path (cdr path)))
     (if found filename)))
 
+(defvar find-image--cache (make-hash-table :test #'equal))
+
 ;;;###autoload
-(defun find-image (specs)
+(defun find-image (specs &optional cache)
   "Find an image, choosing one of a list of image specifications.
 
 SPECS is a list of image specifications.
@@ -695,26 +697,33 @@ is supported, and FILE exists, is used to construct the 
image
 specification to be returned.  Return nil if no specification is
 satisfied.
 
+If CACHE is non-nil, results are cached and returned on subsequent calls.
+
 The image is looked for in `image-load-path'.
 
 Image files should not be larger than specified by `max-image-size'."
-  (let (image)
-    (while (and specs (null image))
-      (let* ((spec (car specs))
-            (type (plist-get spec :type))
-            (data (plist-get spec :data))
-            (file (plist-get spec :file))
-            found)
-       (when (image-type-available-p type)
-         (cond ((stringp file)
-                (if (setq found (image-search-load-path file))
-                    (setq image
-                          (cons 'image (plist-put (copy-sequence spec)
-                                                  :file found)))))
-               ((not (null data))
-                (setq image (cons 'image spec)))))
-       (setq specs (cdr specs))))
-    image))
+  (or (and cache
+           (gethash specs find-image--cache))
+      (let ((orig-specs specs)
+            image)
+        (while (and specs (null image))
+          (let* ((spec (car specs))
+                (type (plist-get spec :type))
+                (data (plist-get spec :data))
+                (file (plist-get spec :file))
+                found)
+           (when (image-type-available-p type)
+             (cond ((stringp file)
+                    (if (setq found (image-search-load-path file))
+                        (setq image
+                              (cons 'image (plist-put (copy-sequence spec)
+                                                      :file found)))))
+                   ((not (null data))
+                    (setq image (cons 'image spec)))))
+           (setq specs (cdr specs))))
+        (when cache
+          (setf (gethash orig-specs find-image--cache) image))
+        image)))
 
 
 ;;;###autoload
diff --git a/lisp/image/compface.el b/lisp/image/compface.el
index 12473e8..6519615 100644
--- a/lisp/image/compface.el
+++ b/lisp/image/compface.el
@@ -1,6 +1,6 @@
 ;;; compface.el --- functions for converting X-Face headers -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: multimedia, news
diff --git a/lisp/image/exif.el b/lisp/image/exif.el
index 6aeb52c..2dc9419 100644
--- a/lisp/image/exif.el
+++ b/lisp/image/exif.el
@@ -1,6 +1,6 @@
 ;;; exif.el --- parsing Exif data in JPEG images -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: images
@@ -165,7 +165,7 @@ If the orientation isn't present in the data, return nil."
       ;; Another magical number.
       (unless (= (exif--read-number 2 le) #x002a)
         (signal 'exif-error "Invalid TIFF header length"))
-      (let ((offset (exif--read-number 2 le)))
+      (let ((offset (exif--read-number 4 le)))
         ;; Jump to where the IFD (directory) starts and parse it.
         (when (> (1+ offset) (point-max))
           (signal 'exif-error "Invalid IFD (directory) offset"))
diff --git a/lisp/image/gravatar.el b/lisp/image/gravatar.el
index 3543be6..4f37834 100644
--- a/lisp/image/gravatar.el
+++ b/lisp/image/gravatar.el
@@ -1,6 +1,6 @@
 ;;; gravatar.el --- Get Gravatars -*- lexical-binding: t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Julien Danjou <julien@danjou.info>
 ;; Keywords: comm, multimedia
diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el
index c31a3b8..e47f1f7 100644
--- a/lisp/image/image-converter.el
+++ b/lisp/image/image-converter.el
@@ -1,6 +1,6 @@
 ;;; image-converter.el --- Converting images from exotic formats -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: images
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 8fdacb0..b5cd18a 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -1,6 +1,6 @@
 ;;; imenu.el --- framework for mode-specific buffer indexes  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1994-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Ake Stenhoff <etxaksf@aom.ericsson.se>
 ;;         Lars Lindberg <lli@sypro.cap.se>
diff --git a/lisp/indent.el b/lisp/indent.el
index e67109a..5c5270b 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -1,6 +1,6 @@
 ;;; indent.el --- indentation commands for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985, 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Package: emacs
diff --git a/lisp/info-look.el b/lisp/info-look.el
index bcc2930..fd6f8f1 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -1,7 +1,7 @@
 ;;; info-look.el --- major-mode-sensitive Info index lookup facility -*- 
lexical-binding: t -*-
 ;; An older version of this was known as libc.el.
 
-;; Copyright (C) 1995-1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Ralph Schleicher <rs@ralph-schleicher.de>
 ;; Keywords: help languages
diff --git a/lisp/info-xref.el b/lisp/info-xref.el
index 6d0ebe0..be1928d 100644
--- a/lisp/info-xref.el
+++ b/lisp/info-xref.el
@@ -1,6 +1,6 @@
 ;;; info-xref.el --- check external references in an Info document -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Kevin Ryde <user42@zip.com.au>
 ;; Keywords: docs
diff --git a/lisp/info.el b/lisp/info.el
index c3684de..ef94aa9 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1,6 +1,6 @@
 ;; info.el --- Info package for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: help
@@ -2473,7 +2473,7 @@ Table of contents is created from the tree structure of 
menus."
               (setq bound (or (and (equal nodename "Top")
                                    (save-excursion
                                      (re-search-forward
-                                      "^[ \t-]*The Detailed Node Listing" nil 
t)))
+                                      "^[ \t—-]*The Detailed Node Listing" nil 
t)))
                               bound))
               (while (< (point) bound)
                 (cond
@@ -3105,9 +3105,11 @@ See `Info-scroll-down'."
 (defun Info-next-reference-or-link (pat prop)
   "Move point to the next pattern-based cross-reference or property-based link.
 The next cross-reference is searched using the regexp PAT, and the next link
-is searched using the text property PROP.  Move point to the closest found 
position
-of either a cross-reference found by `re-search-forward' or a link found by
-`next-single-char-property-change'.  Return the new position of point, or nil."
+is searched using the text property PROP.  Move point to the closest found
+position of either a cross-reference found by `re-search-forward' or a link
+found by `next-single-char-property-change'.
+
+Return the new position of point, or nil."
   (let ((pxref (save-excursion (re-search-forward pat nil t)))
        (plink (next-single-char-property-change (point) prop)))
     (when (and (< plink (point-max)) (not (get-char-property plink prop)))
@@ -3120,10 +3122,12 @@ of either a cross-reference found by 
`re-search-forward' or a link found by
 
 (defun Info-prev-reference-or-link (pat prop)
   "Move point to the previous pattern-based cross-reference or property-based 
link.
-The previous cross-reference is searched using the regexp PAT, and the 
previous link
-is searched using the text property PROP.  Move point to the closest found 
position
-of either a cross-reference found by `re-search-backward' or a link found by
-`previous-single-char-property-change'.  Return the new position of point, or 
nil."
+The previous cross-reference is searched using the regexp PAT, and the previous
+link is searched using the text property PROP.  Move point to the closest found
+position of either a cross-reference found by `re-search-backward' or a link
+found by `previous-single-char-property-change'.
+
+Return the new position of point, or nil."
   (let ((pxref (save-excursion (re-search-backward pat nil t)))
        (plink (previous-single-char-property-change (point) prop)))
     (when (and (> plink (point-min)) (not (get-char-property plink prop)))
@@ -4790,10 +4794,10 @@ first line or header line, and for breadcrumb links.")
                    ;; an end of sentence
                    (skip-syntax-backward " ("))
                   (setq other-tag
-                       (cond ((save-match-data (looking-back "\\<see"
+                       (cond ((save-match-data (looking-back "\\(^\\| \\)see"
                                                               (- (point) 3)))
                               "")
-                             ((save-match-data (looking-back "\\<in"
+                             ((save-match-data (looking-back "\\(^\\| \\)in"
                                                               (- (point) 2)))
                               "")
                              ((memq (char-before) '(nil ?\. ?! ??))
diff --git a/lisp/informat.el b/lisp/informat.el
index 7750ab0..3da2351 100644
--- a/lisp/informat.el
+++ b/lisp/informat.el
@@ -1,6 +1,6 @@
 ;;; informat.el --- info support functions package for Emacs
 
-;; Copyright (C) 1986, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1986, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: help
diff --git a/lisp/international/ccl.el b/lisp/international/ccl.el
index 3b3fcf4..3c5a461 100644
--- a/lisp/international/ccl.el
+++ b/lisp/international/ccl.el
@@ -1,6 +1,6 @@
 ;;; ccl.el --- CCL (Code Conversion Language) compiler  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index 0b6920c..6924e1c 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -1,6 +1,6 @@
 ;;; characters.el --- set syntax and category for multibyte characters
 
-;; Copyright (C) 1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2000-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -226,6 +226,7 @@ with L, LRE, or LRO Unicode bidi character type.")
 
 
 ;; JISX0208
+;; Note: Some of these have their syntax updated later below.
 (map-charset-chars #'modify-syntax-entry 'japanese-jisx0208 "_" #x2121 #x227E)
 (map-charset-chars #'modify-syntax-entry 'japanese-jisx0208 "_" #x2821 #x287E)
 (let ((chars '(?ー ?゛ ?゜ ?ヽ ?ヾ ?ゝ ?ゞ ?〃 ?仝 ?々 ?〆 ?〇)))
@@ -317,6 +318,7 @@ with L, LRE, or LRO Unicode bidi character type.")
 (modify-syntax-entry #x5be ".") ; MAQAF
 (modify-syntax-entry #x5c0 ".") ; PASEQ
 (modify-syntax-entry #x5c3 ".") ; SOF PASUQ
+(modify-syntax-entry #x5c6 ".") ; NUN HAFUKHA
 (modify-syntax-entry #x5f3 ".") ; GERESH
 (modify-syntax-entry #x5f4 ".") ; GERSHAYIM
 
@@ -521,6 +523,9 @@ with L, LRE, or LRO Unicode bidi character type.")
   ;; syntax: ¢£¤¥¨ª¯²³´¶¸¹º.)  There should be a well-defined way of
   ;; relating Unicode categories to Emacs syntax codes.
 
+  ;; FIXME: We should probably just use the Unicode properties to set
+  ;; up the syntax table.
+
   ;; NBSP isn't semantically interchangeable with other whitespace chars,
   ;; so it's more like punctuation.
   (set-case-syntax ?  "." tbl)
@@ -558,7 +563,7 @@ with L, LRE, or LRO Unicode bidi character type.")
     (setq c (1+ c)))
 
   ;; Latin Extended Additional
-  (modify-category-entry '(#x1e00 . #x1ef9) ?l)
+  (modify-category-entry '(#x1E00 . #x1EF9) ?l)
 
   ;; Latin Extended-C
   (setq c #x2C60)
@@ -579,13 +584,13 @@ with L, LRE, or LRO Unicode bidi character type.")
     (setq c (1+ c)))
 
   ;; Greek
-  (modify-category-entry '(#x0370 . #x03ff) ?g)
+  (modify-category-entry '(#x0370 . #x03FF) ?g)
 
   ;; Armenian
   (setq c #x531)
 
   ;; Greek Extended
-  (modify-category-entry '(#x1f00 . #x1fff) ?g)
+  (modify-category-entry '(#x1F00 . #x1FFF) ?g)
 
   ;; cyrillic
   (modify-category-entry '(#x0400 . #x04FF) ?y)
@@ -605,40 +610,43 @@ with L, LRE, or LRO Unicode bidi character type.")
   (while (<= c #x200F)
     (set-case-syntax c "." tbl)
     (setq c (1+ c)))
-  ;; Fixme: These aren't all right:
   (setq c #x2010)
-  (while (<= c #x2016)
-    (set-case-syntax c "_" tbl)
+  ;; Fixme: What to do with characters that have Pi and Pf
+  ;; Unicode properties?
+  (while (<= c #x2017)
+    (set-case-syntax c "." tbl)
     (setq c (1+ c)))
   ;; Punctuation syntax for quotation marks (like `)
-  (while (<= c #x201f)
+  (while (<= c #x201F)
     (set-case-syntax  c "." tbl)
     (setq c (1+ c)))
-  ;; Fixme: These aren't all right:
   (while (<= c #x2027)
-    (set-case-syntax c "_" tbl)
+    (set-case-syntax c "." tbl)
     (setq c (1+ c)))
-  (while (<= c #x206F)
+  (setq c #x2030)
+  (while (<= c #x205E)
     (set-case-syntax c "." tbl)
     (setq c (1+ c)))
+  (let ((chars '(?‹ ?› ?⁄ ?⁒)))
+    (while chars
+      (modify-syntax-entry (car chars) "_")
+      (setq chars (cdr chars))))
 
-  ;; Fixme: The following blocks might be better as symbol rather than
-  ;; punctuation.
   ;; Arrows
   (setq c #x2190)
   (while (<= c #x21FF)
-    (set-case-syntax c "." tbl)
+    (set-case-syntax c "_" tbl)
     (setq c (1+ c)))
   ;; Mathematical Operators
   (while (<= c #x22FF)
-    (set-case-syntax c "." tbl)
+    (set-case-syntax c "_" tbl)
     (setq c (1+ c)))
   ;; Miscellaneous Technical
   (while (<= c #x23FF)
-    (set-case-syntax c "." tbl)
+    (set-case-syntax c "_" tbl)
     (setq c (1+ c)))
   ;; Control Pictures
-  (while (<= c #x243F)
+  (while (<= c #x244F)
     (set-case-syntax c "_" tbl)
     (setq c (1+ c)))
 
@@ -652,13 +660,13 @@ with L, LRE, or LRO Unicode bidi character type.")
   ;; Supplemental Mathematical Operators
   (setq c #x2A00)
   (while (<= c #x2AFF)
-    (set-case-syntax c "." tbl)
+    (set-case-syntax c "_" tbl)
     (setq c (1+ c)))
 
   ;; Miscellaneous Symbols and Arrows
   (setq c #x2B00)
   (while (<= c #x2BFF)
-    (set-case-syntax c "." tbl)
+    (set-case-syntax c "_" tbl)
     (setq c (1+ c)))
 
   ;; Coptic
@@ -674,19 +682,47 @@ with L, LRE, or LRO Unicode bidi character type.")
     (set-case-syntax c "." tbl)
     (setq c (1+ c)))
 
+  ;; Ideographic punctuation
+  (setq c #x3001)
+  (while (<= c #x3003)
+    (set-case-syntax c "." tbl)
+    (setq c (1+ c)))
+  (set-case-syntax #x30FB "." tbl)
+
   ;; Symbols for Legacy Computing
   (setq c #x1FB00)
+  (while (<= c #x1FBCA)
+    (set-case-syntax c "_" tbl)
+    (setq c (1+ c)))
+  ;; FIXME: Should these be digits?
   (while (<= c #x1FBFF)
     (set-case-syntax c "." tbl)
     (setq c (1+ c)))
 
   ;; Fullwidth Latin
-  (setq c #xff21)
-  (while (<= c #xff3a)
+  (setq c #xFF01)
+  (while (<= c #xFF0F)
+    (set-case-syntax c "." tbl)
+    (setq c (1+ c)))
+  (set-case-syntax #xFF04 "_" tbl)
+  (set-case-syntax #xFF0B "_" tbl)
+  (set-case-syntax #xFF1A "." tbl)
+  (set-case-syntax #xFF1B "." tbl)
+  (set-case-syntax #xFF1F "." tbl)
+  (set-case-syntax #xFF20 "." tbl)
+  (setq c #xFF21)
+  (while (<= c #xFF3A)
     (modify-category-entry c ?l)
     (modify-category-entry (+ c #x20) ?l)
     (setq c (1+ c)))
 
+  ;; Halfwidth Latin
+  (setq c #xFF64)
+  (while (<= c #xFF65)
+    (set-case-syntax c "." tbl)
+    (setq c (1+ c)))
+  (set-case-syntax #xFF61 "." tbl)
+
   ;; Combining diacritics
   (modify-category-entry '(#x300 . #x362) ?^)
   ;; Combining marks
@@ -759,7 +795,14 @@ with L, LRE, or LRO Unicode bidi character type.")
         (funcall map-unicode-property 'uppercase
                  (lambda (lc uc) (aset up lc uc) (aset up uc uc)))
         (funcall map-unicode-property 'lowercase
-                 (lambda (uc lc) (aset down uc lc) (aset down lc lc))))))
+                 (lambda (uc lc) (aset down uc lc) (aset down lc lc)))
+
+        ;; Override the Unicode uppercase property for ß, since we are
+        ;; using our case tables for determining the case of a
+        ;; character (see uppercasep and lowercasep in buffer.h).
+        ;; The special-uppercase property of ß ensures that it is
+        ;; still upcased to SS per the usual convention.
+        (aset up ?ß ?ẞ))))
 
   ;; Clear out the extra slots so that they will be recomputed from the main
   ;; (downcase) table and upcase table.  Since we’re side-stepping the usual
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index a52b628..4d80e17 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -1,6 +1,6 @@
 ;;; fontset.el --- commands for handling fontset
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el
index f50f86a..400421d 100644
--- a/lisp/international/isearch-x.el
+++ b/lisp/international/isearch-x.el
@@ -1,6 +1,6 @@
 ;;; isearch-x.el --- extended isearch handling commands
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -35,9 +35,8 @@
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (toggle-input-method t))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 ;;;###autoload
@@ -46,9 +45,8 @@
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (toggle-input-method))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 ;;;###autoload
@@ -57,9 +55,7 @@
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (activate-transient-input-method))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 (defvar isearch-minibuffer-local-map
diff --git a/lisp/international/iso-ascii.el b/lisp/international/iso-ascii.el
index 0df07d6..f8cb61c 100644
--- a/lisp/international/iso-ascii.el
+++ b/lisp/international/iso-ascii.el
@@ -1,6 +1,6 @@
 ;;; iso-ascii.el --- set up char tables for ISO 8859/1 on ASCII terminals  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1987, 1995, 1998, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1987, 1995, 1998, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Howard Gayle
diff --git a/lisp/international/iso-cvt.el b/lisp/international/iso-cvt.el
index e55ae1a..3f3843e 100644
--- a/lisp/international/iso-cvt.el
+++ b/lisp/international/iso-cvt.el
@@ -1,7 +1,7 @@
 ;;; iso-cvt.el --- translate ISO 8859-1 from/to various encodings -*- coding: 
utf-8 -*-
 ;; This file was formerly called gm-lingo.el.
 
-;; Copyright (C) 1993-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Gschwind <mike@vlsivie.tuwien.ac.at>
 ;; Keywords: tex, iso, latin, i18n
diff --git a/lisp/international/iso-transl.el b/lisp/international/iso-transl.el
index 39fd75e..8b5814e 100644
--- a/lisp/international/iso-transl.el
+++ b/lisp/international/iso-transl.el
@@ -1,6 +1,6 @@
 ;;; iso-transl.el --- keyboard input for ISO 10646 chars -*- coding: utf-8 -*-
 
-;; Copyright (C) 1987, 1993-1999, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1987, 1993-1999, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Howard Gayle
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index 5f645b6..b805904 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -1,6 +1,6 @@
 ;;; ja-dic-cnv.el --- convert a Japanese dictionary (SKK-JISYO.L) to Emacs Lisp
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
diff --git a/lisp/international/kinsoku.el b/lisp/international/kinsoku.el
index 4e9b6b0..cd740ac 100644
--- a/lisp/international/kinsoku.el
+++ b/lisp/international/kinsoku.el
@@ -1,6 +1,6 @@
 ;;; kinsoku.el --- `Kinsoku' processing funcs
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/international/kkc.el b/lisp/international/kkc.el
index 9da9d14..290f4fa 100644
--- a/lisp/international/kkc.el
+++ b/lisp/international/kkc.el
@@ -1,6 +1,6 @@
 ;;; kkc.el --- Kana Kanji converter
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/international/latexenc.el b/lisp/international/latexenc.el
index cce5e06..e2ee3fb 100644
--- a/lisp/international/latexenc.el
+++ b/lisp/international/latexenc.el
@@ -1,6 +1,6 @@
 ;;; latexenc.el --- guess correct coding system in LaTeX files -*-coding: 
utf-8 -*-
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Arne Jørgensen <arne@arnested.dk>
 ;; Keywords: mule, coding system, latex
diff --git a/lisp/international/latin1-disp.el 
b/lisp/international/latin1-disp.el
index f2e35e9..bda2c51 100644
--- a/lisp/international/latin1-disp.el
+++ b/lisp/international/latin1-disp.el
@@ -1,6 +1,6 @@
 ;;; latin1-disp.el --- display tables for other ISO 8859 on Latin-1 terminals 
-*-coding: utf-8;-*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: i18n
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index d59f2c0..347e678 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1,6 +1,6 @@
 ;;; mule-cmds.el --- commands for multilingual environment  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -1356,7 +1356,7 @@ This is the input method activated by the command
   :version "28.1")
 
 (defvar current-transient-input-method nil
-  "The current input method temporarily enabled by 
`activate-transient-input-method'.
+  "Current input method temporarily enabled by 
`activate-transient-input-method'.
 If nil, that means no transient input method is active now.")
 (make-variable-buffer-local 'current-transient-input-method)
 (put 'current-transient-input-method 'permanent-local t)
diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el
index 99449ad..662f211 100644
--- a/lisp/international/mule-conf.el
+++ b/lisp/international/mule-conf.el
@@ -1,6 +1,6 @@
 ;;; mule-conf.el --- configure multilingual environment
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 
2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
@@ -1075,6 +1075,90 @@
 (define-charset-alias 'ebcdic-int 'ibm038)
 (define-charset-alias 'cp038 'ibm038)
 
+(define-charset 'ibm256
+  "Netherlands version of EBCDIC"
+  :short-name "IBM256"
+  :code-space [0 255]
+  :mime-charset 'ibm256
+  :map "IBM256")
+
+(define-charset 'ibm273
+  "Austrian / German version of EBCDIC"
+  :short-name "IBM273"
+  :code-space [0 255]
+  :mime-charset 'ibm273
+  :map "IBM273")
+
+(define-charset 'ibm274
+  "Belgian version of EBCDIC"
+  :short-name "IBM274"
+  :code-space [0 255]
+  :mime-charset 'ibm274
+  :map "IBM274")
+
+(define-charset 'ibm275
+  "Brazilian version of EBCDIC"
+  :short-name "IBM275"
+  :code-space [0 255]
+  :mime-charset 'ibm275
+  :map "IBM275")
+
+(define-charset 'ibm277
+  "Danish / Norwegian version of EBCDIC"
+  :short-name "IBM277"
+  :code-space [0 255]
+  :mime-charset 'ibm277
+  :map "IBM277")
+
+(define-charset 'ibm278
+  "Finnish / Swedish version of EBCDIC"
+  :short-name "IBM278"
+  :code-space [0 255]
+  :mime-charset 'ibm278
+  :map "IBM278")
+
+(define-charset 'ibm280
+  "Italian version of EBCDIC"
+  :short-name "IBM280"
+  :code-space [0 255]
+  :mime-charset 'ibm270
+  :map "IBM280")
+
+(define-charset 'ibm281
+  "Japanese-E version of EBCDIC"
+  :short-name "IBM281"
+  :code-space [0 255]
+  :mime-charset 'ibm281
+  :map "IBM281")
+
+(define-charset 'ibm284
+  "Spanish version of EBCDIC"
+  :short-name "IBM284"
+  :code-space [0 255]
+  :mime-charset 'ibm284
+  :map "IBM284")
+
+(define-charset 'ibm285
+  "UK english version of EBCDIC"
+  :short-name "IBM285"
+  :code-space [0 255]
+  :mime-charset 'ibm285
+  :map "IBM285")
+
+(define-charset 'ibm290
+  "Japanese katakana version of EBCDIC"
+  :short-name "IBM290"
+  :code-space [0 255]
+  :mime-charset 'ibm290
+  :map "IBM290")
+
+(define-charset 'ibm297
+  "French version of EBCDIC"
+  :short-name "IBM297"
+  :code-space [0 255]
+  :mime-charset 'ibm297
+  :map "IBM297")
+
 (define-charset 'ibm1047
   ;; Says groff:
   "IBM1047, `EBCDIC Latin 1/Open Systems' used by OS/390 Unix."
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index 57e5686..d622268 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -1,6 +1,6 @@
 ;;; mule-diag.el --- show diagnosis of multilingual environment (Mule)
 
-;; Copyright (C) 1997-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index 8f31633..580bd29 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -1,6 +1,6 @@
 ;;; mule-util.el --- utility functions for multilingual environment (mule)  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 1997-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 212e723..d3a1005 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1,6 +1,6 @@
 ;;; mule.el --- basic commands for multilingual environment
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -307,12 +307,9 @@ Return t if file exists."
       (and (null noerror)
           (signal 'file-error (list "Cannot open load file" file)))
     ;; Read file with code conversion, and then eval.
-    (let* ((buffer
-            ;; We can't use `generate-new-buffer' because files.el
-            ;; is not yet loaded.
-            (get-buffer-create (generate-new-buffer-name " *load*")))
-          (load-in-progress t)
-          (source (save-match-data (string-match "\\.el\\'" fullname))))
+    (let ((buffer (generate-new-buffer " *load*"))
+          (load-in-progress t)
+          (source (string-suffix-p ".el" fullname)))
       (unless nomessage
        (if source
            (message "Loading %s (source)..." file)
diff --git a/lisp/international/ogonek.el b/lisp/international/ogonek.el
index 37fcda7..79e4468 100644
--- a/lisp/international/ogonek.el
+++ b/lisp/international/ogonek.el
@@ -1,6 +1,6 @@
 ;;; ogonek.el --- change the encoding of Polish diacritics
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Włodek Bzyl
 ;;        Ryszard Kubiak
diff --git a/lisp/international/quail.el b/lisp/international/quail.el
index 39ef6d3..f2ac44a 100644
--- a/lisp/international/quail.el
+++ b/lisp/international/quail.el
@@ -1,6 +1,6 @@
 ;;; quail.el --- provides simple input method for multilingual text
 
-;; Copyright (C) 1997-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/international/rfc1843.el b/lisp/international/rfc1843.el
index c59538f..bd83a7a 100644
--- a/lisp/international/rfc1843.el
+++ b/lisp/international/rfc1843.el
@@ -1,6 +1,6 @@
 ;;; rfc1843.el --- HZ (rfc1843) decoding  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: news HZ HZ+ mail i18n
diff --git a/lisp/international/robin.el b/lisp/international/robin.el
index 94d2bf1..16cac07 100644
--- a/lisp/international/robin.el
+++ b/lisp/international/robin.el
@@ -424,8 +424,7 @@ While this input method is active, the variable
        (add-hook 'minibuffer-exit-hook 'robin-exit-from-minibuffer))
     (run-hooks 'input-method-activate-hook
               'robin-activate-hook)
-    (set (make-local-variable 'input-method-function)
-        'robin-input-method)))
+    (setq-local input-method-function 'robin-input-method)))
 
 (define-obsolete-variable-alias
   'robin-inactivate-hook
diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index 2da8635..58c81bf 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -1,6 +1,6 @@
 ;;; titdic-cnv.el --- convert cxterm dictionary (TIT format) to Quail package 
-*- coding:iso-2022-7bit; lexical-binding:t -*-
 
-;; Copyright (C) 1997-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/international/ucs-normalize.el 
b/lisp/international/ucs-normalize.el
index 7822450..d1b5c07 100644
--- a/lisp/international/ucs-normalize.el
+++ b/lisp/international/ucs-normalize.el
@@ -1,6 +1,6 @@
 ;;; ucs-normalize.el --- Unicode normalization NFC/NFD/NFKD/NFKC
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Taichi Kawabata <kawabata.taichi@gmail.com>
 ;; Keywords: unicode, normalization
diff --git a/lisp/international/utf-7.el b/lisp/international/utf-7.el
index fe676e2..e941abb 100644
--- a/lisp/international/utf-7.el
+++ b/lisp/international/utf-7.el
@@ -1,6 +1,6 @@
 ;;; utf-7.el --- utf-7 coding system
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: i18n, mail
diff --git a/lisp/international/utf7.el b/lisp/international/utf7.el
index 6df74d0..d78e397 100644
--- a/lisp/international/utf7.el
+++ b/lisp/international/utf7.el
@@ -1,6 +1,6 @@
 ;;; utf7.el --- UTF-7 encoding/decoding for Emacs   -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Jon K Hellan <hellan@acm.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/isearch.el b/lisp/isearch.el
index a0aa250..fefdd16 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1,6 +1,6 @@
 ;;; isearch.el --- incremental search minor mode -*- lexical-binding: t -*-
 
-;; Copyright (C) 1992-1997, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1997, 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
 ;; Maintainer: emacs-devel@gnu.org
@@ -519,7 +519,7 @@ This is like `describe-bindings', but displays only Isearch 
keys."
 (defvar isearch-menu-bar-yank-map
   (let ((map (make-sparse-keymap)))
     (define-key map [isearch-yank-pop]
-      '(menu-item "Previous kill" isearch-yank-pop
+      '(menu-item "Previous kill" isearch-yank-pop-only
                   :help "Replace previous yanked kill on search string"))
     (define-key map [isearch-yank-kill]
       '(menu-item "Current kill" isearch-yank-kill
@@ -734,7 +734,7 @@ This is like `describe-bindings', but displays only Isearch 
keys."
 
     (define-key map "\M-n" 'isearch-ring-advance)
     (define-key map "\M-p" 'isearch-ring-retreat)
-    (define-key map "\M-y" 'isearch-yank-pop)
+    (define-key map "\M-y" 'isearch-yank-pop-only)
 
     (define-key map "\M-\t" 'isearch-complete)
 
@@ -965,10 +965,6 @@ Each element is an `isearch--state' struct where the slots 
are
 ;; The value of input-method-function when isearch is invoked.
 (defvar isearch-input-method-function nil)
 
-;; A flag to tell if input-method-function is locally bound when
-;; isearch is invoked.
-(defvar isearch-input-method-local-p nil)
-
 (defvar isearch--saved-overriding-local-map nil)
 
 ;; Minor-mode-alist changes - kind of redundant with the
@@ -1023,7 +1019,7 @@ Type \\[isearch-yank-until-char] to yank from point until 
the next instance of a
 Type \\[isearch-yank-line] to yank rest of line onto end of search string\
  and search for it.
 Type \\[isearch-yank-kill] to yank the last string of killed text.
-Type \\[isearch-yank-pop] to replace string just yanked into search prompt
+Type \\[isearch-yank-pop-only] to replace string just yanked into search prompt
  with string killed before it.
 Type \\[isearch-quote-char] to quote control character to search for it.
 Type \\[isearch-char-by-name] to add a character to search by Unicode name,\
@@ -1238,7 +1234,6 @@ used to set the value of `isearch-regexp-function'."
        search-ring-yank-pointer nil
        isearch-opened-overlays nil
        isearch-input-method-function input-method-function
-       isearch-input-method-local-p (local-variable-p 'input-method-function)
        regexp-search-ring-yank-pointer nil
 
        isearch-pre-scroll-point nil
@@ -1259,9 +1254,7 @@ used to set the value of `isearch-regexp-function'."
   ;; We must bypass input method while reading key.  When a user type
   ;; printable character, appropriate input method is turned on in
   ;; minibuffer to read multibyte characters.
-  (or isearch-input-method-local-p
-      (make-local-variable 'input-method-function))
-  (setq input-method-function nil)
+  (setq-local input-method-function nil)
 
   (looking-at "")
   (setq isearch-window-configuration
@@ -1418,8 +1411,8 @@ NOPUSH is t and EDIT is t."
        (set-window-group-start (selected-window) found-start t))))
 
   (setq isearch-mode nil)
-  (if isearch-input-method-local-p
-      (setq input-method-function isearch-input-method-function)
+  (if isearch-input-method-function
+      (setq-local input-method-function isearch-input-method-function)
     (kill-local-variable 'input-method-function))
 
   (if isearch-tool-bar-old-map
@@ -1610,7 +1603,8 @@ If this is set inside code wrapped by the macro
   "Exit Isearch mode, run BODY, and reinvoke the pending search.
 You can update the global isearch variables by setting new values to
 `isearch-new-string', `isearch-new-message', `isearch-new-forward',
-`isearch-new-regexp-function', `isearch-new-case-fold', 
`isearch-new-nonincremental'."
+`isearch-new-regexp-function', `isearch-new-case-fold',
+`isearch-new-nonincremental'."
   ;; This code is very hairy for several reasons, explained in the code.
   ;; Mainly, isearch-mode must be terminated while editing and then restarted.
   ;; If there were a way to catch any change of buffer from the minibuffer,
@@ -2497,9 +2491,13 @@ If search string is empty, just beep."
   (isearch-yank-string (current-kill 0)))
 
 (defun isearch-yank-pop ()
-  "Replace just-yanked search string with previously killed string."
+  "Replace just-yanked search string with previously killed string.
+Unlike `isearch-yank-pop-only', when this command is called not immediately
+after a `isearch-yank-kill' or a `isearch-yank-pop', it activates the
+minibuffer to read a string from the `kill-ring' as `yank-pop' does."
   (interactive)
-  (if (not (memq last-command '(isearch-yank-kill isearch-yank-pop)))
+  (if (not (memq last-command '(isearch-yank-kill
+                                isearch-yank-pop isearch-yank-pop-only)))
       ;; Yank string from kill-ring-browser.
       (with-isearch-suspended
        (let ((string (read-from-kill-ring)))
@@ -2515,6 +2513,23 @@ If search string is empty, just beep."
     (isearch-pop-state)
     (isearch-yank-string (current-kill 1))))
 
+(defun isearch-yank-pop-only ()
+  "Replace just-yanked search string with previously killed string.
+Unlike `isearch-yank-pop', when this command is called not immediately
+after a `isearch-yank-kill' or a `isearch-yank-pop-only', it only pops
+the last killed string instead of activating the minibuffer to read
+a string from the `kill-ring' as `yank-pop' does."
+  (interactive)
+  (if (not (memq last-command '(isearch-yank-kill
+                                isearch-yank-pop isearch-yank-pop-only)))
+      ;; Fall back on `isearch-yank-kill' for the benefits of people
+      ;; who are used to the old behavior of `M-y' in isearch mode.
+      ;; In future, `M-y' could be changed from `isearch-yank-pop-only'
+      ;; to `isearch-yank-pop' that uses the kill-ring-browser.
+      (isearch-yank-kill)
+    (isearch-pop-state)
+    (isearch-yank-string (current-kill 1))))
+
 (defun isearch-yank-x-selection ()
   "Pull current X selection into search string."
   (interactive)
diff --git a/lisp/isearchb.el b/lisp/isearchb.el
index f75a4b4..3713879 100644
--- a/lisp/isearchb.el
+++ b/lisp/isearchb.el
@@ -1,6 +1,6 @@
 ;;; isearchb --- a marriage between iswitchb and isearch
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 8b3384a..d169e40 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -1,6 +1,6 @@
 ;;; jit-lock.el --- just-in-time fontification  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Gerd Moellmann <gerd@gnu.org>
 ;; Keywords: faces files
diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el
index 79d81a2..3c7d2a0 100644
--- a/lisp/jka-cmpr-hook.el
+++ b/lisp/jka-cmpr-hook.el
@@ -1,6 +1,6 @@
 ;;; jka-cmpr-hook.el --- preloaded code to enable jka-compr.el
 
-;; Copyright (C) 1993-1995, 1997, 1999-2000, 2002-2020 Free Software
+;; Copyright (C) 1993-1995, 1997, 1999-2000, 2002-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Jay K. Adams <jka@ece.cmu.edu>
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index e1a3058..877f2eb 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -1,6 +1,6 @@
 ;;; jka-compr.el --- reading/writing/loading compressed files
 
-;; Copyright (C) 1993-1995, 1997, 1999-2020 Free Software Foundation,
+;; Copyright (C) 1993-1995, 1997, 1999-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Jay K. Adams <jka@ece.cmu.edu>
diff --git a/lisp/json.el b/lisp/json.el
index c2fc157..f5659d8 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -1,6 +1,6 @@
 ;;; json.el --- JavaScript Object Notation parser / generator -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Theresa O'Connor <ted@oconnor.cx>
 ;; Version: 1.5
@@ -435,7 +435,7 @@ Initialized lazily by `json-encode-string'.")
       (concat "\"" (substring-no-properties string) "\"")
     (with-current-buffer
         (or json--string-buffer
-            (with-current-buffer (generate-new-buffer " *json-string*")
+            (with-current-buffer (generate-new-buffer " *json-string*" t)
               ;; This seems to afford decent performance gains.
               (setq-local inhibit-modification-hooks t)
               (setq json--string-buffer (current-buffer))))
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index 1aebeae..7f5aa82 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -1,6 +1,6 @@
 ;;; jsonrpc.el --- JSON-RPC library                  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: João Távora <joaotavora@gmail.com>
 ;; Keywords: processes, languages, extensions
diff --git a/lisp/kermit.el b/lisp/kermit.el
index f2607bf..fdab7e5 100644
--- a/lisp/kermit.el
+++ b/lisp/kermit.el
@@ -1,6 +1,6 @@
 ;;; kermit.el --- additions to shell mode for use with kermit -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1988, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Jeff Norden <jeff@colgate.csnet>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 3437dba..bb8dacf 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -1,6 +1,6 @@
 ;;; kmacro.el --- enhanced keyboard macros -*- lexical-binding: t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Kim F. Storm <storm@cua.dk>
 ;; Keywords: keyboard convenience
@@ -289,7 +289,8 @@ the last increment."
 
 (defun kmacro-set-counter (arg)
   "Set the value of `kmacro-counter' to ARG, or prompt for value if no 
argument.
-With \\[universal-argument] prefix, reset counter to its value prior to this 
iteration of the macro."
+With \\[universal-argument] prefix, reset counter to its value prior to this 
iteration of the
+macro."
   (interactive "NMacro counter value: ")
   (if (not (or defining-kbd-macro executing-kbd-macro))
       (kmacro-display-counter (setq kmacro-initial-counter-value arg))
@@ -1272,7 +1273,8 @@ following additional answers: `insert', `insert-1', 
`replace', `replace-1',
 (defun kmacro-step-edit-macro ()
   "Step edit and execute last keyboard macro.
 
-To customize possible responses, change the \"bindings\" in 
`kmacro-step-edit-map'."
+To customize possible responses, change the \"bindings\" in
+`kmacro-step-edit-map'."
   (interactive)
   (let ((kmacro-step-edit-active t)
        (kmacro-step-edit-new-macro "")
diff --git a/lisp/language/china-util.el b/lisp/language/china-util.el
index 04d4032..4bc2eaa 100644
--- a/lisp/language/china-util.el
+++ b/lisp/language/china-util.el
@@ -1,6 +1,6 @@
 ;;; china-util.el --- utilities for Chinese  -*- coding: utf-8 -*-
 
-;; Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/chinese.el b/lisp/language/chinese.el
index 4389db9..6b434fe 100644
--- a/lisp/language/chinese.el
+++ b/lisp/language/chinese.el
@@ -1,6 +1,6 @@
 ;;; chinese.el --- support for Chinese -*- coding: utf-8; -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/cyril-util.el b/lisp/language/cyril-util.el
index ce60d1a..72ceffd 100644
--- a/lisp/language/cyril-util.el
+++ b/lisp/language/cyril-util.el
@@ -1,6 +1,6 @@
 ;;; cyril-util.el --- utilities for Cyrillic scripts
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Keywords: mule, multilingual, Cyrillic
 
diff --git a/lisp/language/cyrillic.el b/lisp/language/cyrillic.el
index c196370..c491644 100644
--- a/lisp/language/cyrillic.el
+++ b/lisp/language/cyrillic.el
@@ -1,6 +1,6 @@
 ;;; cyrillic.el --- support for Cyrillic -*- coding: utf-8; -*-
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/czech.el b/lisp/language/czech.el
index e692342..e449a7e 100644
--- a/lisp/language/czech.el
+++ b/lisp/language/czech.el
@@ -1,6 +1,6 @@
 ;;; czech.el --- support for Czech -*- coding: utf-8; lexical-binding: t -*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Milan Zamazal <pdm@zamazal.org>
 ;; Maintainer: Pavel Janík <Pavel@Janik.cz>
diff --git a/lisp/language/english.el b/lisp/language/english.el
index b7af84c..dfbec85 100644
--- a/lisp/language/english.el
+++ b/lisp/language/english.el
@@ -1,6 +1,6 @@
 ;;; english.el --- support for English
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/ethio-util.el b/lisp/language/ethio-util.el
index 55e59ab..174b9ec 100644
--- a/lisp/language/ethio-util.el
+++ b/lisp/language/ethio-util.el
@@ -1,6 +1,6 @@
 ;;; ethio-util.el --- utilities for Ethiopic   -*- coding: utf-8-emacs; -*-
 
-;; Copyright (C) 1997-1998, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2002-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -113,17 +113,21 @@ vertically stacked dots.  All SERA <--> FIDEL converters 
refer this
 variable.")
 
 (defvar ethio-use-three-dot-question nil
-  "Non-nil means associate ASCII question mark with Ethiopic old style 
question mark (three vertically stacked dots).
+  "If non-nil, associate ASCII question mark with Ethiopic question mark.
+The Ethiopic old style question mark is three vertically stacked dots.
 If nil, associate ASCII question mark with Ethiopic stylized question
 mark.  All SERA <--> FIDEL converters refer this variable.")
 
 (defvar ethio-quote-vowel-always nil
-  "Non-nil means always put an apostrophe before an isolated vowel (except at 
word initial) in FIDEL --> SERA conversion.
+  "Non-nil means always put an apostrophe before an isolated vowel.
+This happens in FIDEL --> SERA conversions.  Isolated vowels at
+word beginning do not get an apostrophe put before them.
 If nil, put an apostrophe only between a 6th-form consonant and an
 isolated vowel.")
 
 (defvar ethio-W-sixth-always nil
-  "Non-nil means convert the Wu-form of a 12-form consonant to \"W'\" instead 
of \"Wu\" in FIDEL --> SERA conversion.")
+  "Non-nil means convert the Wu-form of a 12-form consonant to \"W'\".
+This is instead of \"Wu\" in FIDEL --> SERA conversion.")
 
 (defvar ethio-numeric-reduction 0
   "Degree of reduction in converting Ethiopic digits into Arabic digits.
diff --git a/lisp/language/ethiopic.el b/lisp/language/ethiopic.el
index 1f8b9b1..1e409e3 100644
--- a/lisp/language/ethiopic.el
+++ b/lisp/language/ethiopic.el
@@ -1,6 +1,6 @@
 ;;; ethiopic.el --- support for Ethiopic       -*- coding: utf-8-emacs; -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/european.el b/lisp/language/european.el
index 713a0fd..1f27ff0 100644
--- a/lisp/language/european.el
+++ b/lisp/language/european.el
@@ -1,6 +1,6 @@
 ;;; european.el --- support for European languages -*- coding: utf-8; -*-
 
-;; Copyright (C) 1997-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -324,6 +324,87 @@ Latin-9 is sometimes nicknamed `Latin-0'."))
   :mime-charset 'windows-1257)
 (define-coding-system-alias 'cp1257 'windows-1257)
 
+(define-coding-system 'ibm256
+  "Netherlands version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm256)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-int1 'ibm256)
+(define-coding-system-alias 'cp256 'ibm256)
+
+(define-coding-system 'ibm273
+  "Austrian / German version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm273)
+  :mnemonic ?*)
+(define-coding-system-alias 'cp273 'ibm273)
+
+(define-coding-system 'ibm274
+  "Belgian version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm274)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-be 'ibm274)
+(define-coding-system-alias 'cp274 'ibm274)
+
+(define-coding-system 'ibm275
+  "Brazilian version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm275)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-br 'ibm275)
+(define-coding-system-alias 'cp275 'ibm275)
+
+(define-coding-system 'ibm277
+  "Danish / Norwegian version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm277)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-dk 'ibm277)
+(define-coding-system-alias 'ebcdic-cp-no 'ibm277)
+(define-coding-system-alias 'cp277 'ibm277)
+
+(define-coding-system 'ibm278
+  "Finnish / Swedish version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm278)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-fi 'ibm278)
+(define-coding-system-alias 'ebcdic-cp-se 'ibm278)
+(define-coding-system-alias 'cp278 'ibm278)
+
+(define-coding-system 'ibm280
+  "Italian version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm280)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-it 'ibm280)
+(define-coding-system-alias 'cp280 'ibm280)
+
+(define-coding-system 'ibm284
+  "Spanish version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm284)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-es 'ibm284)
+(define-coding-system-alias 'cp284 'ibm284)
+
+(define-coding-system 'ibm285
+  "UK english version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm285)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-gb 'ibm285)
+(define-coding-system-alias 'cp285 'ibm285)
+
+(define-coding-system 'ibm297
+  "French version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm297)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-fr 'ibm297)
+(define-coding-system-alias 'cp297 'ibm297)
+
 (define-coding-system 'cp775
   "DOS codepage 775 (PC Baltic, MS-DOS Baltic Rim)"
   :coding-type 'charset
diff --git a/lisp/language/georgian.el b/lisp/language/georgian.el
index 53c994bd..321ef43 100644
--- a/lisp/language/georgian.el
+++ b/lisp/language/georgian.el
@@ -1,6 +1,6 @@
 ;;; georgian.el --- language support for Georgian  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: i18n
diff --git a/lisp/language/greek.el b/lisp/language/greek.el
index 15ae5f4..403a87d 100644
--- a/lisp/language/greek.el
+++ b/lisp/language/greek.el
@@ -1,6 +1,6 @@
 ;;; greek.el --- support for Greek  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2002, 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2013-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/hanja-util.el b/lisp/language/hanja-util.el
index f38dead..313fc63 100644
--- a/lisp/language/hanja-util.el
+++ b/lisp/language/hanja-util.el
@@ -1,6 +1,6 @@
 ;;; hanja-util.el --- Korean Hanja util module  -*- coding: utf-8 -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Jihyun Cho <jihyun.jo@gmail.com>
 ;; Keywords: multilingual, input method, Korean, Hanja
diff --git a/lisp/language/hebrew.el b/lisp/language/hebrew.el
index 08b70ab..9f9a14a 100644
--- a/lisp/language/hebrew.el
+++ b/lisp/language/hebrew.el
@@ -1,6 +1,6 @@
 ;;; hebrew.el --- support for Hebrew -*- coding: utf-8 -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/ind-util.el b/lisp/language/ind-util.el
index 6288522..4bd1cd7 100644
--- a/lisp/language/ind-util.el
+++ b/lisp/language/ind-util.el
@@ -1,6 +1,6 @@
 ;;; ind-util.el --- Transliteration and Misc. Tools for Indian Languages -*- 
coding: utf-8-emacs; -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Keywords: multilingual, Indian, Devanagari
 
diff --git a/lisp/language/indian.el b/lisp/language/indian.el
index 657ad69..b92fda5 100644
--- a/lisp/language/indian.el
+++ b/lisp/language/indian.el
@@ -1,6 +1,6 @@
 ;;; indian.el --- Indian languages support -*- coding: utf-8; -*-
 
-;; Copyright (C) 1997, 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
diff --git a/lisp/language/japan-util.el b/lisp/language/japan-util.el
index 56052b1..9dce17c 100644
--- a/lisp/language/japan-util.el
+++ b/lisp/language/japan-util.el
@@ -1,6 +1,6 @@
 ;;; japan-util.el --- utilities for Japanese
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el
index 9a99245..8c724ee 100644
--- a/lisp/language/japanese.el
+++ b/lisp/language/japanese.el
@@ -1,6 +1,6 @@
 ;;; japanese.el --- support for Japanese
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -188,6 +188,22 @@ eucJP-ms is defined in 
<http://www.opengroup.or.jp/jvc/cde/appendix.html>."
 
 (define-coding-system-alias 'shift_jis-2004 'japanese-shift-jis-2004)
 
+(define-coding-system 'ibm281
+  "Japanese-E version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm281)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-jp-e 'ibm281)
+(define-coding-system-alias 'cp281 'ibm281)
+
+(define-coding-system 'ibm290
+  "Japanese katakana version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm290)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-jp-kana 'ibm290)
+(define-coding-system-alias 'cp290 'ibm290)
+
 (set-language-info-alist
  "Japanese" '((setup-function . setup-japanese-environment-internal)
              (exit-function . use-default-char-width-table)
diff --git a/lisp/language/korea-util.el b/lisp/language/korea-util.el
index 3821785..eb7b85b 100644
--- a/lisp/language/korea-util.el
+++ b/lisp/language/korea-util.el
@@ -1,6 +1,6 @@
 ;;; korea-util.el --- utilities for Korean
 
-;; Copyright (C) 1997, 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
 ;;   2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -70,27 +70,24 @@
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (toggle-korean-input-method))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 (defun isearch-hangul-switch-symbol-ksc ()
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (quail-hangul-switch-symbol-ksc))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 (defun isearch-hangul-switch-hanja ()
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (quail-hangul-switch-hanja))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 ;; Information for setting and exiting Korean environment.
diff --git a/lisp/language/korean.el b/lisp/language/korean.el
index 7e75815..997b8ae 100644
--- a/lisp/language/korean.el
+++ b/lisp/language/korean.el
@@ -1,6 +1,6 @@
 ;;; korean.el --- support for Korean -*- coding: utf-8 -*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -42,6 +42,7 @@
 
 (define-coding-system-alias 'euc-kr 'korean-iso-8bit)
 (define-coding-system-alias 'euc-korea 'korean-iso-8bit)
+(define-coding-system-alias 'ks_c_5601-1987 'korean-iso-8bit)
 
 (define-coding-system 'iso-2022-kr
   "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)."
diff --git a/lisp/language/lao-util.el b/lisp/language/lao-util.el
index fa4c2f7..59c9850 100644
--- a/lisp/language/lao-util.el
+++ b/lisp/language/lao-util.el
@@ -1,6 +1,6 @@
 ;;; lao-util.el --- utilities for Lao -*- coding: utf-8; -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
 ;;   2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/lao.el b/lisp/language/lao.el
index ad96fe3..44fe8d2 100644
--- a/lisp/language/lao.el
+++ b/lisp/language/lao.el
@@ -1,6 +1,6 @@
 ;;; lao.el --- support for Lao -*- coding: utf-8 -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
 ;;   2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/romanian.el b/lisp/language/romanian.el
index 9f1c677..2112df7 100644
--- a/lisp/language/romanian.el
+++ b/lisp/language/romanian.el
@@ -1,6 +1,6 @@
 ;;; romanian.el --- support for Romanian -*- coding: utf-8; lexical-binding: t 
-*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dan Nicolaescu <done@ece.arizona.edu>
 ;; Keywords: multilingual, Romanian, i18n
diff --git a/lisp/language/slovak.el b/lisp/language/slovak.el
index c42a872..2a73846 100644
--- a/lisp/language/slovak.el
+++ b/lisp/language/slovak.el
@@ -1,6 +1,6 @@
 ;;; slovak.el --- support for Slovak -*- coding: utf-8; lexical-binding: t -*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Authors:    Tibor Šimko <tibor.simko@fmph.uniba.sk>,
 ;;             Milan Zamazal <pdm@zamazal.org>
diff --git a/lisp/language/tai-viet.el b/lisp/language/tai-viet.el
index 039e478..17abf13 100644
--- a/lisp/language/tai-viet.el
+++ b/lisp/language/tai-viet.el
@@ -1,6 +1,6 @@
 ;;; tai-viet.el --- support for Tai Viet -*- coding: utf-8; lexical-binding: t 
-*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H13PRO009
diff --git a/lisp/language/thai-util.el b/lisp/language/thai-util.el
index b856e67..f9c57e8 100644
--- a/lisp/language/thai-util.el
+++ b/lisp/language/thai-util.el
@@ -1,6 +1,6 @@
 ;;; thai-util.el --- utilities for Thai -*- coding: utf-8; -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/thai.el b/lisp/language/thai.el
index 800657b..44a9a31 100644
--- a/lisp/language/thai.el
+++ b/lisp/language/thai.el
@@ -1,6 +1,6 @@
 ;;; thai.el --- support for Thai -*- coding: utf-8 -*-
 
-;; Copyright (C) 1997-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/tibet-util.el b/lisp/language/tibet-util.el
index 04369f6..e741af1 100644
--- a/lisp/language/tibet-util.el
+++ b/lisp/language/tibet-util.el
@@ -1,6 +1,6 @@
 ;;; tibet-util.el --- utilities for Tibetan   -*- coding: utf-8-emacs; -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/tibetan.el b/lisp/language/tibetan.el
index bbd4729..5b8e29c 100644
--- a/lisp/language/tibetan.el
+++ b/lisp/language/tibetan.el
@@ -1,6 +1,6 @@
 ;;; tibetan.el --- support for Tibetan language -*- coding: utf-8-emacs; -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/utf-8-lang.el b/lisp/language/utf-8-lang.el
index 9e59f61..f23b388 100644
--- a/lisp/language/utf-8-lang.el
+++ b/lisp/language/utf-8-lang.el
@@ -1,6 +1,6 @@
 ;;; utf-8-lang.el --- generic UTF-8 language environment  -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: i18n
diff --git a/lisp/language/viet-util.el b/lisp/language/viet-util.el
index bd9aa59..177b04b 100644
--- a/lisp/language/viet-util.el
+++ b/lisp/language/viet-util.el
@@ -1,6 +1,6 @@
 ;;; viet-util.el --- utilities for Vietnamese  -*- coding: utf-8; -*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/language/vietnamese.el b/lisp/language/vietnamese.el
index c1cef96..7980041 100644
--- a/lisp/language/vietnamese.el
+++ b/lisp/language/vietnamese.el
@@ -1,6 +1,6 @@
 ;;; vietnamese.el --- support for Vietnamese -*- coding: utf-8; 
lexical-binding: t -*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index ed1b2c7..c6fa497 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -1,4 +1,4 @@
-;;; loaddefs.el --- automatically extracted autoloads
+;;; loaddefs.el --- automatically extracted autoloads  -*- lexical-binding: t 
-*-
 ;;
 ;;; Code:
 
@@ -1202,14 +1202,16 @@ The variables are:
 Variables you assign:
      array-max-row:          The number of rows in the array.
      array-max-column:       The number of columns in the array.
-     array-columns-per-line: The number of columns in the array per line of 
buffer.
+     array-columns-per-line: The number of columns in the array
+                             per line of buffer.
      array-field-width:      The width of each field, in characters.
      array-rows-numbered:    A logical variable describing whether to ignore
-                       row numbers in the buffer.
+                             row numbers in the buffer.
 
 Variables which are calculated:
      array-line-length:      The number of characters in a buffer line.
-     array-lines-per-row:    The number of buffer lines used to display each 
row.
+     array-lines-per-row:    The number of buffer lines used to
+                             display each row.
 
   The following commands are available (an asterisk indicates it may
 take a numeric prefix argument):
@@ -1219,17 +1221,17 @@ take a numeric prefix argument):
     *          \\[array-next-row]        Move down one row.
     *          \\[array-previous-row]    Move up one row.
 
-    *   \\[array-copy-forward]   Copy the current field into the column to the 
right.
-    *   \\[array-copy-backward]          Copy the current field into the 
column to the left.
-    *   \\[array-copy-down]      Copy the current field into the row below.
-    *   \\[array-copy-up]        Copy the current field into the row above.
+    *   \\[array-copy-forward]   Copy current field into the column to the 
right.
+    *   \\[array-copy-backward]          Copy current field into the column to 
the left.
+    *   \\[array-copy-down]      Copy current field into the row below.
+    *   \\[array-copy-up]        Copy current field into the row above.
 
-    *   \\[array-copy-column-forward]   Copy the current column into the 
column to the right.
-    *   \\[array-copy-column-backward]   Copy the current column into the 
column to the left.
+    *   \\[array-copy-column-forward]   Copy current column into the column to 
the right.
+    *   \\[array-copy-column-backward]   Copy current column into the column 
to the left.
     *   \\[array-copy-row-down]   Copy the current row into the row below.
     *   \\[array-copy-row-up]   Copy the current row into the row above.
 
-        \\[array-fill-rectangle]   Copy the field at mark into every cell with 
row and column
+        \\[array-fill-rectangle]   Copy field at mark into every cell with row 
and column
                   between that of point and mark.
 
        \\[array-what-position]   Display the current array row and column.
@@ -1240,7 +1242,7 @@ take a numeric prefix argument):
         \\[array-expand-rows]   Expand the array (remove row numbers and
                   newlines inside rows)
 
-        \\[array-display-local-variables]   Display the current values of 
local variables.
+        \\[array-display-local-variables]   Display current values of local 
variables.
 
 Entering array mode calls the function `array-mode-hook'.
 
@@ -1510,8 +1512,9 @@ let-binding.")
 (autoload 'authinfo-mode "auth-source" "\
 Mode for editing .authinfo/.netrc files.
 
-This is just like `fundamental-mode', but hides passwords.  The
-passwords are revealed when point moved into the password.
+This is just like `fundamental-mode', but has basic syntax
+highlighting and hides passwords.  Passwords are revealed when
+point is moved into the passwords (see `authinfo-hide-elements').
 
 \\{authinfo-mode-map}
 
@@ -4877,8 +4880,18 @@ DEFAULT-BODY, if present, is used as the body of a 
default method.
 
 (autoload 'cl-defmethod "cl-generic" "\
 Define a new method for generic function NAME.
-I.e. it defines the implementation of NAME to use for invocations where the
-values of the dispatch arguments match the specified TYPEs.
+This it defines an implementation of NAME to use for invocations
+of specific types of arguments.
+
+ARGS is a list of dispatch arguments (see `cl-defun'), but where
+each variable element is either just a single variable name VAR,
+or a list on the form (VAR TYPE).
+
+For instance:
+
+  (cl-defmethod foo (bar (format-string string) &optional zot)
+    (format format-string bar))
+
 The dispatch arguments have to be among the mandatory arguments, and
 all methods of NAME have to use the same set of arguments for dispatch.
 Each dispatch argument and TYPE are specified in ARGS where the corresponding
@@ -5399,7 +5412,7 @@ You might also use mode hooks to specify it in certain 
modes, like this:
        (lambda ()
         (unless (or (file-exists-p \"makefile\")
                     (file-exists-p \"Makefile\"))
-          (set (make-local-variable \\='compile-command)
+           (setq-local compile-command
                (concat \"make -k \"
                        (if buffer-file-name
                          (shell-quote-argument
@@ -6643,14 +6656,13 @@ or call the function `global-cwarn-mode'.")
 (autoload 'global-cwarn-mode "cwarn" "\
 Toggle Cwarn mode in all buffers.
 With prefix ARG, enable Global Cwarn mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
+otherwise, disable it.  If called from Lisp, enable the mode if ARG is
+omitted or nil.
 
 Cwarn mode is enabled in all buffers where
 `turn-on-cwarn-mode-if-enabled' would do it.
 
-See `cwarn-mode' for more information on
-Cwarn mode.
+See `cwarn-mode' for more information on Cwarn mode.
 
 \(fn &optional ARG)" t nil)
 
@@ -7538,6 +7550,90 @@ Major mode for editing the diary file.
 
 ;;;***
 
+;;;### (autoloads nil "dictionary" "net/dictionary.el" (0 0 0 0))
+;;; Generated autoloads from net/dictionary.el
+
+(autoload 'dictionary-mode "dictionary" "\
+Mode for searching a dictionary.
+This is a mode for searching a dictionary server implementing the
+protocol defined in RFC 2229.
+
+This is a quick reference to this mode describing the default key bindings:
+
+* q close the dictionary buffer
+* h display this help information
+* s ask for a new word to search
+* d search the word at point
+* n or Tab place point to the next link
+* p or S-Tab place point to the prev link
+
+* m ask for a pattern and list all matching words.
+* D select the default dictionary
+* M select the default search strategy
+
+* Return or Button2 visit that link
+" nil nil)
+
+(autoload 'dictionary "dictionary" "\
+Create a new dictonary buffer and install dictionary-mode." t nil)
+
+(autoload 'dictionary-search "dictionary" "\
+Search the WORD in DICTIONARY if given or in all if nil.
+It presents the selection or word at point as default input and
+allows editing it.
+
+\(fn WORD &optional DICTIONARY)" t nil)
+
+(autoload 'dictionary-lookup-definition "dictionary" "\
+Unconditionally lookup the word at point." t nil)
+
+(autoload 'dictionary-match-words "dictionary" "\
+Search PATTERN in current default dictionary using default strategy.
+
+\(fn &optional PATTERN &rest IGNORED)" t nil)
+
+(autoload 'dictionary-mouse-popup-matching-words "dictionary" "\
+Display entries matching the word at the cursor retrieved using EVENT.
+
+\(fn EVENT)" t nil)
+
+(autoload 'dictionary-popup-matching-words "dictionary" "\
+Display entries matching WORD or the current word if not given.
+
+\(fn &optional WORD)" t nil)
+
+(autoload 'dictionary-tooltip-mode "dictionary" "\
+Display tooltips for the current word.
+
+This function can be used to enable or disable the tooltip mode
+for the current buffer (based on ARG). If global-tooltip-mode is
+active it will overwrite that mode for the current buffer.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'global-dictionary-tooltip-mode "dictionary" "\
+Enable/disable dictionary-tooltip-mode for all buffers.
+
+Internally it provides a default for the dictionary-tooltip-mode.
+It can be overwritten for each buffer using dictionary-tooltip-mode.
+
+Note: (global-dictionary-tooltip-mode 0) will not disable the mode
+any buffer where (dictionary-tooltip-mode 1) has been called.
+
+\(fn &optional ARG)" t nil)
+
+(register-definition-prefixes "dictionary" '("dictionary-" 
"global-dictionary-tooltip-mode"))
+
+;;;***
+
+;;;### (autoloads nil "dictionary-connection" "net/dictionary-connection.el"
+;;;;;;  (0 0 0 0))
+;;; Generated autoloads from net/dictionary-connection.el
+
+(register-definition-prefixes "dictionary-connection" 
'("dictionary-connection-"))
+
+;;;***
+
 ;;;### (autoloads nil "diff" "vc/diff.el" (0 0 0 0))
 ;;; Generated autoloads from vc/diff.el
 
@@ -8039,9 +8135,9 @@ or call the function 
`global-display-fill-column-indicator-mode'.")
 
 (autoload 'global-display-fill-column-indicator-mode 
"display-fill-column-indicator" "\
 Toggle Display-Fill-Column-Indicator mode in all buffers.
-With prefix ARG, enable Global Display-Fill-Column-Indicator mode if ARG is 
positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
+With prefix ARG, enable Global Display-Fill-Column-Indicator mode if
+ARG is positive; otherwise, disable it.  If called from Lisp, enable
+the mode if ARG is omitted or nil.
 
 Display-Fill-Column-Indicator mode is enabled in all buffers where
 `display-fill-column-indicator--turn-on' would do it.
@@ -8049,8 +8145,8 @@ Display-Fill-Column-Indicator mode is enabled in all 
buffers where
 See `display-fill-column-indicator-mode' for more information on
 Display-Fill-Column-Indicator mode.
 
-`global-display-fill-column-indicator-modes' is used to control which modes
-this minor mode is used in.
+`global-display-fill-column-indicator-modes' is used to control
+which modes this minor mode is used in.
 
 \(fn &optional ARG)" t nil)
 
@@ -8113,9 +8209,9 @@ or call the function `global-display-line-numbers-mode'.")
 
 (autoload 'global-display-line-numbers-mode "display-line-numbers" "\
 Toggle Display-Line-Numbers mode in all buffers.
-With prefix ARG, enable Global Display-Line-Numbers mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
+With prefix ARG, enable Global Display-Line-Numbers mode if ARG is
+positive; otherwise, disable it.  If called from Lisp, enable the mode
+if ARG is omitted or nil.
 
 Display-Line-Numbers mode is enabled in all buffers where
 `display-line-numbers--turn-on' would do it.
@@ -8319,6 +8415,9 @@ strings when pressed twice.  See `double-map' for details.
 (autoload 'dunnet "dunnet" "\
 Switch to *dungeon* buffer and start game." t nil)
 
+(autoload 'dun-batch "dunnet" "\
+Start `dunnet' in batch mode." nil nil)
+
 (register-definition-prefixes "dunnet" '("dun" "obj-special"))
 
 ;;;***
@@ -11204,8 +11303,8 @@ Search through all files listed in tags table for match 
for REGEXP.
 Stops when a match is found.
 To continue searching for next match, use command \\[tags-loop-continue].
 
-If FILES if non-nil should be a list or an iterator returning the files to 
search.
-The search will be restricted to these files.
+If FILES if non-nil should be a list or an iterator returning the
+files to search.  The search will be restricted to these files.
 
 Also see the documentation of the `tags-file-name' variable.
 
@@ -11887,13 +11986,13 @@ Set the base remapping of FACE in the current buffer 
to SPECS.
 This causes the remappings specified by `face-remap-add-relative'
 to apply on top of the face specification given by SPECS.
 
-The remaining arguments, SPECS, should form a list of faces.
-Each list element should be either a face name or a property list
+The remaining arguments, SPECS, specify the base of the remapping.
+Each one of SPECS should be either a face name or a property list
 of face attribute/value pairs, like in a `face' text property.
 
-If SPECS is empty, call `face-remap-reset-base' to use the normal
-definition of FACE as the base remapping; note that this is
-different from SPECS containing a single value nil, which means
+If SPECS is empty or a single face `eq' to FACE, call `face-remap-reset-base'
+to use the normal definition of FACE as the base remapping; note that
+this is different from SPECS containing a single value nil, which means
 not to inherit from the global definition of FACE at all.
 
 \(fn FACE &rest SPECS)" nil nil)
@@ -12101,10 +12200,10 @@ internally by feedmail):
    after-run            (the queue has just been run, possibly sending 
messages)
 
 WHAT-EVENT is used as a key into the table `feedmail-queue-reminder-alist'.  If
-the associated value is a function, it is called without arguments and is 
expected
-to perform the reminder activity.  You can supply your own reminder functions
-by redefining `feedmail-queue-reminder-alist'.  If you don't want any 
reminders,
-you can set `feedmail-queue-reminder-alist' to nil.
+the associated value is a function, it is called without arguments and is
+expected to perform the reminder activity.  You can supply your own reminder
+functions by redefining `feedmail-queue-reminder-alist'.  If you don't want any
+reminders, you can set `feedmail-queue-reminder-alist' to nil.
 
 \(fn &optional WHAT-EVENT)" t nil)
 
@@ -12883,7 +12982,7 @@ diagnostics at BEG.
 (autoload 'flymake-diag-region "flymake" "\
 Compute BUFFER's region (BEG . END) corresponding to LINE and COL.
 If COL is nil, return a region just for LINE.  Return nil if the
-region is invalid.
+region is invalid.  This function saves match data.
 
 \(fn BUFFER LINE &optional COL)" nil nil)
 
@@ -13261,7 +13360,10 @@ the symbol `delete', remove those %-specs from the 
result;
 otherwise do the same as for the symbol `ignore', but also leave
 any occurrences of \"%%\" in FORMAT verbatim in the result.
 
-\(fn FORMAT SPECIFICATION &optional IGNORE-MISSING)" nil nil)
+If SPLIT, instead of returning a single string, a list of strings
+is returned, where each format spec is its own element.
+
+\(fn FORMAT SPECIFICATION &optional IGNORE-MISSING SPLIT)" nil nil)
 
 (register-definition-prefixes "format-spec" '("format-spec-"))
 
@@ -14950,14 +15052,13 @@ or call the function `global-goto-address-mode'.")
 (autoload 'global-goto-address-mode "goto-addr" "\
 Toggle Goto-Address mode in all buffers.
 With prefix ARG, enable Global Goto-Address mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
+otherwise, disable it.  If called from Lisp, enable the mode if ARG
+is omitted or nil.
 
 Goto-Address mode is enabled in all buffers where
 `goto-addr-mode--turn-on' would do it.
 
-See `goto-address-mode' for more information on
-Goto-Address mode.
+See `goto-address-mode' for more information on Goto-Address mode.
 
 \(fn &optional ARG)" t nil)
 
@@ -15041,7 +15142,7 @@ List of hook functions run by `grep-process-setup' (see 
`run-hooks').")
 
 (custom-autoload 'grep-setup-hook "grep" t)
 
-(defconst grep-regexp-alist `((,(concat "^\\(?:" 
"\\(?1:[^\0\n]+\\)\\(?3:\0\\)\\(?2:[0-9]+\\):" "\\|" "\\(?1:" 
"\\(?:[a-zA-Z]:\\)?" "[^\n:]+?[^\n/:]\\):[\11 ]*\\(?2:[1-9][0-9]*\\)[\11 ]*:" 
"\\)") 1 2 (,(lambda nil (when grep-highlight-matches (let* ((beg (match-end 
0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg 
(text-property-any beg end 'font-lock-face grep-match-face))) (when mbeg (- 
mbeg beg))))) \, (lambda nil (when grep-highlight-matches (let* ((beg 
(match-end  [...]
+(defconst grep-regexp-alist `((,(concat "^\\(?:" 
"\\(?1:[^\0\n]+\\)\\(?3:\0\\)\\(?2:[0-9]+\\):" "\\|" "\\(?1:" 
"\\(?:[a-zA-Z]:\\)?" "[^\n:]+?[^\n/:]\\):[\11 ]*\\(?2:[1-9][0-9]*\\)[\11 ]*:" 
"\\)") 1 2 (,(lambda nil (when grep-highlight-matches (let* ((beg (match-end 
0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg 
(text-property-any beg end 'font-lock-face grep-match-face))) (when mbeg (- 
mbeg beg))))) \, (lambda nil (when grep-highlight-matches (let* ((beg 
(match-end  [...]
 Regexp used to match grep hits.
 See `compilation-error-regexp-alist' for format details.")
 
@@ -15251,7 +15352,7 @@ and source-file directory for your debugger.
 \(fn COMMAND-LINE)" t nil)
 
 (autoload 'pdb "gud" "\
-Run COMMAND-LINE in the `*gud-FILE*' buffer.
+Run COMMAND-LINE in the `*gud-FILE*' buffer to debug Python programs.
 
 COMMAND-LINE should include the pdb executable
 name (`gud-pdb-command-name') and the file to be debugged.
@@ -16113,14 +16214,13 @@ or call the function `global-hi-lock-mode'.")
 (autoload 'global-hi-lock-mode "hi-lock" "\
 Toggle Hi-Lock mode in all buffers.
 With prefix ARG, enable Global Hi-Lock mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
+otherwise, disable it.  If called from Lisp, enable the mode if ARG is
+omitted or nil.
 
 Hi-Lock mode is enabled in all buffers where
 `turn-on-hi-lock-if-enabled' would do it.
 
-See `hi-lock-mode' for more information on
-Hi-Lock mode.
+See `hi-lock-mode' for more information on Hi-Lock mode.
 
 \(fn &optional ARG)" t nil)
 
@@ -16498,8 +16598,8 @@ or call the function `global-highlight-changes-mode'.")
 
 (autoload 'global-highlight-changes-mode "hilit-chg" "\
 Toggle Highlight-Changes mode in all buffers.
-With prefix ARG, enable Global Highlight-Changes mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
+With prefix ARG, enable Global Highlight-Changes mode if ARG is
+positive; otherwise, disable it.  If called from Lisp, enable the mode if
 ARG is omitted or nil.
 
 Highlight-Changes mode is enabled in all buffers where
@@ -17759,11 +17859,13 @@ is supported, and FILE exists, is used to construct 
the image
 specification to be returned.  Return nil if no specification is
 satisfied.
 
+If CACHE is non-nil, results are cached and returned on subsequent calls.
+
 The image is looked for in `image-load-path'.
 
 Image files should not be larger than specified by `max-image-size'.
 
-\(fn SPECS)" nil nil)
+\(fn SPECS &optional CACHE)" nil nil)
 
 (autoload 'defimage "image" "\
 Define SYMBOL as an image, and return SYMBOL.
@@ -17801,7 +17903,7 @@ recognizes these files as having image type 
`imagemagick'.
 
 If Emacs is compiled without ImageMagick support, this does nothing." nil nil)
 
-(register-definition-prefixes "image" '("image" "unknown-image-type"))
+(register-definition-prefixes "image" '("find-image--cache" "image" 
"unknown-image-type"))
 
 ;;;***
 
@@ -18812,16 +18914,6 @@ Add submenus to the File menu, to convert to and from 
various formats." t nil)
 
 ;;;***
 
-;;;### (autoloads nil "iso-transl" "international/iso-transl.el"
-;;;;;;  (0 0 0 0))
-;;; Generated autoloads from international/iso-transl.el
- (define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map)
- (autoload 'iso-transl-ctl-x-8-map "iso-transl" "Keymap for C-x 8 prefix." t 
'keymap)
-
-(register-definition-prefixes "iso-transl" '("iso-transl-"))
-
-;;;***
-
 ;;;### (autoloads nil "iso8601" "calendar/iso8601.el" (0 0 0 0))
 ;;; Generated autoloads from calendar/iso8601.el
 
@@ -19731,14 +19823,12 @@ or call the function `global-linum-mode'.")
 (autoload 'global-linum-mode "linum" "\
 Toggle Linum mode in all buffers.
 With prefix ARG, enable Global Linum mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
+otherwise, disable it.  If called from Lisp, enable the mode if ARG is
+omitted or nil.
 
-Linum mode is enabled in all buffers where
-`linum-on' would do it.
+Linum mode is enabled in all buffers where `linum-on' would do it.
 
-See `linum-mode' for more information on
-Linum mode.
+See `linum-mode' for more information on Linum mode.
 
 \(fn &optional ARG)" t nil)
 
@@ -20694,6 +20784,21 @@ recursion depth in the minibuffer prompt.  This is 
only useful if
 
 ;;;***
 
+;;;### (autoloads nil "memory-report" "emacs-lisp/memory-report.el"
+;;;;;;  (0 0 0 0))
+;;; Generated autoloads from emacs-lisp/memory-report.el
+
+(autoload 'memory-report "memory-report" "\
+Generate a report of how Emacs is using memory.
+
+This report is approximate, and will commonly over-count memory
+usage by variables, because shared data structures will usually
+by counted more than once." t nil)
+
+(register-definition-prefixes "memory-report" '("memory-report-"))
+
+;;;***
+
 ;;;### (autoloads nil "message" "gnus/message.el" (0 0 0 0))
 ;;; Generated autoloads from gnus/message.el
 
@@ -22898,7 +23003,6 @@ Many aspects this mode can be customized using
 
 ;;;### (autoloads nil "ob-abc" "org/ob-abc.el" (0 0 0 0))
 ;;; Generated autoloads from org/ob-abc.el
-(push (purecopy '(ob-abc 0 1)) package--builtin-versions)
 
 (register-definition-prefixes "ob-abc" '("org-babel-"))
 
@@ -22929,7 +23033,7 @@ Many aspects this mode can be customized using
 ;;;### (autoloads nil "ob-clojure" "org/ob-clojure.el" (0 0 0 0))
 ;;; Generated autoloads from org/ob-clojure.el
 
-(register-definition-prefixes "ob-clojure" '("org-babel-"))
+(register-definition-prefixes "ob-clojure" '("ob-clojure-" "org-babel-"))
 
 ;;;***
 
@@ -22970,7 +23074,6 @@ Many aspects this mode can be customized using
 
 ;;;### (autoloads nil "ob-ebnf" "org/ob-ebnf.el" (0 0 0 0))
 ;;; Generated autoloads from org/ob-ebnf.el
-(push (purecopy '(ob-ebnf 1 0)) package--builtin-versions)
 
 (register-definition-prefixes "ob-ebnf" '("org-babel-"))
 
@@ -23218,7 +23321,6 @@ Many aspects this mode can be customized using
 
 ;;;### (autoloads nil "ob-sed" "org/ob-sed.el" (0 0 0 0))
 ;;; Generated autoloads from org/ob-sed.el
-(push (purecopy '(ob-sed 0 1 1)) package--builtin-versions)
 
 (register-definition-prefixes "ob-sed" '("org-babel-"))
 
@@ -23323,110 +23425,6 @@ startup file, `~/.emacs-octave'.
 
 ;;;***
 
-;;;### (autoloads nil "ol" "org/ol.el" (0 0 0 0))
-;;; Generated autoloads from org/ol.el
-
-(autoload 'org-next-link "ol" "\
-Move forward to the next link.
-If the link is in hidden text, expose it.  When SEARCH-BACKWARD
-is non-nil, move backward.
-
-\(fn &optional SEARCH-BACKWARD)" t nil)
-
-(autoload 'org-previous-link "ol" "\
-Move backward to the previous link.
-If the link is in hidden text, expose it." t nil)
-
-(autoload 'org-toggle-link-display "ol" "\
-Toggle the literal or descriptive display of links." t nil)
-
-(autoload 'org-store-link "ol" "\
-Store a link to the current location.
-\\<org-mode-map>
-This link is added to `org-stored-links' and can later be inserted
-into an Org buffer with `org-insert-link' (`\\[org-insert-link]').
-
-For some link types, a `\\[universal-argument]' prefix ARG is interpreted.  A 
single
-`\\[universal-argument]' negates `org-context-in-file-links' for file links or
-`org-gnus-prefer-web-links' for links to Usenet articles.
-
-A `\\[universal-argument] \\[universal-argument]' prefix ARG forces skipping 
storing functions that are not
-part of Org core.
-
-A `\\[universal-argument] \\[universal-argument] \\[universal-argument]' 
prefix ARG forces storing a link for each line in the
-active region.
-
-Assume the function is called interactively if INTERACTIVE? is
-non-nil.
-
-\(fn ARG &optional INTERACTIVE\\=\\?)" t nil)
-
-(autoload 'org-insert-link "ol" "\
-Insert a link.  At the prompt, enter the link.
-
-Completion can be used to insert any of the link protocol prefixes in use.
-
-The history can be used to select a link previously stored with
-`org-store-link'.  When the empty string is entered (i.e. if you just
-press `RET' at the prompt), the link defaults to the most recently
-stored link.  As `SPC' triggers completion in the minibuffer, you need to
-use `M-SPC' or `C-q SPC' to force the insertion of a space character.
-
-You will also be prompted for a description, and if one is given, it will
-be displayed in the buffer instead of the link.
-
-If there is already a link at point, this command will allow you to edit
-link and description parts.
-
-With a `\\[universal-argument]' prefix, prompts for a file to link to.  The 
file name can be
-selected using completion.  The path to the file will be relative to the
-current directory if the file is in the current directory or a subdirectory.
-Otherwise, the link will be the absolute path as completed in the minibuffer
-\(i.e. normally ~/path/to/file).  You can configure this behavior using the
-option `org-link-file-path-type'.
-
-With a `\\[universal-argument] \\[universal-argument]' prefix, enforce an 
absolute path even if the file is in
-the current directory or below.
-
-A `\\[universal-argument] \\[universal-argument] \\[universal-argument]' 
prefix negates `org-link-keep-stored-after-insertion'.
-
-If the LINK-LOCATION parameter is non-nil, this value will be used as
-the link location instead of reading one interactively.
-
-If the DESCRIPTION parameter is non-nil, this value will be used as the
-default description.  Otherwise, if `org-link-make-description-function'
-is non-nil, this function will be called with the link target, and the
-result will be the default link description.  When called non-interactively,
-don't allow to edit the default description.
-
-\(fn &optional COMPLETE-FILE LINK-LOCATION DESCRIPTION)" t nil)
-
-(autoload 'org-insert-all-links "ol" "\
-Insert all links in `org-stored-links'.
-When a universal prefix, do not delete the links from `org-stored-links'.
-When `ARG' is a number, insert the last N link(s).
-`PRE' and `POST' are optional arguments to define a string to
-prepend or to append.
-
-\(fn ARG &optional PRE POST)" t nil)
-
-(autoload 'org-insert-last-stored-link "ol" "\
-Insert the last link stored in `org-stored-links'.
-
-\(fn ARG)" t nil)
-
-(autoload 'org-insert-link-global "ol" "\
-Insert a link like Org mode does.
-This command can be called in any mode to insert a link in Org syntax." t nil)
-
-(autoload 'org-update-radio-target-regexp "ol" "\
-Find all radio targets in this file and update the regular expression.
-Also refresh fontification if needed." t nil)
-
-(register-definition-prefixes "ol" '("org-"))
-
-;;;***
-
 ;;;### (autoloads nil "ol-bibtex" "org/ol-bibtex.el" (0 0 0 0))
 ;;; Generated autoloads from org/ol-bibtex.el
 
@@ -23529,7 +23527,7 @@ Coloring:
 
 ;;;### (autoloads nil "org" "org/org.el" (0 0 0 0))
 ;;; Generated autoloads from org/org.el
-(push (purecopy '(org 9 3)) package--builtin-versions)
+(push (purecopy '(org 9 4 4)) package--builtin-versions)
 
 (autoload 'org-babel-do-load-languages "org" "\
 Load the languages defined in `org-babel-load-languages'.
@@ -23554,6 +23552,11 @@ FULL is given.
 
 \(fn &optional HERE FULL MESSAGE)" t nil)
 
+(autoload 'org-load-modules-maybe "org" "\
+Load all extensions listed in `org-modules'.
+
+\(fn &optional FORCE)" nil nil)
+
 (autoload 'org-clock-persistence-insinuate "org" "\
 Set up hooks for clock persistence." nil nil)
 
@@ -23623,10 +23626,10 @@ When point is not at the beginning of a headline, 
execute the global
 binding for `TAB', which is re-indenting the line.  See the option
 `org-cycle-emulate-tab' for details.
 
-As a special case, if point is at the beginning of the buffer and there is
-no headline in line 1, this function will act as if called with prefix arg
-\(`\\[universal-argument] TAB', same as `S-TAB') also when called without 
prefix arg, but only
-if the variable `org-cycle-global-at-bob' is t.
+As a special case, if point is at the very beginning of the buffer, if
+there is no headline there, and if the variable `org-cycle-global-at-bob'
+is non-nil, this function acts as if called with prefix argument 
(`\\[universal-argument] TAB',
+same as `S-TAB') also when called without prefix argument.
 
 \(fn &optional ARG)" t nil)
 
@@ -24052,109 +24055,23 @@ Set `org-capture-templates' to be similar to 
`org-remember-templates'." t nil)
 
 ;;;***
 
-;;;### (autoloads nil "org-colview" "org/org-colview.el" (0 0 0 0))
-;;; Generated autoloads from org/org-colview.el
-
-(autoload 'org-columns-remove-overlays "org-colview" "\
-Remove all currently active column overlays." t nil)
-
-(autoload 'org-columns-get-format-and-top-level "org-colview" nil nil nil)
-
-(autoload 'org-columns "org-colview" "\
-Turn on column view on an Org mode file.
-
-Column view applies to the whole buffer if point is before the
-first headline.  Otherwise, it applies to the first ancestor
-setting \"COLUMNS\" property.  If there is none, it defaults to
-the current headline.  With a `\\[universal-argument]' prefix argument, turn 
on column
-view for the whole buffer unconditionally.
-
-When COLUMNS-FMT-STRING is non-nil, use it as the column format.
-
-\(fn &optional GLOBAL COLUMNS-FMT-STRING)" t nil)
-
-(autoload 'org-columns-compute "org-colview" "\
-Summarize the values of PROPERTY hierarchically.
-Also update existing values for PROPERTY according to the first
-column specification.
-
-\(fn PROPERTY)" t nil)
-
-(autoload 'org-dblock-write:columnview "org-colview" "\
-Write the column view table.
-
-PARAMS is a property list of parameters:
-
-`:id' (mandatory)
-
-    The ID property of the entry where the columns view should be
-    built.  When the symbol `local', call locally.  When `global'
-    call column view with the cursor at the beginning of the
-    buffer (usually this means that the whole buffer switches to
-    column view).  When \"file:path/to/file.org\", invoke column
-    view at the start of that file.  Otherwise, the ID is located
-    using `org-id-find'.
-
-`:exclude-tags'
-
-    List of tags to exclude from column view table.
-
-`:format'
-
-    When non-nil, specify the column view format to use.
-
-`:hlines'
-
-    When non-nil, insert a hline before each item.  When
-    a number, insert a hline before each level inferior or equal
-    to that number.
-
-`:indent'
-
-    When non-nil, indent each ITEM field according to its level.
-
-`:match'
-
-    When set to a string, use this as a tags/property match filter.
-
-`:maxlevel'
-
-    When set to a number, don't capture headlines below this level.
-
-`:skip-empty-rows'
-
-    When non-nil, skip rows where all specifiers other than ITEM
-    are empty.
-
-`:vlines'
-
-    When non-nil, make each column a column group to enforce
-    vertical lines.
-
-\(fn PARAMS)" nil nil)
-
-(autoload 'org-columns-insert-dblock "org-colview" "\
-Create a dynamic block capturing a column view table." t nil)
-
-(autoload 'org-agenda-columns "org-colview" "\
-Turn on or update column view in the agenda." t nil)
+;;;### (autoloads nil "org-crypt" "org/org-crypt.el" (0 0 0 0))
+;;; Generated autoloads from org/org-crypt.el
 
-(register-definition-prefixes "org-colview" '("org-"))
+(autoload 'org-encrypt-entry "org-crypt" "\
+Encrypt the content of the current headline." t nil)
 
-;;;***
-
-;;;### (autoloads nil "org-compat" "org/org-compat.el" (0 0 0 0))
-;;; Generated autoloads from org/org-compat.el
+(autoload 'org-decrypt-entry "org-crypt" "\
+Decrypt the content of the current headline." t nil)
 
-(autoload 'org-check-version "org-compat" "\
-Try very hard to provide sensible version strings." nil t)
+(autoload 'org-encrypt-entries "org-crypt" "\
+Encrypt all top-level entries in the current buffer." t nil)
 
-(register-definition-prefixes "org-compat" '("org-"))
+(autoload 'org-decrypt-entries "org-crypt" "\
+Decrypt all entries in the current buffer." t nil)
 
-;;;***
-
-;;;### (autoloads nil "org-crypt" "org/org-crypt.el" (0 0 0 0))
-;;; Generated autoloads from org/org-crypt.el
+(autoload 'org-crypt-use-before-save-magic "org-crypt" "\
+Add a hook to automatically encrypt entries before a file is saved to disk." 
nil nil)
 
 (register-definition-prefixes "org-crypt" '("org-"))
 
@@ -24167,61 +24084,6 @@ Try very hard to provide sensible version strings." 
nil t)
 
 ;;;***
 
-;;;### (autoloads nil "org-duration" "org/org-duration.el" (0 0 0
-;;;;;;  0))
-;;; Generated autoloads from org/org-duration.el
-
-(autoload 'org-duration-set-regexps "org-duration" "\
-Set duration related regexps." t nil)
-
-(autoload 'org-duration-p "org-duration" "\
-Non-nil when string S is a time duration.
-
-\(fn S)" nil nil)
-
-(autoload 'org-duration-to-minutes "org-duration" "\
-Return number of minutes of DURATION string.
-
-When optional argument CANONICAL is non-nil, ignore
-`org-duration-units' and use standard time units value.
-
-A bare number is translated into minutes.  The empty string is
-translated into 0.0.
-
-Return value as a float.  Raise an error if duration format is
-not recognized.
-
-\(fn DURATION &optional CANONICAL)" nil nil)
-
-(autoload 'org-duration-from-minutes "org-duration" "\
-Return duration string for a given number of MINUTES.
-
-Format duration according to `org-duration-format' or FMT, when
-non-nil.
-
-When optional argument CANONICAL is non-nil, ignore
-`org-duration-units' and use standard time units value.
-
-Raise an error if expected format is unknown.
-
-\(fn MINUTES &optional FMT CANONICAL)" nil nil)
-
-(autoload 'org-duration-h:mm-only-p "org-duration" "\
-Non-nil when every duration in TIMES has \"H:MM\" or \"H:MM:SS\" format.
-
-TIMES is a list of duration strings.
-
-Return nil if any duration is expressed with units, as defined in
-`org-duration-units'.  Otherwise, if any duration is expressed
-with \"H:MM:SS\" format, return `h:mm:ss'.  Otherwise, return
-`h:mm'.
-
-\(fn TIMES)" nil nil)
-
-(register-definition-prefixes "org-duration" '("org-duration-"))
-
-;;;***
-
 ;;;### (autoloads nil "org-entities" "org/org-entities.el" (0 0 0
 ;;;;;;  0))
 ;;; Generated autoloads from org/org-entities.el
@@ -24237,42 +24099,6 @@ with \"H:MM:SS\" format, return `h:mm:ss'.  Otherwise, 
return
 
 ;;;***
 
-;;;### (autoloads nil "org-goto" "org/org-goto.el" (0 0 0 0))
-;;; Generated autoloads from org/org-goto.el
-
-(autoload 'org-goto-location "org-goto" "\
-Let the user select a location in current buffer.
-This function uses a recursive edit.  It returns the selected
-position or nil.
-
-\(fn &optional BUF HELP)" nil nil)
-
-(autoload 'org-goto "org-goto" "\
-Look up a different location in the current file, keeping current visibility.
-
-When you want look-up or go to a different location in a
-document, the fastest way is often to fold the entire buffer and
-then dive into the tree.  This method has the disadvantage, that
-the previous location will be folded, which may not be what you
-want.
-
-This command works around this by showing a copy of the current
-buffer in an indirect buffer, in overview mode.  You can dive
-into the tree in that copy, use org-occur and incremental search
-to find a location.  When pressing RET or `Q', the command
-returns to the original buffer in which the visibility is still
-unchanged.  After RET it will also jump to the location selected
-in the indirect buffer and expose the headline hierarchy above.
-
-With a prefix argument, use the alternative interface: e.g., if
-`org-goto-interface' is `outline' use `outline-path-completion'.
-
-\(fn &optional ALTERNATIVE-INTERFACE)" t nil)
-
-(register-definition-prefixes "org-goto" '("org-goto-"))
-
-;;;***
-
 ;;;### (autoloads nil "org-habit" "org/org-habit.el" (0 0 0 0))
 ;;; Generated autoloads from org/org-habit.el
 
@@ -24288,41 +24114,6 @@ With a prefix argument, use the alternative interface: 
e.g., if
 
 ;;;***
 
-;;;### (autoloads nil "org-keys" "org/org-keys.el" (0 0 0 0))
-;;; Generated autoloads from org/org-keys.el
-
-(autoload 'org-babel-describe-bindings "org-keys" "\
-Describe all keybindings behind `org-babel-key-prefix'." t nil)
-
-(register-definition-prefixes "org-keys" '("org-"))
-
-;;;***
-
-;;;### (autoloads nil "org-lint" "org/org-lint.el" (0 0 0 0))
-;;; Generated autoloads from org/org-lint.el
-
-(autoload 'org-lint "org-lint" "\
-Check current Org buffer for syntax mistakes.
-
-By default, run all checkers.  With a `\\[universal-argument]' prefix ARG, 
select one
-category of checkers only.  With a `\\[universal-argument] 
\\[universal-argument]' prefix, run one precise
-checker by its name.
-
-ARG can also be a list of checker names, as symbols, to run.
-
-\(fn &optional ARG)" t nil)
-
-(register-definition-prefixes "org-lint" '("org-lint-"))
-
-;;;***
-
-;;;### (autoloads nil "org-list" "org/org-list.el" (0 0 0 0))
-;;; Generated autoloads from org/org-list.el
-
-(register-definition-prefixes "org-list" '("org-"))
-
-;;;***
-
 ;;;### (autoloads nil "org-macro" "org/org-macro.el" (0 0 0 0))
 ;;; Generated autoloads from org/org-macro.el
 
@@ -24330,18 +24121,6 @@ ARG can also be a list of checker names, as symbols, 
to run.
 
 ;;;***
 
-;;;### (autoloads nil "org-macs" "org/org-macs.el" (0 0 0 0))
-;;; Generated autoloads from org/org-macs.el
-
-(autoload 'org-load-noerror-mustsuffix "org-macs" "\
-Load FILE with optional arguments NOERROR and MUSTSUFFIX.
-
-\(fn FILE)" nil t)
-
-(register-definition-prefixes "org-macs" '("org-"))
-
-;;;***
-
 ;;;### (autoloads nil "org-mouse" "org/org-mouse.el" (0 0 0 0))
 ;;; Generated autoloads from org/org-mouse.el
 
@@ -24349,35 +24128,6 @@ Load FILE with optional arguments NOERROR and 
MUSTSUFFIX.
 
 ;;;***
 
-;;;### (autoloads nil "org-num" "org/org-num.el" (0 0 0 0))
-;;; Generated autoloads from org/org-num.el
-
-(autoload 'org-num-default-format "org-num" "\
-Default numbering display function.
-NUMBERING is a list of numbers.
-
-\(fn NUMBERING)" nil nil)
-
-(autoload 'org-num-mode "org-num" "\
-Dynamic numbering of headlines in an Org buffer.
-
-If called interactively, toggle `Org-Num mode'.  If the prefix
-argument is positive, enable the mode, and if it is zero or negative,
-disable the mode.
-
-If called from Lisp, toggle the mode if ARG is `toggle'.  Enable the
-mode if ARG is nil, omitted, or is a positive number.  Disable the
-mode if ARG is a negative number.
-
-The mode's hook is called both when the mode is enabled and when it is
-disabled.
-
-\(fn &optional ARG)" t nil)
-
-(register-definition-prefixes "org-num" '("org-num-"))
-
-;;;***
-
 ;;;### (autoloads nil "org-pcomplete" "org/org-pcomplete.el" (0 0
 ;;;;;;  0 0))
 ;;; Generated autoloads from org/org-pcomplete.el
@@ -24474,6 +24224,13 @@ See the command `outline-mode' for more information on 
this mode.
 
 ;;;***
 
+;;;### (autoloads nil "ox-man" "org/ox-man.el" (0 0 0 0))
+;;; Generated autoloads from org/ox-man.el
+
+(register-definition-prefixes "ox-man" '("org-man-"))
+
+;;;***
+
 ;;;### (autoloads nil "package" "emacs-lisp/package.el" (0 0 0 0))
 ;;; Generated autoloads from emacs-lisp/package.el
 (push (purecopy '(package 1 1 0)) package--builtin-versions)
@@ -26094,7 +25851,7 @@ Open profile FILENAME.
 
 ;;;### (autoloads nil "project" "progmodes/project.el" (0 0 0 0))
 ;;; Generated autoloads from progmodes/project.el
-(push (purecopy '(project 0 5 2)) package--builtin-versions)
+(push (purecopy '(project 0 5 3)) package--builtin-versions)
 
 (autoload 'project-current "project" "\
 Return the project instance in DIRECTORY, defaulting to `default-directory'.
@@ -26115,7 +25872,7 @@ of the project instance object.
 
 \(fn &optional MAYBE-PROMPT DIRECTORY)" nil nil)
 
-(defvar project-prefix-map (let ((map (make-sparse-keymap))) (define-key map 
"!" 'project-shell-command) (define-key map "&" 'project-async-shell-command) 
(define-key map "f" 'project-find-file) (define-key map "F" 
'project-or-external-find-file) (define-key map "b" 'project-switch-to-buffer) 
(define-key map "s" 'project-shell) (define-key map "d" 'project-dired) 
(define-key map "v" 'project-vc-dir) (define-key map "c" 'project-compile) 
(define-key map "e" 'project-eshell) (define-key ma [...]
+(defvar project-prefix-map (let ((map (make-sparse-keymap))) (define-key map 
"!" 'project-shell-command) (define-key map "&" 'project-async-shell-command) 
(define-key map "f" 'project-find-file) (define-key map "F" 
'project-or-external-find-file) (define-key map "b" 'project-switch-to-buffer) 
(define-key map "s" 'project-shell) (define-key map "d" 'project-dired) 
(define-key map "v" 'project-vc-dir) (define-key map "c" 'project-compile) 
(define-key map "e" 'project-eshell) (define-key ma [...]
 Keymap for project commands.")
  (define-key ctl-x-map "p" project-prefix-map)
 
@@ -26279,19 +26036,33 @@ Save the result in `project-list-file' if the list of 
projects has changed.
 (autoload 'project-known-project-roots "project" "\
 Return the list of root directories of all known projects." nil nil)
 
-(defvar project-switch-commands '((102 "Find file" project-find-file) (103 
"Find regexp" project-find-regexp) (100 "Dired" project-dired) (118 "VC-Dir" 
project-vc-dir) (101 "Eshell" project-eshell)) "\
-Alist mapping keys to project switching menu entries.
+(autoload 'project-execute-extended-command "project" "\
+Execute an extended command in project root." t nil)
+
+(function-put 'project-execute-extended-command 'interactive-only 
'command-execute)
+
+(defvar project-switch-commands '((project-find-file "Find file") 
(project-find-regexp "Find regexp") (project-dired "Dired") (project-vc-dir 
"VC-Dir") (project-eshell "Eshell")) "\
+Alist mapping commands to descriptions.
 Used by `project-switch-project' to construct a dispatch menu of
 commands available upon \"switching\" to another project.
 
-Each element is of the form (KEY LABEL COMMAND), where COMMAND is the
-command to run when KEY is pressed.  LABEL is used to distinguish
-the menu entries in the dispatch menu.")
+Each element is of the form (COMMAND LABEL &optional KEY) where
+COMMAND is the command to run when KEY is pressed.  LABEL is used
+to distinguish the menu entries in the dispatch menu.  If KEY is
+absent, COMMAND must be bound in `project-prefix-map', and the
+key is looked up in that map.")
+
+(custom-autoload 'project-switch-commands "project" t)
 
 (autoload 'project-switch-project "project" "\
 \"Switch\" to another project by running an Emacs command.
 The available commands are presented as a dispatch menu
-made from `project-switch-commands'." t nil)
+made from `project-switch-commands'.
+
+When called in a program, it will use the project corresponding
+to directory DIR.
+
+\(fn DIR)" t nil)
 
 (register-definition-prefixes "project" '("project-"))
 
@@ -26625,7 +26396,7 @@ Optional argument FACE specifies the face to do the 
highlighting.
 
 ;;;### (autoloads nil "python" "progmodes/python.el" (0 0 0 0))
 ;;; Generated autoloads from progmodes/python.el
-(push (purecopy '(python 0 27)) package--builtin-versions)
+(push (purecopy '(python 0 27 1)) package--builtin-versions)
 
 (add-to-list 'auto-mode-alist (cons (purecopy "\\.py[iw]?\\'") 'python-mode))
 
@@ -28013,6 +27784,7 @@ Instead, these commands are available:
 \\[rmail-undelete-previous-message]    Undelete message.  Tries current 
message, then earlier messages
        till a deleted message is found.
 \\[rmail-edit-current-message] Edit the current message.  \\[rmail-cease-edit] 
to return to Rmail.
+\\[rmail-epa-decrypt]  Decrypt the current message.
 \\[rmail-expunge]      Expunge deleted messages.
 \\[rmail-expunge-and-save]     Expunge and save the file.
 \\[rmail-quit]       Quit Rmail: expunge, save, then switch to another buffer.
@@ -29574,7 +29346,7 @@ sorted.  FUNCTION must be a function of one argument.
 \(fn FUNCTION PRED SEQUENCE)" nil nil)
 
 (autoload 'seq-filter "seq" "\
-Return a list of all the elements for which (PRED element) is non-nil in 
SEQUENCE.
+Return a list of all elements for which (PRED element) is non-nil in SEQUENCE.
 
 \(fn PRED SEQUENCE)" nil nil)
 
@@ -29811,8 +29583,8 @@ have <h1>Very Major Headlines</h1> through <h6>Very 
Minor Headlines</h6>
 
 <p>Paragraphs only need an opening tag.  Line breaks and multiple spaces are
 ignored unless the text is <pre>preformatted.</pre>  Text can be marked as
-<strong>bold</strong>, <em>italic</em> or <u>underlined</u> using the normal 
M-o or
-Edit/Text Properties/Face commands.
+<strong>bold</strong>, <em>italic</em> or <u>underlined</u> using the normal 
M-o
+or Edit/Text Properties/Face commands.
 
 Pages can have <a name=\"SOMENAME\">named points</a> and can link other points
 to them with <a href=\"#SOMENAME\">see also somename</a>.  In the same way <a
@@ -31818,14 +31590,13 @@ or call the function `global-subword-mode'.")
 (autoload 'global-subword-mode "subword" "\
 Toggle Subword mode in all buffers.
 With prefix ARG, enable Global Subword mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
+otherwise, disable it.  If called from Lisp, enable the mode if ARG is
+omitted or nil.
 
-Subword mode is enabled in all buffers where
-`(lambda nil (subword-mode 1))' would do it.
+Subword mode is enabled in all buffers where `(lambda nil
+\(subword-mode 1))' would do it.
 
-See `subword-mode' for more information on
-Subword mode.
+See `subword-mode' for more information on Subword mode.
 
 \(fn &optional ARG)" t nil)
 
@@ -31867,14 +31638,13 @@ or call the function `global-superword-mode'.")
 (autoload 'global-superword-mode "subword" "\
 Toggle Superword mode in all buffers.
 With prefix ARG, enable Global Superword mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
+otherwise, disable it.  If called from Lisp, enable the mode if ARG is
+omitted or nil.
 
-Superword mode is enabled in all buffers where
-`(lambda nil (superword-mode 1))' would do it.
+Superword mode is enabled in all buffers where `(lambda nil
+\(superword-mode 1))' would do it.
 
-See `superword-mode' for more information on
-Superword mode.
+See `superword-mode' for more information on Superword mode.
 
 \(fn &optional ARG)" t nil)
 
@@ -32001,14 +31771,13 @@ or call the function `global-tab-line-mode'.")
 (autoload 'global-tab-line-mode "tab-line" "\
 Toggle Tab-Line mode in all buffers.
 With prefix ARG, enable Global Tab-Line mode if ARG is positive;
-otherwise, disable it.  If called from Lisp, enable the mode if
-ARG is omitted or nil.
+otherwise, disable it.  If called from Lisp, enable the mode if ARG is
+omitted or nil.
 
 Tab-Line mode is enabled in all buffers where
 `tab-line-mode--turn-on' would do it.
 
-See `tab-line-mode' for more information on
-Tab-Line mode.
+See `tab-line-mode' for more information on Tab-Line mode.
 
 \(fn &optional ARG)" t nil)
 
@@ -32337,7 +32106,8 @@ Creates a cell above and a cell below the current point 
location." t nil)
 
 (autoload 'table-split-cell-horizontally "table" "\
 Split current cell horizontally.
-Creates a cell on the left and a cell on the right of the current point 
location." t nil)
+Creates a cell on the left and a cell on the right of the current
+point location." t nil)
 
 (autoload 'table-split-cell "table" "\
 Split current cell in ORIENTATION.
@@ -32805,7 +32575,7 @@ use in that buffer.
 
 \(fn PORT SPEED &optional LINE-MODE)" t nil)
 
-(register-definition-prefixes "term" '("ansi-term-color-vector" 
"explicit-shell-file-name" "serial-" "term-"))
+(register-definition-prefixes "term" '("ansi-term-color-vector" "serial-" 
"term-"))
 
 ;;;***
 
@@ -32828,7 +32598,6 @@ Start coverage on function under point." t nil)
 
 ;;;### (autoloads nil "tetris" "play/tetris.el" (0 0 0 0))
 ;;; Generated autoloads from play/tetris.el
-(push (purecopy '(tetris 2 1)) package--builtin-versions)
 
 (autoload 'tetris "tetris" "\
 Play the Tetris game.
@@ -32837,17 +32606,15 @@ rotate the shape to fit in with those at the bottom 
of the screen so
 as to form complete rows.
 
 tetris-mode keybindings:
-   \\<tetris-mode-map>
-\\[tetris-start-game]  Starts a new game of Tetris
-\\[tetris-end-game]    Terminates the current game
-\\[tetris-pause-game]  Pauses (or resumes) the current game
-\\[tetris-move-left]   Moves the shape one square to the left
-\\[tetris-move-right]  Moves the shape one square to the right
-\\[tetris-rotate-prev] Rotates the shape clockwise
-\\[tetris-rotate-next] Rotates the shape anticlockwise
-\\[tetris-move-bottom] Drops the shape to the bottom of the playing area
-
-" t nil)
+\\<tetris-mode-map>
+\\[tetris-start-game]  Start a new game of Tetris
+\\[tetris-end-game]    Terminate the current game
+\\[tetris-pause-game]  Pause (or resume) the current game
+\\[tetris-move-left]   Move the shape one square to the left
+\\[tetris-move-right]  Move the shape one square to the right
+\\[tetris-rotate-prev] Rotate the shape clockwise
+\\[tetris-rotate-next] Rotate the shape anticlockwise
+\\[tetris-move-bottom] Drop the shape to the bottom of the playing area" t nil)
 
 (register-definition-prefixes "tetris" '("tetris-"))
 
@@ -34234,7 +34001,6 @@ the output buffer or changing the window configuration.
 
 ;;;### (autoloads nil "tramp" "net/tramp.el" (0 0 0 0))
 ;;; Generated autoloads from net/tramp.el
-(push (purecopy '(tramp 2 5 0 -1)) package--builtin-versions)
 
 (defvar tramp-mode t "\
 Whether Tramp is enabled.
@@ -34408,6 +34174,7 @@ Add archive file name handler to 
`file-name-handler-alist'." (when tramp-archive
 
 ;;;### (autoloads nil "trampver" "net/trampver.el" (0 0 0 0))
 ;;; Generated autoloads from net/trampver.el
+(push (purecopy '(tramp 2 5 0)) package--builtin-versions)
 
 (register-definition-prefixes "trampver" '("tramp-"))
 
@@ -38445,7 +38212,7 @@ If LIMIT is non-nil, then do not consider characters 
beyond LIMIT.
 
 ;;;### (autoloads nil "xref" "progmodes/xref.el" (0 0 0 0))
 ;;; Generated autoloads from progmodes/xref.el
-(push (purecopy '(xref 1 0 3)) package--builtin-versions)
+(push (purecopy '(xref 1 0 4)) package--builtin-versions)
 
 (autoload 'xref-find-backend "xref" nil nil nil)
 
@@ -38699,39 +38466,39 @@ Zone out, completely." t nil)
 ;;;;;;  "font-lock.el" "format.el" "frame.el" "help.el" "hfy-cmap.el"
 ;;;;;;  "ibuf-ext.el" "indent.el" "international/characters.el" 
"international/charprop.el"
 ;;;;;;  "international/charscript.el" "international/cp51932.el"
-;;;;;;  "international/eucjp-ms.el" "international/mule-cmds.el"
-;;;;;;  "international/mule-conf.el" "international/mule.el" 
"international/uni-bidi.el"
-;;;;;;  "international/uni-brackets.el" "international/uni-category.el"
-;;;;;;  "international/uni-combining.el" "international/uni-comment.el"
-;;;;;;  "international/uni-decimal.el" "international/uni-decomposition.el"
-;;;;;;  "international/uni-digit.el" "international/uni-lowercase.el"
-;;;;;;  "international/uni-mirrored.el" "international/uni-name.el"
-;;;;;;  "international/uni-numeric.el" "international/uni-old-name.el"
-;;;;;;  "international/uni-special-lowercase.el" 
"international/uni-special-titlecase.el"
-;;;;;;  "international/uni-special-uppercase.el" 
"international/uni-titlecase.el"
-;;;;;;  "international/uni-uppercase.el" "isearch.el" "jit-lock.el"
-;;;;;;  "jka-cmpr-hook.el" "language/burmese.el" "language/cham.el"
-;;;;;;  "language/chinese.el" "language/cyrillic.el" "language/czech.el"
-;;;;;;  "language/english.el" "language/ethiopic.el" "language/european.el"
-;;;;;;  "language/georgian.el" "language/greek.el" "language/hebrew.el"
-;;;;;;  "language/indian.el" "language/japanese.el" "language/khmer.el"
-;;;;;;  "language/korean.el" "language/lao.el" "language/misc-lang.el"
-;;;;;;  "language/romanian.el" "language/sinhala.el" "language/slovak.el"
-;;;;;;  "language/tai-viet.el" "language/thai.el" "language/tibetan.el"
-;;;;;;  "language/utf-8-lang.el" "language/vietnamese.el" "ldefs-boot.el"
-;;;;;;  "leim/ja-dic/ja-dic.el" "leim/leim-list.el" "leim/quail/4Corner.el"
-;;;;;;  "leim/quail/ARRAY30.el" "leim/quail/CCDOSPY.el" 
"leim/quail/CTLau-b5.el"
-;;;;;;  "leim/quail/CTLau.el" "leim/quail/ECDICT.el" "leim/quail/ETZY.el"
-;;;;;;  "leim/quail/PY-b5.el" "leim/quail/PY.el" "leim/quail/Punct-b5.el"
-;;;;;;  "leim/quail/Punct.el" "leim/quail/QJ-b5.el" "leim/quail/QJ.el"
-;;;;;;  "leim/quail/SW.el" "leim/quail/TONEPY.el" "leim/quail/ZIRANMA.el"
-;;;;;;  "leim/quail/ZOZY.el" "leim/quail/arabic.el" "leim/quail/compose.el"
-;;;;;;  "leim/quail/croatian.el" "leim/quail/cyril-jis.el" 
"leim/quail/cyrillic.el"
-;;;;;;  "leim/quail/czech.el" "leim/quail/georgian.el" "leim/quail/greek.el"
-;;;;;;  "leim/quail/hanja-jis.el" "leim/quail/hanja.el" "leim/quail/hanja3.el"
-;;;;;;  "leim/quail/hebrew.el" "leim/quail/ipa-praat.el" 
"leim/quail/latin-alt.el"
-;;;;;;  "leim/quail/latin-ltx.el" "leim/quail/latin-post.el" 
"leim/quail/latin-pre.el"
-;;;;;;  "leim/quail/persian.el" "leim/quail/programmer-dvorak.el"
+;;;;;;  "international/eucjp-ms.el" "international/iso-transl.el"
+;;;;;;  "international/mule-cmds.el" "international/mule-conf.el"
+;;;;;;  "international/mule.el" "international/uni-bidi.el" 
"international/uni-brackets.el"
+;;;;;;  "international/uni-category.el" "international/uni-combining.el"
+;;;;;;  "international/uni-comment.el" "international/uni-decimal.el"
+;;;;;;  "international/uni-decomposition.el" "international/uni-digit.el"
+;;;;;;  "international/uni-lowercase.el" "international/uni-mirrored.el"
+;;;;;;  "international/uni-name.el" "international/uni-numeric.el"
+;;;;;;  "international/uni-old-name.el" 
"international/uni-special-lowercase.el"
+;;;;;;  "international/uni-special-titlecase.el" 
"international/uni-special-uppercase.el"
+;;;;;;  "international/uni-titlecase.el" "international/uni-uppercase.el"
+;;;;;;  "isearch.el" "jit-lock.el" "jka-cmpr-hook.el" "language/burmese.el"
+;;;;;;  "language/cham.el" "language/chinese.el" "language/cyrillic.el"
+;;;;;;  "language/czech.el" "language/english.el" "language/ethiopic.el"
+;;;;;;  "language/european.el" "language/georgian.el" "language/greek.el"
+;;;;;;  "language/hebrew.el" "language/indian.el" "language/japanese.el"
+;;;;;;  "language/khmer.el" "language/korean.el" "language/lao.el"
+;;;;;;  "language/misc-lang.el" "language/romanian.el" "language/sinhala.el"
+;;;;;;  "language/slovak.el" "language/tai-viet.el" "language/thai.el"
+;;;;;;  "language/tibetan.el" "language/utf-8-lang.el" "language/vietnamese.el"
+;;;;;;  "ldefs-boot.el" "leim/ja-dic/ja-dic.el" "leim/leim-list.el"
+;;;;;;  "leim/quail/4Corner.el" "leim/quail/ARRAY30.el" "leim/quail/CCDOSPY.el"
+;;;;;;  "leim/quail/CTLau-b5.el" "leim/quail/CTLau.el" "leim/quail/ECDICT.el"
+;;;;;;  "leim/quail/ETZY.el" "leim/quail/PY-b5.el" "leim/quail/PY.el"
+;;;;;;  "leim/quail/Punct-b5.el" "leim/quail/Punct.el" "leim/quail/QJ-b5.el"
+;;;;;;  "leim/quail/QJ.el" "leim/quail/SW.el" "leim/quail/TONEPY.el"
+;;;;;;  "leim/quail/ZIRANMA.el" "leim/quail/ZOZY.el" "leim/quail/arabic.el"
+;;;;;;  "leim/quail/compose.el" "leim/quail/croatian.el" 
"leim/quail/cyril-jis.el"
+;;;;;;  "leim/quail/cyrillic.el" "leim/quail/czech.el" "leim/quail/georgian.el"
+;;;;;;  "leim/quail/greek.el" "leim/quail/hanja-jis.el" "leim/quail/hanja.el"
+;;;;;;  "leim/quail/hanja3.el" "leim/quail/hebrew.el" "leim/quail/ipa-praat.el"
+;;;;;;  "leim/quail/latin-alt.el" "leim/quail/latin-ltx.el" 
"leim/quail/latin-post.el"
+;;;;;;  "leim/quail/latin-pre.el" "leim/quail/persian.el" 
"leim/quail/programmer-dvorak.el"
 ;;;;;;  "leim/quail/py-punct.el" "leim/quail/pypunct-b5.el" 
"leim/quail/quick-b5.el"
 ;;;;;;  "leim/quail/quick-cns.el" "leim/quail/rfc1345.el" "leim/quail/sami.el"
 ;;;;;;  "leim/quail/sgml-input.el" "leim/quail/slovak.el" 
"leim/quail/symbol-ksc.el"
@@ -38743,14 +38510,17 @@ Zone out, completely." t nil)
 ;;;;;;  "mh-e/mh-loaddefs.el" "minibuffer.el" "mouse.el" 
"net/tramp-loaddefs.el"
 ;;;;;;  "newcomment.el" "obarray.el" "org/ob-core.el" "org/ob-lob.el"
 ;;;;;;  "org/ob-matlab.el" "org/ob-tangle.el" "org/ob.el" "org/ol-bbdb.el"
-;;;;;;  "org/ol-irc.el" "org/org-archive.el" "org/org-attach.el"
-;;;;;;  "org/org-clock.el" "org/org-datetree.el" "org/org-element.el"
-;;;;;;  "org/org-feed.el" "org/org-footnote.el" "org/org-id.el" 
"org/org-indent.el"
-;;;;;;  "org/org-install.el" "org/org-mobile.el" "org/org-plot.el"
+;;;;;;  "org/ol-irc.el" "org/ol.el" "org/org-archive.el" "org/org-attach.el"
+;;;;;;  "org/org-clock.el" "org/org-colview.el" "org/org-compat.el"
+;;;;;;  "org/org-datetree.el" "org/org-duration.el" "org/org-element.el"
+;;;;;;  "org/org-feed.el" "org/org-footnote.el" "org/org-goto.el"
+;;;;;;  "org/org-id.el" "org/org-indent.el" "org/org-install.el"
+;;;;;;  "org/org-keys.el" "org/org-lint.el" "org/org-list.el" "org/org-macs.el"
+;;;;;;  "org/org-mobile.el" "org/org-num.el" "org/org-plot.el" 
"org/org-refile.el"
 ;;;;;;  "org/org-table.el" "org/org-timer.el" "org/ox-ascii.el" 
"org/ox-beamer.el"
 ;;;;;;  "org/ox-html.el" "org/ox-icalendar.el" "org/ox-latex.el"
-;;;;;;  "org/ox-man.el" "org/ox-md.el" "org/ox-odt.el" "org/ox-org.el"
-;;;;;;  "org/ox-publish.el" "org/ox-texinfo.el" "org/ox.el" 
"progmodes/elisp-mode.el"
+;;;;;;  "org/ox-md.el" "org/ox-odt.el" "org/ox-org.el" "org/ox-publish.el"
+;;;;;;  "org/ox-texinfo.el" "org/ox.el" "progmodes/elisp-mode.el"
 ;;;;;;  "progmodes/prog-mode.el" "ps-mule.el" "register.el" "replace.el"
 ;;;;;;  "rfn-eshadow.el" "select.el" "simple.el" "startup.el" "subdirs.el"
 ;;;;;;  "subr.el" "tab-bar.el" "textmodes/fill.el" "textmodes/page.el"
diff --git a/lisp/leim/quail/arabic.el b/lisp/leim/quail/arabic.el
index dd840c3..e5bd62b 100644
--- a/lisp/leim/quail/arabic.el
+++ b/lisp/leim/quail/arabic.el
@@ -1,6 +1,6 @@
 ;;; arabic.el --- Quail package for inputting Arabic   -*- coding: utf-8; 
lexical-binding:t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Cloos <cloos@jhcloos.com>
 ;; Keywords: mule, input method, Arabic
diff --git a/lisp/leim/quail/compose.el b/lisp/leim/quail/compose.el
index de251a3..f7ac83a 100644
--- a/lisp/leim/quail/compose.el
+++ b/lisp/leim/quail/compose.el
@@ -1,6 +1,6 @@
 ;;; compose.el --- Quail package for Multi_key character composition 
-*-coding: utf-8;-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Juri Linkov <juri@linkov.net>
 ;; Keywords: multilingual, input method, i18n
diff --git a/lisp/leim/quail/croatian.el b/lisp/leim/quail/croatian.el
index 2efd7ce..08f1e47 100644
--- a/lisp/leim/quail/croatian.el
+++ b/lisp/leim/quail/croatian.el
@@ -1,6 +1,6 @@
 ;;; croatian.el -- Quail package for inputting Croatian  -*-coding: utf-8; 
lexical-binding:t -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Hrvoje Nikšić <hrvoje.niksic@avl.com>
 ;; Keywords: i18n
diff --git a/lisp/leim/quail/cyril-jis.el b/lisp/leim/quail/cyril-jis.el
index 730042b..689f738 100644
--- a/lisp/leim/quail/cyril-jis.el
+++ b/lisp/leim/quail/cyril-jis.el
@@ -1,6 +1,6 @@
 ;;; cyril-jis.el --- Quail package for inputting JISX0208 Cyrillic letters  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/cyrillic.el b/lisp/leim/quail/cyrillic.el
index fa209f0..3654aca 100644
--- a/lisp/leim/quail/cyrillic.el
+++ b/lisp/leim/quail/cyrillic.el
@@ -1,6 +1,6 @@
 ;;; cyrillic.el --- Quail package for inputting Cyrillic characters  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/czech.el b/lisp/leim/quail/czech.el
index 34416c2..78b5011 100644
--- a/lisp/leim/quail/czech.el
+++ b/lisp/leim/quail/czech.el
@@ -1,6 +1,6 @@
 ;;; czech.el --- Quail package for inputting Czech -*-coding: utf-8; 
lexical-binding:t -*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Milan Zamazal <pdm@zamazal.org>
 ;; Maintainer: Pavel Janík <Pavel@Janik.cz>
diff --git a/lisp/leim/quail/georgian.el b/lisp/leim/quail/georgian.el
index e66477a..2389d81 100644
--- a/lisp/leim/quail/georgian.el
+++ b/lisp/leim/quail/georgian.el
@@ -1,6 +1,6 @@
 ;;; georgian.el --- Quail package for inputting Georgian characters  -*- 
coding: utf-8; lexical-binding:t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: i18n
diff --git a/lisp/leim/quail/greek.el b/lisp/leim/quail/greek.el
index eedfb9d..89ebd44 100644
--- a/lisp/leim/quail/greek.el
+++ b/lisp/leim/quail/greek.el
@@ -1,6 +1,6 @@
 ;;; greek.el --- Quail package for inputting Greek -*- coding: utf-8; 
lexical-binding:t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/hangul.el b/lisp/leim/quail/hangul.el
index b856255..20762d3 100644
--- a/lisp/leim/quail/hangul.el
+++ b/lisp/leim/quail/hangul.el
@@ -1,6 +1,6 @@
 ;;; hangul.el --- Korean Hangul input method
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Jihyun Cho <jihyun.jo@gmail.com>
 ;; Keywords: multilingual, input method, Korean, Hangul
@@ -525,7 +525,7 @@ HELP-TEXT is a text set in `hangul-input-method-help-text'."
   (quail-delete-overlays)
   (if (eq (selected-window) (minibuffer-window))
       (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer))
-  (set (make-local-variable 'input-method-function) func))
+  (setq-local input-method-function func))
 
 (defun hangul-input-method-deactivate ()
   "Deactivate the current Hangul input method."
diff --git a/lisp/leim/quail/hanja.el b/lisp/leim/quail/hanja.el
index 3ca17c6..7095bcf 100644
--- a/lisp/leim/quail/hanja.el
+++ b/lisp/leim/quail/hanja.el
@@ -1,6 +1,6 @@
 ;;; hanja.el --- Quail-package for Korean Hanja (KSC5601)  -*-coding: utf-8; 
lexical-binding: t -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/hanja3.el b/lisp/leim/quail/hanja3.el
index b380d40..080ba0e 100644
--- a/lisp/leim/quail/hanja3.el
+++ b/lisp/leim/quail/hanja3.el
@@ -1,6 +1,6 @@
 ;;; hanja3.el --- Quail-package for Korean Hanja (KSC5601)  -*-coding: utf-8; 
lexical-binding: t -*-
 
-;; Copyright (C) 1997, 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Koaunghi Un <koaunghi.un@zdv.uni-tuebingen.de>
 ;; Keywords: mule, quail, multilingual, input method, Korean, Hanja
diff --git a/lisp/leim/quail/indian.el b/lisp/leim/quail/indian.el
index 100ae63..6f5054e 100644
--- a/lisp/leim/quail/indian.el
+++ b/lisp/leim/quail/indian.el
@@ -1,6 +1,6 @@
 ;;; indian.el --- Quail packages for inputting Indian
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: KAWABATA, Taichi <kawabata@m17n.org>
 
diff --git a/lisp/leim/quail/ipa-praat.el b/lisp/leim/quail/ipa-praat.el
index cc577c6..0920bc7 100644
--- a/lisp/leim/quail/ipa-praat.el
+++ b/lisp/leim/quail/ipa-praat.el
@@ -1,6 +1,6 @@
 ;;; ipa-praat.el --- Inputting IPA characters with the conventions of Praat  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Oliver Scholz <epameinondas@gmx.de>
 ;; Keywords: multilingual, input method, IPA
diff --git a/lisp/leim/quail/ipa.el b/lisp/leim/quail/ipa.el
index cbc555d..d9f5888 100644
--- a/lisp/leim/quail/ipa.el
+++ b/lisp/leim/quail/ipa.el
@@ -1,6 +1,6 @@
 ;;; ipa.el --- Quail package for inputting IPA characters  -*-coding: utf-8;-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/japanese.el b/lisp/leim/quail/japanese.el
index 3747997..d7249d2 100644
--- a/lisp/leim/quail/japanese.el
+++ b/lisp/leim/quail/japanese.el
@@ -1,6 +1,6 @@
 ;;; japanese.el --- Quail package for inputting Japanese
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/latin-alt.el b/lisp/leim/quail/latin-alt.el
index 4661ba8..0db952b 100644
--- a/lisp/leim/quail/latin-alt.el
+++ b/lisp/leim/quail/latin-alt.el
@@ -1,6 +1,6 @@
 ;;; latin-alt.el --- Quail package for inputting various European characters 
-*-coding: utf-8; lexical-binding: t -*-
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
 ;;   2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/latin-ltx.el b/lisp/leim/quail/latin-ltx.el
index f1a24bb..fd78253 100644
--- a/lisp/leim/quail/latin-ltx.el
+++ b/lisp/leim/quail/latin-ltx.el
@@ -1,6 +1,6 @@
 ;;; latin-ltx.el --- Quail package for TeX-style input -*-coding: utf-8;-*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
 ;;   2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/latin-post.el b/lisp/leim/quail/latin-post.el
index 293c0c0..8e21ed8 100644
--- a/lisp/leim/quail/latin-post.el
+++ b/lisp/leim/quail/latin-post.el
@@ -1,6 +1,6 @@
 ;;; latin-post.el --- Quail packages for inputting various European characters 
 -*-coding: utf-8; lexical-binding: t -*-
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/latin-pre.el b/lisp/leim/quail/latin-pre.el
index 802b70e..2200654 100644
--- a/lisp/leim/quail/latin-pre.el
+++ b/lisp/leim/quail/latin-pre.el
@@ -1,6 +1,6 @@
 ;;; latin-pre.el --- Quail packages for inputting various European characters  
-*-coding: utf-8; lexical-binding: t -*-
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/lrt.el b/lisp/leim/quail/lrt.el
index 5b09886..e05bc1e 100644
--- a/lisp/leim/quail/lrt.el
+++ b/lisp/leim/quail/lrt.el
@@ -1,6 +1,6 @@
 ;;; lrt.el --- Quail package for inputting Lao characters by LRT method  
-*-coding: utf-8;-*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/persian.el b/lisp/leim/quail/persian.el
index fcbf727..4157f88 100644
--- a/lisp/leim/quail/persian.el
+++ b/lisp/leim/quail/persian.el
@@ -1,6 +1,6 @@
 ;;; persian.el  --- Quail package for inputting Persian/Farsi keyboard -*- 
coding: utf-8; lexical-binding: t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Mohsen BANAN <libre@mohsen.1.banan.byname.net>
 ;; X-URL: http://mohsen.1.banan.byname.net/contact
diff --git a/lisp/leim/quail/programmer-dvorak.el 
b/lisp/leim/quail/programmer-dvorak.el
index c544c62..49f9d82 100644
--- a/lisp/leim/quail/programmer-dvorak.el
+++ b/lisp/leim/quail/programmer-dvorak.el
@@ -1,6 +1,6 @@
 ;;; programmer-dvorak.el --- Quail package for the programmer Dvorak layout  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Joakim Jalap <joakim.jalap@fastmail.com>
 
diff --git a/lisp/leim/quail/py-punct.el b/lisp/leim/quail/py-punct.el
index 76bf612..2a61795 100644
--- a/lisp/leim/quail/py-punct.el
+++ b/lisp/leim/quail/py-punct.el
@@ -1,6 +1,6 @@
 ;;; py-punct.el --- Quail packages for Chinese (pinyin + extra symbols)  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/rfc1345.el b/lisp/leim/quail/rfc1345.el
index 7f98021..a072082 100644
--- a/lisp/leim/quail/rfc1345.el
+++ b/lisp/leim/quail/rfc1345.el
@@ -1,6 +1,6 @@
 ;;; rfc1345.el --- Quail method for RFC 1345 mnemonics -*- coding: utf-8; 
lexical-binding: t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: i18n
diff --git a/lisp/leim/quail/sami.el b/lisp/leim/quail/sami.el
index 33fe287..6c9b2d9 100644
--- a/lisp/leim/quail/sami.el
+++ b/lisp/leim/quail/sami.el
@@ -1,6 +1,6 @@
 ;;; sami.el --- Quail package for inputting Sámi  -*-coding: utf-8; 
lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Wojciech S. Gac <wojciech.s.gac@gmail.com>
 ;; Keywords: i18n, multilingual, input method, Sámi
diff --git a/lisp/leim/quail/sgml-input.el b/lisp/leim/quail/sgml-input.el
index df7ac98..68add78 100644
--- a/lisp/leim/quail/sgml-input.el
+++ b/lisp/leim/quail/sgml-input.el
@@ -1,6 +1,6 @@
 ;;; sgml-input.el --- Quail method for Unicode entered as SGML entities -*- 
coding: utf-8; lexical-binding: t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: i18n
diff --git a/lisp/leim/quail/sisheng.el b/lisp/leim/quail/sisheng.el
index 7e25fbe..8e7a500 100644
--- a/lisp/leim/quail/sisheng.el
+++ b/lisp/leim/quail/sisheng.el
@@ -1,6 +1,6 @@
 ;;; sisheng.el --- sisheng input method for Chinese pinyin transliteration
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Werner LEMBERG <wl@gnu.org>
 
diff --git a/lisp/leim/quail/slovak.el b/lisp/leim/quail/slovak.el
index c306be1..53780cf 100644
--- a/lisp/leim/quail/slovak.el
+++ b/lisp/leim/quail/slovak.el
@@ -1,6 +1,6 @@
 ;;; slovak.el --- Quail package for inputting Slovak  -*-coding: utf-8; 
lexical-binding: t -*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Authors: Tibor Šimko <tibor.simko@fmph.uniba.sk>
 ;;     Milan Zamazal <pdm@zamazal.org>
diff --git a/lisp/leim/quail/symbol-ksc.el b/lisp/leim/quail/symbol-ksc.el
index e346f7c..0583d64 100644
--- a/lisp/leim/quail/symbol-ksc.el
+++ b/lisp/leim/quail/symbol-ksc.el
@@ -1,6 +1,6 @@
 ;;; symbol-ksc.el --- Quail-package for Korean Symbol (KSC5601) -*-coding: 
utf-8; lexical-binding: t -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/tamil-dvorak.el b/lisp/leim/quail/tamil-dvorak.el
index 0a70c3b..b2d48af 100644
--- a/lisp/leim/quail/tamil-dvorak.el
+++ b/lisp/leim/quail/tamil-dvorak.el
@@ -1,6 +1,6 @@
 ;;; tamil-dvorak.el --- Quail package for Tamil input with Dvorak keyboard  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Shakthi Kannan <author@shakthimaan.com>
 
diff --git a/lisp/leim/quail/tibetan.el b/lisp/leim/quail/tibetan.el
index dad4950..a54763d 100644
--- a/lisp/leim/quail/tibetan.el
+++ b/lisp/leim/quail/tibetan.el
@@ -1,6 +1,6 @@
 ;;; tibetan.el --- Quail package for inputting Tibetan characters -*-coding: 
utf-8-emacs;-*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/leim/quail/uni-input.el b/lisp/leim/quail/uni-input.el
index 6f1fbcc..c7cf6ab 100644
--- a/lisp/leim/quail/uni-input.el
+++ b/lisp/leim/quail/uni-input.el
@@ -1,6 +1,6 @@
 ;;; uni-input.el --- Hex Unicode input method
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
@@ -105,8 +105,7 @@ While this input method is active, the variable
     (quail-delete-overlays)
     (if (eq (selected-window) (minibuffer-window))
        (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer))
-    (set (make-local-variable 'input-method-function)
-        'ucs-input-method)))
+    (setq-local input-method-function 'ucs-input-method)))
 
 (defun ucs-input-deactivate ()
   "Deactivate UCS input method."
diff --git a/lisp/leim/quail/vntelex.el b/lisp/leim/quail/vntelex.el
index 8d53ab0..22d23d4 100644
--- a/lisp/leim/quail/vntelex.el
+++ b/lisp/leim/quail/vntelex.el
@@ -1,6 +1,6 @@
 ;;; vntelex.el --- Quail package for Vietnamese by Telex method  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Werner Lemberg <wl@gnu.org>
 ;; Keywords: multilingual, input method, Vietnamese
diff --git a/lisp/leim/quail/vnvni.el b/lisp/leim/quail/vnvni.el
index e797304..faccc0a 100644
--- a/lisp/leim/quail/vnvni.el
+++ b/lisp/leim/quail/vnvni.el
@@ -1,6 +1,6 @@
 ;;; vnvni.el --- Quail package for Vietnamese by VNI method  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author:   Werner Lemberg <wl@gnu.org>
 ;;           Nguyen Thai Ngoc Duy <pclouds@gmail.com>
diff --git a/lisp/leim/quail/welsh.el b/lisp/leim/quail/welsh.el
index a62d2f5..f521d14 100644
--- a/lisp/leim/quail/welsh.el
+++ b/lisp/leim/quail/welsh.el
@@ -1,6 +1,6 @@
 ;;; welsh.el --- Quail package for inputting Welsh characters  -*- coding: 
utf-8; lexical-binding: t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: i18n
diff --git a/lisp/linum.el b/lisp/linum.el
index e8c3642..824f016 100644
--- a/lisp/linum.el
+++ b/lisp/linum.el
@@ -1,6 +1,6 @@
 ;;; linum.el --- display line numbers in the left margin -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Markus Triska <markus.triska@gmx.at>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 8ac575e..a60d6b2 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -1,6 +1,6 @@
 ;;; loadhist.el --- lisp functions for working with feature groups
 
-;; Copyright (C) 1995, 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/loadup.el b/lisp/loadup.el
index d3c8664..9cee6a2 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -1,6 +1,6 @@
 ;;; loadup.el --- load up standardly loaded Lisp files for Emacs
 
-;; Copyright (C) 1985-1986, 1992, 1994, 2001-2020 Free Software
+;; Copyright (C) 1985-1986, 1992, 1994, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/locate.el b/lisp/locate.el
index 44a67ab..c4dbe2a 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -1,6 +1,6 @@
 ;;; locate.el --- interface to the locate command  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1996, 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Peter Breton <pbreton@cs.umb.edu>
 ;; Keywords: unix files
@@ -319,9 +319,9 @@ then `locate-post-command-hook'."
        (erase-buffer)
 
        (setq locate-current-filter filter)
-       (set (make-local-variable 'locate-local-search) search-string)
-       (set (make-local-variable 'locate-local-filter) filter)
-       (set (make-local-variable 'locate-local-prompt) run-locate-command)
+        (setq-local locate-local-search search-string)
+        (setq-local locate-local-filter filter)
+        (setq-local locate-local-prompt run-locate-command)
 
        (if run-locate-command
            (shell-command search-string locate-buffer-name)
@@ -467,8 +467,8 @@ do not work in subdirectories.
        buffer-read-only    t)
   (add-to-invisibility-spec '(dired . t))
   (dired-alist-add-1 default-directory (point-min-marker))
-  (set (make-local-variable 'dired-directory) "/")
-  (set (make-local-variable 'dired-subdir-switches) locate-ls-subdir-switches)
+  (setq-local dired-directory "/")
+  (setq-local dired-subdir-switches locate-ls-subdir-switches)
   (setq dired-switches-alist nil)
   ;; This should support both Unix and Windoze style names
   (setq-local directory-listing-before-filename-regexp
diff --git a/lisp/lpr.el b/lisp/lpr.el
index b45e9c7..012d251 100644
--- a/lisp/lpr.el
+++ b/lisp/lpr.el
@@ -1,6 +1,6 @@
 ;;; lpr.el --- print Emacs buffer on line printer
 
-;; Copyright (C) 1985, 1988, 1992, 1994, 2001-2020 Free Software
+;; Copyright (C) 1985, 1988, 1992, 1994, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index e264620..3721e86 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -1,6 +1,6 @@
 ;;; ls-lisp.el --- emulate insert-directory completely in Emacs Lisp  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1992, 1994, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1994, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
 ;; Modified by: Francis J. Wright <F.J.Wright@maths.qmw.ac.uk>
diff --git a/lisp/macros.el b/lisp/macros.el
index f90ad42..faa1f0b 100644
--- a/lisp/macros.el
+++ b/lisp/macros.el
@@ -1,6 +1,6 @@
 ;;; macros.el --- non-primitive commands for keyboard macros -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1985-1987, 1992, 1994-1995, 2001-2020 Free Software
+;; Copyright (C) 1985-1987, 1992, 1994-1995, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el
index 035bb32..edb52b6 100644
--- a/lisp/mail/binhex.el
+++ b/lisp/mail/binhex.el
@@ -1,6 +1,6 @@
 ;;; binhex.el --- decode BinHex-encoded text  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: binhex news
diff --git a/lisp/mail/blessmail.el b/lisp/mail/blessmail.el
index 242714d..505ce5d 100644
--- a/lisp/mail/blessmail.el
+++ b/lisp/mail/blessmail.el
@@ -1,6 +1,6 @@
 ;;; blessmail.el --- decide whether movemail needs special privileges -*- 
no-byte-compile: t -*-
 
-;; Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 5ad1b98..4e8009d 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -1,6 +1,6 @@
 ;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list
 
-;; Copyright (C) 1985, 1994, 1997-1998, 2000-2020 Free Software
+;; Copyright (C) 1985, 1994, 1997-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: K. Shane Hartman
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index 6effe13..2bcbdf4 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -622,22 +622,25 @@ to arrange for the message to get a From: line."
 
 
 (defcustom feedmail-sendmail-f-doesnt-sell-me-out nil
-  "Says whether the sendmail program issues a warning header if called with 
\"-f\".
+  "Whether sendmail should issue a warning header if called with \"-f\".
 The sendmail program has a useful feature to let you set the envelope FROM
 address via a command line option, \"-f\".  Unfortunately, it also has a widely
 disliked default behavior of selling you out if you do that by inserting
 an unattractive warning in the headers.  It looks something like this:
 
-  X-Authentication-Warning: u1.example.com: niceguy set sender to 
niceguy@example.com using -f
-
-It is possible to configure sendmail to not do this, but such a reconfiguration
-is not an option for many users.  As this is the default behavior of most
-sendmail installations, one can mostly only wish it were otherwise.  If 
feedmail
-believes the sendmail program will sell you out this way, it won't use the 
\"-f\"
-option when calling sendmail.  If it doesn't think sendmail will sell you out,
-it will use the \"-f\" \(since it is a handy feature).  You control what
-feedmail thinks with this variable.  The default is nil, meaning that feedmail
-will believe that sendmail will sell you out."
+  X-Authentication-Warning: u1.example.com: niceguy set
+      sender to niceguy@example.com using -f
+
+It is possible to configure sendmail to not do this, but such a
+reconfiguration is not an option for many users.  As this is the
+default behavior of most sendmail installations, one can mostly
+only wish it were otherwise.  If feedmail believes the sendmail
+program will sell you out this way, it won't use the \"-f\"
+option when calling sendmail.  If it doesn't think sendmail will
+sell you out, it will use the \"-f\" \(since it is a handy
+feature).  You control what feedmail thinks with this variable.
+The default is nil, meaning that feedmail will believe that
+sendmail will sell you out."
   :version "24.1"
   :group 'feedmail-headers
   :type 'boolean
@@ -807,7 +810,8 @@ fiddle-plex.
 
 feedmail will use this list of fiddle-plexes to manipulate user-specified
 message header fields.  It does this after it has completed all normal
-message header field manipulation and before calling 
`feedmail-last-chance-hook'.
+message header field manipulation and before calling
+`feedmail-last-chance-hook'.
 
 For an explanation of fiddle-plexes, see the documentation for the
 variable `feedmail-fiddle-plex-blurb'.  In contrast to some other fiddle-plex
@@ -889,13 +893,14 @@ called and will consult `feedmail-spray-this-address' to 
find the
 stripped envelope email address (no comments or angle brackets).  The
 function should return an embellished form of the address.
 
-The recipe for sending form letters is:  (1) create a message with all
-addressees on Bcc: headers; (2) tell feedmail to remove Bcc: headers
-before sending the message; (3) create a function which will embellish
-stripped addresses, if desired; (4) define 
`feedmail-spray-address-fiddle-plex-list'
-appropriately; (5) send the message with `feedmail-enable-spray' set
-non-nil; (6) stand back and watch co-workers wonder at how efficient
-you are at accomplishing inherently inefficient things."
+The recipe for sending form letters is: (1) create a message with
+all addressees on Bcc: headers; (2) tell feedmail to remove Bcc:
+headers before sending the message; (3) create a function which
+will embellish stripped addresses, if desired; (4) define
+`feedmail-spray-address-fiddle-plex-list' appropriately; (5) send
+the message with `feedmail-enable-spray' set non-nil; (6) stand
+back and watch co-workers wonder at how efficient you are at
+accomplishing inherently inefficient things."
   :group 'feedmail-spray
   :type 'sexp ; too complex to be described accurately
   )
@@ -1336,19 +1341,22 @@ variable, but may depend on its value as described 
here.")
 
 (defun feedmail-mail-send-hook-splitter ()
   "Facilitate dividing `mail-send-hook' things into queued and immediate cases.
-If you have `mail-send-hook' functions that should only be called for sending/
-queueing messages or only be called for the sending of queued messages, this is
-for you.  Add this function to `mail-send-hook' with something like this:
+If you have `mail-send-hook' functions that should only be called
+for sending/ queueing messages or only be called for the sending
+of queued messages, this is for you.  Add this function to
+`mail-send-hook' with something like this:
 
        (add-hook \\='mail-send-hook \\='feedmail-mail-send-hook-splitter)
 
-Then add the functions you want called to either 
`feedmail-mail-send-hook-queued'
-or `feedmail-mail-send-hook', as appropriate.  The distinction is that
-`feedmail-mail-send-hook' will be called when you send mail from a composition
-buffer (typically by typing C-c C-c), whether the message is sent immediately
-or placed in the queue or drafts directory.  `feedmail-mail-send-hook-queued' 
is
-called when messages are being sent from the queue directory, typically via a
-call to `feedmail-run-the-queue'."
+Then add the functions you want called to either
+`feedmail-mail-send-hook-queued' or `feedmail-mail-send-hook', as
+appropriate.  The distinction is that `feedmail-mail-send-hook'
+will be called when you send mail from a composition
+buffer (typically by typing C-c C-c), whether the message is sent
+immediately or placed in the queue or drafts directory.
+`feedmail-mail-send-hook-queued' is called when messages are
+being sent from the queue directory, typically via a call to
+`feedmail-run-the-queue'."
   (feedmail-say-debug ">in-> feedmail-mail-send-hook-splitter %s" 
feedmail-queue-runner-is-active)
   (if feedmail-queue-runner-is-active
       (run-hooks 'feedmail-mail-send-hook-queued)
@@ -2067,10 +2075,10 @@ internally by feedmail):
    after-run            (the queue has just been run, possibly sending 
messages)
 
 WHAT-EVENT is used as a key into the table `feedmail-queue-reminder-alist'.  If
-the associated value is a function, it is called without arguments and is 
expected
-to perform the reminder activity.  You can supply your own reminder functions
-by redefining `feedmail-queue-reminder-alist'.  If you don't want any 
reminders,
-you can set `feedmail-queue-reminder-alist' to nil."
+the associated value is a function, it is called without arguments and is
+expected to perform the reminder activity.  You can supply your own reminder
+functions by redefining `feedmail-queue-reminder-alist'.  If you don't want any
+reminders, you can set `feedmail-queue-reminder-alist' to nil."
   (interactive "p")
   (feedmail-say-debug ">in-> feedmail-queue-reminder %s" what-event)
   (let ((key (if (and what-event (symbolp what-event)) what-event 'on-demand)) 
entry reminder)
@@ -2965,7 +2973,8 @@ probably not appropriate for you."
 
 
 (defun feedmail-fiddle-list-of-fiddle-plexes (list-of-fiddle-plexes)
-  "Fiddling based on a list of fiddle-plexes.  Values t, nil, and string are 
pointless."
+  "Fiddling based on a list of fiddle-plexes.
+Values t, nil, and string are pointless."
   (feedmail-say-debug ">in-> feedmail-fiddle-list-of-fiddle-plexes")
   ;; default is to fall off the end of the list and do nothing
   (let ((lofp list-of-fiddle-plexes) fp)
diff --git a/lisp/mail/flow-fill.el b/lisp/mail/flow-fill.el
index b357b3e..e93ba54 100644
--- a/lisp/mail/flow-fill.el
+++ b/lisp/mail/flow-fill.el
@@ -1,6 +1,6 @@
 ;;; flow-fill.el --- interpret RFC2646 "flowed" text  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <jas@pdc.kth.se>
 ;; Keywords: mail
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el
index 67bfbf7..ea109ee 100644
--- a/lisp/mail/footnote.el
+++ b/lisp/mail/footnote.el
@@ -1,6 +1,6 @@
 ;;; footnote.el --- footnote support for message mode  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Steven L Baur <steve@xemacs.org> (1997-2011)
 ;;         Boruch Baum <boruch_baum@gmx.com> (2017-)
diff --git a/lisp/mail/hashcash.el b/lisp/mail/hashcash.el
index a2705d6..b4889ee 100644
--- a/lisp/mail/hashcash.el
+++ b/lisp/mail/hashcash.el
@@ -1,6 +1,6 @@
 ;;; hashcash.el --- Add hashcash payments to email  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2003-2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Written by: Paul Foley <mycroft@actrix.gen.nz> (1997-2002)
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mail/ietf-drums.el b/lisp/mail/ietf-drums.el
index a136ccf..795e37d 100644
--- a/lisp/mail/ietf-drums.el
+++ b/lisp/mail/ietf-drums.el
@@ -1,6 +1,6 @@
 ;;; ietf-drums.el --- Functions for parsing RFC 2822 headers  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el
index 49dfd2e..4e3bf78 100644
--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -1,6 +1,6 @@
 ;;; mail-extr.el --- extract full name and address from email header
 
-;; Copyright (C) 1991-1994, 1997, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1991-1994, 1997, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Joe Wells <jbw@cs.bu.edu>
diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el
index 34bef2c..37c8ad6 100644
--- a/lisp/mail/mail-hist.el
+++ b/lisp/mail/mail-hist.el
@@ -1,6 +1,6 @@
 ;;; mail-hist.el --- headers and message body history for outgoing mail
 
-;; Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Karl Fogel <kfogel@red-bean.com>
 ;; Created: March, 1994
diff --git a/lisp/mail/mail-parse.el b/lisp/mail/mail-parse.el
index e0274c8..e72ed82 100644
--- a/lisp/mail/mail-parse.el
+++ b/lisp/mail/mail-parse.el
@@ -1,6 +1,6 @@
 ;;; mail-parse.el --- Interface functions for parsing mail  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
diff --git a/lisp/mail/mail-prsvr.el b/lisp/mail/mail-prsvr.el
index 7c67c49..a9b5a44 100644
--- a/lisp/mail/mail-prsvr.el
+++ b/lisp/mail/mail-prsvr.el
@@ -1,6 +1,6 @@
 ;;; mail-prsvr.el --- Interface variables for parsing mail  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index 68b6fea..ad2dee5 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -1,6 +1,6 @@
 ;;; mail-utils.el --- utility functions used both by rmail and rnews
 
-;; Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: mail, news
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index de4fe25..2147049 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -1,6 +1,6 @@
 ;;; mailabbrev.el --- abbrev-expansion of mail aliases
 
-;; Copyright (C) 1985-1987, 1992-1993, 1996-1997, 2000-2020 Free
+;; Copyright (C) 1985-1987, 1992-1993, 1996-1997, 2000-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Author: Jamie Zawinski <jwz@lucid.com; now jwz@jwz.org>
diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el
index 2b76539..5a5488b 100644
--- a/lisp/mail/mailalias.el
+++ b/lisp/mail/mailalias.el
@@ -1,6 +1,6 @@
 ;;; mailalias.el --- expand and complete mailing address aliases -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1985, 1987, 1995-1997, 2001-2020 Free Software
+;; Copyright (C) 1985, 1987, 1995-1997, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el
index 405ae17..3cba6a6 100644
--- a/lisp/mail/mailclient.el
+++ b/lisp/mail/mailclient.el
@@ -1,6 +1,6 @@
 ;;; mailclient.el --- mail sending via system's mail client.
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: David Reitter <david.reitter@gmail.com>
 ;; Keywords: mail
diff --git a/lisp/mail/mailheader.el b/lisp/mail/mailheader.el
index 801df10..cbc01e4 100644
--- a/lisp/mail/mailheader.el
+++ b/lisp/mail/mailheader.el
@@ -1,6 +1,6 @@
 ;;; mailheader.el --- mail header parsing, merging, formatting
 
-;; Copyright (C) 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Erik Naggum <erik@naggum.no>
 ;; Keywords: tools, mail, news
diff --git a/lisp/mail/mspools.el b/lisp/mail/mspools.el
index ab2649f..970f52c 100644
--- a/lisp/mail/mspools.el
+++ b/lisp/mail/mspools.el
@@ -1,6 +1,6 @@
 ;;; mspools.el --- show mail spools waiting to be read  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Stephen Eglen <stephen@gnu.org>
 ;; Created: 22 Jan 1997
diff --git a/lisp/mail/qp.el b/lisp/mail/qp.el
index 10ac696..02a371a 100644
--- a/lisp/mail/qp.el
+++ b/lisp/mail/qp.el
@@ -1,6 +1,6 @@
 ;;; qp.el --- Quoted-Printable functions  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: mail, extensions
diff --git a/lisp/mail/reporter.el b/lisp/mail/reporter.el
index 805dd12..f4de299 100644
--- a/lisp/mail/reporter.el
+++ b/lisp/mail/reporter.el
@@ -1,6 +1,6 @@
 ;;; reporter.el --- customizable bug reporting of lisp programs
 
-;; Copyright (C) 1993-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author:          1993-1998 Barry A. Warsaw
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mail/rfc2045.el b/lisp/mail/rfc2045.el
index dba9c04..c0672f1 100644
--- a/lisp/mail/rfc2045.el
+++ b/lisp/mail/rfc2045.el
@@ -1,6 +1,6 @@
 ;;; rfc2045.el --- Functions for decoding rfc2045 headers  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
diff --git a/lisp/mail/rfc2047.el b/lisp/mail/rfc2047.el
index 4aa0c28..5b08713 100644
--- a/lisp/mail/rfc2047.el
+++ b/lisp/mail/rfc2047.el
@@ -1,6 +1,6 @@
 ;;; rfc2047.el --- functions for encoding and decoding rfc2047 messages  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     MORIOKA Tomohiko <morioka@jaist.ac.jp>
diff --git a/lisp/mail/rfc2231.el b/lisp/mail/rfc2231.el
index 17da60e..6fb4502 100644
--- a/lisp/mail/rfc2231.el
+++ b/lisp/mail/rfc2231.el
@@ -1,6 +1,6 @@
 ;;; rfc2231.el --- Functions for decoding rfc2231 headers  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
diff --git a/lisp/mail/rfc2368.el b/lisp/mail/rfc2368.el
index afa3059..553f3cc 100644
--- a/lisp/mail/rfc2368.el
+++ b/lisp/mail/rfc2368.el
@@ -1,6 +1,6 @@
 ;;; rfc2368.el --- support for rfc2368  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Sen Nagata <sen@eccosys.com>
 ;; Keywords: mail
diff --git a/lisp/mail/rfc822.el b/lisp/mail/rfc822.el
index 70480d4..f07fcdf 100644
--- a/lisp/mail/rfc822.el
+++ b/lisp/mail/rfc822.el
@@ -1,6 +1,6 @@
 ;;; rfc822.el --- hairy RFC 822 (or later) parser for mail, news, etc.
 
-;; Copyright (C) 1986-1987, 1990, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1986-1987, 1990, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Richard Mlynarik <mly@eddie.mit.edu>
diff --git a/lisp/mail/rmail-spam-filter.el b/lisp/mail/rmail-spam-filter.el
index db51848..dda472e 100644
--- a/lisp/mail/rmail-spam-filter.el
+++ b/lisp/mail/rmail-spam-filter.el
@@ -1,6 +1,6 @@
 ;;; rmail-spam-filter.el --- spam filter for Rmail, the Emacs mail reader
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 ;; Keywords: email, spam, filter, rmail
 ;; Author: Eli Tziperman <eli AT deas.harvard.edu>
 ;; Package: rmail
@@ -214,6 +214,16 @@ the cdr is set to t.  Else, the car is set to nil."
           ;; rule means this cannot be spam.
           (setcar result nil)))))
 
+;; Don't spuriously advance to the next unseen message while
+;; prompting, because that causes it to then be missed while actually
+;; reading mail afterwards!  Call this instead of
+;; rmail-first-unseen-message.
+(defun rsf--rmail-last-seen-message ()
+  (max 1
+       ;; 'rmail-first-unseen-message' can return nil in a completely
+       ;; empty buffer.
+       (1- (or (rmail-first-unseen-message) 1))))
+
 (defun rmail-spam-filter (msg)
   "Return nil if message number MSG is spam based on `rsf-definitions-alist'.
 If spam, optionally output message to a file `rsf-file' and delete
@@ -327,8 +337,7 @@ it from rmail file.  Called for each new message retrieved 
by
       (if (and (car maybe-spam) (cdr maybe-spam))
           ;; Temporarily set rmail-current-message in order to output
           ;; and delete the spam msg if needed:
-          (let ((rmail-current-message msg) ; FIXME does this do anything?
-                (action (cdr (assq 'action
+          (let ((action (cdr (assq 'action
                                    (nth num-element rsf-definitions-alist))))
                 (newfile (not (file-exists-p rsf-file))))
             ;; Check action item in rsf-definitions-alist and do it.
@@ -337,7 +346,7 @@ it from rmail file.  Called for each new message retrieved 
by
               ;; Else the prompt to write a new file leaves the raw
               ;; mbox buffer visible.
               (and newfile
-                   (rmail-show-message (rmail-first-unseen-message) t))
+                   (rmail-show-message (rsf--rmail-last-seen-message) t))
               (rmail-output rsf-file)
               ;; Swap back, else rmail-get-new-mail-1 gets confused.
               (when newfile
@@ -377,7 +386,7 @@ This is called at the end of `rmail-get-new-mail-1' if 
there is new mail."
              (sleep-for rsf-sleep-after-message))
          (when (> nspam 0)
            ;; Otherwise sleep or expunge prompt leaves raw mbox buffer showing.
-           (rmail-show-message (or (rmail-first-unseen-message) 1) t)
+           (rmail-show-message (or (rsf--rmail-last-seen-message) 1) t)
            (unwind-protect
                (progn
                  (if rsf-beep (ding t))
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 63d992d..6979783 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1,6 +1,6 @@
 ;;; rmail.el --- main code of "RMAIL" mail reader for Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1985-1988, 1993-1998, 2000-2020 Free Software
+;; Copyright (C) 1985-1988, 1993-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -1080,6 +1080,7 @@ The buffer is expected to be narrowed to just the header 
of the message."
     (define-key map [?\S-\ ] 'scroll-down-command)
     (define-key map "\177"   'scroll-down-command)
     (define-key map "?"      'describe-mode)
+    (define-key map "\C-c\C-d" 'rmail-epa-decrypt)
     (define-key map "\C-c\C-s\C-d" 'rmail-sort-by-date)
     (define-key map "\C-c\C-s\C-s" 'rmail-sort-by-subject)
     (define-key map "\C-c\C-s\C-a" 'rmail-sort-by-author)
@@ -1272,6 +1273,7 @@ Instead, these commands are available:
 \\[rmail-undelete-previous-message]    Undelete message.  Tries current 
message, then earlier messages
        till a deleted message is found.
 \\[rmail-edit-current-message] Edit the current message.  \\[rmail-cease-edit] 
to return to Rmail.
+\\[rmail-epa-decrypt]  Decrypt the current message.
 \\[rmail-expunge]      Expunge deleted messages.
 \\[rmail-expunge-and-save]     Expunge and save the file.
 \\[rmail-quit]       Quit Rmail: expunge, save, then switch to another buffer.
@@ -4610,11 +4612,10 @@ Argument MIME is non-nil if this is a mime message."
                     "> ")
              (push (rmail-epa-decrypt-1 mime) decrypts))))
 
-      (when (and decrypts (eq major-mode 'rmail-mode))
-        (rmail-add-label "decrypt"))
-
       (when (and decrypts (rmail-buffers-swapped-p))
        (when (y-or-n-p "Replace the original message? ")
+          (when (eq major-mode 'rmail-mode)
+            (rmail-add-label "decrypt"))
          (setq decrypts (nreverse decrypts))
          (let ((beg (rmail-msgbeg rmail-current-message))
                (end (rmail-msgend rmail-current-message)))
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el
index 72a5603..2680ed7 100644
--- a/lisp/mail/rmailedit.el
+++ b/lisp/mail/rmailedit.el
@@ -1,6 +1,6 @@
 ;;; rmailedit.el --- "RMAIL edit mode"  Edit the current message
 
-;; Copyright (C) 1985, 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: mail
diff --git a/lisp/mail/rmailkwd.el b/lisp/mail/rmailkwd.el
index f5115ad..657b362 100644
--- a/lisp/mail/rmailkwd.el
+++ b/lisp/mail/rmailkwd.el
@@ -1,6 +1,6 @@
 ;;; rmailkwd.el --- part of the "RMAIL" mail reader for Emacs
 
-;; Copyright (C) 1985, 1988, 1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1985, 1988, 1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 29c6dcf..ab5b49a 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -1,6 +1,6 @@
 ;;; rmailmm.el --- MIME decoding and display stuff for RMAIL
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Alexander Pohoyda
 ;;     Alex Schroeder
diff --git a/lisp/mail/rmailmsc.el b/lisp/mail/rmailmsc.el
index 204f33d..ef5f3c3 100644
--- a/lisp/mail/rmailmsc.el
+++ b/lisp/mail/rmailmsc.el
@@ -1,6 +1,6 @@
 ;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader
 
-;; Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: mail
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index cfde335..9305a48 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -1,6 +1,6 @@
 ;;; rmailout.el --- "RMAIL" mail reader for Emacs: output message to a file
 
-;; Copyright (C) 1985, 1987, 1993-1994, 2001-2020 Free Software
+;; Copyright (C) 1985, 1987, 1993-1994, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mail/rmailsort.el b/lisp/mail/rmailsort.el
index c2749be..2c42e6c 100644
--- a/lisp/mail/rmailsort.el
+++ b/lisp/mail/rmailsort.el
@@ -1,6 +1,6 @@
 ;;; rmailsort.el --- Rmail: sort messages
 
-;; Copyright (C) 1990, 1993-1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1990, 1993-1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Masanobu UMEDA <umerin@mse.kyutech.ac.jp>
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index a085e0b..60b67ed 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -1,6 +1,6 @@
 ;;; rmailsum.el --- make summary buffers for the mail reader  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1985, 1993-1996, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1985, 1993-1996, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -121,6 +121,7 @@ Setting this option to nil might speed up the generation of 
summaries."
     (define-key map [?\S-\ ] 'rmail-summary-scroll-msg-down)
     (define-key map "\177"   'rmail-summary-scroll-msg-down)
     (define-key map "?"      'describe-mode)
+    (define-key map "\C-c\C-d"      'rmail-summary-epa-decrypt)
     (define-key map "\C-c\C-n" 'rmail-summary-next-same-subject)
     (define-key map "\C-c\C-p" 'rmail-summary-previous-same-subject)
     (define-key map "\C-c\C-s\C-d" 'rmail-summary-sort-by-date)
@@ -785,6 +786,11 @@ the message being processed."
                 ;; To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= 
=?UTF-8?Q?N=C4=9Bmec?=
                 ;; <stepnem@gmail.com>
                 (setq from (rfc2047-decode-string from))
+                 ;; We cannot tolerate any leftover newlines in From,
+                 ;; as that disrupts the rmail-summary display.
+                 ;; Newlines can be left in From if it was malformed,
+                 ;; e.g. had unbalanced quotes.
+                 (setq from (replace-regexp-in-string "\n+" " " from))
                 (setq len (length from))
                 (setq mch (string-match "[@%]" from))
                 (format "%25s"
@@ -1482,6 +1488,12 @@ argument says to read a file name and use that file as 
the inbox."
   (rmail-edit-current-message)
   (use-local-map rmail-summary-edit-map))
 
+(defun rmail-summary-epa-decrypt ()
+  "Decrypt this message."
+  (interactive)
+  (rmail-pop-to-buffer rmail-buffer)
+  (rmail-epa-decrypt))
+
 (defun rmail-summary-cease-edit ()
   "Finish editing message, then go back to Rmail summary buffer."
   (interactive)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 02a852f..9f6fd6d 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1,6 +1,6 @@
 ;;; sendmail.el --- mail sending commands for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1992-1996, 1998, 2000-2020 Free Software
+;; Copyright (C) 1985-1986, 1992-1996, 1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 63c8f14..5526f2f 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -1,6 +1,6 @@
 ;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1995-1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el
index 9b7af01..5766c79 100644
--- a/lisp/mail/supercite.el
+++ b/lisp/mail/supercite.el
@@ -1,6 +1,6 @@
 ;;; supercite.el --- minor mode for citing mail and news replies
 
-;; Copyright (C) 1993, 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: 1993 Barry A. Warsaw <bwarsaw@python.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mail/uce.el b/lisp/mail/uce.el
index 2a1e4f3..a573c8a 100644
--- a/lisp/mail/uce.el
+++ b/lisp/mail/uce.el
@@ -1,6 +1,6 @@
 ;;; uce.el --- facilitate reply to unsolicited commercial email
 
-;; Copyright (C) 1996, 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: stanislav shalunov <shalunov@mccme.ru>
 ;; Created: 10 Dec 1996
diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el
index 9ac5f35..bf57ed6 100644
--- a/lisp/mail/undigest.el
+++ b/lisp/mail/undigest.el
@@ -1,6 +1,6 @@
 ;;; undigest.el --- digest-cracking support for the RMAIL mail reader  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1994, 1996, 2001-2020 Free Software
+;; Copyright (C) 1985-1986, 1994, 1996, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el
index e1f1378..34de416 100644
--- a/lisp/mail/unrmail.el
+++ b/lisp/mail/unrmail.el
@@ -1,6 +1,6 @@
 ;;; unrmail.el --- convert Rmail Babyl files to mbox files
 
-;; Copyright (C) 1992, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: mail
diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el
index 0dce9b7..fdd402e 100644
--- a/lisp/mail/uudecode.el
+++ b/lisp/mail/uudecode.el
@@ -1,6 +1,6 @@
 ;;; uudecode.el -- elisp native uudecode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: uudecode news
diff --git a/lisp/mail/yenc.el b/lisp/mail/yenc.el
index 58e2965..0ab6d85 100644
--- a/lisp/mail/yenc.el
+++ b/lisp/mail/yenc.el
@@ -1,6 +1,6 @@
 ;;; yenc.el --- elisp native yenc decoder  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Jesper Harder <harder@ifa.au.dk>
 ;; Keywords: yenc news
diff --git a/lisp/makesum.el b/lisp/makesum.el
index 673cb15..a7e88db 100644
--- a/lisp/makesum.el
+++ b/lisp/makesum.el
@@ -1,6 +1,6 @@
 ;;; makesum.el --- generate key binding summary for Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: help
diff --git a/lisp/man.el b/lisp/man.el
index 991b1bb..ca50b3a 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1,6 +1,6 @@
 ;;; man.el --- browse UNIX manual pages -*- lexical-binding: t -*-
 
-;; Copyright (C) 1993-1994, 1996-1997, 2001-2020 Free Software
+;; Copyright (C) 1993-1994, 1996-1997, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Barry A. Warsaw <bwarsaw@cen.com>
@@ -1583,10 +1583,10 @@ The following key bindings are currently in effect in 
the buffer:
   (auto-fill-mode -1)
   (setq imenu-generic-expression (list (list nil Man-heading-regexp 0)))
   (imenu-add-to-menubar man-imenu-title)
-  (set (make-local-variable 'outline-regexp) Man-heading-regexp)
-  (set (make-local-variable 'outline-level) (lambda () 1))
-  (set (make-local-variable 'bookmark-make-record-function)
-       'Man-bookmark-make-record)
+  (setq-local outline-regexp Man-heading-regexp)
+  (setq-local outline-level (lambda () 1))
+  (setq-local bookmark-make-record-function
+              #'Man-bookmark-make-record)
   (add-hook 'window-state-change-functions #'Man--window-state-change nil t))
 
 (defun Man-build-section-list ()
diff --git a/lisp/master.el b/lisp/master.el
index 32556a5..796f218 100644
--- a/lisp/master.el
+++ b/lisp/master.el
@@ -1,6 +1,6 @@
 ;;; master.el --- make a buffer the master over another buffer
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Old-Version: 1.0.2
@@ -96,8 +96,7 @@ yourself the value of `master-of' by calling 
`master-show-slave'."
   "Makes BUFFER the slave of the current buffer.
 Use \\[master-mode] to toggle control of the slave buffer."
   (interactive "bSlave: ")
-  (make-local-variable 'master-of)
-  (setq master-of buffer)
+  (setq-local master-of buffer)
   (run-hooks 'master-set-slave-hook))
 
 (defun master-show-slave ()
diff --git a/lisp/mb-depth.el b/lisp/mb-depth.el
index 7ee7525..06da073 100644
--- a/lisp/mb-depth.el
+++ b/lisp/mb-depth.el
@@ -1,6 +1,6 @@
 ;;; mb-depth.el --- Indicate minibuffer-depth in prompt -*- lexical-binding: t 
-*-
 ;;
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Miles Bader <miles@gnu.org>
 ;; Keywords: convenience
diff --git a/lisp/md4.el b/lisp/md4.el
index 11c9130..771d9f9 100644
--- a/lisp/md4.el
+++ b/lisp/md4.el
@@ -1,6 +1,6 @@
 ;;; md4.el --- MD4 Message Digest Algorithm. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2001, 2004, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2004, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Taro Kawagishi <tarok@transpulse.org>
 ;; Keywords: MD4
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index c6ced68..c4eae68 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1,6 +1,6 @@
 ;;; menu-bar.el --- define a default menu bar
 
-;; Copyright (C) 1993-1995, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Richard M. Stallman
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mh-e/ChangeLog.1 b/lisp/mh-e/ChangeLog.1
index d30441f..f1aeca6 100644
--- a/lisp/mh-e/ChangeLog.1
+++ b/lisp/mh-e/ChangeLog.1
@@ -11419,7 +11419,7 @@
        (dist): Leave release in current directory.
 
 
-  Copyright (C) 2003-2020 Free Software Foundation, Inc.
+  Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/mh-e/ChangeLog.2 b/lisp/mh-e/ChangeLog.2
index 02a0c07..b6b16f7 100644
--- a/lisp/mh-e/ChangeLog.2
+++ b/lisp/mh-e/ChangeLog.2
@@ -3673,7 +3673,7 @@
 
 See ChangeLog.1 for earlier changes.
 
-  Copyright (C) 2005-2020 Free Software Foundation, Inc.
+  Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index 8e610ec..af6f2f1 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -1,6 +1,6 @@
 ;;; mh-acros.el --- macros used in MH-E
 
-;; Copyright (C) 2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index d037bdc..012725c 100644
--- a/lisp/mh-e/mh-alias.el
+++ b/lisp/mh-e/mh-alias.el
@@ -1,6 +1,6 @@
 ;;; mh-alias.el --- MH-E mail alias completion and expansion
 
-;; Copyright (C) 1994-1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Peter S. Galbraith <psg@debian.org>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-buffers.el b/lisp/mh-e/mh-buffers.el
index f1334b8..55f74b6 100644
--- a/lisp/mh-e/mh-buffers.el
+++ b/lisp/mh-e/mh-buffers.el
@@ -1,6 +1,6 @@
 ;;; mh-buffers.el --- MH-E buffer constants and utilities
 
-;; Copyright (C) 1993, 1995, 1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index e766bca..0dedb7e 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -1,6 +1,6 @@
 ;;; mh-comp.el --- MH-E functions for composing and sending messages
 
-;; Copyright (C) 1993, 1995, 1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index c02b095..07bf03b 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -1,6 +1,6 @@
 ;;; mh-compat.el --- make MH-E compatible with various versions of Emacs
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Keywords: mail
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 3ac5c8f..9185c2a 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -1,6 +1,6 @@
 ;;; mh-e.el --- GNU Emacs interface to the MH mail system
 
-;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2020 Free
+;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
@@ -3182,7 +3182,7 @@ folder, which is also available in `mh-current-folder'."
   :package-version '(MH-E . "8.0"))
 
 (defcustom-mh mh-annotate-msg-hook nil
-  "Hook run whenever a message is sent and after the scan lines and message 
are annotated.
+  "Hook run when a message is sent and after annotating the scan lines and 
message.
 Hook functions can access the current folder name with
 `mh-current-folder' and obtain the message numbers of the
 annotated messages with `mh-annotate-list'."
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index 0fb5ebf..555d13d 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -1,6 +1,6 @@
 ;;; mh-folder.el --- MH-Folder mode
 
-;; Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Keywords: mail
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index 66cea01..309bcb4 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -1,6 +1,6 @@
 ;;; mh-funcs.el --- MH-E functions not everyone will use right away
 
-;; Copyright (C) 1993, 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Keywords: mail
diff --git a/lisp/mh-e/mh-gnus.el b/lisp/mh-e/mh-gnus.el
index 12a0f62..6a98516 100644
--- a/lisp/mh-e/mh-gnus.el
+++ b/lisp/mh-e/mh-gnus.el
@@ -1,6 +1,6 @@
 ;;; mh-gnus.el --- make MH-E compatible with various versions of Gnus
 
-;; Copyright (C) 2003-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el
index 23fa87d..1844399 100644
--- a/lisp/mh-e/mh-identity.el
+++ b/lisp/mh-e/mh-identity.el
@@ -1,6 +1,6 @@
 ;;; mh-identity.el --- multiple identify support for MH-E
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Peter S. Galbraith <psg@debian.org>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-inc.el b/lisp/mh-e/mh-inc.el
index bff99b7..32f7317 100644
--- a/lisp/mh-e/mh-inc.el
+++ b/lisp/mh-e/mh-inc.el
@@ -1,6 +1,6 @@
 ;;; mh-inc.el --- MH-E "inc" and separate mail spool handling
 
-;; Copyright (C) 2003-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Peter S. Galbraith <psg@debian.org>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-junk.el b/lisp/mh-e/mh-junk.el
index ebc5038..b49c632 100644
--- a/lisp/mh-e/mh-junk.el
+++ b/lisp/mh-e/mh-junk.el
@@ -1,6 +1,6 @@
 ;;; mh-junk.el --- MH-E interface to anti-spam measures
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>,
 ;;         Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index b8aca77..f5ad73d 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -1,6 +1,6 @@
 ;;; mh-letter.el --- MH-Letter mode
 
-;; Copyright (C) 1993, 1995, 1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-limit.el b/lisp/mh-e/mh-limit.el
index d457780..036522f 100644
--- a/lisp/mh-e/mh-limit.el
+++ b/lisp/mh-e/mh-limit.el
@@ -1,6 +1,6 @@
 ;;; mh-limit.el --- MH-E display limits
 
-;; Copyright (C) 2001-2003, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2003, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Peter S. Galbraith <psg@debian.org>
 ;; Keywords: mail
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index dc9d17a..7bdf743f 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -1,6 +1,6 @@
 ;;; mh-mime.el --- MH-E MIME support
 
-;; Copyright (C) 1993, 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Keywords: mail
diff --git a/lisp/mh-e/mh-print.el b/lisp/mh-e/mh-print.el
index 7779ec0..513a1bc 100644
--- a/lisp/mh-e/mh-print.el
+++ b/lisp/mh-e/mh-print.el
@@ -1,6 +1,6 @@
 ;;; mh-print.el --- MH-E printing support
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Jeffrey C Honig <jch@honig.net>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-scan.el b/lisp/mh-e/mh-scan.el
index a0addcb..cec3313 100644
--- a/lisp/mh-e/mh-scan.el
+++ b/lisp/mh-e/mh-scan.el
@@ -1,6 +1,6 @@
 ;;; mh-scan.el --- MH-E scan line constants and utilities
 
-;; Copyright (C) 1993, 1995, 1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
index 5cfe678..05ba12d 100644
--- a/lisp/mh-e/mh-search.el
+++ b/lisp/mh-e/mh-search.el
@@ -1,6 +1,6 @@
 ;;; mh-search  ---  MH-Search mode
 
-;; Copyright (C) 1993, 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Indexed search by Satyaki Das <satyaki@theforce.stanford.edu>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index a8fb46d..e8a03f6 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -1,6 +1,6 @@
 ;;; mh-seq.el --- MH-E sequences support
 
-;; Copyright (C) 1993, 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Keywords: mail
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index 48ff741..9ad843c 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -1,6 +1,6 @@
 ;;; mh-show.el --- MH-Show mode
 
-;; Copyright (C) 1993, 1995, 1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el
index 0732a16..35d5884 100644
--- a/lisp/mh-e/mh-speed.el
+++ b/lisp/mh-e/mh-speed.el
@@ -1,6 +1,6 @@
 ;;; mh-speed.el --- MH-E speedbar support
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el
index e6ee87b..3657462 100644
--- a/lisp/mh-e/mh-thread.el
+++ b/lisp/mh-e/mh-thread.el
@@ -1,6 +1,6 @@
 ;;; mh-thread.el --- MH-E threading support
 
-;; Copyright (C) 2002-2004, 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-tool-bar.el b/lisp/mh-e/mh-tool-bar.el
index b1e4177..7dbddbc 100644
--- a/lisp/mh-e/mh-tool-bar.el
+++ b/lisp/mh-e/mh-tool-bar.el
@@ -1,6 +1,6 @@
 ;;; mh-tool-bar.el --- MH-E tool bar support
 
-;; Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index 28d3c76..d7c607d 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -1,6 +1,6 @@
 ;;; mh-utils.el --- MH-E general utilities
 
-;; Copyright (C) 1993, 1995, 1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el
index 909f1fe..036575a 100644
--- a/lisp/mh-e/mh-xface.el
+++ b/lisp/mh-e/mh-xface.el
@@ -1,6 +1,6 @@
 ;;; mh-xface.el --- MH-E X-Face and Face header field display
 
-;; Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Keywords: mail
@@ -425,8 +425,7 @@ After the image is fetched, it is stored in CACHE-FILE. It 
will
 be displayed in a buffer and position specified by MARKER. The
 actual display is carried out by the SENTINEL function."
   (if mh-wget-executable
-      (let ((buffer (get-buffer-create (generate-new-buffer-name
-                                        mh-temp-fetch-buffer)))
+      (let ((buffer (generate-new-buffer mh-temp-fetch-buffer))
             (filename (or (mh-funcall-if-exists make-temp-file "mhe-fetch")
                           (expand-file-name (make-temp-name "~/mhe-fetch")))))
         (with-current-buffer buffer
diff --git a/lisp/midnight.el b/lisp/midnight.el
index 69e6f0c..8b79892 100644
--- a/lisp/midnight.el
+++ b/lisp/midnight.el
@@ -1,6 +1,6 @@
 ;;; midnight.el --- run something every midnight, e.g., kill old buffers  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Sam Steingold <sds@gnu.org>
 ;; Created: 1998-05-18
diff --git a/lisp/minibuf-eldef.el b/lisp/minibuf-eldef.el
index 363899d..30273fa 100644
--- a/lisp/minibuf-eldef.el
+++ b/lisp/minibuf-eldef.el
@@ -1,6 +1,6 @@
 ;;; minibuf-eldef.el --- Only show defaults in prompts when applicable  -*- 
lexical-binding: t -*-
 ;;
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Miles Bader <miles@gnu.org>
 ;; Keywords: convenience
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index d44d896..556f5d3 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1,6 +1,6 @@
 ;;; minibuffer.el --- Minibuffer completion functions -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Package: emacs
@@ -123,7 +123,8 @@ This metadata is an alist.  Currently understood keys are:
 - `affixation-function': function to prepend/append a prefix/suffix to
    entries.  Takes one argument (COMPLETIONS) and should return a list
    of completions with a list of three elements: completion, its prefix
-   and suffix.
+   and suffix.  This function takes priority over `annotation-function'
+   when both are provided, so only this function is used.
 - `display-sort-function': function to sort entries in *Completions*.
    Takes one argument (COMPLETIONS) and should return a new list
    of completions.  Can operate destructively.
@@ -955,6 +956,7 @@ styles for specific categories, such as files, buffers, 
etc."
     ;; A new style that combines substring and pcm might be better,
     ;; e.g. one that does not anchor to bos.
     (project-file (styles . (substring)))
+    (xref-location (styles . (substring)))
     (info-menu (styles . (basic substring))))
   "Default settings for specific completion categories.
 Each entry has the shape (CATEGORY . ALIST) where ALIST is
@@ -1926,6 +1928,8 @@ These include:
    completions.  The function must accept one argument, a list of
    completions, and return a list where each element is a list of
    three elements: a completion, a prefix and a suffix.
+   This function takes priority over `:annotation-function'
+   when both are provided, so only this function is used.
 
 `:exit-function': Function to run after completion is performed.
 
@@ -2056,25 +2060,26 @@ variables.")
                               (if sort-fun
                                   (funcall sort-fun completions)
                                 (sort completions 'string-lessp))))
-                      (when ann-fun
+                      (cond
+                       (aff-fun
+                        (setq completions
+                              (funcall aff-fun completions)))
+                       (ann-fun
                         (setq completions
                               (mapcar (lambda (s)
                                         (let ((ann (funcall ann-fun s)))
                                           (if ann (list s ann) s)))
-                                      completions)))
-                      (when aff-fun
-                        (setq completions
-                              (funcall aff-fun completions)))
+                                      completions))))
 
                       (with-current-buffer standard-output
-                        (set (make-local-variable 'completion-base-position)
+                        (setq-local completion-base-position
                              (list (+ start base-size)
                                    ;; FIXME: We should pay attention to 
completion
                                    ;; boundaries here, but currently
                                    ;; completion-all-completions does not give 
us the
                                    ;; necessary information.
                                    end))
-                        (set (make-local-variable 
'completion-list-insert-choice-function)
+                        (setq-local completion-list-insert-choice-function
                              (let ((ctable minibuffer-completion-table)
                                    (cpred minibuffer-completion-predicate)
                                    (cprops completion-extra-properties))
@@ -2866,7 +2871,7 @@ See `read-file-name' for the meaning of the arguments."
                           ;; On the first request on `M-n' fill
                           ;; `minibuffer-default' with a list of defaults
                           ;; relevant for file-name reading.
-                          (set (make-local-variable 
'minibuffer-default-add-function)
+                          (setq-local minibuffer-default-add-function
                                (lambda ()
                                  (with-current-buffer
                                      (window-buffer 
(minibuffer-selected-window))
@@ -3155,7 +3160,8 @@ or a symbol, see `completion-pcm--merge-completions'."
   (let ((n '()))
     (while p
       (pcase p
-        (`(,(or 'any 'any-delim) point . ,rest) (setq p `(point . ,rest)))
+        (`(,(or 'any 'any-delim) ,(or 'any 'point) . ,rest)
+         (setq p (cdr p)))
         ;; This is not just a performance improvement: it turns a
         ;; terminating `point' into an implicit `any', which affects
         ;; the final position of point (because `point' gets turned
@@ -3240,6 +3246,13 @@ than the latter (which has two \"holes\" and three
 one-letter-long matches).")
 
 (defun completion-pcm--hilit-commonality (pattern completions)
+  "Show where and how well PATTERN matches COMPLETIONS.
+PATTERN, a list of symbols and strings as seen
+`completion-pcm--merge-completions', is assumed to match every
+string in COMPLETIONS.  Return a deep copy of COMPLETIONS where
+each string is propertized with `completion-score', a number
+between 0 and 1, and with faces `completions-common-part',
+`completions-first-difference' in the relevant segments."
   (when completions
     (let* ((re (completion-pcm--pattern->regex pattern 'group))
            (point-idx (completion-pcm--pattern-point-idx pattern))
@@ -3251,12 +3264,12 @@ one-letter-long matches).")
          (unless (string-match re str)
            (error "Internal error: %s does not match %s" re str))
          (let* ((pos (if point-idx (match-beginning point-idx) (match-end 0)))
-                (md (match-data))
-                (start (pop md))
-                (end (pop md))
-                (len (length str))
-                ;; To understand how this works, consider these bad
-                ;; ascii(tm) diagrams showing how the pattern "foo"
+                (match-end (match-end 0))
+                (md (cddr (match-data)))
+                (from 0)
+                (end (length str))
+                ;; To understand how this works, consider these simple
+                ;; ascii diagrams showing how the pattern "foo"
                 ;; flex-matches "fabrobazo", "fbarbazoo" and
                 ;; "barfoobaz":
 
@@ -3292,9 +3305,12 @@ one-letter-long matches).")
                 (score-numerator 0)
                 (score-denominator 0)
                 (last-b 0)
-                (update-score
+                (update-score-and-face
                  (lambda (a b)
-                   "Update score variables given match range (A B)."
+                   "Update score and face given match range (A B)."
+                   (add-face-text-property a b
+                                           'completions-common-part
+                                           nil str)
                    (setq
                     score-numerator   (+ score-numerator (- b a)))
                    (unless (or (= a last-b)
@@ -3308,19 +3324,15 @@ one-letter-long matches).")
                                                     
flex-score-match-tightness)))))
                    (setq
                     last-b              b))))
-           (funcall update-score start start)
            (while md
-             (funcall update-score start (car md))
-             (add-face-text-property
-              start (pop md)
-              'completions-common-part
-              nil str)
-             (setq start (pop md)))
-           (funcall update-score len len)
-           (add-face-text-property
-            start end
-            'completions-common-part
-            nil str)
+             (funcall update-score-and-face from (pop md))
+             (setq from (pop md)))
+           ;; If `pattern' doesn't have an explicit trailing any, the
+           ;; regex `re' won't produce match data representing the
+           ;; region after the match.  We need to account to account
+           ;; for that extra bit of match (bug#42149).
+           (unless (= from match-end)
+             (funcall update-score-and-face from match-end))
            (if (> (length str) pos)
                (add-face-text-property
                 pos (1+ pos)
@@ -3329,7 +3341,7 @@ one-letter-long matches).")
            (unless (zerop (length str))
              (put-text-property
               0 1 'completion-score
-              (/ score-numerator (* len (1+ score-denominator)) 1.0) str)))
+              (/ score-numerator (* end (1+ score-denominator)) 1.0) str)))
          str)
        completions))))
 
diff --git a/lisp/misc.el b/lisp/misc.el
index 0339578..09f6011 100644
--- a/lisp/misc.el
+++ b/lisp/misc.el
@@ -1,6 +1,6 @@
 ;;; misc.el --- some nonstandard editing and utility commands for Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1989, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: convenience
diff --git a/lisp/misearch.el b/lisp/misearch.el
index 6ec10fe..668c711 100644
--- a/lisp/misearch.el
+++ b/lisp/misearch.el
@@ -1,6 +1,6 @@
 ;;; misearch.el --- isearch extensions for multi-buffer search
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Juri Linkov <juri@jurta.org>
 ;; Keywords: matching
diff --git a/lisp/mouse-copy.el b/lisp/mouse-copy.el
index a650bd6..e48722e 100644
--- a/lisp/mouse-copy.el
+++ b/lisp/mouse-copy.el
@@ -1,6 +1,6 @@
 ;;; mouse-copy.el --- one-click text copy and move
 
-;; Copyright (C) 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: John Heidemann <johnh@ISI.EDU>
 ;; Keywords: mouse
diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el
index e80ebba..f661260 100644
--- a/lisp/mouse-drag.el
+++ b/lisp/mouse-drag.el
@@ -1,6 +1,6 @@
 ;;; mouse-drag.el --- use mouse-2 to do a new style of scrolling
 
-;; Copyright (C) 1996-1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: John Heidemann <johnh@ISI.EDU>
 ;; Keywords: mouse
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 9d4492f..0da8288 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1,6 +1,6 @@
 ;;; mouse.el --- window system-independent mouse support  -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 1993-1995, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 1999-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: hardware, mouse
diff --git a/lisp/mpc.el b/lisp/mpc.el
index fade23e..827f8aa 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -1,6 +1,6 @@
 ;;; mpc.el --- A client for the Music Player Daemon   -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: multimedia
diff --git a/lisp/msb.el b/lisp/msb.el
index 15aeaa2..14209d9 100644
--- a/lisp/msb.el
+++ b/lisp/msb.el
@@ -1,6 +1,6 @@
 ;;; msb.el --- customizable buffer-selection with multiple menus
 
-;; Copyright (C) 1993-1995, 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Lindberg <lars.lindberg@home.se>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index 9fd050f..adfeacc 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -1,6 +1,6 @@
 ;;; mwheel.el --- Mouse wheel support  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc.
 ;; Keywords: mouse
 ;; Package: emacs
 
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index c627e1a..9559b12 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -1,6 +1,6 @@
 ;;; ange-ftp.el --- transparent FTP support for GNU Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1989-1996, 1998, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1989-1996, 1998, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Andy Norman (ange@hplb.hpl.hp.com)
@@ -1080,7 +1080,7 @@ All HOST values should be in lower case.")
 (defvar ange-ftp-trample-marker)
 
 ;; New error symbols.
-(define-error 'ftp-error nil 'file-error) ;"FTP error"
+(define-error 'ftp-error nil '(remote-file-error file-error)) ;"FTP error"
 
 ;;; ------------------------------------------------------------
 ;;; Enhanced message support.
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 8b245b0..7b72a71 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -1,6 +1,6 @@
 ;;; browse-url.el --- pass a URL to a WWW browser  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Denis Howe <dbh@doc.ic.ac.uk>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index 8b40808..7a7bbef 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -1,6 +1,6 @@
 ;;; dbus.el --- Elisp bindings for D-Bus. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, hardware
diff --git a/lisp/net/dictionary-connection.el 
b/lisp/net/dictionary-connection.el
new file mode 100644
index 0000000..d88c0b4
--- /dev/null
+++ b/lisp/net/dictionary-connection.el
@@ -0,0 +1,155 @@
+;;; dictionary-connection.el --- TCP-based client connection for dictionary  
-*- lexical-binding:t -*-
+
+;; Author: Torsten Hilbrich <torsten.hilbrich@gmx.net>
+;; Keywords: network
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; dictionary-connection allows to handle TCP-based connections in
+;; client mode where text-based information are exchanged. There is
+;; special support for handling CR LF (and the usual CR LF . CR LF
+;; terminater).
+
+;;; Code:
+
+(defsubst dictionary-connection-p (connection)
+  "Returns non-nil if CONNECTION is a connection object."
+  (get connection 'connection))
+
+(defsubst dictionary-connection-read-point (connection)
+  "Return the read point of the CONNECTION object."
+  (get connection 'dictionary-connection-read-point))
+
+(defsubst dictionary-connection-process (connection)
+  "Return the process of the CONNECTION object."
+  (get connection 'dictionary-connection-process))
+
+(defsubst dictionary-connection-buffer (connection)
+  "Return the buffer of the CONNECTION object."
+  (get connection 'dictionary-connection-buffer))
+
+(defsubst dictionary-connection-set-read-point (connection point)
+  "Set the read-point for CONNECTION to POINT."
+  (put connection 'dictionary-connection-read-point point))
+
+(defsubst dictionary-connection-set-process (connection process)
+  "Set the process for CONNECTION to PROCESS."
+  (put connection 'dictionary-connection-process process))
+
+(defsubst dictionary-connection-set-buffer (connection buffer)
+  "Set the buffer for CONNECTION to BUFFER."
+  (put connection 'dictionary-connection-buffer buffer))
+
+(defun dictionary-connection-create-data (buffer process point)
+  "Create a new connection data based on BUFFER, PROCESS, and POINT."
+  (let ((connection (make-symbol "connection")))
+    (put connection 'connection t)
+    (dictionary-connection-set-read-point connection point)
+    (dictionary-connection-set-process connection process)
+    (dictionary-connection-set-buffer connection buffer)
+    connection))
+
+(defun dictionary-connection-open (server port)
+  "Open a connection to SERVER at PORT.
+A data structure identifing the connection is returned"
+
+  (let ((process-buffer (generate-new-buffer (format " connection to %s:%s"
+                                                    server
+                                                    port)))
+       (process))
+    (with-current-buffer process-buffer
+      (setq process (open-network-stream "connection" process-buffer
+                                        server port))
+      (dictionary-connection-create-data process-buffer process (point-min)))))
+
+(defun dictionary-connection-status (connection)
+  "Return the status of the CONNECTION.
+Possible return values are the symbols:
+nil: argument is no connection object
+'none: argument has no connection
+'up: connection is open and buffer is existing
+'down: connection is closed
+'alone: connection is not associated with a buffer"
+  (when (dictionary-connection-p connection)
+    (let ((process (dictionary-connection-process connection))
+          (buffer (dictionary-connection-buffer connection)))
+      (if (not process)
+          'none
+        (if (not (buffer-live-p buffer))
+            'alone
+          (if (not (eq (process-status process) 'open))
+              'down
+            'up))))))
+
+(defun dictionary-connection-close (connection)
+  "Force closing of the CONNECTION."
+  (when (dictionary-connection-p connection)
+    (let ((buffer (dictionary-connection-buffer connection))
+          (process (dictionary-connection-process connection)))
+      (if process
+          (delete-process process))
+      (if buffer
+          (kill-buffer buffer))
+
+      (dictionary-connection-set-process connection nil)
+      (dictionary-connection-set-buffer connection nil))))
+
+(defun dictionary-connection-send (connection data)
+  "Send DATA to the process stored in CONNECTION."
+  (unless (eq (dictionary-connection-status connection) 'up)
+    (error "Connection is not up"))
+  (with-current-buffer (dictionary-connection-buffer connection)
+    (goto-char (point-max))
+    (dictionary-connection-set-read-point connection (point))
+    (process-send-string (dictionary-connection-process connection) data)))
+
+(defun dictionary-connection-send-crlf (connection data)
+  "Send DATA together with CRLF to the process found in CONNECTION."
+  (dictionary-connection-send connection (concat data "\r\n")))
+
+(defun dictionary-connection-read (connection delimiter)
+  "Read data from CONNECTION until DELIMITER is found inside the buffer."
+  (unless (eq (dictionary-connection-status connection) 'up)
+    (error "Connection is not up"))
+  (let ((case-fold-search nil)
+       match-end)
+    (with-current-buffer (dictionary-connection-buffer connection)
+      (goto-char (dictionary-connection-read-point connection))
+      ;; Wait until there is enough data
+      (while (not (search-forward-regexp delimiter nil t))
+       (accept-process-output (dictionary-connection-process connection) 3)
+       (goto-char (dictionary-connection-read-point connection)))
+      (setq match-end (point))
+      ;; Return the result
+      (let ((result (buffer-substring (dictionary-connection-read-point 
connection)
+                                     match-end)))
+       (dictionary-connection-set-read-point connection match-end)
+       result))))
+
+(defun dictionary-connection-read-crlf (connection)
+  "Read from CONNECTION until a line is completed with CRLF."
+  (dictionary-connection-read connection "\015?\012"))
+
+(defun dictionary-connection-read-to-point (connection)
+  "Read from CONNECTION until an end of entry is encountered.
+End of entry is a decimal point found on a line by itself.
+"
+  (dictionary-connection-read connection "\015?\012[.]\015?\012"))
+
+(provide 'dictionary-connection)
+;;; dictionary-connection.el ends here
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
new file mode 100644
index 0000000..f873342
--- /dev/null
+++ b/lisp/net/dictionary.el
@@ -0,0 +1,1355 @@
+;;; dictionary.el --- Client for rfc2229 dictionary servers  -*- 
lexical-binding:t -*-
+
+;; Author: Torsten Hilbrich <torsten.hilbrich@gmx.net>
+;; Keywords: interface, dictionary
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; dictionary allows you to interact with dictionary servers.
+;; Use M-x customize-group dictionary to modify user settings.
+;;
+;; Main functions for interaction are:
+;; dictionary        - opens a new dictionary buffer
+;; dictionary-search - search for the definition of a word
+;;
+;; You can find more information in the README file of the GitHub
+;; repository https://github.com/myrkr/dictionary-el
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'easymenu)
+(require 'custom)
+(require 'dictionary-connection)
+(require 'button)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Stuff for customizing.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar dictionary-current-server)
+(defun dictionary-set-server-var (name value)
+  "Customize helper for setting variable NAME to VALUE.
+The helper is used by customize to check for an active connection
+when setting a variable. The user has then the choice to close
+the existing connection."
+  (if (and (boundp 'dictionary-connection)
+          dictionary-connection
+          (eq (dictionary-connection-status dictionary-connection) 'up)
+          (y-or-n-p
+           (concat "Close existing connection to " dictionary-current-server 
"? ")))
+      (dictionary-connection-close dictionary-connection))
+  (set-default name value))
+
+(defgroup dictionary nil
+  "Client for accessing the dictd server based dictionaries"
+  :group 'hypermedia)
+
+(defgroup dictionary-proxy nil
+  "Proxy configuration options for the dictionary client"
+  :group 'dictionary)
+
+(defcustom dictionary-server
+  nil
+  "This server is contacted for searching the dictionary.
+
+You can specify here:
+
+- Automatic: First try localhost, then dict.org after confirmation
+- localhost: Only use localhost
+- dict.org: Only use dict.org
+- User-defined: You can specify your own server here
+"
+  :group 'dictionary
+  :set 'dictionary-set-server-var
+  :type '(choice (const :tag "Automatic" nil)
+                 (const :tag "localhost" "localhost")
+                 (const :tag "dict.org" "dict.org")
+                 (string :tag "User-defined"))
+  :version "28.1")
+
+(defcustom dictionary-port
+  2628
+  "The port of the dictionary server.
+ This port is propably always 2628 so there should be no need to modify it."
+  :group 'dictionary
+  :set 'dictionary-set-server-var
+  :type 'number
+  :version "28.1")
+
+(defcustom dictionary-identification
+  "dictionary.el emacs lisp dictionary client"
+  "This is the identification string that will be sent to the server."
+  :group 'dictionary
+  :type 'string
+  :version "28.1")
+
+(defcustom dictionary-default-dictionary
+  "*"
+  "The dictionary which is used for searching definitions and matching.
+ * and ! have a special meaning, * search all dictionaries, ! search until
+ one dictionary yields matches."
+  :group 'dictionary
+  :type 'string
+  :version "28.1")
+
+(defcustom dictionary-default-strategy
+  "."
+  "The default strategy for listing matching words."
+  :group 'dictionary
+  :type 'string
+  :version "28.1")
+
+(defcustom dictionary-default-popup-strategy
+  "exact"
+  "The default strategy for listing matching words within a popup window.
+
+The following algorithm (defined by the dictd server) are supported
+by the choice value:
+
+- Exact match
+
+  The found word exactly matches the searched word.
+
+- Similiar sounding
+
+  The found word sounds similiar to the searched word.  For this match type
+  the soundex algorithm defined by Donald E. Knuth is used.  It will only
+  works with english words and the algorithm is not very reliable (i.e.,
+  the soundex algorithm is quite simple).
+
+- Levenshtein distance one
+
+  The Levenshtein distance is defined as the number of insertions, deletions,
+  or replacements needed to get the searched word.  This algorithm searches
+  for word where spelling mistakes are allowed.  Levenshtein distance one
+  means there is either a deleted character, an inserted character, or a
+  modified one.
+
+- User choice
+
+  Here you can enter any matching algorithm supported by your
+  dictionary server.
+"
+  :group 'dictionary
+  :type '(choice (const :tag "Exact match" "exact")
+                (const :tag "Similiar sounding" "soundex")
+                (const :tag "Levenshtein distance one" "lev")
+                (string :tag "User choice"))
+  :version "28.1")
+
+(defcustom dictionary-create-buttons
+  t
+  "Create some clickable buttons on top of the window if non-nil."
+  :group 'dictionary
+  :type 'boolean
+  :version "28.1")
+
+(defcustom dictionary-mode-hook
+  nil
+  "Hook run in dictionary mode buffers."
+  :group 'dictionary
+  :type 'hook
+  :version "28.1")
+
+(defcustom dictionary-use-http-proxy
+  nil
+  "Connects via a HTTP proxy using the CONNECT command when not nil."
+  :group 'dictionary-proxy
+  :set 'dictionary-set-server-var
+  :type 'boolean
+  :version "28.1")
+
+(defcustom dictionary-proxy-server
+  "proxy"
+  "The name of the HTTP proxy to use when dictionary-use-http-proxy is set."
+  :group 'dictionary-proxy
+  :set 'dictionary-set-server-var
+  :type 'string
+  :version "28.1")
+
+(defcustom dictionary-proxy-port
+  3128
+  "The port of the proxy server, used only when dictionary-use-http-proxy is 
set."
+  :group 'dictionary-proxy
+  :set 'dictionary-set-server-var
+  :type 'number
+  :version "28.1")
+
+(defcustom dictionary-use-single-buffer
+  nil
+  "Should the dictionary command reuse previous dictionary buffers?"
+  :group 'dictionary
+  :type 'boolean
+  :version "28.1")
+
+(defcustom dictionary-description-open-delimiter
+  ""
+  "The delimiter to display in front of the dictionaries description"
+  :group 'dictionary
+  :type 'string
+  :version "28.1")
+
+(defcustom dictionary-description-close-delimiter
+  ""
+  "The delimiter to display after of the dictionaries description"
+  :group 'dictionary
+  :type 'string
+  :version "28.1")
+
+;; Define only when coding-system-list is available
+(defcustom dictionary-coding-systems-for-dictionaries
+  '( ("mueller" . koi8-r))
+  "Mapping of dictionaries to coding systems.
+Each entry in this list defines the coding system to be used for that
+dictionary.  The default coding system for all other dictionaries
+is utf-8"
+  :group 'dictionary
+  :type `(repeat (cons :tag "Association"
+                       (string :tag "Dictionary name")
+                       (choice :tag "Coding system"
+                               :value 'utf-8
+                               ,@(mapcar (lambda (x) (list 'const x))
+                                         (coding-system-list))
+                               )))
+  :version "28.1")
+
+(defface dictionary-word-definition-face
+'((((supports (:family "DejaVu Serif")))
+   (:family "DejaVu Serif"))
+  (((type x))
+   (:font "Sans Serif"))
+  (t
+   (:font "default")))
+"The face that is used for displaying the definition of the word."
+:group 'dictionary
+:version "28.1")
+
+(defface dictionary-word-entry-face
+  '((((type x))
+     (:italic t))
+    (((type tty) (class color))
+     (:foreground "green"))
+    (t
+     (:inverse t)))
+  "The face that is used for displaying the initial word entry line."
+  :group 'dictionary
+  :version "28.1")
+
+(defface dictionary-button-face
+  '((t
+     (:bold t)))
+  "The face that is used for displaying buttons."
+  :group 'dictionary
+  :version "28.1")
+
+(defface dictionary-reference-face
+  '((((type x)
+      (class color)
+      (background dark))
+     (:foreground "yellow"))
+    (((type tty)
+      (class color)
+      (background dark))
+     (:foreground "cyan"))
+    (((class color)
+      (background light))
+     (:foreground "blue"))
+    (t
+     (:underline t)))
+
+  "The face that is used for displaying a reference word."
+  :group 'dictionary
+  :version "28.1")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Buffer local variables for storing the current state
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar dictionary-window-configuration
+  nil
+  "The window configuration to be restored upon closing the buffer")
+
+(defvar dictionary-selected-window
+  nil
+  "The currently selected window")
+
+(defvar dictionary-position-stack
+  nil
+  "The history buffer for point and window position")
+
+(defvar dictionary-data-stack
+  nil
+  "The history buffer for functions and arguments")
+
+(defvar dictionary-positions
+  nil
+  "The current positions")
+
+(defvar dictionary-current-data
+  nil
+  "The item that will be placed on stack next time")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Global variables
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defvar dictionary-mode-map
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (set-keymap-parent map button-buffer-map)
+
+    (define-key map "q" 'dictionary-close)
+    (define-key map "h" 'dictionary-help)
+    (define-key map "s" 'dictionary-search)
+    (define-key map "d" 'dictionary-lookup-definition)
+    (define-key map "D" 'dictionary-select-dictionary)
+    (define-key map "M" 'dictionary-select-strategy)
+    (define-key map "m" 'dictionary-match-words)
+    (define-key map "l" 'dictionary-previous)
+    (define-key map "n" 'forward-button)
+    (define-key map "p" 'backward-button)
+    (define-key map " " 'scroll-up)
+    (define-key map (read-kbd-macro "M-SPC") 'scroll-down)
+    map)
+  "Keymap for the dictionary mode.")
+
+(defvar dictionary-connection
+  nil
+  "The current network connection")
+
+(defvar dictionary-instances
+  0
+  "The number of open dictionary buffers")
+
+(defvar dictionary-marker
+  nil
+  "Stores the point position while buffer display.")
+
+(defvar dictionary-color-support
+  (condition-case nil
+      (x-display-color-p)
+    (error nil))
+  "Determines if the Emacs has support to display color")
+
+(defvar dictionary-word-history
+  '()
+  "History list of searched word")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Basic function providing startup actions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;###autoload
+(defun dictionary-mode ()
+  "Mode for searching a dictionary.
+This is a mode for searching a dictionary server implementing the
+protocol defined in RFC 2229.
+
+This is a quick reference to this mode describing the default key bindings:
+
+* q close the dictionary buffer
+* h display this help information
+* s ask for a new word to search
+* d search the word at point
+* n or Tab place point to the next link
+* p or S-Tab place point to the prev link
+
+* m ask for a pattern and list all matching words.
+* D select the default dictionary
+* M select the default search strategy
+
+* Return or Button2 visit that link
+"
+
+  (unless (eq major-mode 'dictionary-mode)
+    (cl-incf dictionary-instances))
+
+  (kill-all-local-variables)
+  (buffer-disable-undo)
+  (use-local-map dictionary-mode-map)
+  (setq major-mode 'dictionary-mode)
+  (setq mode-name "Dictionary")
+
+  (setq-local dictionary-data-stack nil)
+  (setq-local dictionary-position-stack nil)
+
+  (make-local-variable 'dictionary-current-data)
+  (make-local-variable 'dictionary-positions)
+
+  (make-local-variable 'dictionary-default-dictionary)
+  (make-local-variable 'dictionary-default-strategy)
+
+  (add-hook 'kill-buffer-hook 'dictionary-close t t)
+  (run-hooks 'dictionary-mode-hook))
+
+;;;###autoload
+(defun dictionary ()
+  "Create a new dictonary buffer and install dictionary-mode."
+  (interactive)
+  (let ((buffer (or (and dictionary-use-single-buffer
+                         (get-buffer "*Dictionary*"))
+                    (generate-new-buffer "*Dictionary*")))
+        (window-configuration (current-window-configuration))
+        (selected-window (frame-selected-window)))
+
+    (switch-to-buffer-other-window buffer)
+    (dictionary-mode)
+
+    (setq-local dictionary-window-configuration window-configuration)
+    (setq-local dictionary-selected-window selected-window)
+    (dictionary-check-connection)
+    (dictionary-new-buffer)
+    (dictionary-store-positions)
+    (dictionary-store-state 'dictionary-new-buffer nil)))
+
+(defun dictionary-new-buffer ()
+  "Create a new and clean buffer."
+
+  (dictionary-pre-buffer)
+  (dictionary-post-buffer))
+
+(defsubst dictionary-reply-code (reply)
+  "Return the reply code stored in REPLY."
+  (get reply 'reply-code))
+
+(defsubst dictionary-reply (reply)
+  "Return the string reply stored in REPLY."
+  (get reply 'reply))
+
+(defsubst dictionary-reply-list (reply)
+  "Return the reply list stored in REPLY."
+  (get reply 'reply-list))
+
+(defun dictionary-open-server (server)
+  "Opens a new connection to SERVER.
+The connection takes the proxy setting in customization group
+`dictionary-proxy' into account."
+  (let ((wanted 'raw-text)
+        (coding-system nil))
+    (if (member wanted (coding-system-list))
+        (setq coding-system wanted))
+    (let ((coding-system-for-read coding-system)
+          (coding-system-for-write coding-system))
+      (setq dictionary-current-server server)
+      (message "Opening connection to %s:%s" server
+               dictionary-port)
+      (dictionary-connection-close dictionary-connection)
+      (setq dictionary-connection
+            (if dictionary-use-http-proxy
+                (dictionary-connection-open dictionary-proxy-server
+                                            dictionary-proxy-port)
+              (dictionary-connection-open server dictionary-port)))
+      (set-process-query-on-exit-flag
+       (dictionary-connection-process dictionary-connection)
+       nil)
+
+      (when dictionary-use-http-proxy
+        (message "Proxy CONNECT to %s:%d"
+                 dictionary-proxy-server
+                 dictionary-proxy-port)
+        (dictionary-send-command (format "CONNECT %s:%d HTTP/1.1"
+                                         server
+                                         dictionary-port))
+        ;; just a \r\n combination
+        (dictionary-send-command "")
+
+        ;; read first line of reply
+        (let* ((reply (dictionary-read-reply))
+               (reply-list (dictionary-split-string reply)))
+          ;; first item is protocol, second item is code
+          (unless (= (string-to-number (cadr reply-list)) 200)
+            (error "Bad reply from proxy server %s" reply))
+
+          ;; skip the following header lines until empty found
+          (while (not (equal reply ""))
+            (setq reply (dictionary-read-reply)))))
+
+      (dictionary-check-initial-reply)
+      (dictionary-send-command (concat "client " dictionary-identification))
+      (let ((reply (dictionary-read-reply-and-split)))
+        (message nil)
+        (unless (dictionary-check-reply reply 250)
+          (error "Unknown server answer: %s"
+                 (dictionary-reply reply)))))))
+
+(defun dictionary-check-connection ()
+  "Check if there is already a connection open."
+  (if (not (and dictionary-connection
+               (eq (dictionary-connection-status dictionary-connection) 'up)))
+      (if dictionary-server
+          (dictionary-open-server dictionary-server)
+        (let ((server "localhost"))
+          (condition-case nil
+              (dictionary-open-server server)
+            (error
+             (if (y-or-n-p
+                  (format "Failed to open server %s, continue with dict.org?"
+                          server))
+                 (dictionary-open-server "dict.org")
+               (error "Failed automatic server selection, please customize 
dictionary-server"))))))))
+
+(defun dictionary-mode-p ()
+  "Return non-nil if current buffer has dictionary-mode."
+  (eq major-mode 'dictionary-mode))
+
+(defun dictionary-ensure-buffer ()
+  "If current buffer is not a dictionary buffer, create a new one."
+  (unless (dictionary-mode-p)
+    (dictionary)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Dealing with closing the buffer
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun dictionary-close (&rest ignored)
+  "Close the current dictionary buffer and its connection."
+  (interactive)
+  (if (eq major-mode 'dictionary-mode)
+      (progn
+       (setq major-mode nil)
+       (if (<= (cl-decf dictionary-instances) 0)
+           (dictionary-connection-close dictionary-connection))
+       (let ((configuration dictionary-window-configuration)
+             (selected-window dictionary-selected-window))
+         (kill-buffer (current-buffer))
+         (set-window-configuration configuration)
+         (select-window selected-window)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Helpful functions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun dictionary-send-command (string)
+  "Send the command `string' to the network connection."
+  (dictionary-check-connection)
+  ;;;; #####
+  (dictionary-connection-send-crlf dictionary-connection string))
+
+(defun dictionary-read-reply ()
+  "Read the reply line from the server."
+  (let ((answer (dictionary-connection-read-crlf dictionary-connection)))
+    (if (string-match "\r?\n" answer)
+       (substring answer 0 (match-beginning 0))
+      answer)))
+
+(defun dictionary-split-string (string)
+  "Split STRING constiting of space-separated words into elements.
+This function knows about the special meaning of quotes (\")"
+  (let ((list))
+    (while (and string (> (length string) 0))
+      (let ((search "\\(\\s-+\\)")
+           (start 0))
+       (if (= (aref string 0) ?\")
+           (setq search "\\(\"\\)\\s-*"
+                 start 1))
+       (if (string-match search string start)
+           (progn
+             (setq list (cons (substring string start (- (match-end 1) 1)) 
list)
+                   string (substring string (match-end 0))))
+         (setq list (cons string list)
+               string nil))))
+    (nreverse list)))
+
+(defun dictionary-read-reply-and-split ()
+  "Reads the reply, splits it into words and returns it."
+  (let ((answer (make-symbol "reply-data"))
+       (reply (dictionary-read-reply)))
+    (let ((reply-list (dictionary-split-string reply)))
+      (put answer 'reply reply)
+      (put answer 'reply-list reply-list)
+      (put answer 'reply-code (string-to-number (car reply-list)))
+      answer)))
+
+(defun dictionary-read-answer ()
+  "Read the complete answer.
+The answer is delimited by a decimal point (.) on a line by itself."
+  (let ((answer (dictionary-connection-read-to-point dictionary-connection))
+       (start 0))
+    (while (string-match "\r\n" answer start)
+      (setq answer (replace-match "\n" t t answer))
+      (setq start (1- (match-end 0))))
+    (setq start 0)
+    (if (string-match "\n\\.\n.*" answer start)
+       (setq answer (replace-match "" t t answer)))
+    answer))
+
+(defun dictionary-check-reply (reply code)
+  "Extract the reply code from REPLY and checks against CODE."
+  (let ((number (dictionary-reply-code reply)))
+    (and (numberp number)
+        (= number code))))
+
+(defun dictionary-coding-system (dictionary)
+  "Select coding system to use for DICTIONARY."
+  (let ((coding-system
+         (or (cdr (assoc dictionary
+                         dictionary-coding-systems-for-dictionaries))
+             'utf-8)))
+    (if (member coding-system (coding-system-list))
+        coding-system
+      nil)))
+
+(defun dictionary-decode-charset (text dictionary)
+  "Convert TEXT from the charset configured for DICTIONARY."
+  (let ((coding-system (dictionary-coding-system dictionary)))
+    (if coding-system
+       (decode-coding-string text coding-system)
+      text)))
+
+(defun dictionary-encode-charset (text dictionary)
+  "Convert TEXT to the charset defined for DICTIONARY."
+  (let ((coding-system (dictionary-coding-system dictionary)))
+    (if coding-system
+       (encode-coding-string text coding-system)
+      text)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Communication functions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun dictionary-check-initial-reply ()
+  "Reads the first reply from server and checks it."
+  (let ((reply (dictionary-read-reply-and-split)))
+    (unless (dictionary-check-reply reply 220)
+      (dictionary-connection-close dictionary-connection)
+      (error "Server returned: %s" (dictionary-reply reply)))))
+
+;; Store the current state
+(defun dictionary-store-state (function data)
+  "Stores the current state of operation for later restore.
+The current state consist of a tuple of FUNCTION and DATA. This
+is basically an implementation of a history to return to a
+previous state."
+  (if dictionary-current-data
+      (progn
+       (push dictionary-current-data dictionary-data-stack)
+       (unless dictionary-positions
+         (error "dictionary-store-state called before 
dictionary-store-positions"))
+       (push dictionary-positions dictionary-position-stack)))
+  (setq dictionary-current-data
+       (cons function data)))
+
+(defun dictionary-store-positions ()
+  "Stores the current positions for later restore."
+
+  (setq dictionary-positions (cons (point) (window-start))))
+
+;; Restore the previous state
+(defun dictionary-restore-state (&rest ignored)
+  "Restore the state just before the last operation."
+  (let ((position (pop dictionary-position-stack))
+       (data (pop dictionary-data-stack)))
+    (unless position
+      (error "Already at begin of history"))
+    (apply (car data) (cdr data))
+    (set-window-start (selected-window) (cdr position))
+    (goto-char (car position))
+    (setq dictionary-current-data data)))
+
+;; The normal search
+
+(defun dictionary-new-search (args &optional all)
+  "Saves the current state and starts a new search based on ARGS.
+The parameter ARGS is a cons cell where car is the word to search
+and cdr is the dictionary where to search the word in."
+  (interactive)
+  (dictionary-store-positions)
+  (let ((word (car args))
+       (dictionary (cdr args)))
+
+    (if all
+       (setq dictionary dictionary-default-dictionary))
+    (dictionary-ensure-buffer)
+    (dictionary-new-search-internal word dictionary 
'dictionary-display-search-result)
+    (dictionary-store-state 'dictionary-new-search-internal
+                           (list word dictionary 
'dictionary-display-search-result))))
+
+(defun dictionary-new-search-internal (word dictionary function)
+  "Starts a new search for WORD in DICTIONARY after preparing the buffer.
+FUNCTION is the callback which is called for each search result.
+"
+  (dictionary-pre-buffer)
+  (dictionary-do-search word dictionary function))
+
+(defun dictionary-do-search (word dictionary function &optional nomatching)
+  "Searches WORD in DICTIONARY and calls FUNCTION for each result.
+The parameter NOMATCHING controls whether to suppress the display
+of matching words."
+
+  (message "Searching for %s in %s" word dictionary)
+  (dictionary-send-command (concat "define "
+                                  (dictionary-encode-charset dictionary "")
+                                  " \""
+                                  (dictionary-encode-charset word dictionary)
+                                  "\""))
+
+  (message nil)
+  (let ((reply (dictionary-read-reply-and-split)))
+    (if (dictionary-check-reply reply 552)
+       (progn
+         (unless nomatching
+           (beep)
+           (insert "Word not found, maybe you are looking "
+                   "for one of these words\n\n")
+           (dictionary-do-matching word
+                                   dictionary
+                                   "."
+                                   'dictionary-display-only-match-result)
+           (dictionary-post-buffer)))
+      (if (dictionary-check-reply reply 550)
+         (error "Dictionary \"%s\" is unknown, please select an existing one."
+                dictionary)
+       (unless (dictionary-check-reply reply 150)
+         (error "Unknown server answer: %s" (dictionary-reply reply)))
+       (funcall function reply)))))
+
+(define-button-type 'dictionary-link
+  'face 'dictionary-reference-face
+  'action (lambda (button)
+            (let ((func (button-get button 'callback))
+                  (data (button-get button 'data))
+                  (list-data (button-get button 'list-data)))
+              (if list-data
+                  (apply func list-data)
+                (funcall func data)))))
+
+(define-button-type 'dictionary-button
+  :supertype 'dictionary-link
+  'face 'dictionary-button-face)
+
+(defun dictionary-pre-buffer ()
+  "These commands are executed at the begin of a new buffer."
+  (setq buffer-read-only nil)
+  (erase-buffer)
+  (if dictionary-create-buttons
+      (progn
+        (insert-button "[Back]" :type 'dictionary-button
+                       'callback 'dictionary-restore-state
+                       'help-echo (purecopy "Mouse-2 to go backwards in 
history"))
+       (insert " ")
+        (insert-button "[Search definition]" :type 'dictionary-button
+                       'callback 'dictionary-search
+                       'help-echo (purecopy "Mouse-2 to look up a new word"))
+       (insert "         ")
+
+       (insert-button "[Matching words]" :type 'dictionary-button
+                       'callback 'dictionary-match-words
+                       'help-echo (purecopy "Mouse-2 to find matches for a 
pattern"))
+       (insert "        ")
+
+       (insert-button "[Quit]" :type 'dictionary-button
+                       'callback 'dictionary-close
+                       'help-echo (purecopy "Mouse-2 to close this window"))
+
+       (insert "\n       ")
+
+        (insert-button "[Select dictionary]" :type 'dictionary-button
+                       'callback 'dictionary-select-dictionary
+                       'help-echo (purecopy "Mouse-2 to select dictionary for 
future searches"))
+       (insert "         ")
+        (insert-button "[Select match strategy]" :type 'dictionary-button
+                       'callback 'dictionary-select-strategy
+                       'help-echo (purecopy "Mouse-2 to select matching 
algorithm"))
+       (insert "\n\n")))
+  (setq dictionary-marker (point-marker)))
+
+(defun dictionary-post-buffer ()
+  "These commands are executed at the end of a new buffer."
+  (goto-char dictionary-marker)
+
+  (set-buffer-modified-p nil)
+  (setq buffer-read-only t))
+
+(defun dictionary-display-search-result (reply)
+  "This function starts displaying the result in REPLY."
+
+  (let ((number (nth 1 (dictionary-reply-list reply))))
+    (insert number (if (equal number "1")
+                      " definition"
+                    " definitions")
+           " found\n\n")
+    (setq reply (dictionary-read-reply-and-split))
+    (while (dictionary-check-reply reply 151)
+      (let* ((reply-list (dictionary-reply-list reply))
+            (dictionary (nth 2 reply-list))
+            (description (nth 3 reply-list))
+            (word (nth 1 reply-list)))
+       (dictionary-display-word-entry dictionary description)
+       (setq reply (dictionary-read-answer))
+       (dictionary-display-word-definition reply word dictionary)
+       (setq reply (dictionary-read-reply-and-split))))
+    (dictionary-post-buffer)))
+
+(defun dictionary-display-word-entry (dictionary description)
+  "Insert an explanation for DESCRIPTION from DICTIONARY.
+The DICTIONARY is only used for decoding the bytes to display the DESCRIPTION."
+  (let ((start (point)))
+    (insert "From "
+           dictionary-description-open-delimiter
+           (dictionary-decode-charset description dictionary)
+           dictionary-description-close-delimiter
+           " [" (dictionary-decode-charset dictionary dictionary) "]:")
+    (put-text-property start (point) 'face 'dictionary-word-entry-face)
+    (insert "\n\n")))
+
+(defun dictionary-display-word-definition (reply word dictionary)
+  "Insert the definition in REPLY for the current WORD from DICTIONARY.
+It will replace links which are found in the REPLY and replace
+them with buttons to perform a a new search.
+"
+  (let ((start (point)))
+    (insert (dictionary-decode-charset reply dictionary))
+    (insert "\n\n")
+    (put-text-property start (point) 'face 'dictionary-word-definition-face)
+    (let ((regexp "\\({+\\)\\([^ '\"][^}]*\\)\\(}+\\)"))
+      (goto-char start)
+      (while (< (point) (point-max))
+       (if (search-forward-regexp regexp nil t)
+           (let ((match-start (match-beginning 2))
+                 (match-end (match-end 2)))
+             (if dictionary-color-support
+                 ;; Compensate for the replacement
+                 (let ((brace-match-length (- (match-end 1)
+                                              (match-beginning 1))))
+                   (setq match-start (- (match-beginning 2)
+                                        brace-match-length))
+                   (setq match-end (- (match-end 2)
+                                      brace-match-length))
+                   (replace-match "\\2")))
+             (dictionary-mark-reference match-start match-end
+                                        'dictionary-new-search
+                                        word dictionary))
+         (goto-char (point-max)))))))
+
+(defun dictionary-mark-reference (start end call displayed-word dictionary)
+  "Format the area from START to END as link calling CALL.
+The word is taken from the buffer, the DICTIONARY is given as argument."
+  (let ((word (buffer-substring-no-properties start end)))
+    (while (string-match "\n\\s-*" word)
+      (setq word (replace-match " " t t word)))
+    (while (string-match "[*\"]" word)
+      (setq word (replace-match "" t t word)))
+
+    (unless (equal word displayed-word)
+      (make-button start end :type 'dictionary-link
+                   'callback call
+                   'data (cons word dictionary)
+                   'help-echo (concat "Press Mouse-2 to lookup \""
+                                      word "\" in \"" dictionary "\"")))))
+
+(defun dictionary-select-dictionary (&rest ignored)
+  "Save the current state and start a dictionary selection."
+  (interactive)
+  (dictionary-ensure-buffer)
+  (dictionary-store-positions)
+  (dictionary-do-select-dictionary)
+  (dictionary-store-state 'dictionary-do-select-dictionary nil))
+
+(defun dictionary-do-select-dictionary (&rest ignored)
+  "The workhorse for doing the dictionary selection."
+
+  (message "Looking up databases and descriptions")
+  (dictionary-send-command "show db")
+
+  (let ((reply (dictionary-read-reply-and-split)))
+    (message nil)
+    (if (dictionary-check-reply reply 554)
+       (error "No dictionary present")
+      (unless (dictionary-check-reply reply 110)
+       (error "Unknown server answer: %s"
+              (dictionary-reply reply)))
+      (dictionary-display-dictionarys))))
+
+(defun dictionary-simple-split-string (string &optional pattern)
+  "Return a list of substrings of STRING which are separated by PATTERN.
+If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
+  (or pattern
+      (setq pattern "[ \f\t\n\r\v]+"))
+  ;; The FSF version of this function takes care not to cons in case
+  ;; of infloop.  Maybe we should synch?
+  (let (parts (start 0))
+    (while (string-match pattern string start)
+      (setq parts (cons (substring string start (match-beginning 0)) parts)
+           start (match-end 0)))
+    (nreverse (cons (substring string start) parts))))
+
+(defun dictionary-display-dictionarys ()
+  "Handle the display of all dictionaries existing on the server."
+  (dictionary-pre-buffer)
+  (insert "Please select your default dictionary:\n\n")
+  (dictionary-display-dictionary-line "* \"All dictionaries\"")
+  (dictionary-display-dictionary-line "! \"The first matching dictionary\"")
+  (let* ((reply (dictionary-read-answer))
+        (list (dictionary-simple-split-string reply "\n+")))
+    (mapc 'dictionary-display-dictionary-line list))
+  (dictionary-post-buffer))
+
+(defun dictionary-display-dictionary-line (string)
+  "Display a single dictionary and its description read from STRING."
+  (let* ((list (dictionary-split-string string))
+        (dictionary (car list))
+        (description (cadr list))
+        (translated (dictionary-decode-charset description dictionary)))
+    (if dictionary
+       (if (equal dictionary "--exit--")
+           (insert "(end of default search list)\n")
+          (insert-button (concat dictionary ": " translated) :type 
'dictionary-link
+                         'callback 'dictionary-set-dictionary
+                         'data (cons dictionary description)
+                         'help-echo (purecopy "Mouse-2 to select this 
dictionary"))
+          (unless (dictionary-special-dictionary dictionary)
+            (insert " ")
+            (insert-button "(Details)" :type 'dictionary-link
+                           'callback 'dictionary-set-dictionary
+                           'list-data (list (cons dictionary description) t)
+                           'help-echo (purecopy "Mouse-2 to get more 
information")))
+         (insert "\n")))))
+
+(defun dictionary-set-dictionary (param &optional more)
+  "Select the dictionary which is the car of PARAM as new default."
+
+  (if more
+      (dictionary-display-more-info param)
+    (let ((dictionary (car param)))
+      (setq dictionary-default-dictionary dictionary)
+      (dictionary-restore-state)
+      (message "Dictionary %s has been selected" dictionary))))
+
+(defun dictionary-special-dictionary (name)
+  "Checks whether the special * or ! dictionary are seen in NAME."
+  (or (equal name "*")
+      (equal name "!")))
+
+(defun dictionary-display-more-info (param)
+  "Display the available information on the dictionary found in PARAM."
+
+  (let ((dictionary (car param))
+       (description (cdr param)))
+    (unless (dictionary-special-dictionary dictionary)
+      (dictionary-store-positions)
+      (message "Requesting more information on %s" dictionary)
+      (dictionary-send-command
+       (concat "show info " (dictionary-encode-charset dictionary "")))
+      (let ((reply (dictionary-read-reply-and-split)))
+       (message nil)
+       (if (dictionary-check-reply reply 550)
+           (error "Dictionary \"%s\" does not exist" dictionary)
+         (unless (dictionary-check-reply reply 112)
+           (error "Unknown server answer: %s" (dictionary-reply reply)))
+         (dictionary-pre-buffer)
+         (insert "Information on dictionary: ")
+          (insert-button description :type 'dictionary-link
+                         'callback 'dictionary-set-dictionary
+                         'data (cons dictionary description)
+                         'help-echo (purecopy "Mouse-2 to select this 
dictionary"))
+         (insert "\n\n")
+         (setq reply (dictionary-read-answer))
+         (insert reply)
+         (dictionary-post-buffer)))
+
+      (dictionary-store-state 'dictionary-display-more-info dictionary))))
+
+(defun dictionary-select-strategy (&rest ignored)
+  "Save the current state and start a strategy selection."
+  (interactive)
+  (dictionary-ensure-buffer)
+  (dictionary-store-positions)
+  (dictionary-do-select-strategy)
+  (dictionary-store-state 'dictionary-do-select-strategy nil))
+
+(defun dictionary-do-select-strategy ()
+  "The workhorse for doing the strategy selection."
+
+  (message "Request existing matching algorithm")
+  (dictionary-send-command "show strat")
+
+  (let ((reply (dictionary-read-reply-and-split)))
+    (message nil)
+    (if (dictionary-check-reply reply 555)
+       (error "No strategies available")
+      (unless (dictionary-check-reply reply 111)
+       (error "Unknown server answer: %s"
+              (dictionary-reply reply)))
+      (dictionary-display-strategies))))
+
+(defun dictionary-display-strategies ()
+  "Handle the display of all strategies existing on the server."
+  (dictionary-pre-buffer)
+  (insert "Please select your default search strategy:\n\n")
+  (dictionary-display-strategy-line ". \"The servers default\"")
+  (let* ((reply (dictionary-read-answer))
+        (list (dictionary-simple-split-string reply "\n+")))
+    (mapc 'dictionary-display-strategy-line list))
+  (dictionary-post-buffer))
+
+(defun dictionary-display-strategy-line (string)
+  "Display a single strategy found in STRING."
+  (let* ((list (dictionary-split-string string))
+        (strategy (car list))
+        (description (cadr list)))
+    (if strategy
+       (progn
+          (insert-button description :type 'dictionary-link
+                         'callback 'dictionary-set-strategy
+                         'data strategy
+                         'help-echo (purecopy "Mouse-2 to select this matching 
algorithm"))
+         (insert "\n")))))
+
+(defun dictionary-set-strategy (strategy &rest ignored)
+  "Select this STRATEGY as new default"
+  (setq dictionary-default-strategy strategy)
+  (dictionary-restore-state)
+  (message "Strategy %s has been selected" strategy))
+
+(defun dictionary-new-matching (word)
+  "Run a new matching search on WORD."
+  (dictionary-ensure-buffer)
+  (dictionary-store-positions)
+  (dictionary-do-matching word dictionary-default-dictionary
+                         dictionary-default-strategy
+                         'dictionary-display-match-result)
+  (dictionary-store-state 'dictionary-do-matching
+                         (list word dictionary-default-dictionary
+                               dictionary-default-strategy
+                               'dictionary-display-match-result)))
+
+(defun dictionary-do-matching (word dictionary strategy function)
+  "Find matches for WORD with STRATEGY in DICTIONARY and display them with 
FUNCTION."
+
+  (message "Lookup matching words for %s in %s using %s"
+          word dictionary strategy)
+  (dictionary-send-command
+   (concat "match " (dictionary-encode-charset dictionary "") " "
+          (dictionary-encode-charset strategy "") " \""
+          (dictionary-encode-charset word "") "\""))
+  (let ((reply (dictionary-read-reply-and-split)))
+    (message nil)
+    (if (dictionary-check-reply reply 550)
+       (error "Dictionary \"%s\" is invalid" dictionary))
+    (if (dictionary-check-reply reply 551)
+       (error "Strategy \"%s\" is invalid" strategy))
+    (if (dictionary-check-reply reply 552)
+       (error (concat
+               "No match for \"%s\" with strategy \"%s\" in "
+               "dictionary \"%s\".")
+              word strategy dictionary))
+    (unless (dictionary-check-reply reply 152)
+      (error "Unknown server answer: %s" (dictionary-reply reply)))
+    (funcall function reply)))
+
+(defun dictionary-display-only-match-result (reply)
+  "Display the results from the current matches in REPLY without the headers."
+
+  (let ((number (nth 1 (dictionary-reply-list reply)))
+       (list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
+    (insert number " matching word" (if (equal number "1") "" "s")
+           " found\n\n")
+    (let ((result nil))
+      (mapc (lambda (item)
+             (let* ((list (dictionary-split-string item))
+                    (dictionary (car list))
+                    (word (cadr list))
+                    (hash (assoc dictionary result)))
+               (if dictionary
+                   (if hash
+                       (setcdr hash (cons word (cdr hash)))
+                     (setq result (cons
+                                   (cons dictionary (list word))
+                                   result))))))
+           list)
+      (dictionary-display-match-lines (reverse result)))))
+
+(defun dictionary-display-match-result (reply)
+  "Display the results in REPLY from a match operation."
+  (dictionary-pre-buffer)
+
+  (let ((number (nth 1 (dictionary-reply-list reply)))
+       (list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
+    (insert number " matching word" (if (equal number "1") "" "s")
+           " found\n\n")
+    (let ((result nil))
+      (mapc (lambda (item)
+             (let* ((list (dictionary-split-string item))
+                    (dictionary (car list))
+                    (word (cadr list))
+                    (hash (assoc dictionary result)))
+               (if dictionary
+                   (if hash
+                       (setcdr hash (cons word (cdr hash)))
+                     (setq result (cons
+                                   (cons dictionary (list word))
+                                   result))))))
+           list)
+      (dictionary-display-match-lines (reverse result))))
+  (dictionary-post-buffer))
+
+(defun dictionary-display-match-lines (list)
+  "Display a line for each match found in LIST."
+  (mapc (lambda (item)
+         (let ((dictionary (car item))
+               (word-list (cdr item)))
+           (insert "Matches from " dictionary ":\n")
+           (mapc (lambda (word)
+                   (setq word (dictionary-decode-charset word dictionary))
+                   (insert "  ")
+                    (insert-button word :type 'dictionary-link
+                                   'callback 'dictionary-new-search
+                                   'data (cons word dictionary)
+                                   'help-echo (purecopy "Mouse-2 to lookup 
word"))
+                   (insert "\n")) (reverse word-list))
+           (insert "\n")))
+       list))
+
+;; Returns a sensible default for dictionary-search:
+;; - if region is active returns its contents
+;; - otherwise return the word near the point
+(defun dictionary-search-default ()
+  (if (use-region-p)
+      (buffer-substring-no-properties (region-beginning) (region-end))
+    (current-word t)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; User callable commands
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;###autoload
+(defun dictionary-search (word &optional dictionary)
+  "Search the WORD in DICTIONARY if given or in all if nil.
+It presents the selection or word at point as default input and
+allows editing it."
+  (interactive
+   (list (let ((default (dictionary-search-default)))
+           (read-string (if default
+                            (format "Search word (%s): " default)
+                          "Search word: ")
+                        nil 'dictionary-word-history default))
+        (if current-prefix-arg
+            (read-string (if dictionary-default-dictionary
+                             (format "Dictionary (%s): " 
dictionary-default-dictionary)
+                           "Dictionary: ")
+                         nil nil dictionary-default-dictionary)
+          dictionary-default-dictionary)))
+
+  ;; if called by pressing the button
+  (unless word
+    (setq word (read-string "Search word: " nil 'dictionary-word-history)))
+  ;; just in case non-interactivly called
+  (unless dictionary
+    (setq dictionary dictionary-default-dictionary))
+  (dictionary-new-search (cons word dictionary)))
+
+;;;###autoload
+(defun dictionary-lookup-definition ()
+  "Unconditionally lookup the word at point."
+  (interactive)
+  (dictionary-new-search (cons (current-word) dictionary-default-dictionary)))
+
+(defun dictionary-previous ()
+  "Go to the previous location in the current buffer."
+  (interactive)
+  (unless (dictionary-mode-p)
+    (error "Current buffer is no dictionary buffer"))
+  (dictionary-restore-state))
+
+(defun dictionary-help ()
+  "Display a little help."
+  (interactive)
+  (describe-function 'dictionary-mode))
+
+;;;###autoload
+(defun dictionary-match-words (&optional pattern &rest ignored)
+  "Search PATTERN in current default dictionary using default strategy."
+  (interactive)
+  ;; can't use interactive because of mouse events
+  (or pattern
+      (setq pattern (read-string "Search pattern: "
+                                 nil 'dictionary-word-history)))
+  (dictionary-new-matching pattern))
+
+;;;###autoload
+(defun dictionary-mouse-popup-matching-words (event)
+  "Display entries matching the word at the cursor retrieved using EVENT."
+  (interactive "e")
+  (let ((word (save-window-excursion
+               (save-excursion
+                 (mouse-set-point event)
+                 (current-word)))))
+    (selected-window)
+    (dictionary-popup-matching-words word)))
+
+;;;###autoload
+(defun dictionary-popup-matching-words (&optional word)
+  "Display entries matching WORD or the current word if not given."
+  (interactive)
+  (dictionary-do-matching (or word (current-word) (error "Nothing to search 
for"))
+                         dictionary-default-dictionary
+                         dictionary-default-popup-strategy
+                         'dictionary-process-popup-replies))
+
+(defun dictionary-process-popup-replies (&ignore)
+  (let ((list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
+
+    (let ((result (mapcar (lambda (item)
+                           (let* ((list (dictionary-split-string item))
+                                  (dictionary (car list))
+                                  (word (dictionary-decode-charset
+                                         (cadr list) dictionary)))
+                             (message word)
+                             (if (equal word "")
+                                 [ "-" nil nil]
+                               (vector (concat "[" dictionary "] " word)
+                                       `(dictionary-new-search
+                                         '(,word . ,dictionary))
+                                       t ))))
+
+                         list)))
+      (easy-menu-define dictionary-mode-map-menu dictionary-mode-map
+        "Menu used for displaying dictionary popup"
+        (cons "Matching words"
+              `(,@result)))
+      (popup-menu dictionary-mode-map-menu))))
+
+;;; Tooltip support
+
+;; Add a mode indicater named "Dict"
+(defvar dictionary-tooltip-mode
+  nil
+  "Indicates wheather the dictionary tooltip mode is active.")
+(nconc minor-mode-alist '((dictionary-tooltip-mode " Dict")))
+
+(defcustom dictionary-tooltip-dictionary
+  nil
+  "This dictionary to lookup words for tooltips"
+  :group 'dictionary
+  :type '(choice (const :tag "None" nil) string)
+  :version "28.1")
+
+(defun dictionary-definition (word &optional dictionary)
+  (interactive)
+  (unwind-protect
+      (let ((dictionary (or dictionary dictionary-default-dictionary)))
+       (dictionary-do-search word dictionary 'dictionary-read-definition t))
+    nil))
+
+(defun dictionary-read-definition (&ignore)
+  (let ((list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
+    (mapconcat 'identity (cdr list) "\n")))
+
+;;; Tooltip support for GNU Emacs
+(defvar global-dictionary-tooltip-mode
+  nil)
+
+(defun dictionary-word-at-mouse-event (event)
+  (with-current-buffer (tooltip-event-buffer event)
+    (let ((point (posn-point (event-end event))))
+      (if (use-region-p)
+         (when (and (<= (region-beginning) point) (<= point (region-end)))
+           (buffer-substring (region-beginning) (region-end)))
+        (save-excursion
+          (goto-char point)
+        (current-word))))))
+
+(defvar dictionary-tooltip-mouse-event nil
+  "Event that triggered the tooltip mode.")
+
+(defun dictionary-display-tooltip (&ignore)
+  "Search the current word in the `dictionary-tooltip-dictionary'."
+  (interactive "e")
+  (if (and dictionary-tooltip-mode dictionary-tooltip-dictionary)
+      (let ((word (dictionary-word-at-mouse-event 
dictionary-tooltip-mouse-event)))
+        (if word
+            (let ((definition
+                    (dictionary-definition word 
dictionary-tooltip-dictionary)))
+              (if definition
+                  (tooltip-show (dictionary-decode-charset definition
+                                                           
dictionary-tooltip-dictionary)))))
+        t)
+    nil))
+
+(defun dictionary-tooltip-track-mouse (event)
+  "Called whenever a dictionary tooltip display is about to be triggered."
+  (interactive "e")
+  (tooltip-hide)
+  (when dictionary-tooltip-mode
+    (setq dictionary-tooltip-mouse-event (copy-sequence event))
+    (tooltip-start-delayed-tip)))
+
+(defun dictionary-switch-tooltip-mode (on)
+  "Turn off or on support for the dictionary tooltip mode.
+
+It is normally internally called with 1 to enable support for the
+tooltip mode. The hook function will check the value of the
+variable dictionary-tooltip-mode to decide if some action must be
+taken. When disabling the tooltip mode the value of this variable
+will be set to nil.
+"
+  (interactive)
+  (tooltip-mode on)
+  (if on
+      (add-hook 'tooltip-functions 'dictionary-display-tooltip)
+    (remove-hook 'tooltip-functions 'dictionary-display-tooltip)))
+
+;;;###autoload
+(defun dictionary-tooltip-mode (&optional arg)
+  "Display tooltips for the current word.
+
+This function can be used to enable or disable the tooltip mode
+for the current buffer (based on ARG). If global-tooltip-mode is
+active it will overwrite that mode for the current buffer.
+"
+
+  (interactive "P")
+  (require 'tooltip)
+  (let ((on (if arg
+                (> (prefix-numeric-value arg) 0)
+              (not dictionary-tooltip-mode))))
+    (setq-local dictionary-tooltip-mode on)
+    (setq-local track-mouse on)
+    (make-local-variable 'dictionary-tooltip-mouse-event)
+    (dictionary-switch-tooltip-mode 1)
+    (if on
+        (local-set-key [mouse-movement] 'dictionary-tooltip-track-mouse)
+      (local-set-key [mouse-movement] 'ignore))
+    on))
+
+;;;###autoload
+(defun global-dictionary-tooltip-mode (&optional arg)
+  "Enable/disable dictionary-tooltip-mode for all buffers.
+
+Internally it provides a default for the dictionary-tooltip-mode.
+It can be overwritten for each buffer using dictionary-tooltip-mode.
+
+Note: (global-dictionary-tooltip-mode 0) will not disable the mode
+any buffer where (dictionary-tooltip-mode 1) has been called.
+"
+  (interactive "P")
+  (require 'tooltip)
+  (let ((on (if arg (> (prefix-numeric-value arg) 0)
+              (not global-dictionary-tooltip-mode))))
+    (setq global-dictionary-tooltip-mode on)
+    (setq-default dictionary-tooltip-mode on)
+    (make-local-variable 'dictionary-tooltip-mouse-event)
+    (setq-default track-mouse on)
+    (dictionary-switch-tooltip-mode 1)
+    (if on
+        (global-set-key [mouse-movement] 'dictionary-tooltip-track-mouse)
+      (global-set-key [mouse-movement] 'ignore))
+    on))
+
+(provide 'dictionary)
+;;; dictionary.el ends here
diff --git a/lisp/net/dig.el b/lisp/net/dig.el
index da4ea405..92dcf73 100644
--- a/lisp/net/dig.el
+++ b/lisp/net/dig.el
@@ -1,6 +1,6 @@
 ;;; dig.el --- Domain Name System dig interface  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;; Keywords: DNS BIND dig comm
diff --git a/lisp/net/dns.el b/lisp/net/dns.el
index c368cd7..2045d4d 100644
--- a/lisp/net/dns.el
+++ b/lisp/net/dns.el
@@ -1,6 +1,6 @@
 ;;; dns.el --- Domain Name Service lookups  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: network comm
diff --git a/lisp/net/eudc-bob.el b/lisp/net/eudc-bob.el
index b2069ed..456d70e 100644
--- a/lisp/net/eudc-bob.el
+++ b/lisp/net/eudc-bob.el
@@ -1,6 +1,6 @@
 ;;; eudc-bob.el --- Binary Objects Support for EUDC  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;;         Pavel Janík <Pavel@Janik.cz>
diff --git a/lisp/net/eudc-export.el b/lisp/net/eudc-export.el
index 5c96628..bac75e6 100644
--- a/lisp/net/eudc-export.el
+++ b/lisp/net/eudc-export.el
@@ -1,6 +1,6 @@
 ;;; eudc-export.el --- functions to export EUDC query results
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;;         Pavel Janík <Pavel@Janik.cz>
diff --git a/lisp/net/eudc-hotlist.el b/lisp/net/eudc-hotlist.el
index f87f8f0..e4b7e8a 100644
--- a/lisp/net/eudc-hotlist.el
+++ b/lisp/net/eudc-hotlist.el
@@ -1,6 +1,6 @@
 ;;; eudc-hotlist.el --- hotlist management for EUDC
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;;         Pavel Janík <Pavel@Janik.cz>
diff --git a/lisp/net/eudc-vars.el b/lisp/net/eudc-vars.el
index 2306d7b..b808017 100644
--- a/lisp/net/eudc-vars.el
+++ b/lisp/net/eudc-vars.el
@@ -1,6 +1,6 @@
 ;;; eudc-vars.el --- Emacs Unified Directory Client  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;;         Pavel Janík <Pavel@Janik.cz>
diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el
index f4e4c17..f61929c 100644
--- a/lisp/net/eudc.el
+++ b/lisp/net/eudc.el
@@ -1,6 +1,6 @@
 ;;; eudc.el --- Emacs Unified Directory Client  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;;         Pavel Janík <Pavel@Janik.cz>
diff --git a/lisp/net/eudcb-bbdb.el b/lisp/net/eudcb-bbdb.el
index 5d6b52a..e11458b 100644
--- a/lisp/net/eudcb-bbdb.el
+++ b/lisp/net/eudcb-bbdb.el
@@ -1,6 +1,6 @@
 ;;; eudcb-bbdb.el --- Emacs Unified Directory Client - BBDB Backend
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;;         Pavel Janík <Pavel@Janik.cz>
diff --git a/lisp/net/eudcb-ldap.el b/lisp/net/eudcb-ldap.el
index 14cc7db..4623079 100644
--- a/lisp/net/eudcb-ldap.el
+++ b/lisp/net/eudcb-ldap.el
@@ -1,6 +1,6 @@
 ;;; eudcb-ldap.el --- Emacs Unified Directory Client - LDAP Backend
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;;         Pavel Janík <Pavel@Janik.cz>
diff --git a/lisp/net/eudcb-mab.el b/lisp/net/eudcb-mab.el
index 5953c86..eb7032a 100644
--- a/lisp/net/eudcb-mab.el
+++ b/lisp/net/eudcb-mab.el
@@ -1,6 +1,6 @@
 ;;; eudcb-mab.el --- Emacs Unified Directory Client - AddressBook backend
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@newartisans.com>
 ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org>
diff --git a/lisp/net/eudcb-macos-contacts.el b/lisp/net/eudcb-macos-contacts.el
index 3c0d88f..66a684d 100644
--- a/lisp/net/eudcb-macos-contacts.el
+++ b/lisp/net/eudcb-macos-contacts.el
@@ -1,6 +1,6 @@
 ;;; eudcb-macos-contacts.el --- EUDC - macOS Contacts backend
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Alexander Adolf
 
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index ce49e32..d131b2b 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1,6 +1,6 @@
 ;;; eww.el --- Emacs Web Wowser  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: html
diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el
index 8ad7219..ff58cbb 100644
--- a/lisp/net/gnutls.el
+++ b/lisp/net/gnutls.el
@@ -1,6 +1,6 @@
 ;;; gnutls.el --- Support SSL/TLS connections through GnuTLS
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Ted Zlatanov <tzz@lifelogs.com>
 ;; Keywords: comm, tls, ssl, encryption
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index 43bea76..d192630 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -1,6 +1,6 @@
 ;;; goto-addr.el --- click to browse URL or to send to e-mail address
 
-;; Copyright (C) 1995, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Ding <ericding@alum.mit.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/net/hmac-def.el b/lisp/net/hmac-def.el
index 944cc6c..5ea8839 100644
--- a/lisp/net/hmac-def.el
+++ b/lisp/net/hmac-def.el
@@ -1,6 +1,6 @@
 ;;; hmac-def.el --- A macro for defining HMAC functions.  -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 1999, 2001, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
 ;; Keywords: HMAC, RFC2104
diff --git a/lisp/net/hmac-md5.el b/lisp/net/hmac-md5.el
index 974ee0d..85a8c51 100644
--- a/lisp/net/hmac-md5.el
+++ b/lisp/net/hmac-md5.el
@@ -1,6 +1,6 @@
 ;;; hmac-md5.el --- Compute HMAC-MD5.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999, 2001, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
 ;; Keywords: HMAC, RFC2104, HMAC-MD5, MD5, KEYED-MD5, CRAM-MD5
diff --git a/lisp/net/imap.el b/lisp/net/imap.el
index 0394f0e..052ef29 100644
--- a/lisp/net/imap.el
+++ b/lisp/net/imap.el
@@ -1,6 +1,6 @@
 ;;; imap.el --- imap library  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;; Keywords: mail
@@ -190,7 +190,7 @@ until a successful connection is made."
   :type '(repeat string))
 
 (defcustom imap-process-connection-type nil
-  "Value for `process-connection-type' to use for Kerberos4, GSSAPI, shell, 
and SSL.
+  "Value for `process-connection-type' to use for Kerberos4, GSSAPI, shell and 
SSL.
 The `process-connection-type' variable controls the type of device
 used to communicate with subprocesses.  Values are nil to use a
 pipe, or t or `pty' to use a pty.  The value has no effect if the
@@ -1033,8 +1033,7 @@ necessary.  If nil, the buffer name is generated."
            (when (funcall (nth 1 (assq stream imap-stream-alist)) buffer)
              ;; Stream changed?
              (if (not (eq imap-default-stream stream))
-                 (with-current-buffer (get-buffer-create
-                                       (generate-new-buffer-name " *temp*"))
+                  (with-current-buffer (generate-new-buffer " *temp*")
                    (mapc 'make-local-variable imap-local-variables)
                    (set-buffer-multibyte nil)
                    (buffer-disable-undo)
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el
index 0016af2..0476835 100644
--- a/lisp/net/ldap.el
+++ b/lisp/net/ldap.el
@@ -1,6 +1,6 @@
 ;;; ldap.el --- client interface to LDAP for Emacs
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el
index d0f8c12..455673b 100644
--- a/lisp/net/mailcap.el
+++ b/lisp/net/mailcap.el
@@ -1,6 +1,6 @@
 ;;; mailcap.el --- MIME media types configuration -*- lexical-binding: t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: William M. Perry <wmperry@aventail.com>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -386,8 +386,7 @@ Gnus might fail to display all of it.")
     (when
        (save-window-excursion
          (delete-other-windows)
-         (let ((buffer (get-buffer-create (generate-new-buffer-name
-                                           "*Warning*"))))
+          (let ((buffer (generate-new-buffer "*Warning*")))
            (unwind-protect
                (with-current-buffer buffer
                  (insert (substitute-command-keys
diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el
index 5571b2a..08edb44 100644
--- a/lisp/net/mairix.el
+++ b/lisp/net/mairix.el
@@ -1,6 +1,6 @@
 ;;; mairix.el --- Mairix interface for Emacs
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: David Engster <dengste@eml.cc>
 ;; Keywords: mail searching
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index 994a0bf..d5aad3a 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -1,6 +1,6 @@
 ;;; net-utils.el --- network functions
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Sun Mar 16 1997
diff --git a/lisp/net/netrc.el b/lisp/net/netrc.el
index 01db97c..9473c82 100644
--- a/lisp/net/netrc.el
+++ b/lisp/net/netrc.el
@@ -1,6 +1,6 @@
 ;;; netrc.el --- .netrc parsing functionality  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el
index e86426d..b45cefc 100644
--- a/lisp/net/network-stream.el
+++ b/lisp/net/network-stream.el
@@ -1,6 +1,6 @@
 ;;; network-stream.el --- open network processes, possibly with encryption -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: network
diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el
index f45abf7..3b120be 100644
--- a/lisp/net/newst-backend.el
+++ b/lisp/net/newst-backend.el
@@ -1,6 +1,6 @@
 ;;; newst-backend.el --- Retrieval backend for newsticker  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author:      Ulf Jasper <ulf.jasper@web.de>
 ;; Filename:    newst-backend.el
diff --git a/lisp/net/newst-plainview.el b/lisp/net/newst-plainview.el
index 98f55a7..44d2fd6 100644
--- a/lisp/net/newst-plainview.el
+++ b/lisp/net/newst-plainview.el
@@ -1,6 +1,6 @@
 ;;; newst-plainview.el --- Single buffer frontend for newsticker.
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author:      Ulf Jasper <ulf.jasper@web.de>
 ;; Filename:    newst-plainview.el
diff --git a/lisp/net/newst-reader.el b/lisp/net/newst-reader.el
index 7c3a919..b188bd4 100644
--- a/lisp/net/newst-reader.el
+++ b/lisp/net/newst-reader.el
@@ -1,6 +1,6 @@
 ;;; newst-reader.el --- Generic RSS reader functions.
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author:      Ulf Jasper <ulf.jasper@web.de>
 ;; Filename:    newst-reader.el
diff --git a/lisp/net/newst-ticker.el b/lisp/net/newst-ticker.el
index 8e60c1e..275c91a 100644
--- a/lisp/net/newst-ticker.el
+++ b/lisp/net/newst-ticker.el
@@ -1,6 +1,6 @@
 ;; newst-ticker.el --- mode line ticker for newsticker.
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author:      Ulf Jasper <ulf.jasper@web.de>
 ;; Filename:    newst-ticker.el
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index 30db1a3..cf55f66 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -1,6 +1,6 @@
 ;;; newst-treeview.el --- Treeview frontend for newsticker.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author:      Ulf Jasper <ulf.jasper@web.de>
 ;; Filename:    newst-treeview.el
diff --git a/lisp/net/newsticker.el b/lisp/net/newsticker.el
index c949915..34e94ac 100644
--- a/lisp/net/newsticker.el
+++ b/lisp/net/newsticker.el
@@ -1,6 +1,6 @@
 ;;; newsticker.el --- A Newsticker for Emacs. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author:      Ulf Jasper <ulf.jasper@web.de>
 ;; Filename:    newsticker.el
diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el
index 2b30040..3f3e713 100644
--- a/lisp/net/nsm.el
+++ b/lisp/net/nsm.el
@@ -1,6 +1,6 @@
 ;;; nsm.el --- Network Security Manager  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: encryption, security, network
diff --git a/lisp/net/ntlm.el b/lisp/net/ntlm.el
index 6d1cf2d..0450c80 100644
--- a/lisp/net/ntlm.el
+++ b/lisp/net/ntlm.el
@@ -1,6 +1,6 @@
 ;;; ntlm.el --- NTLM (NT LanManager) authentication support  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2001, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Taro Kawagishi <tarok@transpulse.org>
 ;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org>
diff --git a/lisp/net/pop3.el b/lisp/net/pop3.el
index 6f58984..aa34fe7 100644
--- a/lisp/net/pop3.el
+++ b/lisp/net/pop3.el
@@ -1,6 +1,6 @@
 ;;; pop3.el --- Post Office Protocol (RFC 1460) interface  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/net/puny.el b/lisp/net/puny.el
index 5c58fe0..6b3663a 100644
--- a/lisp/net/puny.el
+++ b/lisp/net/puny.el
@@ -1,6 +1,6 @@
 ;;; puny.el --- translate non-ASCII domain names to ASCII  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: mail, net
diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el
index 8609ea8..ab1f43f 100644
--- a/lisp/net/quickurl.el
+++ b/lisp/net/quickurl.el
@@ -1,6 +1,6 @@
 ;;; quickurl.el --- insert a URL based on text at point in buffer
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Pearson <davep@davep.org>
 ;; Created: 1999-05-28
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 63e6eed..22348a1 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1,6 +1,6 @@
 ;;; rcirc.el --- default, simple IRC client          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Ryan Yeske <rcyeske@gmail.com>
 ;; Maintainers: Ryan Yeske <rcyeske@gmail.com>,
@@ -416,6 +416,9 @@ will be killed."
 (defvar rcirc-server-buffer nil
   "The server buffer associated with this channel buffer.")
 
+(defvar rcirc-server-parameters nil
+  "List of parameters received from the server.")
+
 (defvar rcirc-target nil
   "The channel or user associated with this buffer.")
 
@@ -586,6 +589,7 @@ If ARG is non-nil, instead prompt for connection 
parameters."
       (setq-local rcirc-user-disconnect nil)
       (setq-local rcirc-user-authenticated nil)
       (setq-local rcirc-connecting t)
+      (setq-local rcirc-server-parameters nil)
 
       (add-hook 'auto-save-hook 'rcirc-log-write)
 
@@ -1503,7 +1507,7 @@ is found by looking up RESPONSE in 
`rcirc-response-formats'."
 (make-variable-buffer-local 'rcirc-last-sender)
 
 (defcustom rcirc-omit-threshold 100
-  "Number of lines since last activity from a nick before 
`rcirc-omit-responses' are omitted."
+  "Lines since last activity from a nick before `rcirc-omit-responses' are 
omitted."
   :type 'integer)
 
 (defcustom rcirc-log-process-buffers nil
@@ -2873,9 +2877,28 @@ Not in rfc1459.txt"
 (defun rcirc-handler-433 (process sender args text)
   "ERR_NICKNAMEINUSE"
   (rcirc-handler-generic process "433" sender args text)
-  (let* ((new-nick (concat (cadr args) "`")))
-    (with-rcirc-process-buffer process
-      (rcirc-cmd-nick new-nick nil process))))
+  (with-rcirc-process-buffer process
+    (let* ((length (string-to-number
+                    (or (rcirc-server-parameter-value 'nicklen)
+                        "16"))))
+      (rcirc-cmd-nick (rcirc--make-new-nick (cadr args) length) nil process))))
+
+(defun rcirc--make-new-nick (nick length)
+  ;; If we already have some ` chars at the end, then shorten the
+  ;; non-` bit of the name.
+  (when (= (length nick) length)
+    (setq nick (replace-regexp-in-string "[^`]\\(`+\\)\\'" "\\1" nick)))
+  (concat
+   (if (>= (length nick) length)
+       (substring nick 0 (1- length))
+     nick)
+   "`"))
+
+(defun rcirc-handler-005 (process sender args text)
+  "ERR_NICKNAMEINUSE"
+  (rcirc-handler-generic process "005" sender args text)
+  (with-rcirc-process-buffer process
+    (setq rcirc-server-parameters (append rcirc-server-parameters args))))
 
 (defun rcirc-authenticate ()
   "Send authentication to process associated with current buffer.
@@ -3072,6 +3095,13 @@ Passwords are stored in `rcirc-authinfo' (which see)."
   (>= (point) rcirc-prompt-end-marker))
 
 
+(defun rcirc-server-parameter-value (parameter)
+  (cl-loop for elem in rcirc-server-parameters
+           for setting = (split-string elem "=")
+           when (and (= (length setting) 2)
+                     (string-equal (downcase (car setting)) parameter))
+           return (cadr setting)))
+
 (provide 'rcirc)
 
 ;;; rcirc.el ends here
diff --git a/lisp/net/rfc2104.el b/lisp/net/rfc2104.el
index b008c9a..c03ac5a 100644
--- a/lisp/net/rfc2104.el
+++ b/lisp/net/rfc2104.el
@@ -1,6 +1,6 @@
 ;;; rfc2104.el --- RFC2104 Hashed Message Authentication Codes  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <jas@pdc.kth.se>
 ;; Keywords: mail
diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el
index 6c960a1..3136e53 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/net/rlogin.el
@@ -1,6 +1,6 @@
 ;;; rlogin.el --- remote login interface  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1992-1995, 1997-1998, 2001-2020 Free Software
+;; Copyright (C) 1992-1995, 1997-1998, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Noah Friedman <friedman@splode.com>
diff --git a/lisp/net/sasl-cram.el b/lisp/net/sasl-cram.el
index 3810572..bc2612d 100644
--- a/lisp/net/sasl-cram.el
+++ b/lisp/net/sasl-cram.el
@@ -1,6 +1,6 @@
 ;;; sasl-cram.el --- CRAM-MD5 module for the SASL client framework
 
-;; Copyright (C) 2000, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@gnu.org>
 ;;     Kenichi OKADA <okada@opaopa.org>
diff --git a/lisp/net/sasl-digest.el b/lisp/net/sasl-digest.el
index ea0b82c..efc8f82 100644
--- a/lisp/net/sasl-digest.el
+++ b/lisp/net/sasl-digest.el
@@ -1,6 +1,6 @@
 ;;; sasl-digest.el --- DIGEST-MD5 module for the SASL client framework
 
-;; Copyright (C) 2000, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;;     Kenichi OKADA <okada@opaopa.org>
diff --git a/lisp/net/sasl-ntlm.el b/lisp/net/sasl-ntlm.el
index 6882c23..6658226 100644
--- a/lisp/net/sasl-ntlm.el
+++ b/lisp/net/sasl-ntlm.el
@@ -1,6 +1,6 @@
 ;;; sasl-ntlm.el --- NTLM (NT Lan Manager) module for the SASL client framework
 
-;; Copyright (C) 2000, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Taro Kawagishi <tarok@transpulse.org>
 ;; Keywords: SASL, NTLM
diff --git a/lisp/net/sasl-scram-rfc.el b/lisp/net/sasl-scram-rfc.el
index 8de52de..91d7666 100644
--- a/lisp/net/sasl-scram-rfc.el
+++ b/lisp/net/sasl-scram-rfc.el
@@ -1,6 +1,6 @@
 ;;; sasl-scram-rfc.el --- SCRAM-SHA-1 module for the SASL client framework  
-*- lexical-binding: t; -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Magnus Henoch <magnus.henoch@gmail.com>
 ;; Package: sasl
diff --git a/lisp/net/sasl-scram-sha256.el b/lisp/net/sasl-scram-sha256.el
index e50a032..c1df988 100644
--- a/lisp/net/sasl-scram-sha256.el
+++ b/lisp/net/sasl-scram-sha256.el
@@ -1,6 +1,6 @@
 ;;; sasl-scram-sha256.el --- SCRAM-SHA-256 module for the SASL client 
framework  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;; Package: sasl
diff --git a/lisp/net/sasl.el b/lisp/net/sasl.el
index ab118e1..7f0431a 100644
--- a/lisp/net/sasl.el
+++ b/lisp/net/sasl.el
@@ -1,6 +1,6 @@
 ;;; sasl.el --- SASL client framework
 
-;; Copyright (C) 2000, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@gnu.org>
 ;; Keywords: SASL
diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el
index e8ef185..ad27167 100644
--- a/lisp/net/secrets.el
+++ b/lisp/net/secrets.el
@@ -1,6 +1,6 @@
 ;;; secrets.el --- Client interface to gnome-keyring and kwallet. -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm password passphrase
diff --git a/lisp/net/shr-color.el b/lisp/net/shr-color.el
index ce55ca6..ac1f701 100644
--- a/lisp/net/shr-color.el
+++ b/lisp/net/shr-color.el
@@ -1,6 +1,6 @@
 ;;; shr-color.el --- Simple HTML Renderer color management  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Julien Danjou <julien@danjou.info>
 ;; Keywords: html
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 2e5dd5f..9c3740f 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1,6 +1,6 @@
 ;;; shr.el --- Simple HTML Renderer -*- lexical-binding: t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: html
@@ -1516,8 +1516,9 @@ ones, in case fg and bg are nil."
       plist)))
 
 (defun shr-tag-base (dom)
-  (when-let* ((base (dom-attr dom 'href)))
-    (setq shr-base (shr-parse-base base)))
+  (let ((base (dom-attr dom 'href)))
+    (when (> (length base) 0)
+      (setq shr-base (shr-parse-base base))))
   (shr-generic dom))
 
 (defun shr-tag-a (dom)
diff --git a/lisp/net/sieve-manage.el b/lisp/net/sieve-manage.el
index f9224b2..c4d6ec4 100644
--- a/lisp/net/sieve-manage.el
+++ b/lisp/net/sieve-manage.el
@@ -1,6 +1,6 @@
 ;;; sieve-manage.el --- Implementation of the managesieve protocol in elisp  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;;         Albert Krewinkel <tarleb@moltkeplatz.de>
diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el
index b3d511c..fbc4e75 100644
--- a/lisp/net/sieve-mode.el
+++ b/lisp/net/sieve-mode.el
@@ -1,6 +1,6 @@
 ;;; sieve-mode.el --- Sieve code editing commands for Emacs  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 
diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el
index ae96134..ca10026 100644
--- a/lisp/net/sieve.el
+++ b/lisp/net/sieve.el
@@ -1,6 +1,6 @@
 ;;; sieve.el --- Utilities to manage sieve scripts
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 
@@ -360,8 +360,8 @@ Used to bracket operations which move point in the 
sieve-buffer."
         (if (not (sieve-manage-ok-p err))
             (message "Sieve upload failed: %s" (nth 2 err))
           (message "Sieve upload done.  Use %s to manage scripts."
-                   (substitute-command-keys "\\[sieve-manage]"))
-          (set-buffer-modified-p nil))))))
+                   (substitute-command-keys "\\[sieve-manage]"))))
+      (set-buffer-modified-p nil))))
 
 ;;;###autoload
 (defun sieve-upload-and-bury (&optional name)
diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el
index df0fd1d..983e6d9 100644
--- a/lisp/net/snmp-mode.el
+++ b/lisp/net/snmp-mode.el
@@ -1,6 +1,6 @@
 ;;; snmp-mode.el --- SNMP & SNMPv2 MIB major mode
 
-;; Copyright (C) 1995, 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Paul D. Smith <psmith@BayNetworks.com>
 ;; Keywords: data
diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el
index 241ce9e..3cc5569 100644
--- a/lisp/net/soap-client.el
+++ b/lisp/net/soap-client.el
@@ -1,6 +1,6 @@
 ;;; soap-client.el --- Access SOAP web services       -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Alexandru Harsanyi <AlexHarsanyi@gmail.com>
 ;; Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
diff --git a/lisp/net/soap-inspect.el b/lisp/net/soap-inspect.el
index 54d196b..604e35c 100644
--- a/lisp/net/soap-inspect.el
+++ b/lisp/net/soap-inspect.el
@@ -1,6 +1,6 @@
 ;;; soap-inspect.el --- Interactive WSDL inspector    -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Alexandru Harsanyi <AlexHarsanyi@gmail.com>
 ;; Created: October 2010
diff --git a/lisp/net/socks.el b/lisp/net/socks.el
index 9b22a50..0d48fd7 100644
--- a/lisp/net/socks.el
+++ b/lisp/net/socks.el
@@ -1,6 +1,6 @@
 ;;; socks.el --- A Socks v5 Client for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1996-2000, 2002, 2007-2020 Free Software Foundation,
+;; Copyright (C) 1996-2000, 2002, 2007-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: William M. Perry <wmperry@gnu.org>
@@ -260,7 +260,7 @@
     (setq state (process-get proc 'socks-state))
     (cond
      ((= state socks-state-waiting-for-auth)
-      (cl-callf (lambda (s) (setq string (concat string s)))
+      (cl-callf (lambda (s) (setq string (concat s string)))
           (process-get proc 'socks-scratch))
       (if (< (length string) 2)
          nil                           ; We need to spin some more
@@ -272,7 +272,7 @@
      ((= state socks-state-authenticated)
       )
      ((= state socks-state-waiting)
-      (cl-callf (lambda (s) (setq string (concat string s)))
+      (cl-callf (lambda (s) (setq string (concat s string)))
           (process-get proc 'socks-scratch))
       (setq version (process-get proc 'socks-server-protocol))
       (cond
@@ -542,7 +542,7 @@
                              service))
         (process-put proc 'socks-buffer buffer)
         (process-put proc 'socks-host host)
-        (process-put proc 'socks-service host)
+        (process-put proc 'socks-service service)
         (set-process-filter proc nil)
         (set-process-buffer proc (if buffer (get-buffer-create buffer)))
         proc))))
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index 872c9f6..67f8444 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -1,6 +1,6 @@
 ;;; telnet.el --- run a telnet session from within an Emacs buffer
 
-;; Copyright (C) 1985, 1988, 1992, 1994, 2001-2020 Free Software
+;; Copyright (C) 1985, 1988, 1992, 1994, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: William F. Schelter
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 4947d16..c0c215d 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1,6 +1,6 @@
 ;;; tramp-adb.el --- Functions for calling Android Debug Bridge from Tramp  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Jürgen Hötzel <juergen@archlinux.org>
 ;; Keywords: comm, processes
@@ -929,7 +929,7 @@ alternative implementation will be used."
          (unless (or (null sentinel) (functionp sentinel))
            (signal 'wrong-type-argument (list #'functionp sentinel)))
          (unless (or (null stderr) (bufferp stderr) (stringp stderr))
-           (signal 'wrong-type-argument (list #'stringp stderr)))
+           (signal 'wrong-type-argument (list #'bufferp stderr)))
          (when (and (stringp stderr) (tramp-tramp-file-p stderr)
                     (not (tramp-equal-remote default-directory stderr)))
            (signal 'file-error (list "Wrong stderr" stderr)))
@@ -981,7 +981,11 @@ alternative implementation will be used."
                      ;; otherwise we might be interrupted by
                      ;; `verify-visited-file-modtime'.
                      (let ((buffer-undo-list t)
-                           (inhibit-read-only t))
+                           (inhibit-read-only t)
+                           (coding-system-for-write
+                            (if (symbolp coding) coding (car coding)))
+                           (coding-system-for-read
+                            (if (symbolp coding) coding (cdr coding))))
                        (clear-visited-file-modtime)
                        (narrow-to-region (point-max) (point-max))
                        ;; We call `tramp-adb-maybe-open-connection',
@@ -1127,6 +1131,13 @@ This happens for Android >= 4.0."
   (if (string-match-p "[[:multibyte:]]" command)
       ;; Multibyte codepoints with four bytes are not supported at
       ;; least by toybox.
+
+      ;; 
<https://android.stackexchange.com/questions/226638/how-to-use-multibyte-file-names-in-adb-shell/232379#232379>
+      ;; mksh uses UTF-8 internally, but is currently limited to the
+      ;; BMP (basic multilingua plane), which means U+0000 to
+      ;; U+FFFD. If you want to use SMP codepoints (U-00010000 to
+      ;; U-0010FFFD) on the input line, you currently have to disable
+      ;; the UTF-8 mode (sorry).
       (tramp-adb-execute-adb-command vec "shell" command)
 
     (unless neveropen (tramp-adb-maybe-open-connection vec))
@@ -1260,6 +1271,9 @@ connection if a previous connection has died for some 
reason."
            (process-put p 'adjust-window-size-function #'ignore)
            (set-process-query-on-exit-flag p nil)
 
+           ;; Set connection-local variables.
+           (tramp-set-connection-local-variables vec)
+
            ;; Change prompt.
            (tramp-set-connection-property
             p "prompt" (regexp-quote (format "///%s#$" prompt)))
@@ -1312,9 +1326,6 @@ connection if a previous connection has died for some 
reason."
                (tramp-error
                 vec 'file-error "Cannot switch to user `%s'" user)))
 
-           ;; Set connection-local variables.
-           (tramp-set-connection-local-variables vec)
-
            ;; Mark it as connected.
            (tramp-set-connection-property p "connected" t)))))))
 
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index 931a971..0bbd927 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -1,6 +1,6 @@
 ;;; tramp-archive.el --- Tramp archive manager  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 970e2ee..2b0a4d9 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -1,6 +1,6 @@
 ;;; tramp-cache.el --- file information caching for Tramp  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2000, 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel Pittman <daniel@inanna.danann.net>
 ;;         Michael Albinus <michael.albinus@gmx.de>
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 622116d..097f25e 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -1,6 +1,6 @@
 ;;; tramp-cmds.el --- Interactive commands for Tramp  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -159,9 +159,6 @@ When called interactively, a Tramp connection has to be 
selected."
 This includes password cache, file cache, connection cache, buffers."
   (interactive)
 
-  ;; Unlock Tramp.
-  (setq tramp-locked nil)
-
   ;; Flush password cache.
   (password-reset)
 
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index b44eabc..87e5378 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -1,6 +1,6 @@
 ;;; tramp-compat.el --- Tramp compatibility functions  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
index 4d34bbb..dfe5462 100644
--- a/lisp/net/tramp-crypt.el
+++ b/lisp/net/tramp-crypt.el
@@ -1,6 +1,6 @@
 ;;; tramp-crypt.el --- Tramp crypt utilities  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el
index 329a490..fa2df89 100644
--- a/lisp/net/tramp-ftp.el
+++ b/lisp/net/tramp-ftp.el
@@ -1,6 +1,6 @@
 ;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index f3d03d0..f882636 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1,6 +1,6 @@
 ;;; tramp-gvfs.el --- Tramp access functions for GVFS daemon  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -49,12 +49,12 @@
 
 ;; The user option `tramp-gvfs-methods' contains the list of supported
 ;; connection methods.  Per default, these are "afp", "dav", "davs",
-;; "gdrive", "media", "nextcloud" and "sftp".
+;; "gdrive", "mtp", "nextcloud" and "sftp".
 
 ;; "gdrive" and "nextcloud" connection methods require a respective
 ;; account in GNOME Online Accounts, with enabled "Files" service.
 
-;; The "media" connection method is responsible for media devices,
+;; The "mtp" connection method is responsible for media devices,
 ;; like cell phones, tablets, cameras etc.  The device must already be
 ;; connected via USB, before accessing it.
 
@@ -131,7 +131,7 @@
 
 ;;;###tramp-autoload
 (defcustom tramp-gvfs-methods
-  '("afp" "dav" "davs" "gdrive" "media" "nextcloud" "sftp")
+  '("afp" "dav" "davs" "gdrive" "mtp" "nextcloud" "sftp")
   "List of methods for remote files, accessed with GVFS."
   :group 'tramp
   :version "28.1"
@@ -142,7 +142,7 @@
                         (const "gdrive")
                         (const "http")
                         (const "https")
-                        (const "media")
+                        (const "mtp")
                         (const "nextcloud")
                         (const "sftp")
                         (const "smb"))))
@@ -159,7 +159,7 @@
 
 ;;;###tramp-autoload
 (defvar tramp-media-methods '("afc" "gphoto2" "mtp")
-  "List of GVFS methods which are covered by the \"media\" method.
+  "List of GVFS methods which are covered by the \"mtp\" method.
 They are checked during start up via
 `tramp-gvfs-interface-remotevolumemonitor'.")
 
@@ -1434,6 +1434,9 @@ If FILE-SYSTEM is non-nil, return file system attributes."
        (unless (process-live-p p)
          (tramp-error
           p 'file-notify-error "Monitoring not supported for `%s'" file-name))
+       ;; Set "gio-file-monitor" property.  We believe, that "gio
+       ;; monitor" uses polling when applied for mounted files.
+       (tramp-set-connection-property p "gio-file-monitor" 'GPollFileMonitor)
        p))))
 
 (defun tramp-gvfs-monitor-process-filter (proc string)
@@ -1636,7 +1639,7 @@ ID-FORMAT valid values are `string' and `integer'."
   (if (tramp-tramp-file-p filename)
       (with-parsed-tramp-file-name filename nil
        ;; Ensure that media devices are cached.
-       (when (string-equal method "media")
+       (when (string-equal method "mtp")
          (tramp-get-media-device v))
        (with-tramp-connection-property v "activation-uri"
          (setq localname "/")
@@ -1646,7 +1649,7 @@ ID-FORMAT valid values are `string' and `integer'."
            (setq method "davs"
                  localname
                  (concat (tramp-gvfs-get-remote-prefix v) localname)))
-         (when (string-equal "media" method)
+         (when (string-equal "mtp" method)
            (when-let
                ((media (tramp-get-connection-property v "media-device" nil)))
              (setq method (tramp-media-device-method media)
@@ -2055,7 +2058,7 @@ and \"org.gtk.Private.RemoteVolumeMonitor.VolumeRemoved\" 
signals."
           (uri (url-generic-parse-url (nth 5 volume)))
           (method (url-type uri))
           (vec (make-tramp-file-name
-                :method "media"
+                :method "mtp"
                 ;; A host name cannot contain spaces.
                 :host (tramp-compat-string-replace " " "_" (nth 1 volume))))
           (media (make-tramp-media-device
@@ -2112,7 +2115,10 @@ connection if a previous connection has died for some 
reason."
              :buffer (tramp-get-connection-buffer vec)
              :server t :host 'local :service t :noquery t)))
       (process-put p 'vector vec)
-      (set-process-query-on-exit-flag p nil)))
+      (set-process-query-on-exit-flag p nil)
+
+      ;; Set connection-local variables.
+      (tramp-set-connection-local-variables vec)))
 
   (unless (tramp-gvfs-connection-mounted-p vec)
     (let ((method (tramp-file-name-method vec))
@@ -2216,9 +2222,6 @@ connection if a previous connection has died for some 
reason."
          (and (functionp tramp-password-save-function)
               (funcall tramp-password-save-function)))
 
-       ;; Set connection-local variables.
-       (tramp-set-connection-local-variables vec)
-
        ;; Mark it as connected.
        (tramp-set-connection-property
         (tramp-get-connection-process vec) "connected" t)))))
@@ -2360,7 +2363,7 @@ VEC is used only for traces."
                              tramp-gvfs-interface-remotevolumemonitor "List")))
        (let* ((uri (url-generic-parse-url (nth 5 volume)))
               (vec (make-tramp-file-name
-                    :method "media"
+                    :method "mtp"
                     ;; A host name cannot contain spaces.
                     :host (tramp-compat-string-replace " " "_" (nth 1 
volume))))
               (media (make-tramp-media-device
@@ -2373,12 +2376,12 @@ VEC is used only for traces."
          (tramp-set-connection-property vec "media-device" media)
          (tramp-set-connection-property media "vector" vec))))
 
-    ;; Adapt default host name, supporting /media:: when possible.
+    ;; Adapt default host name, supporting /mtp:: when possible.
     (setq tramp-default-host-alist
          (append
-          `(("media" nil ,(if (= (length devices) 1) (car devices) "")))
+          `(("mtp" nil ,(if (= (length devices) 1) (car devices) "")))
           (delete
-           (assoc "media" tramp-default-host-alist)
+           (assoc "mtp" tramp-default-host-alist)
            tramp-default-host-alist)))))
 
 (defun tramp-parse-media-names (service)
@@ -2495,7 +2498,7 @@ This uses \"avahi-browse\" in case D-Bus is not enabled 
in Avahi."
     ;; Add completion functions for media devices.
     (tramp-get-media-devices nil)
     (tramp-set-completion-function
-     "media"
+     "mtp"
      (mapcar
       (lambda (method) `(tramp-parse-media-names ,(format "_%s._tcp" method)))
       tramp-media-methods))))
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el
index 566c673..64b5b48 100644
--- a/lisp/net/tramp-integration.el
+++ b/lisp/net/tramp-integration.el
@@ -1,6 +1,6 @@
 ;;; tramp-integration.el --- Tramp integration into other packages  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 4790bb4..8638bb4 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -1,6 +1,6 @@
 ;;; tramp-rclone.el --- Tramp access functions to cloud storages  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 137f085..865ea4e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1,6 +1,6 @@
 ;;; tramp-sh.el --- Tramp access functions for (s)sh-like connections  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; (copyright statements below in code to be updated with the above notice)
 
@@ -58,8 +58,7 @@ If it is nil, no compression at all will be applied."
 
 ;;;###tramp-autoload
 (defcustom tramp-copy-size-limit 10240
-  "The maximum file size where inline copying is preferred over an \
-out-of-the-band copy.
+  "Maximum file size where inline copying is preferred to an out-of-the-band 
copy.
 If it is nil, out-of-the-band copy will be used without a check."
   :group 'tramp
   :type '(choice (const nil) integer))
@@ -782,7 +781,7 @@ characters need to be doubled.")
 (defconst tramp-perl-encode
   "%p -e '
 # This script contributed by Juanma Barranquero <lektu@terra.es>.
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 use strict;
 
 my %%trans = do {
@@ -821,7 +820,7 @@ characters need to be doubled.")
 (defconst tramp-perl-decode
   "%p -e '
 # This script contributed by Juanma Barranquero <lektu@terra.es>.
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 use strict;
 
 my %%trans = do {
@@ -2235,7 +2234,7 @@ the uid and gid from FILENAME."
                     (file-writable-p (concat prefix localname2))))
            (tramp-do-copy-or-rename-file-directly
             op (concat prefix localname1) (concat prefix localname2)
-            ok-if-already-exists keep-date t)
+            ok-if-already-exists keep-date preserve-uid-gid)
            ;; We must change the ownership to the local user.
            (tramp-set-file-uid-gid
             (concat prefix localname2)
@@ -2871,7 +2870,7 @@ implementation will be used."
          (unless (or (null sentinel) (functionp sentinel))
            (signal 'wrong-type-argument (list #'functionp sentinel)))
          (unless (or (null stderr) (bufferp stderr) (stringp stderr))
-           (signal 'wrong-type-argument (list #'stringp stderr)))
+           (signal 'wrong-type-argument (list #'bufferp stderr)))
          (when (and (stringp stderr) (tramp-tramp-file-p stderr)
                     (not (tramp-equal-remote default-directory stderr)))
            (signal 'file-error (list "Wrong stderr" stderr)))
@@ -2944,7 +2943,8 @@ implementation will be used."
                                 (mapconcat
                                  #'tramp-shell-quote-argument uenv " "))
                              "")
-                           (if heredoc (format "<<'%s'" tramp-end-of-heredoc) 
"")
+                           (if heredoc
+                               (format "<<'%s'" tramp-end-of-heredoc) "")
                            (if tmpstderr (format "2>'%s'" tmpstderr) "")
                            (mapconcat #'tramp-shell-quote-argument env " ")
                            (if heredoc
@@ -2984,7 +2984,11 @@ implementation will be used."
                      ;; `verify-visited-file-modtime'.
                      (let ((buffer-undo-list t)
                            (inhibit-read-only t)
-                           (mark (point-max)))
+                           (mark (point-max))
+                           (coding-system-for-write
+                            (if (symbolp coding) coding (car coding)))
+                           (coding-system-for-read
+                            (if (symbolp coding) coding (cdr coding))))
                        (clear-visited-file-modtime)
                        (narrow-to-region (point-max) (point-max))
                        ;; We call `tramp-maybe-open-connection', in
@@ -3562,7 +3566,7 @@ implementation will be used."
 
          ;; Make `last-coding-system-used' have the right value.
          (when coding-system-used
-           (set 'last-coding-system-used coding-system-used))))
+            (setq last-coding-system-used coding-system-used))))
 
       (tramp-flush-file-properties v localname)
 
@@ -3834,6 +3838,10 @@ Fall back to normal file name handler if no Tramp 
handler exists."
        (unless (process-live-p p)
          (tramp-error
           p 'file-notify-error "Monitoring not supported for `%s'" file-name))
+       ;; Set "gio-file-monitor" property if needed.
+       (when (string-equal (file-name-nondirectory command) "gio")
+         (tramp-set-connection-property
+          p "gio-file-monitor" (tramp-get-remote-gio-file-monitor v)))
        p))))
 
 (defun tramp-sh-gio-monitor-process-filter (proc string)
@@ -4910,7 +4918,8 @@ Goes through the list `tramp-inline-compress-commands'."
 (defun tramp-timeout-session (vec)
   "Close the connection VEC after a session timeout.
 If there is just some editing, retry it after 5 seconds."
-  (if (and tramp-locked tramp-locker
+  (if (and (tramp-get-connection-property
+           (tramp-get-connection-process vec) "locked" nil)
           (tramp-file-name-equal-p vec (car tramp-current-connection)))
       (progn
        (tramp-message
@@ -5030,6 +5039,9 @@ connection if a previous connection has died for some 
reason."
 
                (tramp-message vec 6 "%s" (string-join (process-command p) " "))
 
+               ;; Set connection-local variables.
+               (tramp-set-connection-local-variables vec)
+
                ;; Check whether process is alive.
                (tramp-barf-if-no-shell-prompt
                 p 10
@@ -5139,9 +5151,6 @@ connection if a previous connection has died for some 
reason."
                  (setq options ""
                        target-alist (cdr target-alist)))
 
-               ;; Set connection-local variables.
-               (tramp-set-connection-local-variables vec)
-
                ;; Activate session timeout.
                (when (tramp-get-connection-property p "session-timeout" nil)
                  (run-at-time
@@ -5753,6 +5762,30 @@ This command is returned only if 
`delete-by-moving-to-trash' is non-nil."
     (tramp-message vec 5 "Finding a suitable `gio-monitor' command")
     (tramp-find-executable vec "gio" (tramp-get-remote-path vec) t t)))
 
+(defun tramp-get-remote-gio-file-monitor (vec)
+  "Determine remote GFileMonitor."
+  (with-tramp-connection-property vec "gio-file-monitor"
+    (with-current-buffer (tramp-get-connection-buffer vec)
+      (tramp-message vec 5 "Finding the used GFileMonitor")
+      (when-let ((gio (tramp-get-remote-gio-monitor vec)))
+       ;; Search for the used FileMonitor.  There is no known way to
+       ;; get this information directly from gio, so we check for
+       ;; linked libraries of libgio.
+       (when (tramp-send-command-and-check vec (concat "ldd " gio))
+         (goto-char (point-min))
+         (when (re-search-forward "\\S-+/libgio\\S-+")
+           (when (tramp-send-command-and-check
+                  vec (concat "strings " (match-string 0)))
+             (goto-char (point-min))
+             (re-search-forward
+              (format
+               "^%s$"
+               (regexp-opt
+                '("GFamFileMonitor" "GFenFileMonitor"
+                  "GInotifyFileMonitor" "GKqueueFileMonitor")))
+              nil 'noerror)
+             (intern (match-string 0)))))))))
+
 (defun tramp-get-remote-gvfs-monitor-dir (vec)
   "Determine remote `gvfs-monitor-dir' command."
   (with-tramp-connection-property vec "gvfs-monitor-dir"
@@ -6109,4 +6142,9 @@ function cell is returned to be applied on a buffer."
 ;;
 ;; * Implement `:stderr' of `make-process' as pipe process.
 
+;; * One interesting solution (with other applications as well) would
+;;   be to stipulate, as a directory or connection-local variable, an
+;;   additional rc file on the remote machine that is sourced every
+;;   time Tramp connects.  <https://emacs.stackexchange.com/questions/62306>
+
 ;;; tramp-sh.el ends here
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index e521371..1604e89 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1,6 +1,6 @@
 ;;; tramp-smb.el --- Tramp access functions for SMB servers  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -2040,6 +2040,9 @@ If ARGUMENT is non-nil, use it as argument for
              (process-put p 'adjust-window-size-function #'ignore)
              (set-process-query-on-exit-flag p nil)
 
+             ;; Set connection-local variables.
+             (tramp-set-connection-local-variables vec)
+
              (condition-case err
                  (let ((inhibit-message t))
                    ;; Play login scenario.
@@ -2073,9 +2076,6 @@ If ARGUMENT is non-nil, use it as argument for
                    (tramp-set-connection-property p "smb-share" share)
                    (tramp-set-connection-property p "chunksize" 1)
 
-                   ;; Set connection-local variables.
-                   (tramp-set-connection-local-variables vec)
-
                    ;; Mark it as connected.
                    (tramp-set-connection-property p "connected" t))
 
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index 558a57b..5bb1546 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -1,6 +1,6 @@
 ;;; tramp-sudoedit.el --- Functions for accessing under root permissions  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/lisp/net/tramp-uu.el b/lisp/net/tramp-uu.el
index f368f72..5171b9d 100644
--- a/lisp/net/tramp-uu.el
+++ b/lisp/net/tramp-uu.el
@@ -1,6 +1,6 @@
 ;;; tramp-uu.el --- uuencode in Lisp  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b3853aa..cc8dda8 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1,16 +1,12 @@
 ;;; tramp.el --- Transparent Remote Access, Multiple Protocol  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;;         Michael Albinus <michael.albinus@gmx.de>
 ;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
 ;; Package: tramp
-;; Version: 2.5.0-pre
-;; Package-Requires: ((emacs "25.1"))
-;; Package-Type: multi
-;; URL: https://savannah.gnu.org/projects/tramp
 
 ;; This file is part of GNU Emacs.
 
@@ -1022,8 +1018,8 @@ See `tramp-file-name-structure'."
    5 6 7 8 1))
 
 (defvar tramp-file-name-structure nil ;Initialized when defining 
`tramp-syntax'!
-  "List of six elements (REGEXP METHOD USER HOST FILE HOP), detailing \
-the Tramp file name structure.
+  "List detailing the Tramp file name structure.
+This is a list of six elements (REGEXP METHOD USER HOST FILE HOP).
 
 The first element REGEXP is a regular expression matching a Tramp file
 name.  The regex should contain parentheses around the method name,
@@ -2349,33 +2345,6 @@ Must be handled by the callers."
                res (cdr elt))))
       res)))
 
-;; In Emacs, there is some concurrency due to timers.  If a timer
-;; interrupts Tramp and wishes to use the same connection buffer as
-;; the "main" Emacs, then garbage might occur in the connection
-;; buffer.  Therefore, we need to make sure that a timer does not use
-;; the same connection buffer as the "main" Emacs.  We implement a
-;; cheap global lock, instead of locking each connection buffer
-;; separately.  The global lock is based on two variables,
-;; `tramp-locked' and `tramp-locker'.  `tramp-locked' is set to true
-;; (with setq) to indicate a lock.  But Tramp also calls itself during
-;; processing of a single file operation, so we need to allow
-;; recursive calls.  That's where the `tramp-locker' variable comes in
-;; -- it is let-bound to t during the execution of the current
-;; handler.  So if `tramp-locked' is t and `tramp-locker' is also t,
-;; then we should just proceed because we have been called
-;; recursively.  But if `tramp-locker' is nil, then we are a timer
-;; interrupting the "main" Emacs, and then we signal an error.
-
-(defvar tramp-locked nil
-  "If non-nil, then Tramp is currently busy.
-Together with `tramp-locker', this implements a locking mechanism
-preventing reentrant calls of Tramp.")
-
-(defvar tramp-locker nil
-  "If non-nil, then a caller has locked Tramp.
-Together with `tramp-locked', this implements a locking mechanism
-preventing reentrant calls of Tramp.")
-
 ;; Main function.
 (defun tramp-file-name-handler (operation &rest args)
   "Invoke Tramp file name handler for OPERATION and ARGS.
@@ -2429,17 +2398,7 @@ Fall back to normal file name handler if no Tramp file 
name handler exists."
                        (setq result
                              (catch 'non-essential
                                (catch 'suppress
-                                 (when (and tramp-locked (not tramp-locker))
-                                   (setq tramp-locked nil)
-                                   (tramp-error
-                                    v 'file-error
-                                    "Forbidden reentrant call of Tramp"))
-                                 (let ((tl tramp-locked))
-                                   (setq tramp-locked t)
-                                   (unwind-protect
-                                       (let ((tramp-locker t))
-                                         (apply foreign operation args))
-                                     (setq tramp-locked tl))))))
+                                 (apply foreign operation args))))
                         ;; (tramp-message
                         ;;  v 4 "Running `%s'...`%s'" (cons operation args) 
result)
                        (cond
@@ -3825,16 +3784,33 @@ It does not support `:stderr'."
        (unless (or (null sentinel) (functionp sentinel))
          (signal 'wrong-type-argument (list #'functionp sentinel)))
        (unless (or (null stderr) (bufferp stderr))
-         (signal 'wrong-type-argument (list #'stringp stderr)))
+         (signal 'wrong-type-argument (list #'bufferp stderr)))
 
        (let* ((buffer
                (if buffer
                    (get-buffer-create buffer)
                  ;; BUFFER can be nil.  We use a temporary buffer.
                  (generate-new-buffer tramp-temp-buffer-name)))
+              ;; We use as environment the difference to toplevel
+              ;; `process-environment'.
+              (env (mapcar
+                    (lambda (elt)
+                      (unless
+                          (member
+                           elt (default-toplevel-value 'process-environment))
+                        (when (string-match-p "=" elt) elt)))
+                    process-environment))
+              (env (setenv-internal
+                    env "INSIDE_EMACS"
+                    (concat (or (getenv "INSIDE_EMACS") emacs-version)
+                            ",tramp:" tramp-version)
+                    'keep))
+              (env (mapcar #'tramp-shell-quote-argument (delq nil env)))
+              ;; Quote command.
+              (command (mapconcat #'tramp-shell-quote-argument command " "))
+              ;; Set cwd and environment variables.
               (command
-               (mapconcat
-                #'identity (append `("cd" ,localname "&&") command) " ")))
+               (append `("cd" ,localname "&&" "(" "env") env `(,command ")"))))
 
          ;; Check for `tramp-sh-file-name-handler', because something
          ;; is different between tramp-adb.el and tramp-sh.el.
@@ -3889,7 +3865,7 @@ It does not support `:stderr'."
              (mapcar (lambda (x) (split-string x " ")) login-args))
             p (make-process
                :name name :buffer buffer
-               :command (append `(,login-program) login-args `(,command))
+               :command (append `(,login-program) login-args command)
                :coding coding :noquery noquery :connection-type connection-type
                :filter filter :sentinel sentinel :stderr stderr))
 
@@ -4499,6 +4475,32 @@ performed successfully.  Any other value means an error."
 
 ;;; Utility functions:
 
+;; In Emacs, there is some concurrency due to timers.  If a timer
+;; interrupts Tramp and wishes to use the same connection buffer as
+;; the "main" Emacs, then garbage might occur in the connection
+;; buffer.  Therefore, we need to make sure that a timer does not use
+;; the same connection buffer as the "main" Emacs.  We lock each
+;; connection process separately by a connection property.
+
+(defmacro with-tramp-locked-connection (proc &rest body)
+  "Lock PROC for other communication, and run BODY.
+Mostly useful to protect BODY from being interrupted by timers."
+  (declare (indent 1) (debug t))
+  `(if (tramp-get-connection-property ,proc "locked" nil)
+       ;; Be kind for older Emacsen.
+       (if (member 'remote-file-error debug-ignored-errors)
+          (throw 'non-essential 'non-essential)
+        (tramp-error
+         ,proc 'remote-file-error "Forbidden reentrant call of Tramp"))
+     (unwind-protect
+        (progn
+          (tramp-set-connection-property ,proc "locked" t)
+          ,@body)
+       (tramp-flush-connection-property ,proc "locked"))))
+
+(font-lock-add-keywords
+ 'emacs-lisp-mode '("\\<with-tramp-locked-connection\\>"))
+
 (defun tramp-accept-process-output (proc &optional timeout)
   "Like `accept-process-output' for Tramp processes.
 This is needed in order to hide `last-coding-system-used', which is set
@@ -4508,15 +4510,17 @@ If the user quits via `C-g', it is propagated up to 
`tramp-file-name-handler'."
     (let ((inhibit-read-only t)
          last-coding-system-used
          result)
-      ;; JUST-THIS-ONE is set due to Bug#12145.  `with-local-quit'
-      ;; returns t in order to report success.
-      (if (with-local-quit
-           (setq result (accept-process-output proc timeout nil t)) t)
-         (tramp-message
-          proc 10 "%s %s %s %s\n%s"
-          proc timeout (process-status proc) result (buffer-string))
-       ;; Propagate quit.
-       (keyboard-quit))
+      ;; This must be protected by the "locked" property.
+      (with-tramp-locked-connection proc
+       ;; JUST-THIS-ONE is set due to Bug#12145.  `with-local-quit'
+       ;; returns t in order to report success.
+       (if (with-local-quit
+             (setq result (accept-process-output proc timeout nil t)) t)
+           (tramp-message
+            proc 10 "%s %s %s %s\n%s"
+            proc timeout (process-status proc) result (buffer-string))
+         ;; Propagate quit.
+         (keyboard-quit)))
       result)))
 
 (defun tramp-search-regexp (regexp)
@@ -4633,19 +4637,21 @@ the remote host use line-endings as defined in the 
variable
       (unless (or (string-empty-p string)
                  (string-equal (substring string -1) tramp-rsh-end-of-line))
        (setq string (concat string tramp-rsh-end-of-line)))
-      ;; Send the string.
-      (with-local-quit
-       (if (and chunksize (not (zerop chunksize)))
-           (let ((pos 0)
-                 (end (length string)))
-             (while (< pos end)
-               (tramp-message
-                vec 10 "Sending chunk from %s to %s"
-                pos (min (+ pos chunksize) end))
-               (process-send-string
-                p (substring string pos (min (+ pos chunksize) end)))
-               (setq pos (+ pos chunksize))))
-         (process-send-string p string))))))
+      ;; This must be protected by the "locked" property.
+      (with-tramp-locked-connection p
+       ;; Send the string.
+       (with-local-quit
+         (if (and chunksize (not (zerop chunksize)))
+             (let ((pos 0)
+                   (end (length string)))
+               (while (< pos end)
+                 (tramp-message
+                  vec 10 "Sending chunk from %s to %s"
+                  pos (min (+ pos chunksize) end))
+                 (process-send-string
+                  p (substring string pos (min (+ pos chunksize) end)))
+                 (setq pos (+ pos chunksize))))
+           (process-send-string p string)))))))
 
 (defun tramp-process-sentinel (proc event)
   "Flush file caches and remove shell prompt."
@@ -5210,6 +5216,8 @@ Invokes `password-read' if available, `read-passwd' else."
                (tramp-check-for-regexp proc tramp-password-prompt-regexp)
                (format "%s for %s " (capitalize (match-string 1)) key))))
         (auth-source-creation-prompts `((secret . ,pw-prompt)))
+        ;; Use connection-local value.
+        (auth-sources (with-current-buffer (process-buffer proc) auth-sources))
         ;; We suspend the timers while reading the password.
          (stimers (with-timeout-suspend))
         auth-info auth-passwd)
@@ -5250,7 +5258,7 @@ Invokes `password-read' if available, `read-passwd' else."
                   (setq auth-passwd (funcall auth-passwd)))
                 auth-passwd)
 
-              ;; Try the password cache.
+              ;; Try the password cache.  Exists since Emacs 26.1.
               (progn
                 (setq auth-passwd (password-read pw-prompt key)
                       tramp-password-save-function
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index d6b582e..714b3f9 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -1,12 +1,16 @@
 ;;; trampver.el --- Transparent Remote Access, Multiple Protocol  -*- 
lexical-binding:t -*-
 ;;; lisp/trampver.el.  Generated from trampver.el.in by configure.
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
 ;; Package: tramp
+;; Version: 2.5.0
+;; Package-Requires: ((emacs "25.1"))
+;; Package-Type: multi
+;; URL: https://www.gnu.org/software/tramp/
 
 ;; This file is part of GNU Emacs.
 
@@ -30,13 +34,13 @@
 
 ;;; Code:
 
-;; In the Tramp GIT, the version number is auto-frobbed from tramp.el,
-;; and the bug report address is auto-frobbed from configure.ac.
-;; Emacs version check is defined in macro AC_EMACS_INFO of
-;; aclocal.m4; should be changed only there.
+;; In the Tramp GIT repository, the version number, the bug report
+;; address and the required Emacs version are auto-frobbed from
+;; configure.ac, so you should edit that file and run "autoconf &&
+;; ./configure" to change them.
 
 ;;;###tramp-autoload
-(defconst tramp-version "2.5.0-pre"
+(defconst tramp-version "2.5.0"
   "This version of Tramp.")
 
 ;;;###tramp-autoload
@@ -72,7 +76,7 @@
 ;; Check for Emacs version.
 (let ((x   (if (not (string-lessp emacs-version "25.1"))
       "ok"
-    (format "Tramp 2.5.0-pre is not fit for %s"
+    (format "Tramp 2.5.0 is not fit for %s"
             (replace-regexp-in-string "\n" "" (emacs-version))))))
   (unless (string-equal "ok" x) (error "%s" x)))
 
diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el
index 9fbc434..9bcf1d3 100644
--- a/lisp/net/webjump.el
+++ b/lisp/net/webjump.el
@@ -1,6 +1,6 @@
 ;;; webjump.el --- programmable Web hotlist  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1996-1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author:    Neil W. Van Dyke <nwv@acm.org>
 ;; Created:   09-Aug-1996
diff --git a/lisp/net/zeroconf.el b/lisp/net/zeroconf.el
index cb3c0f2..d5da73b 100644
--- a/lisp/net/zeroconf.el
+++ b/lisp/net/zeroconf.el
@@ -1,6 +1,6 @@
 ;;; zeroconf.el --- Service browser using Avahi.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, hardware
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 3eb158d..5d0d105 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -1,6 +1,6 @@
 ;;; newcomment.el --- (un)comment regions of buffers -*- lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: code extracted from Emacs-20's simple.el
 ;; Maintainer: Stefan Monnier <monnier@gnu.org>
@@ -304,7 +304,7 @@ This is useful when style-conventions require a certain 
minimal offset.
 Python's PEP8 for example recommends two spaces, so you could do:
 
 \(add-hook \\='python-mode-hook
-   (lambda () (set (make-local-variable \\='comment-inline-offset) 2)))
+   (lambda () (setq-local comment-inline-offset 2)))
 
 See `comment-padding' for whole-line comments."
   :version "24.3"
@@ -361,21 +361,21 @@ function should first call this function explicitly."
       (let ((cs (read-string "No comment syntax is defined.  Use: ")))
        (if (zerop (length cs))
            (error "No comment syntax defined")
-         (set (make-local-variable 'comment-start) cs)
-         (set (make-local-variable 'comment-start-skip) cs))))
+          (setq-local comment-start cs)
+          (setq-local comment-start-skip cs))))
     ;; comment-use-syntax
     (when (eq comment-use-syntax 'undecided)
-      (set (make-local-variable 'comment-use-syntax)
-          (let ((st (syntax-table))
-                (cs comment-start)
-                (ce (if (string= "" comment-end) "\n" comment-end)))
-            ;; Try to skip over a comment using forward-comment
-            ;; to see if the syntax tables properly recognize it.
-            (with-temp-buffer
-              (set-syntax-table st)
-              (insert cs " hello " ce)
-              (goto-char (point-min))
-              (and (forward-comment 1) (eobp))))))
+      (setq-local comment-use-syntax
+                  (let ((st (syntax-table))
+                        (cs comment-start)
+                        (ce (if (string= "" comment-end) "\n" comment-end)))
+                    ;; Try to skip over a comment using forward-comment
+                    ;; to see if the syntax tables properly recognize it.
+                    (with-temp-buffer
+                      (set-syntax-table st)
+                      (insert cs " hello " ce)
+                      (goto-char (point-min))
+                      (and (forward-comment 1) (eobp))))))
     ;; comment-padding
     (unless comment-padding (setq comment-padding 0))
     (when (integerp comment-padding)
@@ -385,9 +385,9 @@ function should first call this function explicitly."
     ;;(setq comment-end (comment-string-strip comment-end nil t))
     ;; comment-continue
     (unless (or comment-continue (string= comment-end ""))
-      (set (make-local-variable 'comment-continue)
-          (concat (if (string-match "\\S-\\S-" comment-start) " " "|")
-                  (substring comment-start 1)))
+      (setq-local comment-continue
+                  (concat (if (string-match "\\S-\\S-" comment-start) " " "|")
+                          (substring comment-start 1)))
       ;; Hasn't been necessary yet.
       ;; (unless (string-match comment-start-skip comment-continue)
       ;;       (kill-local-variable 'comment-continue))
@@ -396,29 +396,29 @@ function should first call this function explicitly."
     (unless (and comment-start-skip
                 ;; In case comment-start has changed since last time.
                 (string-match comment-start-skip comment-start))
-      (set (make-local-variable 'comment-start-skip)
-          (concat (unless (eq comment-use-syntax t)
-                     ;; `syntax-ppss' will detect escaping.
-                     "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)")
-                   "\\(?:\\s<+\\|"
-                  (regexp-quote (comment-string-strip comment-start t t))
-                  ;; Let's not allow any \s- but only [ \t] since \n
-                  ;; might be both a comment-end marker and \s-.
-                  "+\\)[ \t]*")))
+      (setq-local comment-start-skip
+                  (concat (unless (eq comment-use-syntax t)
+                            ;; `syntax-ppss' will detect escaping.
+                            "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)")
+                          "\\(?:\\s<+\\|"
+                          (regexp-quote (comment-string-strip comment-start t 
t))
+                          ;; Let's not allow any \s- but only [ \t] since \n
+                          ;; might be both a comment-end marker and \s-.
+                          "+\\)[ \t]*")))
     (unless (and comment-end-skip
                 ;; In case comment-end has changed since last time.
                 (string-match comment-end-skip
                                (if (string= "" comment-end) "\n" comment-end)))
       (let ((ce (if (string= "" comment-end) "\n"
                  (comment-string-strip comment-end t t))))
-       (set (make-local-variable 'comment-end-skip)
-            ;; We use [ \t] rather than \s- because we don't want to
-            ;; remove ^L in C mode when uncommenting.
-            (concat "[ \t]*\\(\\s>" (if comment-quote-nested "" "+")
-                    "\\|" (regexp-quote (substring ce 0 1))
-                    (if (and comment-quote-nested (<= (length ce) 1)) "" "+")
-                    (regexp-quote (substring ce 1))
-                    "\\)"))))))
+        (setq-local comment-end-skip
+                    ;; We use [ \t] rather than \s- because we don't want to
+                    ;; remove ^L in C mode when uncommenting.
+                    (concat "[ \t]*\\(\\s>" (if comment-quote-nested "" "+")
+                            "\\|" (regexp-quote (substring ce 0 1))
+                            (if (and comment-quote-nested (<= (length ce) 1)) 
"" "+")
+                            (regexp-quote (substring ce 1))
+                            "\\)"))))))
 
 (defun comment-quote-re (str unp)
   (concat (regexp-quote (substring str 0 1))
diff --git a/lisp/notifications.el b/lisp/notifications.el
index f838986..2241afa 100644
--- a/lisp/notifications.el
+++ b/lisp/notifications.el
@@ -1,6 +1,6 @@
 ;;; notifications.el --- Client interface to desktop notifications.
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Julien Danjou <julien@danjou.info>
 ;; Keywords: comm desktop notifications
diff --git a/lisp/novice.el b/lisp/novice.el
index 4771d8d..22eca21 100644
--- a/lisp/novice.el
+++ b/lisp/novice.el
@@ -1,6 +1,6 @@
 ;;; novice.el --- handling of disabled commands ("novice mode") for Emacs
 
-;; Copyright (C) 1985-1987, 1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1985-1987, 1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/nxml/nxml-enc.el b/lisp/nxml/nxml-enc.el
index 3221d80..abdc2e4 100644
--- a/lisp/nxml/nxml-enc.el
+++ b/lisp/nxml/nxml-enc.el
@@ -1,6 +1,6 @@
 ;;; nxml-enc.el --- XML encoding auto-detection  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/nxml-maint.el b/lisp/nxml/nxml-maint.el
index a838eb6..24a3c5c 100644
--- a/lisp/nxml/nxml-maint.el
+++ b/lisp/nxml/nxml-maint.el
@@ -1,6 +1,6 @@
 ;;; nxml-maint.el --- commands for maintainers of nxml-*.el  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index 5bb904e..5bc3049 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -1,6 +1,6 @@
 ;;; nxml-mode.el --- a new XML mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML
@@ -107,8 +107,10 @@ and when the encoding declaration specifies `UTF-16'."
 
 (defcustom nxml-default-buffer-file-coding-system nil
   "Default value for `buffer-file-coding-system' for a buffer for a new file.
-A value of nil means use the default value of `buffer-file-coding-system' as 
normal.
-A buffer's `buffer-file-coding-system' affects what 
\\[nxml-insert-xml-declaration] inserts."
+A value of nil means use the default value of
+`buffer-file-coding-system' as normal.
+A buffer's `buffer-file-coding-system' affects what
+\\[nxml-insert-xml-declaration] inserts."
   :group 'nxml
   :type 'coding-system)
 
diff --git a/lisp/nxml/nxml-ns.el b/lisp/nxml/nxml-ns.el
index 9f6598e..e33140c 100644
--- a/lisp/nxml/nxml-ns.el
+++ b/lisp/nxml/nxml-ns.el
@@ -1,6 +1,6 @@
 ;;; nxml-ns.el --- XML namespace processing  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/nxml-outln.el b/lisp/nxml/nxml-outln.el
index 8fab612..6dca34a 100644
--- a/lisp/nxml/nxml-outln.el
+++ b/lisp/nxml/nxml-outln.el
@@ -1,6 +1,6 @@
 ;;; nxml-outln.el --- outline support for nXML mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2004, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/nxml-parse.el b/lisp/nxml/nxml-parse.el
index e5c785e..d2eb4f1 100644
--- a/lisp/nxml/nxml-parse.el
+++ b/lisp/nxml/nxml-parse.el
@@ -1,6 +1,6 @@
 ;;; nxml-parse.el --- XML parser, sharing infrastructure with nxml-mode  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/nxml-rap.el b/lisp/nxml/nxml-rap.el
index 0d7d95a..6f74274 100644
--- a/lisp/nxml/nxml-rap.el
+++ b/lisp/nxml/nxml-rap.el
@@ -1,6 +1,6 @@
 ;;; nxml-rap.el --- low-level support for random access parsing for nXML mode  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/nxml-util.el b/lisp/nxml/nxml-util.el
index 33c2e67..022d6c5 100644
--- a/lisp/nxml/nxml-util.el
+++ b/lisp/nxml/nxml-util.el
@@ -1,6 +1,6 @@
 ;;; nxml-util.el --- utility functions for nxml-*.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/rng-cmpct.el b/lisp/nxml/rng-cmpct.el
index 296cc26..dcbd7ed 100644
--- a/lisp/nxml/rng-cmpct.el
+++ b/lisp/nxml/rng-cmpct.el
@@ -1,6 +1,6 @@
 ;;; rng-cmpct.el --- parsing of RELAX NG Compact Syntax schemas  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-dt.el b/lisp/nxml/rng-dt.el
index 4aba09a..25d838c 100644
--- a/lisp/nxml/rng-dt.el
+++ b/lisp/nxml/rng-dt.el
@@ -1,6 +1,6 @@
 ;;; rng-dt.el --- datatype library interface for RELAX NG  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-loc.el b/lisp/nxml/rng-loc.el
index 00b2aa7..d5a608d 100644
--- a/lisp/nxml/rng-loc.el
+++ b/lisp/nxml/rng-loc.el
@@ -1,6 +1,6 @@
 ;;; rng-loc.el --- Locate the schema to use for validation  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-maint.el b/lisp/nxml/rng-maint.el
index 67c7c59..82d716d 100644
--- a/lisp/nxml/rng-maint.el
+++ b/lisp/nxml/rng-maint.el
@@ -1,6 +1,6 @@
 ;;; rng-maint.el --- commands for RELAX NG maintainers  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-match.el b/lisp/nxml/rng-match.el
index 928808c..4fc6727 100644
--- a/lisp/nxml/rng-match.el
+++ b/lisp/nxml/rng-match.el
@@ -1,6 +1,6 @@
 ;;; rng-match.el --- matching of RELAX NG patterns against XML events  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-nxml.el b/lisp/nxml/rng-nxml.el
index d0ebdf1..7d74fd3 100644
--- a/lisp/nxml/rng-nxml.el
+++ b/lisp/nxml/rng-nxml.el
@@ -1,6 +1,6 @@
 ;;; rng-nxml.el --- make nxml-mode take advantage of rng-validate-mode  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-parse.el b/lisp/nxml/rng-parse.el
index 8d21aa3..f72f332 100644
--- a/lisp/nxml/rng-parse.el
+++ b/lisp/nxml/rng-parse.el
@@ -1,6 +1,6 @@
 ;;; rng-parse.el --- parse an XML file and validate it against a schema  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-pttrn.el b/lisp/nxml/rng-pttrn.el
index faaee34..12ffa57 100644
--- a/lisp/nxml/rng-pttrn.el
+++ b/lisp/nxml/rng-pttrn.el
@@ -1,6 +1,6 @@
 ;;; rng-pttrn.el --- RELAX NG patterns  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-uri.el b/lisp/nxml/rng-uri.el
index a44a5dd..fda481f 100644
--- a/lisp/nxml/rng-uri.el
+++ b/lisp/nxml/rng-uri.el
@@ -1,6 +1,6 @@
 ;;; rng-uri.el --- URI parsing and manipulation  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/rng-util.el b/lisp/nxml/rng-util.el
index 2b820fd..59465c3 100644
--- a/lisp/nxml/rng-util.el
+++ b/lisp/nxml/rng-util.el
@@ -1,6 +1,6 @@
 ;;; rng-util.el --- utility functions for RELAX NG library
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-valid.el b/lisp/nxml/rng-valid.el
index 803e68b..6ea8934 100644
--- a/lisp/nxml/rng-valid.el
+++ b/lisp/nxml/rng-valid.el
@@ -1,6 +1,6 @@
 ;;; rng-valid.el --- real-time validation of XML using RELAX NG  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-xsd.el b/lisp/nxml/rng-xsd.el
index 02b0cec..81314b8 100644
--- a/lisp/nxml/rng-xsd.el
+++ b/lisp/nxml/rng-xsd.el
@@ -1,6 +1,6 @@
 ;;; rng-xsd.el --- W3C XML Schema datatypes library for RELAX NG  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el
index 9815f4c..8f89598 100644
--- a/lisp/nxml/xmltok.el
+++ b/lisp/nxml/xmltok.el
@@ -1,6 +1,6 @@
 ;;; xmltok.el --- XML tokenization  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/xsd-regexp.el b/lisp/nxml/xsd-regexp.el
index 3ce59b7..f07ca66 100644
--- a/lisp/nxml/xsd-regexp.el
+++ b/lisp/nxml/xsd-regexp.el
@@ -1,6 +1,6 @@
 ;;; xsd-regexp.el --- translate W3C XML Schema regexps to Emacs regexps  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: wp, hypermedia, languages, XML, regexp
diff --git a/lisp/obarray.el b/lisp/obarray.el
index dcd4ca5..ef2ddb3 100644
--- a/lisp/obarray.el
+++ b/lisp/obarray.el
@@ -1,6 +1,6 @@
 ;;; obarray.el --- obarray functions -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: obarray functions
diff --git a/lisp/obsolete/abbrevlist.el b/lisp/obsolete/abbrevlist.el
index bfe0f27..1d517db 100644
--- a/lisp/obsolete/abbrevlist.el
+++ b/lisp/obsolete/abbrevlist.el
@@ -1,6 +1,6 @@
 ;;; abbrevlist.el --- list one abbrev table alphabetically ordered
 
-;; Copyright (C) 1986, 1992, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1986, 1992, 2001-2021 Free Software Foundation, Inc.
 ;; Suggested by a previous version by Gildea.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/obsolete/assoc.el b/lisp/obsolete/assoc.el
index 58b1a95..cb5809b 100644
--- a/lisp/obsolete/assoc.el
+++ b/lisp/obsolete/assoc.el
@@ -1,6 +1,6 @@
 ;;; assoc.el --- insert/delete functions on association lists  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Barry A. Warsaw <bwarsaw@cen.com>
 ;; Keywords: extensions
diff --git a/lisp/obsolete/bruce.el b/lisp/obsolete/bruce.el
index 475eb98..398f315 100644
--- a/lisp/obsolete/bruce.el
+++ b/lisp/obsolete/bruce.el
@@ -1,7 +1,7 @@
 ;;; bruce.el --- bruce phrase utility for overloading the Communications
 ;;; Decency Act snoops, if any.
 
-;; Copyright (C) 1988, 1993, 1997, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1988, 1993, 1997, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/obsolete/cc-compat.el b/lisp/obsolete/cc-compat.el
index ae6447a..96b036e 100644
--- a/lisp/obsolete/cc-compat.el
+++ b/lisp/obsolete/cc-compat.el
@@ -1,6 +1,6 @@
 ;;; cc-compat.el --- cc-mode compatibility with c-mode.el confusion
 
-;; Copyright (C) 1985, 1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;            1994-1999 Barry A. Warsaw
diff --git a/lisp/obsolete/cl-compat.el b/lisp/obsolete/cl-compat.el
index c37fc8e..4abedf3 100644
--- a/lisp/obsolete/cl-compat.el
+++ b/lisp/obsolete/cl-compat.el
@@ -1,6 +1,6 @@
 ;;; cl-compat.el --- Common Lisp extensions for GNU Emacs Lisp (compatibility)
 
-;; Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Version: 2.02
diff --git a/lisp/obsolete/cl.el b/lisp/obsolete/cl.el
index 6a628f3..95af29b 100644
--- a/lisp/obsolete/cl.el
+++ b/lisp/obsolete/cl.el
@@ -1,6 +1,6 @@
 ;;; cl.el --- Compatibility aliases for the old CL library.  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Deprecated-since: 27.1
diff --git a/lisp/obsolete/complete.el b/lisp/obsolete/complete.el
index b1448e7..735e1e0 100644
--- a/lisp/obsolete/complete.el
+++ b/lisp/obsolete/complete.el
@@ -1,6 +1,6 @@
 ;;; complete.el --- partial completion mechanism plus other goodies
 
-;; Copyright (C) 1990-1993, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Keywords: abbrev convenience
diff --git a/lisp/obsolete/crisp.el b/lisp/obsolete/crisp.el
index 18eb0f3..91ff899 100644
--- a/lisp/obsolete/crisp.el
+++ b/lisp/obsolete/crisp.el
@@ -1,6 +1,6 @@
 ;;; crisp.el --- CRiSP/Brief Emacs emulator
 
-;; Copyright (C) 1997-1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Gary D. Foster <Gary.Foster@Corp.Sun.COM>
 ;; Keywords: emulations brief crisp
diff --git a/lisp/obsolete/cust-print.el b/lisp/obsolete/cust-print.el
index 40532ea..c7342b6 100644
--- a/lisp/obsolete/cust-print.el
+++ b/lisp/obsolete/cust-print.el
@@ -1,6 +1,6 @@
 ;;; cust-print.el --- handles print-level and print-circle
 
-;; Copyright (C) 1992, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel LaLiberte <liberte@holonexus.org>
 ;; Adapted-By: ESR
diff --git a/lisp/obsolete/erc-compat.el b/lisp/obsolete/erc-compat.el
index 7ef30d8..203ef07 100644
--- a/lisp/obsolete/erc-compat.el
+++ b/lisp/obsolete/erc-compat.el
@@ -1,6 +1,6 @@
 ;;; erc-compat.el --- ERC compatibility code for XEmacs
 
-;; Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Maintainer: Amin Bandali <bandali@gnu.org>
diff --git a/lisp/obsolete/erc-hecomplete.el b/lisp/obsolete/erc-hecomplete.el
index cd26ede..fce79f7 100644
--- a/lisp/obsolete/erc-hecomplete.el
+++ b/lisp/obsolete/erc-hecomplete.el
@@ -1,6 +1,6 @@
 ;;; erc-hecomplete.el --- Provides Nick name completion for ERC
 
-;; Copyright (C) 2001-2002, 2004, 2006-2020 Free Software Foundation,
+;; Copyright (C) 2001-2002, 2004, 2006-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
diff --git a/lisp/obsolete/eudcb-ph.el b/lisp/obsolete/eudcb-ph.el
index 9f7518b..c7212e3 100644
--- a/lisp/obsolete/eudcb-ph.el
+++ b/lisp/obsolete/eudcb-ph.el
@@ -1,6 +1,6 @@
 ;;; eudcb-ph.el --- Emacs Unified Directory Client - CCSO PH/QI Backend
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;;         Pavel Janík <Pavel@Janik.cz>
diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el
index 9e0198d..8848c89 100644
--- a/lisp/obsolete/fast-lock.el
+++ b/lisp/obsolete/fast-lock.el
@@ -1,6 +1,6 @@
 ;;; fast-lock.el --- automagic text properties caching for fast Font Lock mode
 
-;; Copyright (C) 1994-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Marshall <simon@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/obsolete/gs.el b/lisp/obsolete/gs.el
index 4658f2e..6ab3fc5 100644
--- a/lisp/obsolete/gs.el
+++ b/lisp/obsolete/gs.el
@@ -1,6 +1,6 @@
 ;;; gs.el --- interface to Ghostscript
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
diff --git a/lisp/obsolete/gulp.el b/lisp/obsolete/gulp.el
index 08ab388..0fbaa1c 100644
--- a/lisp/obsolete/gulp.el
+++ b/lisp/obsolete/gulp.el
@@ -1,6 +1,6 @@
 ;;; gulp.el --- ask for updates for Lisp packages
 
-;; Copyright (C) 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Sam Shteingold <shteingd@math.ucla.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/obsolete/html2text.el b/lisp/obsolete/html2text.el
index bc2c8d1..f01561b 100644
--- a/lisp/obsolete/html2text.el
+++ b/lisp/obsolete/html2text.el
@@ -1,6 +1,6 @@
 ;;; html2text.el --- a simple html to plain text converter -*- coding: utf-8 
-*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Joakim Hove <hove@phys.ntnu.no>
 ;; Obsolete-since: 26.1
diff --git a/lisp/obsolete/info-edit.el b/lisp/obsolete/info-edit.el
index ee8f7c1..c8a187c 100644
--- a/lisp/obsolete/info-edit.el
+++ b/lisp/obsolete/info-edit.el
@@ -1,6 +1,6 @@
 ;; info-edit.el --- Editing info files  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: help
diff --git a/lisp/obsolete/iswitchb.el b/lisp/obsolete/iswitchb.el
index 96b063b..58cada1 100644
--- a/lisp/obsolete/iswitchb.el
+++ b/lisp/obsolete/iswitchb.el
@@ -1,6 +1,6 @@
 ;;; iswitchb.el --- switch between buffers using substrings
 
-;; Copyright (C) 1996-1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Stephen Eglen <stephen@gnu.org>
 ;; Keywords: completion convenience
diff --git a/lisp/obsolete/landmark.el b/lisp/obsolete/landmark.el
index df3c5d6..ae15109 100644
--- a/lisp/obsolete/landmark.el
+++ b/lisp/obsolete/landmark.el
@@ -1,6 +1,6 @@
 ;;; landmark.el --- Neural-network robot that learns landmarks  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1996-1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Terrence Brannon <metaperl@gmail.com>
 ;; Created: December 16, 1996 - first release to usenet
@@ -1278,7 +1278,8 @@ Used to move the robot when he is stuck in a rut for some 
reason."
   :group 'landmark)
 (defcustom landmark-max-stall-time 2
   "The maximum number of cycles that the robot can remain stuck in a place.
-After this limit is reached, landmark-random-move is called to push him out of 
it."
+After this limit is reached, landmark-random-move is called to
+push him out of it."
   :type 'integer
   :group 'landmark)
 
diff --git a/lisp/obsolete/lazy-lock.el b/lisp/obsolete/lazy-lock.el
index 694188f..e1a0191 100644
--- a/lisp/obsolete/lazy-lock.el
+++ b/lisp/obsolete/lazy-lock.el
@@ -1,6 +1,6 @@
 ;;; lazy-lock.el --- lazy demand-driven fontification for fast Font Lock mode
 
-;; Copyright (C) 1994-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Marshall <simon@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/obsolete/longlines.el b/lisp/obsolete/longlines.el
index cbe453a..f274dfb 100644
--- a/lisp/obsolete/longlines.el
+++ b/lisp/obsolete/longlines.el
@@ -1,6 +1,6 @@
 ;;; longlines.el --- automatically wrap long lines   -*- coding:utf-8 -*-
 
-;; Copyright (C) 2000-2001, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2001, 2004-2021 Free Software Foundation, Inc.
 
 ;; Authors:    Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
 ;;             Alex Schroeder <alex@gnu.org>
@@ -407,7 +407,8 @@ Hard newlines are left intact."
 
 (defun longlines-auto-wrap (&optional arg)
   "Toggle automatic line wrapping.
-With optional argument ARG, turn on line wrapping if and only if ARG is 
positive.
+With optional argument ARG, turn on line wrapping if and only if
+ARG is positive.
 If automatic line wrapping is turned on, wrap the entire buffer."
   (interactive "P")
   (setq arg (if arg
diff --git a/lisp/obsolete/mantemp.el b/lisp/obsolete/mantemp.el
index 9c0e553..287a5a7 100644
--- a/lisp/obsolete/mantemp.el
+++ b/lisp/obsolete/mantemp.el
@@ -1,6 +1,6 @@
 ;;; mantemp.el --- create manual template instantiations from g++ 2.7.2 output
 
-;; Copyright (C) 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Tom Houlder <thoulder@icor.fr>
 ;; Created: 10 Dec 1996
diff --git a/lisp/obsolete/messcompat.el b/lisp/obsolete/messcompat.el
index 71ae9e4..fa73dc7 100644
--- a/lisp/obsolete/messcompat.el
+++ b/lisp/obsolete/messcompat.el
@@ -1,6 +1,6 @@
 ;;; messcompat.el --- making message mode compatible with mail mode
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: mail, news
diff --git a/lisp/obsolete/metamail.el b/lisp/obsolete/metamail.el
index d6ab4a3..ef97e8a 100644
--- a/lisp/obsolete/metamail.el
+++ b/lisp/obsolete/metamail.el
@@ -1,6 +1,6 @@
 ;;; metamail.el --- Metamail interface for GNU Emacs
 
-;; Copyright (C) 1993, 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@mse.kyutech.ac.jp>
 ;; Keywords: mail, news, mime, multimedia
diff --git a/lisp/obsolete/mouse-sel.el b/lisp/obsolete/mouse-sel.el
index aabbfcf..608596e 100644
--- a/lisp/obsolete/mouse-sel.el
+++ b/lisp/obsolete/mouse-sel.el
@@ -1,6 +1,6 @@
 ;;; mouse-sel.el --- multi-click selection support
 
-;; Copyright (C) 1993-1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Mike Williams <mdub@bigfoot.com>
 ;; Keywords: mouse
diff --git a/lisp/obsolete/nnir.el b/lisp/obsolete/nnir.el
index 6f17854..147efed 100644
--- a/lisp/obsolete/nnir.el
+++ b/lisp/obsolete/nnir.el
@@ -1,6 +1,6 @@
 ;;; nnir.el --- Search mail with various search engines  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <grossjohann@ls6.cs.uni-dortmund.de>
 ;; Swish-e and Swish++ backends by:
diff --git a/lisp/obsolete/old-emacs-lock.el b/lisp/obsolete/old-emacs-lock.el
index 0e17823..07bccd9 100644
--- a/lisp/obsolete/old-emacs-lock.el
+++ b/lisp/obsolete/old-emacs-lock.el
@@ -1,6 +1,6 @@
 ;;; emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked
 
-;; Copyright (C) 1994, 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Tom Wurgler <twurgler@goodyear.com>
 ;; Created: 12/8/94
diff --git a/lisp/obsolete/otodo-mode.el b/lisp/obsolete/otodo-mode.el
index 6aada07..58c385a 100644
--- a/lisp/obsolete/otodo-mode.el
+++ b/lisp/obsolete/otodo-mode.el
@@ -1,6 +1,6 @@
 ;;; todo-mode.el --- major mode for editing TODO list files
 
-;; Copyright (C) 1997, 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Oliver Seidel <privat@os10000.net>
 ;; Maintainer: Stephen Berman <stephen.berman@gmx.net>
diff --git a/lisp/obsolete/pc-mode.el b/lisp/obsolete/pc-mode.el
index 0c69f89..d4c90c2 100644
--- a/lisp/obsolete/pc-mode.el
+++ b/lisp/obsolete/pc-mode.el
@@ -1,6 +1,6 @@
 ;;; pc-mode.el --- emulate certain key bindings used on PCs
 
-;; Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: emulations
diff --git a/lisp/obsolete/pc-select.el b/lisp/obsolete/pc-select.el
index 73ded27..3f18488 100644
--- a/lisp/obsolete/pc-select.el
+++ b/lisp/obsolete/pc-select.el
@@ -2,7 +2,7 @@
 ;;;                 (or MAC GUI or MS-windoze (bah)) look-and-feel
 ;;;                 including key bindings.
 
-;; Copyright (C) 1995-1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Staats <michael@thp.Uni-Duisburg.DE>
 ;; Keywords: convenience emulations
diff --git a/lisp/obsolete/pgg-def.el b/lisp/obsolete/pgg-def.el
index a3575fe..4250938 100644
--- a/lisp/obsolete/pgg-def.el
+++ b/lisp/obsolete/pgg-def.el
@@ -1,6 +1,6 @@
 ;;; pgg-def.el --- functions/macros for defining PGG functions
 
-;; Copyright (C) 1999, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/11/02
diff --git a/lisp/obsolete/pgg-gpg.el b/lisp/obsolete/pgg-gpg.el
index 6e4cec9..90255fe 100644
--- a/lisp/obsolete/pgg-gpg.el
+++ b/lisp/obsolete/pgg-gpg.el
@@ -1,6 +1,6 @@
 ;;; pgg-gpg.el --- GnuPG support for PGG.
 
-;; Copyright (C) 1999-2000, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2000, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Symmetric encryption and gpg-agent support added by:
diff --git a/lisp/obsolete/pgg-parse.el b/lisp/obsolete/pgg-parse.el
index 79d5cbb..edb5d4f 100644
--- a/lisp/obsolete/pgg-parse.el
+++ b/lisp/obsolete/pgg-parse.el
@@ -1,6 +1,6 @@
 ;;; pgg-parse.el --- OpenPGP packet parsing
 
-;; Copyright (C) 1999, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/10/28
diff --git a/lisp/obsolete/pgg-pgp.el b/lisp/obsolete/pgg-pgp.el
index cbcb1b3..e02032a 100644
--- a/lisp/obsolete/pgg-pgp.el
+++ b/lisp/obsolete/pgg-pgp.el
@@ -1,6 +1,6 @@
 ;;; pgg-pgp.el --- PGP 2.* and 6.* support for PGG.
 
-;; Copyright (C) 1999-2000, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2000, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/11/02
diff --git a/lisp/obsolete/pgg-pgp5.el b/lisp/obsolete/pgg-pgp5.el
index 892874e..42ff1ca 100644
--- a/lisp/obsolete/pgg-pgp5.el
+++ b/lisp/obsolete/pgg-pgp5.el
@@ -1,6 +1,6 @@
 ;;; pgg-pgp5.el --- PGP 5.* support for PGG.
 
-;; Copyright (C) 1999-2000, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2000, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/11/02
diff --git a/lisp/obsolete/pgg.el b/lisp/obsolete/pgg.el
index f0f7081..ec93eeb 100644
--- a/lisp/obsolete/pgg.el
+++ b/lisp/obsolete/pgg.el
@@ -1,6 +1,6 @@
 ;;; pgg.el --- glue for the various PGP implementations.
 
-;; Copyright (C) 1999-2000, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2000, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Symmetric encryption added by: Sascha Wilde <wilde@sha-bang.de>
diff --git a/lisp/obsolete/rcompile.el b/lisp/obsolete/rcompile.el
index 6d95b71..29931d9 100644
--- a/lisp/obsolete/rcompile.el
+++ b/lisp/obsolete/rcompile.el
@@ -1,6 +1,6 @@
 ;;; rcompile.el --- run a compilation on a remote machine
 
-;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Alon Albert <alon@milcse.rtsg.mot.com>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/obsolete/s-region.el b/lisp/obsolete/s-region.el
index 2b55f91..bcb5279 100644
--- a/lisp/obsolete/s-region.el
+++ b/lisp/obsolete/s-region.el
@@ -1,6 +1,6 @@
 ;;; s-region.el --- set region using shift key
 
-;; Copyright (C) 1994-1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Morten Welinder <terra@diku.dk>
 ;; Keywords: terminals
diff --git a/lisp/obsolete/sb-image.el b/lisp/obsolete/sb-image.el
index fd88847..53ecfb7 100644
--- a/lisp/obsolete/sb-image.el
+++ b/lisp/obsolete/sb-image.el
@@ -1,6 +1,7 @@
 ;;; sb-image --- Image management for speedbar
 
-;; Copyright (C) 1999-2003, 2005-2019 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2003, 2005-2019, 2021 Free Software Foundation,
+;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: file, tags, tools
diff --git a/lisp/obsolete/sregex.el b/lisp/obsolete/sregex.el
index ad3671c..ac5f62d 100644
--- a/lisp/obsolete/sregex.el
+++ b/lisp/obsolete/sregex.el
@@ -1,6 +1,6 @@
 ;;; sregex.el --- symbolic regular expressions
 
-;; Copyright (C) 1997-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Bob Glickstein <bobg+sregex@zanshin.com>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/obsolete/starttls.el b/lisp/obsolete/starttls.el
index df1a251..451c7eb 100644
--- a/lisp/obsolete/starttls.el
+++ b/lisp/obsolete/starttls.el
@@ -1,6 +1,6 @@
 ;;; starttls.el --- STARTTLS functions
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Author: Simon Josefsson <simon@josefsson.org>
diff --git a/lisp/obsolete/sup-mouse.el b/lisp/obsolete/sup-mouse.el
index 1852e20..f3db27f 100644
--- a/lisp/obsolete/sup-mouse.el
+++ b/lisp/obsolete/sup-mouse.el
@@ -1,6 +1,6 @@
 ;;; sup-mouse.el --- supdup mouse support for lisp machines
 
-;; Copyright (C) 1985-1986, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Wolfgang Rupprecht
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/obsolete/terminal.el b/lisp/obsolete/terminal.el
index 3d73c03..bde656d 100644
--- a/lisp/obsolete/terminal.el
+++ b/lisp/obsolete/terminal.el
@@ -1,6 +1,6 @@
 ;;; terminal.el --- terminal emulator for GNU Emacs
 
-;; Copyright (C) 1986-1989, 1993-1994, 2001-2020 Free Software
+;; Copyright (C) 1986-1989, 1993-1994, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Richard Mlynarik <mly@eddie.mit.edu>
diff --git a/lisp/obsolete/tls.el b/lisp/obsolete/tls.el
index d1b215c..67a497f 100644
--- a/lisp/obsolete/tls.el
+++ b/lisp/obsolete/tls.el
@@ -1,6 +1,6 @@
 ;;; tls.el --- TLS/SSL support via wrapper around GnuTLS
 
-;; Copyright (C) 1996-1999, 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;; Keywords: comm, tls, gnutls, ssl
@@ -130,8 +130,10 @@ the external program knows about the root certificates you
 consider trustworthy, e.g.:
 
 \(setq tls-program
-      \\='(\"gnutls-cli --x509cafile /etc/ssl/certs/ca-certificates.crt -p %p 
%h\"
-       \"gnutls-cli --x509cafile /etc/ssl/certs/ca-certificates.crt -p %p %h 
--protocols ssl3\"))"
+      \\='(\"gnutls-cli --x509cafile /etc/ssl/certs/ca-certificates.crt \\
+-p %p %h\"
+        \"gnutls-cli --x509cafile /etc/ssl/certs/ca-certificates.crt \\
+-p %p %h --protocols ssl3\"))"
   :type '(choice (const :tag "Always" t)
                 (const :tag "Never" nil)
                 (const :tag "Ask" ask))
diff --git a/lisp/obsolete/tpu-edt.el b/lisp/obsolete/tpu-edt.el
index 0de7aa0..78d88cf 100644
--- a/lisp/obsolete/tpu-edt.el
+++ b/lisp/obsolete/tpu-edt.el
@@ -1,6 +1,6 @@
 ;;; tpu-edt.el --- Emacs emulating TPU emulating EDT
 
-;; Copyright (C) 1993-1995, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Rob Riepel <riepel@networking.stanford.edu>
 ;; Version: 4.5
diff --git a/lisp/obsolete/tpu-extras.el b/lisp/obsolete/tpu-extras.el
index f3b59dd..10b9c89 100644
--- a/lisp/obsolete/tpu-extras.el
+++ b/lisp/obsolete/tpu-extras.el
@@ -1,6 +1,6 @@
 ;;; tpu-extras.el --- scroll margins and free cursor mode for TPU-edt
 
-;; Copyright (C) 1993-1995, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Rob Riepel <riepel@networking.stanford.edu>
 ;; Keywords: emulations
diff --git a/lisp/obsolete/tpu-mapper.el b/lisp/obsolete/tpu-mapper.el
index f1c0bb8..2735820 100644
--- a/lisp/obsolete/tpu-mapper.el
+++ b/lisp/obsolete/tpu-mapper.el
@@ -1,6 +1,6 @@
 ;;; tpu-mapper.el --- create a TPU-edt X-windows keymap file
 
-;; Copyright (C) 1993-1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Rob Riepel <riepel@networking.stanford.edu>
 ;; Keywords: emulations
diff --git a/lisp/obsolete/url-ns.el b/lisp/obsolete/url-ns.el
index 8487105..fff3be9 100644
--- a/lisp/obsolete/url-ns.el
+++ b/lisp/obsolete/url-ns.el
@@ -1,6 +1,6 @@
 ;;; url-ns.el --- Various netscape-ish functions for proxy definitions
 
-;; Copyright (C) 1997-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 ;; Obsolete-since: 27.1
diff --git a/lisp/obsolete/vc-arch.el b/lisp/obsolete/vc-arch.el
index 93bd991..80a2094 100644
--- a/lisp/obsolete/vc-arch.el
+++ b/lisp/obsolete/vc-arch.el
@@ -1,6 +1,6 @@
 ;;; vc-arch.el --- VC backend for the Arch version-control system  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Stefan Monnier <monnier@gnu.org>
diff --git a/lisp/obsolete/vip.el b/lisp/obsolete/vip.el
index 37defd1..08085e5 100644
--- a/lisp/obsolete/vip.el
+++ b/lisp/obsolete/vip.el
@@ -1,6 +1,6 @@
 ;;; vip.el --- a VI Package for GNU Emacs
 
-;; Copyright (C) 1986-1988, 1992-1993, 1998, 2001-2020 Free Software
+;; Copyright (C) 1986-1988, 1992-1993, 1998, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Masahiko Sato <ms@sail.stanford.edu>
diff --git a/lisp/obsolete/ws-mode.el b/lisp/obsolete/ws-mode.el
index 0869832..d1ced86 100644
--- a/lisp/obsolete/ws-mode.el
+++ b/lisp/obsolete/ws-mode.el
@@ -1,6 +1,6 @@
 ;;; ws-mode.el --- WordStar emulation mode for GNU Emacs -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 1991, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Juergen Nickelsen <nickel@cs.tu-berlin.de>
 ;; Version: 0.7
diff --git a/lisp/obsolete/yow.el b/lisp/obsolete/yow.el
index 5efd63c..76485f9 100644
--- a/lisp/obsolete/yow.el
+++ b/lisp/obsolete/yow.el
@@ -1,6 +1,6 @@
 ;;; yow.el --- quote random zippyisms
 
-;; Copyright (C) 1993-1995, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Richard Mlynarik
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/org/ChangeLog.1 b/lisp/org/ChangeLog.1
index ef62ae7..d350a31 100644
--- a/lisp/org/ChangeLog.1
+++ b/lisp/org/ChangeLog.1
@@ -32833,7 +32833,7 @@
 ;; add-log-time-zone-rule: t
 ;; End:
 
-       Copyright (C) 2008-2020 Free Software Foundation, Inc.
+       Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lisp/org/ob-C.el b/lisp/org/ob-C.el
index 3a26bc0..6e33901 100644
--- a/lisp/org/ob-C.el
+++ b/lisp/org/ob-C.el
@@ -1,6 +1,6 @@
 ;;; ob-C.el --- Babel Functions for C and Similar Languages -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;;      Thierry Banel
@@ -182,7 +182,7 @@ or `org-babel-execute:C++' or `org-babel-execute:D'."
                       cmdline)))
            "")))
       (when results
-       (setq results (org-trim (org-remove-indentation results)))
+       (setq results (org-remove-indentation results))
        (org-babel-reassemble-table
         (org-babel-result-cond (cdr (assq :result-params params))
           (org-babel-read results t)
@@ -232,7 +232,13 @@ its header arguments."
               (list
                ;; includes
                (mapconcat
-                (lambda (inc) (format "#include %s" inc))
+                (lambda (inc)
+                  ;; :includes '(<foo> <bar>) gives us a list of
+                  ;; symbols; convert those to strings.
+                  (when (symbolp inc) (setq inc (symbol-name inc)))
+                  (if (string-prefix-p "<" inc)
+                      (format "#include %s" inc)
+                    (format "#include \"%s\"" inc)))
                 includes "\n")
                ;; defines
                (mapconcat
diff --git a/lisp/org/ob-J.el b/lisp/org/ob-J.el
index c014521..0c5591d 100644
--- a/lisp/org/ob-J.el
+++ b/lisp/org/ob-J.el
@@ -1,8 +1,9 @@
 ;;; ob-J.el --- Babel Functions for J                -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Oleh Krehel
+;; Maintainer: Joseph Novakovich <josephnovakovich@gmail.com>
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: https://orgmode.org
 
@@ -76,6 +77,8 @@ This function is called by `org-babel-execute-src-block'."
   (message "executing J source code block")
   (let* ((processed-params (org-babel-process-params params))
         (sessionp (cdr (assq :session params)))
+        (sit-time (let ((sit (assq :sit params)))
+                    (if sit (cdr sit) .1)))
          (full-body (org-babel-expand-body:J
                      body params processed-params))
         (tmp-script-file (org-babel-temp-file "J-src")))
@@ -86,9 +89,9 @@ This function is called by `org-babel-execute-src-block'."
           (with-temp-file tmp-script-file
             (insert full-body))
           (org-babel-eval (format "%s < %s" org-babel-J-command 
tmp-script-file) ""))
-       (org-babel-J-eval-string full-body)))))
+       (org-babel-J-eval-string full-body sit-time)))))
 
-(defun org-babel-J-eval-string (str)
+(defun org-babel-J-eval-string (str sit-time)
   "Sends STR to the `j-console-cmd' session and executes it."
   (let ((session (j-console-ensure-session)))
     (with-current-buffer (process-buffer session)
@@ -96,7 +99,7 @@ This function is called by `org-babel-execute-src-block'."
       (insert (format "\n%s\n" str))
       (let ((beg (point)))
        (comint-send-input)
-       (sit-for .1)
+       (sit-for sit-time)
        (buffer-substring-no-properties
         beg (point-max))))))
 
diff --git a/lisp/org/ob-R.el b/lisp/org/ob-R.el
index b52c759..309a0ac 100644
--- a/lisp/org/ob-R.el
+++ b/lisp/org/ob-R.el
@@ -1,6 +1,6 @@
 ;;; ob-R.el --- Babel Functions for R                -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;;     Dan Davison
@@ -193,7 +193,8 @@ This function is called by `org-babel-execute-src-block'."
     (org-babel-comint-in-buffer session
       (mapc (lambda (var)
               (end-of-line 1) (insert var) (comint-send-input nil t)
-              (org-babel-comint-wait-for-output session)) var-lines))
+              (org-babel-comint-wait-for-output session))
+           var-lines))
     session))
 
 (defun org-babel-load-session:R (session body params)
@@ -360,7 +361,7 @@ Each member of this list is a list with three members:
             )
     }
 }(object=%s,transfer.file=\"%s\")"
-  "A template for an R command to evaluate a block of code and write the 
result to a file.
+  "Template for an R command to evaluate a block of code and write result to 
file.
 
 Has four %s escapes to be filled in:
 1. Row names, \"TRUE\" or \"FALSE\"
@@ -459,11 +460,11 @@ last statement in BODY, as elisp."
   "R-specific processing of return value.
 Insert hline if column names in output have been requested."
   (if column-names-p
-      (cons (car result) (cons 'hline (cdr result)))
+      (condition-case nil
+         (cons (car result) (cons 'hline (cdr result)))
+       (error "Could not parse R result"))
     result))
 
 (provide 'ob-R)
 
-
-
 ;;; ob-R.el ends here
diff --git a/lisp/org/ob-abc.el b/lisp/org/ob-abc.el
index d473118..404e39f 100644
--- a/lisp/org/ob-abc.el
+++ b/lisp/org/ob-abc.el
@@ -1,11 +1,10 @@
 ;;; ob-abc.el --- Org Babel Functions for ABC -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: William Waites
 ;; Keywords: literate programming, music
-;; Homepage: http://www.tardis.ed.ac.uk/wwaites
-;; Version: 0.01
+;; Homepage: https://www.tardis.ed.ac.uk/~wwaites
 
 ;; This file is part of GNU Emacs.
 
@@ -87,4 +86,5 @@
   (error "ABC does not support sessions"))
 
 (provide 'ob-abc)
+
 ;;; ob-abc.el ends here
diff --git a/lisp/org/ob-asymptote.el b/lisp/org/ob-asymptote.el
index bdc74b8..bfb5b79 100644
--- a/lisp/org/ob-asymptote.el
+++ b/lisp/org/ob-asymptote.el
@@ -1,6 +1,6 @@
 ;;; ob-asymptote.el --- Babel Functions for Asymptote -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -134,6 +134,4 @@ Otherwise, it is either `real', if some elements are 
floats, or
 
 (provide 'ob-asymptote)
 
-
-
 ;;; ob-asymptote.el ends here
diff --git a/lisp/org/ob-awk.el b/lisp/org/ob-awk.el
index 74bbc4c..b41d70f 100644
--- a/lisp/org/ob-awk.el
+++ b/lisp/org/ob-awk.el
@@ -1,6 +1,6 @@
 ;;; ob-awk.el --- Babel Functions for Awk            -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -106,6 +106,4 @@ This function is called by `org-babel-execute-src-block'."
 
 (provide 'ob-awk)
 
-
-
 ;;; ob-awk.el ends here
diff --git a/lisp/org/ob-calc.el b/lisp/org/ob-calc.el
index 85bcf1d..39ebce1 100644
--- a/lisp/org/ob-calc.el
+++ b/lisp/org/ob-calc.el
@@ -1,6 +1,6 @@
 ;;; ob-calc.el --- Babel Functions for Calc          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -105,6 +105,4 @@
 
 (provide 'ob-calc)
 
-
-
 ;;; ob-calc.el ends here
diff --git a/lisp/org/ob-clojure.el b/lisp/org/ob-clojure.el
index 0d6d1c0..df2d691 100644
--- a/lisp/org/ob-clojure.el
+++ b/lisp/org/ob-clojure.el
@@ -1,6 +1,6 @@
 ;;; ob-clojure.el --- Babel Functions for Clojure    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Joel Boehland, Eric Schulte, Oleh Krehel, Frederick Giasson
 ;;
@@ -30,80 +30,70 @@
 
 ;; - clojure (at least 1.2.0)
 ;; - clojure-mode
-;; - either cider or SLIME
+;; - inf-clojure, cider or SLIME
 
-;; For Cider, see https://github.com/clojure-emacs/cider
+;; For clojure-mode, see https://github.com/clojure-emacs/clojure-mode
+;; For cider, see https://github.com/clojure-emacs/cider
+;; For inf-clojure, see https://github.com/clojure-emacs/cider
 
 ;; For SLIME, the best way to install these components is by following
 ;; the directions as set out by Phil Hagelberg (Technomancy) on the
 ;; web page: http://technomancy.us/126
 
 ;;; Code:
-(require 'cl-lib)
 (require 'ob)
-(require 'org-macs)
 
-(declare-function cider-jack-in "ext:cider" (&optional prompt-project 
cljs-too))
 (declare-function cider-current-connection "ext:cider-client" (&optional type))
 (declare-function cider-current-ns "ext:cider-client" ())
-(declare-function cider-repls "ext:cider-connection" (&optional type ensure))
-(declare-function nrepl--merge "ext:nrepl-client" (dict1 dict2))
+(declare-function inf-clojure "ext:inf-clojure" (cmd))
+(declare-function inf-clojure-cmd "ext:inf-clojure" (project-type))
+(declare-function inf-clojure-eval-string "ext:inf-clojure" (code))
+(declare-function inf-clojure-project-type "ext:inf-clojure" ())
 (declare-function nrepl-dict-get "ext:nrepl-client" (dict key))
-(declare-function nrepl-dict-put "ext:nrepl-client" (dict key value))
-(declare-function nrepl-request:eval "ext:nrepl-client" (input callback 
connection &optional ns line column additional-params tooling))
 (declare-function nrepl-sync-request:eval "ext:nrepl-client" (input connection 
&optional ns tooling))
+(declare-function sesman-start-session "ext:sesman" (system))
 (declare-function slime-eval "ext:slime" (sexp &optional package))
 
-(defvar nrepl-sync-request-timeout)
 (defvar cider-buffer-ns)
-(defvar sesman-system)
-(defvar cider-version)
 
 (defvar org-babel-tangle-lang-exts)
 (add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj"))
+(add-to-list 'org-babel-tangle-lang-exts '("clojurescript" . "cljs"))
 
 (defvar org-babel-default-header-args:clojure '())
-(defvar org-babel-header-args:clojure '((ns . :any)
-                                       (package . :any)))
+(defvar org-babel-header-args:clojure '((ns . :any) (package . :any)))
+(defvar org-babel-default-header-args:clojurescript '())
+(defvar org-babel-header-args:clojurescript '((package . :any)))
 
-(defcustom org-babel-clojure-sync-nrepl-timeout 10
-  "Timeout value, in seconds, of a Clojure sync call.
-If the value is nil, timeout is disabled."
-  :group 'org-babel
-  :type 'integer
-  :version "26.1"
-  :package-version '(Org . "9.1")
-  :safe #'wholenump)
-
-(defcustom org-babel-clojure-backend
-  (cond ((featurep 'cider) 'cider)
-       (t 'slime))
+(defcustom org-babel-clojure-backend nil
   "Backend used to evaluate Clojure code blocks."
   :group 'org-babel
   :type '(choice
+         (const :tag "inf-clojure" inf-clojure)
          (const :tag "cider" cider)
-         (const :tag "SLIME" slime)))
+         (const :tag "slime" slime)
+         (const :tag "Not configured yet" nil)))
 
 (defcustom org-babel-clojure-default-ns "user"
   "Default Clojure namespace for source block when finding ns failed."
   :type 'string
   :group 'org-babel)
 
-(defun org-babel-clojure-cider-current-ns ()
-  "Like `cider-current-ns' except `cider-find-ns'."
-  (or cider-buffer-ns
-      (let ((repl-buf (cider-current-connection)))
-       (and repl-buf (buffer-local-value 'cider-buffer-ns repl-buf)))
-      org-babel-clojure-default-ns))
-
 (defun org-babel-expand-body:clojure (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (let* ((vars (org-babel--get-vars params))
         (ns (or (cdr (assq :ns params))
-                (org-babel-clojure-cider-current-ns)))
+                (if (eq org-babel-clojure-backend 'cider)
+                    (or cider-buffer-ns
+                        (let ((repl-buf (cider-current-connection)))
+                          (and repl-buf (buffer-local-value
+                                         'cider-buffer-ns repl-buf))))
+                  org-babel-clojure-default-ns)))
         (result-params (cdr (assq :result-params params)))
         (print-level nil)
         (print-length nil)
+        ;; Remove comments, they break (let [...] ...) bindings
+        (body (replace-regexp-in-string "^[    ]*;+.*$" "" body))
         (body (org-trim
                (concat
                 ;; Source block specified namespace :ns.
@@ -113,7 +103,7 @@ If the value is nil, timeout is disabled."
                   (format "(let [%s]\n%s)"
                           (mapconcat
                            (lambda (var)
-                             (format "%S (quote %S)" (car var) (cdr var)))
+                             (format "%S %S" (car var) (cdr var)))
                            vars
                            "\n      ")
                           body))))))
@@ -122,161 +112,141 @@ If the value is nil, timeout is disabled."
        (format "(clojure.pprint/pprint (do %s))" body)
       body)))
 
+(defvar ob-clojure-inf-clojure-filter-out)
+(defvar ob-clojure-inf-clojure-tmp-output)
+(defun ob-clojure-inf-clojure-output (s)
+  "Store a trimmed version of S in a variable and return S."
+  (let ((s0 (org-trim
+            (replace-regexp-in-string
+             ob-clojure-inf-clojure-filter-out "" s))))
+    (push s0 ob-clojure-inf-clojure-tmp-output))
+  s)
+
+(defmacro ob-clojure-with-temp-expanded (expanded params &rest body)
+  "Run BODY on EXPANDED code block with PARAMS."
+  (declare (debug (body)) (indent 2))
+  `(with-temp-buffer
+     (insert ,expanded)
+     (goto-char (point-min))
+     (while (not (looking-at "\\s-*\\'"))
+       (let* ((beg (point))
+             (end (progn (forward-sexp) (point)))
+             (exp (org-babel-expand-body:clojure
+                   (buffer-substring beg end) ,params)))
+        (sit-for .1)
+        ,@body))))
+
+(defsubst ob-clojure-string-or-list (l)
+  "Convert list L into a string or a list of list."
+  (if (and (listp l) (= (length l) 1))
+      (car l)
+    (mapcar #'list l)))
+
+(defvar inf-clojure-buffer)
+(defvar comint-prompt-regexp)
+(defvar inf-clojure-comint-prompt-regexp)
+(defun ob-clojure-eval-with-inf-clojure (expanded params)
+  "Evaluate EXPANDED code block with PARAMS using inf-clojure."
+  (condition-case nil (require 'inf-clojure)
+    (user-error "inf-clojure not available"))
+  ;; Maybe initiate the inf-clojure session
+  (unless (and inf-clojure-buffer
+              (buffer-live-p (get-buffer inf-clojure-buffer)))
+    (save-window-excursion
+      (let* ((alias (cdr (assq :alias params)))
+            (cmd0 (inf-clojure-cmd (inf-clojure-project-type)))
+            (cmd (if alias (replace-regexp-in-string
+                            "clojure" (format "clojure -A%s" alias)
+                            cmd0)
+                   cmd0)))
+       (setq comint-prompt-regexp inf-clojure-comint-prompt-regexp)
+       (funcall-interactively #'inf-clojure cmd)
+       (goto-char (point-max))))
+    (sit-for 1))
+  ;; Now evaluate the code
+  (setq ob-clojure-inf-clojure-filter-out
+       (concat "^nil\\|nil$\\|\\s-*"
+               (or (cdr (assq :ns params))
+                   org-babel-clojure-default-ns)
+               "=>\\s-*"))
+  (add-hook 'comint-preoutput-filter-functions
+           #'ob-clojure-inf-clojure-output)
+  (setq ob-clojure-inf-clojure-tmp-output nil)
+  (ob-clojure-with-temp-expanded expanded nil
+    (inf-clojure-eval-string exp))
+  (sit-for .5)
+  (remove-hook 'comint-preoutput-filter-functions
+              #'ob-clojure-inf-clojure-output)
+  ;; And return the result
+  (ob-clojure-string-or-list
+   (delete nil
+          (mapcar
+           (lambda (s)
+             (unless (or (equal "" s)
+                         (string-match-p "^Clojure" s))
+               s))
+           (reverse ob-clojure-inf-clojure-tmp-output)))))
+
+(defun ob-clojure-eval-with-cider (expanded params)
+  "Evaluate EXPANDED code block with PARAMS using cider."
+  (condition-case nil (require 'cider)
+    (user-error "cider not available"))
+  (let ((connection (cider-current-connection (cdr (assq :target params))))
+       (result-params (cdr (assq :result-params params)))
+       result0)
+    (unless connection (sesman-start-session 'CIDER))
+    (if (not connection)
+       ;; Display in the result instead of using `user-error'
+       (setq result0 "Please reevaluate when nREPL is connected")
+      (ob-clojure-with-temp-expanded expanded params
+       (let ((response (nrepl-sync-request:eval exp connection)))
+         (push (or (nrepl-dict-get response "root-ex")
+                   (nrepl-dict-get response "ex")
+                   (nrepl-dict-get
+                    response (if (or (member "output" result-params)
+                                     (member "pp" result-params))
+                                 "out"
+                               "value")))
+               result0)))
+      (ob-clojure-string-or-list
+       (reverse (delete "" (mapcar (lambda (r)
+                                    (replace-regexp-in-string "nil" "" r))
+                                  result0)))))))
+
+(defun ob-clojure-eval-with-slime (expanded params)
+  "Evaluate EXPANDED code block with PARAMS using slime."
+  (condition-case nil (require 'slime)
+    (user-error "slime not available"))
+  (with-temp-buffer
+    (insert expanded)
+    (slime-eval
+     `(swank:eval-and-grab-output
+       ,(buffer-substring-no-properties (point-min) (point-max)))
+     (cdr (assq :package params)))))
+
 (defun org-babel-execute:clojure (body params)
-  "Execute a block of Clojure code with Babel.
-The underlying process performed by the code block can be output
-using the :show-process parameter."
+  "Execute a block of Clojure code with Babel."
+  (unless org-babel-clojure-backend
+    (user-error "You need to customize org-babel-clojure-backend"))
   (let* ((expanded (org-babel-expand-body:clojure body params))
-        (response (list 'dict))
-         result)
-    (cl-case org-babel-clojure-backend
-      (cider
-       (require 'cider)
-       (let ((result-params (cdr (assq :result-params params)))
-            (show (cdr (assq :show-process params))))
-         (if (member show '(nil "no"))
-            ;; Run code without showing the process.
-            (progn
-              (setq response
-                    (let ((nrepl-sync-request-timeout
-                           org-babel-clojure-sync-nrepl-timeout))
-                      (nrepl-sync-request:eval expanded
-                                               (cider-current-connection))))
-              (setq result
-                    (concat
-                     (nrepl-dict-get response
-                                     (if (or (member "output" result-params)
-                                             (member "pp" result-params))
-                                         "out"
-                                       "value"))
-                     (nrepl-dict-get response "ex")
-                     (nrepl-dict-get response "root-ex")
-                     (nrepl-dict-get response "err"))))
-          ;; Show the process in an output buffer/window.
-           (let ((process-buffer (switch-to-buffer-other-window
-                                 "*Clojure Show Process Sub Buffer*"))
-                status)
-            ;; Run the Clojure code in nREPL.
-            (nrepl-request:eval
-             expanded
-             (lambda (resp)
-               (when (member "out" resp)
-                 ;; Print the output of the nREPL in the output buffer.
-                 (princ (nrepl-dict-get resp "out") process-buffer))
-               (when (member "ex" resp)
-                 ;; In case there is an exception, then add it to the
-                 ;; output buffer as well.
-                 (princ (nrepl-dict-get resp "ex") process-buffer)
-                 (princ (nrepl-dict-get resp "root-ex") process-buffer))
-               (when (member "err" resp)
-                 ;; In case there is an error, then add it to the
-                 ;; output buffer as well.
-                 (princ (nrepl-dict-get resp "err") process-buffer))
-               (nrepl--merge response resp)
-               ;; Update the status of the nREPL output session.
-               (setq status (nrepl-dict-get response "status")))
-             (cider-current-connection))
-
-            ;; Wait until the nREPL code finished to be processed.
-            (while (not (member "done" status))
-              (nrepl-dict-put response "status" (remove "need-input" status))
-              (accept-process-output nil 0.01)
-              (redisplay))
-
-            ;; Delete the show buffer & window when the processing is
-            ;; finalized.
-            (mapc #'delete-window
-                  (get-buffer-window-list process-buffer nil t))
-            (kill-buffer process-buffer)
-
-            ;; Put the output or the value in the result section of
-            ;; the code block.
-            (setq result
-                  (concat
-                   (nrepl-dict-get response
-                                   (if (or (member "output" result-params)
-                                           (member "pp" result-params))
-                                       "out"
-                                     "value"))
-                   (nrepl-dict-get response "ex")
-                   (nrepl-dict-get response "root-ex")
-                   (nrepl-dict-get response "err")))))))
-      (slime
-       (require 'slime)
-       (with-temp-buffer
-        (insert expanded)
-        (setq result
-              (slime-eval
-               `(swank:eval-and-grab-output
-                 ,(buffer-substring-no-properties (point-min) (point-max)))
-               (cdr (assq :package params)))))))
-    (org-babel-result-cond (cdr (assq :result-params params))
+        (result-params (cdr (assq :result-params params)))
+        result)
+    (setq result
+         (cond
+          ((eq org-babel-clojure-backend 'inf-clojure)
+           (ob-clojure-eval-with-inf-clojure expanded params))
+          ((eq org-babel-clojure-backend 'cider)
+           (ob-clojure-eval-with-cider expanded params))
+          ((eq org-babel-clojure-backend 'slime)
+           (ob-clojure-eval-with-slime expanded params))))
+    (org-babel-result-cond result-params
       result
       (condition-case nil (org-babel-script-escape result)
        (error result)))))
 
-(defun org-babel-clojure-initiate-session (&optional session _params)
-  "Initiate a session named SESSION according to PARAMS."
-  (when (and session (not (string= session "none")))
-    (save-window-excursion
-      (cond
-       ((org-babel-comint-buffer-livep session) nil)
-       ;; CIDER jack-in to the Clojure project directory.
-       ((eq org-babel-clojure-backend 'cider)
-        (require 'cider)
-        (let ((session-buffer
-              (save-window-excursion
-                (if (version< cider-version "0.18.0")
-                    ;; Older CIDER (without sesman) still need to use
-                    ;; old way.
-                    (cider-jack-in nil) ;jack-in without project
-                  ;; New CIDER (with sesman to manage sessions).
-                  (unless (cider-repls)
-                    (let ((sesman-system 'CIDER))
-                      (call-interactively 'sesman-link-with-directory))))
-                 (current-buffer))))
-          (when (org-babel-comint-buffer-livep session-buffer)
-            (sit-for .25)
-           session-buffer)))
-       ((eq org-babel-clojure-backend 'slime)
-        (error "Session evaluation with SLIME is not supported"))
-       (t
-        (error "Session initiate failed")))
-      (get-buffer session))))
-
-(defun org-babel-prep-session:clojure (session params)
-  "Prepare SESSION according to the header arguments specified in PARAMS."
-  (let ((session (org-babel-clojure-initiate-session session))
-        (var-lines (org-babel-variable-assignments:clojure params)))
-    (when session
-      (org-babel-comint-in-buffer session
-       (dolist (var var-lines)
-         (insert var)
-         (comint-send-input nil t)
-         (org-babel-comint-wait-for-output session)
-         (sit-for .1)
-         (goto-char (point-max)))))
-    session))
-
-(defun org-babel-clojure-var-to-clojure (var)
-  "Convert src block's VAR to Clojure variable."
-  (cond
-   ((listp var)
-    (replace-regexp-in-string "(" "'(" var))
-   ((stringp var)
-    ;; Wrap Babel passed-in header argument value with quotes in Clojure.
-    (format "\"%s\"" var))
-   (t
-    (format "%S" var))))
-
-(defun org-babel-variable-assignments:clojure (params)
-  "Return a list of Clojure statements assigning the block's variables in 
PARAMS."
-  (mapcar
-   (lambda (pair)
-     (format "(def %s %s)"
-             (car pair)
-             (org-babel-clojure-var-to-clojure (cdr pair))))
-   (org-babel--get-vars params)))
+(defun org-babel-execute:clojurescript (body params)
+  "Evaluate BODY with PARAMS as ClojureScript code."
+  (org-babel-execute:clojure body (cons '(:target . "cljs") params)))
 
 (provide 'ob-clojure)
 
diff --git a/lisp/org/ob-comint.el b/lisp/org/ob-comint.el
index 552b7a0..18d4f3c 100644
--- a/lisp/org/ob-comint.el
+++ b/lisp/org/ob-comint.el
@@ -1,6 +1,6 @@
 ;;; ob-comint.el --- Babel Functions for Interaction with Comint Buffers -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, comint
@@ -151,6 +151,4 @@ FILE exists at end of evaluation."
 
 (provide 'ob-comint)
 
-
-
 ;;; ob-comint.el ends here
diff --git a/lisp/org/ob-coq.el b/lisp/org/ob-coq.el
index d04a40d..c77e8c9 100644
--- a/lisp/org/ob-coq.el
+++ b/lisp/org/ob-coq.el
@@ -1,6 +1,6 @@
 ;;; ob-coq.el --- Babel Functions for Coq            -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -76,3 +76,5 @@ create one.  Return the initialized session."
   (get-buffer org-babel-coq-buffer))
 
 (provide 'ob-coq)
+
+;;; ob-coq.el ends here
diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el
index fe9af1c..1343410 100644
--- a/lisp/org/ob-core.el
+++ b/lisp/org/ob-core.el
@@ -1,6 +1,6 @@
 ;;; ob-core.el --- Working with Code Blocks          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Authors: Eric Schulte
 ;;     Dan Davison
@@ -38,6 +38,7 @@
 (defvar org-link-file-path-type)
 (defvar org-src-lang-modes)
 (defvar org-src-preserve-indentation)
+(defvar org-babel-tangle-uncomment-comments)
 
 (declare-function org-at-item-p "org-list" ())
 (declare-function org-at-table-p "org" (&optional table-type))
@@ -59,6 +60,7 @@
 (declare-function org-element-type "org-element" (element))
 (declare-function org-entry-get "org" (pom property &optional inherit 
literal-nil))
 (declare-function org-escape-code-in-region "org-src" (beg end))
+(declare-function org-forward-heading-same-level "org" (arg &optional 
invisible-ok))
 (declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
 (declare-function org-indent-line "org" ())
 (declare-function org-list-get-list-end "org-list" (item struct prevs))
@@ -67,7 +69,6 @@
 (declare-function org-list-to-generic "org-list" (LIST PARAMS))
 (declare-function org-list-to-lisp "org-list" (&optional delete))
 (declare-function org-macro-escape-arguments "org-macro" (&rest args))
-(declare-function org-make-options-regexp "org" (kwds &optional extra))
 (declare-function org-mark-ring-push "org" (&optional pos buffer))
 (declare-function org-narrow-to-subtree "org" ())
 (declare-function org-next-block "org" (arg &optional backward block-regexp))
@@ -78,6 +79,7 @@
 (declare-function org-src-coderef-regexp "org-src" (fmt &optional label))
 (declare-function org-src-get-lang-mode "org-src" (lang))
 (declare-function org-table-align "org-table" ())
+(declare-function org-table-convert-region "org-table" (beg0 end0 &optional 
separator))
 (declare-function org-table-end "org-table" (&optional table-type))
 (declare-function org-table-import "org-table" (file arg))
 (declare-function org-table-to-lisp "org-table" (&optional txt))
@@ -164,7 +166,6 @@ This string must include a \"%s\" which will be replaced by 
the results."
   "Non-nil means show the time the code block was evaluated in the result 
hash."
   :group 'org-babel
   :type 'boolean
-  :version "26.1"
   :package-version '(Org . "9.0")
   :safe #'booleanp)
 
@@ -238,7 +239,8 @@ should be asked whether to allow evaluation."
                    (if (functionp org-confirm-babel-evaluate)
                        (funcall org-confirm-babel-evaluate
                                 ;; Language, code block body.
-                                (nth 0 info) (nth 1 info))
+                                (nth 0 info)
+                                (org-babel--expand-body info))
                      org-confirm-babel-evaluate))))
     (cond
      (noeval nil)
@@ -400,6 +402,7 @@ then run `org-babel-switch-to-session'."
     (file      . :any)
     (file-desc  . :any)
     (file-ext   . :any)
+    (file-mode  . ((#o755 #o555 #o444 :any)))
     (hlines    . ((no yes)))
     (mkdirp    . ((yes no)))
     (no-expand)
@@ -487,11 +490,21 @@ For the format of SAFE-LIST, see 
`org-babel-safe-header-args'."
   "Regexp matching a NAME keyword.")
 
 (defconst org-babel-result-regexp
-  (format "^[ \t]*#\\+%s\\(?:\\[\\(?:%s \\)?\\([[:alnum:]]+\\)\\]\\)?:[ \t]*"
-         org-babel-results-keyword
-         ;; <%Y-%m-%d %H:%M:%S>
-         "<\\(?:[0-9]\\{4\\}-[0-1][0-9]-[0-3][0-9] \
-[0-2][0-9]\\(?::[0-5][0-9]\\)\\{2\\}\\)>")
+  (rx (seq bol
+           (zero-or-more (any "\t "))
+           "#+results"
+           (opt "["
+               ;; Time stamp part.
+               (opt "("
+                     (= 4 digit) (= 2 "-" (= 2 digit))
+                     " "
+                     (= 2 digit) (= 2 ":" (= 2 digit))
+                     ") ")
+               ;; SHA1 hash.
+               (group (one-or-more hex-digit))
+               "]")
+           ":"
+           (zero-or-more (any "\t "))))
   "Regular expression used to match result lines.
 If the results are associated with a hash key then the hash will
 be saved in match group 1.")
@@ -622,6 +635,17 @@ a list with the following pattern:
        (setf (nth 2 info) (org-babel-generate-file-param name (nth 2 info)))
        info))))
 
+(defun org-babel--expand-body (info)
+  "Expand noweb references in body and remove any coderefs."
+  (let ((coderef (nth 6 info))
+       (expand
+        (if (org-babel-noweb-p (nth 2 info) :eval)
+            (org-babel-expand-noweb-references info)
+          (nth 1 info))))
+    (if (not coderef) expand
+      (replace-regexp-in-string
+       (org-src-coderef-regexp coderef) "" expand nil nil 1))))
+
 ;;;###autoload
 (defun org-babel-execute-src-block (&optional arg info params)
   "Execute the current source code block.
@@ -667,17 +691,7 @@ block."
         ((org-babel-confirm-evaluate info)
          (let* ((lang (nth 0 info))
                 (result-params (cdr (assq :result-params params)))
-                ;; Expand noweb references in BODY and remove any
-                ;; coderef.
-                (body
-                 (let ((coderef (nth 6 info))
-                       (expand
-                        (if (org-babel-noweb-p params :eval)
-                            (org-babel-expand-noweb-references info)
-                          (nth 1 info))))
-                   (if (not coderef) expand
-                     (replace-regexp-in-string
-                      (org-src-coderef-regexp coderef) "" expand nil nil 1))))
+                (body (org-babel--expand-body info))
                 (dir (cdr (assq :dir params)))
                 (mkdirp (cdr (assq :mkdirp params)))
                 (default-directory
@@ -721,7 +735,11 @@ block."
                    (with-temp-file file
                      (insert (org-babel-format-result
                               result
-                              (cdr (assq :sep params))))))
+                              (cdr (assq :sep params)))))
+                   ;; Set file permissions if header argument
+                   ;; `:file-mode' is provided.
+                   (when (assq :file-mode params)
+                     (set-file-modes file (cdr (assq :file-mode params)))))
                  (setq result file))
                ;; Possibly perform post process provided its
                ;; appropriate.  Dynamically bind "*this*" to the
@@ -1301,10 +1319,9 @@ CONTEXT specifies the context of evaluation.  It can be 
`:eval',
   "Return the current in-buffer hash."
   (let ((result (org-babel-where-is-src-block-result nil info)))
     (when result
-      (org-with-wide-buffer
-       (goto-char result)
-       (looking-at org-babel-result-regexp)
-       (match-string-no-properties 1)))))
+      (org-with-point-at result
+       (let ((case-fold-search t)) (looking-at org-babel-result-regexp))
+       (match-string-no-properties 1)))))
 
 (defun org-babel-hide-hash ()
   "Hide the hash in the current results line.
@@ -1312,7 +1329,8 @@ Only the initial `org-babel-hash-show' characters of the 
hash
 will remain visible."
   (add-to-invisibility-spec '(org-babel-hide-hash . t))
   (save-excursion
-    (when (and (re-search-forward org-babel-result-regexp nil t)
+    (when (and (let ((case-fold-search t))
+                (re-search-forward org-babel-result-regexp nil t))
                (match-string 1))
       (let* ((start (match-beginning 1))
              (hide-start (+ org-babel-hash-show start))
@@ -1330,11 +1348,12 @@ Only the initial `org-babel-hash-show' characters of 
each hash
 will remain visible.  This function should be called as part of
 the `org-mode-hook'."
   (save-excursion
-    (while (and (not org-babel-hash-show-time)
-               (re-search-forward org-babel-result-regexp nil t))
-      (goto-char (match-beginning 0))
-      (org-babel-hide-hash)
-      (goto-char (match-end 0)))))
+    (let ((case-fold-search t))
+      (while (and (not org-babel-hash-show-time)
+                 (re-search-forward org-babel-result-regexp nil t))
+       (goto-char (match-beginning 0))
+       (org-babel-hide-hash)
+       (goto-char (match-end 0))))))
 (add-hook 'org-mode-hook 'org-babel-hide-all-hashes)
 
 (defun org-babel-hash-at-point (&optional point)
@@ -1363,9 +1382,10 @@ portions of results lines."
   (interactive)
   (org-babel-show-result-all)
   (save-excursion
-    (while (re-search-forward org-babel-result-regexp nil t)
-      (save-excursion (goto-char (match-beginning 0))
-                      (org-babel-hide-result-toggle-maybe)))))
+    (let ((case-fold-search t))
+      (while (re-search-forward org-babel-result-regexp nil t)
+       (save-excursion (goto-char (match-beginning 0))
+                       (org-babel-hide-result-toggle-maybe))))))
 
 (defun org-babel-show-result-all ()
   "Unfold all results in the current buffer."
@@ -1377,52 +1397,50 @@ portions of results lines."
   "Toggle visibility of result at point."
   (interactive)
   (let ((case-fold-search t))
-    (if (save-excursion
-          (beginning-of-line 1)
-          (looking-at org-babel-result-regexp))
-        (progn (org-babel-hide-result-toggle)
-               t) ;; to signal that we took action
-      nil))) ;; to signal that we did not
+    (and (org-match-line org-babel-result-regexp)
+         (progn (org-babel-hide-result-toggle) t))))
 
 (defun org-babel-hide-result-toggle (&optional force)
   "Toggle the visibility of the current result."
   (interactive)
   (save-excursion
     (beginning-of-line)
-    (if (re-search-forward org-babel-result-regexp nil t)
-        (let ((start (progn (beginning-of-line 2) (- (point) 1)))
-             (end (progn
-                    (while (looking-at org-babel-multi-line-header-regexp)
-                      (forward-line 1))
-                    (goto-char (- (org-babel-result-end) 1)) (point)))
-             ov)
-          (if (memq t (mapcar (lambda (overlay)
-                                (eq (overlay-get overlay 'invisible)
-                                   'org-babel-hide-result))
-                              (overlays-at start)))
-              (when (or (not force) (eq force 'off))
-               (mapc (lambda (ov)
-                       (when (member ov org-babel-hide-result-overlays)
-                         (setq org-babel-hide-result-overlays
-                               (delq ov org-babel-hide-result-overlays)))
-                       (when (eq (overlay-get ov 'invisible)
-                                 'org-babel-hide-result)
-                         (delete-overlay ov)))
-                     (overlays-at start)))
-            (setq ov (make-overlay start end))
-            (overlay-put ov 'invisible 'org-babel-hide-result)
-            ;; make the block accessible to isearch
-            (overlay-put
-             ov 'isearch-open-invisible
-             (lambda (ov)
-               (when (member ov org-babel-hide-result-overlays)
-                 (setq org-babel-hide-result-overlays
-                       (delq ov org-babel-hide-result-overlays)))
-               (when (eq (overlay-get ov 'invisible)
-                         'org-babel-hide-result)
-                 (delete-overlay ov))))
-            (push ov org-babel-hide-result-overlays)))
-      (error "Not looking at a result line"))))
+    (let ((case-fold-search t))
+      (unless (re-search-forward org-babel-result-regexp nil t)
+       (error "Not looking at a result line")))
+    (let ((start (progn (beginning-of-line 2) (1- (point))))
+         (end (progn
+                (while (looking-at org-babel-multi-line-header-regexp)
+                  (forward-line 1))
+                (goto-char (1- (org-babel-result-end)))
+                (point)))
+         ov)
+      (if (memq t (mapcar (lambda (overlay)
+                           (eq (overlay-get overlay 'invisible)
+                               'org-babel-hide-result))
+                         (overlays-at start)))
+         (when (or (not force) (eq force 'off))
+           (mapc (lambda (ov)
+                   (when (member ov org-babel-hide-result-overlays)
+                     (setq org-babel-hide-result-overlays
+                           (delq ov org-babel-hide-result-overlays)))
+                   (when (eq (overlay-get ov 'invisible)
+                             'org-babel-hide-result)
+                     (delete-overlay ov)))
+                 (overlays-at start)))
+       (setq ov (make-overlay start end))
+       (overlay-put ov 'invisible 'org-babel-hide-result)
+       ;; make the block accessible to isearch
+       (overlay-put
+        ov 'isearch-open-invisible
+        (lambda (ov)
+          (when (member ov org-babel-hide-result-overlays)
+            (setq org-babel-hide-result-overlays
+                  (delq ov org-babel-hide-result-overlays)))
+          (when (eq (overlay-get ov 'invisible)
+                    'org-babel-hide-result)
+            (delete-overlay ov))))
+       (push ov org-babel-hide-result-overlays)))))
 
 ;; org-tab-after-check-for-cycling-hook
 (add-hook 'org-tab-first-hook 'org-babel-hide-result-toggle-maybe)
@@ -1654,7 +1672,8 @@ Note: this function removes any hlines in TABLE."
       (mapcar (lambda (row)
                 (if (listp row)
                     (cons (or (pop rownames) "") row)
-                  row)) table)
+                  row))
+             table)
     table))
 
 (defun org-babel-pick-name (names selector)
@@ -1879,9 +1898,9 @@ region is not active then the point is demarcated."
         (block (and start (match-string 0)))
         (headers (and start (match-string 4)))
         (stars (concat (make-string (or (org-current-level) 1) ?*) " "))
-        (lower-case-p (and block
+        (upper-case-p (and block
                            (let (case-fold-search)
-                             (string-match-p "#\\+begin_src" block)))))
+                             (string-match-p "#\\+BEGIN_SRC" block)))))
     (if info
         (mapc
          (lambda (place)
@@ -1895,9 +1914,9 @@ region is not active then the point is demarcated."
                 (delete-region (point-at-bol) (point-at-eol)))
                (insert (concat
                        (if (looking-at "^") "" "\n")
-                       indent (funcall (if lower-case-p 'downcase 'upcase) 
"#+end_src\n")
+                       indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
                        (if arg stars indent) "\n"
-                       indent (funcall (if lower-case-p 'downcase 'upcase) 
"#+begin_src ")
+                       indent (if upper-case-p "#+BEGIN_SRC " "#+begin_src ")
                        lang
                        (if (> (length headers) 1)
                            (concat " " headers) headers)
@@ -1918,14 +1937,16 @@ region is not active then the point is demarcated."
                   (if (org-region-active-p) (mark) (point)) (point))))
        (insert (concat (if (looking-at "^") "" "\n")
                        (if arg (concat stars "\n") "")
-                       (funcall (if lower-case-p 'downcase 'upcase) 
"#+begin_src ")
-                       lang "\n"
-                       body
+                       (if upper-case-p "#+BEGIN_SRC " "#+begin_src ")
+                       lang "\n" body
                        (if (or (= (length body) 0)
                                (string-suffix-p "\r" body)
-                               (string-suffix-p "\n" body)) "" "\n")
-                       (funcall (if lower-case-p 'downcase 'upcase) 
"#+end_src\n")))
-       (goto-char start) (move-end-of-line 1)))))
+                               (string-suffix-p "\n" body))
+                           ""
+                         "\n")
+                       (if upper-case-p "#+END_SRC\n" "#+end_src\n")))
+       (goto-char start)
+       (move-end-of-line 1)))))
 
 (defun org-babel--insert-results-keyword (name hash)
   "Insert RESULTS keyword with NAME value at point.
@@ -1938,7 +1959,7 @@ the results hash, or nil.  Leave point before the 
keyword."
                  (cond ((not hash) nil)
                        (org-babel-hash-show-time
                         (format "[%s %s]"
-                                (format-time-string "<%F %T>")
+                                (format-time-string "(%F %T)")
                                 hash))
                        (t (format "[%s]" hash)))
                  ":"
@@ -1964,7 +1985,7 @@ point, along with related contents.  Do nothing if HASH 
is nil.
 Return a non-nil value if results were cleared.  In this case,
 leave point where new results should be inserted."
   (when hash
-    (looking-at org-babel-result-regexp)
+    (let ((case-fold-search t)) (looking-at org-babel-result-regexp))
     (unless (string= (match-string 1) hash)
       (let* ((e (org-element-at-point))
             (post (copy-marker (org-element-property :post-affiliated e))))
@@ -2371,13 +2392,58 @@ INFO may provide the values of these header arguments 
(in the
                             (org-babel-chomp result "\n"))))
                   (t (goto-char beg) (insert result)))
                  (setq end (copy-marker (point) t))
-                 ;; possibly wrap result
+                 ;; Possibly wrap result.
                  (cond
                   ((assq :wrap (nth 2 info))
-                   (let ((name (or (cdr (assq :wrap (nth 2 info))) "results")))
-                     (funcall wrap (concat "#+begin_" name)
-                              (concat "#+end_" (car (split-string name)))
-                              nil nil (concat "{{{results(@@" name ":") 
"@@)}}}")))
+                   (let* ((full (or (cdr (assq :wrap (nth 2 info))) "results"))
+                          (split (split-string full))
+                          (type (car split))
+                          (opening-line (concat "#+begin_" full))
+                          (closing-line (concat "#+end_" type)))
+                     (cond
+                      ;; Escape contents from "export" wrap.  Wrap
+                      ;; inline results within an export snippet with
+                      ;; appropriate value.
+                      ((eq t (compare-strings type nil nil "export" nil nil t))
+                       (let ((backend (pcase split
+                                        (`(,_) "none")
+                                        (`(,_ ,b . ,_) b))))
+                         (funcall wrap
+                                  opening-line closing-line
+                                  nil nil
+                                  (format "{{{results(@@%s:"
+                                          backend) "@@)}}}")))
+                      ;; Escape contents from "example" wrap.  Mark
+                      ;; inline results as verbatim.
+                      ((eq t (compare-strings type nil nil "example" nil nil 
t))
+                       (funcall wrap
+                                opening-line closing-line
+                                nil nil
+                                "{{{results(=" "=)}}}"))
+                      ;; Escape contents from "src" wrap.  Mark
+                      ;; inline results as inline source code.
+                      ((eq t (compare-strings type nil nil "src" nil nil t))
+                       (let ((inline-open
+                              (pcase split
+                                (`(,_)
+                                 "{{{results(src_none{")
+                                (`(,_ ,language)
+                                 (format "{{{results(src_%s{" language))
+                                (`(,_ ,language . ,rest)
+                                 (let ((r (mapconcat #'identity rest " ")))
+                                   (format "{{{results(src_%s[%s]{"
+                                           language r))))))
+                         (funcall wrap
+                                  opening-line closing-line
+                                  nil nil
+                                  inline-open "})}}}")))
+                      ;; Do not escape contents in non-verbatim
+                      ;; blocks.  Return plain inline results.
+                      (t
+                       (funcall wrap
+                                opening-line closing-line
+                                t nil
+                                "{{{results(" ")}}}")))))
                   ((member "html" result-params)
                    (funcall wrap "#+begin_export html" "#+end_export" nil nil
                             "{{{results(@@html:" "@@)}}}"))
@@ -2433,7 +2499,8 @@ INFO may provide the values of these header arguments (in 
the
 (defun org-babel-remove-result (&optional info keep-keyword)
   "Remove the result of the current source block."
   (interactive)
-  (let ((location (org-babel-where-is-src-block-result nil info)))
+  (let ((location (org-babel-where-is-src-block-result nil info))
+       (case-fold-search t))
     (when location
       (save-excursion
         (goto-char location)
@@ -2488,7 +2555,7 @@ in the buffer."
           (if (memq (org-element-type element)
                     ;; Possible results types.
                     '(drawer example-block export-block fixed-width item
-                             plain-list src-block table))
+                             plain-list special-block src-block table))
               (save-excursion
                 (goto-char (min (point-max) ;for narrowed buffers
                                 (org-element-property :end element)))
@@ -2502,16 +2569,19 @@ If the `default-directory' is different from the 
containing
 file's directory then expand relative links."
   (when (stringp result)
     (let ((same-directory?
-          (and buffer-file-name
+          (and (buffer-file-name (buffer-base-buffer))
                (not (string= (expand-file-name default-directory)
-                             (expand-file-name
-                              (file-name-directory buffer-file-name)))))))
+                           (expand-file-name
+                            (file-name-directory
+                             (buffer-file-name (buffer-base-buffer)))))))))
       (format "[[file:%s]%s]"
-             (if (and default-directory buffer-file-name same-directory?)
+             (if (and default-directory
+                      (buffer-file-name (buffer-base-buffer)) same-directory?)
                  (if (eq org-link-file-path-type 'adaptive)
                      (file-relative-name
                       (expand-file-name result default-directory)
-                      (file-name-directory (buffer-file-name)))
+                      (file-name-directory
+                       (buffer-file-name (buffer-base-buffer))))
                    (expand-file-name result default-directory))
                result)
              (if description (concat "[" description "]") "")))))
@@ -2707,117 +2777,110 @@ would set the value of argument \"a\" equal to \"9\". 
 Note that
 these arguments are not evaluated in the current source-code
 block but are passed literally to the \"example-block\"."
   (let* ((parent-buffer (or parent-buffer (current-buffer)))
-         (info (or info (org-babel-get-src-block-info 'light)))
+        (info (or info (org-babel-get-src-block-info 'light)))
          (lang (nth 0 info))
          (body (nth 1 info))
-        (ob-nww-start org-babel-noweb-wrap-start)
-        (ob-nww-end org-babel-noweb-wrap-end)
-         (new-body "")
-        (nb-add (lambda (text) (setq new-body (concat new-body text))))
-        index source-name evaluate prefix)
-    (with-temp-buffer
-      (setq-local org-babel-noweb-wrap-start ob-nww-start)
-      (setq-local org-babel-noweb-wrap-end ob-nww-end)
-      (insert body) (goto-char (point-min))
-      (setq index (point))
-      (while (and (re-search-forward (org-babel-noweb-wrap) nil t))
-       (save-match-data (setf source-name (match-string 1)))
-       (save-match-data (setq evaluate (string-match "(.*)" source-name)))
-       (save-match-data
-         (setq prefix
-               (buffer-substring (match-beginning 0)
-                                 (save-excursion
-                                   (beginning-of-line 1) (point)))))
-       ;; add interval to new-body (removing noweb reference)
-       (goto-char (match-beginning 0))
-       (funcall nb-add (buffer-substring index (point)))
-       (goto-char (match-end 0))
-       (setq index (point))
-       (funcall
-         nb-add
-         (with-current-buffer parent-buffer
-           (save-restriction
-             (widen)
-             (mapconcat ;; Interpose PREFIX between every line.
-              #'identity
-              (split-string
-               (if evaluate
-                   (let ((raw (org-babel-ref-resolve source-name)))
-                     (if (stringp raw) raw (format "%S" raw)))
-                 (or
-                  ;; Retrieve from the Library of Babel.
-                  (nth 2 (assoc-string source-name org-babel-library-of-babel))
-                  ;; Return the contents of headlines literally.
-                  (save-excursion
-                    (when (org-babel-ref-goto-headline-id source-name)
-                     (org-babel-ref-headline-body)))
-                  ;; Find the expansion of reference in this buffer.
-                  (save-excursion
-                   (goto-char (point-min))
-                   (let* ((name-regexp
-                           (org-babel-named-src-block-regexp-for-name
-                            source-name))
-                          (comment
-                           (string= "noweb"
-                                    (cdr (assq :comments (nth 2 info)))))
-                          (c-wrap
-                           (lambda (s)
-                             ;; Comment, according to LANG mode,
-                             ;; string S.  Return new string.
-                             (with-temp-buffer
-                               (funcall (org-src-get-lang-mode lang))
-                               (comment-region (point)
-                                               (progn (insert s) (point)))
-                               (org-trim (buffer-string)))))
-                          (expand-body
-                           (lambda (i)
-                             ;; Expand body of code blocked
-                             ;; represented by block info I.
-                             (let ((b (if (org-babel-noweb-p (nth 2 i) :eval)
-                                          (org-babel-expand-noweb-references i)
-                                        (nth 1 i))))
-                               (if (not comment) b
-                                 (let ((cs (org-babel-tangle-comment-links i)))
-                                   (concat (funcall c-wrap (car cs)) "\n"
-                                           b "\n"
-                                           (funcall c-wrap (cadr cs)))))))))
-                     (if (and (re-search-forward name-regexp nil t)
-                              (not (org-in-commented-heading-p)))
-                         ;; Found a source block named SOURCE-NAME.
-                         ;; Assume it is unique; do not look after
-                         ;; `:noweb-ref' header argument.
-                         (funcall expand-body
-                                  (org-babel-get-src-block-info 'light))
-                       ;; Though luck.  We go into the long process
-                       ;; of checking each source block and expand
-                       ;; those with a matching Noweb reference.
-                       (let ((expansion nil))
-                         (org-babel-map-src-blocks nil
-                           (unless (org-in-commented-heading-p)
-                             (let* ((info
-                                     (org-babel-get-src-block-info 'light))
-                                    (parameters (nth 2 info)))
-                               (when (equal source-name
-                                            (cdr (assq :noweb-ref parameters)))
-                                 (push (funcall expand-body info) expansion)
-                                 (push (or (cdr (assq :noweb-sep parameters))
-                                           "\n")
-                                       expansion)))))
-                         (when expansion
-                           (mapconcat #'identity
-                                      (nreverse (cdr expansion))
-                                      ""))))))
-                  ;; Possibly raise an error if named block doesn't exist.
-                  (if (or org-babel-noweb-error-all-langs
-                         (member lang org-babel-noweb-error-langs))
-                     (error "%s could not be resolved (see \
-`org-babel-noweb-error-langs')"
-                            (org-babel-noweb-wrap source-name))
-                    "")))
-               "[\n\r]")
-             (concat "\n" prefix))))))
-      (funcall nb-add (buffer-substring index (point-max))))
-    new-body))
+        (comment (string= "noweb" (cdr (assq :comments (nth 2 info)))))
+        (noweb-re (format "\\(.*?\\)\\(%s\\)"
+                          (with-current-buffer parent-buffer
+                            (org-babel-noweb-wrap))))
+        (cache nil)
+        (c-wrap
+         (lambda (s)
+           ;; Comment string S, according to LANG mode.  Return new
+           ;; string.
+           (unless org-babel-tangle-uncomment-comments
+             (with-temp-buffer
+               (funcall (org-src-get-lang-mode lang))
+               (comment-region (point)
+                               (progn (insert s) (point)))
+               (org-trim (buffer-string))))))
+        (expand-body
+         (lambda (i)
+           ;; Expand body of code represented by block info I.
+           (let ((b (if (org-babel-noweb-p (nth 2 i) :eval)
+                        (org-babel-expand-noweb-references i)
+                      (nth 1 i))))
+             (if (not comment) b
+               (let ((cs (org-babel-tangle-comment-links i)))
+                 (concat (funcall c-wrap (car cs)) "\n"
+                         b "\n"
+                         (funcall c-wrap (cadr cs))))))))
+        (expand-references
+         (lambda (ref cache)
+           (pcase (gethash ref cache)
+             (`(,last . ,previous)
+              ;; Ignore separator for last block.
+              (let ((strings (list (funcall expand-body last))))
+                (dolist (i previous)
+                  (let ((parameters (nth 2 i)))
+                    ;; Since we're operating in reverse order, first
+                    ;; push separator, then body.
+                    (push (or (cdr (assq :noweb-sep parameters)) "\n")
+                          strings)
+                    (push (funcall expand-body i) strings)))
+                (mapconcat #'identity strings "")))
+             ;; Raise an error about missing reference, or return the
+             ;; empty string.
+             ((guard (or org-babel-noweb-error-all-langs
+                         (member lang org-babel-noweb-error-langs)))
+              (error "Cannot resolve %s (see `org-babel-noweb-error-langs')"
+                     (org-babel-noweb-wrap ref)))
+             (_ "")))))
+    (replace-regexp-in-string
+     noweb-re
+     (lambda (m)
+       (with-current-buffer parent-buffer
+        (save-match-data
+          (let* ((prefix (match-string 1 m))
+                 (id (match-string 3 m))
+                 (evaluate (string-match-p "(.*)" id))
+                 (expansion
+                  (cond
+                   (evaluate
+                    ;; Evaluation can potentially modify the buffer
+                    ;; and invalidate the cache: reset it.
+                    (setq cache nil)
+                    (let ((raw (org-babel-ref-resolve id)))
+                      (if (stringp raw) raw (format "%S" raw))))
+                   ;; Retrieve from the Library of Babel.
+                   ((nth 2 (assoc-string id org-babel-library-of-babel)))
+                   ;; Return the contents of headlines literally.
+                   ((org-babel-ref-goto-headline-id id)
+                    (org-babel-ref-headline-body))
+                   ;; Look for a source block named SOURCE-NAME.  If
+                   ;; found, assume it is unique; do not look after
+                   ;; `:noweb-ref' header argument.
+                   ((org-with-point-at 1
+                      (let ((r (org-babel-named-src-block-regexp-for-name id)))
+                        (and (re-search-forward r nil t)
+                             (not (org-in-commented-heading-p))
+                             (funcall expand-body
+                                      (org-babel-get-src-block-info t))))))
+                   ;; All Noweb references were cached in a previous
+                   ;; run.  Extract the information from the cache.
+                   ((hash-table-p cache)
+                    (funcall expand-references id cache))
+                   ;; Though luck.  We go into the long process of
+                   ;; checking each source block and expand those
+                   ;; with a matching Noweb reference.  Since we're
+                   ;; going to visit all source blocks in the
+                   ;; document, cache information about them as well.
+                   (t
+                    (setq cache (make-hash-table :test #'equal))
+                    (org-with-wide-buffer
+                     (org-babel-map-src-blocks nil
+                       (if (org-in-commented-heading-p)
+                           (org-forward-heading-same-level nil t)
+                         (let* ((info (org-babel-get-src-block-info t))
+                                (ref (cdr (assq :noweb-ref (nth 2 info)))))
+                           (push info (gethash ref cache))))))
+                    (funcall expand-references id cache)))))
+            ;; Interpose PREFIX between every line.
+            (mapconcat #'identity
+                       (split-string expansion "[\n\r]")
+                       (concat "\n" prefix))))))
+     body t t 2)))
 
 (defun org-babel--script-escape-inner (str)
   (let (in-single in-double backslash out)
@@ -2931,30 +2994,41 @@ situations in which is it not appropriate."
 (defun org-babel--string-to-number (string)
   "If STRING represents a number return its value.
 Otherwise return nil."
-  (and (string-match-p "\\`-?\\([0-9]\\|\\([1-9]\\|[0-9]*\\.\\)[0-9]*\\)\\'" 
string)
-       (string-to-number string)))
+  (unless (or (string-match-p "\\s-" (org-trim string))
+             (not (string-match-p "^[0-9e.+ -]+$" string)))
+    (let ((interned-string (ignore-errors (read string))))
+      (when (numberp interned-string)
+       interned-string))))
 
 (defun org-babel-import-elisp-from-file (file-name &optional separator)
   "Read the results located at FILE-NAME into an elisp table.
 If the table is trivial, then return it as a scalar."
-  (save-window-excursion
-    (let ((result
-          (with-temp-buffer
-            (condition-case err
-                (progn
-                  (org-table-import file-name separator)
-                  (delete-file file-name)
-                  (delq nil
-                        (mapcar (lambda (row)
-                                  (and (not (eq row 'hline))
-                                       (mapcar #'org-babel-string-read row)))
-                                (org-table-to-lisp))))
-              (error (message "Error reading results: %s" err) nil)))))
-      (pcase result
-       (`((,scalar)) scalar)
-       (`((,_ ,_ . ,_)) result)
-       (`(,scalar) scalar)
-       (_ result)))))
+  (let ((result
+        (with-temp-buffer
+          (condition-case err
+              (progn
+                (insert-file-contents file-name)
+                (delete-file file-name)
+                (let ((pmax (point-max)))
+                  ;; If the file was empty, don't bother trying to
+                  ;; convert the table.
+                  (when (> pmax 1)
+                    (org-table-convert-region (point-min) pmax separator)
+                    (delq nil
+                          (mapcar (lambda (row)
+                                    (and (not (eq row 'hline))
+                                         (mapcar #'org-babel-string-read row)))
+                                  (org-table-to-lisp))))))
+            (error
+             (display-warning 'org-babel
+                              (format "Error reading results: %S" err)
+                              :error)
+             nil)))))
+    (pcase result
+      (`((,scalar)) scalar)
+      (`((,_ ,_ . ,_)) result)
+      (`(,scalar) scalar)
+      (_ result))))
 
 (defun org-babel-string-read (cell)
   "Strip nested \"s from around strings."
@@ -3054,7 +3128,7 @@ of `org-babel-temporary-directory'."
                      (delete-directory file)
                    (delete-file file)))
                (directory-files org-babel-temporary-directory 'full
-                                 directory-files-no-dot-files-regexp))
+                                directory-files-no-dot-files-regexp))
          (delete-directory org-babel-temporary-directory))
       (error
        (message "Failed to remove temporary Org-babel directory %s"
diff --git a/lisp/org/ob-css.el b/lisp/org/ob-css.el
index b03e8fa..8ad70d4 100644
--- a/lisp/org/ob-css.el
+++ b/lisp/org/ob-css.el
@@ -1,6 +1,6 @@
 ;;; ob-css.el --- Babel Functions for CSS            -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -43,6 +43,4 @@ CSS does not support sessions."
 
 (provide 'ob-css)
 
-
-
 ;;; ob-css.el ends here
diff --git a/lisp/org/ob-ditaa.el b/lisp/org/ob-ditaa.el
index 369a080..249c8c8 100644
--- a/lisp/org/ob-ditaa.el
+++ b/lisp/org/ob-ditaa.el
@@ -1,6 +1,6 @@
 ;;; ob-ditaa.el --- Babel Functions for ditaa        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -119,6 +119,4 @@ This function is called by `org-babel-execute-src-block'."
 
 (provide 'ob-ditaa)
 
-
-
 ;;; ob-ditaa.el ends here
diff --git a/lisp/org/ob-dot.el b/lisp/org/ob-dot.el
index df83068..d13261b 100644
--- a/lisp/org/ob-dot.el
+++ b/lisp/org/ob-dot.el
@@ -1,6 +1,6 @@
 ;;; ob-dot.el --- Babel Functions for dot            -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -87,6 +87,4 @@ This function is called by `org-babel-execute-src-block'."
 
 (provide 'ob-dot)
 
-
-
 ;;; ob-dot.el ends here
diff --git a/lisp/org/ob-ebnf.el b/lisp/org/ob-ebnf.el
index 65151bf..58666a4 100644
--- a/lisp/org/ob-ebnf.el
+++ b/lisp/org/ob-ebnf.el
@@ -1,11 +1,10 @@
 ;;; ob-ebnf.el --- Babel Functions for EBNF          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Gauland
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: https://orgmode.org
-;; Version: 1.00
 
 ;; This file is part of GNU Emacs.
 
@@ -24,18 +23,18 @@
 
 ;;; Commentary:
 
-;;; Org-Babel support for using ebnf2ps to generate encapsulated postscript
-;;; railroad diagrams. It recognizes these arguments:
-;;;
-;;;     :file is required; it must include the extension '.eps.' All the rules
-;;;           in the block will be drawn in the same file. This is done by
-;;;           inserting a '[<file>' comment at the start of the block (see the
-;;;           documentation for ebnf-eps-buffer for more information).
-;;;
-;;;     :style specifies a value in ebnf-style-database. This provides the
-;;;            ability to customize the output. The style can also specify the
-;;;            grammar syntax (by setting ebnf-syntax); note that only ebnf,
-;;;            iso-ebnf, and yacc are supported by this file.
+;; Org-Babel support for using ebnf2ps to generate encapsulated postscript
+;; railroad diagrams. It recognizes these arguments:
+;;
+;;     :file is required; it must include the extension '.eps.' All the rules
+;;           in the block will be drawn in the same file. This is done by
+;;           inserting a '[<file>' comment at the start of the block (see the
+;;           documentation for ebnf-eps-buffer for more information).
+;;
+;;     :style specifies a value in ebnf-style-database. This provides the
+;;            ability to customize the output. The style can also specify the
+;;            grammar syntax (by setting ebnf-syntax); note that only ebnf,
+;;            iso-ebnf, and yacc are supported by this file.
 
 ;;; Requirements:
 
@@ -78,4 +77,5 @@ This function is called by `org-babel-execute-src-block'."
       result)))
 
 (provide 'ob-ebnf)
+
 ;;; ob-ebnf.el ends here
diff --git a/lisp/org/ob-emacs-lisp.el b/lisp/org/ob-emacs-lisp.el
index 095fbdb..d03151f 100644
--- a/lisp/org/ob-emacs-lisp.el
+++ b/lisp/org/ob-emacs-lisp.el
@@ -1,6 +1,6 @@
 ;;; ob-emacs-lisp.el --- Babel Functions for Emacs-lisp Code -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -61,31 +61,30 @@ by `org-edit-src-code'.")
 
 (defun org-babel-execute:emacs-lisp (body params)
   "Execute a block of emacs-lisp code with Babel."
-  (save-window-excursion
-    (let* ((lexical (cdr (assq :lexical params)))
-          (result-params (cdr (assq :result-params params)))
-          (body (format (if (member "output" result-params)
-                            "(with-output-to-string %s\n)"
-                          "(progn %s\n)")
-                        (org-babel-expand-body:emacs-lisp body params)))
-          (result (eval (read (if (or (member "code" result-params)
-                                      (member "pp" result-params))
-                                  (concat "(pp " body ")")
-                                body))
-                        (org-babel-emacs-lisp-lexical lexical))))
-      (org-babel-result-cond result-params
-       (let ((print-level nil)
-              (print-length nil))
-          (if (or (member "scalar" result-params)
-                  (member "verbatim" result-params))
-              (format "%S" result)
-            (format "%s" result)))
-       (org-babel-reassemble-table
-        result
-         (org-babel-pick-name (cdr (assq :colname-names params))
-                              (cdr (assq :colnames params)))
-         (org-babel-pick-name (cdr (assq :rowname-names params))
-                              (cdr (assq :rownames params))))))))
+  (let* ((lexical (cdr (assq :lexical params)))
+        (result-params (cdr (assq :result-params params)))
+        (body (format (if (member "output" result-params)
+                          "(with-output-to-string %s\n)"
+                        "(progn %s\n)")
+                      (org-babel-expand-body:emacs-lisp body params)))
+        (result (eval (read (if (or (member "code" result-params)
+                                    (member "pp" result-params))
+                                (concat "(pp " body ")")
+                              body))
+                      (org-babel-emacs-lisp-lexical lexical))))
+    (org-babel-result-cond result-params
+      (let ((print-level nil)
+            (print-length nil))
+        (if (or (member "scalar" result-params)
+                (member "verbatim" result-params))
+            (format "%S" result)
+          (format "%s" result)))
+      (org-babel-reassemble-table
+       result
+       (org-babel-pick-name (cdr (assq :colname-names params))
+                            (cdr (assq :colnames params)))
+       (org-babel-pick-name (cdr (assq :rowname-names params))
+                            (cdr (assq :rownames params)))))))
 
 (defun org-babel-emacs-lisp-lexical (lexical)
   "Interpret :lexical source block argument.
@@ -108,6 +107,4 @@ corresponding :lexical source block argument."
 
 (provide 'ob-emacs-lisp)
 
-
-
 ;;; ob-emacs-lisp.el ends here
diff --git a/lisp/org/ob-eshell.el b/lisp/org/ob-eshell.el
index 4edd3cf..6ae0fc6 100644
--- a/lisp/org/ob-eshell.el
+++ b/lisp/org/ob-eshell.el
@@ -1,6 +1,6 @@
 ;;; ob-eshell.el --- Babel Functions for Eshell      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: stardiviner <numbchild@gmail.com>
 ;; Keywords: literate programming, reproducible research
diff --git a/lisp/org/ob-eval.el b/lisp/org/ob-eval.el
index a939d93..b0fca7b 100644
--- a/lisp/org/ob-eval.el
+++ b/lisp/org/ob-eval.el
@@ -1,6 +1,6 @@
 ;;; ob-eval.el --- Babel Functions for External Code Evaluation -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, comint
@@ -144,6 +144,4 @@ This buffer is named by `org-babel-error-buffer-name'."
 
 (provide 'ob-eval)
 
-
-
 ;;; ob-eval.el ends here
diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el
index bbf9b55..e851ff6 100644
--- a/lisp/org/ob-exp.el
+++ b/lisp/org/ob-exp.el
@@ -1,6 +1,6 @@
 ;;; ob-exp.el --- Exportation of Babel Source Blocks -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Authors: Eric Schulte
 ;;     Dan Davison
@@ -33,6 +33,7 @@
 (declare-function org-escape-code-in-string "org-src" (s))
 (declare-function org-export-copy-buffer "ox" ())
 (declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
+(declare-function org-in-archived-heading-p "org" (&optional no-inheritance))
 
 (defvar org-src-preserve-indentation)
 
@@ -157,7 +158,8 @@ this template."
              ;; encountered.
              (goto-char (point-min))
              (while (re-search-forward regexp nil t)
-               (unless (save-match-data (org-in-commented-heading-p))
+               (unless (save-match-data (or (org-in-commented-heading-p)
+                                            (org-in-archived-heading-p)))
                  (let* ((object? (match-end 1))
                         (element (save-match-data
                                    (if object? (org-element-context)
@@ -403,9 +405,7 @@ inhibit insertion of results into the buffer."
          (`lob
           (save-excursion
             (goto-char (nth 5 info))
-            (let (org-confirm-babel-evaluate)
-              (org-babel-execute-src-block nil info)))))))))
-
+            (org-babel-execute-src-block nil info))))))))
 
 (provide 'ob-exp)
 
diff --git a/lisp/org/ob-forth.el b/lisp/org/ob-forth.el
index aef6784..3b521bc 100644
--- a/lisp/org/ob-forth.el
+++ b/lisp/org/ob-forth.el
@@ -1,6 +1,6 @@
 ;;; ob-forth.el --- Babel Functions for Forth        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, forth
@@ -76,7 +76,8 @@ This function is called by `org-babel-execute-src-block'."
                    ;; Report errors.
                    (org-babel-eval-error-notify 1
                     (buffer-substring
-                     (+ (match-beginning 0) 1) (point-max))) nil))))
+                     (+ (match-beginning 0) 1) (point-max)))
+                   nil))))
              (split-string (org-trim
                             (org-babel-expand-body:generic body params))
                            "\n"
diff --git a/lisp/org/ob-fortran.el b/lisp/org/ob-fortran.el
index 149058f..99afa0d 100644
--- a/lisp/org/ob-fortran.el
+++ b/lisp/org/ob-fortran.el
@@ -1,6 +1,6 @@
 ;;; ob-fortran.el --- Babel Functions for Fortran    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Authors: Sergey Litvinov
 ;;       Eric Schulte
@@ -101,7 +101,8 @@ its header arguments."
                     (concat
                      ;; variables
                      (mapconcat 'org-babel-fortran-var-to-fortran vars "\n")
-                     body) params)
+                     body)
+                    params)
                  body) "\n") "\n")))
 
 (defun org-babel-fortran-ensure-main-wrap (body params)
diff --git a/lisp/org/ob-gnuplot.el b/lisp/org/ob-gnuplot.el
index d11c55f..6489c23 100644
--- a/lisp/org/ob-gnuplot.el
+++ b/lisp/org/ob-gnuplot.el
@@ -1,6 +1,6 @@
 ;;; ob-gnuplot.el --- Babel Functions for Gnuplot    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -35,7 +35,7 @@
 
 ;; - gnuplot :: http://www.gnuplot.info/
 ;;
-;; - gnuplot-mode :: 
http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html
+;; - gnuplot-mode :: you can search the web for the latest active one.
 
 ;;; Code:
 (require 'ob)
@@ -278,6 +278,4 @@ Pass PARAMS through to `orgtbl-to-generic' when exporting 
TABLE."
 
 (provide 'ob-gnuplot)
 
-
-
 ;;; ob-gnuplot.el ends here
diff --git a/lisp/org/ob-groovy.el b/lisp/org/ob-groovy.el
index 38e2a16..fa847dd 100644
--- a/lisp/org/ob-groovy.el
+++ b/lisp/org/ob-groovy.el
@@ -1,6 +1,6 @@
 ;;; ob-groovy.el --- Babel Functions for Groovy      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Miro Bezjak
 ;; Keywords: literate programming, reproducible research
@@ -65,7 +65,6 @@ This function is called by `org-babel-execute-src-block'."
       (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
 
 (defvar org-babel-groovy-wrapper-method
-
   "class Runner extends Script {
     def out = new PrintWriter(new ByteArrayOutputStream())
     def run() { %s }
@@ -74,7 +73,6 @@ This function is called by `org-babel-execute-src-block'."
 println(new Runner().run())
 ")
 
-
 (defun org-babel-groovy-evaluate
     (session body &optional result-type result-params)
   "Evaluate BODY in external Groovy process.
@@ -111,6 +109,4 @@ supported in Groovy."
 
 (provide 'ob-groovy)
 
-
-
 ;;; ob-groovy.el ends here
diff --git a/lisp/org/ob-haskell.el b/lisp/org/ob-haskell.el
index e004a34..d7ac1b0 100644
--- a/lisp/org/ob-haskell.el
+++ b/lisp/org/ob-haskell.el
@@ -1,6 +1,6 @@
 ;;; ob-haskell.el --- Babel Functions for Haskell    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -23,20 +23,19 @@
 
 ;;; Commentary:
 
-;; Org-Babel support for evaluating haskell source code.  This one will
-;; be sort of tricky because haskell programs must be compiled before
+;; Org Babel support for evaluating Haskell source code.
+;; Haskell programs must be compiled before
 ;; they can be run, but haskell code can also be run through an
 ;; interactive interpreter.
 ;;
-;; For now lets only allow evaluation using the haskell interpreter.
+;; By default we evaluate using the Haskell interpreter.
+;; To use the compiler, specify :compile yes in the header.
 
 ;;; Requirements:
 
-;; - haskell-mode :: http://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode
-;;
-;; - inf-haskell :: http://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode
-;;
-;; - (optionally) lhs2tex :: http://people.cs.uu.nl/andres/lhs2tex/
+;; - haskell-mode: http://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode
+;; - inf-haskell: http://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode
+;; - (optionally) lhs2tex: http://people.cs.uu.nl/andres/lhs2tex/
 
 ;;; Code:
 (require 'ob)
@@ -47,6 +46,7 @@
 (declare-function run-haskell "ext:inf-haskell" (&optional arg))
 (declare-function inferior-haskell-load-file
                  "ext:inf-haskell" (&optional reload))
+(declare-function org-entry-get "org" (pom property &optional inherit 
literal-nil))
 
 (defvar org-babel-tangle-lang-exts)
 (add-to-list 'org-babel-tangle-lang-exts '("haskell" . "hs"))
@@ -60,8 +60,63 @@
 
 (defvar haskell-prompt-regexp)
 
-(defun org-babel-execute:haskell (body params)
-  "Execute a block of Haskell code."
+(defcustom org-babel-haskell-compiler "ghc"
+  "Command used to compile a Haskell source code file into an executable.
+May be either a command in the path, like \"ghc\" or an absolute
+path name, like \"/usr/local/bin/ghc\".  The command can include
+a parameter, such as \"ghc -v\"."
+  :group 'org-babel
+  :package-version '(Org "9.4")
+  :type 'string)
+
+(defconst org-babel-header-args:haskell '(compile . :any)
+  "Haskell-specific header arguments.")
+
+(defun org-babel-haskell-execute (body params)
+  "This function should only be called by `org-babel-execute:haskell'"
+  (let* ((tmp-src-file (org-babel-temp-file "Haskell-src-" ".hs"))
+         (tmp-bin-file
+          (org-babel-process-file-name
+           (org-babel-temp-file "Haskell-bin-" org-babel-exeext)))
+         (cmdline (cdr (assq :cmdline params)))
+         (cmdline (if cmdline (concat " " cmdline) ""))
+         (flags (cdr (assq :flags params)))
+         (flags (mapconcat #'identity
+                          (if (listp flags)
+                               flags
+                             (list flags))
+                          " "))
+         (libs (org-babel-read
+               (or (cdr (assq :libs params))
+                   (org-entry-get nil "libs" t))
+               nil))
+         (libs (mapconcat #'identity
+                         (if (listp libs) libs (list libs))
+                         " ")))
+    (with-temp-file tmp-src-file (insert body))
+    (org-babel-eval
+     (format "%s -o %s %s %s %s"
+             org-babel-haskell-compiler
+            tmp-bin-file
+            flags
+            (org-babel-process-file-name tmp-src-file)
+            libs)
+     "")
+    (let ((results (org-babel-eval (concat tmp-bin-file cmdline) "")))
+      (when results
+        (setq results (org-trim (org-remove-indentation results)))
+        (org-babel-reassemble-table
+         (org-babel-result-cond (cdr (assq :result-params params))
+          (org-babel-read results t)
+          (let ((tmp-file (org-babel-temp-file "Haskell-")))
+            (with-temp-file tmp-file (insert results))
+            (org-babel-import-elisp-from-file tmp-file)))
+         (org-babel-pick-name
+         (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+         (org-babel-pick-name
+         (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))))
+
+(defun org-babel-interpret-haskell (body params)
   (require 'inf-haskell)
   (add-hook 'inferior-haskell-hook
             (lambda ()
@@ -87,7 +142,7 @@
     (org-babel-reassemble-table
      (let ((result
             (pcase result-type
-              (`output (mapconcat #'identity (reverse (cdr results)) "\n"))
+              (`output (mapconcat #'identity (reverse results) "\n"))
               (`value (car results)))))
        (org-babel-result-cond (cdr (assq :result-params params))
         result (org-babel-script-escape result)))
@@ -96,6 +151,13 @@
      (org-babel-pick-name (cdr (assq :rowname-names params))
                          (cdr (assq :rowname-names params))))))
 
+(defun org-babel-execute:haskell (body params)
+  "Execute a block of Haskell code."
+  (let ((compile (string= "yes" (cdr (assq :compile params)))))
+    (if (not compile)
+       (org-babel-interpret-haskell body params)
+      (org-babel-haskell-execute body params))))
+
 (defun org-babel-haskell-initiate-session (&optional _session _params)
   "Initiate a haskell session.
 If there is not a current inferior-process-buffer in SESSION
@@ -215,6 +277,4 @@ constructs (header arguments, no-web syntax etc...) are 
ignored."
 
 (provide 'ob-haskell)
 
-
-
 ;;; ob-haskell.el ends here
diff --git a/lisp/org/ob-hledger.el b/lisp/org/ob-hledger.el
index 06d03b6..3d2f46c 100644
--- a/lisp/org/ob-hledger.el
+++ b/lisp/org/ob-hledger.el
@@ -1,6 +1,6 @@
 ;;  ob-hledger.el --- Babel Functions for hledger      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Michael
 ;; Keywords: literate programming, reproducible research, plain text accounting
@@ -30,6 +30,8 @@
 ;; probably ~/.hledger.journal (it may not notice your $LEDGER_FILE env var).
 ;; So make ~/.hledger.journal a symbolic link to the real file if necessary.
 
+;; TODO Unit tests are more than welcome, too.
+
 ;;; Code:
 (require 'ob)
 
@@ -64,7 +66,4 @@ This function is called by `org-babel-execute-src-block'."
 
 (provide 'ob-hledger)
 
-
-
 ;;; ob-hledger.el ends here
-;; TODO Unit tests are more than welcome, too.
diff --git a/lisp/org/ob-io.el b/lisp/org/ob-io.el
index 4d1f154..63d2b6c 100644
--- a/lisp/org/ob-io.el
+++ b/lisp/org/ob-io.el
@@ -1,6 +1,6 @@
 ;;; ob-io.el --- Babel Functions for Io              -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Andrzej Lichnerowicz
 ;; Keywords: literate programming, reproducible research
@@ -90,7 +90,6 @@ in BODY as elisp."
                  raw
                  (org-babel-script-escape raw)))))))
 
-
 (defun org-babel-prep-session:io (_session _params)
   "Prepare SESSION according to the header arguments specified in PARAMS."
   (error "Sessions are not (yet) supported for Io"))
@@ -103,6 +102,4 @@ supported in Io."
 
 (provide 'ob-io)
 
-
-
 ;;; ob-io.el ends here
diff --git a/lisp/org/ob-java.el b/lisp/org/ob-java.el
index 4b3d454..b1d517e 100644
--- a/lisp/org/ob-java.el
+++ b/lisp/org/ob-java.el
@@ -1,6 +1,6 @@
 ;;; ob-java.el --- Babel Functions for Java          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -58,6 +58,7 @@ parameters may be used, like javac -verbose"
         (src-file (concat classname ".java"))
         (cmpflag (or (cdr (assq :cmpflag params)) ""))
         (cmdline (or (cdr (assq :cmdline params)) ""))
+        (cmdargs (or (cdr (assq :cmdargs params)) ""))
         (full-body (org-babel-expand-body:generic body params)))
     (with-temp-file src-file (insert full-body))
     (org-babel-eval
@@ -66,10 +67,10 @@ parameters may be used, like javac -verbose"
     (unless (or (not packagename) (file-exists-p packagename))
       (make-directory packagename 'parents))
     (let ((results (org-babel-eval (concat org-babel-java-command
-                                           " " cmdline " " classname) "")))
+                                           " " cmdline " " classname " " 
cmdargs) "")))
       (org-babel-reassemble-table
        (org-babel-result-cond (cdr (assq :result-params params))
-        (org-babel-read results)
+        (org-babel-read results t)
          (let ((tmp-file (org-babel-temp-file "c-")))
            (with-temp-file tmp-file (insert results))
            (org-babel-import-elisp-from-file tmp-file)))
@@ -80,6 +81,4 @@ parameters may be used, like javac -verbose"
 
 (provide 'ob-java)
 
-
-
 ;;; ob-java.el ends here
diff --git a/lisp/org/ob-js.el b/lisp/org/ob-js.el
index 655e253..b2a971e 100644
--- a/lisp/org/ob-js.el
+++ b/lisp/org/ob-js.el
@@ -1,6 +1,6 @@
 ;;; ob-js.el --- Babel Functions for Javascript      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, js
@@ -65,7 +65,7 @@
   :safe #'stringp)
 
 (defvar org-babel-js-function-wrapper
-  "require('sys').print(require('sys').inspect(function(){\n%s\n}()));"
+  "require('process').stdout.write(require('util').inspect(function(){%s}()));"
   "Javascript code to print value of body.")
 
 (defun org-babel-execute:js (body params)
@@ -201,6 +201,4 @@ then create.  Return the initialized session."
 
 (provide 'ob-js)
 
-
-
 ;;; ob-js.el ends here
diff --git a/lisp/org/ob-latex.el b/lisp/org/ob-latex.el
index e0cc103..138f474 100644
--- a/lisp/org/ob-latex.el
+++ b/lisp/org/ob-latex.el
@@ -1,6 +1,6 @@
 ;;; ob-latex.el --- Babel Functions for LaTeX        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -84,7 +84,8 @@
                  (regexp-quote (format "%S" (car pair)))
                  (if (stringp (cdr pair))
                      (cdr pair) (format "%S" (cdr pair)))
-                 body))) (org-babel--get-vars params))
+                 body)))
+       (org-babel--get-vars params))
   (org-trim body))
 
 (defun org-babel-execute:latex (body params)
@@ -108,8 +109,11 @@ This function is called by `org-babel-execute-src-block'."
              (append (cdr (assq :packages params)) org-latex-packages-alist)))
         (cond
          ((and (string-suffix-p ".png" out-file) (not imagemagick))
-          (org-create-formula-image
-           body out-file org-format-latex-options in-buffer))
+          (let ((org-format-latex-header
+                (concat org-format-latex-header "\n"
+                        (mapconcat #'identity headers "\n"))))
+          (org-create-formula-image
+            body out-file org-format-latex-options in-buffer)))
          ((string-suffix-p ".tikz" out-file)
          (when (file-exists-p out-file) (delete-file out-file))
          (with-temp-file out-file
@@ -221,6 +225,6 @@ This function is called by `org-babel-execute-src-block'."
   "Return an error because LaTeX doesn't support sessions."
   (error "LaTeX does not support sessions"))
 
-
 (provide 'ob-latex)
+
 ;;; ob-latex.el ends here
diff --git a/lisp/org/ob-ledger.el b/lisp/org/ob-ledger.el
index e63e106..a117f85 100644
--- a/lisp/org/ob-ledger.el
+++ b/lisp/org/ob-ledger.el
@@ -1,6 +1,6 @@
 ;;; ob-ledger.el --- Babel Functions for Ledger      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric S Fraga
 ;; Keywords: literate programming, reproducible research, accounting
@@ -65,6 +65,4 @@ called by `org-babel-execute-src-block'."
 
 (provide 'ob-ledger)
 
-
-
 ;;; ob-ledger.el ends here
diff --git a/lisp/org/ob-lilypond.el b/lisp/org/ob-lilypond.el
index eb3372f..fbdd905 100644
--- a/lisp/org/ob-lilypond.el
+++ b/lisp/org/ob-lilypond.el
@@ -1,6 +1,6 @@
 ;;; ob-lilypond.el --- Babel Functions for Lilypond  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Martyn Jago
 ;; Keywords: babel language, literate programming
@@ -67,12 +67,15 @@ the midi file is not automatically played.  Default value 
is t")
 (defvar org-babel-lilypond-ly-command ""
   "Command to execute lilypond on your system.
 Do not set it directly.  Customize `org-babel-lilypond-commands' instead.")
+
 (defvar org-babel-lilypond-pdf-command ""
   "Command to show a PDF file on your system.
 Do not set it directly.  Customize `org-babel-lilypond-commands' instead.")
+
 (defvar org-babel-lilypond-midi-command ""
   "Command to play a MIDI file on your system.
 Do not set it directly.  Customize `org-babel-lilypond-commands' instead.")
+
 (defcustom org-babel-lilypond-commands
   (cond
    ((eq system-type 'darwin)
@@ -94,7 +97,8 @@ you can leave the string empty on this case."
   :version "24.4"
   :package-version '(Org . "8.2.7")
   :set
-  (lambda (_symbol value)
+  (lambda (symbol value)
+    (set symbol value)
     (setq
      org-babel-lilypond-ly-command   (nth 0 value)
      org-babel-lilypond-pdf-command  (nth 1 value)
@@ -201,7 +205,7 @@ If error in compilation, attempt to mark the error in 
lilypond org file."
          (delete-file org-babel-lilypond-temp-file))
        (rename-file org-babel-lilypond-tangled-file
                     org-babel-lilypond-temp-file))
-      (switch-to-buffer-other-window "*lilypond*")
+      (org-switch-to-buffer-other-window "*lilypond*")
       (erase-buffer)
       (org-babel-lilypond-compile-lilyfile org-babel-lilypond-temp-file)
       (goto-char (point-min))
@@ -258,7 +262,7 @@ FILE-NAME is full path to lilypond file."
   "Mark the erroneous lines in the lilypond org buffer.
 FILE-NAME is full path to lilypond file.
 LINE is the erroneous line."
-  (switch-to-buffer-other-window
+  (org-switch-to-buffer-other-window
    (concat (file-name-nondirectory
             (org-babel-lilypond-switch-extension file-name ".org"))))
   (let ((temp (point)))
@@ -387,7 +391,8 @@ If TEST is non-nil, the shell command is returned and is 
not run."
 (defun org-babel-lilypond-switch-extension (file-name ext)
   "Utility command to swap current FILE-NAME extension with EXT."
   (concat (file-name-sans-extension
-           file-name) ext))
+           file-name)
+        ext))
 
 (defun org-babel-lilypond-get-header-args (mode)
   "Default arguments to use when evaluating a lilypond source block.
diff --git a/lisp/org/ob-lisp.el b/lisp/org/ob-lisp.el
index f0e1ff6..87b9241 100644
--- a/lisp/org/ob-lisp.el
+++ b/lisp/org/ob-lisp.el
@@ -1,6 +1,6 @@
 ;;; ob-lisp.el --- Babel Functions for Common Lisp   -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Authors: Joel Boehland
 ;;      Eric Schulte
@@ -122,6 +122,4 @@ a property list containing the parameters of the block."
 
 (provide 'ob-lisp)
 
-
-
 ;;; ob-lisp.el ends here
diff --git a/lisp/org/ob-lob.el b/lisp/org/ob-lob.el
index 8c341e6..903dabf 100644
--- a/lisp/org/ob-lob.el
+++ b/lisp/org/ob-lob.el
@@ -1,6 +1,6 @@
 ;;; ob-lob.el --- Functions Supporting the Library of Babel -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Authors: Eric Schulte
 ;;      Dan Davison
diff --git a/lisp/org/ob-lua.el b/lisp/org/ob-lua.el
index b046b54..11503e4 100644
--- a/lisp/org/ob-lua.el
+++ b/lisp/org/ob-lua.el
@@ -1,6 +1,6 @@
 ;;; ob-lua.el --- Org Babel functions for Lua evaluation -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2014, 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2016-2021 Free Software Foundation, Inc.
 
 ;; Authors: Dieter Schoen
 ;; Keywords: literate programming, reproducible research
@@ -107,7 +107,8 @@ VARS contains resolved variable references."
     (org-babel-comint-in-buffer session
       (mapc (lambda (var)
               (end-of-line 1) (insert var) (comint-send-input)
-              (org-babel-comint-wait-for-output session)) var-lines))
+              (org-babel-comint-wait-for-output session))
+           var-lines))
     session))
 
 (defun org-babel-load-session:lua (session body params)
@@ -397,6 +398,4 @@ fd:close()"
 
 (provide 'ob-lua)
 
-
-
 ;;; ob-lua.el ends here
diff --git a/lisp/org/ob-makefile.el b/lisp/org/ob-makefile.el
index 15bf6ee..69ab6fe 100644
--- a/lisp/org/ob-makefile.el
+++ b/lisp/org/ob-makefile.el
@@ -1,6 +1,6 @@
 ;;; ob-makefile.el --- Babel Functions for Makefile  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;;        Thomas S. Dye
@@ -43,6 +43,4 @@ does not support sessions."
 
 (provide 'ob-makefile)
 
-
-
 ;;; ob-makefile.el ends here
diff --git a/lisp/org/ob-matlab.el b/lisp/org/ob-matlab.el
index 958357f..45ec5c5 100644
--- a/lisp/org/ob-matlab.el
+++ b/lisp/org/ob-matlab.el
@@ -1,6 +1,6 @@
 ;;; ob-matlab.el --- Babel support for Matlab        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Dan Davison
 ;; Keywords: literate programming, reproducible research
@@ -42,6 +42,4 @@
 
 (provide 'ob-matlab)
 
-
-
 ;;; ob-matlab.el ends here
diff --git a/lisp/org/ob-maxima.el b/lisp/org/ob-maxima.el
index 5d38cc3..7b49bb0 100644
--- a/lisp/org/ob-maxima.el
+++ b/lisp/org/ob-maxima.el
@@ -1,6 +1,6 @@
 ;;; ob-maxima.el --- Babel Functions for Maxima      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric S Fraga
 ;;     Eric Schulte
@@ -27,9 +27,7 @@
 ;; Org-Babel support for evaluating maxima entries.
 ;;
 ;; This differs from most standard languages in that
-;;
 ;; 1) there is no such thing as a "session" in maxima
-;;
 ;; 2) we are adding the "cmdline" header argument
 
 ;;; Code:
@@ -125,9 +123,6 @@ of the same value."
       (concat "[" (mapconcat #'org-babel-maxima-elisp-to-maxima val ", ") "]")
     (format "%s" val)))
 
-
 (provide 'ob-maxima)
 
-
-
 ;;; ob-maxima.el ends here
diff --git a/lisp/org/ob-mscgen.el b/lisp/org/ob-mscgen.el
index fa4d3e3..999d4f4 100644
--- a/lisp/org/ob-mscgen.el
+++ b/lisp/org/ob-mscgen.el
@@ -1,6 +1,6 @@
 ;;; ob-msc.el --- Babel Functions for Mscgen         -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Juan Pechiar
 ;; Keywords: literate programming, reproducible research
@@ -68,8 +68,7 @@ mscgen supported formats."
   (let* ((out-file (or (cdr (assq :file params)) "output.png" ))
          (filetype (or (cdr (assq :filetype params)) "png" )))
     (unless (cdr (assq :file params))
-      (error "
-ERROR: no output file specified.  Add \":file name.png\" to the src header"))
+      (error "ERROR: no output file specified.  Add \":file name.png\" to the 
src header"))
     (org-babel-eval (concat "mscgen -T " filetype " -o " out-file) body)
     nil)) ;; signal that output has already been written to file
 
@@ -79,6 +78,4 @@ ERROR: no output file specified.  Add \":file name.png\" to 
the src header"))
 
 (provide 'ob-mscgen)
 
-
-
 ;;; ob-msc.el ends here
diff --git a/lisp/org/ob-ocaml.el b/lisp/org/ob-ocaml.el
index 6972dae..0aa91af 100644
--- a/lisp/org/ob-ocaml.el
+++ b/lisp/org/ob-ocaml.el
@@ -1,6 +1,6 @@
 ;;; ob-ocaml.el --- Babel Functions for Ocaml        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -166,6 +166,4 @@ Emacs-lisp table, otherwise return the results as a string."
 
 (provide 'ob-ocaml)
 
-
-
 ;;; ob-ocaml.el ends here
diff --git a/lisp/org/ob-octave.el b/lisp/org/ob-octave.el
index fbfc9b9..166cd59 100644
--- a/lisp/org/ob-octave.el
+++ b/lisp/org/ob-octave.el
@@ -1,6 +1,6 @@
 ;;; ob-octave.el --- Babel Functions for Octave and Matlab -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Dan Davison
 ;; Keywords: literate programming, reproducible research
@@ -136,7 +136,8 @@ specifying a variable of the same value."
     (org-babel-comint-in-buffer session
       (mapc (lambda (var)
               (end-of-line 1) (insert var) (comint-send-input nil t)
-              (org-babel-comint-wait-for-output session)) var-lines))
+              (org-babel-comint-wait-for-output session))
+           var-lines))
     session))
 
 (defun org-babel-matlab-initiate-session (&optional session params)
@@ -230,7 +231,8 @@ value of the last statement in BODY, as elisp."
                         org-babel-octave-eoe-indicator
                       org-babel-octave-eoe-output)
                     t full-body)
-                 (insert full-body) (comint-send-input nil t)))) results)
+                 (insert full-body) (comint-send-input nil t))))
+        results)
     (pcase result-type
       (`value
        (org-babel-octave-import-elisp-from-file tmp-file))
@@ -259,6 +261,4 @@ This removes initial blank and comment lines and then calls
 
 (provide 'ob-octave)
 
-
-
 ;;; ob-octave.el ends here
diff --git a/lisp/org/ob-org.el b/lisp/org/ob-org.el
index 6316501..e29cbb5 100644
--- a/lisp/org/ob-org.el
+++ b/lisp/org/ob-org.el
@@ -1,6 +1,6 @@
 ;;; ob-org.el --- Babel Functions for Org Code Blocks -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -67,6 +67,4 @@ This function is called by `org-babel-execute-src-block'."
 
 (provide 'ob-org)
 
-
-
 ;;; ob-org.el ends here
diff --git a/lisp/org/ob-perl.el b/lisp/org/ob-perl.el
index 2daf577..0cfac85 100644
--- a/lisp/org/ob-perl.el
+++ b/lisp/org/ob-perl.el
@@ -1,6 +1,6 @@
 ;;; ob-perl.el --- Babel Functions for Perl          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Authors: Dan Davison
 ;;      Eric Schulte
@@ -152,6 +152,4 @@ return the value of the last statement in BODY, as elisp."
 
 (provide 'ob-perl)
 
-
-
 ;;; ob-perl.el ends here
diff --git a/lisp/org/ob-picolisp.el b/lisp/org/ob-picolisp.el
index bf31197..b1587f2 100644
--- a/lisp/org/ob-picolisp.el
+++ b/lisp/org/ob-picolisp.el
@@ -1,6 +1,6 @@
 ;;; ob-picolisp.el --- Babel Functions for Picolisp  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Authors: Thorsten Jolitz
 ;;      Eric Schulte
@@ -182,6 +182,4 @@ then create.  Return the initialized session."
 
 (provide 'ob-picolisp)
 
-
-
 ;;; ob-picolisp.el ends here
diff --git a/lisp/org/ob-plantuml.el b/lisp/org/ob-plantuml.el
index 49886e2..93c6538 100644
--- a/lisp/org/ob-plantuml.el
+++ b/lisp/org/ob-plantuml.el
@@ -1,6 +1,6 @@
 ;;; ob-plantuml.el --- Babel Functions for Plantuml  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Zhang Weize
 ;; Keywords: literate programming, reproducible research
@@ -31,7 +31,7 @@
 ;;; Requirements:
 
 ;; plantuml     | http://plantuml.sourceforge.net/
-;; plantuml.jar | `org-plantuml-jar-path' should point to the jar file
+;; plantuml.jar | `org-plantuml-jar-path' should point to the jar file (when 
exec mode is `jar')
 
 ;;; Code:
 (require 'ob)
@@ -46,6 +46,31 @@
   :version "24.1"
   :type 'string)
 
+(defcustom org-plantuml-exec-mode 'jar
+  "Method to use for PlantUML diagram generation.
+`jar' means to use java together with the JAR.
+The JAR can be configured via `org-plantuml-jar-path'.
+
+`plantuml' means to use the PlantUML executable.
+The executable can be configured via `org-plantuml-executable-path'.
+You can also configure extra arguments via `org-plantuml-executable-args'."
+  :group 'org-babel
+  :package-version '(Org . "9.4")
+  :type 'symbol
+  :options '(jar plantuml))
+
+(defcustom org-plantuml-executable-path "plantuml"
+  "File name of the PlantUML executable."
+  :group 'org-babel
+  :package-version '(Org . "9.4")
+  :type 'string)
+
+(defcustom org-plantuml-executable-args (list "-headless")
+  "The arguments passed to plantuml executable when executing PlantUML."
+  :group 'org-babel
+  :package-version '(Org . "9.4")
+  :type '(repeat string))
+
 (defun org-babel-variable-assignments:plantuml (params)
   "Return a list of PlantUML statements assigning the block's variables.
 PARAMS is a property list of source block parameters, which may
@@ -69,10 +94,11 @@ function to convert variables to PlantUML assignments.
 
 If BODY does not contain @startXXX ... @endXXX clauses, @startuml
 ... @enduml will be added."
-  (let ((assignments (org-babel-variable-assignments:plantuml params)))
-    (if (string-prefix-p "@start" body t) assignments
-      (format "@startuml\n%s\n@enduml"
-             (org-babel-expand-body:generic body params assignments)))))
+  (let ((full-body
+        (org-babel-expand-body:generic
+         body params (org-babel-variable-assignments:plantuml params))))
+    (if (string-prefix-p "@start" body t) full-body
+      (format "@startuml\n%s\n@enduml" full-body))))
 
 (defun org-babel-execute:plantuml (body params)
   "Execute a block of plantuml code with org-babel.
@@ -82,40 +108,41 @@ This function is called by `org-babel-execute-src-block'."
         (cmdline (cdr (assq :cmdline params)))
         (in-file (org-babel-temp-file "plantuml-"))
         (java (or (cdr (assq :java params)) ""))
+        (executable (cond ((eq org-plantuml-exec-mode 'plantuml) 
org-plantuml-executable-path)
+                          (t "java")))
+        (executable-args (cond ((eq org-plantuml-exec-mode 'plantuml) 
org-plantuml-executable-args)
+                               ((string= "" org-plantuml-jar-path)
+                                (error "`org-plantuml-jar-path' is not set"))
+                               ((not (file-exists-p org-plantuml-jar-path))
+                                (error "Could not find plantuml.jar at %s" 
org-plantuml-jar-path))
+                               (t (list java
+                                        "-jar"
+                                        (shell-quote-argument 
(expand-file-name org-plantuml-jar-path))))))
         (full-body (org-babel-plantuml-make-body body params))
-        (cmd (if (string= "" org-plantuml-jar-path)
-                 (error "`org-plantuml-jar-path' is not set")
-               (concat "java " java " -jar "
-                       (shell-quote-argument
-                        (expand-file-name org-plantuml-jar-path))
-                       (if (string= (file-name-extension out-file) "png")
-                           " -tpng" "")
-                       (if (string= (file-name-extension out-file) "svg")
-                           " -tsvg" "")
-                       (if (string= (file-name-extension out-file) "eps")
-                           " -teps" "")
-                       (if (string= (file-name-extension out-file) "pdf")
-                           " -tpdf" "")
-                       (if (string= (file-name-extension out-file) "tex")
-                           " -tlatex" "")
-                       (if (string= (file-name-extension out-file) "vdx")
-                           " -tvdx" "")
-                       (if (string= (file-name-extension out-file) "xmi")
-                           " -txmi" "")
-                       (if (string= (file-name-extension out-file) "scxml")
-                           " -tscxml" "")
-                       (if (string= (file-name-extension out-file) "html")
-                           " -thtml" "")
-                       (if (string= (file-name-extension out-file) "txt")
-                           " -ttxt" "")
-                       (if (string= (file-name-extension out-file) "utxt")
-                           " -utxt" "")
-                       " -p " cmdline " < "
-                       (org-babel-process-file-name in-file)
-                       " > "
-                       (org-babel-process-file-name out-file)))))
-    (unless (file-exists-p org-plantuml-jar-path)
-      (error "Could not find plantuml.jar at %s" org-plantuml-jar-path))
+        (cmd (mapconcat #'identity
+                        (append
+                         (list executable)
+                         executable-args
+                         (pcase (file-name-extension out-file)
+                           ("png" '("-tpng"))
+                           ("svg" '("-tsvg"))
+                           ("eps" '("-teps"))
+                           ("pdf" '("-tpdf"))
+                           ("tex" '("-tlatex"))
+                           ("vdx" '("-tvdx"))
+                           ("xmi" '("-txmi"))
+                           ("scxml" '("-tscxml"))
+                           ("html" '("-thtml"))
+                           ("txt" '("-ttxt"))
+                           ("utxt" '("-utxt")))
+                         (list
+                          "-p"
+                          cmdline
+                          "<"
+                          (org-babel-process-file-name in-file)
+                          ">"
+                          (org-babel-process-file-name out-file)))
+                        " ")))
     (with-temp-file in-file (insert full-body))
     (message "%s" cmd) (org-babel-eval cmd "")
     nil)) ;; signal that output has already been written to file
@@ -126,6 +153,4 @@ This function is called by `org-babel-execute-src-block'."
 
 (provide 'ob-plantuml)
 
-
-
 ;;; ob-plantuml.el ends here
diff --git a/lisp/org/ob-processing.el b/lisp/org/ob-processing.el
index fc1bead..9e6572a 100644
--- a/lisp/org/ob-processing.el
+++ b/lisp/org/ob-processing.el
@@ -1,6 +1,6 @@
 ;;; ob-processing.el --- Babel functions for processing -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Jarmo Hurri (adapted from ob-asymptote.el written by Eric Schulte)
 ;; Keywords: literate programming, reproducible research
diff --git a/lisp/org/ob-python.el b/lisp/org/ob-python.el
index 823f6e6..7911205 100644
--- a/lisp/org/ob-python.el
+++ b/lisp/org/ob-python.el
@@ -1,9 +1,10 @@
 ;;; ob-python.el --- Babel Functions for Python      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Authors: Eric Schulte
 ;;      Dan Davison
+;; Maintainer: Jack Kamm <jackkamm@gmail.com>
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: https://orgmode.org
 
@@ -29,10 +30,11 @@
 ;;; Code:
 (require 'ob)
 (require 'org-macs)
+(require 'python)
 
-(declare-function py-shell "ext:python-mode" (&optional argprompt))
+(declare-function py-shell "ext:python-mode" (&rest args))
 (declare-function py-toggle-shells "ext:python-mode" (arg))
-(declare-function run-python "ext:python" (&optional cmd dedicated show))
+(declare-function py-shell-send-string "ext:python-mode" (strg &optional 
process))
 
 (defvar org-babel-tangle-lang-exts)
 (add-to-list 'org-babel-tangle-lang-exts '("python" . "py"))
@@ -104,7 +106,8 @@ VARS contains resolved variable references."
     (org-babel-comint-in-buffer session
       (mapc (lambda (var)
               (end-of-line 1) (insert var) (comint-send-input)
-              (org-babel-comint-wait-for-output session)) var-lines))
+              (org-babel-comint-wait-for-output session))
+           var-lines))
     session))
 
 (defun org-babel-load-session:python (session body params)
@@ -177,42 +180,40 @@ Emacs-lisp table, otherwise return the results as a 
string."
   "Initiate a python session.
 If there is not a current inferior-process-buffer in SESSION
 then create.  Return the initialized session."
-  (require org-babel-python-mode)
   (save-window-excursion
     (let* ((session (if session (intern session) :default))
-           (python-buffer (org-babel-python-session-buffer session))
+           (py-buffer (org-babel-python-session-buffer session))
           (cmd (if (member system-type '(cygwin windows-nt ms-dos))
                    (concat org-babel-python-command " -i")
                  org-babel-python-command)))
       (cond
-       ((and (eq 'python org-babel-python-mode)
-            (fboundp 'run-python)) ; python.el
-       (if (not (version< "24.1" emacs-version))
-           (run-python cmd)
-         (unless python-buffer
-           (setq python-buffer (org-babel-python-with-earmuffs session)))
-         (let ((python-shell-buffer-name
-                (org-babel-python-without-earmuffs python-buffer)))
-           (run-python cmd))))
+       ((eq 'python org-babel-python-mode) ; python.el
+       (unless py-buffer
+         (setq py-buffer (org-babel-python-with-earmuffs session)))
+       (let ((python-shell-buffer-name
+              (org-babel-python-without-earmuffs py-buffer)))
+         (run-python cmd)
+         (sleep-for 0 10)))
        ((and (eq 'python-mode org-babel-python-mode)
             (fboundp 'py-shell)) ; python-mode.el
+       (require 'python-mode)
        ;; Make sure that py-which-bufname is initialized, as otherwise
        ;; it will be overwritten the first time a Python buffer is
        ;; created.
        (py-toggle-shells py-default-interpreter)
        ;; `py-shell' creates a buffer whose name is the value of
        ;; `py-which-bufname' with '*'s at the beginning and end
-       (let* ((bufname (if (and python-buffer (buffer-live-p python-buffer))
+       (let* ((bufname (if (and py-buffer (buffer-live-p py-buffer))
                            (replace-regexp-in-string ;; zap surrounding *
-                            "^\\*\\([^*]+\\)\\*$" "\\1" python-buffer)
+                            "^\\*\\([^*]+\\)\\*$" "\\1" py-buffer)
                          (concat "Python-" (symbol-name session))))
               (py-which-bufname bufname))
-         (py-shell)
-         (setq python-buffer (org-babel-python-with-earmuffs bufname))))
+         (setq py-buffer (org-babel-python-with-earmuffs bufname))
+         (py-shell nil nil t org-babel-python-command py-buffer nil nil t 
nil)))
        (t
        (error "No function available for running an inferior Python")))
       (setq org-babel-python-buffers
-           (cons (cons session python-buffer)
+           (cons (cons session py-buffer)
                  (assq-delete-all session org-babel-python-buffers)))
       session)))
 
@@ -222,8 +223,9 @@ then create.  Return the initialized session."
     (org-babel-python-session-buffer
      (org-babel-python-initiate-session-by-key session))))
 
-(defvar org-babel-python-eoe-indicator "'org_babel_python_eoe'"
+(defvar org-babel-python-eoe-indicator "org_babel_python_eoe"
   "A string to indicate that evaluation has completed.")
+
 (defconst org-babel-python-wrapper-method
   "
 def main():
@@ -238,14 +240,39 @@ def main():
 
 open('%s', 'w').write( pprint.pformat(main()) )")
 
-(defconst org-babel-python--exec-tmpfile
-  (concat
-   "__org_babel_python_fname = '%s'; "
-   "__org_babel_python_fh = open(__org_babel_python_fname); "
-   "exec(compile("
-   "__org_babel_python_fh.read(), __org_babel_python_fname, 'exec'"
-   ")); "
-   "__org_babel_python_fh.close()"))
+(defconst org-babel-python--exec-tmpfile "\
+with open('%s') as __org_babel_python_tmpfile:
+    exec(compile(__org_babel_python_tmpfile.read(), 
__org_babel_python_tmpfile.name, 'exec'))"
+  "Template for Python session command with output results.
+
+Has a single %s escape, the tempfile containing the source code
+to evaluate.")
+
+(defun org-babel-python-format-session-value
+    (src-file result-file result-params)
+  "Return Python code to evaluate SRC-FILE and write result to RESULT-FILE."
+  (format "\
+import ast
+with open('%s') as __org_babel_python_tmpfile:
+    __org_babel_python_ast = ast.parse(__org_babel_python_tmpfile.read())
+__org_babel_python_final = __org_babel_python_ast.body[-1]
+if isinstance(__org_babel_python_final, ast.Expr):
+    __org_babel_python_ast.body = __org_babel_python_ast.body[:-1]
+    exec(compile(__org_babel_python_ast, '<string>', 'exec'))
+    __org_babel_python_final = eval(compile(ast.Expression(
+        __org_babel_python_final.value), '<string>', 'eval'))
+    with open('%s', 'w') as __org_babel_python_tmpfile:
+        if %s:
+            import pprint
+            
__org_babel_python_tmpfile.write(pprint.pformat(__org_babel_python_final))
+        else:
+            __org_babel_python_tmpfile.write(str(__org_babel_python_final))
+else:
+    exec(compile(__org_babel_python_ast, '<string>', 'exec'))
+    __org_babel_python_final = None"
+         (org-babel-process-file-name src-file 'noquote)
+         (org-babel-process-file-name result-file 'noquote)
+         (if (member "pp" result-params) "True" "False")))
 
 (defun org-babel-python-evaluate
   (session body &optional result-type result-params preamble)
@@ -256,6 +283,19 @@ open('%s', 'w').write( pprint.pformat(main()) )")
     (org-babel-python-evaluate-external-process
      body result-type result-params preamble)))
 
+(defun org-babel-python--shift-right (body &optional count)
+  (with-temp-buffer
+    (python-mode)
+    (insert body)
+    (goto-char (point-min))
+    (while (not (eobp))
+      (unless (python-syntax-context 'string)
+       (python-indent-shift-right (line-beginning-position)
+                                  (line-end-position)
+                                  count))
+      (forward-line 1))
+    (buffer-string)))
+
 (defun org-babel-python-evaluate-external-process
     (body &optional result-type result-params preamble)
   "Evaluate BODY in external python process.
@@ -276,89 +316,70 @@ last statement in BODY, as elisp."
                        (if (member "pp" result-params)
                            org-babel-python-pp-wrapper-method
                          org-babel-python-wrapper-method)
-                       (mapconcat
-                        (lambda (line) (format "\t%s" line))
-                        (split-string (org-remove-indentation (org-trim body))
-                                      "[\r\n]")
-                        "\n")
+                       (org-babel-python--shift-right body)
                        (org-babel-process-file-name tmp-file 'noquote))))
                     (org-babel-eval-read-file tmp-file))))))
     (org-babel-result-cond result-params
       raw
       (org-babel-python-table-or-string (org-trim raw)))))
 
+(defun org-babel-python--send-string (session body)
+  "Pass BODY to the Python process in SESSION.
+Return output."
+  (with-current-buffer session
+    (let* ((string-buffer "")
+          (comint-output-filter-functions
+           (cons (lambda (text) (setq string-buffer
+                                      (concat string-buffer text)))
+                 comint-output-filter-functions))
+          (body (format "\
+try:
+%s
+except:
+    raise
+finally:
+    print('%s')"
+                        (org-babel-python--shift-right body 4)
+                        org-babel-python-eoe-indicator)))
+      (if (not (eq 'python-mode org-babel-python-mode))
+         (let ((python-shell-buffer-name
+                (org-babel-python-without-earmuffs session)))
+           (python-shell-send-string body))
+       (require 'python-mode)
+       (py-shell-send-string body (get-buffer-process session)))
+      ;; same as `python-shell-comint-end-of-output-p' in emacs-25.1+
+      (while (not (string-match
+                  org-babel-python-eoe-indicator
+                  string-buffer))
+       (accept-process-output (get-buffer-process (current-buffer))))
+      (org-babel-chomp (substring string-buffer 0 (match-beginning 0))))))
+
 (defun org-babel-python-evaluate-session
     (session body &optional result-type result-params)
   "Pass BODY to the Python process in SESSION.
 If RESULT-TYPE equals `output' then return standard output as a
 string.  If RESULT-TYPE equals `value' then return the value of the
 last statement in BODY, as elisp."
-  (let* ((send-wait (lambda () (comint-send-input nil t) (sleep-for 0 5)))
-        (dump-last-value
-         (lambda
-           (tmp-file pp)
-           (mapc
-            (lambda (statement) (insert statement) (funcall send-wait))
-            (if pp
-                (list
-                 "import pprint"
-                 (format "open('%s', 'w').write(pprint.pformat(_))"
-                         (org-babel-process-file-name tmp-file 'noquote)))
-              (list (format "open('%s', 'w').write(str(_))"
-                            (org-babel-process-file-name tmp-file
-                                                          'noquote)))))))
-        (last-indent 0)
-        (input-body (lambda (body)
-                      (dolist (line (split-string body "[\r\n]"))
-                        ;; Insert a blank line to end an indent
-                        ;; block.
-                        (let ((curr-indent (string-match "\\S-" line)))
-                          (if curr-indent
-                              (progn
-                                (when (< curr-indent last-indent)
-                                  (insert "")
-                                  (funcall send-wait))
-                                (setq last-indent curr-indent))
-                            (setq last-indent 0)))
-                        (insert line)
-                        (funcall send-wait))
-                      (funcall send-wait)))
+  (let* ((tmp-src-file (org-babel-temp-file "python-"))
          (results
-          (pcase result-type
-            (`output
-            (let ((body (if (string-match-p ".\n+." body) ; Multiline
-                            (let ((tmp-src-file (org-babel-temp-file
-                                                 "python-")))
-                              (with-temp-file tmp-src-file (insert body))
-                              (format org-babel-python--exec-tmpfile
-                                      tmp-src-file))
-                          body)))
-              (mapconcat
-               #'org-trim
-               (butlast
-                (org-babel-comint-with-output
-                    (session org-babel-python-eoe-indicator t body)
-                  (funcall input-body body)
-                  (funcall send-wait) (funcall send-wait)
-                  (insert org-babel-python-eoe-indicator)
-                  (funcall send-wait))
-                2) "\n")))
-            (`value
-             (let ((tmp-file (org-babel-temp-file "python-")))
-               (org-babel-comint-with-output
-                   (session org-babel-python-eoe-indicator nil body)
-                 (let ((comint-process-echoes nil))
-                   (funcall input-body body)
-                   (funcall dump-last-value tmp-file
-                            (member "pp" result-params))
-                   (funcall send-wait) (funcall send-wait)
-                   (insert org-babel-python-eoe-indicator)
-                   (funcall send-wait)))
-               (org-babel-eval-read-file tmp-file))))))
-    (unless (string= (substring org-babel-python-eoe-indicator 1 -1) results)
-      (org-babel-result-cond result-params
-       results
-        (org-babel-python-table-or-string results)))))
+         (progn
+           (with-temp-file tmp-src-file (insert body))
+            (pcase result-type
+             (`output
+              (let ((body (format org-babel-python--exec-tmpfile
+                                  (org-babel-process-file-name
+                                   tmp-src-file 'noquote))))
+                (org-babel-python--send-string session body)))
+              (`value
+               (let* ((tmp-results-file (org-babel-temp-file "python-"))
+                     (body (org-babel-python-format-session-value
+                            tmp-src-file tmp-results-file result-params)))
+                (org-babel-python--send-string session body)
+                (sleep-for 0 10)
+                (org-babel-eval-read-file tmp-results-file)))))))
+    (org-babel-result-cond result-params
+      results
+      (org-babel-python-table-or-string results))))
 
 (defun org-babel-python-read-string (string)
   "Strip \\='s from around Python string."
@@ -369,6 +390,4 @@ last statement in BODY, as elisp."
 
 (provide 'ob-python)
 
-
-
 ;;; ob-python.el ends here
diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el
index 19905bf..a7ab299 100644
--- a/lisp/org/ob-ref.el
+++ b/lisp/org/ob-ref.el
@@ -1,6 +1,6 @@
 ;;; ob-ref.el --- Babel Functions for Referencing External Data -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Authors: Eric Schulte
 ;;      Dan Davison
@@ -143,7 +143,8 @@ Emacs Lisp representation of the value of the variable."
                                   (org-babel-ref-split-args new-referent))))
              (when (> (length new-header-args) 0)
                (setq args (append (org-babel-parse-header-arguments
-                                   new-header-args) args)))
+                                   new-header-args)
+                                  args)))
              (setq ref new-refere)))
          (when (string-match "^\\(.+\\):\\(.+\\)$" ref)
            (setq split-file (match-string 1 ref))
@@ -240,7 +241,6 @@ to \"0:-1\"."
   "Split ARG-STRING into top-level arguments of balanced parenthesis."
   (mapcar #'org-trim (org-babel-balanced-split arg-string 44)))
 
-
 (provide 'ob-ref)
 
 ;;; ob-ref.el ends here
diff --git a/lisp/org/ob-ruby.el b/lisp/org/ob-ruby.el
index aa28bf1..ccc746e 100644
--- a/lisp/org/ob-ruby.el
+++ b/lisp/org/ob-ruby.el
@@ -1,6 +1,6 @@
 ;;; ob-ruby.el --- Babel Functions for Ruby          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -39,7 +39,8 @@
 (require 'ob)
 (require 'org-macs)
 
-(declare-function run-ruby "ext:inf-ruby" (&optional command name))
+(declare-function run-ruby-or-pop-to-buffer "ext:inf-ruby" (command &optional 
name buffer))
+(declare-function inf-ruby-buffer "ext:inf-ruby" ())
 (declare-function xmp "ext:rcodetools" (&optional option))
 
 (defvar inf-ruby-default-implementation)
@@ -75,6 +76,9 @@ This function is called by `org-babel-execute-src-block'."
                   (cdr (assq :session params)) params))
          (result-params (cdr (assq :result-params params)))
          (result-type (cdr (assq :result-type params)))
+        (org-babel-ruby-command
+         (or (cdr (assq :ruby params))
+             org-babel-ruby-command))
          (full-body (org-babel-expand-body:generic
                     body params (org-babel-variable-assignments:ruby params)))
          (result (if (member "xmp" result-params)
@@ -104,7 +108,8 @@ This function is called by `org-babel-execute-src-block'."
       (mapc (lambda (var)
               (insert var) (comint-send-input nil t)
               (org-babel-comint-wait-for-output session)
-              (sit-for .1) (goto-char (point-max))) var-lines))
+              (sit-for .1) (goto-char (point-max)))
+           var-lines))
     session))
 
 (defun org-babel-load-session:ruby (session body params)
@@ -154,12 +159,18 @@ If there is not a current inferior-process-buffer in 
SESSION
 then create one.  Return the initialized session."
   (unless (string= session "none")
     (require 'inf-ruby)
-    (let* ((cmd (cdr (or (assq :ruby params)
-                        (assoc inf-ruby-default-implementation
-                               inf-ruby-implementations))))
+    (let* ((command (cdr (or (assq :ruby params)
+                            (assoc inf-ruby-default-implementation
+                                   inf-ruby-implementations))))
           (buffer (get-buffer (format "*%s*" session)))
           (session-buffer (or buffer (save-window-excursion
-                                       (run-ruby cmd session)
+                                       (run-ruby-or-pop-to-buffer
+                                        (if (functionp command)
+                                            (funcall command)
+                                          command)
+                                        (or session "ruby")
+                                        (unless session
+                                          (inf-ruby-buffer)))
                                        (current-buffer)))))
       (if (org-babel-comint-buffer-livep session-buffer)
          (progn (sit-for .25) session-buffer)
@@ -265,6 +276,4 @@ return the value of the last statement in BODY, as elisp."
 
 (provide 'ob-ruby)
 
-
-
 ;;; ob-ruby.el ends here
diff --git a/lisp/org/ob-sass.el b/lisp/org/ob-sass.el
index c101574..76cdfd8 100644
--- a/lisp/org/ob-sass.el
+++ b/lisp/org/ob-sass.el
@@ -1,6 +1,6 @@
 ;;; ob-sass.el --- Babel Functions for the Sass CSS generation language -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -65,6 +65,4 @@ This function is called by `org-babel-execute-src-block'."
 
 (provide 'ob-sass)
 
-
-
 ;;; ob-sass.el ends here
diff --git a/lisp/org/ob-scheme.el b/lisp/org/ob-scheme.el
index bfd53d5..a18bfb5 100644
--- a/lisp/org/ob-scheme.el
+++ b/lisp/org/ob-scheme.el
@@ -1,6 +1,6 @@
 ;;; ob-scheme.el --- Babel Functions for Scheme      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Authors: Eric Schulte
 ;;         Michael Gauland
@@ -43,6 +43,7 @@
 (require 'geiser-impl nil t)
 (defvar geiser-repl--repl)             ; Defined in geiser-repl.el
 (defvar geiser-impl--implementation)   ; Defined in geiser-impl.el
+(defvar geiser-scheme-implementation)  ; Defined in geiser-impl.el
 (defvar geiser-default-implementation) ; Defined in geiser-impl.el
 (defvar geiser-active-implementations) ; Defined in geiser-impl.el
 (defvar geiser-debug-show-debug-p)     ; Defined in geiser-debug.el
@@ -71,7 +72,8 @@
 (defun org-babel-expand-body:scheme (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (let ((vars (org-babel--get-vars params))
-       (prepends (cdr (assq :prologue params))))
+       (prepends (cdr (assq :prologue params)))
+       (postpends (cdr (assq :epilogue params))))
     (concat (and prepends (concat prepends "\n"))
            (if (null vars) body
              (format "(let (%s)\n%s\n)"
@@ -80,7 +82,8 @@
                         (format "%S" (print `(,(car var) ',(cdr var)))))
                       vars
                       "\n      ")
-                     body)))))
+                     body))
+           (and postpends (concat "\n" postpends)))))
 
 
 (defvar org-babel-scheme-repl-map (make-hash-table :test #'equal)
@@ -175,7 +178,8 @@ is true; otherwise returns the last value."
                (geiser-debug-show-debug-p nil))
            (let ((ret (geiser-eval-region (point-min) (point-max))))
              (setq result (if output
-                              (geiser-eval--retort-output ret)
+                              (or (geiser-eval--retort-output ret)
+                                  "Geiser Interpreter produced no output")
                             (geiser-eval--retort-result-str ret "")))))
          (when (not repl)
            (save-current-buffer (set-buffer repl-buffer)
@@ -208,6 +212,7 @@ This function is called by `org-babel-execute-src-block'."
       (let* ((result-type (cdr (assq :result-type params)))
             (impl (or (when (cdr (assq :scheme params))
                         (intern (cdr (assq :scheme params))))
+                      geiser-scheme-implementation
                       geiser-default-implementation
                       (car geiser-active-implementations)))
             (session (org-babel-scheme-make-session-name
diff --git a/lisp/org/ob-screen.el b/lisp/org/ob-screen.el
index f663c9d..c3388c3 100644
--- a/lisp/org/ob-screen.el
+++ b/lisp/org/ob-screen.el
@@ -1,6 +1,6 @@
 ;;; ob-screen.el --- Babel Support for Interactive Terminal -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Benjamin Andresen
 ;; Keywords: literate programming, interactive shell
@@ -40,7 +40,8 @@
 In case you want to use a different screen than one selected by your $PATH")
 
 (defvar org-babel-default-header-args:screen
-  '((:results . "silent") (:session . "default") (:cmd . "sh") (:terminal . 
"xterm"))
+  `((:results . "silent") (:session . "default") (:cmd . "sh")
+    (:terminal . "xterm") (:screenrc . ,null-device))
   "Default arguments to use when running screen source blocks.")
 
 (defun org-babel-execute:screen (body params)
@@ -59,11 +60,11 @@ In case you want to use a different screen than one 
selected by your $PATH")
   (let* ((session (cdr (assq :session params)))
          (cmd (cdr (assq :cmd params)))
          (terminal (cdr (assq :terminal params)))
+         (screenrc (cdr (assq :screenrc params)))
          (process-name (concat "org-babel: terminal (" session ")")))
     (apply 'start-process process-name "*Messages*"
            terminal `("-T" ,(concat "org-babel: " session) "-e" 
,org-babel-screen-location
-                     "-c" ,null-device "-mS" ,(concat "org-babel-session-" 
session)
-                     ,cmd))
+                     "-c" ,screenrc "-mS" ,session ,cmd))
     ;; XXX: Is there a better way than the following?
     (while (not (org-babel-screen-session-socketname session))
       ;; wait until screen session is available before returning
@@ -97,9 +98,8 @@ In case you want to use a different screen than one selected 
by your $PATH")
                         nil
                         (mapcar
                          (lambda (x)
-                           (when (string-match
-                                  (concat "org-babel-session-" session) x)
-                             x))
+                           (and (string-match-p (regexp-quote session) x)
+                                x))
                          sockets)))))
     (when match-socket (car (split-string match-socket)))))
 
@@ -108,6 +108,7 @@ In case you want to use a different screen than one 
selected by your $PATH")
   (let ((tmpfile (org-babel-temp-file "screen-")))
     (with-temp-file tmpfile
       (insert body)
+      (insert "\n")
 
       ;; org-babel has superfluous spaces
       (goto-char (point-min))
@@ -138,6 +139,4 @@ The terminal should shortly flicker."
 
 (provide 'ob-screen)
 
-
-
 ;;; ob-screen.el ends here
diff --git a/lisp/org/ob-sed.el b/lisp/org/ob-sed.el
index f926da8..b95f411 100644
--- a/lisp/org/ob-sed.el
+++ b/lisp/org/ob-sed.el
@@ -1,10 +1,9 @@
 ;;; ob-sed.el --- Babel Functions for Sed Scripts    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Bjarte Johansen
 ;; Keywords: literate programming, reproducible research
-;; Version: 0.1.1
 
 ;; This file is part of GNU Emacs.
 
@@ -68,7 +67,8 @@ function is called by `org-babel-execute-src-block'."
          (in-file (cdr (assq :in-file params)))
         (code-file (let ((file (org-babel-temp-file "sed-")))
                       (with-temp-file file
-                       (insert body)) file))
+                       (insert body))
+                     file))
         (stdin (let ((stdin (cdr (assq :stdin params))))
                   (when stdin
                     (let ((tmp (org-babel-temp-file "sed-stdin-"))
@@ -102,4 +102,5 @@ function is called by `org-babel-execute-src-block'."
       (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))
 
 (provide 'ob-sed)
+
 ;;; ob-sed.el ends here
diff --git a/lisp/org/ob-shell.el b/lisp/org/ob-shell.el
index 1383f42..3eed0c1 100644
--- a/lisp/org/ob-shell.el
+++ b/lisp/org/ob-shell.el
@@ -1,6 +1,6 @@
 ;;; ob-shell.el --- Babel Functions for Shell Evaluation -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -71,6 +71,19 @@ outside the Customize interface."
         (set-default symbol value)
         (org-babel-shell-initialize)))
 
+(defcustom org-babel-shell-results-defaults-to-output t
+  "Let shell execution defaults to \":results output\".
+
+When set to t, use \":results output\" when no :results setting
+is set.  This is especially useful for inline source blocks.
+
+When set to nil, stick to the convention of using :results value
+as the default setting when no :results is set, the \"value\" of
+a shell execution being its exit code."
+  :group 'org-babel
+  :type 'boolean
+  :package-version '(Org . "9.4"))
+
 (defun org-babel-execute:shell (body params)
   "Execute a block of Shell commands with Babel.
 This function is called by `org-babel-execute-src-block'."
@@ -79,9 +92,17 @@ This function is called by `org-babel-execute-src-block'."
         (stdin (let ((stdin (cdr (assq :stdin params))))
                   (when stdin (org-babel-sh-var-to-string
                                (org-babel-ref-resolve stdin)))))
+        (results-params (cdr (assq :result-params params)))
+        (value-is-exit-status
+         (or (and
+              (equal '("replace") results-params)
+              (not org-babel-shell-results-defaults-to-output))
+             (member "value" results-params)))
         (cmdline (cdr (assq :cmdline params)))
-         (full-body (org-babel-expand-body:generic
-                    body params (org-babel-variable-assignments:shell 
params))))
+         (full-body (concat
+                    (org-babel-expand-body:generic
+                     body params (org-babel-variable-assignments:shell params))
+                    (when value-is-exit-status "\necho $?"))))
     (org-babel-reassemble-table
      (org-babel-sh-evaluate session full-body params stdin cmdline)
      (org-babel-pick-name
@@ -96,7 +117,8 @@ This function is called by `org-babel-execute-src-block'."
     (org-babel-comint-in-buffer session
       (mapc (lambda (var)
               (insert var) (comint-send-input nil t)
-              (org-babel-comint-wait-for-output session)) var-lines))
+              (org-babel-comint-wait-for-output session))
+           var-lines))
     session))
 
 (defun org-babel-load-session:shell (session body params)
@@ -129,15 +151,15 @@ This function is called by `org-babel-execute-src-block'."
     (varname values &optional sep hline)
   "Return a list of statements declaring the values as bash associative array."
   (format "unset %s\ndeclare -A %s\n%s"
-    varname varname
-    (mapconcat
-     (lambda (items)
-       (format "%s[%s]=%s"
-              varname
-              (org-babel-sh-var-to-sh (car items) sep hline)
-              (org-babel-sh-var-to-sh (cdr items) sep hline)))
-     values
-     "\n")))
+         varname varname
+         (mapconcat
+          (lambda (items)
+            (format "%s[%s]=%s"
+                    varname
+                    (org-babel-sh-var-to-sh (car items) sep hline)
+                    (org-babel-sh-var-to-sh (cdr items) sep hline)))
+          values
+          "\n")))
 
 (defun org-babel--variable-assignments:bash (varname values &optional sep 
hline)
   "Represent the parameters as useful Bash shell variables."
@@ -208,6 +230,12 @@ If RESULT-TYPE equals `output' then return a list of the 
outputs
 of the statements in BODY, if RESULT-TYPE equals `value' then
 return the value of the last statement in BODY."
   (let* ((shebang (cdr (assq :shebang params)))
+        (results-params (cdr (assq :result-params params)))
+        (value-is-exit-status
+         (or (and
+              (equal '("replace") results-params)
+              (not org-babel-shell-results-defaults-to-output))
+             (member "value" results-params)))
         (results
          (cond
           ((or stdin cmdline)         ; external shell script w/STDIN
@@ -259,8 +287,9 @@ return the value of the last statement in BODY."
                (insert body))
              (set-file-modes script-file #o755)
              (org-babel-eval script-file "")))
-          (t
-           (org-babel-eval shell-file-name (org-trim body))))))
+          (t (org-babel-eval shell-file-name (org-trim body))))))
+    (when value-is-exit-status
+      (setq results (car (reverse (split-string results "\n" t)))))
     (when results
       (let ((result-params (cdr (assq :result-params params))))
         (org-babel-result-cond result-params
@@ -277,6 +306,4 @@ return the value of the last statement in BODY."
 
 (provide 'ob-shell)
 
-
-
 ;;; ob-shell.el ends here
diff --git a/lisp/org/ob-shen.el b/lisp/org/ob-shen.el
index 1ce7113..6803b0b 100644
--- a/lisp/org/ob-shen.el
+++ b/lisp/org/ob-shen.el
@@ -1,6 +1,6 @@
 ;;; ob-shen.el --- Babel Functions for Shen          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, shen
@@ -75,4 +75,5 @@ This function is called by `org-babel-execute-src-block'."
           (error results))))))
 
 (provide 'ob-shen)
+
 ;;; ob-shen.el ends here
diff --git a/lisp/org/ob-sql.el b/lisp/org/ob-sql.el
index 59cf195..947acef 100644
--- a/lisp/org/ob-sql.el
+++ b/lisp/org/ob-sql.el
@@ -1,6 +1,6 @@
 ;;; ob-sql.el --- Babel Functions for SQL            -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -55,7 +55,7 @@
 ;; - dbi
 ;; - mssql
 ;; - sqsh
-;; - postgresql
+;; - postgresql (postgres)
 ;; - oracle
 ;; - vertica
 ;;
@@ -73,6 +73,7 @@
 (declare-function orgtbl-to-csv "org-table" (table params))
 (declare-function org-table-to-lisp "org-table" (&optional txt))
 (declare-function cygwin-convert-file-name-to-windows "cygw32.c" (file 
&optional absolute-p))
+(declare-function sql-set-product "sql" (product))
 
 (defvar sql-connection-alist)
 (defvar org-babel-default-header-args:sql '())
@@ -92,6 +93,13 @@
   (org-babel-sql-expand-vars
    body (org-babel--get-vars params)))
 
+(defun org-babel-edit-prep:sql (info)
+  "Set `sql-product' in Org edit buffer.
+Set `sql-product' in Org edit buffer according to the
+corresponding :engine source block header argument."
+  (let ((product (cdr (assq :engine (nth 2 info)))))
+    (sql-set-product product)))
+
 (defun org-babel-sql-dbstring-mysql (host port user password database)
   "Make MySQL cmd line args for database connection.  Pass nil to omit that 
arg."
   (combine-and-quote-strings
@@ -156,7 +164,8 @@ SQL Server on Windows and Linux platform."
              " "))
 
 (defun org-babel-sql-dbstring-vertica (host port user password database)
-  "Make Vertica command line args for database connection. Pass nil to omit 
that arg."
+  "Make Vertica command line args for database connection.
+Pass nil to omit that arg."
   (mapconcat #'identity
              (delq nil
                    (list (when host     (format "-h %s" host))
@@ -211,64 +220,64 @@ This function is called by `org-babel-execute-src-block'."
          (out-file (or (cdr (assq :out-file params))
                        (org-babel-temp-file "sql-out-")))
         (header-delim "")
-         (command (pcase (intern engine)
-                    (`dbi (format "dbish --batch %s < %s | sed '%s' > %s"
-                                 (or cmdline "")
-                                 (org-babel-process-file-name in-file)
-                                 "/^+/d;s/^|//;s/(NULL)/ /g;$d"
-                                 (org-babel-process-file-name out-file)))
-                    (`monetdb (format "mclient -f tab %s < %s > %s"
-                                     (or cmdline "")
-                                     (org-babel-process-file-name in-file)
-                                     (org-babel-process-file-name out-file)))
-                   (`mssql (format "sqlcmd %s -s \"\t\" %s -i %s -o %s"
-                                   (or cmdline "")
-                                   (org-babel-sql-dbstring-mssql
-                                    dbhost dbuser dbpassword database)
-                                   (org-babel-sql-convert-standard-filename
-                                    (org-babel-process-file-name in-file))
-                                   (org-babel-sql-convert-standard-filename
-                                    (org-babel-process-file-name out-file))))
-                    (`mysql (format "mysql %s %s %s < %s > %s"
-                                   (org-babel-sql-dbstring-mysql
-                                    dbhost dbport dbuser dbpassword database)
-                                   (if colnames-p "" "-N")
-                                   (or cmdline "")
-                                   (org-babel-process-file-name in-file)
-                                   (org-babel-process-file-name out-file)))
-                   (`postgresql (format
-                                 "%spsql --set=\"ON_ERROR_STOP=1\" %s -A -P \
-footer=off -F \"\t\"  %s -f %s -o %s %s"
-                                 (if dbpassword
-                                     (format "PGPASSWORD=%s " dbpassword)
-                                   "")
-                                 (if colnames-p "" "-t")
-                                 (org-babel-sql-dbstring-postgresql
-                                  dbhost dbport dbuser database)
-                                 (org-babel-process-file-name in-file)
-                                 (org-babel-process-file-name out-file)
-                                 (or cmdline "")))
-                   (`sqsh (format "sqsh %s %s -i %s -o %s -m csv"
+         (command (cl-case (intern engine)
+                    (dbi (format "dbish --batch %s < %s | sed '%s' > %s"
+                                (or cmdline "")
+                                (org-babel-process-file-name in-file)
+                                "/^+/d;s/^|//;s/(NULL)/ /g;$d"
+                                (org-babel-process-file-name out-file)))
+                    (monetdb (format "mclient -f tab %s < %s > %s"
+                                    (or cmdline "")
+                                    (org-babel-process-file-name in-file)
+                                    (org-babel-process-file-name out-file)))
+                   (mssql (format "sqlcmd %s -s \"\t\" %s -i %s -o %s"
                                   (or cmdline "")
-                                  (org-babel-sql-dbstring-sqsh
+                                  (org-babel-sql-dbstring-mssql
                                    dbhost dbuser dbpassword database)
                                   (org-babel-sql-convert-standard-filename
                                    (org-babel-process-file-name in-file))
                                   (org-babel-sql-convert-standard-filename
                                    (org-babel-process-file-name out-file))))
-                   (`vertica (format "vsql %s -f %s -o %s %s"
-                                   (org-babel-sql-dbstring-vertica
-                                    dbhost dbport dbuser dbpassword database)
-                                   (org-babel-process-file-name in-file)
-                                   (org-babel-process-file-name out-file)
-                                   (or cmdline "")))
-                    (`oracle (format
-                             "sqlplus -s %s < %s > %s"
-                             (org-babel-sql-dbstring-oracle
-                              dbhost dbport dbuser dbpassword database)
-                             (org-babel-process-file-name in-file)
-                             (org-babel-process-file-name out-file)))
-                    (_ (error "No support for the %s SQL engine" engine)))))
+                    (mysql (format "mysql %s %s %s < %s > %s"
+                                  (org-babel-sql-dbstring-mysql
+                                   dbhost dbport dbuser dbpassword database)
+                                  (if colnames-p "" "-N")
+                                  (or cmdline "")
+                                  (org-babel-process-file-name in-file)
+                                  (org-babel-process-file-name out-file)))
+                   ((postgresql postgres) (format
+                                           "%spsql --set=\"ON_ERROR_STOP=1\" 
%s -A -P \
+footer=off -F \"\t\"  %s -f %s -o %s %s"
+                                           (if dbpassword
+                                               (format "PGPASSWORD=%s " 
dbpassword)
+                                             "")
+                                           (if colnames-p "" "-t")
+                                           (org-babel-sql-dbstring-postgresql
+                                            dbhost dbport dbuser database)
+                                           (org-babel-process-file-name 
in-file)
+                                           (org-babel-process-file-name 
out-file)
+                                           (or cmdline "")))
+                   (sqsh (format "sqsh %s %s -i %s -o %s -m csv"
+                                 (or cmdline "")
+                                 (org-babel-sql-dbstring-sqsh
+                                  dbhost dbuser dbpassword database)
+                                 (org-babel-sql-convert-standard-filename
+                                  (org-babel-process-file-name in-file))
+                                 (org-babel-sql-convert-standard-filename
+                                  (org-babel-process-file-name out-file))))
+                   (vertica (format "vsql %s -f %s -o %s %s"
+                                    (org-babel-sql-dbstring-vertica
+                                     dbhost dbport dbuser dbpassword database)
+                                    (org-babel-process-file-name in-file)
+                                    (org-babel-process-file-name out-file)
+                                    (or cmdline "")))
+                    (oracle (format
+                            "sqlplus -s %s < %s > %s"
+                            (org-babel-sql-dbstring-oracle
+                             dbhost dbport dbuser dbpassword database)
+                            (org-babel-process-file-name in-file)
+                            (org-babel-process-file-name out-file)))
+                    (t (user-error "No support for the %s SQL engine" 
engine)))))
     (with-temp-file in-file
       (insert
        (pcase (intern engine)
@@ -301,7 +310,7 @@ SET COLSEP '|'
        (progn (insert-file-contents-literally out-file) (buffer-string)))
       (with-temp-buffer
        (cond
-        ((memq (intern engine) '(dbi mysql postgresql sqsh vertica))
+        ((memq (intern engine) '(dbi mysql postgresql postgres sqsh vertica))
          ;; Add header row delimiter after column-names header in first line
          (cond
           (colnames-p
@@ -365,6 +374,4 @@ SET COLSEP '|'
 
 (provide 'ob-sql)
 
-
-
 ;;; ob-sql.el ends here
diff --git a/lisp/org/ob-sqlite.el b/lisp/org/ob-sqlite.el
index 957ee65..6e21fa9 100644
--- a/lisp/org/ob-sqlite.el
+++ b/lisp/org/ob-sqlite.el
@@ -1,6 +1,6 @@
 ;;; ob-sqlite.el --- Babel Functions for SQLite Databases -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -133,11 +133,12 @@ This function is called by `org-babel-execute-src-block'."
   "If RESULT looks like a trivial table, then unwrap it."
   (if (and (equal 1 (length result))
           (equal 1 (length (car result))))
-      (org-babel-read (caar result))
+      (org-babel-read (caar result) t)
     (mapcar (lambda (row)
              (if (eq 'hline row)
                  'hline
-               (mapcar #'org-babel-string-read row))) result)))
+               (mapcar #'org-babel-string-read row)))
+           result)))
 
 (defun org-babel-sqlite-offset-colnames (table headers-p)
   "If HEADERS-P is non-nil then offset the first row as column names."
@@ -152,6 +153,4 @@ Prepare SESSION according to the header arguments specified 
in PARAMS."
 
 (provide 'ob-sqlite)
 
-
-
 ;;; ob-sqlite.el ends here
diff --git a/lisp/org/ob-stan.el b/lisp/org/ob-stan.el
index 678047c..1f2afde 100644
--- a/lisp/org/ob-stan.el
+++ b/lisp/org/ob-stan.el
@@ -1,6 +1,6 @@
 ;;; ob-stan.el --- Babel Functions for Stan          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Kyle Meyer
 ;; Keywords: literate programming, reproducible research
@@ -82,4 +82,5 @@ Otherwise, write the Stan code directly to the named file."
   (user-error "Stan does not support sessions"))
 
 (provide 'ob-stan)
+
 ;;; ob-stan.el ends here
diff --git a/lisp/org/ob-table.el b/lisp/org/ob-table.el
index 3132965..39a14a2 100644
--- a/lisp/org/ob-table.el
+++ b/lisp/org/ob-table.el
@@ -1,6 +1,6 @@
 ;;; ob-table.el --- Support for Calling Babel Functions from Tables -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -62,7 +62,8 @@ If STRING ends in a newline character, then remove the newline
 character and replace it with ellipses."
   (if (and (stringp string) (string-match "[\n\r]\\(.\\)?" string))
       (concat (substring string 0 (match-beginning 0))
-             (when (match-string 1 string) "...")) string))
+             (when (match-string 1 string) "..."))
+    string))
 
 (defmacro org-sbe (source-block &rest variables)
   "Return the results of calling SOURCE-BLOCK with VARIABLES.
@@ -147,6 +148,4 @@ as shown in the example below.
 
 (provide 'ob-table)
 
-
-
 ;;; ob-table.el ends here
diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el
index 9460398..3c3943c 100644
--- a/lisp/org/ob-tangle.el
+++ b/lisp/org/ob-tangle.el
@@ -1,6 +1,6 @@
 ;;; ob-tangle.el --- Extract Source Code From Org Files -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
@@ -41,6 +41,7 @@
 (declare-function org-element-type "org-element" (element))
 (declare-function org-heading-components "org" ())
 (declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
+(declare-function org-in-archived-heading-p "org" (&optional no-inheritance))
 (declare-function outline-previous-heading "outline" ())
 
 (defcustom org-babel-tangle-lang-exts
@@ -166,13 +167,14 @@ evaluating BODY."
 (def-edebug-spec org-babel-with-temp-filebuffer (form body))
 
 ;;;###autoload
-(defun org-babel-tangle-file (file &optional target-file lang)
+(defun org-babel-tangle-file (file &optional target-file lang-re)
   "Extract the bodies of source code blocks in FILE.
 Source code blocks are extracted with `org-babel-tangle'.
 Optional argument TARGET-FILE can be used to specify a default
-export file for all source blocks.  Optional argument LANG can be
-used to limit the exported source code blocks by language.
-Return a list whose CAR is the tangled file name."
+export file for all source blocks.  Optional argument LANG-RE can
+be used to limit the exported source code blocks by languages
+matching a regular expression.  Return a list whose CAR is the
+tangled file name."
   (interactive "fFile to tangle: \nP")
   (let ((visited-p (find-buffer-visiting (expand-file-name file)))
        to-be-removed)
@@ -180,7 +182,7 @@ Return a list whose CAR is the tangled file name."
        (save-window-excursion
          (find-file file)
          (setq to-be-removed (current-buffer))
-         (mapcar #'expand-file-name (org-babel-tangle nil target-file lang)))
+         (mapcar #'expand-file-name (org-babel-tangle nil target-file 
lang-re)))
       (unless visited-p
        (kill-buffer to-be-removed)))))
 
@@ -192,7 +194,7 @@ Return a list whose CAR is the tangled file name."
   (mapc (lambda (el) (copy-file el pub-dir t)) (org-babel-tangle-file 
filename)))
 
 ;;;###autoload
-(defun org-babel-tangle (&optional arg target-file lang)
+(defun org-babel-tangle (&optional arg target-file lang-re)
   "Write code blocks to source-specific files.
 Extract the bodies of all source code blocks from the current
 file into their own source-specific files.
@@ -200,8 +202,9 @@ With one universal prefix argument, only tangle the block 
at point.
 When two universal prefix arguments, only tangle blocks for the
 tangle file of the block at point.
 Optional argument TARGET-FILE can be used to specify a default
-export file for all source blocks.  Optional argument LANG can be
-used to limit the exported source code blocks by language."
+export file for all source blocks.  Optional argument LANG-RE can
+be used to limit the exported source code blocks by languages
+matching a regular expression."
   (interactive "P")
   (run-hooks 'org-babel-pre-tangle-hook)
   ;; Possibly Restrict the buffer to the current code block
@@ -286,7 +289,7 @@ used to limit the exported source code blocks by language."
              specs)))
         (if (equal arg '(4))
             (org-babel-tangle-single-block 1 t)
-          (org-babel-tangle-collect-blocks lang tangle-file)))
+          (org-babel-tangle-collect-blocks lang-re tangle-file)))
        (message "Tangled %d code block%s from %s" block-counter
                 (if (= block-counter 1) "" "s")
                 (file-name-nondirectory
@@ -364,13 +367,14 @@ that the appropriate major-mode is set.  SPEC has the 
form:
               (org-fill-template
                org-babel-tangle-comment-format-end link-data)))))
 
-(defun org-babel-tangle-collect-blocks (&optional language tangle-file)
+(defun org-babel-tangle-collect-blocks (&optional lang-re tangle-file)
   "Collect source blocks in the current Org file.
 Return an association list of source-code block specifications of
 the form used by `org-babel-spec-to-string' grouped by language.
-Optional argument LANGUAGE can be used to limit the collected
-source code blocks by language.  Optional argument TANGLE-FILE
-can be used to limit the collected code blocks by target file."
+Optional argument LANG-RE can be used to limit the collected
+source code blocks by languages matching a regular expression.
+Optional argument TANGLE-FILE can be used to limit the collected
+code blocks by target file."
   (let ((counter 0) last-heading-pos blocks)
     (org-babel-map-src-blocks (buffer-file-name)
       (let ((current-heading-pos
@@ -379,13 +383,14 @@ can be used to limit the collected code blocks by target 
file."
        (if (eq last-heading-pos current-heading-pos) (cl-incf counter)
          (setq counter 1)
          (setq last-heading-pos current-heading-pos)))
-      (unless (org-in-commented-heading-p)
+      (unless (or (org-in-commented-heading-p)
+                 (org-in-archived-heading-p))
        (let* ((info (org-babel-get-src-block-info 'light))
               (src-lang (nth 0 info))
               (src-tfile (cdr (assq :tangle (nth 2 info)))))
          (unless (or (string= src-tfile "no")
                      (and tangle-file (not (equal tangle-file src-tfile)))
-                     (and language (not (string= language src-lang))))
+                     (and lang-re (not (string-match-p lang-re src-lang))))
            ;; Add the spec for this block to blocks under its
            ;; language.
            (let ((by-lang (assoc src-lang blocks))
@@ -471,9 +476,9 @@ non-nil, return the full association list to be used by
                  file)
                (if (and org-babel-tangle-use-relative-file-links
                         (string-match org-link-types-re link)
-                        (string= (match-string 0 link) "file"))
+                        (string= (match-string 1 link) "file"))
                    (concat "file:"
-                           (file-relative-name (match-string 1 link)
+                           (file-relative-name (substring link (match-end 0))
                                                (file-name-directory
                                                 (cdr (assq :tangle params)))))
                  link)
@@ -513,14 +518,16 @@ which enable the original code blocks to be found."
     (goto-char (point-min))
     (let ((counter 0) new-body end)
       (while (re-search-forward org-link-bracket-re nil t)
-        (when (re-search-forward
-              (concat " " (regexp-quote (match-string 2)) " ends here"))
-          (setq end (match-end 0))
-          (forward-line -1)
-          (save-excursion
-           (when (setq new-body (org-babel-tangle-jump-to-org))
-             (org-babel-update-block-body new-body)))
-          (setq counter (+ 1 counter)))
+        (if (and (match-string 2)
+                (re-search-forward
+                 (concat " " (regexp-quote (match-string 2)) " ends here") nil 
t))
+           (progn (setq end (match-end 0))
+                  (forward-line -1)
+                  (save-excursion
+                    (when (setq new-body (org-babel-tangle-jump-to-org))
+                      (org-babel-update-block-body new-body)))
+                  (setq counter (+ 1 counter)))
+         (setq end (point)))
         (goto-char end))
       (prog1 counter (message "Detangled %d code blocks" counter)))))
 
@@ -541,7 +548,8 @@ which enable the original code blocks to be found."
                            (save-match-data
                              (re-search-forward
                               (concat " " (regexp-quote block-name)
-                                      " ends here") nil t)
+                                      " ends here")
+                              nil t)
                              (setq end (line-beginning-position))))))))
        (unless (and start (< start mid) (< mid end))
          (error "Not in tangled code"))
diff --git a/lisp/org/ob-vala.el b/lisp/org/ob-vala.el
index b1c2275..6c3068a 100644
--- a/lisp/org/ob-vala.el
+++ b/lisp/org/ob-vala.el
@@ -1,6 +1,6 @@
 ;;; ob-vala.el --- Babel functions for Vala evaluation -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Christian Garbs <mitch@cgarbs.de>
 ;; Keywords: literate programming, reproducible research
diff --git a/lisp/org/ob.el b/lisp/org/ob.el
index 7347bab..1e89b02 100644
--- a/lisp/org/ob.el
+++ b/lisp/org/ob.el
@@ -1,6 +1,6 @@
 ;;; ob.el --- Working with Code Blocks in Org        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Authors: Eric Schulte
 ;; Keywords: literate programming, reproducible research
diff --git a/lisp/org/ol-bbdb.el b/lisp/org/ol-bbdb.el
index 9f522ce..01a1fe9 100644
--- a/lisp/org/ol-bbdb.el
+++ b/lisp/org/ol-bbdb.el
@@ -1,6 +1,6 @@
 ;;; ol-bbdb.el --- Links to BBDB entries             -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Authors: Carsten Dominik <carsten at orgmode dot org>
 ;;       Thomas Baumann <thomas dot baumann at ch dot tum dot de>
@@ -98,7 +98,7 @@
 (require 'org-macs)
 (require 'ol)
 
-;; Declare functions and variables
+;;; Declare functions and variables
 
 (declare-function bbdb "ext:bbdb-com" (string elidep))
 (declare-function bbdb-company "ext:bbdb-com" (string elidep))
@@ -126,9 +126,9 @@
 
 (declare-function diary-ordinal-suffix "diary-lib" (n))
 
-(with-no-warnings (defvar date))       ;unprefixed, from calendar.el
+(with-no-warnings (defvar date))       ; unprefixed, from calendar.el
 
-;; Customization
+;;; Customization
 
 (defgroup org-bbdb-anniversaries nil
   "Customizations for including anniversaries from BBDB into Agenda."
@@ -162,13 +162,13 @@ used."
   '(("birthday" .
      (lambda (name years suffix)
        (concat "Birthday: [[bbdb:" name "][" name " ("
-               (format "%s" years) ; handles numbers as well as strings
-               suffix ")]]")))
+              (format "%s" years)        ; handles numbers as well as strings
+              suffix ")]]")))
     ("wedding" .
      (lambda (name years suffix)
        (concat "[[bbdb:" name "][" name "'s "
-               (format "%s" years)
-               suffix " wedding anniversary]]"))))
+              (format "%s" years)
+              suffix " wedding anniversary]]"))))
   "How different types of anniversaries should be formatted.
 An alist of elements (STRING . FORMAT) where STRING is the name of an
 anniversary class and format is either:
@@ -221,7 +221,8 @@ date year)."
                         :complete #'org-bbdb-complete-link
                         :store #'org-bbdb-store-link)
 
-;; Implementation
+;;; Implementation
+
 (defun org-bbdb-store-link ()
   "Store a link to a BBDB database entry."
   (when (eq major-mode 'bbdb-mode)
@@ -236,7 +237,7 @@ date year)."
                            :link link :description name)
       link)))
 
-(defun org-bbdb-export (path desc format)
+(defun org-bbdb-export (path desc format _)
   "Create the export version of a BBDB link specified by PATH or DESC.
 If exporting to either HTML or LaTeX FORMAT the link will be
 italicized, in all other cases it is left unchanged."
@@ -249,7 +250,7 @@ italicized, in all other cases it is left unchanged."
     (format "<text:span text:style-name=\"Emphasis\">%s</text:span>" desc))
    (t desc)))
 
-(defun org-bbdb-open (name)
+(defun org-bbdb-open (name _)
   "Follow a BBDB link to NAME."
   (require 'bbdb-com)
   (let ((inhibit-redisplay (not debug-on-error)))
@@ -362,7 +363,9 @@ This is used by Org to re-create the anniversary hash 
table."
 
 ;;;###autoload
 (defun org-bbdb-anniversaries ()
-  "Extract anniversaries from BBDB for display in the agenda."
+  "Extract anniversaries from BBDB for display in the agenda.
+When called programmatically, this function expects the `date'
+variable to be globally bound."
   (require 'bbdb)
   (require 'diary-lib)
   (unless (hash-table-p org-bbdb-anniv-hash)
@@ -380,7 +383,7 @@ This is used by Org to re-create the anniversary hash 
table."
          (text ())
          rec recs)
 
-    ;; we don't want to miss people born on Feb. 29th
+    ;; We don't want to miss people born on Feb. 29th
     (when (and (= m 3) (= d 1)
                (not (null (gethash (list 2 29) org-bbdb-anniv-hash)))
                (not (calendar-leap-year-p y)))
@@ -415,8 +418,9 @@ This is used by Org to re-create the anniversary hash 
table."
         ))
     text))
 
-;;; Return list of anniversaries for today and the next n-1 (default: n=7) 
days.
-;;; This is meant to be used in an org file instead of org-bbdb-anniversaries:
+;;; Return the list of anniversaries for today and the next n-1
+;;; (default: n=7) days.  This is meant to be used in an org file
+;;; instead of org-bbdb-anniversaries:
 ;;;
 ;;; %%(org-bbdb-anniversaries-future)
 ;;;
@@ -427,7 +431,7 @@ This is used by Org to re-create the anniversary hash 
table."
 ;;; to override the 7-day default.
 
 (defun org-bbdb-date-list (d n)
-  "Return a list of dates in (m d y) format from the given date D to n-1 days 
hence."
+  "Return list of dates in (m d y) format from the given date D to n-1 days 
hence."
   (let ((abs (calendar-absolute-from-gregorian d)))
     (mapcar (lambda (i) (calendar-gregorian-from-absolute (+ abs i)))
            (number-sequence 0 (1- n)))))
@@ -442,15 +446,14 @@ for the same event depending on if it occurs in the next 
few days
 or far away in the future."
   (let ((delta (- (calendar-absolute-from-gregorian anniv-date)
                   (calendar-absolute-from-gregorian agenda-date))))
-
     (cond
      ((= delta 0) " -- today\\&")
      ((= delta 1) " -- tomorrow\\&")
-     ((< delta org-bbdb-general-anniversary-description-after) (format " -- in 
%d days\\&" delta))
+     ((< delta org-bbdb-general-anniversary-description-after)
+      (format " -- in %d days\\&" delta))
      ((pcase-let ((`(,month ,day ,year) anniv-date))
        (format " -- %d-%02d-%02d\\&" year month day))))))
 
-
 (defun org-bbdb-anniversaries-future (&optional n)
   "Return list of anniversaries for today and the next n-1 days (default n=7)."
   (let ((n (or n 7)))
diff --git a/lisp/org/ol-bibtex.el b/lisp/org/ol-bibtex.el
index f139d64..6b59121 100644
--- a/lisp/org/ol-bibtex.el
+++ b/lisp/org/ol-bibtex.el
@@ -1,6 +1,6 @@
 ;;; ol-bibtex.el --- Links to BibTeX entries        -*- lexical-binding: t; -*-
 ;;
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 ;;
 ;; Authors: Bastien Guerry <bzg@gnu.org>
 ;;       Carsten Dominik <carsten dot dominik at gmail dot com>
@@ -95,7 +95,7 @@
 ;; The link creation part has been part of Org for a long time.
 ;;
 ;; Creating better capture template information was inspired by a request
-;; of Austin Frank: http://article.gmane.org/gmane.emacs.orgmode/4112
+;; of Austin Frank: https://orgmode.org/list/m0myu03vbx.fsf@gmail.com
 ;; and then implemented by Bastien Guerry.
 ;;
 ;; Eric Schulte eventually added the functions for translating between
@@ -134,10 +134,11 @@
 (declare-function org-insert-heading "org" (&optional arg invisible-ok top))
 (declare-function org-map-entries "org" (func &optional match scope &rest 
skip))
 (declare-function org-narrow-to-subtree "org" ())
-(declare-function org-open-file "org" (path &optional in-emacs line search))
 (declare-function org-set-property "org" (property value))
 (declare-function org-toggle-tag "org" (tag &optional onoff))
 
+(declare-function org-search-view "org-agenda" (&optional todo-only string 
edit-at))
+
 
 ;;; Bibtex data
 (defvar org-bibtex-types
@@ -483,12 +484,11 @@ With optional argument OPTIONAL, also prompt for optional 
fields."
                         :follow #'org-bibtex-open
                         :store #'org-bibtex-store-link)
 
-(defun org-bibtex-open (path)
-  "Visit the bibliography entry on PATH."
-  (let* ((search (when (string-match "::\\(.+\\)\\'" path)
-                  (match-string 1 path)))
-        (path (substring path 0 (match-beginning 0))))
-    (org-open-file path t nil search)))
+(defun org-bibtex-open (path arg)
+  "Visit the bibliography entry on PATH.
+ARG, when non-nil, is a universal prefix argument.  See
+`org-open-file' for details."
+  (org-link-open-as-file path arg))
 
 (defun org-bibtex-store-link ()
   "Store a link to a BibTeX entry."
@@ -556,7 +556,8 @@ With optional argument OPTIONAL, also prompt for optional 
fields."
     ;; We construct a regexp that searches for "@entrytype{" followed by the 
key
     (goto-char (point-min))
     (and (re-search-forward (concat "@[a-zA-Z]+[ \t\n]*{[ \t\n]*"
-                                   (regexp-quote s) "[ \t\n]*,") nil t)
+                                   (regexp-quote s) "[ \t\n]*,")
+                           nil t)
         (goto-char (match-beginning 0)))
     (if (and (match-beginning 0) (equal current-prefix-arg '(16)))
        ;; Use double prefix to indicate that any web link should be browsed
@@ -596,7 +597,8 @@ Headlines are exported using `org-bibtex-headline'."
              (with-temp-file filename
                (insert (mapconcat #'identity bibtex-entries "\n")))
              (message "Successfully exported %d BibTeX entries to %s"
-                      (length bibtex-entries) filename) nil))))
+                      (length bibtex-entries) filename)
+            nil))))
     (when error-point
       (goto-char error-point)
       (message "Bibtex error at %S" (nth 4 (org-heading-components))))))
@@ -661,7 +663,8 @@ This uses `bibtex-parse-entry'."
             (when (and (> (length str) 1)
                        (= (aref str 0) (car pair))
                        (= (aref str (1- (length str))) (cdr pair)))
-              (setf str (substring str 1 (1- (length str)))))) str)))
+              (setf str (substring str 1 (1- (length str))))))
+          str)))
     (push (mapcar
            (lambda (pair)
              (cons (let ((field (funcall keyword (car pair))))
diff --git a/lisp/org/ol-docview.el b/lisp/org/ol-docview.el
index 22b6302..7ab67de 100644
--- a/lisp/org/ol-docview.el
+++ b/lisp/org/ol-docview.el
@@ -1,6 +1,6 @@
 ;;; ol-docview.el --- Links to Docview mode buffers  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Jan Böcker <jan.boecker at jboecker dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -68,7 +68,7 @@
        ((eq format 'ascii) (format "%s (%s)" desc path))
        (t path)))))
 
-(defun org-docview-open (link)
+(defun org-docview-open (link _)
   (string-match "\\(.*?\\)\\(?:::\\([0-9]+\\)\\)?$" link)
   (let ((path (match-string 1 link))
        (page (and (match-beginning 2)
@@ -98,7 +98,6 @@ and append it."
          "::"
          (read-from-minibuffer "Page:" "1")))
 
-
 (provide 'ol-docview)
 
 ;;; ol-docview.el ends here
diff --git a/lisp/org/ol-eshell.el b/lisp/org/ol-eshell.el
index 7e742f8..769e7ee 100644
--- a/lisp/org/ol-eshell.el
+++ b/lisp/org/ol-eshell.el
@@ -1,6 +1,6 @@
 ;;; ol-eshell.el - Links to Working Directories in Eshell -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Konrad Hinsen <konrad.hinsen AT fastmail.net>
 
@@ -33,7 +33,7 @@
                         :follow #'org-eshell-open
                         :store #'org-eshell-store-link)
 
-(defun org-eshell-open (link)
+(defun org-eshell-open (link _)
   "Switch to an eshell buffer and execute a command line.
    The link can be just a command line (executed in the default
    eshell buffer) or a command line prefixed by a buffer name
diff --git a/lisp/org/ol-eww.el b/lisp/org/ol-eww.el
index f32c06b..e9ffee6 100644
--- a/lisp/org/ol-eww.el
+++ b/lisp/org/ol-eww.el
@@ -1,6 +1,6 @@
 ;;; ol-eww.el --- Store URL and kill from Eww mode    -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Marco Wahl <marcowahlsoft>a<gmailcom>
 ;; Keywords: link, eww
@@ -46,17 +46,22 @@
 ;;; Code:
 (require 'ol)
 (require 'cl-lib)
+(require 'eww)
 
+;; For Emacsen < 25.
 (defvar eww-current-title)
 (defvar eww-current-url)
-(defvar eww-data)
-(defvar eww-mode-map)
-
-(declare-function eww-current-url "eww")
 
 
 ;; Store Org link in Eww mode buffer
-(org-link-set-parameters "eww" :follow #'eww :store #'org-eww-store-link)
+(org-link-set-parameters "eww"
+                        :follow #'org-eww-open
+                        :store #'org-eww-store-link)
+
+(defun org-eww-open (url _)
+  "Open URL with Eww in the current buffer."
+  (eww url))
+
 (defun org-eww-store-link ()
   "Store a link to the url of an EWW buffer."
   (when (eq major-mode 'eww-mode)
diff --git a/lisp/org/ol-gnus.el b/lisp/org/ol-gnus.el
index 71d55cd..71051bc 100644
--- a/lisp/org/ol-gnus.el
+++ b/lisp/org/ol-gnus.el
@@ -1,6 +1,6 @@
 ;;; ol-gnus.el --- Links to Gnus Groups and Messages -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;         Tassilo Horn <tassilo at member dot fsf dot org>
@@ -34,7 +34,8 @@
 (require 'gnus-sum)
 (require 'gnus-util)
 (require 'nnheader)
-(require 'nnselect)
+(or (require 'nnselect nil t)           ; Emacs >= 28
+    (require 'nnir nil t))              ; Emacs < 28
 (require 'ol)
 
 
@@ -61,7 +62,7 @@
 ;;; Customization variables
 
 (defcustom org-gnus-prefer-web-links nil
-  "If non-nil, `org-store-link' creates web links to Google groups or Gmane.
+  "If non-nil, `org-store-link' creates web links to Google groups.
 \\<org-mode-map>When nil, Gnus will be used for such links.
 Using a prefix argument to the command `\\[org-store-link]' (`org-store-link')
 negates this setting for the duration of the command."
@@ -87,8 +88,8 @@ negates this setting for the duration of the command."
 (defun org-gnus-group-link (group)
   "Create a link to the Gnus group GROUP.
 If GROUP is a newsgroup and `org-gnus-prefer-web-links' is
-non-nil, create a link to groups.google.com or gmane.org.
-Otherwise create a link to the group inside Gnus.
+non-nil, create a link to groups.google.com.  Otherwise create a
+link to the group inside Gnus.
 
 If `org-store-link' was called with a prefix arg the meaning of
 `org-gnus-prefer-web-links' is reversed."
@@ -96,10 +97,7 @@ If `org-store-link' was called with a prefix arg the meaning 
of
     (if (and (string-prefix-p "nntp" group) ;; Only for nntp groups
             (org-xor current-prefix-arg
                      org-gnus-prefer-web-links))
-       (concat (if (string-match "gmane" unprefixed-group)
-                   "http://news.gmane.org/";
-                 "http://groups.google.com/group/";)
-               unprefixed-group)
+       (concat "https://groups.google.com/group/"; unprefixed-group)
       (concat "gnus:" group))))
 
 (defun org-gnus-article-link (group newsgroups message-id x-no-archive)
@@ -110,7 +108,7 @@ parameters are the Gnus GROUP, the NEWSGROUPS the article 
was
 posted to and the X-NO-ARCHIVE header value of that article.
 
 If GROUP is a newsgroup and `org-gnus-prefer-web-links' is
-non-nil, create a link to groups.google.com or gmane.org.
+non-nil, create a link to groups.google.com.
 Otherwise create a link to the article inside Gnus.
 
 If `org-store-link' was called with a prefix arg the meaning of
@@ -118,9 +116,7 @@ If `org-store-link' was called with a prefix arg the 
meaning of
   (if (and (org-xor current-prefix-arg org-gnus-prefer-web-links)
           newsgroups             ;make web links only for nntp groups
           (not x-no-archive))    ;and if X-No-Archive isn't set
-      (format (if (string-match-p "gmane\\." newsgroups)
-                 "http://mid.gmane.org/%s";
-               "http://groups.google.com/groups/search?as_umsgid=%s";)
+      (format "https://groups.google.com/groups/search?as_umsgid=%s";
              (url-encode-url message-id))
     (concat "gnus:" group "#" message-id)))
 
@@ -140,9 +136,15 @@ If `org-store-link' was called with a prefix arg the 
meaning of
               (`(nnvirtual . ,_)
                (save-excursion
                  (car (nnvirtual-map-article (gnus-summary-article-number)))))
-              (`(nnselect . ,_)
+              (`(,(or `nnselect `nnir) . ,_)  ; nnir is for Emacs < 28.
                (save-excursion
-                 (nnselect-article-group (gnus-summary-article-number))))
+                 (cond
+                  ((fboundp 'nnselect-article-group)
+                   (nnselect-article-group (gnus-summary-article-number)))
+                  ((fboundp 'nnir-article-group)
+                   (nnir-article-group (gnus-summary-article-number)))
+                  (t
+                   (error "No article-group variant bound")))))
               (_ gnus-newsgroup-name)))
            (header (if (eq major-mode 'gnus-article-mode)
                        ;; When in an article, first move to summary
@@ -215,7 +217,7 @@ If `org-store-link' was called with a prefix arg the 
meaning of
      (format "nntp+%s:%s" (or (cdr server) (car server)) group)
      article)))
 
-(defun org-gnus-open (path)
+(defun org-gnus-open (path _)
   "Follow the Gnus message or folder link specified by PATH."
   (unless (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path)
     (error "Error in Gnus link %S" path))
diff --git a/lisp/org/ol-info.el b/lisp/org/ol-info.el
index 58d45a7..8b1e5da 100644
--- a/lisp/org/ol-info.el
+++ b/lisp/org/ol-info.el
@@ -1,6 +1,6 @@
 ;;; ol-info.el --- Links to Info Nodes               -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -59,7 +59,7 @@
                            :link link :desc desc)
       link)))
 
-(defun org-info-open (path)
+(defun org-info-open (path _)
   "Follow an Info file and node link specified by PATH."
   (org-info-follow-link path))
 
diff --git a/lisp/org/ol-irc.el b/lisp/org/ol-irc.el
index 3a34779..e3d7651 100644
--- a/lisp/org/ol-irc.el
+++ b/lisp/org/ol-irc.el
@@ -1,6 +1,6 @@
 ;;; ol-irc.el --- Links to IRC Sessions              -*- lexical-binding: t; 
-*-
 ;;
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Philip Jackson <emacs@shellarchive.co.uk>
 ;; Keywords: erc, irc, link, org
@@ -78,7 +78,7 @@
                         :store #'org-irc-store-link
                         :export #'org-irc-export)
 
-(defun org-irc-visit (link)
+(defun org-irc-visit (link _)
   "Parse LINK and dispatch to the correct function based on the client found."
   (let ((link (org-irc-parse-link link)))
     (cond
diff --git a/lisp/org/ol-mhe.el b/lisp/org/ol-mhe.el
index 099882d..37147a3 100644
--- a/lisp/org/ol-mhe.el
+++ b/lisp/org/ol-mhe.el
@@ -1,6 +1,6 @@
 ;;; ol-mhe.el --- Links to MH-E Messages             -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -96,7 +96,7 @@ supported by MH-E."
        (org-link-add-props :link link :description desc)
        link))))
 
-(defun org-mhe-open (path)
+(defun org-mhe-open (path _)
   "Follow an MH-E message link specified by PATH."
   (let (folder article)
     (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
diff --git a/lisp/org/ol-rmail.el b/lisp/org/ol-rmail.el
index cad8eaa..a73060b 100644
--- a/lisp/org/ol-rmail.el
+++ b/lisp/org/ol-rmail.el
@@ -1,6 +1,6 @@
 ;;; ol-rmail.el --- Links to Rmail Messages          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -43,7 +43,9 @@
 (defvar rmail-file-name)        ; From rmail.el
 
 ;; Install the link type
-(org-link-set-parameters "rmail" :follow #'org-rmail-open :store 
#'org-rmail-store-link)
+(org-link-set-parameters "rmail"
+                        :follow #'org-rmail-open
+                        :store #'org-rmail-store-link)
 
 ;; Implementation
 (defun org-rmail-store-link ()
@@ -75,7 +77,7 @@
          (rmail-show-message rmail-current-message)
          link)))))
 
-(defun org-rmail-open (path)
+(defun org-rmail-open (path _)
   "Follow an Rmail message link to the specified PATH."
   (let (folder article)
     (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
diff --git a/lisp/org/ol-w3m.el b/lisp/org/ol-w3m.el
index 5b03b8d..f1f3afd 100644
--- a/lisp/org/ol-w3m.el
+++ b/lisp/org/ol-w3m.el
@@ -1,6 +1,6 @@
 ;;; ol-w3m.el --- Copy and Paste From W3M            -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org/ol.el b/lisp/org/ol.el
index c9e4da5..d1db168 100644
--- a/lisp/org/ol.el
+++ b/lisp/org/ol.el
@@ -1,6 +1,6 @@
 ;;; ol.el --- Org links library                      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -45,6 +45,7 @@
 (declare-function dired-get-filename "dired" (&optional localp 
no-error-if-not-filep))
 (declare-function org-at-heading-p "org" (&optional _))
 (declare-function org-back-to-heading "org" (&optional invisible-ok))
+(declare-function org-before-first-heading-p "org" ())
 (declare-function org-do-occur "org" (regexp &optional cleanup))
 (declare-function org-element-at-point "org-element" ())
 (declare-function org-element-cache-refresh "org-element" (pos))
@@ -57,16 +58,17 @@
 (declare-function org-entry-get "org" (pom property &optional inherit 
literal-nil))
 (declare-function org-find-property "org" (property &optional value))
 (declare-function org-get-heading "org" (&optional no-tags no-todo no-priority 
no-comment))
-(declare-function org-heading-components "org" ())
 (declare-function org-id-find-id-file "org-id" (id))
 (declare-function org-id-store-link "org-id" ())
 (declare-function org-insert-heading "org" (&optional arg invisible-ok top))
 (declare-function org-load-modules-maybe "org" (&optional force))
 (declare-function org-mark-ring-push "org" (&optional pos buffer))
+(declare-function org-mode "org" ())
 (declare-function org-occur "org" (regexp &optional keep-previous callback))
 (declare-function org-open-file "org" (path &optional in-emacs line search))
 (declare-function org-overview "org" ())
 (declare-function org-restart-font-lock "org" ())
+(declare-function org-run-like-in-org-mode "org" (cmd))
 (declare-function org-show-context "org" (&optional key))
 (declare-function org-src-coderef-format "org-src" (&optional element))
 (declare-function org-src-coderef-regexp "org-src" (fmt &optional label))
@@ -85,42 +87,94 @@
   :group 'org)
 
 (defcustom org-link-parameters nil
-  "An alist of properties that defines all the links in Org mode.
+  "Alist of properties that defines all the links in Org mode.
+
 The key in each association is a string of the link type.
-Subsequent optional elements make up a plist of link properties.
+Subsequent optional elements make up a property list for that
+type.
+
+All properties are optional.  However, the most important ones
+are, in this order, `:follow', `:export', and `:store', described
+below.
+
+`:follow'
+
+  Function used to follow the link, when the `org-open-at-point'
+  command runs on it.  It is called with two arguments: the path,
+  as a string, and a universal prefix argument.
+
+  Here, you may use `org-link-open-as-file' helper function for
+  types similar to \"file\".
+
+`:export'
+
+  Function that accepts four arguments:
+  - the path, as a string,
+  - the description as a string, or nil,
+  - the export back-end,
+  - the export communication channel, as a plist.
+
+  When nil, export for that type of link is delegated to the
+  back-end.
+
+`:store'
+
+  Function responsible for storing the link.  See the function
+  `org-store-link-functions' for a description of the expected
+  arguments.
+
+Additional properties provide more specific control over the
+link.
+
+`:activate-func'
+
+  Function to run at the end of Font Lock activation.  It must
+  accept four arguments:
+  - the buffer position at the start of the link,
+  - the buffer position at its end,
+  - the path, as a string,
+  - a boolean, non-nil when the link has brackets.
 
-:follow - A function that takes the link path as an argument.
+`:complete'
 
-:export - A function that takes the link path, description and
-export-backend as arguments.
+  Function that inserts a link with completion.  The function
+  takes one optional prefix argument.
 
-:store - A function responsible for storing the link.  See the
-function `org-store-link-functions'.
+`:display'
 
-:complete - A function that inserts a link with completion.  The
-function takes one optional prefix argument.
+  Value for `invisible' text property on the hidden parts of the
+  link.  The most useful value is `full', which will not fold the
+  link in descriptive display.  Default is `org-link'.
 
-:face - A face for the link, or a function that returns a face.
-The function takes one argument which is the link path.  The
-default face is `org-link'.
+`:face'
 
-:mouse-face - The mouse-face. The default is `highlight'.
+  Face for the link, or a function returning a face.  The
+  function takes one argument, which is the path.
 
-:display - `full' will not fold the link in descriptive
-display.  Default is `org-link'.
+  The default face is `org-link'.
 
-:help-echo - A string or function that takes (window object position)
-as arguments and returns a string.
+`:help-echo'
 
-:keymap - A keymap that is active on the link.  The default is
-`org-mouse-map'.
+  String or function used as a value for the `help-echo' text
+  property.  The function is called with one argument, the help
+  string to display, and should return a string.
 
-:htmlize-link - A function for the htmlize-link.  Defaults
-to (list :uri \"type:path\")
+`:htmlize-link'
 
-:activate-func - A function to run at the end of font-lock
-activation.  The function must accept (link-start link-end path bracketp)
-as arguments."
+  Function or plist for the `htmlize-link' text property.  The
+  function takes no argument.
+
+  Default is (:uri \"type:path\")
+
+`:keymap'
+
+  Active keymap when point is on the link.  Default is
+  `org-mouse-map'.
+
+`:mouse-face'
+
+  Face used when hovering over the link.  Default is
+  `highlight'."
   :group 'org-link
   :package-version '(Org . "9.1")
   :type '(alist :tag "Link display parameters"
@@ -408,7 +462,7 @@ This is for example useful to limit the length of the 
subject.
 
 Examples: \"%f on: %.30s\", \"Email from %f\", \"Email %c\""
   :group 'org-link-store
-  :package-version '(Org . 9.3)
+  :package-version '(Org . "9.3")
   :type 'string
   :safe #'stringp)
 
@@ -674,6 +728,44 @@ White spaces are not significant."
       (goto-char origin)
       (user-error "No match for radio target: %s" target))))
 
+(defun org-link--context-from-region ()
+  "Return context string from active region, or nil."
+  (when (org-region-active-p)
+    (let ((context (buffer-substring (region-beginning) (region-end))))
+      (when (and (wholenump org-link-context-for-files)
+                (> org-link-context-for-files 0))
+       (let ((lines (org-split-string context "\n")))
+         (setq context
+               (mapconcat #'identity
+                          (cl-subseq lines 0 org-link-context-for-files)
+                          "\n"))))
+      context)))
+
+(defun org-link--normalize-string (string &optional context)
+  "Remove ignored contents from STRING string and return it.
+This function removes contiguous white spaces and statistics
+cookies.  When optional argument CONTEXT is non-nil, it assumes
+STRING is a context string, and also removes special search
+syntax around the string."
+  (let ((string
+        (org-trim
+         (replace-regexp-in-string
+          (rx (one-or-more (any " \t")))
+          " "
+          (replace-regexp-in-string
+           ;; Statistics cookie regexp.
+           (rx (seq "[" (0+ digit) (or "%" (seq "/" (0+ digit))) "]"))
+           " "
+           string)))))
+    (when context
+      (while (cond ((and (string-prefix-p "(" string)
+                        (string-suffix-p ")" string))
+                   (setq string (org-trim (substring string 1 -1))))
+                  ((string-match "\\`[#*]+[ \t]*" string)
+                   (setq string (substring string (match-end 0))))
+                  (t nil))))
+    string))
+
 
 ;;; Public API
 
@@ -692,6 +784,8 @@ TYPE is a string and KEY is a plist keyword.  See
   "Set link TYPE properties to PARAMETERS.
 PARAMETERS should be keyword value pairs.  See
 `org-link-parameters' for supported keys."
+  (when (member type '("coderef" "custom-id" "fuzzy" "radio"))
+    (error "Cannot override reserved link type: %S" type))
   (let ((data (assoc type org-link-parameters)))
     (if data (setcdr data (org-combine-plists (cdr data) parameters))
       (push (cons type parameters) org-link-parameters)
@@ -716,12 +810,10 @@ This should be called after the variable 
`org-link-parameters' has changed."
          (rx (seq "[["
                   ;; URI part: match group 1.
                   (group
-                   ;; Allow an even number of backslashes right
-                   ;; before the closing bracket.
-                   (or (one-or-more "\\\\")
-                       (and (*? anything)
-                            (not (any "\\"))
-                            (zero-or-more "\\\\"))))
+                   (one-or-more
+                     (or (not (any "[]\\"))
+                        (and "\\" (zero-or-more "\\\\") (any "[]"))
+                        (and (one-or-more "\\") (not (any "[]"))))))
                   "]"
                   ;; Description (optional): match group 2.
                   (opt "[" (group (+? anything)) "]")
@@ -838,37 +930,26 @@ E.g. \"%C3%B6\" becomes the german o-Umlaut."
 
 (defun org-link-escape (link)
   "Backslash-escape sensitive characters in string LINK."
-  ;; Escape closing square brackets followed by another square bracket
-  ;; or at the end of the link.  Also escape final backslashes so that
-  ;; we do not escape inadvertently URI's closing bracket.
-  (with-temp-buffer
-    (insert link)
-    (insert (make-string (- (skip-chars-backward "\\\\"))
-                        ?\\))
-    (while (search-backward "]" nil t)
-      (when (looking-at-p "]\\(?:[][]\\|\\'\\)")
-       (insert (make-string (1+ (- (skip-chars-backward "\\\\")))
-                            ?\\))))
-    (buffer-string)))
+  (replace-regexp-in-string
+   (rx (seq (group (zero-or-more "\\")) (group (or string-end (any "[]")))))
+   (lambda (m)
+     (concat (match-string 1 m)
+            (match-string 1 m)
+            (and (/= (match-beginning 2) (match-end 2)) "\\")))
+   link nil t 1))
 
 (defun org-link-unescape (link)
   "Remove escaping backslash characters from string LINK."
-  (with-temp-buffer
-    (save-excursion (insert link))
-    (while (re-search-forward "\\(\\\\+\\)\\]\\(?:[][]\\|\\'\\)" nil t)
-      (replace-match (make-string (/ (- (match-end 1) (match-beginning 1)) 2)
-                                 ?\\)
-                    nil t nil 1))
-    (goto-char (point-max))
-    (delete-char (/ (- (skip-chars-backward "\\\\")) 2))
-    (buffer-string)))
+  (replace-regexp-in-string
+   (rx (group (one-or-more "\\")) (or string-end (any "[]")))
+   (lambda (_)
+     (concat (make-string (/ (- (match-end 1) (match-beginning 1)) 2) ?\\)))
+   link nil t 1))
 
 (defun org-link-make-string (link &optional description)
   "Make a bracket link, consisting of LINK and DESCRIPTION.
 LINK is escaped with backslashes for inclusion in buffer."
-  (unless (org-string-nw-p link) (error "Empty link"))
-  (let* ((uri (org-link-escape link))
-        (zero-width-space (string ?\x200B))
+  (let* ((zero-width-space (string ?\x200B))
         (description
          (and (org-string-nw-p description)
               ;; Description cannot contain two consecutive square
@@ -881,9 +962,10 @@ LINK is escaped with backslashes for inclusion in buffer."
                (replace-regexp-in-string "]\\'"
                                          (concat "\\&" zero-width-space)
                                          (org-trim description))))))
-    (format "[[%s]%s]"
-           uri
-           (if description (format "[%s]" description) ""))))
+    (if (not (org-string-nw-p link)) description
+      (format "[[%s]%s]"
+             (org-link-escape link)
+             (if description (format "[%s]" description) "")))))
 
 (defun org-store-link-functions ()
   "List of functions that are called to create and store a link.
@@ -930,7 +1012,8 @@ Abbreviations are defined in `org-link-abbrev-alist'."
         ((string-match "%(\\([^)]+\\))" rpl)
          (replace-match
           (save-match-data
-            (funcall (intern-soft (match-string 1 rpl)) tag)) t t rpl))
+            (funcall (intern-soft (match-string 1 rpl)) tag))
+          t t rpl))
         ((string-match "%s" rpl) (replace-match (or tag "") t t rpl))
         ((string-match "%h" rpl)
          (replace-match (url-hexify-string (or tag "")) t t rpl))
@@ -938,63 +1021,60 @@ Abbreviations are defined in `org-link-abbrev-alist'."
 
 (defun org-link-open (link &optional arg)
   "Open a link object LINK.
-Optional argument is passed to `org-open-file' when S is
-a \"file\" link."
+
+ARG is an optional prefix argument.  Some link types may handle
+it.  For example, it determines what application to run when
+opening a \"file\" link.
+
+Functions responsible for opening the link are either hard-coded
+for internal and \"file\" links, or stored as a parameter in
+`org-link-parameters', which see."
   (let ((type (org-element-property :type link))
        (path (org-element-property :path link)))
-    (cond
-     ((equal type "file")
-      (if (string-match "[*?{]" (file-name-nondirectory path))
-         (dired path)
-       ;; Look into `org-link-parameters' in order to find
-       ;; a DEDICATED-FUNCTION to open file.  The function will be
-       ;; applied on raw link instead of parsed link due to the
-       ;; limitation in `org-add-link-type' ("open" function called
-       ;; with a single argument).  If no such function is found,
-       ;; fallback to `org-open-file'.
-       (let* ((option (org-element-property :search-option link))
-              (app (org-element-property :application link))
-              (dedicated-function
-               (org-link-get-parameter (if app (concat type "+" app) type)
-                                       :follow)))
-         (if dedicated-function
-             (funcall dedicated-function
-                      (concat path
-                              (and option (concat "::" option))))
-           (apply #'org-open-file
-                  path
-                  (cond (arg)
-                        ((equal app "emacs") 'emacs)
-                        ((equal app "sys") 'system))
-                  (cond ((not option) nil)
-                        ((string-match-p "\\`[0-9]+\\'" option)
-                         (list (string-to-number option)))
-                        (t (list nil option))))))))
-     ((functionp (org-link-get-parameter type :follow))
-      (funcall (org-link-get-parameter type :follow) path))
-     ((member type '("coderef" "custom-id" "fuzzy" "radio"))
-      (unless (run-hook-with-args-until-success 'org-open-link-functions path)
-       (if (not arg) (org-mark-ring-push)
-         (switch-to-buffer-other-window (org-link--buffer-for-internals)))
-       (let ((destination
-              (org-with-wide-buffer
-               (if (equal type "radio")
-                   (org-link--search-radio-target
-                    (org-element-property :path link))
-                 (org-link-search
-                  (pcase type
-                    ("custom-id" (concat "#" path))
-                    ("coderef" (format "(%s)" path))
-                    (_ path))
-                  ;; Prevent fuzzy links from matching themselves.
-                  (and (equal type "fuzzy")
-                       (+ 2 (org-element-property :begin link)))))
-               (point))))
-         (unless (and (<= (point-min) destination)
-                      (>= (point-max) destination))
-           (widen))
-         (goto-char destination))))
-     (t (browse-url-at-point)))))
+    (pcase type
+      ;; Opening a "file" link requires special treatment since we
+      ;; first need to integrate search option, if any.
+      ("file"
+       (let* ((option (org-element-property :search-option link))
+             (path (if option (concat path "::" option) path)))
+        (org-link-open-as-file path
+                               (pcase (org-element-property :application link)
+                                 ((guard arg) arg)
+                                 ("emacs" 'emacs)
+                                 ("sys" 'system)))))
+      ;; Internal links.
+      ((or "coderef" "custom-id" "fuzzy" "radio")
+       (unless (run-hook-with-args-until-success 'org-open-link-functions path)
+        (if (not arg) (org-mark-ring-push)
+          (switch-to-buffer-other-window (org-link--buffer-for-internals)))
+        (let ((destination
+               (org-with-wide-buffer
+                (if (equal type "radio")
+                    (org-link--search-radio-target path)
+                  (org-link-search
+                   (pcase type
+                     ("custom-id" (concat "#" path))
+                     ("coderef" (format "(%s)" path))
+                     (_ path))
+                   ;; Prevent fuzzy links from matching themselves.
+                   (and (equal type "fuzzy")
+                        (+ 2 (org-element-property :begin link)))))
+                (point))))
+          (unless (and (<= (point-min) destination)
+                       (>= (point-max) destination))
+            (widen))
+          (goto-char destination))))
+      (_
+       ;; Look for a dedicated "follow" function in custom links.
+       (let ((f (org-link-get-parameter type :follow)))
+        (when (functionp f)
+          ;; Function defined in `:follow' parameter may use a single
+          ;; argument, as it was mandatory before Org 9.4.  This is
+          ;; deprecated, but support it for now.
+          (condition-case nil
+              (funcall (org-link-get-parameter type :follow) path arg)
+            (wrong-number-of-arguments
+             (funcall (org-link-get-parameter type :follow) path)))))))))
 
 (defun org-link-open-from-string (s &optional arg)
   "Open a link in the string S, as if it was in Org mode.
@@ -1095,10 +1175,9 @@ of matched result, which is either `dedicated' or 
`fuzzy'."
             (catch :name-match
               (goto-char (point-min))
               (while (re-search-forward name nil t)
-                (let ((element (org-element-at-point)))
-                  (when (equal words
-                               (split-string
-                                (org-element-property :name element)))
+                (let* ((element (org-element-at-point))
+                       (name (org-element-property :name element)))
+                  (when (and name (equal words (split-string name)))
                     (setq type 'dedicated)
                     (beginning-of-line)
                     (throw :name-match t))))
@@ -1111,18 +1190,14 @@ of matched result, which is either `dedicated' or 
`fuzzy'."
                  (format "%s.*\\(?:%s[ \t]\\)?.*%s"
                          org-outline-regexp-bol
                          org-comment-string
-                         (mapconcat #'regexp-quote words ".+")))
-                (cookie-re "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]")
-                (comment-re (format "\\`%s[ \t]+" org-comment-string)))
+                         (mapconcat #'regexp-quote words ".+"))))
             (goto-char (point-min))
             (catch :found
               (while (re-search-forward title-re nil t)
                 (when (equal words
                              (split-string
-                              (replace-regexp-in-string
-                               cookie-re ""
-                               (replace-regexp-in-string
-                                comment-re "" (org-get-heading t t t)))))
+                              (org-link--normalize-string
+                               (org-get-heading t t t t))))
                   (throw :found t)))
               nil)))
       (beginning-of-line)
@@ -1173,24 +1248,40 @@ of matched result, which is either `dedicated' or 
`fuzzy'."
     type))
 
 (defun org-link-heading-search-string (&optional string)
-  "Make search string for the current headline or STRING."
-  (let ((s (or string
-              (and (derived-mode-p 'org-mode)
-                   (save-excursion
-                     (org-back-to-heading t)
-                     (org-element-property :raw-value
-                                           (org-element-at-point))))))
-       (lines org-link-context-for-files))
-    (unless string (setq s (concat "*" s))) ;Add * for headlines
-    (setq s (replace-regexp-in-string "\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" "" 
s))
-    (when (and string (integerp lines) (> lines 0))
-      (let ((slines (org-split-string s "\n")))
-       (when (< lines (length slines))
-         (setq s (mapconcat
-                  #'identity
-                  (reverse (nthcdr (- (length slines) lines)
-                                   (reverse slines))) "\n")))))
-    (mapconcat #'identity (split-string s) " ")))
+  "Make search string for the current headline or STRING.
+
+Search string starts with an asterisk.  COMMENT keyword and
+statistics cookies are removed, and contiguous spaces are packed
+into a single one.
+
+When optional argument STRING is non-nil, assume it a headline,
+without any asterisk, TODO or COMMENT keyword, and without any
+priority cookie or tag."
+  (concat "*"
+         (org-link--normalize-string
+          (or string (org-get-heading t t t t)))))
+
+(defun org-link-open-as-file (path arg)
+  "Pretend PATH is a file name and open it.
+
+According to \"file\"-link syntax, PATH may include additional
+search options, separated from the file name with \"::\".
+
+This function is meant to be used as a possible tool for
+`:follow' property in `org-link-parameters'."
+  (let* ((option (and (string-match "::\\(.*\\)\\'" path)
+                     (match-string 1 path)))
+        (file-name (if (not option) path
+                     (substring path 0 (match-beginning 0)))))
+    (if (string-match "[*?{]" (file-name-nondirectory file-name))
+       (dired file-name)
+      (apply #'org-open-file
+            file-name
+            arg
+            (cond ((not option) nil)
+                  ((string-match-p "\\`[0-9]+\\'" option)
+                   (list (string-to-number option)))
+                  (t (list nil option)))))))
 
 (defun org-link-display-format (s)
   "Replace links in string S with their description.
@@ -1211,15 +1302,15 @@ If there is no description, use the link target."
 ;;; Built-in link types
 
 ;;;; "doi" link type
-(defun org-link--open-doi (path)
+(defun org-link--open-doi (path arg)
   "Open a \"doi\" type link.
 PATH is a the path to search for, as a string."
-  (browse-url (url-encode-url (concat org-link-doi-server-url path))))
+  (browse-url (url-encode-url (concat org-link-doi-server-url path)) arg))
 
 (org-link-set-parameters "doi" :follow #'org-link--open-doi)
 
 ;;;; "elisp" link type
-(defun org-link--open-elisp (path)
+(defun org-link--open-elisp (path _)
   "Open a \"elisp\" type link.
 PATH is the sexp to evaluate, as a string."
   (if (or (and (org-string-nw-p org-link-elisp-skip-confirm-regexp)
@@ -1240,7 +1331,7 @@ PATH is the sexp to evaluate, as a string."
 (org-link-set-parameters "file" :complete #'org-link-complete-file)
 
 ;;;; "help" link type
-(defun org-link--open-help (path)
+(defun org-link--open-help (path _)
   "Open a \"help\" type link.
 PATH is a symbol name, as a string."
   (pcase (intern path)
@@ -1254,10 +1345,11 @@ PATH is a symbol name, as a string."
 (dolist (scheme '("ftp" "http" "https" "mailto" "news"))
   (org-link-set-parameters scheme
                           :follow
-                          (lambda (url) (browse-url (concat scheme ":" url)))))
+                          (lambda (url arg)
+                            (browse-url (concat scheme ":" url) arg))))
 
 ;;;; "shell" link type
-(defun org-link--open-shell (path)
+(defun org-link--open-shell (path _)
   "Open a \"shell\" type link.
 PATH is the command to execute, as a string."
   (if (or (and (org-string-nw-p org-link-shell-skip-confirm-regexp)
@@ -1375,7 +1467,7 @@ non-nil."
            (move-beginning-of-line 2)
            (set-mark (point)))))
     (setq org-store-link-plist nil)
-    (let (link cpltxt desc description search txt custom-id agenda-link)
+    (let (link cpltxt desc description search custom-id agenda-link)
       (cond
        ;; Store a link using an external link type, if any function is
        ;; available. If more than one can generate a link from current
@@ -1465,10 +1557,16 @@ non-nil."
          (org-link-store-props :type "calendar" :date cd)))
 
        ((eq major-mode 'help-mode)
-       (setq link (concat "help:" (save-excursion
-                                    (goto-char (point-min))
-                                    (looking-at "^[^ ]+")
-                                    (match-string 0))))
+       (let ((symbol (replace-regexp-in-string
+                      ;; Help mode escapes backquotes and backslashes
+                      ;; before displaying them.  E.g., "`" appears
+                      ;; as "\'" for reasons.  Work around this.
+                      (rx "\\" (group (or "`" "\\"))) "\\1"
+                      (save-excursion
+                        (goto-char (point-min))
+                        (looking-at "^[^ ]+")
+                        (match-string 0)))))
+         (setq link (concat "help:" symbol)))
        (org-link-store-props :type "help"))
 
        ((eq major-mode 'w3-mode)
@@ -1534,30 +1632,35 @@ non-nil."
                                 (abbreviate-file-name
                                  (buffer-file-name (buffer-base-buffer))))))))
          (t
-          ;; Just link to current headline
+          ;; Just link to current headline.
           (setq cpltxt (concat "file:"
                                (abbreviate-file-name
                                 (buffer-file-name (buffer-base-buffer)))))
-          ;; Add a context search string
+          ;; Add a context search string.
           (when (org-xor org-link-context-for-files (equal arg '(4)))
             (let* ((element (org-element-at-point))
-                   (name (org-element-property :name element)))
-              (setq txt (cond
-                         ((org-at-heading-p) nil)
-                         (name)
-                         ((org-region-active-p)
-                          (buffer-substring (region-beginning) (region-end)))))
-              (when (or (null txt) (string-match "\\S-" txt))
-                (setq cpltxt
-                      (concat cpltxt "::"
-                              (condition-case nil
-                                  (org-link-heading-search-string txt)
-                                (error "")))
-                      desc (or name
-                               (nth 4 (ignore-errors (org-heading-components)))
-                               "NONE")))))
-          (when (string-match "::\\'" cpltxt)
-            (setq cpltxt (substring cpltxt 0 -2)))
+                   (name (org-element-property :name element))
+                   (context
+                    (cond
+                     ((let ((region (org-link--context-from-region)))
+                        (and region (org-link--normalize-string region t))))
+                     (name)
+                     ((org-before-first-heading-p)
+                      (org-link--normalize-string (org-current-line-string) t))
+                     (t (org-link-heading-search-string)))))
+              (when (org-string-nw-p context)
+                (setq cpltxt (format "%s::%s" cpltxt context))
+                (setq desc
+                      (or name
+                          ;; Although description is not a search
+                          ;; string, use `org-link--normalize-string'
+                          ;; to prettify it (contiguous white spaces)
+                          ;; and remove volatile contents (statistics
+                          ;; cookies).
+                          (and (not (org-before-first-heading-p))
+                               (org-link--normalize-string
+                                (org-get-heading t t t t)))
+                          "NONE")))))
           (setq link cpltxt)))))
 
        ((buffer-file-name (buffer-base-buffer))
@@ -1565,16 +1668,16 @@ non-nil."
        (setq cpltxt (concat "file:"
                             (abbreviate-file-name
                              (buffer-file-name (buffer-base-buffer)))))
-       ;; Add a context string.
+       ;; Add a context search string.
        (when (org-xor org-link-context-for-files (equal arg '(4)))
-         (setq txt (if (org-region-active-p)
-                       (buffer-substring (region-beginning) (region-end))
-                     (buffer-substring (point-at-bol) (point-at-eol))))
-         ;; Only use search option if there is some text.
-         (when (string-match "\\S-" txt)
-           (setq cpltxt
-                 (concat cpltxt "::" (org-link-heading-search-string txt))
-                 desc "NONE")))
+         (let ((context (org-link--normalize-string
+                         (or (org-link--context-from-region)
+                             (org-current-line-string))
+                         t)))
+           ;; Only use search option if there is some text.
+           (when (org-string-nw-p context)
+             (setq cpltxt (format "%s::%s" cpltxt context))
+             (setq desc "NONE"))))
        (setq link cpltxt))
 
        (interactive?
@@ -1589,15 +1692,19 @@ non-nil."
       (cond ((not desc))
            ((equal desc "NONE") (setq desc nil))
            (t (setq desc (org-link-display-format desc))))
-      ;; Return the link
+      ;; Store and return the link
       (if (not (and interactive? link))
          (or agenda-link (and link (org-link-make-string link desc)))
-       (push (list link desc) org-stored-links)
-       (message "Stored: %s" (or desc link))
-       (when custom-id
-         (setq link (concat "file:" (abbreviate-file-name
-                                     (buffer-file-name)) "::#" custom-id))
-         (push (list link desc) org-stored-links))
+       (if (member (list link desc) org-stored-links)
+           (message "This link already exists")
+         (push (list link desc) org-stored-links)
+         (message "Stored: %s" (or desc link))
+         (when custom-id
+           (setq link (concat "file:"
+                              (abbreviate-file-name
+                               (buffer-file-name (buffer-base-buffer)))
+                              "::#" custom-id))
+           (push (list link desc) org-stored-links)))
        (car org-stored-links)))))
 
 ;;;###autoload
@@ -1737,13 +1844,14 @@ Use TAB to complete link prefixes, then RET for 
type-specific completion support
     ;; Check if we are linking to the current file with a search
     ;; option If yes, simplify the link by using only the search
     ;; option.
-    (when (and buffer-file-name
+    (when (and (buffer-file-name (buffer-base-buffer))
               (let ((case-fold-search nil))
                 (string-match "\\`file:\\(.+?\\)::" link)))
       (let ((path (match-string-no-properties 1 link))
            (search (substring-no-properties link (match-end 0))))
        (save-match-data
-         (when (equal (file-truename buffer-file-name) (file-truename path))
+         (when (equal (file-truename (buffer-file-name (buffer-base-buffer)))
+                      (file-truename path))
            ;; We are linking to this same file, with a search option
            (setq link search)))))
 
@@ -1903,7 +2011,10 @@ Also refresh fontification if needed."
 
 (org-link-make-regexps)
 
-
 (provide 'ol)
 
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; ol.el ends here
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 82bf1b2..99e5464 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -1,6 +1,6 @@
 ;;; org-agenda.el --- Dynamic task and appointment lists for Org
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -49,6 +49,7 @@
 (require 'ol)
 (require 'org)
 (require 'org-macs)
+(require 'org-refile)
 
 (declare-function diary-add-to-list "diary-lib"
                   (date string specifier &optional marker globcolor literal))
@@ -83,6 +84,7 @@
 (declare-function org-agenda-columns "org-colview" ())
 (declare-function org-add-archive-files "org-archive" (files))
 (declare-function org-capture "org-capture" (&optional goto keys))
+(declare-function org-clock-modify-effort-estimate "org-clock" (&optional 
value))
 
 (defvar calendar-mode-map)
 (defvar org-clock-current-task)
@@ -185,7 +187,7 @@ and `org-agenda-entry-text-maxlines'."
   "Non-nil means export org-links as descriptive links in agenda added text.
 This variable applies to the text added to the agenda when
 `org-agenda-add-entry-text-maxlines' is larger than 0.
-When this variable nil, the URL will (also) be shown."
+When this variable is nil, the URL will (also) be shown."
   :group 'org-agenda
   :type 'boolean)
 
@@ -1012,6 +1014,12 @@ headlines as the agenda display heavily relies on them."
   :group 'org-agenda-startup
   :type 'hook)
 
+(defcustom org-agenda-filter-hook nil
+  "Hook run just after filtering with `org-agenda-filter'."
+  :group 'org-agenda-startup
+  :package-version '(Org . "9.4")
+  :type 'hook)
+
 (defcustom org-agenda-mouse-1-follows-link nil
   "Non-nil means mouse-1 on a link will follow the link in the agenda.
 A longer mouse click will still set point.  Needs to be set
@@ -1092,14 +1100,21 @@ reorganize-frame  Show only two windows on the current 
frame, the current
                   window and the agenda.
 other-frame       Use `switch-to-buffer-other-frame' to display agenda.
                   Also, when exiting the agenda, kill that frame.
+other-tab         Use `switch-to-buffer-other-tab' to display the
+                  agenda, making use of the `tab-bar-mode' introduced
+                  in Emacs version 27.1.  Also, kill that tab when
+                  exiting the agenda view.
+
 See also the variable `org-agenda-restore-windows-after-quit'."
   :group 'org-agenda-windows
   :type '(choice
          (const current-window)
          (const other-frame)
+         (const other-tab)
          (const other-window)
          (const only-window)
-         (const reorganize-frame)))
+         (const reorganize-frame))
+  :package-version '(Org . "9.4"))
 
 (defcustom org-agenda-window-frame-fractions '(0.5 . 0.75)
   "The min and max height of the agenda window as a fraction of frame height.
@@ -1110,11 +1125,11 @@ It only matters if `org-agenda-window-setup' is 
`reorganize-frame'."
 
 (defcustom org-agenda-restore-windows-after-quit nil
   "Non-nil means restore window configuration upon exiting agenda.
-Before the window configuration is changed for displaying the agenda,
-the current status is recorded.  When the agenda is exited with
-`q' or `x' and this option is set, the old state is restored.  If
-`org-agenda-window-setup' is `other-frame', the value of this
-option will be ignored."
+Before the window configuration is changed for displaying the
+agenda, the current status is recorded.  When the agenda is
+exited with `q' or `x' and this option is set, the old state is
+restored.  If `org-agenda-window-setup' is `other-frame' or
+`other-tab', the value of this option will be ignored."
   :group 'org-agenda-windows
   :type 'boolean)
 
@@ -1156,6 +1171,11 @@ argument, a calendar-style date list like (month day 
year)."
          (string :tag "Format string")
          (function :tag "Function")))
 
+(defun org-agenda-end-of-line ()
+  "Go to the end of visible line."
+  (interactive)
+  (goto-char (line-end-position)))
+
 (defun org-agenda-format-date-aligned (date)
   "Format a DATE string for display in the daily/weekly agenda.
 This function makes sure that dates are aligned for easy reading."
@@ -1238,6 +1258,16 @@ in the past."
   :version "24.1"
   :type 'boolean)
 
+(defcustom org-agenda-diary-file 'diary-file
+  "File to which to add new entries with the `i' key in agenda and calendar.
+When this is the symbol `diary-file', the functionality in the Emacs
+calendar will be used to add entries to the `diary-file'.  But when this
+points to a file, `org-agenda-diary-entry' will be used instead."
+  :group 'org-agenda
+  :type '(choice
+         (const :tag "The standard Emacs diary file" diary-file)
+         (file :tag "Special Org file diary entries")))
+
 (defcustom org-agenda-include-diary nil
   "If non-nil, include in the agenda entries from the Emacs Calendar's diary.
 Custom commands can set this variable in the options section."
@@ -1619,7 +1649,7 @@ part of an agenda sorting strategy."
   :group 'org-agenda-sorting
   :type 'symbol)
 
-(defcustom org-sort-agenda-notime-is-late t
+(defcustom org-agenda-sort-notime-is-late t
   "Non-nil means items without time are considered late.
 This is only relevant for sorting.  When t, items which have no explicit
 time like 15:30 will be considered as 99:01, i.e. later than any items which
@@ -1629,7 +1659,7 @@ agenda entries."
   :group 'org-agenda-sorting
   :type 'boolean)
 
-(defcustom org-sort-agenda-noeffort-is-high t
+(defcustom org-agenda-sort-noeffort-is-high t
   "Non-nil means items without effort estimate are sorted as high effort.
 This also applies when filtering an agenda view with respect to the
 < or > effort operator.  Then, tasks with no effort defined will be treated
@@ -1923,8 +1953,8 @@ However, settings in `org-priority-faces' will overrule 
these faces.
 When this variable is the symbol `cookies', only fontify the
 cookies, not the entire task.
 This may also be an association list of priority faces, whose
-keys are the character values of `org-highest-priority',
-`org-default-priority', and `org-lowest-priority' (the default values
+keys are the character values of `org-priority-highest',
+`org-priority-default', and `org-priority-lowest' (the default values
 are ?A, ?B, and ?C, respectively).  The face may be a named face, a
 color as a string, or a list like `(:background \"Red\")'.
 If it is a color, the variable `org-faces-easy-properties'
@@ -1985,7 +2015,7 @@ category, you can use:
                                          (string :tag "File or data")
                                          (symbol :tag "Type")
                                          (boolean :tag "Data?")
-                                         (repeat :tag "Extra image properties" 
:inline t symbol))
+                                         (repeat :tag "Extra image properties" 
:inline t sexp))
                                    (list :tag "Display properties" sexp))))
 
 (defgroup org-agenda-column-view nil
@@ -2101,6 +2131,8 @@ evaluate to a string."
 (defvar org-agenda-mode-map (make-sparse-keymap)
   "Keymap for `org-agenda-mode'.")
 
+(org-remap org-agenda-mode-map 'move-end-of-line 'org-agenda-end-of-line)
+
 (defvar org-agenda-menu) ; defined later in this file.
 (defvar org-agenda-restrict nil) ; defined later in this file.
 (defvar org-agenda-follow-mode nil)
@@ -2197,6 +2229,7 @@ The following commands are available:
 
 \\{org-agenda-mode-map}"
   (interactive)
+  (ignore-errors (require 'face-remap))
   (let ((agenda-local-vars-to-keep
         '(text-scale-mode-amount
           text-scale-mode
@@ -2209,8 +2242,8 @@ The following commands are available:
                           (dolist (elem save)
                             (pcase elem
                               (`(,var . ,val)          ;ignore unbound 
variables
-                               (when (and val (memq var var-set))
-                                 (set var val)))))))
+                               (when (and val (memq var var-set))
+                                 (set var val)))))))
       (cond (org-agenda-doing-sticky-redo
             ;; Refreshing sticky agenda-buffer
             ;;
@@ -2273,155 +2306,152 @@ The following commands are available:
    (if (fboundp 'run-mode-hooks) 'run-mode-hooks 'run-hooks)
    (list 'org-agenda-mode-hook)))
 
-(substitute-key-definition 'undo 'org-agenda-undo
+(substitute-key-definition #'undo #'org-agenda-undo
                           org-agenda-mode-map global-map)
-(org-defkey org-agenda-mode-map "\C-i"     'org-agenda-goto)
-(org-defkey org-agenda-mode-map [(tab)]    'org-agenda-goto)
-(org-defkey org-agenda-mode-map "\C-m"     'org-agenda-switch-to)
-(org-defkey org-agenda-mode-map "\C-k"     'org-agenda-kill)
-(org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile)
-(org-defkey org-agenda-mode-map [(meta down)] 'org-agenda-drag-line-forward)
-(org-defkey org-agenda-mode-map [(meta up)] 'org-agenda-drag-line-backward)
-(org-defkey org-agenda-mode-map "m"        'org-agenda-bulk-mark)
-(org-defkey org-agenda-mode-map "\M-m"     'org-agenda-bulk-toggle)
-(org-defkey org-agenda-mode-map "*"        'org-agenda-bulk-mark-all)
-(org-defkey org-agenda-mode-map "\M-*"     'org-agenda-bulk-toggle-all)
-(org-defkey org-agenda-mode-map "#"        'org-agenda-dim-blocked-tasks)
-(org-defkey org-agenda-mode-map "%"        'org-agenda-bulk-mark-regexp)
-(org-defkey org-agenda-mode-map "u"        'org-agenda-bulk-unmark)
-(org-defkey org-agenda-mode-map "U"        'org-agenda-bulk-unmark-all)
-(org-defkey org-agenda-mode-map "B"        'org-agenda-bulk-action)
-(org-defkey org-agenda-mode-map "k"        'org-agenda-capture)
-(org-defkey org-agenda-mode-map "A"        'org-agenda-append-agenda)
-(org-defkey org-agenda-mode-map "\C-c\C-x!" 'org-reload)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-a" 'org-agenda-archive-default)
-(org-defkey org-agenda-mode-map "\C-c\C-xa"    'org-agenda-toggle-archive-tag)
-(org-defkey org-agenda-mode-map "\C-c\C-xA"    
'org-agenda-archive-to-archive-sibling)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-s" 'org-agenda-archive)
-(org-defkey org-agenda-mode-map "\C-c$"        'org-agenda-archive)
-(org-defkey org-agenda-mode-map "$"        'org-agenda-archive)
-(org-defkey org-agenda-mode-map "\C-c\C-o" 'org-agenda-open-link)
-(org-defkey org-agenda-mode-map " "        'org-agenda-show-and-scroll-up)
-(org-defkey org-agenda-mode-map [backspace] 'org-agenda-show-scroll-down)
-(org-defkey org-agenda-mode-map "\d" 'org-agenda-show-scroll-down)
-(org-defkey org-agenda-mode-map [(control shift right)] 
'org-agenda-todo-nextset)
-(org-defkey org-agenda-mode-map [(control shift left)]  
'org-agenda-todo-previousset)
-(org-defkey org-agenda-mode-map "\C-c\C-xb" 
'org-agenda-tree-to-indirect-buffer)
-(org-defkey org-agenda-mode-map "o"        'delete-other-windows)
-(org-defkey org-agenda-mode-map "L"        'org-agenda-recenter)
-(org-defkey org-agenda-mode-map "\C-c\C-t" 'org-agenda-todo)
-(org-defkey org-agenda-mode-map "t"        'org-agenda-todo)
-(org-defkey org-agenda-mode-map "a"        
'org-agenda-archive-default-with-confirmation)
-(org-defkey org-agenda-mode-map ":"        'org-agenda-set-tags)
-(org-defkey org-agenda-mode-map "\C-c\C-q" 'org-agenda-set-tags)
-(org-defkey org-agenda-mode-map "."        'org-agenda-goto-today)
-(org-defkey org-agenda-mode-map "j"        'org-agenda-goto-date)
-(org-defkey org-agenda-mode-map "d"        'org-agenda-day-view)
-(org-defkey org-agenda-mode-map "w"        'org-agenda-week-view)
-(org-defkey org-agenda-mode-map "y"        'org-agenda-year-view)
-(org-defkey org-agenda-mode-map "\C-c\C-z" 'org-agenda-add-note)
-(org-defkey org-agenda-mode-map "z"        'org-agenda-add-note)
-(org-defkey org-agenda-mode-map [(shift right)] 'org-agenda-do-date-later)
-(org-defkey org-agenda-mode-map [(shift left)] 'org-agenda-do-date-earlier)
-(org-defkey org-agenda-mode-map [?\C-c ?\C-x (right)] 
'org-agenda-do-date-later)
-(org-defkey org-agenda-mode-map [?\C-c ?\C-x (left)] 
'org-agenda-do-date-earlier)
-
-(org-defkey org-agenda-mode-map ">" 'org-agenda-date-prompt)
-(org-defkey org-agenda-mode-map "\C-c\C-s" 'org-agenda-schedule)
-(org-defkey org-agenda-mode-map "\C-c\C-d" 'org-agenda-deadline)
+(org-defkey org-agenda-mode-map "\C-i" #'org-agenda-goto)
+(org-defkey org-agenda-mode-map [(tab)] #'org-agenda-goto)
+(org-defkey org-agenda-mode-map "\C-m" #'org-agenda-switch-to)
+(org-defkey org-agenda-mode-map "\C-k" #'org-agenda-kill)
+(org-defkey org-agenda-mode-map "\C-c\C-w" #'org-agenda-refile)
+(org-defkey org-agenda-mode-map [(meta down)] #'org-agenda-drag-line-forward)
+(org-defkey org-agenda-mode-map [(meta up)] #'org-agenda-drag-line-backward)
+(org-defkey org-agenda-mode-map "m" #'org-agenda-bulk-mark)
+(org-defkey org-agenda-mode-map "\M-m" #'org-agenda-bulk-toggle)
+(org-defkey org-agenda-mode-map "*" #'org-agenda-bulk-mark-all)
+(org-defkey org-agenda-mode-map "\M-*" #'org-agenda-bulk-toggle-all)
+(org-defkey org-agenda-mode-map "#" #'org-agenda-dim-blocked-tasks)
+(org-defkey org-agenda-mode-map "%" #'org-agenda-bulk-mark-regexp)
+(org-defkey org-agenda-mode-map "u" #'org-agenda-bulk-unmark)
+(org-defkey org-agenda-mode-map "U" #'org-agenda-bulk-unmark-all)
+(org-defkey org-agenda-mode-map "B" #'org-agenda-bulk-action)
+(org-defkey org-agenda-mode-map "k" #'org-agenda-capture)
+(org-defkey org-agenda-mode-map "A" #'org-agenda-append-agenda)
+(org-defkey org-agenda-mode-map "\C-c\C-x!" #'org-reload)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-a" #'org-agenda-archive-default)
+(org-defkey org-agenda-mode-map "\C-c\C-xa" #'org-agenda-toggle-archive-tag)
+(org-defkey org-agenda-mode-map "\C-c\C-xA" 
#'org-agenda-archive-to-archive-sibling)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-s" #'org-agenda-archive)
+(org-defkey org-agenda-mode-map "\C-c$" #'org-agenda-archive)
+(org-defkey org-agenda-mode-map "$" #'org-agenda-archive)
+(org-defkey org-agenda-mode-map "\C-c\C-o" #'org-agenda-open-link)
+(org-defkey org-agenda-mode-map " " #'org-agenda-show-and-scroll-up)
+(org-defkey org-agenda-mode-map [backspace] #'org-agenda-show-scroll-down)
+(org-defkey org-agenda-mode-map "\d" #'org-agenda-show-scroll-down)
+(org-defkey org-agenda-mode-map [(control shift right)] 
#'org-agenda-todo-nextset)
+(org-defkey org-agenda-mode-map [(control shift left)] 
#'org-agenda-todo-previousset)
+(org-defkey org-agenda-mode-map "\C-c\C-xb" 
#'org-agenda-tree-to-indirect-buffer)
+(org-defkey org-agenda-mode-map "o" #'delete-other-windows)
+(org-defkey org-agenda-mode-map "L" #'org-agenda-recenter)
+(org-defkey org-agenda-mode-map "\C-c\C-t" #'org-agenda-todo)
+(org-defkey org-agenda-mode-map "t" #'org-agenda-todo)
+(org-defkey org-agenda-mode-map "a" 
#'org-agenda-archive-default-with-confirmation)
+(org-defkey org-agenda-mode-map ":" #'org-agenda-set-tags)
+(org-defkey org-agenda-mode-map "\C-c\C-q" #'org-agenda-set-tags)
+(org-defkey org-agenda-mode-map "." #'org-agenda-goto-today)
+(org-defkey org-agenda-mode-map "j" #'org-agenda-goto-date)
+(org-defkey org-agenda-mode-map "d" #'org-agenda-day-view)
+(org-defkey org-agenda-mode-map "w" #'org-agenda-week-view)
+(org-defkey org-agenda-mode-map "y" #'org-agenda-year-view)
+(org-defkey org-agenda-mode-map "\C-c\C-z" #'org-agenda-add-note)
+(org-defkey org-agenda-mode-map "z" #'org-agenda-add-note)
+(org-defkey org-agenda-mode-map [(shift right)] #'org-agenda-do-date-later)
+(org-defkey org-agenda-mode-map [(shift left)] #'org-agenda-do-date-earlier)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (right)] 
#'org-agenda-do-date-later)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (left)] 
#'org-agenda-do-date-earlier)
+(org-defkey org-agenda-mode-map ">" #'org-agenda-date-prompt)
+(org-defkey org-agenda-mode-map "\C-c\C-s" #'org-agenda-schedule)
+(org-defkey org-agenda-mode-map "\C-c\C-d" #'org-agenda-deadline)
 (let ((l '(1 2 3 4 5 6 7 8 9 0)))
   (while l (org-defkey org-agenda-mode-map
-                      (int-to-string (pop l)) 'digit-argument)))
-
-(org-defkey org-agenda-mode-map "F" 'org-agenda-follow-mode)
-(org-defkey org-agenda-mode-map "R" 'org-agenda-clockreport-mode)
-(org-defkey org-agenda-mode-map "E" 'org-agenda-entry-text-mode)
-(org-defkey org-agenda-mode-map "l" 'org-agenda-log-mode)
-(org-defkey org-agenda-mode-map "v" 'org-agenda-view-mode-dispatch)
-(org-defkey org-agenda-mode-map "D" 'org-agenda-toggle-diary)
-(org-defkey org-agenda-mode-map "!" 'org-agenda-toggle-deadlines)
-(org-defkey org-agenda-mode-map "G" 'org-agenda-toggle-time-grid)
-(org-defkey org-agenda-mode-map "r" 'org-agenda-redo)
-(org-defkey org-agenda-mode-map "g" 'org-agenda-redo-all)
-(org-defkey org-agenda-mode-map "e" 'org-agenda-set-effort)
-(org-defkey org-agenda-mode-map "\C-c\C-xe" 'org-agenda-set-effort)
+                      (number-to-string (pop l)) #'digit-argument)))
+(org-defkey org-agenda-mode-map "F" #'org-agenda-follow-mode)
+(org-defkey org-agenda-mode-map "R" #'org-agenda-clockreport-mode)
+(org-defkey org-agenda-mode-map "E" #'org-agenda-entry-text-mode)
+(org-defkey org-agenda-mode-map "l" #'org-agenda-log-mode)
+(org-defkey org-agenda-mode-map "v" #'org-agenda-view-mode-dispatch)
+(org-defkey org-agenda-mode-map "D" #'org-agenda-toggle-diary)
+(org-defkey org-agenda-mode-map "!" #'org-agenda-toggle-deadlines)
+(org-defkey org-agenda-mode-map "G" #'org-agenda-toggle-time-grid)
+(org-defkey org-agenda-mode-map "r" #'org-agenda-redo)
+(org-defkey org-agenda-mode-map "g" #'org-agenda-redo-all)
+(org-defkey org-agenda-mode-map "e" #'org-agenda-set-effort)
+(org-defkey org-agenda-mode-map "\C-c\C-xe" #'org-agenda-set-effort)
 (org-defkey org-agenda-mode-map "\C-c\C-x\C-e"
-           'org-clock-modify-effort-estimate)
-(org-defkey org-agenda-mode-map "\C-c\C-xp" 'org-agenda-set-property)
-(org-defkey org-agenda-mode-map "q" 'org-agenda-quit)
-(org-defkey org-agenda-mode-map "Q" 'org-agenda-Quit)
-(org-defkey org-agenda-mode-map "x" 'org-agenda-exit)
-(org-defkey org-agenda-mode-map "\C-x\C-w" 'org-agenda-write)
-(org-defkey org-agenda-mode-map "\C-x\C-s" 'org-save-all-org-buffers)
-(org-defkey org-agenda-mode-map "s" 'org-save-all-org-buffers)
-(org-defkey org-agenda-mode-map "T" 'org-agenda-show-tags)
-(org-defkey org-agenda-mode-map "n" 'org-agenda-next-line)
-(org-defkey org-agenda-mode-map "p" 'org-agenda-previous-line)
-(org-defkey org-agenda-mode-map "N" 'org-agenda-next-item)
-(org-defkey org-agenda-mode-map "P" 'org-agenda-previous-item)
-(substitute-key-definition 'next-line 'org-agenda-next-line
+           #'org-clock-modify-effort-estimate)
+(org-defkey org-agenda-mode-map "\C-c\C-xp" #'org-agenda-set-property)
+(org-defkey org-agenda-mode-map "q" #'org-agenda-quit)
+(org-defkey org-agenda-mode-map "Q" #'org-agenda-Quit)
+(org-defkey org-agenda-mode-map "x" #'org-agenda-exit)
+(org-defkey org-agenda-mode-map "\C-x\C-w" #'org-agenda-write)
+(org-defkey org-agenda-mode-map "\C-x\C-s" #'org-save-all-org-buffers)
+(org-defkey org-agenda-mode-map "s" #'org-save-all-org-buffers)
+(org-defkey org-agenda-mode-map "T" #'org-agenda-show-tags)
+(org-defkey org-agenda-mode-map "n" #'org-agenda-next-line)
+(org-defkey org-agenda-mode-map "p" #'org-agenda-previous-line)
+(org-defkey org-agenda-mode-map "N" #'org-agenda-next-item)
+(org-defkey org-agenda-mode-map "P" #'org-agenda-previous-item)
+(substitute-key-definition #'next-line #'org-agenda-next-line
                           org-agenda-mode-map global-map)
-(substitute-key-definition 'previous-line 'org-agenda-previous-line
+(substitute-key-definition #'previous-line #'org-agenda-previous-line
                           org-agenda-mode-map global-map)
-(org-defkey org-agenda-mode-map "\C-c\C-a" 'org-attach)
-(org-defkey org-agenda-mode-map "\C-c\C-n" 'org-agenda-next-date-line)
-(org-defkey org-agenda-mode-map "\C-c\C-p" 'org-agenda-previous-date-line)
-(org-defkey org-agenda-mode-map "\C-c," 'org-agenda-priority)
-(org-defkey org-agenda-mode-map "," 'org-agenda-priority)
-(org-defkey org-agenda-mode-map "i" 'org-agenda-diary-entry)
-(org-defkey org-agenda-mode-map "c" 'org-agenda-goto-calendar)
-(org-defkey org-agenda-mode-map "C" 'org-agenda-convert-date)
-(org-defkey org-agenda-mode-map "M" 'org-agenda-phases-of-moon)
-(org-defkey org-agenda-mode-map "S" 'org-agenda-sunrise-sunset)
-(org-defkey org-agenda-mode-map "h" 'org-agenda-holidays)
-(org-defkey org-agenda-mode-map "H" 'org-agenda-holidays)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-i" 'org-agenda-clock-in)
-(org-defkey org-agenda-mode-map "I" 'org-agenda-clock-in)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-o" 'org-agenda-clock-out)
-(org-defkey org-agenda-mode-map "O" 'org-agenda-clock-out)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-x" 'org-agenda-clock-cancel)
-(org-defkey org-agenda-mode-map "X" 'org-agenda-clock-cancel)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-j" 'org-clock-goto)
-(org-defkey org-agenda-mode-map "J" 'org-agenda-clock-goto)
-(org-defkey org-agenda-mode-map "+" 'org-agenda-priority-up)
-(org-defkey org-agenda-mode-map "-" 'org-agenda-priority-down)
-(org-defkey org-agenda-mode-map [(shift up)] 'org-agenda-priority-up)
-(org-defkey org-agenda-mode-map [(shift down)] 'org-agenda-priority-down)
-(org-defkey org-agenda-mode-map [?\C-c ?\C-x (up)] 'org-agenda-priority-up)
-(org-defkey org-agenda-mode-map [?\C-c ?\C-x (down)] 'org-agenda-priority-down)
-(org-defkey org-agenda-mode-map "f" 'org-agenda-later)
-(org-defkey org-agenda-mode-map "b" 'org-agenda-earlier)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-c" 'org-agenda-columns)
-(org-defkey org-agenda-mode-map "\C-c\C-x>" 
'org-agenda-remove-restriction-lock)
-(org-defkey org-agenda-mode-map "\C-c\C-x<" 
'org-agenda-set-restriction-lock-from-agenda)
-
-(org-defkey org-agenda-mode-map "[" 'org-agenda-manipulate-query-add)
-(org-defkey org-agenda-mode-map "]" 'org-agenda-manipulate-query-subtract)
-(org-defkey org-agenda-mode-map "{" 'org-agenda-manipulate-query-add-re)
-(org-defkey org-agenda-mode-map "}" 'org-agenda-manipulate-query-subtract-re)
-(org-defkey org-agenda-mode-map "\\" 'org-agenda-filter-by-tag)
-(org-defkey org-agenda-mode-map "_" 'org-agenda-filter-by-effort)
-(org-defkey org-agenda-mode-map "=" 'org-agenda-filter-by-regexp)
-(org-defkey org-agenda-mode-map "/" 'org-agenda-filter)
-(org-defkey org-agenda-mode-map "|" 'org-agenda-filter-remove-all)
-(org-defkey org-agenda-mode-map "~" 'org-agenda-limit-interactively)
-(org-defkey org-agenda-mode-map "<" 'org-agenda-filter-by-category)
-(org-defkey org-agenda-mode-map "^" 'org-agenda-filter-by-top-headline)
-(org-defkey org-agenda-mode-map ";" 'org-timer-set-timer)
-(org-defkey org-agenda-mode-map "\C-c\C-x_" 'org-timer-stop)
-(define-key org-agenda-mode-map "?" 'org-agenda-show-the-flagging-note)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-mg"    'org-mobile-pull)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-mp"    'org-mobile-push)
-(org-defkey org-agenda-mode-map "\C-c\C-xI" 'org-info-find-node)
-
-(org-defkey org-agenda-mode-map [mouse-2] 'org-agenda-goto-mouse)
-(org-defkey org-agenda-mode-map [mouse-3] 'org-agenda-show-mouse)
-
-(define-key org-agenda-mode-map [remap forward-paragraph] 
'org-agenda-forward-block)
-(define-key org-agenda-mode-map [remap backward-paragraph] 
'org-agenda-backward-block)
+(org-defkey org-agenda-mode-map "\C-c\C-a" #'org-attach)
+(org-defkey org-agenda-mode-map "\C-c\C-n" #'org-agenda-next-date-line)
+(org-defkey org-agenda-mode-map "\C-c\C-p" #'org-agenda-previous-date-line)
+(org-defkey org-agenda-mode-map "\C-c," #'org-agenda-priority)
+(org-defkey org-agenda-mode-map "," #'org-agenda-priority)
+(org-defkey org-agenda-mode-map "i" #'org-agenda-diary-entry)
+(org-defkey org-agenda-mode-map "c" #'org-agenda-goto-calendar)
+(org-defkey org-agenda-mode-map "C" #'org-agenda-convert-date)
+(org-defkey org-agenda-mode-map "M" #'org-agenda-phases-of-moon)
+(org-defkey org-agenda-mode-map "S" #'org-agenda-sunrise-sunset)
+(org-defkey org-agenda-mode-map "h" #'org-agenda-holidays)
+(org-defkey org-agenda-mode-map "H" #'org-agenda-holidays)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-i" #'org-agenda-clock-in)
+(org-defkey org-agenda-mode-map "I" #'org-agenda-clock-in)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-o" #'org-agenda-clock-out)
+(org-defkey org-agenda-mode-map "O" #'org-agenda-clock-out)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-x" #'org-agenda-clock-cancel)
+(org-defkey org-agenda-mode-map "X" #'org-agenda-clock-cancel)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-j" #'org-clock-goto)
+(org-defkey org-agenda-mode-map "J" #'org-agenda-clock-goto)
+(org-defkey org-agenda-mode-map "+" #'org-agenda-priority-up)
+(org-defkey org-agenda-mode-map "-" #'org-agenda-priority-down)
+(org-defkey org-agenda-mode-map [(shift up)] #'org-agenda-priority-up)
+(org-defkey org-agenda-mode-map [(shift down)] #'org-agenda-priority-down)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (up)] #'org-agenda-priority-up)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (down)] 
#'org-agenda-priority-down)
+(org-defkey org-agenda-mode-map "f" #'org-agenda-later)
+(org-defkey org-agenda-mode-map "b" #'org-agenda-earlier)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-c" #'org-agenda-columns)
+(org-defkey org-agenda-mode-map "\C-c\C-x>" 
#'org-agenda-remove-restriction-lock)
+(org-defkey org-agenda-mode-map "\C-c\C-x<" 
#'org-agenda-set-restriction-lock-from-agenda)
+(org-defkey org-agenda-mode-map "[" #'org-agenda-manipulate-query-add)
+(org-defkey org-agenda-mode-map "]" #'org-agenda-manipulate-query-subtract)
+(org-defkey org-agenda-mode-map "{" #'org-agenda-manipulate-query-add-re)
+(org-defkey org-agenda-mode-map "}" #'org-agenda-manipulate-query-subtract-re)
+(org-defkey org-agenda-mode-map "\\" #'org-agenda-filter-by-tag)
+(org-defkey org-agenda-mode-map "_" #'org-agenda-filter-by-effort)
+(org-defkey org-agenda-mode-map "=" #'org-agenda-filter-by-regexp)
+(org-defkey org-agenda-mode-map "/" #'org-agenda-filter)
+(org-defkey org-agenda-mode-map "|" #'org-agenda-filter-remove-all)
+(org-defkey org-agenda-mode-map "~" #'org-agenda-limit-interactively)
+(org-defkey org-agenda-mode-map "<" #'org-agenda-filter-by-category)
+(org-defkey org-agenda-mode-map "^" #'org-agenda-filter-by-top-headline)
+(org-defkey org-agenda-mode-map ";" #'org-timer-set-timer)
+(org-defkey org-agenda-mode-map "\C-c\C-x_" #'org-timer-stop)
+(org-defkey org-agenda-mode-map "?" #'org-agenda-show-the-flagging-note)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-mg" #'org-mobile-pull)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-mp" #'org-mobile-push)
+(org-defkey org-agenda-mode-map "\C-c\C-xI" #'org-info-find-node)
+(org-defkey org-agenda-mode-map [mouse-2] #'org-agenda-goto-mouse)
+(org-defkey org-agenda-mode-map [mouse-3] #'org-agenda-show-mouse)
+(org-defkey org-agenda-mode-map [remap forward-paragraph] 
#'org-agenda-forward-block)
+(org-defkey org-agenda-mode-map [remap backward-paragraph] 
#'org-agenda-backward-block)
+(org-defkey org-agenda-mode-map "\C-c\C-c" #'org-agenda-ctrl-c-ctrl-c)
 
 (when org-agenda-mouse-1-follows-link
   (org-defkey org-agenda-mode-map [follow-link] 'mouse-face))
+
 (easy-menu-define org-agenda-menu org-agenda-mode-map "Agenda menu"
   '("Agenda"
     ("Agenda Files")
@@ -2562,7 +2592,7 @@ The following commands are available:
      ["Set Priority" org-agenda-priority t]
      ["Increase Priority" org-agenda-priority-up t]
      ["Decrease Priority" org-agenda-priority-down t]
-     ["Show Priority" org-show-priority t])
+     ["Show Priority" org-priority-show t])
     ("Calendar/Diary"
      ["New Diary Entry" org-agenda-diary-entry (org-agenda-check-type nil 
'agenda)]
      ["Goto Calendar" org-agenda-goto-calendar (org-agenda-check-type nil 
'agenda)]
@@ -3112,7 +3142,7 @@ s   Search for keywords                 M   Like m, but 
only TODO entries
          ;; Hint to navigation if window too small for all information
          (setq header-line-format
                (when (not (pos-visible-in-window-p (point-max)))
-                 "Use SPC, DEL, C-n or C-p to navigate."))
+                 "Use C-v, M-v, C-n or C-p to navigate."))
 
          ;; Ask for selection
          (cl-loop
@@ -3126,24 +3156,8 @@ s   Search for keywords                 M   Like m, but 
only TODO entries
                                 " (unrestricted)"))
                           ""))
                (setq c (read-char-exclusive)))
-          until (not (memq c '(14 16 ?\s ?\d)))
-          do (cl-case c
-               (14 (if (not (pos-visible-in-window-p (point-max)))
-                       (ignore-errors (scroll-up 1))
-                     (message "End of buffer")
-                     (sit-for 1)))
-               (16 (if (not (pos-visible-in-window-p (point-min)))
-                       (ignore-errors (scroll-down 1))
-                     (message "Beginning of buffer")
-                     (sit-for 1)))
-               (?\s (if (not (pos-visible-in-window-p (point-max)))
-                        (scroll-up nil)
-                      (message "End of buffer")
-                      (sit-for 1)))
-               (?\d (if (not (pos-visible-in-window-p (point-min)))
-                        (scroll-down nil)
-                      (message "Beginning of buffer")
-                      (sit-for 1)))))
+          until (not (memq c '(14 16 22 134217846)))
+          do (org-scroll c))
 
          (message "")
          (cond
@@ -3590,8 +3604,7 @@ removed from the entry content.  Currently only 
`planning' is allowed here."
             (when org-agenda-add-entry-text-descriptive-links
               (goto-char (point-min))
               (while (org-activate-links (point-max))
-                (add-text-properties (match-beginning 0) (match-end 0)
-                                     '(face org-link))))
+                (goto-char (match-end 0))))
             (goto-char (point-min))
             (while (re-search-forward org-link-bracket-re (point-max) t)
               (set-text-properties (match-beginning 0) (match-end 0)
@@ -3746,6 +3759,14 @@ generating a new one."
       ;; does not have org variables local
       org-agenda-this-buffer-is-sticky))))
 
+(defvar org-agenda-buffer-tmp-name nil)
+
+(defun org-agenda--get-buffer-name (sticky-name)
+  (or org-agenda-buffer-tmp-name
+      (and org-agenda-doing-sticky-redo org-agenda-buffer-name)
+      sticky-name
+      "*Org Agenda*"))
+
 (defun org-agenda-prepare-window (abuf filter-alist)
   "Setup agenda buffer in the window.
 ABUF is the buffer for the agenda window.
@@ -3762,6 +3783,10 @@ FILTER-ALIST is an alist of filters we need to apply when
       (org-switch-to-buffer-other-window abuf))
      ((eq org-agenda-window-setup 'other-frame)
       (switch-to-buffer-other-frame abuf))
+     ((eq org-agenda-window-setup 'other-tab)
+      (if (fboundp 'switch-to-buffer-other-tab)
+         (switch-to-buffer-other-tab abuf)
+       (user-error "Your version of Emacs does not have tab bar support")))
      ((eq org-agenda-window-setup 'only-window)
       (delete-other-windows)
       (pop-to-buffer-same-window abuf))
@@ -3846,15 +3871,17 @@ FILTER-ALIST is an alist of filters we need to apply 
when
 (defvar org-overriding-columns-format)
 (defvar org-local-columns-format)
 (defun org-agenda-finalize ()
-  "Finishing touch for the agenda buffer, called just before displaying it."
+  "Finishing touch for the agenda buffer.
+This function is called just before displaying the agenda.  If
+you want to add your own functions to the finalization of the
+agenda display, configure `org-agenda-finalize-hook'."
   (unless org-agenda-multi
-    (save-excursion
-      (let ((inhibit-read-only t))
+    (let ((inhibit-read-only t))
+      (save-excursion
        (goto-char (point-min))
        (save-excursion
          (while (org-activate-links (point-max))
-           (add-text-properties (match-beginning 0) (match-end 0)
-                                '(face org-link))))
+           (goto-char (match-end 0))))
        (unless (eq org-agenda-remove-tags t)
          (org-agenda-align-tags))
        (unless org-agenda-with-colors
@@ -3893,7 +3920,6 @@ FILTER-ALIST is an alist of filters we need to apply when
                                     'tags
                                     (org-with-point-at mrk
                                       (mapcar #'downcase (org-get-tags)))))))))
-       (run-hooks 'org-agenda-finalize-hook)
        (setq org-agenda-represented-tags nil
              org-agenda-represented-categories nil)
        (when org-agenda-top-headline-filter
@@ -3919,12 +3945,13 @@ FILTER-ALIST is an alist of filters we need to apply 
when
        (when (get 'org-agenda-effort-filter :preset-filter)
          (org-agenda-filter-apply
           (get 'org-agenda-effort-filter :preset-filter) 'effort))
-       (add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 
'local)))))
+       (add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local))
+      (run-hooks 'org-agenda-finalize-hook))))
 
 (defun org-agenda-mark-clocking-task ()
   "Mark the current clock entry in the agenda if it is present."
   ;; We need to widen when `org-agenda-finalize' is called from
-  ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
+  ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in').
   (when (bound-and-true-p org-clock-current-task)
     (save-restriction
       (widen)
@@ -3959,15 +3986,15 @@ FILTER-ALIST is an alist of filters we need to apply 
when
   (save-excursion
     (let (b e p ov h l)
       (goto-char (point-min))
-      (while (re-search-forward "\\[#\\(.\\)\\]" nil t)
-       (setq h (or (get-char-property (point) 'org-highest-priority)
-                   org-highest-priority)
-             l (or (get-char-property (point) 'org-lowest-priority)
-                   org-lowest-priority)
-             p (string-to-char (match-string 1))
-             b (match-beginning 0)
+      (while (re-search-forward org-priority-regexp nil t)
+       (setq h (or (get-char-property (point) 'org-priority-highest)
+                   org-priority-highest)
+             l (or (get-char-property (point) 'org-priority-lowest)
+                   org-priority-lowest)
+             p (string-to-char (match-string 2))
+             b (match-beginning 1)
              e (if (eq org-agenda-fontify-priorities 'cookies)
-                   (match-end 0)
+                   (1+ (match-end 2))
                  (point-at-eol))
              ov (make-overlay b e))
        (overlay-put
@@ -3995,7 +4022,7 @@ dimming them."
   (when (called-interactively-p 'interactive)
     (message "Dim or hide blocked tasks..."))
   (dolist (o (overlays-in (point-min) (point-max)))
-    (when (eq (overlay-get o 'org-type) 'org-blocked-todo)
+    (when (eq (overlay-get o 'face) 'org-agenda-dimmed-todo-face)
       (delete-overlay o)))
   (save-excursion
     (let ((inhibit-read-only t))
@@ -4003,22 +4030,26 @@ dimming them."
       (while (let ((pos (text-property-not-all
                         (point) (point-max) 'org-todo-blocked nil)))
               (when pos (goto-char pos)))
-       (let* ((invisible (eq (org-get-at-bol 'org-todo-blocked) 'invisible))
+       (let* ((invisible
+               (eq (org-get-at-bol 'org-todo-blocked) 'invisible))
+              (todo-blocked
+               (eq (org-get-at-bol 'org-filter-type) 'todo-blocked))
               (ov (make-overlay (if invisible
                                     (line-end-position 0)
                                   (line-beginning-position))
                                 (line-end-position))))
-         (if invisible
-             (overlay-put ov 'invisible t)
+         (when todo-blocked
            (overlay-put ov 'face 'org-agenda-dimmed-todo-face))
-         (overlay-put ov 'org-type 'org-blocked-todo))
-       (forward-line))))
+         (when invisible
+           (org-agenda-filter-hide-line 'todo-blocked)))
+       (move-beginning-of-line 2))))
   (when (called-interactively-p 'interactive)
     (message "Dim or hide blocked tasks...done")))
 
 (defun org-agenda--mark-blocked-entry (entry)
-  "For ENTRY a string with the text property `org-hd-marker', if
-the header at `org-hd-marker' is blocked according to
+  "If ENTRY is blocked, mark it for fontification or invisibility.
+
+If the header at `org-hd-marker' is blocked according to
 `org-entry-blocked-p', then if `org-agenda-dim-blocked-tasks' is
 'invisible and the header is not blocked by checkboxes, set the
 text property `org-todo-blocked' to `invisible', otherwise set it
@@ -4042,7 +4073,9 @@ to t."
              (put-text-property
               0 (length entry) 'org-todo-blocked
               (if really-invisible 'invisible t)
-              entry)))))))
+              entry)
+             (put-text-property
+              0 (length entry) 'org-filter-type 'todo-blocked entry)))))))
   entry)
 
 (defvar org-agenda-skip-function nil
@@ -4066,8 +4099,10 @@ continue from there."
     (when (or
           (save-excursion (goto-char p) (looking-at comment-start-skip))
           (and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
-               (get-text-property p :org-archived)
-               (org-end-of-subtree t))
+               (or (and (get-text-property p :org-archived)
+                        (org-end-of-subtree t))
+                   (and (member org-archive-tag org-file-tags)
+                        (goto-char (point-max)))))
           (and org-agenda-skip-comment-trees
                (get-text-property p :org-comment)
                (org-end-of-subtree t))
@@ -4099,8 +4134,8 @@ functions do."
 
 (defun org-agenda-new-marker (&optional pos)
   "Return a new agenda marker.
-Maker is at point, or at POS if non-nil.  Org mode keeps a list of
-these markers and resets them when they are no longer in use."
+Marker is at point, or at POS if non-nil.  Org mode keeps a list
+of these markers and resets them when they are no longer in use."
   (let ((m (copy-marker (or pos (point)) t)))
     (setq org-agenda-last-marker-time (float-time))
     (if org-agenda-buffer
@@ -4182,7 +4217,6 @@ See the docstring of `org-read-date' for details.")
 (defvar org-starting-day nil) ; local variable in the agenda buffer
 (defvar org-arg-loc nil) ; local variable
 
-(defvar org-agenda-buffer-tmp-name nil)
 ;;;###autoload
 (defun org-agenda-list (&optional arg start-day span with-hour)
   "Produce a daily/weekly view from all files in variable `org-agenda-files'.
@@ -4210,15 +4244,13 @@ items if they have an hour specification like [h]h:mm."
       (user-error "Agenda creation impossible for this span(=%d days)." span)))
   (catch 'exit
     (setq org-agenda-buffer-name
-         (or org-agenda-buffer-tmp-name
-             (and org-agenda-doing-sticky-redo org-agenda-buffer-name)
-             (when org-agenda-sticky
+         (org-agenda--get-buffer-name
+          (and org-agenda-sticky
                (cond ((and org-keys (stringp org-match))
                       (format "*Org Agenda(%s:%s)*" org-keys org-match))
                      (org-keys
                       (format "*Org Agenda(%s)*" org-keys))
-                     (t "*Org Agenda(a)*")))
-             "*Org Agenda*"))
+                     (t "*Org Agenda(a)*")))))
     (org-agenda-prepare "Day/Week")
     (setq start-day (or start-day org-agenda-start-day))
     (when (stringp start-day)
@@ -4365,7 +4397,7 @@ items if they have an hour specification like [h]h:mm."
          (insert tbl)))
       (goto-char (point-min))
       (or org-agenda-multi (org-agenda-fit-window-to-buffer))
-      (unless (or (not (get-buffer-window))
+      (unless (or (not (get-buffer-window org-agenda-buffer-name))
                  (and (pos-visible-in-window-p (point-min))
                       (pos-visible-in-window-p (point-max))))
        (goto-char (1- (point-max)))
@@ -4508,12 +4540,15 @@ is active."
                     (edit-at string))
                    'org-agenda-search-history)))
     (catch 'exit
-      (when org-agenda-sticky
-       (setq org-agenda-buffer-name
-             (if (stringp string)
-                 (format "*Org Agenda(%s:%s)*"
-                         (or org-keys (or (and todo-only "S") "s")) string)
-               (format "*Org Agenda(%s)*" (or (and todo-only "S") "s")))))
+      (setq org-agenda-buffer-name
+           (org-agenda--get-buffer-name
+            (and org-agenda-sticky
+                 (if (stringp string)
+                     (format "*Org Agenda(%s:%s)*"
+                             (or org-keys (or (and todo-only "S") "s"))
+                             string)
+                   (format "*Org Agenda(%s)*"
+                           (or (and todo-only "S") "s"))))))
       (org-agenda-prepare "SEARCH")
       (org-compile-prefix-format 'search)
       (org-set-sorting-strategy 'search)
@@ -4760,12 +4795,13 @@ for a keyword.  A numeric prefix directly selects the 
Nth keyword in
         (completion-ignore-case t)
          kwds org-select-this-todo-keyword rtn rtnall files file pos)
     (catch 'exit
-      (when org-agenda-sticky
-       (setq org-agenda-buffer-name
-             (if (stringp org-select-this-todo-keyword)
-                 (format "*Org Agenda(%s:%s)*" (or org-keys "t")
-                         org-select-this-todo-keyword)
-               (format "*Org Agenda(%s)*" (or org-keys "t")))))
+      (setq org-agenda-buffer-name
+           (org-agenda--get-buffer-name
+            (and org-agenda-sticky
+                 (if (stringp org-select-this-todo-keyword)
+                     (format "*Org Agenda(%s:%s)*" (or org-keys "t")
+                             org-select-this-todo-keyword)
+                   (format "*Org Agenda(%s)*" (or org-keys "t"))))))
       (org-agenda-prepare "TODO")
       (setq kwds org-todo-keywords-for-agenda
             org-select-this-todo-keyword (if (stringp arg) arg
@@ -4774,8 +4810,12 @@ for a keyword.  A numeric prefix directly selects the 
Nth keyword in
                                                 (nth (1- arg) kwds))))
       (when (equal arg '(4))
         (setq org-select-this-todo-keyword
-              (completing-read "Keyword (or KWD1|K2D2|...): "
-                               (mapcar #'list kwds) nil nil)))
+              (mapconcat #'identity
+                         (let ((crm-separator "|"))
+                           (completing-read-multiple
+                            "Keyword (or KWD1|KWD2|...): "
+                            (mapcar #'list kwds) nil nil))
+                         "|")))
       (and (equal 0 arg) (setq org-select-this-todo-keyword nil))
       (org-compile-prefix-format 'todo)
       (org-set-sorting-strategy 'todo)
@@ -4848,13 +4888,15 @@ The prefix arg TODO-ONLY limits the search to TODO 
entries."
     (when (and (stringp match) (not (string-match "\\S-" match)))
       (setq match nil))
     (catch 'exit
-      ;; TODO: this code is repeated a lot...
-      (when org-agenda-sticky
-       (setq org-agenda-buffer-name
-             (if (stringp match)
-                 (format "*Org Agenda(%s:%s)*"
-                         (or org-keys (or (and todo-only "M") "m")) match)
-               (format "*Org Agenda(%s)*" (or (and todo-only "M") "m")))))
+      (setq org-agenda-buffer-name
+           (org-agenda--get-buffer-name
+            (and org-agenda-sticky
+                 (if (stringp match)
+                     (format "*Org Agenda(%s:%s)*"
+                             (or org-keys (or (and todo-only "M") "m"))
+                             match)
+                   (format "*Org Agenda(%s)*"
+                           (or (and todo-only "M") "m"))))))
       (setq matcher (org-make-tags-matcher match))
       ;; Prepare agendas (and `org-tag-alist-for-agenda') before
       ;; expanding tags within `org-make-tags-matcher'
@@ -5135,6 +5177,7 @@ of what a project is and how to check if it stuck, 
customize the variable
          (cons 'org-diary-default-entry diary-list-entries-hook))
         (diary-file-name-prefix nil) ; turn this feature off
         (diary-modify-entry-list-string-function 
'org-modify-diary-entry-string)
+        (diary-time-regexp (concat "^" diary-time-regexp))
         entries
         (org-disable-agenda-to-diary t))
     (save-excursion
@@ -5284,7 +5327,8 @@ function from a program - use 
`org-agenda-get-day-entries' instead."
     (when results
       (setq results
            (mapcar (lambda (i) (replace-regexp-in-string
-                                org-link-bracket-re "\\2" i)) results))
+                                org-link-bracket-re "\\2" i))
+                   results))
       (concat (org-agenda-finalize-entries results) "\n"))))
 
 ;;; Agenda entry finders
@@ -5503,10 +5547,12 @@ This function is invoked if 
`org-agenda-todo-ignore-deadlines',
               (cond
                ((eq org-agenda-todo-ignore-scheduled 'future)
                 (> (org-time-stamp-to-now
-                    (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds) 0))
+                    (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds)
+                   0))
                ((eq org-agenda-todo-ignore-scheduled 'past)
                 (<= (org-time-stamp-to-now
-                     (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds) 0))
+                     (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds)
+                    0))
                ((numberp org-agenda-todo-ignore-scheduled)
                 (org-agenda-todo-custom-ignore-p
                  (match-string 1) org-agenda-todo-ignore-scheduled))
@@ -5519,10 +5565,12 @@ This function is invoked if 
`org-agenda-todo-ignore-deadlines',
                 (not (org-deadline-close-p (match-string 1))))
                ((eq org-agenda-todo-ignore-deadlines 'future)
                 (> (org-time-stamp-to-now
-                    (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds) 0))
+                    (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds)
+                   0))
                ((eq org-agenda-todo-ignore-deadlines 'past)
                 (<= (org-time-stamp-to-now
-                     (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds) 0))
+                     (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds)
+                    0))
                ((numberp org-agenda-todo-ignore-deadlines)
                 (org-agenda-todo-custom-ignore-p
                  (match-string 1) org-agenda-todo-ignore-deadlines))
@@ -5546,10 +5594,12 @@ This function is invoked if 
`org-agenda-todo-ignore-deadlines',
                     (cond
                      ((eq org-agenda-todo-ignore-timestamp 'future)
                       (> (org-time-stamp-to-now
-                          (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds) 0))
+                          (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds)
+                         0))
                      ((eq org-agenda-todo-ignore-timestamp 'past)
                       (<= (org-time-stamp-to-now
-                           (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds) 0))
+                           (match-string 1) 
org-agenda-todo-ignore-time-comparison-use-seconds)
+                          0))
                      ((numberp org-agenda-todo-ignore-timestamp)
                       (org-agenda-todo-custom-ignore-p
                        (match-string 1) org-agenda-todo-ignore-timestamp))
@@ -6457,7 +6507,6 @@ scheduled items with an hour specification like [h]h:mm."
                          (and (eq org-agenda-show-inherited-tags t)
                               (or (eq org-agenda-use-tag-inheritance t)
                                   (memq 'agenda 
org-agenda-use-tag-inheritance))))
-
                      tags (org-get-tags nil (not inherited-tags)))
                (setq level (make-string (org-reduced-level 
(org-outline-level)) ? ))
                (looking-at "\\*+[ \t]+\\(.*\\)")
@@ -6475,12 +6524,19 @@ scheduled items with an hour specification like 
[h]h:mm."
                                   org-agenda-timerange-leaders)
                              (1+ (- d0 d1)) (1+ (- d2 d1)))
                             head level category tags
-                            (cond ((and (= d1 d0) (= d2 d0))
-                                   (concat "<" start-time ">--<" end-time ">"))
-                                   ((= d1 d0)
-                                   (concat "<" start-time ">"))
-                                  ((= d2 d0)
-                                   (concat "<" end-time ">")))
+                            (save-match-data
+                              (let ((hhmm1 (and (string-match org-ts-regexp1 
s1)
+                                                (match-string 6 s1)))
+                                    (hhmm2 (and (string-match org-ts-regexp1 
s2)
+                                                (match-string 6 s2))))
+                                (cond ((string= hhmm1 hhmm2)
+                                       (concat "<" start-time ">--<" end-time 
">"))
+                                      ((and (= d1 d0) (= d2 d0))
+                                       (concat "<" start-time ">--<" end-time 
">"))
+                                       ((= d1 d0)
+                                       (concat "<" start-time ">"))
+                                      ((= d2 d0)
+                                       (concat "<" end-time ">")))))
                             remove-re))))
              (org-add-props txt props
                'org-marker marker 'org-hd-marker hdmarker
@@ -6676,8 +6732,8 @@ Any match of REMOVE-RE will be removed from TXT."
        (org-add-props rtn nil
          'org-category category
          'tags (mapcar 'org-downcase-keep-props tags)
-         'org-highest-priority org-highest-priority
-         'org-lowest-priority org-lowest-priority
+         'org-priority-highest org-priority-highest
+         'org-priority-lowest org-priority-lowest
          'time-of-day time-of-day
          'duration duration
          'breadcrumbs breadcrumbs
@@ -6872,7 +6928,7 @@ HH:MM."
                                  (< t0 1000)) "0" "")
                         (if (< t0 100) "0" "")
                         (if (< t0 10)  "0" "")
-                        (int-to-string t0))))
+                        (number-to-string t0))))
        (if string (concat (substring t1 -4 -2) ":" (substring t1 -2)) t0)))))
 
 (defvar org-agenda-before-sorting-filter-function nil
@@ -6920,7 +6976,7 @@ The optional argument TYPE tells the agenda type."
     (when max-effort
       (setq list (org-agenda-limit-entries
                  list 'effort-minutes max-effort
-                 (lambda (e) (or e (if org-sort-agenda-noeffort-is-high
+                 (lambda (e) (or e (if org-agenda-sort-noeffort-is-high
                                        32767 -1))))))
     (when max-todo
       (setq list (org-agenda-limit-entries list 'todo-state max-todo)))
@@ -7006,7 +7062,8 @@ The optional argument TYPE tells the agenda type."
                   ;; that isn't there.
                   pl
                   (equal (string-match (concat "\\(\\.*\\)" re "\\( +\\)")
-                                       x pl) pl))
+                                       x pl)
+                         pl))
          (add-text-properties
           (or (match-end 1) (match-end 0)) (match-end 0)
           (list 'face (org-get-todo-face (match-string 2 x)))
@@ -7033,7 +7090,7 @@ The optional argument TYPE tells the agenda type."
 
 (defsubst org-cmp-effort (a b)
   "Compare the effort values of string A and B."
-  (let* ((def (if org-sort-agenda-noeffort-is-high 32767 -1))
+  (let* ((def (if org-agenda-sort-noeffort-is-high 32767 -1))
         ;; `effort-minutes' property is not directly accessible from
         ;; the strings, but is stored as a property in `txt'.
         (ea (or (get-text-property
@@ -7083,12 +7140,14 @@ The optional argument TYPE tells the agenda type."
         (case-fold-search nil))
     (when pla
       (when (string-match (concat "\\`[ \t]*" (or (get-text-property 0 
'org-todo-regexp a) "")
-                                 "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *") ta)
+                                 "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *")
+                         ta)
        (setq ta (substring ta (match-end 0))))
       (setq ta (downcase ta)))
     (when plb
       (when (string-match (concat "\\`[ \t]*" (or (get-text-property 0 
'org-todo-regexp b) "")
-                                 "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *") tb)
+                                 "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *")
+                         tb)
        (setq tb (substring tb (match-end 0))))
       (setq tb (downcase tb)))
     (cond ((not (or ta tb)) nil)
@@ -7109,7 +7168,7 @@ The optional argument TYPE tells the agenda type."
 
 (defsubst org-cmp-time (a b)
   "Compare the time-of-day values of strings A and B."
-  (let* ((def (if org-sort-agenda-notime-is-late 9901 -1))
+  (let* ((def (if org-agenda-sort-notime-is-late 9901 -1))
         (ta (or (get-text-property 1 'time-of-day a) def))
         (tb (or (get-text-property 1 'time-of-day b) def)))
     (cond ((< ta tb) -1)
@@ -7121,7 +7180,7 @@ When TYPE is \"scheduled\", \"deadline\", \"timestamp\" or
 \"timestamp_ia\", compare within each of these type.  When TYPE
 is the empty string, compare all timestamps without respect of
 their type."
-  (let* ((def (and (not org-sort-agenda-notime-is-late) -1))
+  (let* ((def (and (not org-agenda-sort-notime-is-late) -1))
         (ta (or (and (string-match type (or (get-text-property 1 'type a) ""))
                      (get-text-property 1 'ts-date a))
                 def))
@@ -7351,6 +7410,10 @@ agenda."
       (cond
        ((eq org-agenda-window-setup 'other-frame)
        (delete-frame))
+       ((eq org-agenda-window-setup 'other-tab)
+       (if (fboundp 'tab-bar-close-tab)
+           (tab-bar-close-tab)
+         (user-error "Your version of Emacs does not have tab bar mode 
support")))
        ((and org-agenda-restore-windows-after-quit
             wconf)
        ;; Maybe restore the pre-agenda window configuration.  Reset
@@ -7470,7 +7533,7 @@ in the agenda."
     (and top-hl-filter (org-agenda-filter-top-headline-apply top-hl-filter))
     (and cols (called-interactively-p 'any) (org-agenda-columns))
     (org-goto-line line)
-    (recenter window-line)))
+    (when (called-interactively-p 'any) (recenter window-line))))
 
 (defun org-agenda-redo-all (&optional exhaustive)
   "Rebuild all agenda views in the current buffer.
@@ -7495,7 +7558,8 @@ With a prefix argument, do so in all agenda buffers."
   "Filter lines in the agenda buffer that have a specific category.
 The category is that of the current line.
 With a `\\[universal-argument]' prefix argument, exclude the lines of that 
category.
-When there is already a category filter in place, this command removes the 
filter."
+When there is already a category filter in place, this command removes the
+filter."
   (interactive "P")
   (if (and org-agenda-filtered-by-category
           org-agenda-category-filter)
@@ -7508,7 +7572,8 @@ When there is already a category filter in place, this 
command removes the filte
        (cat
         (org-agenda-filter-apply
          (setq org-agenda-category-filter
-              (list (concat "+" cat))) 'category))
+              (list (concat "+" cat)))
+        'category))
        (t (error "No category at point"))))))
 
 (defun org-find-top-headline (&optional pos)
@@ -7520,7 +7585,10 @@ search from."
       (when pos (goto-char pos))
       ;; Skip up to the topmost parent.
       (while (org-up-heading-safe))
-      (ignore-errors (nth 4 (org-heading-components))))))
+      (ignore-errors
+       (replace-regexp-in-string
+        "^\\[[0-9]+/[0-9]+\\] *\\|^\\[%[0-9]+\\] *" ""
+        (nth 4 (org-heading-components)))))))
 
 (defvar org-agenda-filtered-by-top-headline nil)
 (defun org-agenda-filter-by-top-headline (strip)
@@ -7572,8 +7640,9 @@ This last option is in practice not very useful, but it 
is available for
 consistency with the other filter commands."
   (interactive "P")
   (let* ((efforts (split-string
-                  (or (cdr (assoc (concat org-effort-property "_ALL")
-                                  org-global-properties))
+                  (or (cdr (assoc-string (concat org-effort-property "_ALL")
+                                         org-global-properties
+                                         t))
                       "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00")))
         ;; XXX: the following handles only up to 10 different
         ;; effort values.
@@ -7614,7 +7683,6 @@ consistency with the other filter commands."
               (if keep current nil)))
        (org-agenda-filter-apply org-agenda-effort-filter 'effort)))))
 
-
 (defun org-agenda-filter (&optional strip-or-accumulate)
   "Prompt for a general filter string and apply it to the agenda.
 
@@ -7665,11 +7733,18 @@ the variable `org-agenda-auto-exclude-function'."
     (let* ((tag-list (org-agenda-get-represented-tags))
           (category-list (org-agenda-get-represented-categories))
           (negate (equal strip-or-accumulate '(4)))
+          (cf (mapconcat #'identity org-agenda-category-filter ""))
+          (tf (mapconcat #'identity org-agenda-tag-filter ""))
+          (rpl-fn (lambda (c) (replace-regexp-in-string "^\\+" "" (or (car c) 
""))))
+          (ef (replace-regexp-in-string "^\\+" "" (or (car 
org-agenda-effort-filter) "")))
+          (rf (replace-regexp-in-string "^\\+" "" (or (car 
org-agenda-regexp-filter) "")))
+          (ff (concat cf tf ef (when (not (equal rf "")) (concat "/" rf "/"))))
           (f-string (completing-read
                      (concat
                       (if negate "Negative filter" "Filter")
                       " [+cat-tag<0:10-/regexp/]: ")
-                     'org-agenda-filter-completion-function))
+                     'org-agenda-filter-completion-function
+                     nil nil ff))
           (keep (or (if (string-match "^\\+[+-]" f-string)
                         (progn (setq f-string (substring f-string 1)) t))
                     (equal strip-or-accumulate '(16))))
@@ -7678,6 +7753,11 @@ the variable `org-agenda-auto-exclude-function'."
           (fe (if keep org-agenda-effort-filter))
           (fr (if keep org-agenda-regexp-filter))
           pm s)
+      ;; If the filter contains a double-quoted string, replace a
+      ;; single hyphen by the arbitrary and temporary string "~~~"
+      ;; to disambiguate such hyphens from syntactic ones.
+      (setq f-string (replace-regexp-in-string
+                     "\"\\([^\"]*\\)-\\([^\"]*\\)\"" "\"\\1~~~\\2\"" f-string))
       (while (string-match "^[ \t]*\\([-+]\\)?\\(\\([^-+<>=/ 
\t]+\\)\\|\\([<>=][0-9:]+\\)\\|\\(/\\([^/]+\\)/?\\)\\)" f-string)
        (setq pm (if (match-beginning 1) (match-string 1 f-string) "+"))
        (when negate
@@ -7685,12 +7765,15 @@ the variable `org-agenda-auto-exclude-function'."
        (cond
         ((match-beginning 3)
          ;; category or tag
-         (setq s (match-string 3 f-string))
+         (setq s (replace-regexp-in-string ; Remove the temporary special 
string.
+                  "~~~" "-" (match-string 3 f-string)))
          (cond
           ((member s tag-list)
            (add-to-list 'ft (concat pm s) 'append 'equal))
           ((member s category-list)
-           (add-to-list 'fc (concat pm s) 'append 'equal))
+           (add-to-list 'fc (concat pm ; Remove temporary double quotes.
+                                    (replace-regexp-in-string "\"\\(.*\\)\"" 
"\\1" s))
+                        'append 'equal))
           (t (message
               "`%s%s' filter ignored because tag/category is not represented"
               pm s))))
@@ -7705,15 +7788,15 @@ the variable `org-agenda-auto-exclude-function'."
       (and fc (org-agenda-filter-apply
               (setq org-agenda-category-filter fc) 'category))
       (and ft (org-agenda-filter-apply
-              (setq org-agenda-tag-filter ft) 'tag))
+              (setq org-agenda-tag-filter ft) 'tag 'expand))
       (and fe (org-agenda-filter-apply
               (setq org-agenda-effort-filter fe) 'effort))
       (and fr (org-agenda-filter-apply
               (setq org-agenda-regexp-filter fr) 'regexp))
-      )))
+      (run-hooks 'org-agenda-filter-hook))))
 
 (defun org-agenda-filter-completion-function (string _predicate &optional flag)
-  "Complete a complex filter string
+  "Complete a complex filter string.
 FLAG specifies the type of completion operation to perform.  This
 function is passed as a collection function to `completing-read',
 which see."
@@ -7732,8 +7815,9 @@ which see."
                          (org-agenda-get-represented-tags))))
      ((member operator '("<" ">" "="))
       (setq table (split-string
-                  (or (cdr (assoc (concat org-effort-property "_ALL")
-                                  org-global-properties))
+                  (or (cdr (assoc-string (concat org-effort-property "_ALL")
+                                         org-global-properties
+                                         t))
                       "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00")
                   " +")))
      (t (setq table nil)))
@@ -7760,7 +7844,9 @@ which see."
     (org-agenda-filter-show-all-top-filter))
   (when org-agenda-effort-filter
     (org-agenda-filter-show-all-effort))
-  (org-agenda-finalize))
+  (org-agenda-finalize)
+  (when (called-interactively-p 'interactive)
+    (message "All agenda filters removed")))
 
 (defun org-agenda-filter-by-tag (strip-or-accumulate &optional char exclude)
   "Keep only those lines in the agenda buffer that have a specific tag.
@@ -7860,8 +7946,12 @@ also press `-' or `+' to switch between filtering and 
excluding."
                                 pos 'org-category nil (point-max))))
            (push (get-text-property pos 'org-category) categories))
          (setq org-agenda-represented-categories
-               (nreverse (org-uniquify (delq nil categories))))))))
+               ;; Enclose category names with a hyphen in double
+               ;; quotes to process them specially in `org-agenda-filter'.
+               (mapcar (lambda (s) (if (string-match-p "-" s) (format "\"%s\"" 
s) s))
+                       (nreverse (org-uniquify (delq nil categories)))))))))
 
+(defvar org-tag-groups-alist-for-agenda)
 (defun org-agenda-get-represented-tags ()
   "Return a list of all tags used in this agenda buffer.
 These will be lower-case, for filtering."
@@ -7873,15 +7963,27 @@ These will be lower-case, for filtering."
                                 pos 'tags nil (point-max))))
            (setq tt (get-text-property pos 'tags))
            (if tt (push tt tags-lists)))
-         (setq org-agenda-represented-tags
+         (setq tags-lists
                (nreverse (org-uniquify
-                          (delq nil (apply 'append tags-lists)))))))))
+                          (delq nil (apply 'append tags-lists)))))
+         (dolist (tag tags-lists)
+           (mapc
+            (lambda (group)
+              (when (member tag (mapcar #'downcase group))
+                (push (downcase (car group)) tags-lists)))
+            org-tag-groups-alist-for-agenda))
+         (setq org-agenda-represented-tags tags-lists)))))
 
 (defun org-agenda-filter-make-matcher (filter type &optional expand)
   "Create the form that tests a line for agenda filter.  Optional
 argument EXPAND can be used for the TYPE tag and will expand the
 tags in the FILTER if any of the tags in FILTER are grouptags."
-  (let (f f1)
+  (let ((multi-pos-cats
+        (and (eq type 'category)
+             (string-match-p "\\+.*\\+"
+                             (mapconcat (lambda (cat) (substring cat 0 1))
+                                        filter ""))))
+       f f1)
     (cond
      ;; Tag filter
      ((eq type 'tag)
@@ -7925,7 +8027,7 @@ tags in the FILTER if any of the tags in FILTER are 
grouptags."
                     filter)))
       (dolist (x filter)
        (push (org-agenda-filter-effort-form x) f))))
-    (cons 'and (nreverse f))))
+    (cons (if multi-pos-cats 'or 'and) (nreverse f))))
 
 (defun org-agenda-filter-make-matcher-tag-exp (tags op)
   "Return a form associated to tag-expression TAGS.
@@ -7965,12 +8067,13 @@ If the line does not have an effort defined, return 
nil."
   ;; current line but is stored as a property in `txt'.
   (let ((effort (get-text-property 0 'effort-minutes (org-get-at-bol 'txt))))
     (funcall op
-            (or effort (if org-sort-agenda-noeffort-is-high 32767 -1))
+            (or effort (if org-agenda-sort-noeffort-is-high 32767 -1))
             value)))
 
 (defun org-agenda-filter-expand-tags (filter &optional no-operator)
   "Expand group tags in FILTER for the agenda.
-When NO-OPERATOR is non-nil, do not add the + operator to returned tags."
+When NO-OPERATOR is non-nil, do not add the + operator to
+returned tags."
   (if org-group-tags
       (let ((case-fold-search t) rtn)
        (mapc
@@ -7987,34 +8090,33 @@ When NO-OPERATOR is non-nil, do not add the + operator 
to returned tags."
     filter))
 
 (defun org-agenda-filter-apply (filter type &optional expand)
-  "Set FILTER as the new agenda filter and apply it.  Optional
-argument EXPAND can be used for the TYPE tag and will expand the
-tags in the FILTER if any of the tags in FILTER are grouptags."
+  "Set FILTER as the new agenda filter and apply it.
+Optional argument EXPAND can be used for the TYPE tag and will
+expand the tags in the FILTER if any of the tags in FILTER are
+grouptags."
   ;; Deactivate `org-agenda-entry-text-mode' when filtering
   (when org-agenda-entry-text-mode (org-agenda-entry-text-mode))
-  (let (tags cat txt)
-    (setq org-agenda-filter-form (org-agenda-filter-make-matcher
-                                 filter type expand))
-    ;; Only set `org-agenda-filtered-by-category' to t when a unique
-    ;; category is used as the filter:
-    (setq org-agenda-filtered-by-category
-         (and (eq type 'category)
-              (not (equal (substring (car filter) 0 1) "-"))))
-    (org-agenda-set-mode-name)
-    (save-excursion
-      (goto-char (point-min))
-      (while (not (eobp))
-       (if (org-get-at-bol 'org-hd-marker)
-           (progn
-             (setq tags (org-get-at-bol 'tags)
-                   cat (org-agenda-get-category)
-                   txt (org-get-at-bol 'txt))
-             (unless (eval org-agenda-filter-form)
-               (org-agenda-filter-hide-line type))
-             (beginning-of-line 2))
-         (beginning-of-line 2))))
-    (when (get-char-property (point) 'invisible)
-      (ignore-errors (org-agenda-previous-line)))))
+  (setq org-agenda-filter-form (org-agenda-filter-make-matcher
+                               filter type expand))
+  ;; Only set `org-agenda-filtered-by-category' to t when a unique
+  ;; category is used as the filter:
+  (setq org-agenda-filtered-by-category
+       (and (eq type 'category)
+            (not (equal (substring (car filter) 0 1) "-"))))
+  (org-agenda-set-mode-name)
+  (save-excursion
+    (goto-char (point-min))
+    (while (not (eobp))
+      (when (or (org-get-at-bol 'org-hd-marker)
+               (org-get-at-bol 'org-marker))
+       (let ((tags (org-get-at-bol 'tags))
+             (cat (org-agenda-get-category))
+             (txt (or (org-get-at-bol 'txt) "")))
+         (unless (eval org-agenda-filter-form)
+           (org-agenda-filter-hide-line type))))
+      (beginning-of-line 2)))
+  (when (get-char-property (point) 'invisible)
+    (ignore-errors (org-agenda-previous-line))))
 
 (defun org-agenda-filter-top-headline-apply (hl &optional negative)
   "Filter by top headline HL."
@@ -8034,16 +8136,17 @@ tags in the FILTER if any of the tags in FILTER are 
grouptags."
        org-agenda-filtered-by-top-headline t))
 
 (defun org-agenda-filter-hide-line (type)
-  "Hide lines with TYPE in the agenda buffer."
-  (let* ((b (max (point-min) (1- (point-at-bol))))
-        (e (point-at-eol)))
+  "If current line is TYPE, hide it in the agenda buffer."
+  (let* (buffer-invisibility-spec
+        (beg (max (point-min) (1- (point-at-bol))))
+        (end (point-at-eol)))
     (let ((inhibit-read-only t))
       (add-text-properties
-       b e `(invisible org-filtered org-filter-type ,type)))))
+       beg end `(invisible org-filtered org-filter-type ,type)))))
 
 (defun org-agenda-remove-filter (type)
-  (interactive)
   "Remove filter of type TYPE from the agenda buffer."
+  (interactive)
   (save-excursion
     (goto-char (point-min))
     (let ((inhibit-read-only t) pos)
@@ -8517,7 +8620,10 @@ log items, nothing else."
 When called with a prefix argument, include all archive files as well."
   (interactive "P")
   (setq org-agenda-archives-mode
-       (if with-files t (if org-agenda-archives-mode nil 'trees)))
+       (cond ((and with-files (eq org-agenda-archives-mode t)) nil)
+             (with-files t)
+             (org-agenda-archives-mode nil)
+             (t 'trees)))
   (org-agenda-set-mode-name)
   (org-agenda-redo)
   (message
@@ -8584,14 +8690,14 @@ When called with a prefix argument, include all archive 
files as well."
              (if (or org-agenda-category-filter
                      (get 'org-agenda-category-filter :preset-filter))
                  '(:eval (propertize
-                           (concat "["
+                          (concat "["
                                   (mapconcat
                                    'identity
                                    (append
                                     (get 'org-agenda-category-filter 
:preset-filter)
                                     org-agenda-category-filter)
                                    "")
-                                   "]")
+                                  "]")
                           'face 'org-agenda-filter-category
                           'help-echo "Category used in filtering")) "")
              (if (or org-agenda-tag-filter
@@ -8703,6 +8809,7 @@ When called with a prefix argument, include all archive 
files as well."
                     (org-agenda-error)))
         (buffer (marker-buffer marker))
         (pos (marker-position marker)))
+    ;; FIXME: use `org-switch-to-buffer-other-window'?
     (switch-to-buffer-other-window buffer)
     (widen)
     (push-mark)
@@ -8721,92 +8828,143 @@ When called with a prefix argument, include all 
archive files as well."
   "Normal hook run after an item has been shown from the agenda.
 Point is in the buffer where the item originated.")
 
+;; Defined later in org-agenda.el
+(defvar org-agenda-loop-over-headlines-in-active-region nil)
+
+(defun org-agenda-do-in-region (beg end cmd &optional arg force-arg delete)
+  "Between region BEG and END, call agenda command CMD.
+When optional argument ARG is non-nil or FORCE-ARG is `t', pass
+ARG to CMD.  When optional argument DELETE is non-nil, assume CMD
+deletes the agenda entry and don't move to the next entry."
+  (save-excursion
+    (goto-char beg)
+    (let ((mend (move-marker (make-marker) end))
+         (all (eq org-agenda-loop-over-headlines-in-active-region t))
+         (match (and (stringp org-agenda-loop-over-headlines-in-active-region)
+                     org-agenda-loop-over-headlines-in-active-region))
+         (level (and (eq org-agenda-loop-over-headlines-in-active-region 
'start-level)
+                     (org-get-at-bol 'level))))
+      (while (< (point) mend)
+       (let ((ov (make-overlay (point) (point-at-eol))))
+         (if (not (or all
+                      (and match (looking-at-p match))
+                      (eq level (org-get-at-bol 'level))))
+             (org-agenda-next-item 1)
+           (overlay-put ov 'face 'region)
+           (if (or arg force-arg) (funcall cmd arg) (funcall cmd))
+           (when (not delete) (org-agenda-next-item 1))
+           (delete-overlay ov)))))))
+
+;; org-agenda-[schedule,deadline,date-prompt,todo,[toggle]archive*,
+;; kill,set-property,set-effort] commands may loop over agenda
+;; entries.  Commands `org-agenda-set-tags' and `org-agenda-bulk-mark'
+;; use their own mechanisms on active regions.
+(defmacro org-agenda-maybe-loop (cmd arg force-arg delete &rest body)
+  "Maybe loop over agenda entries and perform CMD.
+Pass ARG, FORCE-ARG, DELETE and BODY to `org-agenda-do-in-region'."
+  (declare (debug t))
+  `(if (and (called-interactively-p 'any)
+           org-agenda-loop-over-headlines-in-active-region
+           (org-region-active-p))
+       (org-agenda-do-in-region
+       (region-beginning) (region-end) ,cmd ,arg ,force-arg ,delete)
+     ,@body))
+
 (defun org-agenda-kill ()
   "Kill the entry or subtree belonging to the current agenda entry."
   (interactive)
-  (or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
-  (let* ((bufname-orig (buffer-name))
-        (marker (or (org-get-at-bol 'org-marker)
-                    (org-agenda-error)))
-        (buffer (marker-buffer marker))
-        (pos (marker-position marker))
-        (type (org-get-at-bol 'type))
-        dbeg dend (n 0))
-    (org-with-remote-undo buffer
-      (with-current-buffer buffer
-       (save-excursion
-         (goto-char pos)
-         (if (and (derived-mode-p 'org-mode) (not (member type '("sexp"))))
-             (setq dbeg (progn (org-back-to-heading t) (point))
-                   dend (org-end-of-subtree t t))
-           (setq dbeg (point-at-bol)
-                 dend (min (point-max) (1+ (point-at-eol)))))
-         (goto-char dbeg)
-         (while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n)))))
-      (when (or (eq t org-agenda-confirm-kill)
-               (and (numberp org-agenda-confirm-kill)
-                    (> n org-agenda-confirm-kill)))
-       (let ((win-conf (current-window-configuration)))
-         (unwind-protect
-             (and
-              (prog2
-                  (org-agenda-tree-to-indirect-buffer nil)
-                  (not (y-or-n-p
-                        (format "Delete entry with %d lines in buffer \"%s\"? "
-                                n (buffer-name buffer))))
-                (kill-buffer org-last-indirect-buffer))
-              (error "Abort"))
-           (set-window-configuration win-conf))))
-      (let ((org-agenda-buffer-name bufname-orig))
-       (org-remove-subtree-entries-from-agenda buffer dbeg dend))
-      (with-current-buffer buffer (delete-region dbeg dend))
-      (message "Agenda item and source killed"))))
+  (or (eq major-mode 'org-agenda-mode) (user-error "Not in agenda"))
+  (org-agenda-maybe-loop
+   #'org-agenda-kill nil nil t
+   (let* ((bufname-orig (buffer-name))
+         (marker (or (org-get-at-bol 'org-marker)
+                     (org-agenda-error)))
+         (buffer (marker-buffer marker))
+         (pos (marker-position marker))
+         (type (org-get-at-bol 'type))
+         dbeg dend (n 0))
+     (org-with-remote-undo buffer
+       (with-current-buffer buffer
+        (save-excursion
+          (goto-char pos)
+          (if (and (derived-mode-p 'org-mode) (not (member type '("sexp"))))
+              (setq dbeg (progn (org-back-to-heading t) (point))
+                    dend (org-end-of-subtree t t))
+            (setq dbeg (point-at-bol)
+                  dend (min (point-max) (1+ (point-at-eol)))))
+          (goto-char dbeg)
+          (while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n)))))
+       (when (or (eq t org-agenda-confirm-kill)
+                (and (numberp org-agenda-confirm-kill)
+                     (> n org-agenda-confirm-kill)))
+        (let ((win-conf (current-window-configuration)))
+          (unwind-protect
+              (and
+               (prog2
+                   (org-agenda-tree-to-indirect-buffer nil)
+                   (not (y-or-n-p
+                         (format "Delete entry with %d lines in buffer \"%s\"? 
"
+                                 n (buffer-name buffer))))
+                 (kill-buffer org-last-indirect-buffer))
+               (error "Abort"))
+            (set-window-configuration win-conf))))
+       (let ((org-agenda-buffer-name bufname-orig))
+        (org-remove-subtree-entries-from-agenda buffer dbeg dend))
+       (with-current-buffer buffer (delete-region dbeg dend))
+       (message "Agenda item and source killed")))))
 
 (defvar org-archive-default-command) ; defined in org-archive.el
 (defun org-agenda-archive-default ()
   "Archive the entry or subtree belonging to the current agenda entry."
   (interactive)
   (require 'org-archive)
-  (org-agenda-archive-with org-archive-default-command))
+  (funcall-interactively
+   #'org-agenda-archive-with org-archive-default-command))
 
 (defun org-agenda-archive-default-with-confirmation ()
   "Archive the entry or subtree belonging to the current agenda entry."
   (interactive)
   (require 'org-archive)
-  (org-agenda-archive-with org-archive-default-command 'confirm))
+  (funcall-interactively
+   #'org-agenda-archive-with org-archive-default-command 'confirm))
 
 (defun org-agenda-archive ()
   "Archive the entry or subtree belonging to the current agenda entry."
   (interactive)
-  (org-agenda-archive-with 'org-archive-subtree))
+  (funcall-interactively
+   #'org-agenda-archive-with 'org-archive-subtree))
 
 (defun org-agenda-archive-to-archive-sibling ()
   "Move the entry to the archive sibling."
   (interactive)
-  (org-agenda-archive-with 'org-archive-to-archive-sibling))
+  (funcall-interactively
+   #'org-agenda-archive-with 'org-archive-to-archive-sibling))
 
 (defun org-agenda-archive-with (cmd &optional confirm)
   "Move the entry to the archive sibling."
   (interactive)
-  (or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
-  (let* ((bufname-orig (buffer-name))
-        (marker (or (org-get-at-bol 'org-marker)
-                    (org-agenda-error)))
-        (buffer (marker-buffer marker))
-        (pos (marker-position marker)))
-    (org-with-remote-undo buffer
-      (with-current-buffer buffer
-       (if (derived-mode-p 'org-mode)
-           (if (and confirm
-                    (not (y-or-n-p "Archive this subtree or entry? ")))
-               (error "Abort")
-             (save-window-excursion
-               (goto-char pos)
-               (let ((org-agenda-buffer-name bufname-orig))
-                 (org-remove-subtree-entries-from-agenda))
-               (org-back-to-heading t)
-               (funcall cmd)))
-         (error "Archiving works only in Org files"))))))
+  (or (eq major-mode 'org-agenda-mode) (user-error "Not in agenda"))
+  (org-agenda-maybe-loop
+   #'org-agenda-archive-with cmd nil t
+   (let* ((bufname-orig (buffer-name))
+         (marker (or (org-get-at-bol 'org-marker)
+                     (org-agenda-error)))
+         (buffer (marker-buffer marker))
+         (pos (marker-position marker)))
+     (org-with-remote-undo buffer
+       (with-current-buffer buffer
+        (if (derived-mode-p 'org-mode)
+            (if (and confirm
+                     (not (y-or-n-p "Archive this subtree or entry? ")))
+                (error "Abort")
+              (save-window-excursion
+                (goto-char pos)
+                (let ((org-agenda-buffer-name bufname-orig))
+                  (org-remove-subtree-entries-from-agenda))
+                (org-back-to-heading t)
+                (let ((org-archive-from-agenda t))
+                  (funcall cmd))))
+          (error "Archiving works only in Org files")))))))
 
 (defun org-remove-subtree-entries-from-agenda (&optional buf beg end)
   "Remove all lines in the agenda that correspond to a given subtree.
@@ -8893,12 +9051,16 @@ It also looks at the text of the entry itself."
                  (setq trg (and (string-match org-link-bracket-re l)
                                 (match-string 1 l)))
                  (if (or (not trg) (string-match org-link-any-re trg))
-                     (org-with-wide-buffer
-                      (goto-char marker)
-                      (when (search-forward l nil lkend)
-                        (goto-char (match-beginning 0))
-                        (org-open-at-point)))
+                     ;; Don't use `org-with-wide-buffer' here as
+                     ;; opening the link may result in moving the point
+                     (save-restriction
+                       (widen)
+                       (goto-char marker)
+                       (when (search-forward l nil lkend)
+                         (goto-char (match-beginning 0))
+                         (org-open-at-point)))
                    ;; This is an internal link, widen the buffer
+                   ;; FIXME: use `org-switch-to-buffer-other-window'?
                    (switch-to-buffer-other-window buffer)
                    (widen)
                    (goto-char marker)
@@ -9001,8 +9163,7 @@ The prefix arg selects the amount of information to 
display:
 1   just show the entry according to defaults.
 2   show the children view
 3   show the subtree view
-4   show the entire subtree and any LOGBOOK drawers
-5   show the entire subtree and any drawers
+4   show the entire subtree and any drawers
 With prefix argument FULL-ENTRY, make the entire entry visible
 if it was hidden in the outline."
   (interactive "p")
@@ -9032,13 +9193,7 @@ if it was hidden in the outline."
        (org-back-to-heading)
        (run-hook-with-args 'org-cycle-hook 'subtree))
       (message "Remote: SUBTREE"))
-     ((= more 4)
-      (outline-show-subtree)
-      (save-excursion
-       (org-back-to-heading)
-       (org-cycle-hide-drawers 'subtree '("LOGBOOK")))
-      (message "Remote: SUBTREE AND LOGBOOK"))
-     ((> more 4)
+     ((> more 3)
       (outline-show-subtree)
       (message "Remote: SUBTREE AND ALL DRAWERS")))
     (select-window win)))
@@ -9153,44 +9308,46 @@ This changes the line at point, all other lines in the 
agenda referring to
 the same tree node, and the headline of the tree node in the Org file."
   (interactive "P")
   (org-agenda-check-no-diary)
-  (let* ((col (current-column))
-        (marker (or (org-get-at-bol 'org-marker)
-                    (org-agenda-error)))
-        (buffer (marker-buffer marker))
-        (pos (marker-position marker))
-        (hdmarker (org-get-at-bol 'org-hd-marker))
-        (todayp (org-agenda-today-p (org-get-at-bol 'day)))
-        (inhibit-read-only t)
-        org-loop-over-headlines-in-active-region
-        org-agenda-headline-snapshot-before-repeat newhead just-one)
-    (org-with-remote-undo buffer
-      (with-current-buffer buffer
-       (widen)
-       (goto-char pos)
-       (org-show-context 'agenda)
-       (let ((current-prefix-arg arg))
-         (call-interactively 'org-todo))
-       (and (bolp) (forward-char 1))
-       (setq newhead (org-get-heading))
-       (when (and (bound-and-true-p
-                   org-agenda-headline-snapshot-before-repeat)
-                  (not (equal org-agenda-headline-snapshot-before-repeat
-                              newhead))
-                  todayp)
-         (setq newhead org-agenda-headline-snapshot-before-repeat
-               just-one t))
-       (save-excursion
-         (org-back-to-heading)
-         (move-marker org-last-heading-marker (point))))
-      (beginning-of-line 1)
-      (save-window-excursion
-       (org-agenda-change-all-lines newhead hdmarker 'fixface just-one))
-      (when (bound-and-true-p org-clock-out-when-done)
-       (string-match (concat "^" (regexp-opt org-done-keywords-for-agenda))
-                     newhead)
-       (org-agenda-unmark-clocking-task))
-      (org-move-to-column col)
-      (org-agenda-mark-clocking-task))))
+  (org-agenda-maybe-loop
+   #'org-agenda-todo arg nil nil
+   (let* ((col (current-column))
+         (marker (or (org-get-at-bol 'org-marker)
+                     (org-agenda-error)))
+         (buffer (marker-buffer marker))
+         (pos (marker-position marker))
+         (hdmarker (org-get-at-bol 'org-hd-marker))
+         (todayp (org-agenda-today-p (org-get-at-bol 'day)))
+         (inhibit-read-only t)
+         org-loop-over-headlines-in-active-region
+         org-agenda-headline-snapshot-before-repeat newhead just-one)
+     (org-with-remote-undo buffer
+       (with-current-buffer buffer
+        (widen)
+        (goto-char pos)
+        (org-show-context 'agenda)
+        (let ((current-prefix-arg arg))
+          (call-interactively 'org-todo))
+        (and (bolp) (forward-char 1))
+        (setq newhead (org-get-heading))
+        (when (and (bound-and-true-p
+                    org-agenda-headline-snapshot-before-repeat)
+                   (not (equal org-agenda-headline-snapshot-before-repeat
+                               newhead))
+                   todayp)
+          (setq newhead org-agenda-headline-snapshot-before-repeat
+                just-one t))
+        (save-excursion
+          (org-back-to-heading)
+          (move-marker org-last-heading-marker (point))))
+       (beginning-of-line 1)
+       (save-window-excursion
+        (org-agenda-change-all-lines newhead hdmarker 'fixface just-one))
+       (when (bound-and-true-p org-clock-out-when-done)
+        (string-match (concat "^" (regexp-opt org-done-keywords-for-agenda))
+                      newhead)
+        (org-agenda-unmark-clocking-task))
+       (org-move-to-column col)
+       (org-agenda-mark-clocking-task)))))
 
 (defun org-agenda-add-note (&optional arg)
   "Add a time-stamped note to the entry at point."
@@ -9329,9 +9486,9 @@ the same tree node, and the headline of the tree node in 
the Org file.
 Called with a universal prefix arg, show the priority instead of setting it."
   (interactive "P")
   (if (equal force-direction '(4))
-      (org-show-priority)
-    (unless org-enable-priority-commands
-      (error "Priority commands are disabled"))
+      (org-priority-show)
+    (unless org-priority-enable-commands
+      (user-error "Priority commands are disabled"))
     (org-agenda-check-no-diary)
     (let* ((col (current-column))
           (marker (or (org-get-at-bol 'org-marker)
@@ -9382,59 +9539,65 @@ Called with a universal prefix arg, show the priority 
instead of setting it."
   "Set a property for the current headline."
   (interactive)
   (org-agenda-check-no-diary)
-  (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
-                      (org-agenda-error)))
-        (buffer (marker-buffer hdmarker))
-        (pos (marker-position hdmarker))
-        (inhibit-read-only t)
-        newhead)
-    (org-with-remote-undo buffer
-      (with-current-buffer buffer
-       (widen)
-       (goto-char pos)
-       (org-show-context 'agenda)
-       (call-interactively 'org-set-property)))))
+  (org-agenda-maybe-loop
+   #'org-agenda-set-property nil nil nil
+   (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
+                       (org-agenda-error)))
+         (buffer (marker-buffer hdmarker))
+         (pos (marker-position hdmarker))
+         (inhibit-read-only t)
+         newhead)
+     (org-with-remote-undo buffer
+       (with-current-buffer buffer
+        (widen)
+        (goto-char pos)
+        (org-show-context 'agenda)
+        (call-interactively 'org-set-property))))))
 
 (defun org-agenda-set-effort ()
   "Set the effort property for the current headline."
   (interactive)
   (org-agenda-check-no-diary)
-  (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
-                      (org-agenda-error)))
-        (buffer (marker-buffer hdmarker))
-        (pos (marker-position hdmarker))
-        (inhibit-read-only t)
-        newhead)
-    (org-with-remote-undo buffer
-      (with-current-buffer buffer
-       (widen)
-       (goto-char pos)
-       (org-show-context 'agenda)
-       (call-interactively 'org-set-effort)
-       (end-of-line 1)
-       (setq newhead (org-get-heading)))
-      (org-agenda-change-all-lines newhead hdmarker))))
+  (org-agenda-maybe-loop
+   #'org-agenda-set-effort nil nil nil
+   (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
+                       (org-agenda-error)))
+         (buffer (marker-buffer hdmarker))
+         (pos (marker-position hdmarker))
+         (inhibit-read-only t)
+         newhead)
+     (org-with-remote-undo buffer
+       (with-current-buffer buffer
+        (widen)
+        (goto-char pos)
+        (org-show-context 'agenda)
+        (call-interactively 'org-set-effort)
+        (end-of-line 1)
+        (setq newhead (org-get-heading)))
+       (org-agenda-change-all-lines newhead hdmarker)))))
 
 (defun org-agenda-toggle-archive-tag ()
   "Toggle the archive tag for the current entry."
   (interactive)
   (org-agenda-check-no-diary)
-  (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
-                       (org-agenda-error)))
-        (buffer (marker-buffer hdmarker))
-        (pos (marker-position hdmarker))
-        (inhibit-read-only t)
-        newhead)
-    (org-with-remote-undo buffer
-      (with-current-buffer buffer
-       (widen)
-       (goto-char pos)
-       (org-show-context 'agenda)
-       (call-interactively 'org-toggle-archive-tag)
-       (end-of-line 1)
-       (setq newhead (org-get-heading)))
-      (org-agenda-change-all-lines newhead hdmarker)
-      (beginning-of-line 1))))
+  (org-agenda-maybe-loop
+   #'org-agenda-toggle-archive-tag nil nil nil
+   (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
+                       (org-agenda-error)))
+         (buffer (marker-buffer hdmarker))
+         (pos (marker-position hdmarker))
+         (inhibit-read-only t)
+         newhead)
+     (org-with-remote-undo buffer
+       (with-current-buffer buffer
+        (widen)
+        (goto-char pos)
+        (org-show-context 'agenda)
+        (call-interactively 'org-toggle-archive-tag)
+        (end-of-line 1)
+        (setq newhead (org-get-heading)))
+       (org-agenda-change-all-lines newhead hdmarker)
+       (beginning-of-line 1)))))
 
 (defun org-agenda-do-date-later (arg)
   (interactive "P")
@@ -9540,8 +9703,11 @@ Called with a universal prefix arg, show the priority 
instead of setting it."
       (goto-char (point-max))
       (while (not (bobp))
        (when (equal marker (org-get-at-bol 'org-marker))
-          (remove-text-properties (point-at-bol) (point-at-eol) '(display nil))
-         (org-move-to-column (- (window-width) (length stamp)) t)
+          (remove-text-properties (line-beginning-position)
+                                 (line-end-position)
+                                 '(display nil))
+         (org-move-to-column
+          (- (/ (window-width nil t) (window-font-width)) (length stamp)) t)
           (add-text-properties
           (1- (point)) (point-at-eol)
           (list 'display (org-add-props stamp nil
@@ -9556,18 +9722,20 @@ be used to request time specification in the time 
stamp."
   (interactive "P")
   (org-agenda-check-type t 'agenda)
   (org-agenda-check-no-diary)
-  (let* ((marker (or (org-get-at-bol 'org-marker)
-                    (org-agenda-error)))
-        (buffer (marker-buffer marker))
-        (pos (marker-position marker)))
-    (org-with-remote-undo buffer
-      (with-current-buffer buffer
-       (widen)
-       (goto-char pos)
-       (unless (org-at-timestamp-p 'lax) (error "Cannot find time stamp"))
-       (org-time-stamp arg (equal (char-after (match-beginning 0)) ?\[)))
-      (org-agenda-show-new-time marker org-last-changed-timestamp))
-    (message "Time stamp changed to %s" org-last-changed-timestamp)))
+  (org-agenda-maybe-loop
+   #'org-agenda-date-prompt arg t nil
+   (let* ((marker (or (org-get-at-bol 'org-marker)
+                     (org-agenda-error)))
+         (buffer (marker-buffer marker))
+         (pos (marker-position marker)))
+     (org-with-remote-undo buffer
+       (with-current-buffer buffer
+        (widen)
+        (goto-char pos)
+        (unless (org-at-timestamp-p 'lax) (error "Cannot find time stamp"))
+        (org-time-stamp arg (equal (char-after (match-beginning 0)) ?\[)))
+       (org-agenda-show-new-time marker org-last-changed-timestamp))
+     (message "Time stamp changed to %s" org-last-changed-timestamp))))
 
 (defun org-agenda-schedule (arg &optional time)
   "Schedule the item at point.
@@ -9575,20 +9743,22 @@ ARG is passed through to `org-schedule'."
   (interactive "P")
   (org-agenda-check-type t 'agenda 'todo 'tags 'search)
   (org-agenda-check-no-diary)
-  (let* ((marker (or (org-get-at-bol 'org-marker)
-                    (org-agenda-error)))
-        (type (marker-insertion-type marker))
-        (buffer (marker-buffer marker))
-        (pos (marker-position marker))
-        ts)
-    (set-marker-insertion-type marker t)
-    (org-with-remote-undo buffer
-      (with-current-buffer buffer
-       (widen)
-       (goto-char pos)
-       (setq ts (org-schedule arg time)))
-      (org-agenda-show-new-time marker ts " S"))
-    (message "%s" ts)))
+  (org-agenda-maybe-loop
+   #'org-agenda-schedule arg t nil
+   (let* ((marker (or (org-get-at-bol 'org-marker)
+                     (org-agenda-error)))
+         (type (marker-insertion-type marker))
+         (buffer (marker-buffer marker))
+         (pos (marker-position marker))
+         ts)
+     (set-marker-insertion-type marker t)
+     (org-with-remote-undo buffer
+       (with-current-buffer buffer
+        (widen)
+        (goto-char pos)
+        (setq ts (org-schedule arg time)))
+       (org-agenda-show-new-time marker ts " S"))
+     (message "%s" ts))))
 
 (defun org-agenda-deadline (arg &optional time)
   "Schedule the item at point.
@@ -9596,18 +9766,20 @@ ARG is passed through to `org-deadline'."
   (interactive "P")
   (org-agenda-check-type t 'agenda 'todo 'tags 'search)
   (org-agenda-check-no-diary)
-  (let* ((marker (or (org-get-at-bol 'org-marker)
-                    (org-agenda-error)))
-        (buffer (marker-buffer marker))
-        (pos (marker-position marker))
-        ts)
-    (org-with-remote-undo buffer
-      (with-current-buffer buffer
-       (widen)
-       (goto-char pos)
-       (setq ts (org-deadline arg time)))
-      (org-agenda-show-new-time marker ts " D"))
-    (message "%s" ts)))
+  (org-agenda-maybe-loop
+   #'org-agenda-deadline arg t nil
+   (let* ((marker (or (org-get-at-bol 'org-marker)
+                     (org-agenda-error)))
+         (buffer (marker-buffer marker))
+         (pos (marker-position marker))
+         ts)
+     (org-with-remote-undo buffer
+       (with-current-buffer buffer
+        (widen)
+        (goto-char pos)
+        (setq ts (org-deadline arg time)))
+       (org-agenda-show-new-time marker ts " D"))
+     (message "%s" ts))))
 
 (defun org-agenda-clock-in (&optional arg)
   "Start the clock on the currently selected item."
@@ -9635,7 +9807,7 @@ ARG is passed through to `org-deadline'."
   "Stop the currently running clock."
   (interactive)
   (unless (marker-buffer org-clock-marker)
-    (error "No running clock"))
+    (user-error "No running clock"))
   (let ((marker (make-marker)) (col (current-column)) newhead)
     (org-with-remote-undo (marker-buffer org-clock-marker)
       (with-current-buffer (marker-buffer org-clock-marker)
@@ -9791,13 +9963,13 @@ the resulting entry will not be shown.  When TEXT is 
empty, switch to
           (org-agenda-insert-diary-make-new-entry text))
         (org-insert-time-stamp (org-time-from-absolute
                                 (calendar-absolute-from-gregorian d1))
-                               nil nil nil nil time2))
+                               nil nil nil nil time2))
        (end-of-line 0))
       ((block) ;; Wrap this in (strictly unnecessary) parens because
        ;; otherwise the indentation gets confused by the
        ;; special meaning of 'block
        (when (> (calendar-absolute-from-gregorian d1)
-               (calendar-absolute-from-gregorian d2))
+               (calendar-absolute-from-gregorian d2))
         (setq d1 (prog1 d2 (setq d2 d1))))
        (if (eq org-agenda-insert-diary-strategy 'top-level)
           (org-agenda-insert-diary-as-top-level text)
@@ -10061,13 +10233,13 @@ When ARG is greater than one mark ARG lines."
       (goto-char (point-min))
       (goto-char (next-single-property-change (point) 'org-hd-marker))
       (while (and (re-search-forward regexp nil t)
-                 (setq txt-at-point (get-text-property (point) 'txt)))
+                 (setq txt-at-point
+                       (get-text-property (match-beginning 0) 'txt)))
        (if (get-char-property (point) 'invisible)
            (beginning-of-line 2)
-         (when (string-match regexp txt-at-point)
+         (when (string-match-p regexp txt-at-point)
            (setq entries-marked (1+ entries-marked))
            (call-interactively 'org-agenda-bulk-mark)))))
-
     (unless entries-marked
       (message "No entry matching this regexp."))))
 
@@ -10137,6 +10309,33 @@ bulk action."
   :version "24.1"
   :type 'boolean)
 
+(defcustom org-agenda-loop-over-headlines-in-active-region t
+  "Shall some commands act upon headlines in the active region?
+
+When set to t, some commands will be performed in all headlines
+within the active region.
+
+When set to `start-level', some commands will be performed in all
+headlines within the active region, provided that these headlines
+are of the same level than the first one.
+
+When set to a regular expression, those commands will be
+performed on the matching headlines within the active region.
+
+The list of commands is: `org-agenda-schedule',
+`org-agenda-deadline', `org-agenda-date-prompt',
+`org-agenda-todo', `org-agenda-archive*', `org-agenda-kill'.
+
+See `org-loop-over-headlines-in-active-region' for the equivalent
+option for Org buffers."
+  :type '(choice (const :tag "Don't loop" nil)
+                (const :tag "All headlines in active region" t)
+                (const :tag "In active region, headlines at the same level 
than the first one" start-level)
+                (regexp :tag "Regular expression matcher"))
+  :version "27.1"
+  :package-version '(Org . "9.4")
+  :group 'org-agenda)
+
 (defun org-agenda-bulk-action (&optional arg)
   "Execute an remote-editing action on all marked entries.
 The prefix arg is passed through to the command if possible."
@@ -10546,6 +10745,11 @@ when defining today."
          (org-extend-today-until (1+ hour)))
     (org-agenda-todo arg)))
 
+(defun org-agenda-ctrl-c-ctrl-c ()
+  "Set tags in agenda buffer."
+  (interactive)
+  (org-agenda-set-tags))
+
 (provide 'org-agenda)
 
 ;;; org-agenda.el ends here
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index b33025b..73cd83e 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.el
@@ -1,6 +1,6 @@
 ;;; org-archive.el --- Archiving for Org             -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -24,7 +24,7 @@
 ;;
 ;;; Commentary:
 
-;; This file contains the face definitions for Org.
+;; This file contains the archive functionality for Org.
 
 ;;; Code:
 
@@ -91,6 +91,25 @@ When a string, a %s formatter will be replaced by the file 
name."
          (const :tag "When archiving a subtree to the same file" infile)
          (const :tag "Always" t)))
 
+(defcustom org-archive-subtree-save-file-p 'from-org
+  "Conditionally save the archive file after archiving a subtree.
+This variable can be any of the following symbols:
+
+t              saves in all cases.
+`from-org'     prevents saving from an agenda-view.
+`from-agenda'  saves only when the archive is initiated from an agenda-view.
+nil            prevents saving in all cases.
+
+Note that, regardless of this value, the archive buffer is never
+saved when archiving into a location in the current buffer."
+  :group 'org-archive
+  :package-version '(Org . "9.4")
+  :type '(choice
+         (const :tag "Save archive buffer" t)
+         (const :tag "Save when archiving from agenda" from-agenda)
+         (const :tag "Save when archiving from an Org buffer" from-org)
+         (const :tag "Do not save")))
+
 (defcustom org-archive-save-context-info '(time file olpath category todo 
itags)
   "Parts of context info that should be stored as properties when archiving.
 When a subtree is moved to an archive file, it loses information given by
@@ -230,12 +249,20 @@ direct children of this heading."
                           ((find-buffer-visiting afile))
                           ((find-file-noselect afile))
                           (t (error "Cannot access file \"%s\"" afile))))
+            (org-odd-levels-only
+             (if (local-variable-p 'org-odd-levels-only (current-buffer))
+                 org-odd-levels-only
+               tr-org-odd-levels-only))
             level datetree-date datetree-subheading-p)
-       (when (string-match "\\`datetree/" heading)
-         ;; Replace with ***, to represent the 3 levels of headings the
-         ;; datetree has.
-         (setq heading (replace-regexp-in-string "\\`datetree/" "***" heading))
-         (setq datetree-subheading-p (> (length heading) 3))
+       (when (string-match "\\`datetree/\\(\\**\\)" heading)
+         ;; "datetree/" corresponds to 3 levels of headings.
+         (let ((nsub (length (match-string 1 heading))))
+           (setq heading (concat (make-string
+                                  (+ (if org-odd-levels-only 5 3)
+                                     (* (org-level-increment) nsub))
+                                  ?*)
+                                 (substring heading (match-end 0))))
+           (setq datetree-subheading-p (> nsub 0)))
          (setq datetree-date (org-date-to-gregorian
                               (or (org-entry-get nil "CLOSED" t) time))))
        (if (and (> (length heading) 0)
@@ -290,11 +317,7 @@ direct children of this heading."
                  (org-todo-kwd-alist tr-org-todo-kwd-alist)
                  (org-done-keywords tr-org-done-keywords)
                  (org-todo-regexp tr-org-todo-regexp)
-                 (org-todo-line-regexp tr-org-todo-line-regexp)
-                 (org-odd-levels-only
-                  (if (local-variable-p 'org-odd-levels-only (current-buffer))
-                      org-odd-levels-only
-                    tr-org-odd-levels-only)))
+                 (org-todo-line-regexp tr-org-todo-line-regexp))
              (goto-char (point-min))
              (org-show-all '(headings blocks))
              (if (and heading (not (and datetree-date (not 
datetree-subheading-p))))
@@ -361,6 +384,15 @@ direct children of this heading."
                     (point)
                     (concat "ARCHIVE_" (upcase (symbol-name item)))
                     value))))
+             ;; Save the buffer, if it is not the same buffer and
+             ;; depending on `org-archive-subtree-save-file-p'.
+             (unless (eq this-buffer buffer)
+               (when (or (eq org-archive-subtree-save-file-p t)
+                         (eq org-archive-subtree-save-file-p
+                             (if (boundp 'org-archive-from-agenda)
+                                 'from-agenda
+                               'from-org)))
+                 (save-buffer)))
              (widen))))
        ;; Here we are back in the original buffer.  Everything seems
        ;; to have worked.  So now run hooks, cut the tree and finish
diff --git a/lisp/org/org-attach-git.el b/lisp/org/org-attach-git.el
index 31945ff..2091cbc 100644
--- a/lisp/org/org-attach-git.el
+++ b/lisp/org/org-attach-git.el
@@ -1,6 +1,6 @@
 ;;; org-attach-git.el --- Automatic git commit extension to org-attach -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Original Author: John Wiegley <johnw@newartisans.com>
 ;; Restructurer: Gustav Wikström <gustav@whil.se>
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el
index 1ed305c..46decac 100644
--- a/lisp/org/org-attach.el
+++ b/lisp/org/org-attach.el
@@ -1,10 +1,9 @@
 ;;; org-attach.el --- Manage file attachments to Org outlines -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@newartisans.com>
 ;; Keywords: org data attachment
-
 ;; This file is part of GNU Emacs.
 ;;
 ;; GNU Emacs is free software: you can redistribute it and/or modify
@@ -41,6 +40,8 @@
 (require 'org-id)
 
 (declare-function dired-dwim-target-directory "dired-aux")
+(declare-function org-element-property "org-element" (property element))
+(declare-function org-element-type "org-element" (element))
 
 (defgroup org-attach nil
   "Options concerning attachments in Org mode."
@@ -129,8 +130,7 @@ Selective means to respect the inheritance setting in
   :type '(choice
          (const :tag "Don't use inheritance" nil)
          (const :tag "Inherit parent node attachments" t)
-         (const :tag "Respect org-use-property-inheritance" selective))
-  :type 'boolean)
+         (const :tag "Respect org-use-property-inheritance" selective)))
 
 (defcustom org-attach-store-link-p nil
   "Non-nil means store a link to a file when attaching it."
@@ -139,7 +139,8 @@ Selective means to respect the inheritance setting in
   :type '(choice
          (const :tag "Don't store link" nil)
          (const :tag "Link to origin location" t)
-         (const :tag "Link to the attach-dir location" attached)))
+         (const :tag "Attachment link to the attach-dir location" attached)
+         (const :tag "File link to the attach-dir location" file)))
 
 (defcustom org-attach-archive-delete nil
   "Non-nil means attachments are deleted upon archiving a subtree.
@@ -181,7 +182,7 @@ attachment folders based on ID."
   :type '(repeat (function :tag "Function with ID as input")))
 
 (defvar org-attach-after-change-hook nil
-  "Hook to be called when files have been added or removed to the attachment 
folder.")
+  "Hook called when files have been added or removed to the attachment 
folder.")
 
 (defvar org-attach-open-hook nil
   "Hook that is invoked by `org-attach-open'.
@@ -254,16 +255,16 @@ Shows a list of commands and prompts for another key to 
execute a command."
                       (get-text-property (point) 'org-marker)))
       (unless marker
        (error "No item in current line")))
-    (save-excursion
-      (when marker
-       (set-buffer (marker-buffer marker))
-       (goto-char marker))
-      (org-back-to-heading t)
+    (org-with-point-at marker
+      (org-back-to-heading-or-point-min t)
       (save-excursion
        (save-window-excursion
          (unless org-attach-expert
-           (with-output-to-temp-buffer "*Org Attach*"
-              (princ
+           (org-switch-to-buffer-other-window "*Org Attach*")
+           (erase-buffer)
+           (setq cursor-type nil
+             header-line-format "Use C-v, M-v, C-n or C-p to navigate.")
+           (insert
                (concat "Attachment folder:\n"
                       (or dir
                           "Can't find an existing attachment-folder")
@@ -286,11 +287,14 @@ Shows a list of commands and prompts for another key to 
execute a command."
                                      "Invalid `org-attach-commands' item: %S"
                                      entry))))
                                org-attach-commands
-                               "\n"))))))
+                               "\n")))))
          (org-fit-window-to-buffer (get-buffer-window "*Org Attach*"))
-         (message "Select command: [%s]"
-                  (concat (mapcar #'caar org-attach-commands)))
-         (setq c (read-char-exclusive))
+         (let ((msg (format "Select command: [%s]"
+                            (concat (mapcar #'caar org-attach-commands)))))
+           (message msg)
+           (while (and (setq c (read-char-exclusive))
+                       (memq c '(14 16 22 134217846)))
+             (org-scroll c t)))
          (and (get-buffer "*Org Attach*") (kill-buffer "*Org Attach*"))))
       (let ((command (cl-some (lambda (entry)
                                (and (memq c (nth 0 entry)) (nth 1 entry)))
@@ -457,14 +461,6 @@ DIR-property exists (that is different from the unset 
one)."
   "Turn the autotag off."
   (org-attach-tag 'off))
 
-(defun org-attach-store-link (file)
-  "Add a link to `org-stored-link' when attaching a file.
-Only do this when `org-attach-store-link-p' is non-nil."
-  (setq org-stored-links
-       (cons (list (org-attach-expand-link file)
-                   (file-name-nondirectory file))
-             org-stored-links)))
-
 (defun org-attach-url (url)
   (interactive "MURL of the file to attach: \n")
   (let ((org-attach-method 'url))
@@ -491,7 +487,7 @@ METHOD may be `cp', `mv', `ln', `lns' or `url' default 
taken from
 `org-attach-method'."
   (interactive
    (list
-    (read-file-name "File to keep as an attachment:"
+    (read-file-name "File to keep as an attachment: "
                     (or (progn
                           (require 'dired-aux)
                           (dired-dwim-target-directory))
@@ -501,22 +497,30 @@ METHOD may be `cp', `mv', `ln', `lns' or `url' default 
taken from
   (setq method (or method org-attach-method))
   (let ((basename (file-name-nondirectory file)))
     (let* ((attach-dir (org-attach-dir 'get-create))
-           (fname (expand-file-name basename attach-dir)))
+           (attach-file (expand-file-name basename attach-dir)))
       (cond
-       ((eq method 'mv) (rename-file file fname))
-       ((eq method 'cp) (copy-file file fname))
-       ((eq method 'ln) (add-name-to-file file fname))
-       ((eq method 'lns) (make-symbolic-link file fname))
-       ((eq method 'url) (url-copy-file file fname)))
+       ((eq method 'mv) (rename-file file attach-file))
+       ((eq method 'cp) (copy-file file attach-file))
+       ((eq method 'ln) (add-name-to-file file attach-file))
+       ((eq method 'lns) (make-symbolic-link file attach-file))
+       ((eq method 'url) (url-copy-file file attach-file)))
       (run-hook-with-args 'org-attach-after-change-hook attach-dir)
       (org-attach-tag)
       (cond ((eq org-attach-store-link-p 'attached)
-             (org-attach-store-link fname))
+            (push (list (concat "attachment:" (file-name-nondirectory 
attach-file))
+                        (file-name-nondirectory attach-file))
+                  org-stored-links))
             ((eq org-attach-store-link-p t)
-             (org-attach-store-link file)))
+             (push (list (concat "file:" file)
+                        (file-name-nondirectory file))
+                  org-stored-links))
+           ((eq org-attach-store-link-p 'file)
+            (push (list (concat "file:" attach-file)
+                        (file-name-nondirectory attach-file))
+                  org-stored-links)))
       (if visit-dir
           (dired attach-dir)
-        (message "File %S is now an attachment." basename)))))
+        (message "File %S is now an attachment" basename)))))
 
 (defun org-attach-attach-cp ()
   "Attach a file by copying it."
@@ -569,13 +573,18 @@ The attachment is created as an Emacs buffer."
 (defun org-attach-delete-all (&optional force)
   "Delete all attachments from the current outline node.
 This actually deletes the entire attachment directory.
-A safer way is to open the directory in dired and delete from there."
+A safer way is to open the directory in dired and delete from there.
+
+With prefix argument FORCE, directory will be recursively deleted
+with no prompts."
   (interactive "P")
   (let ((attach-dir (org-attach-dir)))
     (when (and attach-dir
               (or force
                   (yes-or-no-p "Really remove all attachments of this entry? 
")))
-      (delete-directory attach-dir (yes-or-no-p "Recursive?") t)
+      (delete-directory attach-dir
+                       (or force (yes-or-no-p "Recursive?"))
+                       t)
       (message "Attachment directory removed")
       (run-hook-with-args 'org-attach-after-change-hook attach-dir)
       (org-attach-untag))))
@@ -642,37 +651,37 @@ See `org-attach-open'."
 Basically, this adds the path to the attachment directory."
   (expand-file-name file (org-attach-dir)))
 
-(defun org-attach-expand-link (file)
-  "Return a file link pointing to the current entry's attachment file FILE.
-Basically, this adds the path to the attachment directory, and a \"file:\"
-prefix."
-  (concat "file:" (org-attach-expand file)))
+(defun org-attach-expand-links (_)
+  "Expand links in current buffer.
+It is meant to be added to `org-export-before-parsing-hook'."
+  (save-excursion
+    (while (re-search-forward "attachment:" nil t)
+      (let ((link (org-element-context)))
+       (when (and (eq 'link (org-element-type link))
+                  (string-equal "attachment"
+                                (org-element-property :type link)))
+         (let* ((description (and (org-element-property :contents-begin link)
+                                  (buffer-substring-no-properties
+                                   (org-element-property :contents-begin link)
+                                   (org-element-property :contents-end link))))
+                (file (org-element-property :path link))
+                (new-link (org-link-make-string
+                           (concat "file:" (org-attach-expand file))
+                           description)))
+           (goto-char (org-element-property :end link))
+           (skip-chars-backward " \t")
+           (delete-region (org-element-property :begin link) (point))
+           (insert new-link)))))))
+
+(defun org-attach-follow (file arg)
+  "Open FILE attachment.
+See `org-open-file' for details about ARG."
+  (org-link-open-as-file (org-attach-expand file) arg))
 
 (org-link-set-parameters "attachment"
-                         :follow #'org-attach-open-link
-                         :export #'org-attach-export-link
+                        :follow #'org-attach-follow
                          :complete #'org-attach-complete-link)
 
-(defun org-attach-open-link (link &optional in-emacs)
-  "Attachment link type LINK is expanded with the attached directory and 
opened.
-
-With optional prefix argument IN-EMACS, Emacs will visit the file.
-With a double \\[universal-argument] \\[universal-argument] \
-prefix arg, Org tries to avoid opening in Emacs
-and to use an external application to visit the file."
-  (interactive "P")
-  (let (line search)
-    (cond
-     ((string-match "::\\([0-9]+\\)\\'" link)
-      (setq line (string-to-number (match-string 1 link))
-           link (substring link 0 (match-beginning 0))))
-     ((string-match "::\\(.+\\)\\'" link)
-      (setq search (match-string 1 link)
-            link (substring link 0 (match-beginning 0)))))
-    (if (string-match "[*?{]" (file-name-nondirectory link))
-        (dired (org-attach-expand link))
-      (org-open-file (org-attach-expand link) in-emacs line search))))
-
 (defun org-attach-complete-link ()
   "Advise the user with the available files in the attachment directory."
   (let ((attach-dir (org-attach-dir)))
@@ -691,26 +700,6 @@ and to use an external application to visit the file."
           (t (concat "attachment:" file))))
       (error "No attachment directory exist"))))
 
-(defun org-attach-export-link (link description format)
-  "Translate attachment LINK from Org mode format to exported FORMAT.
-Also includes the DESCRIPTION of the link in the export."
-  (save-excursion
-    (let (path desc)
-      (cond
-       ((string-match "::\\([0-9]+\\)\\'" link)
-        (setq link (substring link 0 (match-beginning 0))))
-       ((string-match "::\\(.+\\)\\'" link)
-        (setq link (substring link 0 (match-beginning 0)))))
-      (setq path (file-relative-name (org-attach-expand link))
-            desc (or description link))
-      (pcase format
-        (`html (format "<a target=\"_blank\" href=\"%s\">%s</a>" path desc))
-        (`latex (format "\\href{%s}{%s}" path desc))
-        (`texinfo (format "@uref{%s,%s}" path desc))
-        (`ascii (format "%s (%s)" desc path))
-        (`md (format "[%s](%s)" desc path))
-        (_ path)))))
-
 (defun org-attach-archive-delete-maybe ()
   "Maybe delete subtree attachments when archiving.
 This function is called by `org-archive-hook'.  The option
@@ -758,6 +747,7 @@ Idea taken from `gnus-dired-attach'."
 
 
 (add-hook 'org-archive-hook 'org-attach-archive-delete-maybe)
+(add-hook 'org-export-before-parsing-hook 'org-attach-expand-links)
 
 (provide 'org-attach)
 
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el
index ace5127..f40f2b3 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -1,6 +1,6 @@
 ;;; org-capture.el --- Fast note taking in Org       -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -49,11 +49,13 @@
 
 (require 'cl-lib)
 (require 'org)
+(require 'org-refile)
 
 (declare-function org-at-encrypted-entry-p "org-crypt" ())
 (declare-function org-at-table-p "org-table" (&optional table-type))
 (declare-function org-clock-update-mode-line "org-clock" (&optional refresh))
 (declare-function org-datetree-find-date-create "org-datetree" (date &optional 
keep-restriction))
+(declare-function org-datetree-find-month-create (d &optional 
keep-restriction))
 (declare-function org-decrypt-entry "org-crypt" ())
 (declare-function org-element-at-point "org-element" ())
 (declare-function org-element-lineage "org-element" (datum &optional types 
with-self))
@@ -68,6 +70,7 @@
 
 (defvar dired-buffers)
 (defvar org-end-time-was-given)
+(defvar org-keyword-properties)
 (defvar org-remember-default-headline)
 (defvar org-remember-templates)
 (defvar org-store-link-plist)
@@ -156,14 +159,20 @@ description  A short string describing the template, will 
be shown during
 type         The type of entry.  Valid types are:
                entry       an Org node, with a headline.  Will be filed
                            as the child of the target entry or as a
-                           top-level entry.
+                           top-level entry.  Its default template is:
+                             \"* %?\n %a\"
                item        a plain list item, will be placed in the
-                           first plain list at the target
-                           location.
+                           first plain list at the target location.
+                           Its default template is:
+                             \"- %?\"
                checkitem   a checkbox item.  This differs from the
                            plain list item only in so far as it uses a
-                           different default template.
+                           different default template.  Its default
+                           template is:
+                             \"- [ ] %?\"
                table-line  a new line in the first table at target location.
+                           Its default template is:
+                             \"| %? |\"
                plain       text to be inserted as it is.
 
 target       Specification of where the captured item should be placed.
@@ -211,9 +220,10 @@ target       Specification of where the captured item 
should be placed.
                 Most general way: write your own function which both visits
                 the file and moves point to the right location
 
-template     The template for creating the capture item.  If you leave this
-             empty, an appropriate default template will be used.  See below
-             for more details.  Instead of a string, this may also be one of
+template     The template for creating the capture item.
+             If it is an empty string or nil, a default template based on
+             the entry type will be used (see the \"type\" section above).
+             Instead of a string, this may also be one of:
 
                  (file \"/path/to/template-file\")
                  (function function-returning-the-template)
@@ -236,15 +246,15 @@ properties are:
 
  :jump-to-captured   When set, jump to the captured entry when finished.
 
- :empty-lines        Set this to the number of lines the should be inserted
+ :empty-lines        Set this to the number of lines that should be inserted
                      before and after the new item.  Default 0, only common
                      other value is 1.
 
- :empty-lines-before Set this to the number of lines the should be inserted
+ :empty-lines-before Set this to the number of lines that should be inserted
                      before the new item.  Overrides :empty-lines for the
                      number lines inserted before.
 
- :empty-lines-after  Set this to the number of lines the should be inserted
+ :empty-lines-after  Set this to the number of lines that should be inserted
                      after the new item.  Overrides :empty-lines for the
                      number of lines inserted after.
 
@@ -260,7 +270,9 @@ properties are:
  :time-prompt        Prompt for a date/time to be used for date/week trees
                      and when filling the template.
 
- :tree-type          When `week', make a week tree instead of the month tree.
+ :tree-type          When `week', make a week tree instead of the month-day
+                     tree.  When `month', make a month tree instead of the
+                     month-day tree.
 
  :unnarrowed         Do not narrow the target buffer, simply show the
                      full buffer.  Default is to narrow it so that you
@@ -322,7 +334,7 @@ be replaced with content and expanded:
   %^L         Like %^C, but insert as link.
   %^{prop}p   Prompt the user for a value for property `prop'.
   %^{prompt}  Prompt the user for a string and replace this sequence with it.
-              A default value and a completion table ca be specified like this:
+              A default value and a completion table can be specified like 
this:
               %^{prompt|default|completion2|completion3|...}.
   %?          After completing the template, position cursor here.
   %\\1 ... %\\N Insert the text entered at the nth %^{prompt}, where N
@@ -625,7 +637,7 @@ of the day at point (if any) or the current HH:MM time."
     (setq org-overriding-default-time
          (org-get-cursor-date (equal goto 1))))
   (cond
-   ((equal goto '(4)) (org-capture-goto-target))
+   ((equal goto '(4))  (org-capture-goto-target keys))
    ((equal goto '(16)) (org-capture-goto-last-stored))
    (t
     (let* ((orig-buf (current-buffer))
@@ -698,21 +710,19 @@ of the day at point (if any) or the current HH:MM time."
 
 (defun org-capture-get-template ()
   "Get the template from a file or a function if necessary."
-  (let ((txt (org-capture-get :template)) file)
-    (cond
-     ((and (listp txt) (eq (car txt) 'file))
-      (if (file-exists-p
-          (setq file (expand-file-name (nth 1 txt) org-directory)))
-         (setq txt (org-file-contents file))
-       (setq txt (format "* Template file %s not found" (nth 1 txt)))))
-     ((and (listp txt) (eq (car txt) 'function))
-      (if (fboundp (nth 1 txt))
-         (setq txt (funcall (nth 1 txt)))
-       (setq txt (format "* Template function %s not found" (nth 1 txt)))))
-     ((not txt) (setq txt ""))
-     ((stringp txt))
-     (t (setq txt "* Invalid capture template")))
-    (org-capture-put :template txt)))
+  (org-capture-put
+   :template
+   (pcase (org-capture-get :template)
+     (`nil "")
+     ((and (pred stringp) template) template)
+     (`(file ,file)
+      (let ((filename (expand-file-name file org-directory)))
+       (if (file-exists-p filename) (org-file-contents filename)
+         (format "* Template file %S not found" file))))
+     (`(function ,f)
+      (if (functionp f) (funcall f)
+       (format "* Template function %S not found" f)))
+     (_ "* Invalid capture template"))))
 
 (defun org-capture-finalize (&optional stay-with-capture)
   "Finalize the capture process.
@@ -727,6 +737,11 @@ captured item after finalizing."
 
   (run-hooks 'org-capture-prepare-finalize-hook)
 
+  ;; Update `org-capture-plist' with the buffer-local value.  Since
+  ;; captures can be run concurrently, this is to ensure that
+  ;; `org-capture-after-finalize-hook' accesses the proper plist.
+  (setq org-capture-plist org-capture-current-plist)
+
   ;; Did we start the clock in this capture buffer?
   (when (and org-capture-clock-was-started
             org-clock-marker
@@ -996,11 +1011,13 @@ Store them in the capture property list."
           (org-capture-put-target-region-and-position)
           (widen)
           ;; Make a date/week tree entry, with the current date (or
-          ;; yesterday, if we are extending dates for a couple of hours)
+          ;; yesterday, if we are extending dates for a couple of
+          ;; hours)
           (funcall
-           (if (eq (org-capture-get :tree-type) 'week)
-               #'org-datetree-find-iso-week-create
-             #'org-datetree-find-date-create)
+           (pcase (org-capture-get :tree-type)
+             (`week #'org-datetree-find-iso-week-create)
+             (`month #'org-datetree-find-month-create)
+             (_ #'org-datetree-find-date-create))
            (calendar-gregorian-from-absolute
             (cond
              (org-overriding-default-time
@@ -1058,7 +1075,7 @@ Store them in the capture property list."
                    (org-capture-put-target-region-and-position)
                    (widen)
                    (goto-char org-clock-hd-marker))
-          (error "No running clock that could be used as capture target")))
+          (user-error "No running clock that could be used as capture 
target")))
        (target (error "Invalid capture target specification: %S" target)))
 
       (org-capture-put :buffer (current-buffer)
@@ -1115,8 +1132,8 @@ may have been stored before."
     (`plain (org-capture-place-plain-text))
     (`item (org-capture-place-item))
     (`checkitem (org-capture-place-item)))
-  (org-capture-mode 1)
-  (setq-local org-capture-current-plist org-capture-plist))
+  (setq-local org-capture-current-plist org-capture-plist)
+  (org-capture-mode 1))
 
 (defun org-capture-place-entry ()
   "Place the template as a new Org entry."
@@ -1129,7 +1146,14 @@ may have been stored before."
     (when exact-position (goto-char exact-position))
     (cond
      ;; Force insertion at point.
-     ((org-capture-get :insert-here) nil)
+     (insert-here?
+      ;; FIXME: level should probably set directly within (let ...).
+      (setq level (org-get-valid-level
+                   (if (or (org-at-heading-p)
+                           (ignore-errors
+                            (save-excursion (org-back-to-heading t))))
+                       (org-outline-level)
+                     1))))
      ;; Insert as a child of the current entry.
      ((org-capture-get :target-entry-p)
       (setq level (org-get-valid-level
@@ -1150,14 +1174,11 @@ may have been stored before."
          (when insert-here? (narrow-to-region beg beg))
          (org-paste-subtree level template 'for-yank))
        (org-capture-position-for-last-stored beg)
-       (let ((end (if (org-at-heading-p) (line-end-position 0) (point))))
-         (org-capture-empty-lines-after)
-         (unless (org-at-heading-p) (outline-next-heading))
-         (org-capture-mark-kill-region origin (point))
-         (org-capture-narrow beg end)
-         (when (or (search-backward "%?" beg t)
-                   (search-forward "%?" end t))
-           (replace-match "")))))))
+       (org-capture-empty-lines-after)
+       (unless (org-at-heading-p) (outline-next-heading))
+       (org-capture-mark-kill-region origin (point))
+       (org-capture-narrow beg (if (eobp) (point) (1- (point))))
+       (org-capture--position-cursor beg (point))))))
 
 (defun org-capture-place-item ()
   "Place the template as a new plain list item."
@@ -1269,9 +1290,7 @@ may have been stored before."
        ;; not narrow at the beginning of the next line, possibly
        ;; altering its structure (e.g., when it is a headline).
        (org-capture-narrow beg (1- end))
-       (when (or (search-backward "%?" beg t)
-                 (search-forward "%?" end t))
-         (replace-match ""))))))
+       (org-capture--position-cursor beg end)))))
 
 (defun org-capture-place-table-line ()
   "Place the template as a table line."
@@ -1353,9 +1372,7 @@ may have been stored before."
        ;; TEXT is guaranteed to end with a newline character.  Ignore
        ;; it when narrowing so as to not alter data on the next line.
        (org-capture-narrow beg (1- end))
-       (when (or (search-backward "%?" beg t)
-                 (search-forward "%?" end t))
-         (replace-match ""))))))
+       (org-capture--position-cursor beg (1- end))))))
 
 (defun org-capture-place-plain-text ()
   "Place the template plainly.
@@ -1390,9 +1407,7 @@ Of course, if exact position has been required, just put 
it there."
        (org-capture-empty-lines-after)
        (org-capture-mark-kill-region origin (point))
        (org-capture-narrow beg end)
-       (when (or (search-backward "%?" beg t)
-                 (search-forward "%?" end t))
-         (replace-match ""))))))
+       (org-capture--position-cursor beg end)))))
 
 (defun org-capture-mark-kill-region (beg end)
   "Mark the region that will have to be killed when aborting capture."
@@ -1438,8 +1453,15 @@ Of course, if exact position has been required, just put 
it there."
 (defun org-capture-narrow (beg end)
   "Narrow, unless configuration says not to narrow."
   (unless (org-capture-get :unnarrowed)
-    (narrow-to-region beg end)
-    (goto-char beg)))
+    (narrow-to-region beg end)))
+
+(defun org-capture--position-cursor (beg end)
+  "Move point to first \"%?\" location or at start of template.
+BEG and END are buffer positions at the beginning and end position
+of the template."
+  (goto-char beg)
+  (when (search-forward "%?" end t)
+    (replace-match "")))
 
 (defun org-capture-empty-lines-before (&optional n)
   "Set the correct number of empty lines before the insertion point.
@@ -1736,11 +1758,11 @@ The template may still contain \"%?\" for cursor 
positioning."
                         (_ (error "Invalid `org-capture--clipboards' value: %S"
                                   org-capture--clipboards)))))
                    ("p"
-                    ;; We remove file properties inherited from
+                    ;; We remove keyword properties inherited from
                     ;; target buffer so `org-read-property-value' has
                     ;; a chance to find allowed values in sub-trees
                     ;; from the target buffer.
-                    (setq-local org-file-properties nil)
+                    (setq-local org-keyword-properties nil)
                     (let* ((origin (set-marker (make-marker)
                                                (org-capture-get :pos)
                                                (org-capture-get :buffer)))
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 06df2d4..2073b33 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1,6 +1,6 @@
 ;;; org-clock.el --- The time clocking code for Org mode -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -35,11 +35,17 @@
 (declare-function notifications-notify "notifications" (&rest params))
 (declare-function org-element-property "org-element" (property element))
 (declare-function org-element-type "org-element" (element))
+(declare-function org-inlinetask-at-task-p "org-inlinetask" ())
+(declare-function org-inlinetask-goto-beginning "org-inlinetask" ())
+(declare-function org-inlinetask-goto-end "org-inlinetask" ())
+(declare-function org-inlinetask-in-task-p "org-inlinetask" ())
 (declare-function org-link-display-format "ol" (s))
 (declare-function org-link-heading-search-string "ol" (&optional string))
 (declare-function org-link-make-string "ol" (link &optional description))
 (declare-function org-table-goto-line "org-table" (n))
 (declare-function org-dynamic-block-define "org" (type func))
+(declare-function w32-notification-notify "w32fns.c" (&rest params))
+(declare-function w32-notification-close "w32fns.c" (&rest params))
 
 (defvar org-frame-title-format-backup nil)
 (defvar org-state)
@@ -273,6 +279,15 @@ also using the face `org-mode-line-clock-overrun'."
          (const :tag "Just mark the time string" nil)
          (string :tag "Text to prepend")))
 
+(defcustom org-show-notification-timeout 3
+  "Number of seconds to wait before closing Org notifications.
+This is applied to notifications sent with `notifications-notify'
+and `w32-notification-notify' only, not other mechanisms possibly
+set through `org-show-notification-handler'."
+  :group 'org-clock
+  :package-version '(Org . "9.4")
+  :type 'integer)
+
 (defcustom org-show-notification-handler nil
   "Function or program to send notification with.
 The function or program will be called with the notification
@@ -457,6 +472,19 @@ Valid values are: `today', `yesterday', `thisweek', 
`lastweek',
                 (const :tag "Select range interactively" interactive))
   :safe #'symbolp)
 
+(defcustom org-clock-auto-clockout-timer nil
+  "Timer for auto clocking out when Emacs is idle.
+When set to a number, auto clock out the currently clocked in
+task after this number of seconds of idle time.
+
+This is only effective when `org-clock-auto-clockout-insinuate'
+is added to the user configuration."
+  :group 'org-clock
+  :package-version '(Org . "9.4")
+  :type '(choice
+         (integer :tag "Clock out after Emacs is idle for X seconds")
+         (const :tag "Never auto clock out" nil)))
+
 (defvar org-clock-in-prepare-hook nil
   "Hook run when preparing the clock.
 This hook is run before anything happens to the task that
@@ -698,7 +726,8 @@ If not, show simply the clocked time like 01:50."
   (save-excursion
     (let ((end (save-excursion (org-end-of-subtree))))
       (when (re-search-forward (concat org-clock-string
-                                      ".*\\]--\\(\\[[^]]+\\]\\)") end t)
+                                      ".*\\]--\\(\\[[^]]+\\]\\)")
+                              end t)
        (org-time-string-to-time (match-string 1))))))
 
 (defun org-clock-update-mode-line (&optional refresh)
@@ -725,7 +754,8 @@ menu\nmouse-2 will jump to task"))
       (setq org-mode-line-string
            (concat (propertize
                     org-clock-task-overrun-text
-                    'face 'org-mode-line-clock-overrun) org-mode-line-string)))
+                    'face 'org-mode-line-clock-overrun)
+                   org-mode-line-string)))
   (force-mode-line-update))
 
 (defun org-clock-get-clocked-time ()
@@ -808,15 +838,26 @@ If PLAY-SOUND is non-nil, it overrides `org-clock-sound'."
   "Show notification.
 Use `org-show-notification-handler' if defined,
 use libnotify if available, or fall back on a message."
+  (ignore-errors (require 'notifications))
   (cond ((functionp org-show-notification-handler)
         (funcall org-show-notification-handler notification))
        ((stringp org-show-notification-handler)
         (start-process "emacs-timer-notification" nil
                        org-show-notification-handler notification))
+       ((fboundp 'w32-notification-notify)
+        (let ((id (w32-notification-notify
+                   :title "Org mode message"
+                   :body notification
+                   :urgency 'low)))
+          (run-with-timer
+           org-show-notification-timeout
+           nil
+           (lambda () (w32-notification-close id)))))
        ((fboundp 'notifications-notify)
         (notifications-notify
          :title "Org mode message"
          :body notification
+         :timeout (* org-show-notification-timeout 1000)
          ;; FIXME how to link to the Org icon?
          ;; :app-icon "~/.emacs.d/icons/mail.png"
          :urgency 'low))
@@ -859,7 +900,8 @@ If CLOCK-SOUND is non-nil, it overrides `org-clock-sound'."
        (goto-char (point-min))
        (while (re-search-forward org-clock-re nil t)
          (push (cons (copy-marker (match-end 1) t)
-                     (org-time-string-to-time (match-string 1))) clocks))))
+                     (org-time-string-to-time (match-string 1)))
+               clocks))))
     clocks))
 
 (defsubst org-is-active-clock (clock)
@@ -983,7 +1025,7 @@ CLOCK is a cons cell of the form (MARKER START-TIME)."
               (let ((element (org-element-at-point)))
                 (when (eq (org-element-type element) 'drawer)
                   (when (> (org-element-property :end element) (car clock))
-                    (org-flag-drawer nil element))
+                    (org-hide-drawer-toggle 'off nil element))
                   (throw 'exit nil)))))))))))
 
 (defun org-clock-resolve (clock &optional prompt-fn last-valid fail-quietly)
@@ -1022,6 +1064,9 @@ k/K      Keep X minutes of the idle time (default is 
all).  If this
          that many minutes after the time that idling began, and then
          clocked back in at the present time.
 
+t/T      Like `k', but will ask you to specify a time (when you got
+         distracted away), instead of a number of minutes.
+
 g/G      Indicate that you \"got back\" X minutes ago.  This is quite
          different from `k': it clocks you out from the beginning of
          the idle period and clock you back in X minutes ago.
@@ -1041,19 +1086,24 @@ to be CLOCKED OUT."))))
                (while (or (null char-pressed)
                           (and (not (memq char-pressed
                                           '(?k ?K ?g ?G ?s ?S ?C
-                                               ?j ?J ?i ?q)))
+                                               ?j ?J ?i ?q ?t ?T)))
                                (or (ding) t)))
                  (setq char-pressed
                        (read-char (concat (funcall prompt-fn clock)
-                                          " [jkKgGSscCiq]? ")
+                                          " [jkKtTgGSscCiq]? ")
                                   nil 45)))
                (and (not (memq char-pressed '(?i ?q))) char-pressed)))))
         (default
           (floor (org-time-convert-to-integer (org-time-since last-valid))
                  60))
         (keep
-         (and (memq ch '(?k ?K))
-              (read-number "Keep how many minutes? " default)))
+         (or (and (memq ch '(?k ?K))
+                  (read-number "Keep how many minutes? " default))
+             (and (memq ch '(?t ?T))
+                  (floor
+                   (/ (float-time
+                       (org-time-subtract (org-read-date t t) last-valid))
+                      60)))))
         (gotback
          (and (memq ch '(?g ?G))
               (read-number "Got back how many minutes ago? " default)))
@@ -1068,7 +1118,7 @@ to be CLOCKED OUT."))))
          (org-clock-resolve-clock clock 'now nil t nil fail-quietly))
       (org-clock-jump-to-current-clock clock))
      ((or (null ch)
-         (not (memq ch '(?k ?K ?g ?G ?s ?S ?C))))
+         (not (memq ch '(?k ?K ?g ?G ?s ?S ?C ?t ?T))))
       (message ""))
      (t
       (org-clock-resolve-clock
@@ -1092,7 +1142,7 @@ to be CLOCKED OUT."))))
              (t
               (error "Unexpected, please report this as a bug")))
        (and gotback last-valid)
-       (memq ch '(?K ?G ?S))
+       (memq ch '(?K ?G ?S ?T))
        (and start-over
            (not (memq ch '(?K ?G ?S ?C))))
        fail-quietly)))))
@@ -1315,7 +1365,6 @@ the default behavior."
          (t
           (insert-before-markers "\n")
           (backward-char 1)
-          (org-indent-line)
           (when (and (save-excursion
                        (end-of-line 0)
                        (org-in-item-p)))
@@ -1340,7 +1389,8 @@ the default behavior."
                     start-time
                     (org-current-time org-clock-rounding-minutes t)))
           (setq ts (org-insert-time-stamp org-clock-start-time
-                                          'with-hm 'inactive))))
+                                          'with-hm 'inactive))
+          (org-indent-line)))
         (move-marker org-clock-marker (point) (buffer-base-buffer))
         (move-marker org-clock-hd-marker
                      (save-excursion (org-back-to-heading t) (point))
@@ -1375,6 +1425,26 @@ the default behavior."
         (message "Clock starts at %s - %s" ts org--msg-extra)
         (run-hooks 'org-clock-in-hook))))))
 
+(defun org-clock-auto-clockout ()
+  "Clock out the currently clocked in task if Emacs is idle.
+See `org-clock-auto-clockout-timer' to set the idle time span.
+
+This is only effective when `org-clock-auto-clockout-insinuate'
+is present in the user configuration."
+  (when (and (numberp org-clock-auto-clockout-timer)
+            org-clock-current-task)
+    (run-with-idle-timer
+     org-clock-auto-clockout-timer nil #'org-clock-out)))
+
+;;;###autoload
+(defun org-clock-toggle-auto-clockout ()
+  (interactive)
+  (if (memq 'org-clock-auto-clockout org-clock-in-hook)
+      (progn (remove-hook 'org-clock-in-hook #'org-clock-auto-clockout)
+            (message "Auto clock-out after idle time turned off"))
+    (add-hook 'org-clock-in-hook #'org-clock-auto-clockout t)
+    (message "Auto clock-out after idle time turned on")))
+
 ;;;###autoload
 (defun org-clock-in-last (&optional arg)
   "Clock in the last closed clocked item.
@@ -1512,7 +1582,7 @@ line and position cursor in that line."
              (insert ":" drawer ":\n:END:\n")
              (org-indent-region beg (point))
              (org-flag-region
-              (line-end-position -1) (1- (point)) t 'org-hide-drawer)
+              (line-end-position -1) (1- (point)) t 'outline)
              (forward-line -1))))
         ;; When a clock drawer needs to be created because of the
         ;; number of clock items or simply if it is missing, collect
@@ -1537,7 +1607,7 @@ line and position cursor in that line."
            (let ((end (point-marker)))
              (goto-char beg)
              (save-excursion (insert ":" drawer ":\n"))
-             (org-flag-region (line-end-position) (1- end) t 'org-hide-drawer)
+             (org-flag-region (line-end-position) (1- end) t 'outline)
              (org-indent-region (point) end)
              (forward-line)
              (unless org-log-states-order-reversed
@@ -1579,7 +1649,7 @@ to, overriding the existing value of 
`org-clock-out-switch-to-state'."
             org-clock-out-switch-to-state))
          (now (org-current-time org-clock-rounding-minutes))
          ts te s h m remove)
-      (setq org-clock-out-time now)
+      (setq org-clock-out-time (or at-time now))
       (save-excursion ; Do not replace this with `with-current-buffer'.
        (with-no-warnings (set-buffer (org-clocking-buffer)))
        (save-restriction
@@ -1724,7 +1794,7 @@ Optional argument N tells to change by that many units."
          (delq 'org-mode-line-string global-mode-string))
     (org-clock-restore-frame-title-format)
     (force-mode-line-update)
-    (error "No active clock"))
+    (user-error "No active clock"))
   (save-excursion    ; Do not replace this with `with-current-buffer'.
     (with-no-warnings (set-buffer (org-clocking-buffer)))
     (goto-char org-clock-marker)
@@ -1753,14 +1823,14 @@ With prefix arg SELECT, offer recently clocked tasks 
for selection."
         (m (cond
             (select
              (or (org-clock-select-task "Select task to go to: ")
-                 (error "No task selected")))
+                 (user-error "No task selected")))
             ((org-clocking-p) org-clock-marker)
             ((and org-clock-goto-may-find-recent-task
                   (car org-clock-history)
                   (marker-buffer (car org-clock-history)))
              (setq recent t)
              (car org-clock-history))
-            (t (error "No active or recent clock task")))))
+            (t (user-error "No active or recent clock task")))))
     (pop-to-buffer-same-window (marker-buffer m))
     (if (or (< m (point-min)) (> m (point-max))) (widen))
     (goto-char m)
@@ -1890,7 +1960,12 @@ PROPNAME lets you set a custom text property instead of 
:org-clock-minutes."
   "Return time, clocked on current item in total."
   (save-excursion
     (save-restriction
-      (org-narrow-to-subtree)
+      (if (and (featurep 'org-inlinetask)
+              (or (org-inlinetask-at-task-p)
+                  (org-inlinetask-in-task-p)))
+         (narrow-to-region (save-excursion (org-inlinetask-goto-beginning) 
(point))
+                           (save-excursion (org-inlinetask-goto-end) (point)))
+       (org-narrow-to-subtree))
       (org-clock-sum tstart)
       org-clock-file-total-minutes)))
 
@@ -2067,7 +2142,10 @@ in the buffer and update it."
     (start (goto-char start)))
   (org-update-dblock))
 
-(org-dynamic-block-define "clocktable" #'org-clock-report)
+;;;###autoload
+(eval-after-load 'org
+  '(progn
+     (org-dynamic-block-define "clocktable" #'org-clock-report)))
 
 (defun org-day-of-week (day month year)
   "Return the day of the week as an integer."
@@ -2310,7 +2388,7 @@ the currently selected interval size."
   (save-excursion
     (goto-char (point-at-bol))
     (if (not (looking-at "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>.*?:block[ 
\t]+\\(\\S-+\\)"))
-       (error "Line needs a :block definition before this command works")
+       (user-error "Line needs a :block definition before this command works")
       (let* ((b (match-beginning 1)) (e (match-end 1))
             (s (match-string 1))
             block shift ins y mw d date wp m)
@@ -2369,7 +2447,7 @@ the currently selected interval size."
                       (encode-time 0 0 0 1 (+ mw n) y))))
           (y
            (setq ins (number-to-string (+ y n))))))
-        (t (error "Cannot shift clocktable block")))
+        (t (user-error "Cannot shift clocktable block")))
        (when ins
          (goto-char b)
          (insert ins)
@@ -2384,20 +2462,21 @@ the currently selected interval size."
   (setq params (org-combine-plists org-clocktable-defaults params))
   (catch 'exit
     (let* ((scope (plist-get params :scope))
+          (base-buffer (org-base-buffer (current-buffer)))
           (files (pcase scope
                    (`agenda
                     (org-agenda-files t))
                    (`agenda-with-archives
                     (org-add-archive-files (org-agenda-files t)))
                    (`file-with-archives
-                    (and buffer-file-name
-                         (org-add-archive-files (list buffer-file-name))))
+                    (let ((base-file (buffer-file-name base-buffer)))
+                      (and base-file
+                           (org-add-archive-files (list base-file)))))
                    ((or `nil `file `subtree `tree
                         (and (pred symbolp)
                              (guard (string-match "\\`tree\\([0-9]+\\)\\'"
                                                   (symbol-name scope)))))
-                    (or (buffer-file-name (buffer-base-buffer))
-                        (current-buffer)))
+                    base-buffer)
                    ((pred functionp) (funcall scope))
                    ((pred consp) scope)
                    (_ (user-error "Unknown scope: %S" scope))))
@@ -2421,7 +2500,7 @@ the currently selected interval size."
       (when step
        ;; Write many tables, in steps
        (unless (or block (and ts te))
-         (error "Clocktable `:step' can only be used with `:block' or 
`:tstart,:end'"))
+         (user-error "Clocktable `:step' can only be used with `:block' or 
`:tstart, :end'"))
        (org-clocktable-steps params)
        (throw 'exit nil))
 
@@ -2527,7 +2606,7 @@ from the dynamic block definition."
            (guard (string-match-p "\\`[0-9]+!\\'" (symbol-name narrow))))
        (setq narrow-cut-p t)
        (setq narrow (string-to-number (symbol-name narrow))))
-      (_ (error "Invalid value %s of :narrow property in clock table" narrow)))
+      (_ (user-error "Invalid value %s of :narrow property in clock table" 
narrow)))
 
     ;; Now we need to output this table stuff.
     (goto-char ipos)
@@ -2718,6 +2797,7 @@ a number of clock tables."
           (pcase step
             (`day "Daily report: ")
             (`week "Weekly report starting on: ")
+            (`semimonth "Semimonthly report starting on: ")
             (`month "Monthly report starting on: ")
             (`year "Annual report starting on: ")
             (_ (user-error "Unknown `:step' specification: %S" step))))
@@ -2767,6 +2847,9 @@ a number of clock tables."
                           (let ((offset (if (= dow week-start) 7
                                           (mod (- week-start dow) 7))))
                             (list 0 0 org-extend-today-until (+ d offset) m 
y)))
+                         (`semimonth (list 0 0 0
+                                           (if (< d 16) 16 1)
+                                           (if (< d 16) m (1+ m)) y))
                          (`month (list 0 0 0 month-start (1+ m) y))
                          (`year (list 0 0 org-extend-today-until 1 1 (1+ 
y)))))))
              (table-begin (line-beginning-position 0))
@@ -2883,7 +2966,7 @@ PROPERTIES: The list properties specified in the 
`:properties' parameter
                             (org-trim
                              (org-link-display-format
                               (replace-regexp-in-string
-                               "\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" ""
+                               "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]" ""
                                headline)))))))
                       (tgs (and tags (org-get-tags)))
                       (tsp
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index e967154..75056d45 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -1,6 +1,6 @@
 ;;; org-colview.el --- Column View in Org            -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -44,6 +44,8 @@
 (declare-function org-dynamic-block-define "org" (type func))
 (declare-function org-link-display-format "ol" (s))
 (declare-function org-link-open-from-string "ol" (s &optional arg))
+(declare-function face-remap-remove-relative "face-remap" (cookie))
+(declare-function face-remap-add-relative "face-remap" (face &rest specs))
 
 (defvar org-agenda-columns-add-appointments-to-effort-sum)
 (defvar org-agenda-columns-compute-summary-properties)
@@ -164,7 +166,7 @@ See `org-columns-summary-types' for details.")
 (org-defkey org-columns-map "o" 'org-overview)
 (org-defkey org-columns-map "e" 'org-columns-edit-value)
 (org-defkey org-columns-map "\C-c\C-t" 'org-columns-todo)
-(org-defkey org-columns-map "\C-c\C-c" 'org-columns-set-tags-or-toggle)
+(org-defkey org-columns-map "\C-c\C-c" 'org-columns-toggle-or-columns-quit)
 (org-defkey org-columns-map "\C-c\C-o" 'org-columns-open-link)
 (org-defkey org-columns-map "v" 'org-columns-show-value)
 (org-defkey org-columns-map "q" 'org-columns-quit)
@@ -257,6 +259,8 @@ value for ITEM property."
                                          (if org-hide-leading-stars ?\s ?*))
                             "* "))))
           (concat stars (org-link-display-format value))))
+       (`(,(or "DEADLINE" "SCHEDULED" "TIMESTAMP") . ,_)
+        (replace-regexp-in-string org-ts-regexp "[\\1]" value))
        (`(,_ ,_ ,_ ,_ nil) value)
        ;; If PRINTF is set, assume we are displaying a number and
        ;; obey to the format string.
@@ -364,11 +368,18 @@ ORIGINAL is the real string, i.e., before it is modified 
by
               ("TODO" (propertize v 'face (org-get-todo-face original)))
               (_ v)))))
 
+(defvar org-columns-header-line-remap nil
+  "Store the relative remapping of column header-line.
+This is needed to later remove this relative remapping.")
+
 (defun org-columns--display-here (columns &optional dateline)
   "Overlay the current line with column display.
 COLUMNS is an alist (SPEC VALUE DISPLAYED).  Optional argument
 DATELINE is non-nil when the face used should be
 `org-agenda-column-dateline'."
+  (when (ignore-errors (require 'face-remap))
+    (setq org-columns-header-line-remap
+         (face-remap-add-relative 'header-line '(:inherit default))))
   (save-excursion
     (beginning-of-line)
     (let* ((level-face (and (looking-at "\\(\\**\\)\\(\\* \\)")
@@ -378,8 +389,7 @@ DATELINE is non-nil when the face used should be
                              (org-get-at-bol 'face))
                         'default))
           (color (list :foreground (face-attribute ref-face :foreground)))
-          (font (list :height (face-attribute 'default :height)
-                      :family (face-attribute 'default :family)))
+          (font (list :family (face-attribute 'default :family)))
           (face (list color font 'org-column ref-face))
           (face1 (list color font 'org-agenda-column-dateline ref-face)))
       ;; Each column is an overlay on top of a character.  So there has
@@ -502,6 +512,9 @@ for the duration of the command.")
 (defun org-columns-remove-overlays ()
   "Remove all currently active column overlays."
   (interactive)
+  (when (and (fboundp 'face-remap-remove-relative)
+            org-columns-header-line-remap)
+    (face-remap-remove-relative org-columns-header-line-remap))
   (when org-columns-overlays
     (when (local-variable-p 'org-previous-header-line-format)
       (setq header-line-format org-previous-header-line-format)
@@ -554,13 +567,19 @@ for the duration of the command.")
   (interactive "P")
   (org-columns-edit-value "TODO"))
 
-(defun org-columns-set-tags-or-toggle (&optional _arg)
-  "Toggle checkbox at point, or set tags for current headline."
-  (interactive "P")
-  (if (string-match "\\`\\[[ xX-]\\]\\'"
-                   (get-char-property (point) 'org-columns-value))
-      (org-columns-next-allowed-value)
-    (org-columns-edit-value "TAGS")))
+(defun org-columns-toggle-or-columns-quit ()
+  "Toggle checkbox at point, or quit column view."
+  (interactive)
+  (or (org-columns--toggle)
+      (org-columns-quit)))
+
+(defun org-columns--toggle ()
+  "Toggle checkbox at point.  Return non-nil if toggle happened, else nil.
+See info documentation about realizing a suitable checkbox."
+  (when (string-match "\\`\\[[ xX-]\\]\\'"
+                     (get-char-property (point) 'org-columns-value))
+    (org-columns-next-allowed-value)
+    t))
 
 (defvar org-overriding-columns-format nil
   "When set, overrides any other format definition for the agenda.
@@ -1550,7 +1569,10 @@ PARAMS is a property list of parameters:
                     (id)))))
   (org-update-dblock))
 
-(org-dynamic-block-define "columnview" #'org-columns-insert-dblock)
+;;;###autoload
+(eval-after-load 'org
+  '(progn
+     (org-dynamic-block-define "columnview" #'org-columns-insert-dblock)))
 
 
 ;;; Column view in the agenda
@@ -1564,6 +1586,7 @@ PARAMS is a property list of parameters:
       (move-marker org-columns-begin-marker (point))
     (setq org-columns-begin-marker (point-marker)))
   (let* ((org-columns--time (float-time))
+        (org-done-keywords org-done-keywords-for-agenda)
         (fmt
          (cond
           ((bound-and-true-p org-overriding-columns-format))
@@ -1613,6 +1636,7 @@ PARAMS is a property list of parameters:
          (dolist (entry cache)
            (goto-char (car entry))
            (org-columns--display-here (cdr entry)))
+         (setq-local org-agenda-columns-active t)
          (when org-agenda-columns-show-summaries
            (org-agenda-colview-summarize cache)))))))
 
@@ -1677,8 +1701,7 @@ This will add overlays to the date lines, to show the 
summary for each day."
                                              'face 'bold final))
                         (list spec final final)))))
                  fmt)
-                'dateline)
-               (setq-local org-agenda-columns-active t))))
+                'dateline))))
          (if (bobp) (throw :complete t) (forward-line -1)))))))
 
 (defun org-agenda-colview-compute (fmt)
@@ -1704,4 +1727,8 @@ This will add overlays to the date lines, to show the 
summary for each day."
 
 (provide 'org-colview)
 
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; org-colview.el ends here
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index c1aaf17..1f4e2e8 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -1,6 +1,6 @@
 ;;; org-compat.el --- Compatibility Code for Older Emacsen -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -34,7 +34,9 @@
 
 (declare-function org-agenda-diary-entry "org-agenda")
 (declare-function org-agenda-maybe-redo "org-agenda" ())
+(declare-function org-agenda-set-restriction-lock "org-agenda" (&optional 
type))
 (declare-function org-agenda-remove-restriction-lock "org-agenda" (&optional 
noupdate))
+(declare-function org-calendar-goto-agenda "org-agenda" ())
 (declare-function org-align-tags "org" (&optional all))
 (declare-function org-at-heading-p "org" (&optional ignored))
 (declare-function org-at-table.el-p "org" ())
@@ -46,11 +48,13 @@
 (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
 (declare-function org-get-heading "org" (&optional no-tags no-todo no-priority 
no-comment))
 (declare-function org-get-tags "org" (&optional pos local))
+(declare-function org-hide-block-toggle "org" (&optional force no-error 
element))
 (declare-function org-link-display-format "ol" (s))
 (declare-function org-link-set-parameters "ol" (type &rest rest))
 (declare-function org-log-into-drawer "org" ())
 (declare-function org-make-tag-string "org" (tags))
 (declare-function org-reduced-level "org" (l))
+(declare-function org-return "org" (&optional indent arg interactive))
 (declare-function org-show-context "org" (&optional key))
 (declare-function org-table-end "org-table" (&optional table-type))
 (declare-function outline-next-heading "outline" ())
@@ -101,6 +105,20 @@ is nil)."
   (defun org-time-convert-to-list (time)
     (seconds-to-time (float-time time))))
 
+;; `newline-and-indent' did not take a numeric argument before 27.1.
+(if (version< emacs-version "27")
+    (defsubst org-newline-and-indent (&optional _arg)
+      (newline-and-indent))
+  (defalias 'org-newline-and-indent #'newline-and-indent))
+
+(defun org--set-faces-extend (faces extend-p)
+  "Set the :extend attribute of FACES to EXTEND-P.
+
+This is a no-op for Emacs versions lower than 27, since face
+extension beyond end of line was not controllable."
+  (when (fboundp 'set-face-extend)
+    (mapc (lambda (f) (set-face-extend f extend-p)) faces)))
+
 
 ;;; Emacs < 26.1 compatibility
 
@@ -314,6 +332,8 @@ Counting starts at 1."
 
 (define-obsolete-variable-alias 'org-attach-directory
   'org-attach-id-dir "Org 9.3")
+(make-obsolete 'org-attach-store-link "No longer used" "Org 9.4")
+(make-obsolete 'org-attach-expand-link "No longer used" "Org 9.4")
 
 (defun org-in-fixed-width-region-p ()
   "Non-nil if point in a fixed-width region."
@@ -556,6 +576,11 @@ use of this function is for the stuck project list."
 (define-obsolete-function-alias 'org-make-link-regexps
   'org-link-make-regexps "Org 9.3")
 
+(define-obsolete-function-alias 'org-property-global-value
+  'org-property-global-or-keyword-value "Org 9.3")
+
+(make-obsolete-variable 'org-file-properties 'org-keyword-properties "Org 9.3")
+
 (define-obsolete-variable-alias 'org-angle-link-re
   'org-link-angle-re "Org 9.3")
 
@@ -616,6 +641,72 @@ use of this function is for the stuck project list."
   (declare (obsolete "use `org-align-tags' instead." "Org 9.2"))
   (org-align-tags t))
 
+(define-obsolete-function-alias
+  'org-at-property-block-p 'org-at-property-drawer-p "Org 9.4")
+
+(defun org-flag-drawer (flag &optional element beg end)
+  "When FLAG is non-nil, hide the drawer we are at.
+Otherwise make it visible.
+
+When optional argument ELEMENT is a parsed drawer, as returned by
+`org-element-at-point', hide or show that drawer instead.
+
+When buffer positions BEG and END are provided, hide or show that
+region as a drawer without further ado."
+  (declare (obsolete "use `org-hide-drawer-toggle' instead." "Org 9.4"))
+  (if (and beg end) (org-flag-region beg end flag 'outline)
+    (let ((drawer
+          (or element
+              (and (save-excursion
+                     (beginning-of-line)
+                     (looking-at-p "^[ \t]*:\\(\\(?:\\w\\|[-_]\\)+\\):[ 
\t]*$"))
+                   (org-element-at-point)))))
+      (when (memq (org-element-type drawer) '(drawer property-drawer))
+       (let ((post (org-element-property :post-affiliated drawer)))
+         (org-flag-region
+          (save-excursion (goto-char post) (line-end-position))
+          (save-excursion (goto-char (org-element-property :end drawer))
+                          (skip-chars-backward " \t\n")
+                          (line-end-position))
+          flag 'outline)
+         ;; When the drawer is hidden away, make sure point lies in
+         ;; a visible part of the buffer.
+         (when (invisible-p (max (1- (point)) (point-min)))
+           (goto-char post)))))))
+
+(defun org-hide-block-toggle-maybe ()
+  "Toggle visibility of block at point.
+Unlike to `org-hide-block-toggle', this function does not throw
+an error.  Return a non-nil value when toggling is successful."
+  (declare (obsolete "use `org-hide-block-toggle' instead." "Org 9.4"))
+  (interactive)
+  (org-hide-block-toggle nil t))
+
+(defun org-hide-block-toggle-all ()
+  "Toggle the visibility of all blocks in the current buffer."
+  (declare (obsolete "please notify Org mailing list if you use this function."
+                    "Org 9.4"))
+  (let ((start (point-min))
+        (end (point-max)))
+    (save-excursion
+      (goto-char start)
+      (while (and (< (point) end)
+                 (re-search-forward "^[ \t]*#\\+begin_?\
+\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$" end t))
+       (save-excursion
+         (save-match-data
+            (goto-char (match-beginning 0))
+            (org-hide-block-toggle)))))))
+
+(defun org-return-indent ()
+  "Goto next table row or insert a newline and indent.
+Calls `org-table-next-row' or `newline-and-indent', depending on
+context.  See the individual commands for more information."
+  (declare (obsolete "use `org-return' with INDENT set to t instead."
+                    "Org 9.4"))
+  (interactive)
+  (org-return t))
+
 (defmacro org-with-silent-modifications (&rest body)
   (declare (obsolete "use `with-silent-modifications' instead." "Org 9.2")
           (debug (body)))
@@ -624,6 +715,23 @@ use of this function is for the stuck project list."
 (define-obsolete-function-alias 'org-babel-strip-quotes
   'org-strip-quotes "Org 9.2")
 
+(define-obsolete-variable-alias 'org-sort-agenda-notime-is-late
+  'org-agenda-sort-notime-is-late "9.4")
+
+(define-obsolete-variable-alias 'org-sort-agenda-noeffort-is-high
+  'org-agenda-sort-noeffort-is-high "9.4")
+
+(defconst org-maybe-keyword-time-regexp
+  (concat "\\(\\<\\(\\(?:CLO\\(?:CK\\|SED\\)\\|DEADLINE\\|SCHEDULED\\):\\)\\)?"
+         " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^]\r\n>]*[]>]"
+         "\\|"
+         "<%%([^\r\n>]*>\\)")
+  "Matches a timestamp, possibly preceded by a keyword.")
+(make-obsolete-variable
+ 'org-maybe-keyword-time-regexp
+ "use `org-planning-line-re', followed by `org-ts-regexp-both' instead."
+ "Org 9.4")
+
 ;;;; Obsolete link types
 
 (eval-after-load 'ol
@@ -808,7 +916,7 @@ This also applied for speedbar access."
             (setq last-level level)))))
      (aref subs 1))))
 
-(eval-after-load "imenu"
+(eval-after-load 'imenu
   '(progn
      (add-hook 'imenu-after-jump-hook
               (lambda ()
@@ -870,7 +978,7 @@ To get rid of the restriction, use 
`\\[org-agenda-remove-restriction-lock]'."
 
 (defvar speedbar-file-key-map)
 (declare-function speedbar-add-supported-extension "speedbar" (extension))
-(eval-after-load "speedbar"
+(eval-after-load 'speedbar
   '(progn
      (speedbar-add-supported-extension ".org")
      (define-key speedbar-file-key-map "<" 
'org-speedbar-set-agenda-restriction)
@@ -980,7 +1088,7 @@ ELEMENT is the element at point."
        (flyspell-delete-region-overlays beg end)))
 
 (defvar flyspell-delayed-commands)
-(eval-after-load "flyspell"
+(eval-after-load 'flyspell
   '(add-to-list 'flyspell-delayed-commands 'org-self-insert-command))
 
 ;;;; Bookmark
@@ -994,7 +1102,7 @@ ELEMENT is the element at point."
        (org-show-context 'bookmark-jump)))
 
 ;; Make `bookmark-jump' shows the jump location if it was hidden.
-(eval-after-load "bookmark"
+(eval-after-load 'bookmark
   '(if (boundp 'bookmark-after-jump-hook)
        ;; We can use the hook
        (add-hook 'bookmark-after-jump-hook 'org-bookmark-jump-unhide)
@@ -1043,17 +1151,18 @@ key."
     ((guard (not (lookup-key calendar-mode-map "c")))
      (local-set-key "c" #'org-calendar-goto-agenda))
     (_ nil))
-  (unless (eq org-agenda-diary-file 'diary-file)
+  (unless (and (boundp 'org-agenda-diary-file)
+              (eq org-agenda-diary-file 'diary-file))
     (local-set-key org-calendar-insert-diary-entry-key
                   #'org-agenda-diary-entry)))
 
-(eval-after-load "calendar"
+(eval-after-load 'calendar
   '(add-hook 'calendar-mode-hook #'org--setup-calendar-bindings))
 
 ;;;; Saveplace
 
 ;; Make sure saveplace shows the location if it was hidden
-(eval-after-load "saveplace"
+(eval-after-load 'saveplace
   '(defadvice save-place-find-file-hook (after org-make-visible activate)
      "Make the position visible."
      (org-bookmark-jump-unhide)))
@@ -1061,7 +1170,7 @@ key."
 ;;;; Ecb
 
 ;; Make sure ecb shows the location if it was hidden
-(eval-after-load "ecb"
+(eval-after-load 'ecb
   '(defadvice ecb-method-clicked (after esf/org-show-context activate)
      "Make hierarchy visible when jumping into location from ECB tree buffer."
      (when (derived-mode-p 'org-mode)
@@ -1075,17 +1184,17 @@ key."
             (org-invisible-p))
     (org-show-context 'mark-goto)))
 
-(eval-after-load "simple"
+(eval-after-load 'simple
   '(defadvice pop-to-mark-command (after org-make-visible activate)
      "Make the point visible with `org-show-context'."
      (org-mark-jump-unhide)))
 
-(eval-after-load "simple"
+(eval-after-load 'simple
   '(defadvice exchange-point-and-mark (after org-make-visible activate)
      "Make the point visible with `org-show-context'."
      (org-mark-jump-unhide)))
 
-(eval-after-load "simple"
+(eval-after-load 'simple
   '(defadvice pop-global-mark (after org-make-visible activate)
      "Make the point visible with `org-show-context'."
      (org-mark-jump-unhide)))
@@ -1094,9 +1203,13 @@ key."
 
 ;; Make "session.el" ignore our circular variable.
 (defvar session-globals-exclude)
-(eval-after-load "session"
+(eval-after-load 'session
   '(add-to-list 'session-globals-exclude 'org-mark-ring))
 
 (provide 'org-compat)
 
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; org-compat.el ends here
diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el
index 4b46a31..caf9de9 100644
--- a/lisp/org/org-crypt.el
+++ b/lisp/org/org-crypt.el
@@ -1,14 +1,8 @@
 ;;; org-crypt.el --- Public Key Encryption for Org Entries -*- 
lexical-binding: t; -*-
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;;
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
-;; Emacs Lisp Archive Entry
-;; Filename: org-crypt.el
-;; Keywords: org-mode
 ;; Author: John Wiegley <johnw@gnu.org>
-;; Maintainer: Peter Jones <pjones@pmade.com>
-;; Description: Adds public key encryption to Org buffers
-;; URL: http://www.newartisans.com/software/emacs.html
-;; Compatibility: Emacs22
 
 ;; This file is part of GNU Emacs.
 ;;
@@ -47,9 +41,7 @@
 ;;
 ;; 3. To later decrypt an entry, use `org-decrypt-entries' or
 ;;    `org-decrypt-entry'.  It might be useful to bind this to a key,
-;;    like C-c C-/.  I hope that in the future, C-c C-r can be might
-;;    overloaded to also decrypt an entry if it's encrypted, since
-;;    that fits nicely with the meaning of "reveal".
+;;    like C-c C-/.
 ;;
 ;; 4. To automatically encrypt all necessary entries when saving a
 ;;    file, call `org-crypt-use-before-save-magic' after loading
@@ -60,10 +52,11 @@
 ;; - Carsten Dominik
 ;; - Vitaly Ostanin
 
-(require 'org)
-
 ;;; Code:
 
+(require 'org-macs)
+(require 'org-compat)
+
 (declare-function epg-decrypt-string "epg" (context cipher))
 (declare-function epg-list-keys "epg" (context &optional name mode))
 (declare-function epg-make-context "epg"
@@ -74,6 +67,17 @@
                  (context plain recipients &optional sign always-trust))
 (defvar epg-context)
 
+(declare-function org-back-over-empty-lines "org" ())
+(declare-function org-back-to-heading "org" (&optional invisible-ok))
+(declare-function org-before-first-heading-p "org" ())
+(declare-function org-end-of-meta-data "org" (&optional full))
+(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
+(declare-function org-entry-get "org" (pom property &optional inherit 
literal-nil))
+(declare-function org-flag-subtree "org" (flag))
+(declare-function org-make-tags-matcher "org" (match))
+(declare-function org-previous-visible-heading "org" (arg))
+(declare-function org-scan-tags "org" (action matcher todo-only &optional 
start-level))
+(declare-function org-set-property "org" (property value))
 
 (defgroup org-crypt nil
   "Org Crypt."
@@ -90,9 +94,18 @@ See the \"Match syntax\" section of the org manual for more 
details."
 (defcustom org-crypt-key ""
   "The default key to use when encrypting the contents of a heading.
 
-This setting can also be overridden in the CRYPTKEY property."
-  :type 'string
-  :group 'org-crypt)
+If this variable is nil, always use symmetric encryption, unconditionally.
+
+Otherwise, The string is matched against all keys in the key ring.
+In particular, the empty string matches no key.  If no key is found,
+look for the `epa-file-encrypt-to' local variable.  Ultimately fall back
+to symmetric encryption.
+
+This setting can be overridden in the CRYPTKEY property."
+  :group 'org-crypt
+  :type '(choice
+         (string :tag "Public key(s) matching")
+         (const :tag "Symmetric encryption" nil)))
 
 (defcustom org-crypt-disable-auto-save 'ask
   "What org-decrypt should do if `auto-save-mode' is enabled.
@@ -118,6 +131,36 @@ nil      : Leave auto-save-mode enabled.
                  (const :tag "Ask"     ask)
                  (const :tag "Encrypt" encrypt)))
 
+(defun org-crypt--encrypted-text (beg end)
+  "Return encrypted text in between BEG and END."
+  ;; Ignore indentation.
+  (replace-regexp-in-string
+   "^[ \t]*" ""
+   (buffer-substring-no-properties beg end)))
+
+(defun org-at-encrypted-entry-p ()
+  "Is the current entry encrypted?
+When the entry is encrypted, return a pair (BEG . END) where BEG
+and END are buffer positions delimiting the encrypted area."
+  (org-with-wide-buffer
+   (unless (org-before-first-heading-p)
+     (org-back-to-heading t)
+     (org-end-of-meta-data 'standard)
+     (let ((case-fold-search nil)
+          (banner-start (rx (seq bol
+                                 (zero-or-more (any "\t "))
+                                 "-----BEGIN PGP MESSAGE-----"
+                                 eol))))
+       (when (looking-at banner-start)
+        (let ((start (point))
+              (banner-end (rx (seq bol
+                                   (or (group (zero-or-more (any "\t "))
+                                              "-----END PGP MESSAGE-----"
+                                              eol)
+                                       (seq (one-or-more "*") " "))))))
+          (when (and (re-search-forward banner-end nil t) (match-string 1))
+            (cons start (line-beginning-position 2)))))))))
+
 (defun org-crypt-check-auto-save ()
   "Check whether auto-save-mode is enabled for the current buffer.
 
@@ -149,93 +192,99 @@ See `org-crypt-disable-auto-save'."
      (t nil))))
 
 (defun org-crypt-key-for-heading ()
-  "Return the encryption key for the current heading."
-  (save-excursion
-    (org-back-to-heading t)
-    (or (org-entry-get nil "CRYPTKEY" 'selective)
-        org-crypt-key
-        (and (boundp 'epa-file-encrypt-to) epa-file-encrypt-to)
-        (message "No crypt key set, using symmetric encryption."))))
-
-(defun org-encrypt-string (str crypt-key)
-  "Return STR encrypted with CRYPT-KEY."
-  ;; Text and key have to be identical, otherwise we re-crypt.
-  (if (and (string= crypt-key (get-text-property 0 'org-crypt-key str))
-          (string= (sha1 str) (get-text-property 0 'org-crypt-checksum str)))
-      (get-text-property 0 'org-crypt-text str)
-    (setq-local epg-context (epg-make-context nil t t))
-    (epg-encrypt-string epg-context str (epg-list-keys epg-context 
crypt-key))))
-
+  "Return the encryption key(s) for the current heading.
+Assume `epg-context' is set."
+  (and org-crypt-key
+       (or (epg-list-keys epg-context
+                         (or (org-entry-get nil "CRYPTKEY" 'selective)
+                             org-crypt-key))
+          (bound-and-true-p epa-file-encrypt-to)
+          (progn
+            (message "No crypt key set, using symmetric encryption.")
+            nil))))
+
+;;;###autoload
 (defun org-encrypt-entry ()
   "Encrypt the content of the current headline."
   (interactive)
-  (require 'epg)
-  (org-with-wide-buffer
-   (org-back-to-heading t)
-   (setq-local epg-context (epg-make-context nil t t))
-   (let ((start-heading (point)))
-     (org-end-of-meta-data)
-     (unless (looking-at-p "-----BEGIN PGP MESSAGE-----")
-       (let ((folded (org-invisible-p))
-            (crypt-key (org-crypt-key-for-heading))
-            (beg (point)))
+  (unless (org-at-encrypted-entry-p)
+    (require 'epg)
+    (setq-local epg-context (epg-make-context nil t t))
+    (org-with-wide-buffer
+     (org-back-to-heading t)
+     (let ((start-heading (point))
+          (crypt-key (org-crypt-key-for-heading))
+          (folded? (org-invisible-p (line-beginning-position))))
+       (org-end-of-meta-data 'standard)
+       (let ((beg (point))
+            (folded-heading
+             (and folded?
+                  (save-excursion
+                    (org-previous-visible-heading 1)
+                    (point)))))
         (goto-char start-heading)
         (org-end-of-subtree t t)
         (org-back-over-empty-lines)
-        (let ((contents (delete-and-extract-region beg (point))))
+        (let* ((contents (delete-and-extract-region beg (point)))
+               (key (get-text-property 0 'org-crypt-key contents))
+               (checksum (get-text-property 0 'org-crypt-checksum contents)))
           (condition-case err
-              (insert (org-encrypt-string contents crypt-key))
+              (insert
+               ;; Text and key have to be identical, otherwise we
+               ;; re-crypt.
+               (if (and (equal crypt-key key)
+                        (string= checksum (sha1 contents)))
+                   (get-text-property 0 'org-crypt-text contents)
+                 (epg-encrypt-string epg-context contents crypt-key)))
             ;; If encryption failed, make sure to insert back entry
             ;; contents in the buffer.
-            (error (insert contents) (error (nth 1 err)))))
-        (when folded
-          (goto-char start-heading)
+            (error
+             (insert contents)
+             (error (error-message-string err)))))
+        (when folded-heading
+          (goto-char folded-heading)
           (org-flag-subtree t))
         nil)))))
 
+;;;###autoload
 (defun org-decrypt-entry ()
   "Decrypt the content of the current headline."
   (interactive)
-  (require 'epg)
-  (unless (org-before-first-heading-p)
-    (org-with-wide-buffer
-     (org-back-to-heading t)
-     (let ((heading-point (point))
-          (heading-was-invisible-p
-           (save-excursion
-             (outline-end-of-heading)
-             (org-invisible-p))))
-       (org-end-of-meta-data)
-       (when (looking-at "-----BEGIN PGP MESSAGE-----")
-        (org-crypt-check-auto-save)
-        (setq-local epg-context (epg-make-context nil t t))
-        (let* ((end (save-excursion
-                      (search-forward "-----END PGP MESSAGE-----")
-                      (forward-line)
-                      (point)))
-               (encrypted-text (buffer-substring-no-properties (point) end))
-               (decrypted-text
-                (decode-coding-string
-                 (epg-decrypt-string
-                  epg-context
-                  encrypted-text)
-                 'utf-8)))
-          ;; Delete region starting just before point, because the
-          ;; outline property starts at the \n of the heading.
-          (delete-region (1- (point)) end)
-          ;; Store a checksum of the decrypted and the encrypted
-          ;; text value.  This allows reusing the same encrypted text
-          ;; if the text does not change, and therefore avoid a
-          ;; re-encryption process.
-          (insert "\n" (propertize decrypted-text
-                                   'org-crypt-checksum (sha1 decrypted-text)
-                                   'org-crypt-key (org-crypt-key-for-heading)
-                                   'org-crypt-text encrypted-text))
-          (when heading-was-invisible-p
-            (goto-char heading-point)
-            (org-flag-subtree t))
-          nil))))))
+  (pcase (org-at-encrypted-entry-p)
+    (`(,beg . ,end)
+     (require 'epg)
+     (setq-local epg-context (epg-make-context nil t t))
+     (org-with-point-at beg
+       (org-crypt-check-auto-save)
+       (let* ((folded-heading
+              (and (org-invisible-p)
+                   (save-excursion
+                     (org-previous-visible-heading 1)
+                     (point))))
+             (encrypted-text (org-crypt--encrypted-text beg end))
+             (decrypted-text
+              (decode-coding-string
+               (epg-decrypt-string epg-context encrypted-text)
+               'utf-8)))
+        ;; Delete region starting just before point, because the
+        ;; outline property starts at the \n of the heading.
+        (delete-region (1- (point)) end)
+        ;; Store a checksum of the decrypted and the encrypted text
+        ;; value.  This allows reusing the same encrypted text if the
+        ;; text does not change, and therefore avoid a re-encryption
+        ;; process.
+        (insert "\n"
+                (propertize decrypted-text
+                            'org-crypt-checksum (sha1 decrypted-text)
+                            'org-crypt-key (org-crypt-key-for-heading)
+                            'org-crypt-text encrypted-text))
+        (when folded-heading
+          (goto-char folded-heading)
+          (org-flag-subtree t))
+        nil)))
+    (_ nil)))
 
+;;;###autoload
 (defun org-encrypt-entries ()
   "Encrypt all top-level entries in the current buffer."
   (interactive)
@@ -245,6 +294,7 @@ See `org-crypt-disable-auto-save'."
      (cdr (org-make-tags-matcher org-crypt-tag-matcher))
      org--matcher-tags-todo-only)))
 
+;;;###autoload
 (defun org-decrypt-entries ()
   "Decrypt all entries in the current buffer."
   (interactive)
@@ -254,14 +304,7 @@ See `org-crypt-disable-auto-save'."
      (cdr (org-make-tags-matcher org-crypt-tag-matcher))
      org--matcher-tags-todo-only)))
 
-(defun org-at-encrypted-entry-p ()
-  "Is the current entry encrypted?"
-  (unless (org-before-first-heading-p)
-    (save-excursion
-      (org-back-to-heading t)
-      (search-forward "-----BEGIN PGP MESSAGE-----"
-                     (save-excursion (outline-next-heading)) t))))
-
+;;;###autoload
 (defun org-crypt-use-before-save-magic ()
   "Add a hook to automatically encrypt entries before a file is saved to disk."
   (add-hook
diff --git a/lisp/org/org-ctags.el b/lisp/org/org-ctags.el
index 08885d2..1fca873 100644
--- a/lisp/org/org-ctags.el
+++ b/lisp/org/org-ctags.el
@@ -1,6 +1,6 @@
 ;;; org-ctags.el - Integrate Emacs "tags" Facility with Org -*- 
lexical-binding: t; -*-
 ;;
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Paul Sexton <eeeickythump@gmail.com>
 
@@ -165,7 +165,7 @@ See the ctags documentation for more information.")
   '(org-ctags-find-tag
     org-ctags-ask-rebuild-tags-file-then-find-tag
     org-ctags-ask-append-topic)
-  "List of functions to be prepended to ORG-OPEN-LINK-FUNCTIONS when ORG-CTAGS 
is active."
+  "List of functions to be prepended to ORG-OPEN-LINK-FUNCTIONS by ORG-CTAGS."
   :group 'org-ctags
   :version "24.1"
   :type 'hook
diff --git a/lisp/org/org-datetree.el b/lisp/org/org-datetree.el
index 6469abe..62bd46e 100644
--- a/lisp/org/org-datetree.el
+++ b/lisp/org/org-datetree.el
@@ -1,6 +1,6 @@
 ;;; org-datetree.el --- Create date entries in a tree -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -51,11 +51,29 @@ Added time stamp is active unless value is `inactive'."
 
 ;;;###autoload
 (defun org-datetree-find-date-create (d &optional keep-restriction)
-  "Find or create an entry for date D.
+  "Find or create a day entry for date D.
 If KEEP-RESTRICTION is non-nil, do not widen the buffer.
 When it is nil, the buffer will be widened to make sure an existing date
 tree can be found.  If it is the symbol `subtree-at-point', then the tree
 will be built under the headline at point."
+  (org-datetree--find-create-group d 'day keep-restriction))
+
+;;;###autoload
+(defun org-datetree-find-month-create (d &optional keep-restriction)
+  "Find or create a month entry for date D.
+Compared to `org-datetree-find-date-create' this function creates
+entries grouped by month instead of days.
+If KEEP-RESTRICTION is non-nil, do not widen the buffer.
+When it is nil, the buffer will be widened to make sure an existing date
+tree can be found.  If it is the symbol `subtree-at-point', then the tree
+will be built under the headline at point."
+  (org-datetree--find-create-group d 'month keep-restriction))
+
+(defun org-datetree--find-create-group
+    (d time-grouping &optional keep-restriction)
+  "Find or create an entry for date D.
+If time-period is day, group entries by day. If time-period is
+month, then group entries by month."
   (setq-local org-datetree-base-level 1)
   (save-restriction
     (if (eq keep-restriction 'subtree-at-point)
@@ -84,9 +102,10 @@ will be built under the headline at point."
       (org-datetree--find-create
        "^\\*+[ \t]+%d-\\([01][0-9]\\) \\w+$"
        year month)
-      (org-datetree--find-create
-       "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$"
-       year month day))))
+      (when (eq time-grouping 'day)
+       (org-datetree--find-create
+        "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$"
+        year month day)))))
 
 ;;;###autoload
 (defun org-datetree-find-iso-week-create (d &optional keep-restriction)
@@ -166,6 +185,8 @@ inserted into the buffer."
 
 (defun org-datetree-insert-line (year &optional month day text)
   (delete-region (save-excursion (skip-chars-backward " \t\n") (point)) 
(point))
+  (when (assq 'heading org-blank-before-new-entry)
+    (insert "\n"))
   (insert "\n" (make-string org-datetree-base-level ?*) " \n")
   (backward-char)
   (when month (org-do-demote))
diff --git a/lisp/org/org-duration.el b/lisp/org/org-duration.el
index 155bfae..29fae2d 100644
--- a/lisp/org/org-duration.el
+++ b/lisp/org/org-duration.el
@@ -1,6 +1,6 @@
 ;;; org-duration.el --- Library handling durations   -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -28,14 +28,16 @@
 ;;   - 3:12
 ;;   - 1:23:45
 ;;   - 1y 3d 3h 4min
+;;   - 1d3h5min
 ;;   - 3d 13:35
 ;;   - 2.35h
 ;;
 ;; More accurately, it consists of numbers and units, as defined in
-;; variable `org-duration-units', separated with white spaces, and
-;; a "H:MM" or "H:MM:SS" part.  White spaces are tolerated between the
-;; number and its relative unit.  Variable `org-duration-format'
-;; controls durations default representation.
+;; variable `org-duration-units', possibly separated with white
+;; spaces, and an optional "H:MM" or "H:MM:SS" part, which always
+;; comes last.  White spaces are tolerated between the number and its
+;; relative unit.  Variable `org-duration-format' controls durations
+;; default representation.
 ;;
 ;; The library provides functions allowing to convert a duration to,
 ;; and from, a number of minutes: `org-duration-to-minutes' and
@@ -122,8 +124,7 @@ are specified here.
 Units with a zero value are skipped, unless REQUIRED? is non-nil.
 In that case, the unit is always used.
 
-Eventually, the list can contain one of the following special
-entries:
+The list can also contain one of the following special entries:
 
   (special . h:mm)
   (special . h:mm:ss)
@@ -139,6 +140,10 @@ entries:
     first one required or with a non-zero integer part.  If there
     is no such unit, the smallest one is used.
 
+Eventually, if the list contains the symbol `compact', the
+duration is expressed in a compact form, without any white space
+between units.
+
 For example,
 
    ((\"d\" . nil) (\"h\" . t) (\"min\" . t))
@@ -172,7 +177,6 @@ a 2-digits fractional part, of \"d\" unit.  A duration 
shorter
 than a day uses \"h\" unit instead."
   :group 'org-time
   :group 'org-clock
-  :version "26.1"
   :package-version '(Org . "9.1")
   :type '(choice
          (const :tag "Use H:MM" h:mm)
@@ -191,7 +195,8 @@ than a day uses \"h\" unit instead."
                         (const h:mm))
                   (cons :tag "Use both units and H:MM:SS"
                         (const special)
-                        (const h:mm:ss))))))
+                        (const h:mm:ss))
+                  (const :tag "Use compact form" compact)))))
 
 
 ;;; Internal variables and functions
@@ -249,13 +254,10 @@ When optional argument CANONICAL is non-nil, refer to
                                                  org-duration-units))
                            t)))
   (setq org-duration--full-re
-       (format "\\`[ \t]*%s\\(?:[ \t]+%s\\)*[ \t]*\\'"
-               org-duration--unit-re
-               org-duration--unit-re))
+       (format "\\`\\(?:[ \t]*%s\\)+[ \t]*\\'" org-duration--unit-re))
   (setq org-duration--mixed-re
-       (format "\\`[ \t]*\\(?1:%s\\(?:[ \t]+%s\\)*\\)[ \t]+\
+       (format "\\`\\(?1:\\([ \t]*%s\\)+\\)[ \t]*\
 \\(?2:[0-9]+\\(?::[0-9][0-9]\\)\\{1,2\\}\\)[ \t]*\\'"
-               org-duration--unit-re
                org-duration--unit-re)))
 
 ;;;###autoload
@@ -353,10 +355,11 @@ Raise an error if expected format is unknown."
         ;; Represent minutes above hour using provided units and H:MM
         ;; or H:MM:SS below.
         (let* ((units-part (* min-modifier (/ (floor minutes) min-modifier)))
-               (minutes-part (- minutes units-part)))
+               (minutes-part (- minutes units-part))
+               (compact (memq 'compact duration-format)))
           (concat
            (org-duration-from-minutes units-part truncated-format canonical)
-           " "
+           (and (not compact) " ")
            (org-duration-from-minutes minutes-part mode))))))
     ;; Units format.
     (duration-format
@@ -368,12 +371,16 @@ Raise an error if expected format is unknown."
                    (format "%%.%df" digits))))
            (selected-units
             (sort (cl-remove-if
-                   ;; Ignore special format cells.
-                   (lambda (pair) (pcase pair (`(special . ,_) t) (_ nil)))
+                   ;; Ignore special format cells and compact option.
+                   (lambda (pair)
+                     (pcase pair
+                       ((or `compact `(special . ,_)) t)
+                       (_ nil)))
                    duration-format)
                   (lambda (a b)
                     (> (org-duration--modifier (car a) canonical)
-                       (org-duration--modifier (car b) canonical))))))
+                       (org-duration--modifier (car b) canonical)))))
+           (separator (if (memq 'compact duration-format) "" " ")))
        (cond
        ;; Fractional duration: use first unit that is either required
        ;; or smaller than MINUTES.
@@ -402,8 +409,8 @@ Raise an error if expected format is unknown."
                (cond ((<= modifier minutes)
                       (let ((value (floor minutes modifier)))
                         (cl-decf minutes (* value modifier))
-                        (format " %d%s" value unit)))
-                     (required? (concat " 0" unit))
+                        (format "%s%d%s" separator value unit)))
+                     (required? (concat separator "0" unit))
                      (t ""))))
            selected-units
            ""))))
@@ -441,4 +448,9 @@ with \"H:MM:SS\" format, return `h:mm:ss'.  Otherwise, 
return
 (org-duration-set-regexps)
 
 (provide 'org-duration)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; org-duration.el ends here
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el
index ef64f58..b7319d6 100644
--- a/lisp/org/org-element.el
+++ b/lisp/org/org-element.el
@@ -1,6 +1,6 @@
 ;;; org-element.el --- Parser for Org Syntax         -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -72,7 +72,6 @@
 (declare-function org-at-heading-p "org" (&optional _))
 (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
 (declare-function org-escape-code-in-string "org-src" (s))
-(declare-function org-find-visible "org" ())
 (declare-function org-macro-escape-arguments "org-macro" (&rest args))
 (declare-function org-macro-extract-arguments "org-macro" (s))
 (declare-function org-reduced-level "org" (l))
@@ -330,7 +329,9 @@ match group 2.
 Don't modify it, set `org-element-affiliated-keywords' instead.")
 
 (defconst org-element-object-restrictions
-  (let* ((standard-set (remq 'table-cell org-element-all-objects))
+  (let* ((minimal-set '(bold code entity italic latex-fragment strike-through
+                            subscript superscript underline verbatim))
+        (standard-set (remq 'table-cell org-element-all-objects))
         (standard-set-no-line-break (remq 'line-break standard-set)))
     `((bold ,@standard-set)
       (footnote-reference ,@standard-set)
@@ -341,23 +342,20 @@ Don't modify it, set `org-element-affiliated-keywords' 
instead.")
       (keyword ,@(remq 'footnote-reference standard-set))
       ;; Ignore all links in a link description.  Also ignore
       ;; radio-targets and line breaks.
-      (link bold code entity export-snippet inline-babel-call inline-src-block
-           italic latex-fragment macro statistics-cookie strike-through
-           subscript superscript underline verbatim)
+      (link export-snippet inline-babel-call inline-src-block macro
+           statistics-cookie ,@minimal-set)
       (paragraph ,@standard-set)
       ;; Remove any variable object from radio target as it would
       ;; prevent it from being properly recognized.
-      (radio-target bold code entity italic latex-fragment strike-through
-                   subscript superscript underline superscript)
+      (radio-target ,@minimal-set)
       (strike-through ,@standard-set)
       (subscript ,@standard-set)
       (superscript ,@standard-set)
       ;; Ignore inline babel call and inline source block as formulas
       ;; are possible.  Also ignore line breaks and statistics
       ;; cookies.
-      (table-cell bold code entity export-snippet footnote-reference italic
-                 latex-fragment link macro radio-target strike-through
-                 subscript superscript target timestamp underline verbatim)
+      (table-cell export-snippet footnote-reference link macro radio-target
+                 target timestamp ,@minimal-set)
       (table-row table-cell)
       (underline ,@standard-set)
       (verse-block ,@standard-set)))
@@ -367,10 +365,6 @@ key is an element or object type containing objects and 
value is
 a list of types that can be contained within an element or object
 of such type.
 
-For example, in a `radio-target' object, one can only find
-entities, latex-fragments, subscript, superscript and text
-markup.
-
 This alist also applies to secondary string.  For example, an
 `headline' type element doesn't directly contain objects, but
 still has an entry since one of its properties (`:title') does.")
@@ -1806,13 +1800,10 @@ Return a list whose CAR is `clock' and CDR is a plist 
containing
 
 ;;;; Comment
 
-(defun org-element-comment-parser (limit affiliated)
+(defun org-element-comment-parser (limit)
   "Parse a comment.
 
-LIMIT bounds the search.  AFFILIATED is a list of which CAR is
-the buffer position at the beginning of the first affiliated
-keyword and CDR is a plist of affiliated keywords along with
-their value.
+LIMIT bounds the search.
 
 Return a list whose CAR is `comment' and CDR is a plist
 containing `:begin', `:end', `:value', `:post-blank',
@@ -1820,8 +1811,7 @@ containing `:begin', `:end', `:value', `:post-blank',
 
 Assume point is at comment beginning."
   (save-excursion
-    (let* ((begin (car affiliated))
-          (post-affiliated (point))
+    (let* ((begin (point))
           (value (prog2 (looking-at "[ \t]*# ?")
                      (buffer-substring-no-properties
                       (match-end 0) (line-end-position))
@@ -1843,13 +1833,11 @@ Assume point is at comment beginning."
                       (skip-chars-forward " \r\t\n" limit)
                       (if (eobp) (point) (line-beginning-position)))))
       (list 'comment
-           (nconc
-            (list :begin begin
-                  :end end
-                  :value value
-                  :post-blank (count-lines com-end end)
-                  :post-affiliated post-affiliated)
-            (cdr affiliated))))))
+           (list :begin begin
+                 :end end
+                 :value value
+                 :post-blank (count-lines com-end end)
+                 :post-affiliated begin)))))
 
 (defun org-element-comment-interpreter (comment _)
   "Interpret COMMENT element as Org syntax.
@@ -2186,9 +2174,9 @@ the buffer position at the beginning of the first 
affiliated
 keyword and CDR is a plist of affiliated keywords along with
 their value.
 
-Return a list whose CAR is `keyword' and CDR is a plist
-containing `:key', `:value', `:begin', `:end', `:post-blank' and
-`:post-affiliated' keywords."
+Return a list whose CAR is a normalized `keyword' (uppercase) and
+CDR is a plist containing `:key', `:value', `:begin', `:end',
+`:post-blank' and `:post-affiliated' keywords."
   (save-excursion
     ;; An orphaned affiliated keyword is considered as a regular
     ;; keyword.  In this case AFFILIATED is nil, so we take care of
@@ -3217,10 +3205,11 @@ Assume point is at the beginning of the link."
        (setq post-blank
              (progn (goto-char link-end) (skip-chars-forward " \t")))
        (setq end (point)))
-      ;; Special "file" type link processing.  Extract opening
+      ;; Special "file"-type link processing.  Extract opening
       ;; application and search option, if any.  Also normalize URI.
       (when (string-match "\\`file\\(?:\\+\\(.+\\)\\)?\\'" type)
-       (setq application (match-string 1 type) type "file")
+       (setq application (match-string 1 type))
+       (setq type "file")
        (when (string-match "::\\(.*\\)\\'" path)
          (setq search-option (match-string 1 path))
          (setq path (replace-match "" nil nil path)))
@@ -3823,12 +3812,6 @@ Assume point is at the first equal sign marker."
 ;; `org-element--current-element' is the core function of this section.
 ;; It returns the Lisp representation of the element starting at
 ;; point.
-;;
-;; `org-element--current-element' makes use of special modes.  They
-;; are activated for fixed element chaining (e.g., `plain-list' >
-;; `item') or fixed conditional element chaining (e.g., `headline' >
-;; `section').  Special modes are: `first-section', `item',
-;; `node-property', `section' and `table-row'.
 
 (defun org-element--current-element (limit &optional granularity mode 
structure)
   "Parse the element starting at point.
@@ -3848,8 +3831,9 @@ nil), secondary values will not be parsed, since they only
 contain objects.
 
 Optional argument MODE, when non-nil, can be either
-`first-section', `section', `planning', `item', `node-property'
-and `table-row'.
+`first-section', `item', `node-property', `planning',
+`property-drawer', `section', `table-row', or `top-comment'.
+
 
 If STRUCTURE isn't provided but MODE is set to `item', it will be
 computed.
@@ -3879,15 +3863,22 @@ element it has to parse."
        (org-element-section-parser
         (or (save-excursion (org-with-limited-levels (outline-next-heading)))
             limit)))
+       ;; Comments.
+       ((looking-at "^[ \t]*#\\(?: \\|$\\)")
+       (org-element-comment-parser limit))
        ;; Planning.
        ((and (eq mode 'planning)
             (eq ?* (char-after (line-beginning-position 0)))
             (looking-at org-planning-line-re))
        (org-element-planning-parser limit))
        ;; Property drawer.
-       ((and (memq mode '(planning property-drawer))
-            (eq ?* (char-after (line-beginning-position
-                                (if (eq mode 'planning) 0 -1))))
+       ((and (pcase mode
+              (`planning (eq ?* (char-after (line-beginning-position 0))))
+              ((or `property-drawer `top-comment)
+               (save-excursion
+                 (beginning-of-line 0)
+                 (not (looking-at "[[:blank:]]*$"))))
+              (_ nil))
             (looking-at org-property-drawer-re))
        (org-element-property-drawer-parser limit))
        ;; When not at bol, point is at the beginning of an item or
@@ -3896,7 +3887,7 @@ element it has to parse."
        ;; Clock.
        ((looking-at org-clock-line-re) (org-element-clock-parser limit))
        ;; Inlinetask.
-       ((org-at-heading-p)
+       ((looking-at "^\\*+ ")
        (org-element-inlinetask-parser limit raw-secondary-p))
        ;; From there, elements can have affiliated keywords.
        (t (let ((affiliated (org-element--collect-affiliated-keywords
@@ -3910,7 +3901,7 @@ element it has to parse."
             ;; LaTeX Environment.
             ((looking-at org-element--latex-begin-environment)
              (org-element-latex-environment-parser limit affiliated))
-            ;; Drawer and Property Drawer.
+            ;; Drawer.
             ((looking-at org-drawer-regexp)
              (org-element-drawer-parser limit affiliated))
             ;; Fixed Width
@@ -3918,13 +3909,10 @@ element it has to parse."
              (org-element-fixed-width-parser limit affiliated))
             ;; Inline Comments, Blocks, Babel Calls, Dynamic Blocks and
             ;; Keywords.
-            ((looking-at "[ \t]*#")
+            ((looking-at "[ \t]*#\\+")
              (goto-char (match-end 0))
              (cond
-              ((looking-at "\\(?: \\|$\\)")
-               (beginning-of-line)
-               (org-element-comment-parser limit affiliated))
-              ((looking-at "\\+BEGIN_\\(\\S-+\\)")
+              ((looking-at "BEGIN_\\(\\S-+\\)")
                (beginning-of-line)
                (funcall (pcase (upcase (match-string 1))
                           ("CENTER"  #'org-element-center-block-parser)
@@ -3937,13 +3925,13 @@ element it has to parse."
                           (_         #'org-element-special-block-parser))
                         limit
                         affiliated))
-              ((looking-at "\\+CALL:")
+              ((looking-at "CALL:")
                (beginning-of-line)
                (org-element-babel-call-parser limit affiliated))
-              ((looking-at "\\+BEGIN:? ")
+              ((looking-at "BEGIN:? ")
                (beginning-of-line)
                (org-element-dynamic-block-parser limit affiliated))
-              ((looking-at "\\+\\S-+:")
+              ((looking-at "\\S-+:")
                (beginning-of-line)
                (org-element-keyword-parser limit affiliated))
               (t
@@ -4024,7 +4012,8 @@ When PARSE is non-nil, values from keywords belonging to
                             (skip-chars-backward " \t")
                             (point))))
                  (if parsed?
-                     (org-element--parse-objects beg end nil restrict)
+                     (save-match-data
+                       (org-element--parse-objects beg end nil restrict))
                    (org-trim (buffer-substring-no-properties beg end)))))
               ;; If KWD is a dual keyword, find its secondary value.
               ;; Maybe parse it.
@@ -4322,34 +4311,41 @@ looking into captions:
 ;; `org-element--object-lex' to find the next object in the current
 ;; container.
 
-(defsubst org-element--next-mode (type parentp)
-  "Return next special mode according to TYPE, or nil.
-TYPE is a symbol representing the type of an element or object
-containing next element if PARENTP is non-nil, or before it
-otherwise.  Modes can be either `first-section', `item',
-`node-property', `planning', `property-drawer', `section',
-`table-row' or nil."
-  (if parentp
+(defsubst org-element--next-mode (mode type parent?)
+  "Return next mode according to current one.
+
+MODE is a symbol representing the expectation about the next
+element or object.  Meaningful values are `first-section',
+`item', `node-property', `planning', `property-drawer',
+`section', `table-row', `top-comment', and nil.
+
+TYPE is the type of the current element or object.
+
+If PARENT? is non-nil, assume the next element or object will be
+located inside the current one.  "
+  (if parent?
       (pcase type
        (`headline 'section)
+       ((and (guard (eq mode 'first-section)) `section) 'top-comment)
        (`inlinetask 'planning)
        (`plain-list 'item)
        (`property-drawer 'node-property)
        (`section 'planning)
        (`table 'table-row))
-    (pcase type
+    (pcase mode
       (`item 'item)
       (`node-property 'node-property)
-      (`planning 'property-drawer)
-      (`table-row 'table-row))))
+      ((and `planning (guard (eq type 'planning))) 'property-drawer)
+      (`table-row 'table-row)
+      ((and `top-comment (guard (eq type 'comment))) 'property-drawer))))
 
 (defun org-element--parse-elements
     (beg end mode structure granularity visible-only acc)
   "Parse elements between BEG and END positions.
 
 MODE prioritizes some elements over the others.  It can be set to
-`first-section', `section', `planning', `item', `node-property'
-or `table-row'.
+`first-section', `item', `node-property', `planning',
+`property-drawer', `section', `table-row', `top-comment', or nil.
 
 When value is `item', STRUCTURE will be used as the current list
 structure.
@@ -4363,54 +4359,52 @@ elements.
 Elements are accumulated into ACC."
   (save-excursion
     (goto-char beg)
-    ;; Visible only: skip invisible parts at the beginning of the
-    ;; element.
-    (when (and visible-only (org-invisible-p2))
-      (goto-char (min (1+ (org-find-visible)) end)))
     ;; When parsing only headlines, skip any text before first one.
     (when (and (eq granularity 'headline) (not (org-at-heading-p)))
       (org-with-limited-levels (outline-next-heading)))
     (let (elements)
       (while (< (point) end)
-       ;; Find current element's type and parse it accordingly to
-       ;; its category.
-       (let* ((element (org-element--current-element
-                        end granularity mode structure))
-              (type (org-element-type element))
-              (cbeg (org-element-property :contents-begin element)))
-         (goto-char (org-element-property :end element))
-         ;; Visible only: skip invisible parts between siblings.
-         (when (and visible-only (org-invisible-p2))
-           (goto-char (min (1+ (org-find-visible)) end)))
-         ;; Fill ELEMENT contents by side-effect.
-         (cond
-          ;; If element has no contents, don't modify it.
-          ((not cbeg))
-          ;; Greater element: parse it between `contents-begin' and
-          ;; `contents-end'.  Make sure GRANULARITY allows the
-          ;; recursion, or ELEMENT is a headline, in which case going
-          ;; inside is mandatory, in order to get sub-level headings.
-          ((and (memq type org-element-greater-elements)
-                (or (memq granularity '(element object nil))
-                    (and (eq granularity 'greater-element)
-                         (eq type 'section))
-                    (eq type 'headline)))
-           (org-element--parse-elements
-            cbeg (org-element-property :contents-end element)
-            ;; Possibly switch to a special mode.
-            (org-element--next-mode type t)
-            (and (memq type '(item plain-list))
-                 (org-element-property :structure element))
-            granularity visible-only element))
-          ;; ELEMENT has contents.  Parse objects inside, if
-          ;; GRANULARITY allows it.
-          ((memq granularity '(object nil))
-           (org-element--parse-objects
-            cbeg (org-element-property :contents-end element) element
-            (org-element-restriction type))))
-         (push (org-element-put-property element :parent acc) elements)
-         ;; Update mode.
-         (setq mode (org-element--next-mode type nil))))
+       ;; Visible only: skip invisible parts due to folding.
+       (if (and visible-only (org-invisible-p nil t))
+           (progn
+             (goto-char (org-find-visible))
+             (when (and (eolp) (not (eobp))) (forward-char)))
+         ;; Find current element's type and parse it accordingly to
+         ;; its category.
+         (let* ((element (org-element--current-element
+                          end granularity mode structure))
+                (type (org-element-type element))
+                (cbeg (org-element-property :contents-begin element)))
+           (goto-char (org-element-property :end element))
+           ;; Fill ELEMENT contents by side-effect.
+           (cond
+            ;; If element has no contents, don't modify it.
+            ((not cbeg))
+            ;; Greater element: parse it between `contents-begin' and
+            ;; `contents-end'.  Ensure GRANULARITY allows recursion,
+            ;; or ELEMENT is a headline, in which case going inside
+            ;; is mandatory, in order to get sub-level headings.
+            ((and (memq type org-element-greater-elements)
+                  (or (memq granularity '(element object nil))
+                      (and (eq granularity 'greater-element)
+                           (eq type 'section))
+                      (eq type 'headline)))
+             (org-element--parse-elements
+              cbeg (org-element-property :contents-end element)
+              ;; Possibly switch to a special mode.
+              (org-element--next-mode mode type t)
+              (and (memq type '(item plain-list))
+                   (org-element-property :structure element))
+              granularity visible-only element))
+            ;; ELEMENT has contents.  Parse objects inside, if
+            ;; GRANULARITY allows it.
+            ((memq granularity '(object nil))
+             (org-element--parse-objects
+              cbeg (org-element-property :contents-end element) element
+              (org-element-restriction type))))
+           (push (org-element-put-property element :parent acc) elements)
+           ;; Update mode.
+           (setq mode (org-element--next-mode mode type nil)))))
       ;; Return result.
       (apply #'org-element-set-contents acc (nreverse elements)))))
 
@@ -4500,15 +4494,21 @@ to an appropriate container (e.g., a paragraph)."
                             (and (memq 'latex-fragment restriction)
                                  (org-element-latex-fragment-parser)))))
                      (?\[
-                      (if (eq (aref result 1) ?\[)
-                          (and (memq 'link restriction)
-                               (org-element-link-parser))
-                        (or (and (memq 'footnote-reference restriction)
-                                 (org-element-footnote-reference-parser))
-                            (and (memq 'timestamp restriction)
-                                 (org-element-timestamp-parser))
-                            (and (memq 'statistics-cookie restriction)
-                                 (org-element-statistics-cookie-parser)))))
+                      (pcase (aref result 1)
+                        ((and ?\[
+                              (guard (memq 'link restriction)))
+                         (org-element-link-parser))
+                        ((and ?f
+                              (guard (memq 'footnote-reference restriction)))
+                         (org-element-footnote-reference-parser))
+                        ((and (or ?% ?/)
+                              (guard (memq 'statistics-cookie restriction)))
+                         (org-element-statistics-cookie-parser))
+                        (_
+                         (or (and (memq 'timestamp restriction)
+                                  (org-element-timestamp-parser))
+                             (and (memq 'statistics-cookie restriction)
+                                  (org-element-statistics-cookie-parser))))))
                      ;; This is probably a plain link.
                      (_ (and (memq 'link restriction)
                              (org-element-link-parser)))))))
@@ -4823,10 +4823,12 @@ indentation removed from its contents."
 ;;
 ;; A single public function is provided: `org-element-cache-reset'.
 ;;
-;; Cache is enabled by default, but can be disabled globally with
+;; Cache is disabled by default for now because it sometimes triggers
+;; freezes, but it can be enabled globally with
 ;; `org-element-use-cache'.  `org-element-cache-sync-idle-time',
-;; org-element-cache-sync-duration' and `org-element-cache-sync-break'
-;; can be tweaked to control caching behavior.
+;; `org-element-cache-sync-duration' and
+;; `org-element-cache-sync-break' can be tweaked to control caching
+;; behavior.
 ;;
 ;; Internally, parsed elements are stored in an AVL tree,
 ;; `org-element--cache'.  This tree is updated lazily: whenever
@@ -5452,9 +5454,11 @@ the process stopped before finding the expected result."
         ;; element following headline above, or first element in
         ;; buffer.
         ((not cached)
-         (when (org-with-limited-levels (outline-previous-heading))
-           (setq mode 'planning)
-          (forward-line))
+         (if (org-with-limited-levels (outline-previous-heading))
+             (progn
+              (setq mode 'planning)
+              (forward-line))
+          (setq mode 'top-comment))
          (skip-chars-forward " \r\t\n")
          (beginning-of-line))
         ;; Cache returned exact match: return it.
@@ -5523,7 +5527,7 @@ the process stopped before finding the expected result."
              ;; after it.
              ((and (<= elem-end pos) (/= (point-max) elem-end))
               (goto-char elem-end)
-              (setq mode (org-element--next-mode type nil)))
+              (setq mode (org-element--next-mode mode type nil)))
              ;; A non-greater element contains point: return it.
              ((not (memq type org-element-greater-elements))
               (throw 'exit element))
@@ -5551,7 +5555,7 @@ the process stopped before finding the expected result."
                                    (and (= cend pos) (= (point-max) pos)))))
                   (goto-char (or next cbeg))
                   (setq next nil
-                        mode (org-element--next-mode type t)
+                        mode (org-element--next-mode mode type t)
                         parent element
                         end cend))))
              ;; Otherwise, return ELEMENT as it is the smallest
@@ -5815,7 +5819,7 @@ element.
 
 Possible types are defined in `org-element-all-elements'.
 Properties depend on element or object type, but always include
-`:begin', `:end', `:parent' and `:post-blank' properties.
+`:begin', `:end', and `:post-blank' properties.
 
 As a special case, if point is at the very beginning of the first
 item in a list or sub-list, returned element will be that list
diff --git a/lisp/org/org-entities.el b/lisp/org/org-entities.el
index e32ce26..eb09899 100644
--- a/lisp/org/org-entities.el
+++ b/lisp/org/org-entities.el
@@ -1,6 +1,6 @@
 ;;; org-entities.el --- Support for Special Entities -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>,
 ;;         Ulf Stegemann <ulf at zeitform dot de>
@@ -27,6 +27,7 @@
 
 ;;; Code:
 
+(declare-function org-mode "org" ())
 (declare-function org-toggle-pretty-entities "org"       ())
 (declare-function org-table-align            "org-table" ())
 
@@ -226,7 +227,7 @@ packages to be loaded, add these packages to 
`org-latex-packages-alist'."
      ("beth" "\\beth" t "&beth;" "beth" "beth" "ב")
      ("dalet" "\\daleth" t "&daleth;" "dalet" "dalet" "ד")
 
-     "** Dead languages"
+     "** Icelandic"
      ("ETH" "\\DH{}" nil "&ETH;" "D" "Ð" "Ð")
      ("eth" "\\dh{}" nil "&eth;" "dh" "ð" "ð")
      ("THORN" "\\TH{}" nil "&THORN;" "TH" "Þ" "Þ")
@@ -386,7 +387,7 @@ packages to be loaded, add these packages to 
`org-latex-packages-alist'."
      ("exists" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
      ("nexist" "\\nexists" t "&exist;" "[there does not exists]" "[there does 
not  exists]" "∄")
      ("nexists" "\\nexists" t "&exist;" "[there does not exists]" "[there does 
not  exists]" "∄")
-     ("empty" "\\empty" t "&empty;" "[empty set]" "[empty set]" "∅")
+     ("empty" "\\emptyset" t "&empty;" "[empty set]" "[empty set]" "∅")
      ("emptyset" "\\emptyset" t "&empty;" "[empty set]" "[empty set]" "∅")
      ("isin" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
      ("in" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 30eab9b..c56873b 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -1,6 +1,6 @@
 ;;; org-faces.el --- Face definitions -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -243,6 +243,15 @@ is of course immediately visible, but for example a passed 
deadline is
 of the frame, for example."
   :group 'org-faces)
 
+(defface org-headline-todo       ;Copied from `font-lock-string-face'
+  '((((class color) (min-colors 16) (background light)) (:foreground "Red4"))
+    (((class color) (min-colors 16) (background dark)) (:foreground "Pink2"))
+    (((class color) (min-colors 8)  (background light)) (:bold t)))
+  "Face used to indicate that a headline is marked as TODO.
+This face is only used if `org-fontify-todo-headline' is set.  If applies
+to the part of the headline after the TODO keyword."
+  :group 'org-faces)
+
 (defface org-headline-done       ;Copied from `font-lock-string-face'
   '((((class color) (min-colors 16) (background light)) (:foreground 
"RosyBrown"))
     (((class color) (min-colors 16) (background dark)) (:foreground 
"LightSalmon"))
@@ -355,6 +364,12 @@ changes."
   "Face used for tables."
   :group 'org-faces)
 
+(defface org-table-header '((t :inherit org-table
+                              :background "LightGray"
+                              :foreground "Black"))
+  "Face for table header."
+  :group 'org-faces)
+
 (defface org-formula
   '((((class color) (min-colors 88) (background light)) (:foreground 
"Firebrick"))
     (((class color) (min-colors 88) (background dark)) (:foreground 
"chocolate1"))
@@ -393,9 +408,17 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword."
   "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords."
   :group 'org-faces)
 
-(defface org-block '((t :inherit shadow))
-  "Face text in #+begin ... #+end blocks.
-For source-blocks `org-src-block-faces' takes precedence."
+(defface org-block `((t :inherit shadow
+                       ,@(and (>= emacs-major-version 27) '(:extend t))))
+  "Face used for text inside various blocks.
+
+It is always used for source blocks.  You can refine what face
+should be used depending on the source block language by setting,
+`org-src-block-faces', which takes precedence.
+
+When `org-fontify-quote-and-verse-blocks' is not nil, text inside
+verse and quote blocks are fontified using the `org-verse' and
+`org-quote' faces, which inherit from `org-block'."
   :group 'org-faces
   :version "26.1")
 
diff --git a/lisp/org/org-feed.el b/lisp/org/org-feed.el
index 58bbba7..5dbd887 100644
--- a/lisp/org/org-feed.el
+++ b/lisp/org/org-feed.el
@@ -1,6 +1,6 @@
 ;;; org-feed.el --- Add RSS feed items to Org files  -*- lexical-binding: t; 
-*-
 ;;
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el
index 14b0a2a..3d42421 100644
--- a/lisp/org/org-footnote.el
+++ b/lisp/org/org-footnote.el
@@ -1,6 +1,6 @@
 ;;; org-footnote.el --- Footnote support in Org      -*- lexical-binding: t; 
-*-
 ;;
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org/org-goto.el b/lisp/org/org-goto.el
index dd9c0fa..163aa58 100644
--- a/lisp/org/org-goto.el
+++ b/lisp/org/org-goto.el
@@ -1,6 +1,6 @@
 ;;; org-goto.el --- Fast navigation in an Org buffer  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -22,27 +22,8 @@
 
 ;;; Code:
 
-(require 'org-macs)
-(require 'org-compat)
-
-(declare-function org-at-heading-p "org" (&optional ignored))
-(declare-function org-beginning-of-line "org" (&optional n))
-(declare-function org-defkey "org" (keymap key def))
-(declare-function org-mark-ring-push "org" (&optional pos buffer))
-(declare-function org-overview "org" ())
-(declare-function org-refile-check-position "org" (refile-pointer))
-(declare-function org-refile-get-location "org" (&optional prompt 
default-buffer new-nodes))
-(declare-function org-show-context "org" (&optional key))
-(declare-function org-show-set-visibility "org" (detail))
-
-(defvar org-complex-heading-regexp)
-(defvar org-startup-align-all-tables)
-(defvar org-startup-folded)
-(defvar org-startup-truncated)
-(defvar org-special-ctrl-a/e)
-(defvar org-refile-target-verify-function)
-(defvar org-refile-use-outline-path)
-(defvar org-refile-targets)
+(require 'org)
+(require 'org-refile)
 
 (defvar org-goto-exit-command nil)
 (defvar org-goto-map nil)
@@ -234,20 +215,15 @@ position or nil."
         (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
         (pop-to-buffer-same-window
          (condition-case nil
-             (make-indirect-buffer (current-buffer) "*org-goto*")
-           (error (make-indirect-buffer (current-buffer) "*org-goto*"))))
+             (make-indirect-buffer (current-buffer) "*org-goto*" t)
+           (error (make-indirect-buffer (current-buffer) "*org-goto*" t))))
         (let (temp-buffer-show-function temp-buffer-show-hook)
           (with-output-to-temp-buffer "*Org Help*"
           (princ (format help (if org-goto-auto-isearch
                                   "  Just type for auto-isearch."
                                 "  n/p/f/b/u to navigate, q to quit.")))))
         (org-fit-window-to-buffer (get-buffer-window "*Org Help*"))
-        (setq buffer-read-only nil)
-        (let ((org-startup-truncated t)
-              (org-startup-folded nil)
-              (org-startup-align-all-tables nil))
-          (org-mode)
-          (org-overview))
+        (org-overview)
         (setq buffer-read-only t)
         (if (and (boundp 'org-goto-start-pos)
                  (integer-or-marker-p org-goto-start-pos))
@@ -309,4 +285,8 @@ With a prefix argument, use the alternative interface: 
e.g., if
 
 (provide 'org-goto)
 
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; org-goto.el ends here
diff --git a/lisp/org/org-habit.el b/lisp/org/org-habit.el
index e1d13b8..231c08b 100644
--- a/lisp/org/org-habit.el
+++ b/lisp/org/org-habit.el
@@ -1,6 +1,6 @@
 ;;; org-habit.el --- The habit tracking code for Org -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw at gnu dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -90,7 +90,7 @@ It will be green even if it was done after the deadline."
   :type 'boolean)
 
 (defcustom org-habit-scheduled-past-days nil
-  "Value to use instead of `org-scheduled-past-days', for habits only.
+"Value to use instead of `org-scheduled-past-days', for habits only.
 
 If nil, `org-scheduled-past-days' is used.
 
@@ -343,7 +343,10 @@ current time."
              (if (and in-the-past-p
                       (not last-done-date)
                       (not (< scheduled now)))
-                 '(org-habit-clear-face . org-habit-clear-future-face)
+                 (if (and all-done-dates (= (car all-done-dates) start))
+                     ;; This is the very first done of this habit.
+                     '(org-habit-ready-face . org-habit-ready-future-face)
+                   '(org-habit-clear-face . org-habit-clear-future-face))
                (org-habit-get-faces
                 habit start
                 (and in-the-past-p
@@ -409,7 +412,7 @@ current time."
                           'help-echo
                           (concat (format-time-string
                                    (org-time-stamp-format)
-                                    (time-add starting (days-to-time (- start 
(time-to-days starting)))))
+                                   (time-add starting (days-to-time (- start 
(time-to-days starting)))))
                                   (if donep " DONE" ""))
                           graph))
       (setq start (1+ start)
@@ -436,7 +439,7 @@ current time."
              habit
              (time-subtract moment (days-to-time org-habit-preceding-days))
              moment
-              (time-add moment (days-to-time org-habit-following-days))))))
+             (time-add moment (days-to-time org-habit-following-days))))))
        (forward-line)))))
 
 (defun org-habit-toggle-habits ()
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index 3efbde0..b3b98c6 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -1,6 +1,6 @@
 ;;; org-id.el --- Global identifiers for Org entries -*- lexical-binding: t; 
-*-
 ;;
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -71,11 +71,11 @@
 ;;; Code:
 
 (require 'org)
+(require 'org-refile)
 (require 'ol)
 
 (declare-function message-make-fqdn "message" ())
 (declare-function org-goto-location "org-goto" (&optional _buf help))
-(declare-function org-link-set-parameters "ol" (type &rest rest))
 
 ;;; Customization
 
@@ -259,6 +259,11 @@ Create an ID if necessary."
   (interactive)
   (org-kill-new (org-id-get nil 'create)))
 
+(defvar org-id-overriding-file-name nil
+  "Tell `org-id-get' to use this as the file name when creating an ID.
+This is useful when working with contents in a temporary buffer
+that will be copied back to the original.")
+
 ;;;###autoload
 (defun org-id-get (&optional pom create prefix)
   "Get the ID property of the entry at point-or-marker POM.
@@ -275,7 +280,9 @@ In any case, the ID of the entry is returned."
        (create
        (setq id (org-id-new prefix))
        (org-entry-put pom "ID" id)
-       (org-id-add-location id (buffer-file-name (buffer-base-buffer)))
+       (org-id-add-location id
+                            (or org-id-overriding-file-name
+                                (buffer-file-name (buffer-base-buffer))))
        id)))))
 
 ;;;###autoload
@@ -478,55 +485,64 @@ This will scan all agenda files, all associated archives, 
and all
 files currently mentioned in `org-id-locations'.
 When FILES is given, scan also these files."
   (interactive)
-  (if (not org-id-track-globally)
-      (error "Please turn on `org-id-track-globally' if you want to track IDs")
-    (let* ((files (delete-dups
-                  (mapcar #'file-truename
-                          (append
-                           ;; Agenda files and all associated archives
-                           (org-agenda-files t org-id-search-archives)
-                           ;; Explicit extra files
-                           (unless (symbolp org-id-extra-files)
-                             org-id-extra-files)
-                           ;; All files known to have IDs
-                           org-id-files
-                           ;; function input
-                           files))))
-          (nfiles (length files))
-          ids seen-ids (ndup 0) (i 0) file-id-alist)
-      (with-temp-buffer
-       (delay-mode-hooks
-         (org-mode)
-          (dolist (file files)
-           (unless silent
-              (setq i (1+ i))
-              (message "Finding ID locations (%d/%d files): %s"
-                       i nfiles file))
-           (when (file-exists-p file)
-             (insert-file-contents file nil nil nil 'replace)
-             (setq ids (org-map-entries
-                        (lambda ()
-                          (org-entry-get (point) "ID"))
-                        "ID<>\"\""))
-             (dolist (id ids)
-               (if (member id seen-ids)
-                   (progn
-                     (message "Duplicate ID \"%s\"" id)
-                     (setq ndup (1+ ndup)))
-                 (push id seen-ids)))
+  (unless org-id-track-globally
+    (error "Please turn on `org-id-track-globally' if you want to track IDs"))
+  (setq org-id-locations nil)
+  (let* ((files
+          (delete-dups
+           (mapcar #'file-truename
+                   (cl-remove-if-not
+                   ;; Default `org-id-extra-files' value contains
+                   ;; `agenda-archives' symbol.
+                   #'stringp
+                   (append
+                    ;; Agenda files and all associated archives.
+                    (org-agenda-files t org-id-search-archives)
+                    ;; Explicit extra files.
+                    (if (symbolp org-id-extra-files)
+                        (symbol-value org-id-extra-files)
+                      org-id-extra-files)
+                    ;; All files known to have IDs.
+                    org-id-files
+                    ;; Additional files from function call.
+                    files)))))
+         (nfiles (length files))
+         (id-regexp
+         (rx (seq bol (0+ (any "\t ")) ":ID:" (1+ " ") (not (any " ")))))
+         (seen-ids nil)
+         (ndup 0)
+         (i 0))
+    (dolist (file files)
+      (when (file-exists-p file)
+        (unless silent
+          (cl-incf i)
+          (message "Finding ID locations (%d/%d files): %s" i nfiles file))
+        (with-current-buffer (find-file-noselect file t)
+          (let ((ids nil)
+                (case-fold-search t))
+            (org-with-point-at 1
+              (while (re-search-forward id-regexp nil t)
+                (when (org-at-property-p)
+                  (push (org-entry-get (point) "ID") ids)))
               (when ids
-               (setq file-id-alist (cons (cons (abbreviate-file-name file) ids)
-                                         file-id-alist)))))))
-      (setq org-id-locations file-id-alist)
-      (setq org-id-files (mapcar 'car org-id-locations))
-      (org-id-locations-save)
-      ;; now convert to a hash
-      (setq org-id-locations (org-id-alist-to-hash org-id-locations))
-      (when (> ndup 0)
-       (warn "WARNING: %d duplicate IDs found, check *Messages* buffer" ndup))
-      (message "%d files scanned, %d files contains IDs and in total %d IDs 
found."
-              nfiles (length org-id-files) (hash-table-count org-id-locations))
-      org-id-locations)))
+                (push (cons (abbreviate-file-name file) ids)
+                      org-id-locations)
+                (dolist (id ids)
+                  (cond
+                   ((not (member id seen-ids)) (push id seen-ids))
+                   (silent nil)
+                   (t
+                    (message "Duplicate ID %S" id)
+                    (cl-incf ndup))))))))))
+    (setq org-id-files (mapcar #'car org-id-locations))
+    (org-id-locations-save)
+    ;; Now convert to a hash table.
+    (setq org-id-locations (org-id-alist-to-hash org-id-locations))
+    (when (and (not silent) (> ndup 0))
+      (warn "WARNING: %d duplicate IDs found, check *Messages* buffer" ndup))
+    (message "%d files scanned, %d files contains IDs, and %d IDs found."
+             nfiles (length org-id-files) (hash-table-count org-id-locations))
+    org-id-locations))
 
 (defun org-id-locations-save ()
   "Save `org-id-locations' in `org-id-locations-file'."
@@ -572,8 +588,10 @@ When FILES is given, scan also these files."
 (defun org-id-add-location (id file)
   "Add the ID with location FILE to the database of ID locations."
   ;; Only if global tracking is on, and when the buffer has a file
+  (unless file
+    (error "bug: org-id-get expects a file-visiting buffer"))
   (let ((afile (abbreviate-file-name file)))
-    (when (and org-id-track-globally id file)
+    (when (and org-id-track-globally id)
       (unless org-id-locations (org-id-locations-load))
       (puthash id afile org-id-locations)
       (unless (member afile org-id-files)
@@ -631,7 +649,7 @@ When FILES is given, scan also these files."
   (or (and org-id-locations
           (hash-table-p org-id-locations)
           (gethash id org-id-locations))
-      ;; ball back on current buffer
+      ;; Fall back on current buffer
       (buffer-file-name (or (buffer-base-buffer (current-buffer))
                            (current-buffer)))))
 
@@ -665,8 +683,11 @@ optional argument MARKERP, return the position as a new 
marker."
     (let* ((link (concat "id:" (org-id-get-create)))
           (case-fold-search nil)
           (desc (save-excursion
-                  (org-back-to-heading t)
-                  (or (and (looking-at org-complex-heading-regexp)
+                  (org-back-to-heading-or-point-min t)
+                  (or (and (org-before-first-heading-p)
+                           (file-name-nondirectory
+                            (buffer-file-name (buffer-base-buffer))))
+                      (and (looking-at org-complex-heading-regexp)
                            (if (match-end 4)
                                (match-string 4)
                              (match-string 0)))
@@ -674,7 +695,7 @@ optional argument MARKERP, return the position as a new 
marker."
       (org-link-store-props :link link :description desc :type "id")
       link)))
 
-(defun org-id-open (id)
+(defun org-id-open (id _)
   "Go to the entry with id ID."
   (org-mark-ring-push)
   (let ((m (org-id-find id 'marker))
diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el
index 5171919..c6bf416 100644
--- a/lisp/org/org-indent.el
+++ b/lisp/org/org-indent.el
@@ -1,6 +1,6 @@
 ;;; org-indent.el --- Dynamic indentation for Org    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -71,8 +71,6 @@ Delay used when the buffer to initialize isn't current.")
 (defvar org-indent--initial-marker nil
   "Position of initialization before interrupt.
 This is used locally in each buffer being initialized.")
-(defvar org-hide-leading-stars-before-indent-mode nil
-  "Used locally.")
 (defvar org-indent-modified-headline-flag nil
   "Non-nil means the last deletion operated on a headline.
 It is modified by `org-indent-notify-modified-headline'.")
@@ -87,15 +85,13 @@ it may be prettier to customize the `org-indent' face."
   :type 'character)
 
 (defcustom org-indent-mode-turns-off-org-adapt-indentation t
-  "Non-nil means setting the variable `org-indent-mode' will \
-turn off indentation adaptation.
+  "Non-nil means setting `org-indent-mode' will turn off indentation 
adaptation.
 For details see the variable `org-adapt-indentation'."
   :group 'org-indent
   :type 'boolean)
 
 (defcustom org-indent-mode-turns-on-hiding-stars t
-  "Non-nil means setting the variable `org-indent-mode' will \
-turn on `org-hide-leading-stars'."
+  "Non-nil means setting `org-indent-mode' will turn on 
`org-hide-leading-stars'."
   :group 'org-indent
   :type 'boolean)
 
@@ -178,10 +174,11 @@ during idle time."
     (setq-local indent-tabs-mode nil)
     (setq-local org-indent--initial-marker (copy-marker 1))
     (when org-indent-mode-turns-off-org-adapt-indentation
-      (setq-local org-adapt-indentation nil))
+      ;; Don't turn off `org-adapt-indentation' when its value is
+      ;; 'headline-data, just indent headline data specially.
+      (or (eq org-adapt-indentation 'headline-data)
+         (setq-local org-adapt-indentation nil)))
     (when org-indent-mode-turns-on-hiding-stars
-      (setq-local org-hide-leading-stars-before-indent-mode
-                 org-hide-leading-stars)
       (setq-local org-hide-leading-stars t))
     (org-indent--compute-prefixes)
     (if (boundp 'filter-buffer-substring-functions)
@@ -207,15 +204,14 @@ during idle time."
       (setq org-indent-agent-timer
            (run-with-idle-timer 0.2 t #'org-indent-initialize-agent))))
    (t
-    ;; mode was turned off (or we refused to turn it on)
+    ;; Mode was turned off (or we refused to turn it on)
     (kill-local-variable 'org-adapt-indentation)
     (setq org-indent-agentized-buffers
          (delq (current-buffer) org-indent-agentized-buffers))
     (when (markerp org-indent--initial-marker)
       (set-marker org-indent--initial-marker nil))
-    (when (boundp 'org-hide-leading-stars-before-indent-mode)
-      (setq-local org-hide-leading-stars
-                 org-hide-leading-stars-before-indent-mode))
+    (when (local-variable-p 'org-hide-leading-stars)
+      (kill-local-variable 'org-hide-leading-stars))
     (if (boundp 'filter-buffer-substring-functions)
        (remove-hook 'filter-buffer-substring-functions
                     (lambda (fun start end delete)
@@ -365,7 +361,18 @@ stopped."
              level (org-list-item-body-column (point))))
            ;; Regular line.
            (t
-            (org-indent-set-line-properties level 
(current-indentation))))))))))
+            (org-indent-set-line-properties
+             level
+             (current-indentation)
+             ;; When adapt indentation is 'headline-data, use
+             ;; `org-indent--heading-line-prefixes' for setting
+             ;; headline data indentation.
+             (and (eq org-adapt-indentation 'headline-data)
+                  (or (org-at-planning-p)
+                      (org-at-clock-log-p)
+                      (looking-at-p org-property-start-re)
+                      (looking-at-p org-property-end-re)
+                      (looking-at-p org-property-re))))))))))))
 
 (defun org-indent-notify-modified-headline (beg end)
   "Set `org-indent-modified-headline-flag' depending on context.
diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el
index 60e3e0c..48402b0 100644
--- a/lisp/org/org-inlinetask.el
+++ b/lisp/org/org-inlinetask.el
@@ -1,6 +1,6 @@
 ;;; org-inlinetask.el --- Tasks Independent of Outline Hierarchy -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org/org-keys.el b/lisp/org/org-keys.el
index 4d4e124..f0fdb79 100644
--- a/lisp/org/org-keys.el
+++ b/lisp/org/org-keys.el
@@ -1,6 +1,6 @@
 ;;; org-keys.el --- Key bindings for Org mode        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
 
@@ -56,7 +56,7 @@
 (declare-function org-clone-subtree-with-time-shift "org" (n &optional shift))
 (declare-function org-columns "org" (&optional global columns-fmt-string))
 (declare-function org-comment-dwim "org" (arg))
-(declare-function org-copy "org" ())
+(declare-function org-refile-copy "org" ())
 (declare-function org-copy-special "org" ())
 (declare-function org-copy-visible "org" (beg end))
 (declare-function org-ctrl-c-ctrl-c "org" (&optional arg))
@@ -148,7 +148,7 @@
 (declare-function org-remove-file "org" (&optional file))
 (declare-function org-resolve-clocks "org" (&optional only-dangling-p 
prompt-fn last-valid))
 (declare-function org-return "org" (&optional indent))
-(declare-function org-return-indent "org" ())
+(declare-function org-return-and-maybe-indent "org" ())
 (declare-function org-reveal "org" (&optional siblings))
 (declare-function org-schedule "org" (arg &optional time))
 (declare-function org-self-insert-command "org" (N))
@@ -196,6 +196,7 @@
 (declare-function org-todo "org" (&optional arg1))
 (declare-function org-toggle-archive-tag "org" (&optional find-done))
 (declare-function org-toggle-checkbox "org" (&optional toggle-presence))
+(declare-function org-toggle-radio-button "org" (&optional arg))
 (declare-function org-toggle-comment "org" ())
 (declare-function org-toggle-fixed-width "org" ())
 (declare-function org-toggle-inline-images "org" (&optional include-linked))
@@ -218,7 +219,7 @@
 ;;; Variables
 
 (defvar org-mode-map (make-sparse-keymap)
-  "Keymap fo Org mode.")
+  "Keymap for Org mode.")
 
 (defvaralias 'org-CUA-compatible 'org-replace-disputed-keys)
 
@@ -444,7 +445,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command 
names."
 ;;;; TAB key with modifiers
 (org-defkey org-mode-map (kbd "C-i") #'org-cycle)
 (org-defkey org-mode-map (kbd "<tab>") #'org-cycle)
-(org-defkey org-mode-map (kbd "C-<tab>") #'org-force-cycle-archived)
+(org-defkey org-mode-map (kbd "C-c C-<tab>") #'org-force-cycle-archived)
 ;; Override text-mode binding to expose `complete-symbol' for
 ;; pcomplete functionality.
 (org-defkey org-mode-map (kbd "M-<tab>") nil)
@@ -580,7 +581,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command 
names."
 (org-defkey org-mode-map (kbd "C-c C-d") #'org-deadline)
 (org-defkey org-mode-map (kbd "C-c ;") #'org-toggle-comment)
 (org-defkey org-mode-map (kbd "C-c C-w") #'org-refile)
-(org-defkey org-mode-map (kbd "C-c M-w") #'org-copy)
+(org-defkey org-mode-map (kbd "C-c M-w") #'org-refile-copy)
 (org-defkey org-mode-map (kbd "C-c /") #'org-sparse-tree) ;minor-mode reserved
 (org-defkey org-mode-map (kbd "C-c \\") #'org-match-sparse-tree) ;minor-mode r.
 (org-defkey org-mode-map (kbd "C-c RET") #'org-ctrl-c-ret)
@@ -617,7 +618,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command 
names."
 (org-defkey org-mode-map (kbd "C-c C-k") #'org-kill-note-or-show-branches)
 (org-defkey org-mode-map (kbd "C-c #") #'org-update-statistics-cookies)
 (org-defkey org-mode-map (kbd "RET") #'org-return)
-(org-defkey org-mode-map (kbd "C-j") #'org-return-indent)
+(org-defkey org-mode-map (kbd "C-j") #'org-return-and-maybe-indent)
 (org-defkey org-mode-map (kbd "C-c ?") #'org-table-field-info)
 (org-defkey org-mode-map (kbd "C-c SPC") #'org-table-blank-field)
 (org-defkey org-mode-map (kbd "C-c +") #'org-table-sum)
@@ -658,6 +659,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command 
names."
 (org-defkey org-mode-map (kbd "C-c C-x C-M-v") #'org-redisplay-inline-images)
 (org-defkey org-mode-map (kbd "C-c C-x \\") #'org-toggle-pretty-entities)
 (org-defkey org-mode-map (kbd "C-c C-x C-b") #'org-toggle-checkbox)
+(org-defkey org-mode-map (kbd "C-c C-x C-r") #'org-toggle-radio-button)
 (org-defkey org-mode-map (kbd "C-c C-x p") #'org-set-property)
 (org-defkey org-mode-map (kbd "C-c C-x P") #'org-set-property-and-value)
 (org-defkey org-mode-map (kbd "C-c C-x e") #'org-set-effort)
@@ -923,6 +925,10 @@ a-list placed behind the generic `org-babel-key-prefix'.")
   (interactive)
   (describe-bindings org-babel-key-prefix))
 
-
 (provide 'org-keys)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; org-keys.el ends here
diff --git a/lisp/org/org-lint.el b/lisp/org/org-lint.el
index 5be1ec7..2e080cc 100644
--- a/lisp/org/org-lint.el
+++ b/lisp/org/org-lint.el
@@ -1,6 +1,6 @@
 ;;; org-lint.el --- Linting for Org documents        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -108,6 +108,7 @@
 (require 'cl-lib)
 (require 'ob)
 (require 'ol)
+(require 'org-attach)
 (require 'org-macro)
 (require 'ox)
 
@@ -423,8 +424,10 @@ instead"
 
 (defun org-lint-deprecated-header-syntax (ast)
   (let* ((deprecated-babel-properties
-         (mapcar (lambda (arg) (symbol-name (car arg)))
-                 org-babel-common-header-args-w-values))
+         ;; DIR is also used for attachments.
+         (delete "dir"
+                 (mapcar (lambda (arg) (downcase (symbol-name (car arg))))
+                         org-babel-common-header-args-w-values)))
         (deprecated-re
          (format "\\`%s[ \t]" (regexp-opt deprecated-babel-properties t))))
     (org-element-map ast '(keyword node-property)
@@ -541,15 +544,16 @@ Use :header-args: instead"
   (org-element-map ast 'drawer
     (lambda (d)
       (when (equal (org-element-property :drawer-name d) "PROPERTIES")
-       (let ((section (org-element-lineage d '(section))))
-         (unless (org-element-map section 'property-drawer #'identity nil t)
-           (list (org-element-property :post-affiliated d)
-                 (if (save-excursion
-                       (goto-char (org-element-property :post-affiliated d))
-                       (forward-line -1)
-                       (or (org-at-heading-p) (org-at-planning-p)))
-                     "Incorrect contents for PROPERTIES drawer"
-                   "Incorrect location for PROPERTIES drawer"))))))))
+       (let ((headline? (org-element-lineage d '(headline)))
+             (before
+              (mapcar #'org-element-type
+                      (assq d (reverse (org-element-contents
+                                        (org-element-property :parent d)))))))
+         (list (org-element-property :post-affiliated d)
+               (if (or (and headline? (member before '(nil (planning))))
+                       (and (null headline?) (member before '(nil (comment)))))
+                   "Incorrect contents for PROPERTIES drawer"
+                 "Incorrect location for PROPERTIES drawer")))))))
 
 (defun org-lint-invalid-effort-property (ast)
   (org-element-map ast 'node-property
@@ -564,16 +568,23 @@ Use :header-args: instead"
 (defun org-lint-link-to-local-file (ast)
   (org-element-map ast 'link
     (lambda (l)
-      (when (equal "file" (org-element-property :type l))
-       (let ((file (org-element-property :path l)))
-         (and (not (file-remote-p file))
-              (not (file-exists-p file))
-              (list (org-element-property :begin l)
-                    (format (if (org-element-lineage l '(link))
-                                "Link to non-existent image file \"%s\"\
- in link description"
-                              "Link to non-existent local file \"%s\"")
-                            file))))))))
+      (let ((type (org-element-property :type l)))
+       (pcase type
+         ((or "attachment" "file")
+          (let* ((path (org-element-property :path l))
+                 (file (if (string= type "file")
+                           path
+                          (org-with-point-at (org-element-property :begin l)
+                           (org-attach-expand path)))))
+            (and (not (file-remote-p file))
+                 (not (file-exists-p file))
+                 (list (org-element-property :begin l)
+                       (format (if (org-element-lineage l '(link))
+                                   "Link to non-existent image file %S \
+in description"
+                                 "Link to non-existent local file %S")
+                                file)))))
+         (_ nil))))))
 
 (defun org-lint-non-existent-setupfile-parameter (ast)
   (org-element-map ast 'keyword
@@ -793,15 +804,25 @@ Use \"export %s\" instead"
       (let ((name (org-trim (match-string-no-properties 0)))
            (element (org-element-at-point)))
        (pcase (org-element-type element)
-         ((or `drawer `property-drawer)
-          (goto-char (org-element-property :end element))
-          nil)
+         (`drawer
+          ;; Find drawer opening lines within non-empty drawers.
+          (let ((end (org-element-property :contents-end element)))
+            (when end
+              (while (re-search-forward org-drawer-regexp end t)
+                (let ((n (org-trim (match-string-no-properties 0))))
+                  (push (list (line-beginning-position)
+                              (format "Possible misleading drawer entry %S" n))
+                        reports))))
+            (goto-char (org-element-property :end element))))
+         (`property-drawer
+          (goto-char (org-element-property :end element)))
          ((or `comment-block `example-block `export-block `src-block
               `verse-block)
           nil)
          (_
+          ;; Find drawer opening lines outside of any drawer.
           (push (list (line-beginning-position)
-                      (format "Possible incomplete drawer \"%s\"" name))
+                      (format "Possible incomplete drawer %S" name))
                 reports)))))
     reports))
 
@@ -1257,6 +1278,10 @@ ARG can also be a list of checker names, as symbols, to 
run."
       (org-lint--display-reports (current-buffer) checkers)
       (message "Org linting process completed"))))
 
-
 (provide 'org-lint)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; org-lint.el ends here
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el
index c79325f..39122e7 100644
--- a/lisp/org/org-list.el
+++ b/lisp/org/org-list.el
@@ -1,6 +1,6 @@
 ;;; org-list.el --- Plain lists for Org              -*- lexical-binding: t; 
-*-
 ;;
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;        Bastien Guerry <bzg@gnu.org>
@@ -81,12 +81,12 @@
 (require 'org-compat)
 
 (defvar org-M-RET-may-split-line)
+(defvar org-adapt-indentation)
 (defvar org-auto-align-tags)
 (defvar org-blank-before-new-entry)
 (defvar org-clock-string)
 (defvar org-closed-string)
 (defvar org-deadline-string)
-(defvar org-description-max-indent)
 (defvar org-done-keywords)
 (defvar org-drawer-regexp)
 (defvar org-element-all-objects)
@@ -132,6 +132,7 @@
 (declare-function org-inlinetask-in-task-p "org-inlinetask" ())
 (declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
 (declare-function org-level-increment "org" ())
+(declare-function org-mode "org" ())
 (declare-function org-narrow-to-subtree "org" ())
 (declare-function org-outline-level "org" ())
 (declare-function org-previous-line-empty-p "org" ())
@@ -911,13 +912,13 @@ items, as returned by `org-list-prevs-alist'."
 STRUCT is the list structure."
   (let* ((item-end (org-list-get-item-end item struct))
         (sub-struct (cdr (member (assq item struct) struct)))
-        subtree)
-    (catch 'exit
-      (mapc (lambda (e)
-             (let ((pos (car e)))
-               (if (< pos item-end) (push pos subtree) (throw 'exit nil))))
-           sub-struct))
-    (nreverse subtree)))
+        items)
+    (catch :exit
+      (pcase-dolist (`(,pos . ,_) sub-struct)
+       (if (< pos item-end)
+           (push pos items)
+         (throw :exit nil))))
+    (nreverse items)))
 
 (defun org-list-get-all-items (item struct prevs)
   "List all items in the same sub-list as ITEM.
@@ -1234,125 +1235,127 @@ after the bullet.  Cursor will be after this text 
once the
 function ends.
 
 This function modifies STRUCT."
-  (let ((case-fold-search t))
-    ;; 1. Get information about list: ITEM containing POS, position of
-    ;;    point with regards to item start (BEFOREP), blank lines
-    ;;    number separating items (BLANK-NB), if we're allowed to
-    ;;    (SPLIT-LINE-P).
-    (let* ((item (goto-char (catch :exit
-                             (let ((inner-item 0))
-                               (pcase-dolist (`(,i . ,_) struct)
-                                 (cond
-                                  ((= i pos) (throw :exit i))
-                                  ((< i pos) (setq inner-item i))
-                                  (t (throw :exit inner-item))))
-                               inner-item))))
-          (item-end (org-list-get-item-end item struct))
-          (item-end-no-blank (org-list-get-item-end-before-blank item struct))
-          (beforep
-           (progn
-             (looking-at org-list-full-item-re)
-             (<= pos
-                 (cond
-                  ((not (match-beginning 4)) (match-end 0))
-                  ;; Ignore tag in a non-descriptive list.
-                  ((save-match-data (string-match "[.)]" (match-string 1)))
-                   (match-beginning 4))
-                  (t (save-excursion
-                       (goto-char (match-end 4))
-                       (skip-chars-forward " \t")
-                       (point)))))))
-          (split-line-p (org-get-alist-option org-M-RET-may-split-line 'item))
-          (blank-nb (org-list-separating-blank-lines-number
-                     pos struct prevs))
-          ;; 2. Build the new item to be created.  Concatenate same
-          ;;    bullet as item, checkbox, text AFTER-BULLET if
-          ;;    provided, and text cut from point to end of item
-          ;;    (TEXT-CUT) to form item's BODY.  TEXT-CUT depends on
-          ;;    BEFOREP and SPLIT-LINE-P.  The difference of size
-          ;;    between what was cut and what was inserted in buffer
-          ;;    is stored in SIZE-OFFSET.
-          (ind (org-list-get-ind item struct))
-          (ind-size (if indent-tabs-mode
-                        (+ (/ ind tab-width) (mod ind tab-width))
-                      ind))
-          (bullet (org-list-bullet-string (org-list-get-bullet item struct)))
-          (box (when checkbox "[ ]"))
-          (text-cut
-           (and (not beforep) split-line-p
-                (progn
-                  (goto-char pos)
-                  ;; If POS is greater than ITEM-END, then point is
-                  ;; in some white lines after the end of the list.
-                  ;; Those must be removed, or they will be left,
-                  ;; stacking up after the list.
-                  (when (< item-end pos)
-                    (delete-region (1- item-end) (point-at-eol)))
-                  (skip-chars-backward " \r\t\n")
-                  (setq pos (point))
-                  (delete-and-extract-region pos item-end-no-blank))))
-          (body (concat bullet (when box (concat box " ")) after-bullet
-                        (and text-cut
-                             (if (string-match "\\`[ \t]+" text-cut)
-                                 (replace-match "" t t text-cut)
-                               text-cut))))
-          (item-sep (make-string  (1+ blank-nb) ?\n))
-          (item-size (+ ind-size (length body) (length item-sep)))
-          (size-offset (- item-size (length text-cut))))
-      ;; 4. Insert effectively item into buffer.
-      (goto-char item)
-      (indent-to-column ind)
-      (insert body item-sep)
-      ;; 5. Add new item to STRUCT.
-      (mapc (lambda (e)
-              (let ((p (car e)) (end (nth 6 e)))
-                (cond
-                ;; Before inserted item, positions don't change but
-                ;; an item ending after insertion has its end shifted
-                ;; by SIZE-OFFSET.
-                ((< p item)
-                 (when (> end item) (setcar (nthcdr 6 e) (+ end size-offset))))
-                ;; Trivial cases where current item isn't split in
-                ;; two.  Just shift every item after new one by
-                ;; ITEM-SIZE.
-                ((or beforep (not split-line-p))
-                 (setcar e (+ p item-size))
-                 (setcar (nthcdr 6 e) (+ end item-size)))
-                ;; Item is split in two: elements before POS are just
-                ;; shifted by ITEM-SIZE.  In the case item would end
-                ;; after split POS, ending is only shifted by
-                ;; SIZE-OFFSET.
-                ((< p pos)
-                 (setcar e (+ p item-size))
-                 (if (< end pos)
-                     (setcar (nthcdr 6 e) (+ end item-size))
-                   (setcar (nthcdr 6 e) (+ end size-offset))))
-                ;; Elements after POS are moved into new item.
-                ;; Length of ITEM-SEP has to be removed as ITEM-SEP
-                ;; doesn't appear in buffer yet.
-                ((< p item-end)
-                 (setcar e (+ p size-offset (- item pos (length item-sep))))
-                 (if (= end item-end)
-                     (setcar (nthcdr 6 e) (+ item item-size))
-                   (setcar (nthcdr 6 e)
-                           (+ end size-offset
-                              (- item pos (length item-sep))))))
-                ;; Elements at ITEM-END or after are only shifted by
-                ;; SIZE-OFFSET.
-                (t (setcar e (+ p size-offset))
-                   (setcar (nthcdr 6 e) (+ end size-offset))))))
-           struct)
-      (push (list item ind bullet nil box nil (+ item item-size)) struct)
-      (setq struct (sort struct (lambda (e1 e2) (< (car e1) (car e2)))))
-      ;; 6. If not BEFOREP, new item must appear after ITEM, so
-      ;; exchange ITEM with the next item in list.  Position cursor
-      ;; after bullet, counter, checkbox, and label.
-      (if beforep
-         (goto-char item)
-       (setq struct (org-list-swap-items item (+ item item-size) struct))
-       (goto-char (org-list-get-next-item
-                   item struct (org-list-prevs-alist struct))))
-      struct)))
+  (let* ((case-fold-search t)
+        ;; Get information about list: ITEM containing POS, position
+        ;; of point with regards to item start (BEFOREP), blank lines
+        ;; number separating items (BLANK-NB), if we're allowed to
+        ;; (SPLIT-LINE-P).
+        (item
+         (catch :exit
+           (let ((i nil))
+             (pcase-dolist (`(,start ,_ ,_ ,_ ,_ ,_ ,end) struct)
+               (cond
+                ((> start pos) (throw :exit i))
+                ((< end pos) nil)      ;skip sub-lists before point
+                (t (setq i start))))
+             ;; If no suitable item is found, insert a sibling of the
+             ;; last item in buffer.
+             (or i (caar (reverse struct))))))
+        (item-end (org-list-get-item-end item struct))
+        (item-end-no-blank (org-list-get-item-end-before-blank item struct))
+        (beforep
+         (progn
+           (goto-char item)
+           (looking-at org-list-full-item-re)
+           (<= pos
+               (cond
+                ((not (match-beginning 4)) (match-end 0))
+                ;; Ignore tag in a non-descriptive list.
+                ((save-match-data (string-match "[.)]" (match-string 1)))
+                 (match-beginning 4))
+                (t (save-excursion
+                     (goto-char (match-end 4))
+                     (skip-chars-forward " \t")
+                     (point)))))))
+        (split-line-p (org-get-alist-option org-M-RET-may-split-line 'item))
+        (blank-nb (org-list-separating-blank-lines-number pos struct prevs))
+        ;; Build the new item to be created.  Concatenate same bullet
+        ;; as item, checkbox, text AFTER-BULLET if provided, and text
+        ;; cut from point to end of item (TEXT-CUT) to form item's
+        ;; BODY.  TEXT-CUT depends on BEFOREP and SPLIT-LINE-P.  The
+        ;; difference of size between what was cut and what was
+        ;; inserted in buffer is stored in SIZE-OFFSET.
+        (ind (org-list-get-ind item struct))
+        (ind-size (if indent-tabs-mode
+                      (+ (/ ind tab-width) (mod ind tab-width))
+                    ind))
+        (bullet (org-list-bullet-string (org-list-get-bullet item struct)))
+        (box (and checkbox "[ ]"))
+        (text-cut
+         (and (not beforep)
+              split-line-p
+              (progn
+                (goto-char pos)
+                ;; If POS is greater than ITEM-END, then point is in
+                ;; some white lines after the end of the list.  Those
+                ;; must be removed, or they will be left, stacking up
+                ;; after the list.
+                (when (< item-end pos)
+                  (delete-region (1- item-end) (point-at-eol)))
+                (skip-chars-backward " \r\t\n")
+                ;; Cut position is after any blank on the line.
+                (save-excursion
+                  (skip-chars-forward " \t")
+                  (setq pos (point)))
+                (delete-and-extract-region (point) item-end-no-blank))))
+        (body
+         (concat bullet
+                 (and box (concat box " "))
+                 after-bullet
+                 (and text-cut
+                      (if (string-match "\\`[ \t]+" text-cut)
+                          (replace-match "" t t text-cut)
+                        text-cut))))
+        (item-sep (make-string  (1+ blank-nb) ?\n))
+        (item-size (+ ind-size (length body) (length item-sep)))
+        (size-offset (- item-size (length text-cut))))
+    ;; Insert effectively item into buffer.
+    (goto-char item)
+    (indent-to-column ind)
+    (insert body item-sep)
+    ;; Add new item to STRUCT.
+    (dolist (e struct)
+      (let ((p (car e)) (end (nth 6 e)))
+       (cond
+        ;; Before inserted item, positions don't change but an item
+        ;; ending after insertion has its end shifted by SIZE-OFFSET.
+        ((< p item)
+         (when (> end item)
+           (setcar (nthcdr 6 e) (+ end size-offset))))
+        ;; Item where insertion happens may be split in two parts.
+        ;; In this case, move start by ITEM-SIZE and end by
+        ;; SIZE-OFFSET.
+        ((and (= p item) (not beforep) split-line-p)
+         (setcar e (+ p item-size))
+         (setcar (nthcdr 6 e) (+ end size-offset)))
+        ;; Items starting after modified item fall into two
+        ;; categories.
+        ;;
+        ;; If modified item was split, and current sub-item was
+        ;; located after split point, it was moved to the new item:
+        ;; the part between body start and split point (POS) was
+        ;; removed.  So we compute the length of that part and shift
+        ;; item's positions accordingly.
+        ;;
+        ;; Otherwise, the item was simply shifted by SIZE-OFFSET.
+        ((and split-line-p (not beforep) (>= p pos) (<= p item-end-no-blank))
+         (let ((offset (- pos item ind (length bullet) (length after-bullet))))
+           (setcar e (- p offset))
+           (setcar (nthcdr 6 e) (- end offset))))
+        (t
+         (setcar e (+ p size-offset))
+         (setcar (nthcdr 6 e) (+ end size-offset))))))
+    (push (list item ind bullet nil box nil (+ item item-size)) struct)
+    (setq struct (sort struct #'car-less-than-car))
+    ;; If not BEFOREP, new item must appear after ITEM, so exchange
+    ;; ITEM with the next item in list.  Position cursor after bullet,
+    ;; counter, checkbox, and label.
+    (if beforep
+       (goto-char item)
+      (setq struct (org-list-swap-items item (+ item item-size) struct))
+      (goto-char (org-list-get-next-item
+                 item struct (org-list-prevs-alist struct))))
+    struct))
 
 (defun org-list-delete-item (item struct)
   "Remove ITEM from the list and return the new structure.
@@ -1793,10 +1796,9 @@ This function modifies STRUCT."
        ;; There are boxes checked after an unchecked one: fix that.
        (when (member "[X]" after-unchecked)
          (let ((index (- (length struct) (length after-unchecked))))
-           (mapc (lambda (e)
-                   (when (org-list-get-checkbox e struct)
-                     (org-list-set-checkbox e struct "[ ]")))
-                 (nthcdr index all-items))
+           (dolist (e (nthcdr index all-items))
+             (when (org-list-get-checkbox e struct)
+               (org-list-set-checkbox e struct "[ ]")))
            ;; Verify once again the structure, without ORDERED.
            (org-list-struct-fix-box struct parents prevs nil)
            ;; Return blocking item.
@@ -1807,24 +1809,22 @@ This function modifies STRUCT."
 
 This function modifies STRUCT."
   (let (end-list acc-end)
-    (mapc (lambda (e)
-           (let* ((pos (car e))
-                  (ind-pos (org-list-get-ind pos struct))
-                  (end-pos (org-list-get-item-end pos struct)))
-             (unless (assq end-pos struct)
-               ;; To determine real ind of an ending position that is
-               ;; not at an item, we have to find the item it belongs
-               ;; to: it is the last item (ITEM-UP), whose ending is
-               ;; further than the position we're interested in.
-               (let ((item-up (assoc-default end-pos acc-end '>)))
-                 (push (cons
-                        ;; Else part is for the bottom point.
-                        (if item-up (+ (org-list-get-ind item-up struct) 2) 0)
-                        end-pos)
-                       end-list)))
-             (push (cons ind-pos pos) end-list)
-             (push (cons end-pos pos) acc-end)))
-         struct)
+    (pcase-dolist (`(,pos . ,_) struct)
+      (let ((ind-pos (org-list-get-ind pos struct))
+           (end-pos (org-list-get-item-end pos struct)))
+       (unless (assq end-pos struct)
+         ;; To determine real ind of an ending position that is not
+         ;; at an item, we have to find the item it belongs to: it is
+         ;; the last item (ITEM-UP), whose ending is further than the
+         ;; position we're interested in.
+         (let ((item-up (assoc-default end-pos acc-end #'>)))
+           (push (cons
+                  ;; Else part is for the bottom point.
+                  (if item-up (+ (org-list-get-ind item-up struct) 2) 0)
+                  end-pos)
+                 end-list)))
+       (push (cons ind-pos pos) end-list)
+       (push (cons end-pos pos) acc-end)))
     (setq end-list (sort end-list (lambda (e1 e2) (< (cdr e1) (cdr e2)))))
     (org-list-struct-assoc-end struct end-list)))
 
@@ -2021,10 +2021,9 @@ beginning of the item."
         (item (copy-marker (point-at-bol)))
         (all (org-list-get-all-items (marker-position item) struct prevs))
         (value init-value))
-    (mapc (lambda (e)
-           (goto-char e)
-           (setq value (apply function value args)))
-         (nreverse all))
+    (dolist (e (nreverse all))
+      (goto-char e)
+      (setq value (apply function value args)))
     (goto-char item)
     (move-marker item nil)
     value))
@@ -2046,9 +2045,8 @@ Possible values are: `folded', `children' or `subtree'.  
See
     ;; Then fold every child.
     (let* ((parents (org-list-parents-alist struct))
           (children (org-list-get-children item struct parents)))
-      (mapc (lambda (e)
-             (org-list-set-item-visibility e struct 'folded))
-           children)))
+      (dolist (child children)
+       (org-list-set-item-visibility child struct 'folded))))
    ((eq view 'subtree)
     ;; Show everything
     (let ((item-end (org-list-get-item-end item struct)))
@@ -2303,6 +2301,56 @@ is an integer, 0 means `-', 1 means `+' etc.  If WHICH is
         (org-list-struct-fix-ind struct parents)
         (org-list-struct-apply-struct struct old-struct)))))
 
+;;;###autoload
+(define-minor-mode org-list-checkbox-radio-mode
+  "When turned on, use list checkboxes as radio buttons."
+  nil " CheckBoxRadio" nil
+  (unless (eq major-mode 'org-mode)
+    (user-error "Cannot turn this mode outside org-mode buffers")))
+
+(defun org-toggle-radio-button (&optional arg)
+  "Toggle off all checkboxes and toggle on the one at point."
+  (interactive "P")
+  (if (not (org-at-item-p))
+      (user-error "Cannot toggle checkbox outside of a list")
+    (let* ((cpos (org-in-item-p))
+          (struct (org-list-struct))
+          (orderedp (org-entry-get nil "ORDERED"))
+          (parents (org-list-parents-alist struct))
+          (old-struct (copy-tree struct))
+          (cbox (org-list-get-checkbox cpos struct))
+           (prevs (org-list-prevs-alist struct))
+          (start (org-list-get-list-begin (point-at-bol) struct prevs))
+          (new (unless (and cbox (equal arg '(4)) (equal start cpos))
+                 "[ ]")))
+      (dolist (pos (org-list-get-all-items
+                   start struct (org-list-prevs-alist struct)))
+       (org-list-set-checkbox pos struct new))
+      (when new
+       (org-list-set-checkbox
+        cpos struct
+        (cond ((equal arg '(4)) (unless cbox "[ ]"))
+              ((equal arg '(16)) (unless cbox "[-]"))
+              (t (if (equal cbox "[X]") "[ ]" "[X]")))))
+      (org-list-struct-fix-box struct parents prevs orderedp)
+      (org-list-struct-apply-struct struct old-struct)
+      (org-update-checkbox-count-maybe))))
+
+(defun org-at-radio-list-p ()
+  "Is point at a list item with radio buttons?"
+  (when (org-match-line (org-item-re)) ;short-circuit
+    (let* ((e (save-excursion (beginning-of-line) (org-element-at-point))))
+      ;; Check we're really on a line with a bullet.
+      (when (memq (org-element-type e) '(item plain-list))
+       ;; Look for ATTR_ORG attribute in the current plain list.
+       (let ((plain-list (org-element-lineage e '(plain-list) t)))
+         (org-with-point-at (org-element-property :post-affiliated plain-list)
+           (let ((case-fold-search t)
+                 (regexp "^[ \t]*#\\+attr_org:.* :radio \\(\\S-+\\)")
+                 (begin (org-element-property :begin plain-list)))
+             (and (re-search-backward regexp begin t)
+                  (not (string-equal "nil" (match-string 1)))))))))))
+
 (defun org-toggle-checkbox (&optional toggle-presence)
   "Toggle the checkbox in the current line.
 
@@ -2317,92 +2365,94 @@ If point is on a headline, apply this to all checkbox 
items in
 the text below the heading, taking as reference the first item in
 subtree, ignoring planning line and any drawer following it."
   (interactive "P")
-  (save-excursion
-    (let* (singlep
-          block-item
-          lim-up
-          lim-down
-          (orderedp (org-entry-get nil "ORDERED"))
-          (_bounds
-           ;; In a region, start at first item in region.
+  (if (org-at-radio-list-p)
+      (org-toggle-radio-button toggle-presence)
+    (save-excursion
+      (let* (singlep
+            block-item
+            lim-up
+            lim-down
+            (orderedp (org-entry-get nil "ORDERED"))
+            (_bounds
+             ;; In a region, start at first item in region.
+             (cond
+              ((org-region-active-p)
+               (let ((limit (region-end)))
+                 (goto-char (region-beginning))
+                 (if (org-list-search-forward (org-item-beginning-re) limit t)
+                     (setq lim-up (point-at-bol))
+                   (error "No item in region"))
+                 (setq lim-down (copy-marker limit))))
+              ((org-at-heading-p)
+               ;; On a heading, start at first item after drawers and
+               ;; time-stamps (scheduled, etc.).
+               (let ((limit (save-excursion (outline-next-heading) (point))))
+                 (org-end-of-meta-data t)
+                 (if (org-list-search-forward (org-item-beginning-re) limit t)
+                     (setq lim-up (point-at-bol))
+                   (error "No item in subtree"))
+                 (setq lim-down (copy-marker limit))))
+              ;; Just one item: set SINGLEP flag.
+              ((org-at-item-p)
+               (setq singlep t)
+               (setq lim-up (point-at-bol)
+                     lim-down (copy-marker (point-at-eol))))
+              (t (error "Not at an item or heading, and no active region"))))
+            ;; Determine the checkbox going to be applied to all items
+            ;; within bounds.
+            (ref-checkbox
+             (progn
+               (goto-char lim-up)
+               (let ((cbox (and (org-at-item-checkbox-p) (match-string 1))))
+                 (cond
+                  ((equal toggle-presence '(16)) "[-]")
+                  ((equal toggle-presence '(4))
+                   (unless cbox "[ ]"))
+                  ((equal "[X]" cbox) "[ ]")
+                  (t "[X]"))))))
+       ;; When an item is found within bounds, grab the full list at
+       ;; point structure, then: (1) set check-box of all its items
+       ;; within bounds to REF-CHECKBOX, (2) fix check-boxes of the
+       ;; whole list, (3) move point after the list.
+       (goto-char lim-up)
+       (while (and (< (point) lim-down)
+                   (org-list-search-forward (org-item-beginning-re)
+                                            lim-down 'move))
+         (let* ((struct (org-list-struct))
+                (struct-copy (copy-tree struct))
+                (parents (org-list-parents-alist struct))
+                (prevs (org-list-prevs-alist struct))
+                (bottom (copy-marker (org-list-get-bottom-point struct)))
+                (items-to-toggle (cl-remove-if
+                                  (lambda (e) (or (< e lim-up) (> e lim-down)))
+                                  (mapcar #'car struct))))
+           (dolist (e items-to-toggle)
+             (org-list-set-checkbox
+              e struct
+              ;; If there is no box at item, leave as-is unless
+              ;; function was called with C-u prefix.
+              (let ((cur-box (org-list-get-checkbox e struct)))
+                (if (or cur-box (equal toggle-presence '(4)))
+                    ref-checkbox
+                  cur-box))))
+           (setq block-item (org-list-struct-fix-box
+                             struct parents prevs orderedp))
+           ;; Report some problems due to ORDERED status of subtree.
+           ;; If only one box was being checked, throw an error, else,
+           ;; only signal problems.
            (cond
-            ((org-region-active-p)
-             (let ((limit (region-end)))
-               (goto-char (region-beginning))
-               (if (org-list-search-forward (org-item-beginning-re) limit t)
-                   (setq lim-up (point-at-bol))
-                 (error "No item in region"))
-               (setq lim-down (copy-marker limit))))
-            ((org-at-heading-p)
-             ;; On a heading, start at first item after drawers and
-             ;; time-stamps (scheduled, etc.).
-             (let ((limit (save-excursion (outline-next-heading) (point))))
-               (org-end-of-meta-data t)
-               (if (org-list-search-forward (org-item-beginning-re) limit t)
-                   (setq lim-up (point-at-bol))
-                 (error "No item in subtree"))
-               (setq lim-down (copy-marker limit))))
-            ;; Just one item: set SINGLEP flag.
-            ((org-at-item-p)
-             (setq singlep t)
-             (setq lim-up (point-at-bol)
-                   lim-down (copy-marker (point-at-eol))))
-            (t (error "Not at an item or heading, and no active region"))))
-          ;; Determine the checkbox going to be applied to all items
-          ;; within bounds.
-          (ref-checkbox
-           (progn
-             (goto-char lim-up)
-             (let ((cbox (and (org-at-item-checkbox-p) (match-string 1))))
-               (cond
-                ((equal toggle-presence '(16)) "[-]")
-                ((equal toggle-presence '(4))
-                 (unless cbox "[ ]"))
-                ((equal "[X]" cbox) "[ ]")
-                (t "[X]"))))))
-      ;; When an item is found within bounds, grab the full list at
-      ;; point structure, then: (1) set check-box of all its items
-      ;; within bounds to REF-CHECKBOX, (2) fix check-boxes of the
-      ;; whole list, (3) move point after the list.
-      (goto-char lim-up)
-      (while (and (< (point) lim-down)
-                 (org-list-search-forward (org-item-beginning-re)
-                                          lim-down 'move))
-       (let* ((struct (org-list-struct))
-              (struct-copy (copy-tree struct))
-              (parents (org-list-parents-alist struct))
-              (prevs (org-list-prevs-alist struct))
-              (bottom (copy-marker (org-list-get-bottom-point struct)))
-              (items-to-toggle (cl-remove-if
-                                (lambda (e) (or (< e lim-up) (> e lim-down)))
-                                (mapcar #'car struct))))
-         (mapc (lambda (e) (org-list-set-checkbox
-                            e struct
-                            ;; If there is no box at item, leave as-is
-                            ;; unless function was called with C-u prefix.
-                            (let ((cur-box (org-list-get-checkbox e struct)))
-                              (if (or cur-box (equal toggle-presence '(4)))
-                                  ref-checkbox
-                                cur-box))))
-               items-to-toggle)
-         (setq block-item (org-list-struct-fix-box
-                           struct parents prevs orderedp))
-         ;; Report some problems due to ORDERED status of subtree.
-         ;; If only one box was being checked, throw an error, else,
-         ;; only signal problems.
-         (cond
-          ((and singlep block-item (> lim-up block-item))
-           (error
-            "Checkbox blocked because of unchecked box at line %d"
-            (org-current-line block-item)))
-          (block-item
-           (message
-            "Checkboxes were removed due to unchecked box at line %d"
-            (org-current-line block-item))))
-         (goto-char bottom)
-         (move-marker bottom nil)
-         (org-list-struct-apply-struct struct struct-copy)))
-      (move-marker lim-down nil)))
+            ((and singlep block-item (> lim-up block-item))
+             (error
+              "Checkbox blocked because of unchecked box at line %d"
+              (org-current-line block-item)))
+            (block-item
+             (message
+              "Checkboxes were removed due to unchecked box at line %d"
+              (org-current-line block-item))))
+           (goto-char bottom)
+           (move-marker bottom nil)
+           (org-list-struct-apply-struct struct struct-copy)))
+       (move-marker lim-down nil))))
   (org-update-checkbox-count-maybe))
 
 (defun org-reset-checkbox-state-subtree ()
@@ -2632,10 +2682,9 @@ Return t if successful."
                                     (org-list-bullet-string "-")))
              ;; Shift every item by OFFSET and fix bullets.  Then
              ;; apply changes to buffer.
-             (mapc (lambda (e)
-                     (let ((ind (org-list-get-ind (car e) struct)))
-                       (org-list-set-ind (car e) struct (+ ind offset))))
-                   struct)
+             (pcase-dolist (`(,pos . ,_) struct)
+               (let ((ind (org-list-get-ind pos struct)))
+                 (org-list-set-ind pos struct (+ ind offset))))
              (org-list-struct-fix-bul struct prevs)
              (org-list-struct-apply-struct struct old-struct))))
         ;; Forbidden move:
@@ -2733,51 +2782,83 @@ If a region is active, all items inside will be moved."
      (t (error "Not at an item")))))
 
 (defvar org-tab-ind-state)
-(defvar org-adapt-indentation)
 (defun org-cycle-item-indentation ()
   "Cycle levels of indentation of an empty item.
+
 The first run indents the item, if applicable.  Subsequent runs
 outdent it at meaningful levels in the list.  When done, item is
 put back at its original position with its original bullet.
 
 Return t at each successful move."
   (when (org-at-item-p)
-    (let* ((org-adapt-indentation nil)
-          (struct (org-list-struct))
-          (ind (org-list-get-ind (point-at-bol) struct))
-          (bullet (org-trim (buffer-substring (point-at-bol) (point-at-eol)))))
+    (let* ((struct (org-list-struct))
+          (item (line-beginning-position))
+          (ind (org-list-get-ind item struct)))
       ;; Accept empty items or if cycle has already started.
       (when (or (eq last-command 'org-cycle-item-indentation)
-               (and (save-excursion
-                      (beginning-of-line)
-                      (looking-at org-list-full-item-re))
-                    (>= (match-end 0) (save-excursion
-                                        (goto-char (org-list-get-item-end
-                                                    (point-at-bol) struct))
-                                        (skip-chars-backward " \r\t\n")
-                                        (point)))))
+               (and (org-match-line org-list-full-item-re)
+                    (>= (match-end 0)
+                        (save-excursion
+                          (goto-char (org-list-get-item-end item struct))
+                          (skip-chars-backward " \t\n")
+                          (point)))))
        (setq this-command 'org-cycle-item-indentation)
-       ;; When in the middle of the cycle, try to outdent first.  If
-       ;; it fails, and point is still at initial position, indent.
-       ;; Else, re-create it at its original position.
-       (if (eq last-command 'org-cycle-item-indentation)
+       (let ((prevs (org-list-prevs-alist struct))
+             (parents (org-list-parents-alist struct)))
+         (if (eq last-command 'org-cycle-item-indentation)
+             ;; When in the middle of the cycle, try to outdent.  If
+             ;; it fails, move point back to its initial position and
+             ;; reset cycle.
+             (pcase-let ((`(,old-ind . ,old-bul) org-tab-ind-state)
+                         (allow-outdent
+                          (lambda (struct prevs parents)
+                            ;; Non-nil if current item can be
+                            ;; outdented.
+                            (and (not (org-list-get-next-item item nil prevs))
+                                 (not (org-list-has-child-p item struct))
+                                 (org-list-get-parent item struct parents)))))
+               (cond
+                ((and (> ind old-ind)
+                      (org-list-get-prev-item item nil prevs))
+                 (org-list-indent-item-generic 1 t struct))
+                ((and (< ind old-ind)
+                      (funcall allow-outdent struct prevs parents))
+                 (org-list-indent-item-generic -1 t struct))
+                (t
+                 (delete-region (line-beginning-position) (line-end-position))
+                 (indent-to-column old-ind)
+                 (insert old-bul " ")
+                 (let* ((struct (org-list-struct))
+                        (parents (org-list-parents-alist struct)))
+                   (if (and (> ind old-ind)
+                            ;; We were previously indenting item.  It
+                            ;; is no longer possible.  Try to outdent
+                            ;; from initial position.
+                            (funcall allow-outdent
+                                     struct
+                                     (org-list-prevs-alist struct)
+                                     parents))
+                       (org-list-indent-item-generic -1 t struct)
+                     (org-list-write-struct struct parents)
+                     ;; Start cycle over.
+                     (setq this-command 'identity)
+                     t)))))
+           ;; If a cycle is starting, remember initial indentation
+           ;; and bullet, then try to indent.  If it fails, try to
+           ;; outdent.
+           (setq org-tab-ind-state
+                 (cons ind (org-trim (org-current-line-string))))
            (cond
-            ((ignore-errors (org-list-indent-item-generic -1 t struct)))
-            ((and (= ind (car org-tab-ind-state))
-                  (ignore-errors (org-list-indent-item-generic 1 t struct))))
-            (t (delete-region (point-at-bol) (point-at-eol))
-               (indent-to-column (car org-tab-ind-state))
-               (insert (cdr org-tab-ind-state) " ")
-               ;; Break cycle
-               (setq this-command 'identity)))
-         ;; If a cycle is starting, remember indentation and bullet,
-         ;; then try to indent.  If it fails, try to outdent.
-         (setq org-tab-ind-state (cons ind bullet))
-         (cond
-          ((ignore-errors (org-list-indent-item-generic 1 t struct)))
-          ((ignore-errors (org-list-indent-item-generic -1 t struct)))
-          (t (user-error "Cannot move item"))))
-       t))))
+            ((org-list-get-prev-item item nil prevs)
+             (org-list-indent-item-generic 1 t struct))
+            ((and (not (org-list-get-next-item item nil prevs))
+                  (org-list-get-parent item struct parents))
+             (org-list-indent-item-generic -1 t struct))
+            (t
+             ;; This command failed.  So will the following one.
+             ;; There's no point in starting the cycle.
+             (setq this-command 'identity)
+             (user-error "Cannot move item")))))))))
 
 (defun org-sort-list
     (&optional with-case sorting-type getkey-func compare-func interactive?)
@@ -2794,8 +2875,8 @@ if the current locale allows for it.
 
 The command prompts for the sorting type unless it has been given
 to the function through the SORTING-TYPE argument, which needs to
-be a character, \(?n ?N ?a ?A ?t ?T ?f ?F ?x ?X).  Here is the
-detailed meaning of each character:
+be a character, among ?n ?N ?a ?A ?t ?T ?f ?F ?x or ?X.  Here is
+the detailed meaning of each character:
 
 n   Numerically, by converting the beginning of the item to a number.
 a   Alphabetically.  Only the first line of item is checked.
@@ -2958,7 +3039,7 @@ With a prefix argument ARG, change the region in a single 
item."
     (if (org-region-active-p)
        (setq beg (funcall skip-blanks (region-beginning))
              end (copy-marker (region-end)))
-      (setq beg (funcall skip-blanks (point-at-bol))
+      (setq beg (point-at-bol)
            end (copy-marker (point-at-eol))))
     ;; Depending on the starting line, choose an action on the text
     ;; between BEG and END.
@@ -3501,4 +3582,8 @@ overruling parameters for `org-list-to-generic'."
 
 (provide 'org-list)
 
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; org-list.el ends here
diff --git a/lisp/org/org-macro.el b/lisp/org/org-macro.el
index a1b987a..f914a33 100644
--- a/lisp/org/org-macro.el
+++ b/lisp/org/org-macro.el
@@ -1,6 +1,6 @@
 ;;; org-macro.el --- Macro Replacement Code for Org  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <n.goaziou@gmail.com>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -50,6 +50,7 @@
 (require 'org-macs)
 (require 'org-compat)
 
+(declare-function org-collect-keywords "org" (keywords &optional unique 
directory))
 (declare-function org-element-at-point "org-element" ())
 (declare-function org-element-context "org-element" (&optional element))
 (declare-function org-element-copy "org-element" (datum))
@@ -88,49 +89,24 @@ directly, use instead:
 VALUE is the template of the macro.  The new value override the
 previous one, unless VALUE is nil.  TEMPLATES is the list of
 templates.  Return the updated list."
-  (when value
-    (let ((old-definition (assoc name templates)))
-      (if old-definition
-         (setcdr old-definition value)
-       (push (cons name value) templates))))
+  (let ((old-definition (assoc name templates)))
+    (cond ((and value old-definition) (setcdr old-definition value))
+         (old-definition)
+         (t (push (cons name (or value "")) templates))))
   templates)
 
-(defun org-macro--collect-macros (&optional files templates)
+(defun org-macro--collect-macros ()
   "Collect macro definitions in current buffer and setup files.
-Return an alist containing all macro templates found.
-
-FILES is a list of setup files names read so far, used to avoid
-circular dependencies.  TEMPLATES is the alist collected so far.
-The two arguments are used in recursive calls."
-  (let ((case-fold-search t))
-    (org-with-point-at 1
-      (while (re-search-forward "^[ \t]*#\\+\\(MACRO\\|SETUPFILE\\):" nil t)
-       (let ((element (org-element-at-point)))
-         (when (eq (org-element-type element) 'keyword)
-           (let ((val (org-element-property :value element)))
-             (if (equal "MACRO" (org-element-property :key element))
-                 ;; Install macro in TEMPLATES.
-                 (when (string-match "^\\(\\S-+\\)[ \t]*" val)
-                   (let ((name (match-string 1 val))
-                         (value (substring val (match-end 0))))
-                     (setq templates
-                           (org-macro--set-template name value templates))))
-               ;; Enter setup file.
-               (let* ((uri (org-strip-quotes val))
-                      (uri-is-url (org-file-url-p uri))
-                      (uri (if uri-is-url
-                               uri
-                             (expand-file-name uri))))
-                 ;; Avoid circular dependencies.
-                 (unless (member uri files)
-                   (with-temp-buffer
-                     (unless uri-is-url
-                       (setq default-directory (file-name-directory uri)))
-                     (org-mode)
-                     (insert (org-file-contents uri 'noerror))
-                     (setq templates
-                           (org-macro--collect-macros
-                            (cons uri files) templates)))))))))))
+Return an alist containing all macro templates found."
+  (let ((templates nil))
+    (pcase (org-collect-keywords '("MACRO"))
+      (`(("MACRO" . ,values))
+       (dolist (value values)
+        (when (string-match "^\\(\\S-+\\)[ \t]*" value)
+          (let ((name (match-string 1 value))
+                (definition (substring value (match-end 0))))
+            (setq templates
+                  (org-macro--set-template name definition templates)))))))
     (let ((macros `(("author" . ,(org-macro--find-keyword-value "AUTHOR"))
                    ("email" . ,(org-macro--find-keyword-value "EMAIL"))
                    ("title" . ,(org-macro--find-keyword-value "TITLE" t))
@@ -417,6 +393,6 @@ Any other non-empty string resets the counter to 1."
                    (t 1))
              org-macro--counter-table)))
 
-
 (provide 'org-macro)
+
 ;;; org-macro.el ends here
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index 2a7ab66..56afdf6 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -1,6 +1,6 @@
 ;;; org-macs.el --- Top-level Definitions for Org -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -34,6 +34,8 @@
 (require 'cl-lib)
 (require 'format-spec)
 
+(declare-function org-mode "org" ())
+(declare-function org-show-context "org" (&optional key))
 (declare-function org-string-collate-lessp "org-compat" (s1 s2 &optional 
locale ignore-case))
 
 (defvar org-ts-regexp0)
@@ -122,7 +124,7 @@ means that the buffer should stay alive during the 
operation,
 because otherwise all these markers will point to nowhere."
   (declare (debug (form body)) (indent 1))
   (org-with-gensyms (data invisible-types markers?)
-    `(let* ((,invisible-types '(org-hide-block org-hide-drawer outline))
+    `(let* ((,invisible-types '(org-hide-block outline))
            (,markers? ,use-markers)
            (,data
             (mapcar (lambda (o)
@@ -375,18 +377,25 @@ error when the user input is empty."
       'org-time-stamp-inactive)
     (apply #'completing-read args)))
 
-(defun org--mks-read-key (allowed-keys prompt)
+(defun org--mks-read-key (allowed-keys prompt navigation-keys)
   "Read a key and ensure it is a member of ALLOWED-KEYS.
+Enable keys to scroll the window if NAVIGATION-KEYS is set.
 TAB, SPC and RET are treated equivalently."
-  (let* ((key (char-to-string
-              (pcase (read-char-exclusive prompt)
-                ((or ?\s ?\t ?\r) ?\t)
-                (char char)))))
-    (if (member key allowed-keys)
-        key
-      (message "Invalid key: `%s'" key)
-      (sit-for 1)
-      (org--mks-read-key allowed-keys prompt))))
+  (setq header-line-format (when navigation-keys "Use C-n, C-p, C-v, M-v to 
navigate."))
+  (let ((char-key (read-char-exclusive prompt)))
+    (if (and navigation-keys (memq char-key '(14 16 22 134217846)))
+       (progn
+         (org-scroll char-key)
+         (org--mks-read-key allowed-keys prompt navigation-keys))
+      (let ((key (char-to-string
+                 (pcase char-key
+                   ((or ?\s ?\t ?\r) ?\t)
+                   (char char)))))
+       (if (member key allowed-keys)
+           key
+         (message "Invalid key: `%s'" key)
+         (sit-for 1)
+         (org--mks-read-key allowed-keys prompt navigation-keys))))))
 
 (defun org-mks (table title &optional prompt specials)
   "Select a member of an alist with multiple keys.
@@ -416,6 +425,7 @@ is selected, only the bare key is returned."
     (let ((inhibit-quit t)
          (buffer (org-switch-to-buffer-other-window "*Org Select*"))
          (prompt (or prompt "Select: "))
+         case-fold-search
          current)
       (unwind-protect
          (catch 'exit
@@ -458,9 +468,13 @@ is selected, only the bare key is returned."
                ;; Display UI and let user select an entry or
                ;; a sub-level prefix.
                (goto-char (point-min))
-               (unless (pos-visible-in-window-p (point-max))
-                 (org-fit-window-to-buffer))
-               (let ((pressed (org--mks-read-key allowed-keys prompt)))
+               (org-fit-window-to-buffer)
+               (message "") ; With this line the prompt appears in
+                            ; the minibuffer. Else keystrokes may
+                            ; appear, which is spurious.
+               (let ((pressed (org--mks-read-key
+                               allowed-keys prompt
+                               (not (pos-visible-in-window-p (1- 
(point-max)))))))
                  (setq current (concat current pressed))
                  (cond
                   ((equal pressed "\C-g") (user-error "Abort"))
@@ -644,6 +658,25 @@ The number of levels is controlled by 
`org-inlinetask-min-level'."
                          limit-level)))
           (format "\\*\\{1,%d\\} " nstars)))))
 
+(defun org--line-empty-p (n)
+  "Is the Nth next line empty?
+Counts the current line as N = 1 and the previous line as N = 0;
+see `beginning-of-line'."
+  (and (not (bobp))
+       (save-excursion
+        (beginning-of-line n)
+        (looking-at-p "[ \t]*$"))))
+
+(defun org-previous-line-empty-p ()
+  "Is the previous line a blank line?
+When NEXT is non-nil, check the next line instead."
+  (org--line-empty-p 0))
+
+(defun org-next-line-empty-p ()
+  "Is the previous line a blank line?
+When NEXT is non-nil, check the next line instead."
+  (org--line-empty-p 2))
+
 
 
 ;;; Motion
@@ -695,7 +728,9 @@ SPEC is the invisibility spec, as a symbol."
     (let ((o (make-overlay from to nil 'front-advance)))
       (overlay-put o 'evaporate t)
       (overlay-put o 'invisible spec)
-      (overlay-put o 'isearch-open-invisible #'delete-overlay))))
+      (overlay-put o
+                  'isearch-open-invisible
+                  (lambda (&rest _) (org-show-context 'isearch))))))
 
 
 
@@ -920,7 +955,8 @@ if necessary."
   (if (<= (length s) maxlength)
       s
     (let* ((n (max (- maxlength 4) 1))
-          (re (concat "\\`\\(.\\{1," (int-to-string n) "\\}[^ ]\\)\\([ 
]\\|\\'\\)")))
+          (re (concat "\\`\\(.\\{1," (number-to-string n)
+                      "\\}[^ ]\\)\\([ ]\\|\\'\\)")))
       (if (string-match re s)
          (concat (match-string 1 s) "...")
        (concat (substring s 0 (max (- maxlength 3) 0)) "...")))))
@@ -1065,10 +1101,16 @@ the value in cdr."
       (get-text-property (or (next-single-property-change 0 prop s) 0)
                         prop s)))
 
-(defun org-invisible-p (&optional pos)
+(defun org-invisible-p (&optional pos folding-only)
   "Non-nil if the character after POS is invisible.
-If POS is nil, use `point' instead."
-  (get-char-property (or pos (point)) 'invisible))
+If POS is nil, use `point' instead.  When optional argument
+FOLDING-ONLY is non-nil, only consider invisible parts due to
+folding of a headline, a block or a drawer, i.e., not because of
+fontification."
+  (let ((value (get-char-property (or pos (point)) 'invisible)))
+    (cond ((not value) nil)
+         (folding-only (memq value '(org-hide-block outline)))
+         (t value))))
 
 (defun org-truely-invisible-p ()
   "Check if point is at a character currently not visible.
@@ -1086,6 +1128,18 @@ move it back by one char before doing this check."
       (backward-char 1))
     (org-invisible-p)))
 
+(defun org-find-visible ()
+  "Return closest visible buffer position, or `point-max'"
+  (if (org-invisible-p)
+      (next-single-char-property-change (point) 'invisible)
+    (point)))
+
+(defun org-find-invisible ()
+  "Return closest invisible buffer position, or `point-max'"
+  (if (org-invisible-p)
+      (point)
+    (next-single-char-property-change (point) 'invisible)))
+
 
 ;;; Time
 
@@ -1182,8 +1236,41 @@ Return 0. if S is not recognized as a valid value."
        ((string-match org-ts-regexp0 s) (org-2ft s))
        (t 0.)))))
 
-
+(defun org-scroll (key &optional additional-keys)
+  "Receive KEY and scroll the current window accordingly.
+When ADDITIONAL-KEYS is not nil, also include SPC and DEL in the
+allowed keys for scrolling, as expected in the export dispatch
+window."
+  (let ((scrlup (if additional-keys '(?\s 22) 22))
+       (scrldn (if additional-keys `(?\d 134217846) 134217846)))
+    (eval
+     `(cl-case ,key
+       ;; C-n
+       (14 (if (not (pos-visible-in-window-p (point-max)))
+               (ignore-errors (scroll-up 1))
+             (message "End of buffer")
+             (sit-for 1)))
+       ;; C-p
+       (16 (if (not (pos-visible-in-window-p (point-min)))
+               (ignore-errors (scroll-down 1))
+             (message "Beginning of buffer")
+             (sit-for 1)))
+       ;; SPC or
+       (,scrlup
+        (if (not (pos-visible-in-window-p (point-max)))
+            (scroll-up nil)
+          (message "End of buffer")
+          (sit-for 1)))
+       ;; DEL
+       (,scrldn (if (not (pos-visible-in-window-p (point-min)))
+                    (scroll-down nil)
+                  (message "Beginning of buffer")
+                  (sit-for 1)))))))
 
 (provide 'org-macs)
 
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; org-macs.el ends here
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el
index 8749e49..a64e0a2 100644
--- a/lisp/org/org-mobile.el
+++ b/lisp/org/org-mobile.el
@@ -1,5 +1,5 @@
 ;;; org-mobile.el --- Code for Asymmetric Sync With a Mobile Device -*- 
lexical-binding: t; -*-
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -258,6 +258,17 @@ the old and new values for the entry.")
 (defvar org-mobile-files-alist nil)
 (defvar org-mobile-checksum-files nil)
 
+;; Add org mobile commands to the main org menu
+(easy-menu-add-item
+ org-org-menu
+ nil
+ '("MobileOrg"
+   ["Push Files and Views" org-mobile-push t]
+   ["Get Captured and Flagged" org-mobile-pull t]
+   ["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "\\[org-agenda] 
?"]
+   "--"
+   ["Setup" (customize-group 'org-mobile) t]))
+
 (defun org-mobile-prepare-file-lists ()
   (setq org-mobile-files-alist (org-mobile-files-alist))
   (setq org-mobile-checksum-files nil))
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index 0279887..5c222ea 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -1,6 +1,6 @@
 ;;; org-mouse.el --- Better mouse support for Org -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
 ;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
@@ -386,7 +386,7 @@ DEFAULT is returned if no priority is given in the 
headline."
   (save-excursion
     (if (org-mouse-re-search-line org-mouse-priority-regexp)
        (match-string 1)
-      (when default (char-to-string org-default-priority)))))
+      (when default (char-to-string org-priority-default)))))
 
 (defun org-mouse-delete-timestamp ()
   "Deletes the current timestamp as well as the preceding keyword.
@@ -407,7 +407,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
          (> (match-end 0) point))))))
 
 (defun org-mouse-priority-list ()
-  (cl-loop for priority from ?A to org-lowest-priority
+  (cl-loop for priority from ?A to org-priority-lowest
           collect (char-to-string priority)))
 
 (defun org-mouse-todo-menu (state)
@@ -495,7 +495,8 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
      ["Check Deadlines"
       (if (functionp 'org-check-deadlines-and-todos)
          (org-check-deadlines-and-todos org-deadline-warning-days)
-       (org-check-deadlines org-deadline-warning-days)) t]
+       (org-check-deadlines org-deadline-warning-days))
+      t]
      ["Check TODOs" org-show-todo-tree t]
      ("Check Tags"
       ,@(org-mouse-keyword-menu
@@ -741,7 +742,8 @@ This means, between the beginning of line and the point."
                               (?$ "($) Formula Parameters")
                               (?# "(#) Recalculation: Auto")
                               (?* "(*) Recalculation: Manual")
-                              (?' "(') Recalculation: None"))) t))))
+                              (?' "(') Recalculation: None")))
+                          t))))
      ((assq :table contextlist)
       (popup-menu
        '(nil
diff --git a/lisp/org/org-num.el b/lisp/org/org-num.el
index 5b8e1db..ebddaa3 100644
--- a/lisp/org/org-num.el
+++ b/lisp/org/org-num.el
@@ -1,6 +1,6 @@
 ;;; org-num.el --- Dynamic Headlines Numbering  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -254,6 +254,7 @@ otherwise."
              org-footnote-section
              (equal title org-footnote-section))
         (and org-num-skip-commented
+            title
              (let ((case-fold-search nil))
                (string-match org-num--comment-re title))
              t)
@@ -466,6 +467,10 @@ NUMBERING is a list of numbers."
     (remove-hook 'after-change-functions #'org-num--verify t)
     (remove-hook 'change-major-mode-hook #'org-num--clear t))))
 
-
 (provide 'org-num)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; org-num.el ends here
diff --git a/lisp/org/org-pcomplete.el b/lisp/org/org-pcomplete.el
index b0ebbc4..29d9d58 100644
--- a/lisp/org/org-pcomplete.el
+++ b/lisp/org/org-pcomplete.el
@@ -1,6 +1,6 @@
 ;;; org-pcomplete.el --- In-buffer Completion Code -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;         John Wiegley <johnw at gnu dot org>
@@ -32,6 +32,8 @@
 (require 'pcomplete)
 
 (declare-function org-at-heading-p "org" (&optional ignored))
+(declare-function org-babel-combine-header-arg-lists "ob-core" (original &rest 
others))
+(declare-function org-babel-get-src-block-info "ob-core" (&optional light 
datum))
 (declare-function org-before-first-heading-p "org" ())
 (declare-function org-buffer-property-keys "org" (&optional specials defaults 
columns))
 (declare-function org-element-at-point "org-element" ())
@@ -47,8 +49,9 @@
 (declare-function org-link-heading-search-string "ol" (&optional string))
 (declare-function org-tag-alist-to-string "org" (alist &optional skip-key))
 
+(defvar org-babel-common-header-args-w-values)
 (defvar org-current-tag-alist)
-(defvar org-default-priority)
+(defvar org-priority-default)
 (defvar org-drawer-regexp)
 (defvar org-element-affiliated-keywords)
 (defvar org-entities)
@@ -56,10 +59,10 @@
 (defvar org-export-exclude-tags)
 (defvar org-export-select-tags)
 (defvar org-file-tags)
-(defvar org-highest-priority)
+(defvar org-priority-highest)
 (defvar org-link-abbrev-alist)
 (defvar org-link-abbrev-alist-local)
-(defvar org-lowest-priority)
+(defvar org-priority-lowest)
 (defvar org-options-keywords)
 (defvar org-outline-regexp)
 (defvar org-property-re)
@@ -252,9 +255,9 @@ When completing for #+STARTUP, for example, this function 
returns
 (defun pcomplete/org-mode/file-option/priorities ()
   "Complete arguments for the #+PRIORITIES file option."
   (pcomplete-here (list (format "%c %c %c"
-                               org-highest-priority
-                               org-lowest-priority
-                               org-default-priority))))
+                               org-priority-highest
+                               org-priority-lowest
+                               org-priority-default))))
 
 (defun pcomplete/org-mode/file-option/select_tags ()
   "Complete arguments for the #+SELECT_TAGS file option."
@@ -352,8 +355,9 @@ This needs more work, to handle headings with lots of 
spaces in them."
            (goto-char (point-min))
            (let (tbl)
              (while (re-search-forward org-outline-regexp nil t)
-               (push (org-link-heading-search-string (org-get-heading t t t t))
-                     tbl))
+               ;; Remove the leading asterisk from
+               ;; `org-link-heading-search-string' result.
+               (push (substring (org-link-heading-search-string) 1) tbl))
              (pcomplete-uniquify-list tbl)))
          ;; When completing a bracketed link, i.e., "[[*", argument
          ;; starts at the star, so remove this character.
@@ -417,11 +421,17 @@ switches."
                                    (symbol-plist
                                     'org-babel-load-languages)
                                    'custom-type)))))))
-  (while (pcomplete-here
-         '("-n" "-r" "-l"
-           ":cache" ":colnames" ":comments" ":dir" ":eval" ":exports"
-           ":file" ":hlines" ":no-expand" ":noweb" ":results" ":rownames"
-           ":session" ":shebang" ":tangle" ":tangle-mode" ":var"))))
+  (let* ((info (org-babel-get-src-block-info 'light))
+        (lang (car info))
+        (lang-headers (intern (concat "org-babel-header-args:" lang)))
+        (headers (org-babel-combine-header-arg-lists
+                  org-babel-common-header-args-w-values
+                  (and (boundp lang-headers) (eval lang-headers t)))))
+    (while (pcomplete-here
+           (append (mapcar
+                    (lambda (arg) (format ":%s" (symbol-name (car arg))))
+                    headers)
+                   '("-n" "-r" "-l"))))))
 
 (defun pcomplete/org-mode/block-option/clocktable ()
   "Complete keywords in a clocktable line."
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el
index 8bf8839..4ac15b3 100644
--- a/lisp/org/org-plot.el
+++ b/lisp/org/org-plot.el
@@ -1,8 +1,9 @@
 ;;; org-plot.el --- Support for Plotting from Org -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Eric Schulte <schulte dot eric at gmail dot com>
+;; Maintainer: TEC <tecosaur@gmail.com>
 ;; Keywords: tables, plotting
 ;; Homepage: https://orgmode.org
 ;;
@@ -144,7 +145,8 @@ and dependent variables."
         row-vals)
     (when (>= ind 0) ;; collect values of ind col
       (setf row-vals (mapcar (lambda (row) (setf counter (+ 1 counter))
-                              (cons counter (nth ind row))) table)))
+                              (cons counter (nth ind row)))
+                            table)))
     (when (or deps (>= ind 0)) ;; remove non-plotting columns
       (setf deps (delq ind deps))
       (setf table (mapcar (lambda (row)
@@ -288,14 +290,12 @@ line directly before or after the table."
        (setf params (plist-put params (car pair) (cdr pair)))))
     ;; collect table and table information
     (let* ((data-file (make-temp-file "org-plot"))
-          (table (org-table-to-lisp))
-          (num-cols (length (if (eq (nth 0 table) 'hline) (nth 1 table)
-                              (nth 0 table)))))
+          (table (org-table-collapse-header (org-table-to-lisp)))
+          (num-cols (length (car table))))
       (run-with-idle-timer 0.1 nil #'delete-file data-file)
-      (while (eq 'hline (car table)) (setf table (cdr table)))
       (when (eq (cadr table) 'hline)
        (setf params
-             (plist-put params :labels (nth 0 table))) ; headers to labels
+             (plist-put params :labels (car table))) ; headers to labels
        (setf table (delq 'hline (cdr table)))) ; clean non-data from table
       ;; Collect options.
       (save-excursion (while (and (equal 0 (forward-line -1))
@@ -308,26 +308,20 @@ line directly before or after the table."
        (`grid (let ((y-labels (org-plot/gnuplot-to-grid-data
                                table data-file params)))
                 (when y-labels (plist-put params :ylabels y-labels)))))
-      ;; Check for timestamp ind column.
-      (let ((ind (1- (plist-get params :ind))))
-       (when (and (>= ind 0) (eq '2d (plist-get params :plot-type)))
-         (if (= (length
-                 (delq 0 (mapcar
-                          (lambda (el)
-                            (if (string-match org-ts-regexp3 el) 0 1))
-                          (mapcar (lambda (row) (nth ind row)) table))))
-                0)
-             (plist-put params :timeind t)
-           ;; Check for text ind column.
-           (if (or (string= (plist-get params :with) "hist")
-                   (> (length
-                       (delq 0 (mapcar
-                                (lambda (el)
-                                  (if (string-match org-table-number-regexp el)
-                                      0 1))
-                                (mapcar (lambda (row) (nth ind row)) table))))
-                      0))
-               (plist-put params :textind t)))))
+      ;; Check type of ind column (timestamp? text?)
+      (when (eq `2d (plist-get params :plot-type))
+       (let* ((ind (1- (plist-get params :ind)))
+              (ind-column (mapcar (lambda (row) (nth ind row)) table)))
+         (cond ((< ind 0) nil) ; ind is implicit
+               ((cl-every (lambda (el)
+                            (string-match org-ts-regexp3 el))
+                          ind-column)
+                (plist-put params :timeind t)) ; ind holds timestamps
+               ((or (string= (plist-get params :with) "hist")
+                    (cl-notevery (lambda (el)
+                                   (string-match org-table-number-regexp el))
+                                 ind-column))
+                (plist-put params :textind t))))) ; ind holds text
       ;; Write script.
       (with-temp-buffer
        (if (plist-get params :script)  ; user script
diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el
index 55a534d..74043f8 100644
--- a/lisp/org/org-protocol.el
+++ b/lisp/org/org-protocol.el
@@ -1,6 +1,6 @@
 ;;; org-protocol.el --- Intercept Calls from Emacsclient to Trigger Custom 
Actions -*- lexical-binding: t; -*-
 ;;
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 ;;
 ;; Authors: Bastien Guerry <bzg@gnu.org>
 ;;       Daniel M German <dmg AT uvic DOT org>
@@ -181,7 +181,8 @@ Possible properties are:
   :working-directory - the local working directory.  This is, what base-url 
will
                        be replaced with.
   :redirects         - A list of cons cells, each of which maps a regular
-                       expression to match to a path relative to 
:working-directory.
+                       expression to match to a path relative to
+                       :working-directory.
 
 Example:
 
@@ -191,7 +192,7 @@ Example:
           :working-suffix \".org\"
           :base-url \"https://orgmode.org/worg/\";
           :working-directory \"/home/user/org/Worg/\")
-         (\"http://localhost/org-notes/\";
+         (\"localhost org-notes/\"
           :online-suffix \".html\"
           :working-suffix \".org\"
           :base-url \"http://localhost/org/\";
@@ -202,12 +203,18 @@ Example:
           :working-directory \"~/site/content/post/\"
           :online-suffix \".html\"
           :working-suffix \".md\"
-          :rewrites ((\"\\(https://site.com/[0-9]+/[0-9]+/[0-9]+/\\)\" . 
\".md\")))))
-
-
-   The last line tells `org-protocol-open-source' to open
-   /home/user/org/index.php, if the URL cannot be mapped to an existing
-   file, and ends with either \"org\" or \"org/\".
+          :rewrites ((\"\\(https://site.com/[0-9]+/[0-9]+/[0-9]+/\\)\"
+                     . \".md\")))
+         (\"GNU emacs OpenGrok\"
+          :base-url \"https://opengrok.housegordon.com/source/xref/emacs/\";
+          :working-directory \"~/dev/gnu-emacs/\")))
+
+   The :rewrites line of \"localhost org-notes\" entry tells
+   `org-protocol-open-source' to open /home/user/org/index.php,
+   if the URL cannot be mapped to an existing file, and ends with
+   either \"org\" or \"org/\".  The \"GNU emacs OpenGrok\" entry
+   does not include any suffix properties, allowing local source
+   file to be opened as found by OpenGrok.
 
 Consider using the interactive functions `org-protocol-create' and
 `org-protocol-create-for-org' to help you filling this variable with valid 
contents."
@@ -545,11 +552,12 @@ The location for a browser's bookmark should look like 
this:
                   ;; ending than strip-suffix here:
                   (f1 (substring f 0 (string-match "\\([\\?#].*\\)?$" f)))
                    (start-pos (+ (string-match wsearch f1) (length base-url)))
-                   (end-pos (string-match
-                            (regexp-quote strip-suffix) f1))
+                   (end-pos (if strip-suffix
+                             (string-match (regexp-quote strip-suffix) f1)
+                             (length f1)))
                   ;; We have to compare redirects without suffix below:
                   (f2 (concat wdir (substring f1 start-pos end-pos)))
-                   (the-file (concat f2 add-suffix)))
+                   (the-file (if add-suffix (concat f2 add-suffix) f2)))
 
              ;; Note: the-file may still contain `%C3' et al here because 
browsers
              ;; tend to encode `&auml;' in URLs to `%25C3' - `%25' being `%'.
@@ -617,13 +625,13 @@ CLIENT is ignored."
             (let ((proto
                   (concat the-protocol
                           (regexp-quote (plist-get (cdr prolist) :protocol))
-                          "\\(:/+\\|\\?\\)")))
+                          "\\(:/+\\|/*\\?\\)")))
               (when (string-match proto fname)
                 (let* ((func (plist-get (cdr prolist) :function))
                        (greedy (plist-get (cdr prolist) :greedy))
                        (split (split-string fname proto))
                        (result (if greedy restoffiles (cadr split)))
-                      (new-style (string= (match-string 1 fname) "?")))
+                      (new-style (string-match "/*?" (match-string 1 fname))))
                   (when (plist-get (cdr prolist) :kill-client)
                    (message "Greedy org-protocol handler.  Killing client.")
                    (server-edit))
diff --git a/lisp/org/org-refile.el b/lisp/org/org-refile.el
new file mode 100644
index 0000000..1e0c339
--- /dev/null
+++ b/lisp/org/org-refile.el
@@ -0,0 +1,742 @@
+;;; org-refile.el --- Refile Org Subtrees             -*- lexical-binding: t; 
-*-
+
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten at orgmode dot org>
+;; Keywords: outlines, hypermedia, calendar, wp
+;;
+;; This file is part of GNU Emacs.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Org Refile allows you to refile subtrees to various locations.
+
+;;; Code:
+
+(require 'org)
+
+(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
+
+(defgroup org-refile nil
+  "Options concerning refiling entries in Org mode."
+  :tag "Org Refile"
+  :group 'org)
+
+(defcustom org-log-refile nil
+  "Information to record when a task is refiled.
+
+Possible values are:
+
+nil     Don't add anything
+time    Add a time stamp to the task
+note    Prompt for a note and add it with template `org-log-note-headings'
+
+This option can also be set with on a per-file-basis with
+
+   #+STARTUP: nologrefile
+   #+STARTUP: logrefile
+   #+STARTUP: lognoterefile
+
+You can have local logging settings for a subtree by setting the LOGGING
+property to one or more of these keywords.
+
+When bulk-refiling, e.g., from the agenda, the value `note' is
+forbidden and will temporarily be changed to `time'."
+  :group 'org-refile
+  :group 'org-progress
+  :version "24.1"
+  :type '(choice
+         (const :tag "No logging" nil)
+         (const :tag "Record timestamp" time)
+         (const :tag "Record timestamp with note." note)))
+
+(defcustom org-refile-targets nil
+  "Targets for refiling entries with `\\[org-refile]'.
+This is a list of cons cells.  Each cell contains:
+- a specification of the files to be considered, either a list of files,
+  or a symbol whose function or variable value will be used to retrieve
+  a file name or a list of file names.  If you use `org-agenda-files' for
+  that, all agenda files will be scanned for targets.  Nil means consider
+  headings in the current buffer.
+- A specification of how to find candidate refile targets.  This may be
+  any of:
+  - a cons cell (:tag . \"TAG\") to identify refile targets by a tag.
+    This tag has to be present in all target headlines, inheritance will
+    not be considered.
+  - a cons cell (:todo . \"KEYWORD\") to identify refile targets by
+    todo keyword.
+  - a cons cell (:regexp . \"REGEXP\") with a regular expression matching
+    headlines that are refiling targets.
+  - a cons cell (:level . N).  Any headline of level N is considered a target.
+    Note that, when `org-odd-levels-only' is set, level corresponds to
+    order in hierarchy, not to the number of stars.
+  - a cons cell (:maxlevel . N).  Any headline with level <= N is a target.
+    Note that, when `org-odd-levels-only' is set, level corresponds to
+    order in hierarchy, not to the number of stars.
+
+Each element of this list generates a set of possible targets.
+The union of these sets is presented (with completion) to
+the user by `org-refile'.
+
+You can set the variable `org-refile-target-verify-function' to a function
+to verify each headline found by the simple criteria above.
+
+When this variable is nil, all top-level headlines in the current buffer
+are used, equivalent to the value `((nil . (:level . 1))'."
+  :group 'org-refile
+  :type '(repeat
+         (cons
+          (choice :value org-agenda-files
+                  (const :tag "All agenda files" org-agenda-files)
+                  (const :tag "Current buffer" nil)
+                  (function) (variable) (file))
+          (choice :tag "Identify target headline by"
+                  (cons :tag "Specific tag" (const :value :tag) (string))
+                  (cons :tag "TODO keyword" (const :value :todo) (string))
+                  (cons :tag "Regular expression" (const :value :regexp) 
(regexp))
+                  (cons :tag "Level number" (const :value :level) (integer))
+                  (cons :tag "Max Level number" (const :value :maxlevel) 
(integer))))))
+
+(defcustom org-refile-target-verify-function nil
+  "Function to verify if the headline at point should be a refile target.
+The function will be called without arguments, with point at the
+beginning of the headline.  It should return t and leave point
+where it is if the headline is a valid target for refiling.
+
+If the target should not be selected, the function must return nil.
+In addition to this, it may move point to a place from where the search
+should be continued.  For example, the function may decide that the entire
+subtree of the current entry should be excluded and move point to the end
+of the subtree."
+  :group 'org-refile
+  :type '(choice
+         (const nil)
+         (function)))
+
+(defcustom org-refile-use-cache nil
+  "Non-nil means cache refile targets to speed up the process.
+\\<org-mode-map>\
+The cache for a particular file will be updated automatically when
+the buffer has been killed, or when any of the marker used for flagging
+refile targets no longer points at a live buffer.
+If you have added new entries to a buffer that might themselves be targets,
+you need to clear the cache manually by pressing `C-0 \\[org-refile]' or,
+if you find that easier, \
+`\\[universal-argument] \\[universal-argument] \\[universal-argument] \
+\\[org-refile]'."
+  :group 'org-refile
+  :version "24.1"
+  :type 'boolean)
+
+(defcustom org-refile-use-outline-path nil
+  "Non-nil means provide refile targets as paths.
+So a level 3 headline will be available as level1/level2/level3.
+
+When the value is `file', also include the file name (without directory)
+into the path.  In this case, you can also stop the completion after
+the file name, to get entries inserted as top level in the file.
+
+When `full-file-path', include the full file path.
+
+When `buffer-name', use the buffer name."
+  :group 'org-refile
+  :type '(choice
+         (const :tag "Not" nil)
+         (const :tag "Yes" t)
+         (const :tag "Start with file name" file)
+         (const :tag "Start with full file path" full-file-path)
+         (const :tag "Start with buffer name" buffer-name)))
+
+(defcustom org-outline-path-complete-in-steps t
+  "Non-nil means complete the outline path in hierarchical steps.
+When Org uses the refile interface to select an outline path (see
+`org-refile-use-outline-path'), the completion of the path can be
+done in a single go, or it can be done in steps down the headline
+hierarchy.  Going in steps is probably the best if you do not use
+a special completion package like `ido' or `icicles'.  However,
+when using these packages, going in one step can be very fast,
+while still showing the whole path to the entry."
+  :group 'org-refile
+  :type 'boolean)
+
+(defcustom org-refile-allow-creating-parent-nodes nil
+  "Non-nil means allow the creation of new nodes as refile targets.
+New nodes are then created by adding \"/new node name\" to the completion
+of an existing node.  When the value of this variable is `confirm',
+new node creation must be confirmed by the user (recommended).
+When nil, the completion must match an existing entry.
+
+Note that, if the new heading is not seen by the criteria
+listed in `org-refile-targets', multiple instances of the same
+heading would be created by trying again to file under the new
+heading."
+  :group 'org-refile
+  :type '(choice
+         (const :tag "Never" nil)
+         (const :tag "Always" t)
+         (const :tag "Prompt for confirmation" confirm)))
+
+(defcustom org-refile-active-region-within-subtree nil
+  "Non-nil means also refile active region within a subtree.
+
+By default `org-refile' doesn't allow refiling regions if they
+don't contain a set of subtrees, but it might be convenient to
+do so sometimes: in that case, the first line of the region is
+converted to a headline before refiling."
+  :group 'org-refile
+  :version "24.1"
+  :type 'boolean)
+
+(defvar org-refile-target-table nil
+  "The list of refile targets, created by `org-refile'.")
+
+(defvar org-refile-cache nil
+  "Cache for refile targets.")
+
+(defvar org-refile-markers nil
+  "All the markers used for caching refile locations.")
+
+;; Add org refile commands to the main org menu
+(mapc (lambda (i) (easy-menu-add-item
+                  org-org-menu
+                  '("Edit Structure") i))
+      '(["Refile Subtree" org-refile (org-in-subtree-not-table-p)]
+       ["Refile and copy Subtree" org-copy (org-in-subtree-not-table-p)]))
+
+(defun org-refile-marker (pos)
+  "Get a new refile marker, but only if caching is in use."
+  (if (not org-refile-use-cache)
+      pos
+    (let ((m (make-marker)))
+      (move-marker m pos)
+      (push m org-refile-markers)
+      m)))
+
+(defun org-refile-cache-clear ()
+  "Clear the refile cache and disable all the markers."
+  (dolist (m org-refile-markers) (move-marker m nil))
+  (setq org-refile-markers nil)
+  (setq org-refile-cache nil)
+  (message "Refile cache has been cleared"))
+
+(defun org-refile-cache-check-set (set)
+  "Check if all the markers in the cache still have live buffers."
+  (let (marker)
+    (catch 'exit
+      (while (and set (setq marker (nth 3 (pop set))))
+       ;; If `org-refile-use-outline-path' is 'file, marker may be nil
+       (when (and marker (null (marker-buffer marker)))
+         (message "Please regenerate the refile cache with `C-0 C-c C-w'")
+         (sit-for 3)
+         (throw 'exit nil)))
+      t)))
+
+(defun org-refile-cache-put (set &rest identifiers)
+  "Push the refile targets SET into the cache, under IDENTIFIERS."
+  (let* ((key (sha1 (prin1-to-string identifiers)))
+        (entry (assoc key org-refile-cache)))
+    (if entry
+       (setcdr entry set)
+      (push (cons key set) org-refile-cache))))
+
+(defun org-refile-cache-get (&rest identifiers)
+  "Retrieve the cached value for refile targets given by IDENTIFIERS."
+  (cond
+   ((not org-refile-cache) nil)
+   ((not org-refile-use-cache) (org-refile-cache-clear) nil)
+   (t
+    (let ((set (cdr (assoc (sha1 (prin1-to-string identifiers))
+                          org-refile-cache))))
+      (and set (org-refile-cache-check-set set) set)))))
+
+(defun org-refile-get-targets (&optional default-buffer)
+  "Produce a table with refile targets."
+  (let ((case-fold-search nil)
+       ;; otherwise org confuses "TODO" as a kw and "Todo" as a word
+       (entries (or org-refile-targets '((nil . (:level . 1)))))
+       targets tgs files desc descre)
+    (message "Getting targets...")
+    (with-current-buffer (or default-buffer (current-buffer))
+      (dolist (entry entries)
+       (setq files (car entry) desc (cdr entry))
+       (cond
+        ((null files) (setq files (list (current-buffer))))
+        ((eq files 'org-agenda-files)
+         (setq files (org-agenda-files 'unrestricted)))
+        ((and (symbolp files) (fboundp files))
+         (setq files (funcall files)))
+        ((and (symbolp files) (boundp files))
+         (setq files (symbol-value files))))
+       (when (stringp files) (setq files (list files)))
+       (cond
+        ((eq (car desc) :tag)
+         (setq descre (concat "^\\*+[ \t]+.*?:" (regexp-quote (cdr desc)) 
":")))
+        ((eq (car desc) :todo)
+         (setq descre (concat "^\\*+[ \t]+" (regexp-quote (cdr desc)) "[ 
\t]")))
+        ((eq (car desc) :regexp)
+         (setq descre (cdr desc)))
+        ((eq (car desc) :level)
+         (setq descre (concat "^\\*\\{" (number-to-string
+                                         (if org-odd-levels-only
+                                             (1- (* 2 (cdr desc)))
+                                           (cdr desc)))
+                              "\\}[ \t]")))
+        ((eq (car desc) :maxlevel)
+         (setq descre (concat "^\\*\\{1," (number-to-string
+                                           (if org-odd-levels-only
+                                               (1- (* 2 (cdr desc)))
+                                             (cdr desc)))
+                              "\\}[ \t]")))
+        (t (error "Bad refiling target description %s" desc)))
+       (dolist (f files)
+         (with-current-buffer (if (bufferp f) f (org-get-agenda-file-buffer f))
+           (or
+            (setq tgs (org-refile-cache-get (buffer-file-name) descre))
+            (progn
+              (when (bufferp f)
+                (setq f (buffer-file-name (buffer-base-buffer f))))
+              (setq f (and f (expand-file-name f)))
+              (when (eq org-refile-use-outline-path 'file)
+                (push (list (file-name-nondirectory f) f nil nil) tgs))
+              (when (eq org-refile-use-outline-path 'buffer-name)
+                (push (list (buffer-name (buffer-base-buffer)) f nil nil) tgs))
+              (when (eq org-refile-use-outline-path 'full-file-path)
+                (push (list (file-truename (buffer-file-name 
(buffer-base-buffer))) f nil nil) tgs))
+              (org-with-wide-buffer
+               (goto-char (point-min))
+               (setq org-outline-path-cache nil)
+               (while (re-search-forward descre nil t)
+                 (beginning-of-line)
+                 (let ((case-fold-search nil))
+                   (looking-at org-complex-heading-regexp))
+                 (let ((begin (point))
+                       (heading (match-string-no-properties 4)))
+                   (unless (or (and
+                                org-refile-target-verify-function
+                                (not
+                                 (funcall org-refile-target-verify-function)))
+                               (not heading))
+                     (let ((re (format org-complex-heading-regexp-format
+                                       (regexp-quote heading)))
+                           (target
+                            (if (not org-refile-use-outline-path) heading
+                              (mapconcat
+                               #'identity
+                               (append
+                                (pcase org-refile-use-outline-path
+                                  (`file (list (file-name-nondirectory
+                                                (buffer-file-name
+                                                 (buffer-base-buffer)))))
+                                  (`full-file-path
+                                   (list (buffer-file-name
+                                          (buffer-base-buffer))))
+                                  (`buffer-name
+                                   (list (buffer-name
+                                          (buffer-base-buffer))))
+                                  (_ nil))
+                                (mapcar (lambda (s) (replace-regexp-in-string
+                                                     "/" "\\/" s nil t))
+                                        (org-get-outline-path t t)))
+                               "/"))))
+                       (push (list target f re (org-refile-marker (point)))
+                             tgs)))
+                   (when (= (point) begin)
+                     ;; Verification function has not moved point.
+                     (end-of-line)))))))
+           (when org-refile-use-cache
+             (org-refile-cache-put tgs (buffer-file-name) descre))
+           (setq targets (append tgs targets))))))
+    (message "Getting targets...done")
+    (delete-dups (nreverse targets))))
+
+(defvar org-refile-history nil
+  "History for refiling operations.")
+
+(defvar org-after-refile-insert-hook nil
+  "Hook run after `org-refile' has inserted its stuff at the new location.
+Note that this is still *before* the stuff will be removed from
+the *old* location.")
+
+(defvar org-refile-keep nil
+  "Non-nil means `org-refile' will copy instead of refile.")
+
+(define-obsolete-function-alias 'org-copy 'org-refile-copy "Org 9.4")
+
+;;;###autoload
+(defun org-refile-copy ()
+  "Like `org-refile', but preserve the refiled subtree."
+  (interactive)
+  (let ((org-refile-keep t))
+    (org-refile nil nil nil "Copy")))
+
+(defvar org-capture-last-stored-marker)
+
+;;;###autoload
+(defun org-refile (&optional arg default-buffer rfloc msg)
+  "Move the entry or entries at point to another heading.
+
+The list of target headings is compiled using the information in
+`org-refile-targets', which see.
+
+At the target location, the entry is filed as a subitem of the
+target heading.  Depending on `org-reverse-note-order', the new
+subitem will either be the first or the last subitem.
+
+If there is an active region, all entries in that region will be
+refiled.  However, the region must fulfill the requirement that
+the first heading sets the top-level of the moved text.
+
+With a `\\[universal-argument]' ARG, the command will only visit the target \
+location
+and not actually move anything.
+
+With a prefix `\\[universal-argument] \\[universal-argument]', go to the \
+location where the last
+refiling operation has put the subtree.
+
+With a numeric prefix argument of `2', refile to the running clock.
+
+With a numeric prefix argument of `3', emulate `org-refile-keep'
+being set to t and copy to the target location, don't move it.
+Beware that keeping refiled entries may result in duplicated ID
+properties.
+
+RFLOC can be a refile location obtained in a different way.  It
+should be a list with the following 4 elements:
+
+1. Name - an identifier for the refile location, typically the
+headline text
+2. File - the file the refile location is in
+3. nil - used for generating refile location candidates, not
+needed when passing RFLOC
+4. Position - the position in the specified file of the
+headline to refile under
+
+MSG is a string to replace \"Refile\" in the default prompt with
+another verb.  E.g. `org-copy' sets this parameter to \"Copy\".
+
+See also `org-refile-use-outline-path'.
+
+If you are using target caching (see `org-refile-use-cache'), you
+have to clear the target cache in order to find new targets.
+This can be done with a `0' prefix (`C-0 C-c C-w') or a triple
+prefix argument (`C-u C-u C-u C-c C-w')."
+  (interactive "P")
+  (if (member arg '(0 (64)))
+      (org-refile-cache-clear)
+    (let* ((actionmsg (cond (msg msg)
+                           ((equal arg 3) "Refile (and keep)")
+                           (t "Refile")))
+          (regionp (org-region-active-p))
+          (region-start (and regionp (region-beginning)))
+          (region-end (and regionp (region-end)))
+          (org-refile-keep (if (equal arg 3) t org-refile-keep))
+          pos it nbuf file level reversed)
+      (setq last-command nil)
+      (when regionp
+       (goto-char region-start)
+       (beginning-of-line)
+       (setq region-start (point))
+       (unless (or (org-kill-is-subtree-p
+                    (buffer-substring region-start region-end))
+                   (prog1 org-refile-active-region-within-subtree
+                     (let ((s (point-at-eol)))
+                       (org-toggle-heading)
+                       (setq region-end (+ (- (point-at-eol) s) region-end)))))
+         (user-error "The region is not a (sequence of) subtree(s)")))
+      (if (equal arg '(16))
+         (org-refile-goto-last-stored)
+       (when (or
+              (and (equal arg 2)
+                   org-clock-hd-marker (marker-buffer org-clock-hd-marker)
+                   (prog1
+                       (setq it (list (or org-clock-heading "running clock")
+                                      (buffer-file-name
+                                       (marker-buffer org-clock-hd-marker))
+                                      ""
+                                      (marker-position org-clock-hd-marker)))
+                     (setq arg nil)))
+              (setq it
+                    (or rfloc
+                        (let (heading-text)
+                          (save-excursion
+                            (unless (and arg (listp arg))
+                              (org-back-to-heading t)
+                              (setq heading-text
+                                    (replace-regexp-in-string
+                                     org-link-bracket-re
+                                     "\\2"
+                                     (or (nth 4 (org-heading-components))
+                                         ""))))
+                            (org-refile-get-location
+                             (cond ((and arg (listp arg)) "Goto")
+                                   (regionp (concat actionmsg " region to"))
+                                   (t (concat actionmsg " subtree \""
+                                              heading-text "\" to")))
+                             default-buffer
+                             (and (not (equal '(4) arg))
+                                  org-refile-allow-creating-parent-nodes)))))))
+         (setq file (nth 1 it)
+               pos (nth 3 it))
+         (when (and (not arg)
+                    pos
+                    (equal (buffer-file-name) file)
+                    (if regionp
+                        (and (>= pos region-start)
+                             (<= pos region-end))
+                      (and (>= pos (point))
+                           (< pos (save-excursion
+                                    (org-end-of-subtree t t))))))
+           (error "Cannot refile to position inside the tree or region"))
+         (setq nbuf (or (find-buffer-visiting file)
+                        (find-file-noselect file)))
+         (if (and arg (not (equal arg 3)))
+             (progn
+               (pop-to-buffer-same-window nbuf)
+               (goto-char (cond (pos)
+                                ((org-notes-order-reversed-p) (point-min))
+                                (t (point-max))))
+               (org-show-context 'org-goto))
+           (if regionp
+               (progn
+                 (org-kill-new (buffer-substring region-start region-end))
+                 (org-save-markers-in-region region-start region-end))
+             (org-copy-subtree 1 nil t))
+           (with-current-buffer (setq nbuf (or (find-buffer-visiting file)
+                                               (find-file-noselect file)))
+             (setq reversed (org-notes-order-reversed-p))
+             (org-with-wide-buffer
+              (if pos
+                  (progn
+                    (goto-char pos)
+                    (setq level (org-get-valid-level (funcall outline-level) 
1))
+                    (goto-char
+                     (if reversed
+                         (or (outline-next-heading) (point-max))
+                       (or (save-excursion (org-get-next-sibling))
+                           (org-end-of-subtree t t)
+                           (point-max)))))
+                (setq level 1)
+                (if (not reversed)
+                    (goto-char (point-max))
+                  (goto-char (point-min))
+                  (or (outline-next-heading) (goto-char (point-max)))))
+              (unless (bolp) (newline))
+              (org-paste-subtree level nil nil t)
+              ;; Record information, according to `org-log-refile'.
+              ;; Do not prompt for a note when refiling multiple
+              ;; headlines, however.  Simply add a time stamp.
+              (cond
+               ((not org-log-refile))
+               (regionp
+                (org-map-region
+                 (lambda () (org-add-log-setup 'refile nil nil 'time))
+                 (point)
+                 (+ (point) (- region-end region-start))))
+               (t
+                (org-add-log-setup 'refile nil nil org-log-refile)))
+              (and org-auto-align-tags
+                   (let ((org-loop-over-headlines-in-active-region nil))
+                     (org-align-tags)))
+              (let ((bookmark-name (plist-get org-bookmark-names-plist
+                                              :last-refile)))
+                (when bookmark-name
+                  (with-demoted-errors
+                      (bookmark-set bookmark-name))))
+              ;; If we are refiling for capture, make sure that the
+              ;; last-capture pointers point here
+              (when (bound-and-true-p org-capture-is-refiling)
+                (let ((bookmark-name (plist-get org-bookmark-names-plist
+                                                :last-capture-marker)))
+                  (when bookmark-name
+                    (with-demoted-errors
+                        (bookmark-set bookmark-name))))
+                (move-marker org-capture-last-stored-marker (point)))
+              (when (fboundp 'deactivate-mark) (deactivate-mark))
+              (run-hooks 'org-after-refile-insert-hook)))
+           (unless org-refile-keep
+             (if regionp
+                 (delete-region (point) (+ (point) (- region-end 
region-start)))
+               (org-preserve-local-variables
+                (delete-region
+                 (and (org-back-to-heading t) (point))
+                 (min (1+ (buffer-size)) (org-end-of-subtree t t) (point))))))
+           (when (featurep 'org-inlinetask)
+             (org-inlinetask-remove-END-maybe))
+           (setq org-markers-to-move nil)
+           (message "%s to \"%s\" in file %s: done" actionmsg
+                    (car it) file)))))))
+
+(defun org-refile-goto-last-stored ()
+  "Go to the location where the last refile was stored."
+  (interactive)
+  (bookmark-jump (plist-get org-bookmark-names-plist :last-refile))
+  (message "This is the location of the last refile"))
+
+(defun org-refile--get-location (refloc tbl)
+  "When user refile to REFLOC, find the associated target in TBL.
+Also check `org-refile-target-table'."
+  (car (delq
+       nil
+       (mapcar
+        (lambda (r) (or (assoc r tbl)
+                        (assoc r org-refile-target-table)))
+        (list (replace-regexp-in-string "/$" "" refloc)
+              (replace-regexp-in-string "\\([^/]\\)$" "\\1/" refloc))))))
+
+(defun org-refile-get-location (&optional prompt default-buffer new-nodes)
+  "Prompt the user for a refile location, using PROMPT.
+PROMPT should not be suffixed with a colon and a space, because
+this function appends the default value from
+`org-refile-history' automatically, if that is not empty."
+  (let ((org-refile-targets org-refile-targets)
+       (org-refile-use-outline-path org-refile-use-outline-path))
+    (setq org-refile-target-table (org-refile-get-targets default-buffer)))
+  (unless org-refile-target-table
+    (user-error "No refile targets"))
+  (let* ((cbuf (current-buffer))
+        (cfn (buffer-file-name (buffer-base-buffer cbuf)))
+        (cfunc (if (and org-refile-use-outline-path
+                        org-outline-path-complete-in-steps)
+                   #'org-olpath-completing-read
+                 #'completing-read))
+        (extra (if org-refile-use-outline-path "/" ""))
+        (cbnex (concat (buffer-name) extra))
+        (filename (and cfn (expand-file-name cfn)))
+        (tbl (mapcar
+              (lambda (x)
+                (if (and (not (member org-refile-use-outline-path
+                                      '(file full-file-path)))
+                         (not (equal filename (nth 1 x))))
+                    (cons (concat (car x) extra " ("
+                                  (file-name-nondirectory (nth 1 x)) ")")
+                          (cdr x))
+                  (cons (concat (car x) extra) (cdr x))))
+              org-refile-target-table))
+        (completion-ignore-case t)
+        cdef
+        (prompt (concat prompt
+                        (or (and (car org-refile-history)
+                                 (concat " (default " (car org-refile-history) 
")"))
+                            (and (assoc cbnex tbl) (setq cdef cbnex)
+                                 (concat " (default " cbnex ")"))) ": "))
+        pa answ parent-target child parent old-hist)
+    (setq old-hist org-refile-history)
+    (setq answ (funcall cfunc prompt tbl nil (not new-nodes)
+                       nil 'org-refile-history
+                       (or cdef (concat (car org-refile-history) extra))))
+    (if (setq pa (org-refile--get-location answ tbl))
+       (let* ((last-refile-loc (car org-refile-history))
+              (last-refile-loc-path (concat last-refile-loc extra)))
+         (org-refile-check-position pa)
+         (when (or (not org-refile-history)
+                   (not (eq old-hist org-refile-history))
+                   (not (equal (car pa) last-refile-loc-path)))
+           (setq org-refile-history
+                 (cons (car pa) (if (assoc last-refile-loc tbl)
+                                    org-refile-history
+                                  (cdr org-refile-history))))
+           (when (or (equal last-refile-loc-path (nth 1 org-refile-history))
+                     (equal last-refile-loc (nth 1 org-refile-history)))
+             (pop org-refile-history)))
+         pa)
+      (if (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ)
+         (progn
+           (setq parent (match-string 1 answ)
+                 child (match-string 2 answ))
+           (setq parent-target (org-refile--get-location parent tbl))
+           (when (and parent-target
+                      (or (eq new-nodes t)
+                          (and (eq new-nodes 'confirm)
+                               (y-or-n-p (format "Create new node \"%s\"? "
+                                                 child)))))
+             (org-refile-new-child parent-target child)))
+       (user-error "Invalid target location")))))
+
+(defun org-refile-check-position (refile-pointer)
+  "Check if the refile pointer matches the headline to which it points."
+  (let* ((file (nth 1 refile-pointer))
+        (re (nth 2 refile-pointer))
+        (pos (nth 3 refile-pointer))
+        buffer)
+    (if (and (not (markerp pos)) (not file))
+       (user-error "Please indicate a target file in the refile path")
+      (when (org-string-nw-p re)
+       (setq buffer (if (markerp pos)
+                        (marker-buffer pos)
+                      (or (find-buffer-visiting file)
+                          (find-file-noselect file))))
+       (with-current-buffer buffer
+         (org-with-wide-buffer
+          (goto-char pos)
+          (beginning-of-line 1)
+          (unless (looking-at-p re)
+            (user-error "Invalid refile position, please clear the cache with 
`C-0 C-c C-w' before refiling"))))))))
+
+(defun org-refile-new-child (parent-target child)
+  "Use refile target PARENT-TARGET to add new CHILD below it."
+  (unless parent-target
+    (error "Cannot find parent for new node"))
+  (let ((file (nth 1 parent-target))
+       (pos (nth 3 parent-target))
+       level)
+    (with-current-buffer (or (find-buffer-visiting file)
+                            (find-file-noselect file))
+      (org-with-wide-buffer
+       (if pos
+          (goto-char pos)
+        (goto-char (point-max))
+        (unless (bolp) (newline)))
+       (when (looking-at org-outline-regexp)
+        (setq level (funcall outline-level))
+        (org-end-of-subtree t t))
+       (org-back-over-empty-lines)
+       (insert "\n" (make-string
+                    (if pos (org-get-valid-level level 1) 1) ?*)
+              " " child "\n")
+       (beginning-of-line 0)
+       (list (concat (car parent-target) "/" child) file "" (point))))))
+
+(defun org-olpath-completing-read (prompt collection &rest args)
+  "Read an outline path like a file name."
+  (let ((thetable collection))
+    (apply #'completing-read
+          prompt
+          (lambda (string predicate &optional flag)
+            (cond
+             ((eq flag nil) (try-completion string thetable))
+             ((eq flag t)
+              (let ((l (length string)))
+                (mapcar (lambda (x)
+                          (let ((r (substring x l))
+                                (f (if (string-match " ([^)]*)$" x)
+                                       (match-string 0 x)
+                                     "")))
+                            (if (string-match "/" r)
+                                (concat string (substring r 0 (match-end 0)) f)
+                              x)))
+                        (all-completions string thetable predicate))))
+             ;; Exact match?
+             ((eq flag 'lambda) (assoc string thetable))))
+          args)))
+
+(provide 'org-refile)
+
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
+;;; org-refile.el ends here
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index 7876dea..20acee4 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -1,6 +1,6 @@
 ;;; org-src.el --- Source code examples in Org       -*- lexical-binding: t; 
-*-
 ;;
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;        Bastien Guerry <bzg@gnu.org>
@@ -37,6 +37,7 @@
 (require 'org-compat)
 (require 'org-keys)
 
+(declare-function org-mode "org" ())
 (declare-function org-element-at-point "org-element" ())
 (declare-function org-element-class "org-element" (datum &optional parent))
 (declare-function org-element-context "org-element" (&optional element))
@@ -148,6 +149,9 @@ the existing edit buffer."
   "How the source code edit buffer should be displayed.
 Possible values for this option are:
 
+plain              Show edit buffer using `display-buffer'.  Users can
+                   further control the display behavior by modifying
+                   `display-buffer-alist' and its relatives.
 current-window     Show edit buffer in the current window, keeping all other
                    windows.
 split-window-below Show edit buffer below the current window, keeping all
@@ -156,10 +160,12 @@ split-window-right Show edit buffer to the right of the 
current window,
                    keeping all other windows.
 other-window       Use `switch-to-buffer-other-window' to display edit buffer.
 reorganize-frame   Show only two windows on the current frame, the current
-                   window and the edit buffer.  When exiting the edit buffer,
-                   return to one window.
+                   window and the edit buffer.
 other-frame        Use `switch-to-buffer-other-frame' to display edit buffer.
-                   Also, when exiting the edit buffer, kill that frame."
+                   Also, when exiting the edit buffer, kill that frame.
+
+Values that modify the window layout (reorganize-frame, split-window-below,
+split-window-right) will restore the layout after exiting the edit buffer."
   :group 'org-edit-structure
   :type '(choice
          (const current-window)
@@ -232,11 +238,11 @@ green, respectability.
   :version "26.1"
   :package-version '(Org . "9.0"))
 
-(defcustom org-src-tab-acts-natively nil
+(defcustom org-src-tab-acts-natively t
   "If non-nil, the effect of TAB in a code block is as if it were
 issued in the language major mode buffer."
   :type 'boolean
-  :version "24.1"
+  :package-version '(Org . "9.4")
   :group 'org-babel)
 
 
@@ -276,6 +282,9 @@ issued in the language major mode buffer."
 (defvar-local org-src--remote nil)
 (put 'org-src--remote 'permanent-local t)
 
+(defvar-local org-src--saved-temp-window-config nil)
+(put 'org-src--saved-temp-window-config 'permanent-local t)
+
 (defvar-local org-src--source-type nil
   "Type of element being edited, as a symbol.")
 (put 'org-src--source-type 'permanent-local t)
@@ -355,6 +364,12 @@ where BEG and END are buffer positions and CONTENTS is a 
string."
             (end (progn (goto-char (org-element-property :end datum))
                         (search-backward "}" (line-beginning-position) t))))
         (list beg end (buffer-substring-no-properties beg end))))
+      ((eq type 'latex-fragment)
+       (let ((beg (org-element-property :begin datum))
+            (end (org-with-point-at (org-element-property :end datum)
+                   (skip-chars-backward " \t")
+                   (point))))
+        (list beg end (buffer-substring-no-properties beg end))))
       ((org-element-property :contents-begin datum)
        (let ((beg (org-element-property :contents-begin datum))
             (end (org-element-property :contents-end datum)))
@@ -469,6 +484,10 @@ When REMOTE is non-nil, do not try to preserve point or 
mark when
 moving from the edit area to the source.
 
 Leave point in edit buffer."
+  (when (memq org-src-window-setup '(reorganize-frame
+                                    split-window-below
+                                    split-window-right))
+    (setq org-src--saved-temp-window-config (current-window-configuration)))
   (let* ((area (org-src--contents-area datum))
         (beg (copy-marker (nth 0 area)))
         (end (copy-marker (nth 1 area) t))
@@ -540,6 +559,10 @@ Leave point in edit buffer."
        (setq org-src-source-file-name source-file-name)
        ;; Start minor mode.
        (org-src-mode)
+       ;; Clear undo information so we cannot undo back to the
+       ;; initial empty buffer.
+       (buffer-disable-undo (current-buffer))
+       (buffer-enable-undo)
        ;; Move mark and point in edit buffer to the corresponding
        ;; location.
        (if remote
@@ -792,9 +815,14 @@ Raise an error when current buffer is not a source editing 
buffer."
 
 (defun org-src-switch-to-buffer (buffer context)
   (pcase org-src-window-setup
+    (`plain
+     (when (eq context 'exit) (quit-restore-window))
+     (pop-to-buffer buffer))
     (`current-window (pop-to-buffer-same-window buffer))
     (`other-window
-     (switch-to-buffer-other-window buffer))
+     (let ((cur-win (selected-window)))
+       (org-switch-to-buffer-other-window buffer)
+       (when (eq context 'exit) (quit-restore-window cur-win))))
     (`split-window-below
      (if (eq context 'exit)
         (delete-window)
@@ -912,7 +940,7 @@ A coderef format regexp can only match at the end of a 
line."
           ;; remove any newline characters in order to preserve
           ;; table's structure.
           (when (org-element-lineage definition '(table-cell))
-            (while (search-forward "\n" nil t) (replace-match "")))))
+            (while (search-forward "\n" nil t) (replace-match " ")))))
        contents
        'remote))
     ;; Report success.
@@ -942,6 +970,46 @@ Throw an error when not at such a table."
     (table-recognize)
     t))
 
+(defun org-edit-latex-fragment ()
+  "Edit LaTeX fragment at point."
+  (interactive)
+  (let ((context (org-element-context)))
+    (unless (and (eq 'latex-fragment (org-element-type context))
+                (org-src--on-datum-p context))
+      (user-error "Not on a LaTeX fragment"))
+    (let* ((contents
+           (buffer-substring-no-properties
+            (org-element-property :begin context)
+            (- (org-element-property :end context)
+               (org-element-property :post-blank context))))
+          (delim-length (if (string-match "\\`\\$[^$]" contents) 1 2)))
+      ;; Make the LaTeX deliminators read-only.
+      (add-text-properties 0 delim-length
+                          (list 'read-only "Cannot edit LaTeX deliminator"
+                                'front-sticky t
+                                'rear-nonsticky t)
+                          contents)
+      (let ((l (length contents)))
+       (add-text-properties (- l delim-length) l
+                            (list 'read-only "Cannot edit LaTeX deliminator"
+                                  'front-sticky nil
+                                  'rear-nonsticky nil)
+                            contents))
+      (org-src--edit-element
+       context
+       (org-src--construct-edit-buffer-name (buffer-name) "LaTeX fragment")
+       (org-src-get-lang-mode "latex")
+       (lambda ()
+        ;; Blank lines break things, replace with a single newline.
+        (while (re-search-forward "\n[ \t]*\n" nil t) (replace-match "\n"))
+        ;; If within a table a newline would disrupt the structure,
+        ;; so remove newlines.
+        (goto-char (point-min))
+        (when (org-element-lineage context '(table-cell))
+          (while (search-forward "\n" nil t) (replace-match " "))))
+       contents))
+    t))
+
 (defun org-edit-latex-environment ()
   "Edit LaTeX environment at point.
 \\<org-src-mode-map>
@@ -1182,8 +1250,11 @@ Throw an error if there is no such buffer."
        (write-back (org-src--goto-coordinates coordinates beg end))))
     ;; Clean up left-over markers and restore window configuration.
     (set-marker beg nil)
-    (set-marker end nil)))
-
+    (set-marker end nil)
+    (when org-src--saved-temp-window-config
+      (unwind-protect
+         (set-window-configuration org-src--saved-temp-window-config)
+       (setq org-src--saved-temp-window-config nil)))))
 
 (provide 'org-src)
 
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 4636baa..ef4672e 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -1,6 +1,6 @@
 ;;; org-table.el --- The Table Editor for Org        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -40,8 +40,13 @@
 (require 'org-keys)
 
 (declare-function calc-eval "calc" (str &optional separator &rest args))
+(declare-function face-remap-remove-relative "face-remap" (cookie))
+(declare-function face-remap-add-relative "face-remap" (face &rest specs))
 (declare-function org-at-timestamp-p "org" (&optional extended))
 (declare-function org-delete-backward-char "org" (N))
+(declare-function org-mode "org" ())
+(declare-function org-duration-p "org-duration" (duration &optional canonical))
+(declare-function org-duration-to-minutes "org-duration" (duration &optional 
canonical))
 (declare-function org-element-at-point "org-element" ())
 (declare-function org-element-contents "org-element" (element))
 (declare-function org-element-extract-element "org-element" (element))
@@ -164,6 +169,12 @@ table, obtained by prompting the user."
   :tag "Org Table Settings"
   :group 'org-table)
 
+(defcustom org-table-header-line-p nil
+  "Activate `org-table-header-line-mode' by default?"
+  :type 'boolean
+  :package-version '(Org . "9.4")
+  :group 'org-table)
+
 (defcustom org-table-default-size "5x2"
   "The default size for newly created tables, Columns x Rows."
   :group 'org-table-settings
@@ -442,6 +453,59 @@ prevents it from hanging Emacs."
   :package-version '(Org . "8.3"))
 
 
+;;; Org table header minor mode
+(defun org-table-row-get-visible-string (&optional pos)
+  "Get the visible string of a table row.
+This may be useful when columns have been shrunk."
+  (save-excursion
+    (when pos (goto-char pos))
+    (goto-char (line-beginning-position))
+    (let ((end (line-end-position)) str)
+      (while (progn (forward-char 1) (< (point) end))
+       (let ((ov (car (overlays-at (point)))))
+         (if (not ov)
+             (push (char-to-string (char-after)) str)
+           (push (overlay-get ov 'display) str)
+           (goto-char (1- (overlay-end ov))))))
+      (format "|%s" (mapconcat #'identity (reverse str) "")))))
+
+(defvar-local org-table-header-overlay nil)
+(defun org-table-header-set-header ()
+  "Display the header of the table at point."
+  (when (overlayp org-table-header-overlay)
+    (delete-overlay org-table-header-overlay))
+  (let* ((ws (window-start))
+        (beg (save-excursion
+               (goto-char (org-table-begin))
+               (while (or (org-at-table-hline-p)
+                          (looking-at-p ".*|\\s-+<[rcl]?\\([0-9]+\\)?>"))
+                 (move-beginning-of-line 2))
+               (point)))
+        (end (save-excursion (goto-char beg) (point-at-eol))))
+    (if (pos-visible-in-window-p beg)
+       (when (overlayp org-table-header-overlay)
+         (delete-overlay org-table-header-overlay))
+      (setq org-table-header-overlay
+           (make-overlay ws (+ ws (- end beg))))
+      (org-overlay-display
+       org-table-header-overlay
+       (org-table-row-get-visible-string beg)
+       'org-table-header))))
+
+;;;###autoload
+(define-minor-mode org-table-header-line-mode
+  "Display the first row of the table at point in the header line."
+  nil " TblHeader" nil
+  (unless (eq major-mode 'org-mode)
+    (user-error "Cannot turn org table header mode outside org-mode buffers"))
+  (if org-table-header-line-mode
+      (add-hook 'post-command-hook #'org-table-header-set-header nil t)
+    (when (overlayp org-table-header-overlay)
+      (delete-overlay org-table-header-overlay)
+      (setq org-table-header-overlay nil))
+    (remove-hook 'post-command-hook #'org-table-header-set-header t)))
+
+
 ;;; Regexps Constants
 
 (defconst org-table-any-line-regexp "^[ \t]*\\(|\\|\\+-[-+]\\)"
@@ -860,19 +924,22 @@ nil      When nil, the command tries to be smart and 
figure out the
 The command tries to be smart and figure out the separator in the
 following way:
 
-  - when each line contains a TAB, assume TAB-separated material
-  - when each line contains a comma, assume CSV material
-  - else, assume one or more SPACE characters as separator.
+- when each line contains a TAB, assume TAB-separated material;
+- when each line contains a comma, assume CSV material;
+- else, assume one or more SPACE characters as separator.
 
 When non-nil, SEPARATOR specifies the field separator in the
 lines.  It can have the following values:
 
-(4)     Use the comma as a field separator
-(16)    Use a TAB as field separator
-(64)    Prompt for a regular expression as field separator
-integer When a number, use that many spaces, or a TAB, as field separator
-regexp  When a regular expression, use it to match the separator."
+- (4)     Use the comma as a field separator.
+- (16)    Use a TAB as field separator.
+- (64)    Prompt for a regular expression as field separator.
+- integer When a number, use that many spaces, or a TAB, as field separator.
+- regexp  When a regular expression, use it to match the separator."
   (interactive "f\nP")
+  (when (and (called-interactively-p 'any)
+            (not (string-match-p (rx "." (or "txt" "tsv" "csv") eos) file)))
+    (user-error "Cannot import such file"))
   (unless (bolp) (insert "\n"))
   (let ((beg (point))
        (pm (point-max)))
@@ -1181,7 +1248,7 @@ value."
   (save-excursion
     (let* ((pos (point))
           (col (org-table-current-column))
-          (cname (car (rassoc (int-to-string col) org-table-column-names)))
+          (cname (car (rassoc (number-to-string col) org-table-column-names)))
           (name (car (rassoc (list (count-lines org-table-current-begin-pos
                                                 (line-beginning-position))
                                    col)
@@ -1290,25 +1357,20 @@ However, when FORCE is non-nil, create new columns if 
necessary."
       (while (< (point) end)
        (unless (org-at-table-hline-p)
          (org-table-goto-column col t)
-         (unless (search-forward "|" (line-end-position) t 2)
-           ;; Add missing vertical bar at the end of the row.
-           (end-of-line)
-           (insert "|"))
-         (insert "  |"))
+         (insert "|"))
        (forward-line)))
-    (org-table-goto-column (1+ col))
+    (org-table-goto-column col)
     (org-table-align)
     ;; Shift appropriately stored shrunk column numbers, then hide the
     ;; columns again.
-    (org-table--shrink-columns (mapcar (lambda (c) (if (<= c col) c (1+ c)))
+    (org-table--shrink-columns (mapcar (lambda (c) (if (< c col) c (1+ c)))
                                       shrunk-columns)
                               beg end)
     (set-marker end nil)
     ;; Fix TBLFM formulas, if desirable.
     (when (or (not org-table-fix-formulas-confirm)
              (funcall org-table-fix-formulas-confirm "Fix formulas? "))
-      (org-table-fix-formulas "$" nil (1- col) 1)
-      (org-table-fix-formulas "$LR" nil (1- col) 1))))
+      (org-table-fix-formulas "$" nil (1- col) 1))))
 
 (defun org-table-find-dataline ()
   "Find a data line in the current table, which is needed for column commands.
@@ -1431,6 +1493,8 @@ Swap with anything in target cell."
   (interactive)
   (unless (org-at-table-p) (user-error "Not at a table"))
   (org-table-find-dataline)
+  (when (save-excursion (skip-chars-forward " \t") (eolp))
+    (search-backward "|"))             ;snap into last column
   (org-table-check-inside-data-field nil t)
   (let* ((col (org-table-current-column))
         (beg (org-table-begin))
@@ -1446,7 +1510,6 @@ Swap with anything in target cell."
         (and (looking-at "|[^|\n]+|")
              (replace-match "|")))
        (forward-line)))
-    (org-table-goto-column (max 1 (1- col)))
     (org-table-align)
     ;; Shift appropriately stored shrunk column numbers, then hide the
     ;; columns again.
@@ -1458,9 +1521,7 @@ Swap with anything in target cell."
     (when (or (not org-table-fix-formulas-confirm)
              (funcall org-table-fix-formulas-confirm "Fix formulas? "))
       (org-table-fix-formulas
-       "$" (list (cons (number-to-string col) "INVALID")) col -1 col)
-      (org-table-fix-formulas
-       "$LR" (list (cons (number-to-string col) "INVALID")) col -1 col))))
+       "$" (list (cons (number-to-string col) "INVALID")) col -1 col))))
 
 ;;;###autoload
 (defun org-table-move-column-right ()
@@ -1521,11 +1582,7 @@ Swap with anything in target cell."
                (funcall org-table-fix-formulas-confirm "Fix formulas? "))
        (org-table-fix-formulas
         "$" (list (cons (number-to-string col) (number-to-string colpos))
-                  (cons (number-to-string colpos) (number-to-string col))))
-       (org-table-fix-formulas
-        "$LR" (list
-               (cons (number-to-string col) (number-to-string colpos))
-               (cons (number-to-string colpos) (number-to-string col))))))))
+                  (cons (number-to-string colpos) (number-to-string col))))))))
 
 ;;;###autoload
 (defun org-table-move-row-down ()
@@ -1958,9 +2015,9 @@ toggle `org-table-follow-field-mode'."
          (coord
           (if (eq org-table-use-standard-references t)
               (concat (org-number-to-letters (org-table-current-column))
-                      (int-to-string (org-table-current-dline)))
-            (concat "@" (int-to-string (org-table-current-dline))
-                    "$" (int-to-string (org-table-current-column)))))
+                      (number-to-string (org-table-current-dline)))
+            (concat "@" (number-to-string (org-table-current-dline))
+                    "$" (number-to-string (org-table-current-column)))))
          (field (org-table-get-field))
          (cw (current-window-configuration))
          p)
@@ -2060,7 +2117,7 @@ When NAMED is non-nil, look for a named equation."
                      (org-table-current-column)))
         (scol (cond
                ((not named) (format "$%d" (org-table-current-column)))
-               ((and name (not (string-match "\\`LR[0-9]+\\'" name))) name)
+               (name)
                (t ref)))
         (name (or name ref))
         (org-table-may-need-update nil)
@@ -2193,11 +2250,10 @@ For all numbers larger than LIMIT, shift them by DELTA."
   (save-excursion
     (goto-char (org-table-end))
     (while (let ((case-fold-search t)) (looking-at "[ \t]*#\\+tblfm:"))
-      (let ((msg "The formulas in #+TBLFM have been updated")
-           (re (concat key "\\([0-9]+\\)"))
+      (let ((re (concat key "\\([0-9]+\\)"))
            (re2
             (when remove
-              (if (or (equal key "$") (equal key "$LR"))
+              (if (equal key "$")
                   (format "\\(@[0-9]+\\)?%s%d=.*?\\(::\\|$\\)"
                           (regexp-quote key) remove)
                 (format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove))))
@@ -2215,11 +2271,10 @@ For all numbers larger than LIMIT, shift them by DELTA."
            (setq s (match-string 1) n (string-to-number s))
            (cond
             ((setq a (assoc s replace))
-             (replace-match (concat key (cdr a)) t t)
-             (message msg))
+             (replace-match (concat key (cdr a)) t t))
             ((and limit (> n limit))
-             (replace-match (concat key (int-to-string (+ n delta))) t t)
-             (message msg))))))
+             (replace-match (concat key (number-to-string (+ n delta))) t 
t)))))
+       (message "The formulas in #+TBLFM have been updated"))
       (forward-line))))
 
 ;;;###autoload
@@ -2547,7 +2602,8 @@ location of point."
                  ev (if (numberp ev) (number-to-string ev) ev)
                  ev (if duration (org-table-time-seconds-to-string
                                   (string-to-number ev)
-                                  duration-output-format) ev))
+                                  duration-output-format)
+                      ev))
 
          ;; Use <...> time-stamps so that Calc can handle them.
          (setq form
@@ -2578,27 +2634,29 @@ location of point."
                     ev)))
 
        (when org-table-formula-debug
-         (with-output-to-temp-buffer "*Substitution History*"
-           (princ (format "Substitution history of formula
+         (let ((wcf (current-window-configuration)))
+           (with-output-to-temp-buffer "*Substitution History*"
+             (princ (format "Substitution history of formula
 Orig:   %s
 $xyz->  %s
 @r$c->  %s
 $1->    %s\n" orig formula form0 form))
-           (if (consp ev)
-               (princ (format "        %s^\nError:  %s"
-                              (make-string (car ev) ?\-) (nth 1 ev)))
-             (princ (format "Result: %s\nFormat: %s\nFinal:  %s"
-                            ev (or fmt "NONE")
-                            (if fmt (format fmt (string-to-number ev)) ev)))))
-         (setq bw (get-buffer-window "*Substitution History*"))
-         (org-fit-window-to-buffer bw)
-         (unless (and (called-interactively-p 'any) (not ndown))
-           (unless (let (inhibit-redisplay)
-                     (y-or-n-p "Debugging Formula.  Continue to next? "))
-             (org-table-align)
-             (user-error "Abort"))
-           (delete-window bw)
-           (message "")))
+             (if (consp ev)
+                 (princ (format "        %s^\nError:  %s"
+                                (make-string (car ev) ?\-) (nth 1 ev)))
+               (princ (format "Result: %s\nFormat: %s\nFinal:  %s"
+                              ev (or fmt "NONE")
+                              (if fmt (format fmt (string-to-number ev)) 
ev)))))
+           (setq bw (get-buffer-window "*Substitution History*"))
+           (org-fit-window-to-buffer bw)
+           (unless (and (called-interactively-p 'any) (not ndown))
+             (unless (let (inhibit-redisplay)
+                       (y-or-n-p "Debugging Formula.  Continue to next? "))
+               (org-table-align)
+               (user-error "Abort"))
+             (delete-window bw)
+             (message "")
+             (set-window-configuration wcf))))
        (when (consp ev) (setq fmt nil ev "#ERROR"))
        (org-table-justify-field-maybe
         (format org-table-formula-field-format
@@ -3767,14 +3825,16 @@ FACE, when non-nil, for the highlight."
 (defun org-table-toggle-coordinate-overlays ()
   "Toggle the display of Row/Column numbers in tables."
   (interactive)
-  (setq org-table-overlay-coordinates (not org-table-overlay-coordinates))
-  (message "Tables Row/Column numbers display turned %s"
-          (if org-table-overlay-coordinates "on" "off"))
-  (when (and (org-at-table-p) org-table-overlay-coordinates)
-    (org-table-align))
-  (unless org-table-overlay-coordinates
-    (mapc 'delete-overlay org-table-coordinate-overlays)
-    (setq org-table-coordinate-overlays nil)))
+  (if (not (org-at-table-p))
+      (user-error "Not on a table")
+    (setq org-table-overlay-coordinates (not org-table-overlay-coordinates))
+    (when (and (org-at-table-p) org-table-overlay-coordinates)
+      (org-table-align))
+    (unless org-table-overlay-coordinates
+      (mapc 'delete-overlay org-table-coordinate-overlays)
+      (setq org-table-coordinate-overlays nil))
+    (message "Tables Row/Column numbers display turned %s"
+            (if org-table-overlay-coordinates "on" "off"))))
 
 ;;;###autoload
 (defun org-table-toggle-formula-debugger ()
@@ -4238,7 +4298,8 @@ extension of the given file name, and finally on the 
variable
                                     (and (string-match-p fileext f) f))
                                   formats)))
                       org-table-export-default-format)
-                  t t) t t)))
+                  t t)
+                 t t)))
          (setq format
                (org-completing-read
                 "Format: " formats nil nil deffmt-readable))))
@@ -4246,9 +4307,7 @@ extension of the given file name, and finally on the 
variable
          (let ((transform (intern (match-string 1 format)))
                (params (and (match-end 2)
                             (read (concat "(" (match-string 2 format) ")"))))
-               (table (org-table-to-lisp
-                       (buffer-substring-no-properties
-                        (org-table-begin) (org-table-end)))))
+               (table (org-table-to-lisp)))
            (unless (fboundp transform)
              (user-error "No such transformation function %s" transform))
            (let (buf)
@@ -4292,78 +4351,79 @@ FIELD is a string.  WIDTH is a number.  ALIGN is either 
\"c\",
      (move-marker org-table-aligned-end-marker end)
      (goto-char beg)
      (org-table-with-shrunk-columns
-      (let* ((indent (progn (looking-at "[ \t]*") (match-string 0)))
-            ;; Table's rows as lists of fields.  Rules are replaced
-            ;; by nil.  Trailing spaces are removed.
-            (fields (mapcar
-                     (lambda (l)
-                       (and (not (string-match-p org-table-hline-regexp l))
-                            (org-split-string l "[ \t]*|[ \t]*")))
-                     (split-string (buffer-substring beg end) "\n" t)))
-            ;; Compute number of columns.  If the table contains no
-            ;; field, create a default table and bail out.
-            (columns-number
-             (if fields (apply #'max (mapcar #'length fields))
-               (kill-region beg end)
-               (org-table-create org-table-default-size)
-               (user-error "Empty table - created default table")))
+      (let* ((table (org-table-to-lisp))
+             (rows (remq 'hline table))
             (widths nil)
-            (alignments nil))
-       ;; Compute alignment and width for each column.
-       (dotimes (i columns-number)
-         (let* ((max-width 1)
-                (fixed-align? nil)
-                (numbers 0)
-                (non-empty 0))
-           (dolist (row fields)
-             (let ((cell (or (nth i row) "")))
-               (setq max-width (max max-width (org-string-width cell)))
-               (cond (fixed-align? nil)
-                     ((equal cell "") nil)
-                     ((string-match "\\`<\\([lrc]\\)[0-9]*>\\'" cell)
-                      (setq fixed-align? (match-string 1 cell)))
-                     (t
-                      (cl-incf non-empty)
-                      (when (string-match-p org-table-number-regexp cell)
-                        (cl-incf numbers))))))
-           (push max-width widths)
-           (push (cond
-                  (fixed-align?)
-                  ((>= numbers (* org-table-number-fraction non-empty)) "r")
-                  (t "l"))
-                 alignments)))
-       (setq widths (nreverse widths))
-       (setq alignments (nreverse alignments))
+            (alignments nil)
+            (columns-number 1))
+       (if (null rows)
+           ;; Table contains only horizontal rules.  Compute the
+           ;; number of columns anyway, and choose an arbitrary width
+           ;; and alignment.
+           (let ((end (line-end-position)))
+             (save-excursion
+               (while (search-forward "+" end t)
+                 (cl-incf columns-number)))
+             (setq widths (make-list columns-number 1))
+             (setq alignments (make-list columns-number "l")))
+         ;; Compute alignment and width for each column.
+         (setq columns-number (apply #'max (mapcar #'length rows)))
+         (dotimes (i columns-number)
+           (let ((max-width 1)
+                 (fixed-align? nil)
+                 (numbers 0)
+                 (non-empty 0))
+             (dolist (row rows)
+               (let ((cell (or (nth i row) "")))
+                 (setq max-width (max max-width (org-string-width cell)))
+                 (cond (fixed-align? nil)
+                       ((equal cell "") nil)
+                       ((string-match "\\`<\\([lrc]\\)[0-9]*>\\'" cell)
+                        (setq fixed-align? (match-string 1 cell)))
+                       (t
+                        (cl-incf non-empty)
+                        (when (string-match-p org-table-number-regexp cell)
+                          (cl-incf numbers))))))
+             (push max-width widths)
+             (push (cond
+                    (fixed-align?)
+                    ((>= numbers (* org-table-number-fraction non-empty)) "r")
+                    (t "l"))
+                   alignments)))
+         (setq widths (nreverse widths))
+         (setq alignments (nreverse alignments)))
        ;; Store alignment of this table, for later editing of single
        ;; fields.
        (setq org-table-last-alignment alignments)
        (setq org-table-last-column-widths widths)
        ;; Build new table rows.  Only replace rows that actually
        ;; changed.
-       (dolist (row fields)
-         (let ((previous (buffer-substring (point) (line-end-position)))
-               (new
-                (format "%s|%s|"
-                        indent
-                        (if (null row) ;horizontal rule
-                            (mapconcat (lambda (w) (make-string (+ 2 w) ?-))
-                                       widths
-                                       "+")
-                          (let ((cells ;add missing fields
-                                 (append row
-                                         (make-list (- columns-number
-                                                       (length row))
-                                                    ""))))
-                            (mapconcat #'identity
-                                       (cl-mapcar #'org-table--align-field
-                                                  cells
-                                                  widths
-                                                  alignments)
-                                       "|"))))))
-           (if (equal new previous)
-               (forward-line)
-             (insert new "\n")
-             (delete-region (point) (line-beginning-position 2)))))
+       (let ((rule (and (memq 'hline table)
+                        (mapconcat (lambda (w) (make-string (+ 2 w) ?-))
+                                   widths
+                                   "+")))
+              (indent (progn (looking-at "[ \t]*|") (match-string 0))))
+         (dolist (row table)
+           (let ((previous (buffer-substring (point) (line-end-position)))
+                 (new
+                   (concat indent
+                          (if (eq row 'hline) rule
+                            (let* ((offset (- columns-number (length row)))
+                                   (fields (if (= 0 offset) row
+                                              ;; Add missing fields.
+                                             (append row
+                                                     (make-list offset "")))))
+                              (mapconcat #'identity
+                                         (cl-mapcar #'org-table--align-field
+                                                    fields
+                                                    widths
+                                                    alignments)
+                                         "|")))
+                          "|")))
+             (if (equal new previous)
+                 (forward-line)
+               (insert new "\n")
+               (delete-region (point) (line-beginning-position 2))))))
        (set-marker end nil)
        (when org-table-overlay-coordinates (org-table-overlay-coordinates))
        (setq org-table-may-need-update nil))))))
@@ -4405,7 +4465,7 @@ Optional argument NEW may specify text to replace the 
current field content."
                          ((not new)
                           (concat (org-table--align-field field width align)
                                   "|"))
-                         ((<= (org-string-width new) width)
+                         ((and width (<= (org-string-width new) width))
                           (concat (org-table--align-field new width align)
                                   "|"))
                          (t
@@ -4757,7 +4817,7 @@ This function sets up the following dynamically scoped 
variables:
          (dolist (name (org-split-string (match-string 1) " *| *"))
            (cl-incf c)
            (when (string-match "\\`[a-zA-Z][_a-zA-Z0-9]*\\'" name)
-             (push (cons name (int-to-string c)) org-table-column-names)))))
+             (push (cons name (number-to-string c)) org-table-column-names)))))
       (setq org-table-column-names (nreverse org-table-column-names))
       (setq org-table-column-name-regexp
            (format "\\$\\(%s\\)\\>"
@@ -4816,23 +4876,10 @@ This function sets up the following dynamically scoped 
variables:
       ;; Get the number of columns from the first data line in table.
       (goto-char beg)
       (forward-line (aref org-table-dlines 1))
-      (let* ((fields
-             (org-split-string
-              (buffer-substring (line-beginning-position) (line-end-position))
-              "[ \t]*|[ \t]*"))
-            (nfields (length fields))
-            al al2)
-       (setq org-table-current-ncol nfields)
-       (let ((last-dline
-              (aref org-table-dlines (1- (length org-table-dlines)))))
-         (dotimes (i nfields)
-           (let ((column (1+ i)))
-             (push (list (format "LR%d" column) last-dline column) al)
-             (push (cons (format "LR%d" column) (nth i fields)) al2))))
-       (setq org-table-named-field-locations
-             (append org-table-named-field-locations al))
-       (setq org-table-local-parameters
-             (append org-table-local-parameters al2))))))
+      (setq org-table-current-ncol
+           (length (org-split-string
+                    (buffer-substring (line-beginning-position) 
(line-end-position))
+                    "[ \t]*|[ \t]*"))))))
 
 (defun org-table--force-dataline ()
   "Move point to the closest data line in a table.
@@ -5038,66 +5085,66 @@ When LOCAL is non-nil, show references for the table at 
point."
 (put 'orgtbl-mode :menu-tag "Org Table Mode")
 
 (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu"
-      '("OrgTbl"
-       ["Create or convert" org-table-create-or-convert-from-region
-        :active (not (org-at-table-p)) :keys "C-c |" ]
-       "--"
-       ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
-       ["Next Field" org-cycle :active (org-at-table-p) :keys "TAB"]
-       ["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"]
-       ["Next Row" org-return :active (org-at-table-p) :keys "RET"]
-       "--"
-       ["Blank Field" org-table-blank-field :active (org-at-table-p) :keys 
"C-c SPC"]
-       ["Edit Field" org-table-edit-field :active (org-at-table-p) :keys "C-c 
` "]
-       ["Copy Field from Above"
-        org-table-copy-down :active (org-at-table-p) :keys "S-RET"]
-       "--"
-       ("Column"
-        ["Move Column Left" org-metaleft :active (org-at-table-p) :keys 
"M-<left>"]
-        ["Move Column Right" org-metaright :active (org-at-table-p) :keys 
"M-<right>"]
-        ["Delete Column" org-shiftmetaleft :active (org-at-table-p) :keys 
"M-S-<left>"]
-        ["Insert Column" org-shiftmetaright :active (org-at-table-p) :keys 
"M-S-<right>"])
-       ("Row"
-        ["Move Row Up" org-metaup :active (org-at-table-p) :keys "M-<up>"]
-        ["Move Row Down" org-metadown :active (org-at-table-p) :keys 
"M-<down>"]
-        ["Delete Row" org-shiftmetaup :active (org-at-table-p) :keys 
"M-S-<up>"]
-        ["Insert Row" org-shiftmetadown :active (org-at-table-p) :keys 
"M-S-<down>"]
-        ["Sort lines in region" org-table-sort-lines :active (org-at-table-p) 
:keys "C-c ^"]
-        "--"
-        ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys 
"C-c -"])
-       ("Rectangle"
-        ["Copy Rectangle" org-copy-special :active (org-at-table-p)]
-        ["Cut Rectangle" org-cut-special :active (org-at-table-p)]
-        ["Paste Rectangle" org-paste-special :active (org-at-table-p)]
-        ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p)])
-       "--"
-       ("Radio tables"
-        ["Insert table template" orgtbl-insert-radio-table
-         (cl-assoc-if #'derived-mode-p orgtbl-radio-table-templates)]
-        ["Comment/uncomment table" orgtbl-toggle-comment t])
-       "--"
-       ["Set Column Formula" org-table-eval-formula :active (org-at-table-p) 
:keys "C-c ="]
-       ["Set Field Formula" (org-table-eval-formula '(4)) :active 
(org-at-table-p) :keys "C-u C-c ="]
-       ["Edit Formulas" org-table-edit-formulas :active (org-at-table-p) :keys 
"C-c '"]
-       ["Recalculate line" org-table-recalculate :active (org-at-table-p) 
:keys "C-c *"]
-       ["Recalculate all" (org-table-recalculate '(4)) :active 
(org-at-table-p) :keys "C-u C-c *"]
-       ["Iterate all" (org-table-recalculate '(16)) :active (org-at-table-p) 
:keys "C-u C-u C-c *"]
-       ["Toggle Recalculate Mark" org-table-rotate-recalc-marks :active 
(org-at-table-p) :keys "C-c #"]
-       ["Sum Column/Rectangle" org-table-sum
-        :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
-       ["Which Column?" org-table-current-column :active (org-at-table-p) 
:keys "C-c ?"]
-       ["Debug Formulas"
-        org-table-toggle-formula-debugger :active (org-at-table-p)
-        :keys "C-c {"
-        :style toggle :selected org-table-formula-debug]
-       ["Show Col/Row Numbers"
-        org-table-toggle-coordinate-overlays :active (org-at-table-p)
-        :keys "C-c }"
-        :style toggle :selected org-table-overlay-coordinates]
-       "--"
-       ("Plot"
-        ["Ascii plot" orgtbl-ascii-plot :active (org-at-table-p) :keys "C-c \" 
a"]
-        ["Gnuplot" org-plot/gnuplot :active (org-at-table-p) :keys "C-c \" 
g"])))
+  '("OrgTbl"
+    ["Create or convert" org-table-create-or-convert-from-region
+     :active (not (org-at-table-p)) :keys "C-c |" ]
+    "--"
+    ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
+    ["Next Field" org-cycle :active (org-at-table-p) :keys "TAB"]
+    ["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"]
+    ["Next Row" org-return :active (org-at-table-p) :keys "RET"]
+    "--"
+    ["Blank Field" org-table-blank-field :active (org-at-table-p) :keys "C-c 
SPC"]
+    ["Edit Field" org-table-edit-field :active (org-at-table-p) :keys "C-c ` "]
+    ["Copy Field from Above"
+     org-table-copy-down :active (org-at-table-p) :keys "S-RET"]
+    "--"
+    ("Column"
+     ["Move Column Left" org-metaleft :active (org-at-table-p) :keys 
"M-<left>"]
+     ["Move Column Right" org-metaright :active (org-at-table-p) :keys 
"M-<right>"]
+     ["Delete Column" org-shiftmetaleft :active (org-at-table-p) :keys 
"M-S-<left>"]
+     ["Insert Column" org-shiftmetaright :active (org-at-table-p) :keys 
"M-S-<right>"])
+    ("Row"
+     ["Move Row Up" org-metaup :active (org-at-table-p) :keys "M-<up>"]
+     ["Move Row Down" org-metadown :active (org-at-table-p) :keys "M-<down>"]
+     ["Delete Row" org-shiftmetaup :active (org-at-table-p) :keys "M-S-<up>"]
+     ["Insert Row" org-shiftmetadown :active (org-at-table-p) :keys 
"M-S-<down>"]
+     ["Sort lines in region" org-table-sort-lines :active (org-at-table-p) 
:keys "C-c ^"]
+     "--"
+     ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys 
"C-c -"])
+    ("Rectangle"
+     ["Copy Rectangle" org-copy-special :active (org-at-table-p)]
+     ["Cut Rectangle" org-cut-special :active (org-at-table-p)]
+     ["Paste Rectangle" org-paste-special :active (org-at-table-p)]
+     ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p)])
+    "--"
+    ("Radio tables"
+     ["Insert table template" orgtbl-insert-radio-table
+      (cl-assoc-if #'derived-mode-p orgtbl-radio-table-templates)]
+     ["Comment/uncomment table" orgtbl-toggle-comment t])
+    "--"
+    ["Set Column Formula" org-table-eval-formula :active (org-at-table-p) 
:keys "C-c ="]
+    ["Set Field Formula" (org-table-eval-formula '(4)) :active 
(org-at-table-p) :keys "C-u C-c ="]
+    ["Edit Formulas" org-table-edit-formulas :active (org-at-table-p) :keys 
"C-c '"]
+    ["Recalculate line" org-table-recalculate :active (org-at-table-p) :keys 
"C-c *"]
+    ["Recalculate all" (org-table-recalculate '(4)) :active (org-at-table-p) 
:keys "C-u C-c *"]
+    ["Iterate all" (org-table-recalculate '(16)) :active (org-at-table-p) 
:keys "C-u C-u C-c *"]
+    ["Toggle Recalculate Mark" org-table-rotate-recalc-marks :active 
(org-at-table-p) :keys "C-c #"]
+    ["Sum Column/Rectangle" org-table-sum
+     :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
+    ["Which Column?" org-table-current-column :active (org-at-table-p) :keys 
"C-c ?"]
+    ["Debug Formulas"
+     org-table-toggle-formula-debugger :active (org-at-table-p)
+     :keys "C-c {"
+     :style toggle :selected org-table-formula-debug]
+    ["Show Col/Row Numbers"
+     org-table-toggle-coordinate-overlays :active (org-at-table-p)
+     :keys "C-c }"
+     :style toggle :selected org-table-overlay-coordinates]
+    "--"
+    ("Plot"
+     ["Ascii plot" orgtbl-ascii-plot :active (org-at-table-p) :keys "C-c \" a"]
+     ["Gnuplot" org-plot/gnuplot :active (org-at-table-p) :keys "C-c \" g"])))
 
 ;;;###autoload
 (define-minor-mode orgtbl-mode
@@ -5144,7 +5191,7 @@ command name.  KEYS are keys that should be checked in 
for a command
 to execute outside of tables."
   (eval
    (list 'defun
-        (intern (concat "orgtbl-hijacker-command-" (int-to-string n)))
+        (intern (concat "orgtbl-hijacker-command-" (number-to-string n)))
         '(arg)
         (concat "In tables, run `" (symbol-name fun) "'.\n"
                 "Outside of tables, run the binding of `"
@@ -5398,17 +5445,56 @@ a radio table."
 ;;;###autoload
 (defun org-table-to-lisp (&optional txt)
   "Convert the table at point to a Lisp structure.
+
 The structure will be a list.  Each item is either the symbol `hline'
 for a horizontal separator line, or a list of field values as strings.
 The table is taken from the parameter TXT, or from the buffer at point."
-  (unless (or txt (org-at-table-p)) (user-error "No table at point"))
-  (let ((txt (or txt
-                (buffer-substring-no-properties (org-table-begin)
-                                                (org-table-end)))))
-    (mapcar (lambda (x)
-             (if (string-match org-table-hline-regexp x) 'hline
-               (org-split-string (org-trim x) "\\s-*|\\s-*")))
-           (org-split-string txt "[ \t]*\n[ \t]*"))))
+  (if txt
+      (with-temp-buffer
+        (insert txt)
+        (goto-char (point-min))
+        (org-table-to-lisp))
+    (save-excursion
+      (goto-char (org-table-begin))
+      (let ((table nil))
+        (while (re-search-forward "\\=[ \t]*|" nil t)
+         (let ((row nil))
+           (if (looking-at "-")
+               (push 'hline table)
+             (while (not (progn (skip-chars-forward " \t") (eolp)))
+               (push (buffer-substring
+                      (point)
+                      (progn (re-search-forward "[ \t]*\\(|\\|$\\)")
+                             (match-beginning 0)))
+                     row))
+             (push (nreverse row) table)))
+         (forward-line))
+        (nreverse table)))))
+
+(defun org-table-collapse-header (table &optional separator max-header-lines)
+  "Collapse the lines before 'hline into a single header.
+
+The given TABLE is a list of lists as returned by `org-table-to-lisp'.
+The leading lines before the first `hline' symbol are considered
+forming the table header.  This function collapses all leading header
+lines into a single header line, followed by the `hline' symbol, and
+the rest of the TABLE.  Header cells are glued together with a space,
+or the given SEPARATOR."
+  (while (eq (car table) 'hline) (pop table))
+  (let* ((separator (or separator " "))
+        (max-header-lines (or max-header-lines 4))
+        (trailer table)
+        (header-lines (cl-loop for line in table
+                               until (eq 'hline line)
+                               collect (pop trailer))))
+    (if (and trailer (<= (length header-lines) max-header-lines))
+       (cons (apply #'cl-mapcar
+                    (lambda (&rest x)
+                      (org-trim
+                       (mapconcat #'identity x separator)))
+                    header-lines)
+             trailer)
+      table)))
 
 (defun orgtbl-send-table (&optional maybe)
   "Send a transformed version of table at point to the receiver position.
@@ -5420,9 +5506,7 @@ for this table."
     ;; when non-interactive, we assume align has just happened.
     (when (called-interactively-p 'any) (org-table-align))
     (let ((dests (orgtbl-gather-send-defs))
-         (table (org-table-to-lisp
-                 (buffer-substring-no-properties (org-table-begin)
-                                                 (org-table-end))))
+         (table (org-table-to-lisp))
          (ntbl 0))
       (unless dests
        (if maybe (throw 'exit nil)
@@ -6093,7 +6177,7 @@ which will prompt for the width."
               ((numberp ask) ask)
               (t 12))))
     ;; Skip any hline a the top of table.
-    (while (eq (car table) 'hline) (setq table (cdr table)))
+    (while (eq (car table) 'hline) (pop table))
     ;; Skip table header if any.
     (dolist (x (or (cdr (memq 'hline table)) table))
       (when (consp x)
diff --git a/lisp/org/org-tempo.el b/lisp/org/org-tempo.el
index fe3b5f8..36b8614 100644
--- a/lisp/org/org-tempo.el
+++ b/lisp/org/org-tempo.el
@@ -1,6 +1,6 @@
 ;;; org-tempo.el --- Template expansion for Org structures -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Rasmus Pank Roulund <emacs at pank dot eu>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -122,7 +122,7 @@ Go through `org-structure-template-alist' and
         (special (member name '("src" "export"))))
     (tempo-define-template (format "org-%s" (replace-regexp-in-string " " "-" 
name))
                           `(,(format "#+begin_%s%s" name (if special " " ""))
-                            ,(when special 'p) '> n '> ,(unless special 'p) n
+                            ,(when special 'p) '> n ,(unless special 'p) n
                             ,(format "#+end_%s" (car (split-string name " ")))
                             >)
                           key
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el
index a1eb5e4..b6802fe 100644
--- a/lisp/org/org-timer.el
+++ b/lisp/org/org-timer.el
@@ -1,6 +1,6 @@
 ;;; org-timer.el --- Timer code for Org mode         -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -470,19 +470,18 @@ time is up."
 Try to use an Org header, otherwise use the buffer name."
   (cond
    ((derived-mode-p 'org-agenda-mode)
-    (let* ((marker (or (get-text-property (point) 'org-marker)
-                      (org-agenda-error)))
+    (let* ((marker (or (get-text-property (point) 'org-marker)))
           (hdmarker (or (get-text-property (point) 'org-hd-marker)
                         marker)))
-      (with-current-buffer (marker-buffer marker)
-       (org-with-wide-buffer
-        (goto-char hdmarker)
-        (org-show-entry)
-        (or (ignore-errors (org-get-heading))
-            (buffer-name (buffer-base-buffer)))))))
+      (when (and marker (marker-buffer marker))
+       (with-current-buffer (marker-buffer marker)
+         (org-with-wide-buffer
+          (goto-char hdmarker)
+          (org-show-entry)
+          (or (ignore-errors (org-get-heading))
+              (buffer-name (buffer-base-buffer))))))))
    ((derived-mode-p 'org-mode)
-    (or (ignore-errors (org-get-heading))
-       (buffer-name (buffer-base-buffer))))
+    (ignore-errors (org-get-heading)))
    (t (buffer-name (buffer-base-buffer)))))
 
 (provide 'org-timer)
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el
index 2a78387..25b3354 100644
--- a/lisp/org/org-version.el
+++ b/lisp/org/org-version.el
@@ -5,13 +5,13 @@
 (defun org-release ()
   "The release version of Org.
 Inserted by installing Org mode or when a release is made."
-   (let ((org-release "9.3"))
+   (let ((org-release "9.4.4"))
      org-release))
 ;;;###autoload
 (defun org-git-version ()
   "The Git version of Org mode.
 Inserted by installing Org or when a release is made."
-   (let ((org-git-version "release_9.3"))
+   (let ((org-git-version "release_9.4.4"))
      org-git-version))
 
 (provide 'org-version)
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 5dc9fa9..43aa0a1 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -1,13 +1,15 @@
 ;;; org.el --- Outline-based notes management and organizer -*- 
lexical-binding: t; -*-
 
 ;; Carstens outline-mode for keeping track of everything.
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
+;; Maintainer: Bastien Guerry <bzg@gnu.org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: https://orgmode.org
-;; Version: 9.3
-;;
+
+;; Version: 9.4.4
+
 ;; This file is part of GNU Emacs.
 ;;
 ;; GNU Emacs is free software: you can redistribute it and/or modify
@@ -121,9 +123,12 @@ Stars are put in group 1 and the trimmed body in group 2.")
 (declare-function org-archive-subtree-default "org-archive" ())
 (declare-function org-archive-to-archive-sibling "org-archive" ())
 (declare-function org-attach "org-attach" ())
+(declare-function org-attach-dir "org-attach"
+                 (&optional create-if-not-exists-p no-fs-check))
 (declare-function org-babel-do-in-edit-buffer "ob-core" (&rest body) t)
 (declare-function org-babel-tangle-file "ob-tangle" (file &optional 
target-file lang))
 (declare-function org-beamer-mode "ox-beamer" (&optional prefix) t)
+(declare-function org-clock-auto-clockout "org-clock" ())
 (declare-function org-clock-cancel "org-clock" ())
 (declare-function org-clock-display "org-clock" (&optional arg))
 (declare-function org-clock-get-last-clock-out-time "org-clock" ())
@@ -141,8 +146,10 @@ Stars are put in group 1 and the trimmed body in group 2.")
 (declare-function org-clock-update-time-maybe "org-clock" ())
 (declare-function org-clocking-buffer "org-clock" ())
 (declare-function org-clocktable-shift "org-clock" (dir n))
+(declare-function org-columns-quit "org-colview" ())
 (declare-function org-columns-insert-dblock "org-colview" ())
 (declare-function org-duration-from-minutes "org-duration" (minutes &optional 
fmt canonical))
+(declare-function org-duration-to-minutes "org-duration" (duration &optional 
canonical))
 (declare-function org-element-at-point "org-element" ())
 (declare-function org-element-cache-refresh "org-element" (pos))
 (declare-function org-element-cache-reset "org-element" (&optional all))
@@ -172,6 +179,7 @@ Stars are put in group 1 and the trimmed body in group 2.")
 (declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
 (declare-function org-inlinetask-toggle-visibility "org-inlinetask" ())
 (declare-function org-latex-make-preamble "ox-latex" (info &optional template 
snippet?))
+(declare-function org-num-mode "org-num" (&optional arg))
 (declare-function org-plot/gnuplot "org-plot" (&optional params))
 (declare-function org-tags-view "org-agenda" (&optional todo-only match))
 (declare-function org-timer "org-timer" (&optional restart no-insert))
@@ -189,6 +197,7 @@ Stars are put in group 1 and the trimmed body in group 2.")
 (defvar org-radio-target-regexp)
 (defvar org-target-link-regexp)
 (defvar org-target-regexp)
+(defvar org-id-overriding-file-name)
 
 ;; load languages based on value of `org-babel-load-languages'
 (defvar org-babel-load-languages)
@@ -215,16 +224,17 @@ and then loads the resulting file using `load-file'.  With
 optional prefix argument COMPILE, the tangled Emacs Lisp file is
 byte-compiled before it is loaded."
   (interactive "fFile to load: \nP")
-  (let* ((tangled-file (concat (file-name-sans-extension file) ".el")))
+  (let ((tangled-file (concat (file-name-sans-extension file) ".el")))
     ;; Tangle only if the Org file is newer than the Elisp file.
     (unless (org-file-newer-than-p
             tangled-file
-            (file-attribute-modification-time (file-attributes file)))
-      (org-babel-tangle-file file tangled-file "emacs-lisp"))
+            (file-attribute-modification-time
+             (file-attributes (file-truename file))))
+      (org-babel-tangle-file file tangled-file "emacs-lisp\\|elisp"))
     (if compile
        (progn
-          (byte-compile-file tangled-file)
-          (load tangled-file)
+         (byte-compile-file tangled-file)
+         (load tangled-file)
          (message "Compiled and loaded %s" tangled-file))
       (load-file tangled-file)
       (message "Loaded %s" tangled-file))))
@@ -349,6 +359,14 @@ FULL is given."
 
 
 ;;; Syntax Constants
+;;;; Comments
+(defconst org-comment-regexp
+  (rx (seq bol (zero-or-more (any "\t ")) "#" (or " " eol)))
+  "Regular expression for comment lines.")
+
+;;;; Keyword
+(defconst org-keyword-regexp "^[ \t]*#\\+\\(\\S-+?\\):[ \t]*\\(.*\\)$"
+  "Regular expression for keyword-lines.")
 
 ;;;; Block
 
@@ -363,6 +381,65 @@ FULL is given."
 (defconst org-dblock-end-re "^[ \t]*#\\+\\(?:END\\|end\\)\\([: \t\r\n]\\|$\\)"
   "Matches the end of a dynamic block.")
 
+;;;; Timestamp
+
+(defconst org-ts--internal-regexp
+  (rx (seq
+       (= 4 digit) "-" (= 2 digit) "-" (= 2 digit)
+       (optional " " (*? nonl))))
+  "Regular expression matching the innards of a time stamp.")
+
+(defconst org-ts-regexp (format "<\\(%s\\)>" org-ts--internal-regexp)
+  "Regular expression for fast time stamp matching.")
+
+(defconst org-ts-regexp-inactive
+  (format "\\[\\(%s\\)\\]" org-ts--internal-regexp)
+  "Regular expression for fast inactive time stamp matching.")
+
+(defconst org-ts-regexp-both (format "[[<]\\(%s\\)[]>]" 
org-ts--internal-regexp)
+  "Regular expression for fast time stamp matching.")
+
+(defconst org-ts-regexp0
+  "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)\\( 
+[^]+0-9>\r\n -]+\\)?\\( +\\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
+  "Regular expression matching time strings for analysis.
+This one does not require the space after the date, so it can be used
+on a string that terminates immediately after the date.")
+
+(defconst org-ts-regexp1 
"\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) *\\([^]+0-9>\r\n 
-]*\\)\\( \\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
+  "Regular expression matching time strings for analysis.")
+
+(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,16\\}>")
+  "Regular expression matching time stamps, with groups.")
+
+(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^]>\n]\\{0,16\\}[]>]")
+  "Regular expression matching time stamps (also [..]), with groups.")
+
+(defconst org-tr-regexp (concat org-ts-regexp "--?-?" org-ts-regexp)
+  "Regular expression matching a time stamp range.")
+
+(defconst org-tr-regexp-both
+  (concat org-ts-regexp-both "--?-?" org-ts-regexp-both)
+  "Regular expression matching a time stamp range.")
+
+(defconst org-tsr-regexp (concat org-ts-regexp "\\(--?-?"
+                                org-ts-regexp "\\)?")
+  "Regular expression matching a time stamp or time stamp range.")
+
+(defconst org-tsr-regexp-both
+  (concat org-ts-regexp-both "\\(--?-?"
+         org-ts-regexp-both "\\)?")
+  "Regular expression matching a time stamp or time stamp range.
+The time stamps may be either active or inactive.")
+
+(defconst org-repeat-re
+  "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\
+\\([.+]?\\+[0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)"
+  "Regular expression for specifying repeated events.
+After a match, group 1 contains the repeat expression.")
+
+(defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>")
+  "Formats for `format-time-string' which are used for time stamps.")
+
 ;;;; Clock and Planning
 
 (defconst org-clock-string "CLOCK:"
@@ -414,7 +491,7 @@ Matched keyword is in group 1.")
 
 (defconst org-deadline-time-hour-regexp
   (concat "\\<" org-deadline-string
-         " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9+:hdwmy \t.-]*\\)>")
+         " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9+:hdwmy/ \t.-]*\\)>")
   "Matches the DEADLINE keyword together with a time-and-hour stamp.")
 
 (defconst org-deadline-line-regexp
@@ -430,7 +507,7 @@ Matched keyword is in group 1.")
 
 (defconst org-scheduled-time-hour-regexp
   (concat "\\<" org-scheduled-string
-         " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9+:hdwmy \t.-]*\\)>")
+         " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9+:hdwmy/ \t.-]*\\)>")
   "Matches the SCHEDULED keyword together with a time-and-hour stamp.")
 
 (defconst org-closed-time-regexp
@@ -454,18 +531,6 @@ Matched keyword is in group 1.")
    " *[[<]\\([^]>]+\\)[]>]")
   "Matches any of the 3 keywords, together with the time stamp.")
 
-(defconst org-maybe-keyword-time-regexp
-  (concat "\\(\\<"
-         (regexp-opt
-          (list org-scheduled-string org-deadline-string org-closed-string
-                org-clock-string)
-          t)
-         "\\)?"
-         " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^]\r\n>]*[]>]"
-         "\\|"
-         "<%%([^\r\n>]*>\\)")
-  "Matches a timestamp, possibly preceded by a keyword.")
-
 (defconst org-all-time-keywords
   (mapcar (lambda (w) (substring w 0 -1))
          (list org-scheduled-string org-deadline-string
@@ -490,6 +555,12 @@ Group 1 contains drawer's name or \"END\".")
 (defconst org-clock-drawer-end-re "^[ \t]*:END:[ \t]*$"
   "Regular expression matching the last line of a clock drawer.")
 
+(defconst org-logbook-drawer-re
+  (rx (seq bol (0+ (any "\t ")) ":LOGBOOK:" (0+ (any "\t ")) "\n"
+          (*? (0+ nonl) "\n")
+          (0+ (any "\t ")) ":END:" (0+ (any "\t ")) eol))
+  "Matches an entire LOGBOOK drawer.")
+
 (defconst org-property-drawer-re
   (concat "^[ \t]*:PROPERTIES:[ \t]*\n"
          "\\(?:[ \t]*:\\S-+:\\(?: .*\\)?[ \t]*\n\\)*?"
@@ -561,60 +632,8 @@ An entry can be toggled between COMMENT and normal with
 
 (defconst org-effort-property "Effort"
   "The property that is being used to keep track of effort estimates.
-Effort estimates given in this property need to have the format H:MM.")
-
-;;;; Timestamp
-
-(defconst org-ts-regexp 
"<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^\r\n>]*\\)>"
-  "Regular expression for fast time stamp matching.")
-
-(defconst org-ts-regexp-inactive
-  "\\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^]\r\n>]*\\)\\]"
-  "Regular expression for fast inactive time stamp matching.")
-
-(defconst org-ts-regexp-both 
"[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^]\r\n>]*\\)[]>]"
-  "Regular expression for fast time stamp matching.")
-
-(defconst org-ts-regexp0
-  "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)\\( 
+[^]+0-9>\r\n -]+\\)?\\( +\\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
-  "Regular expression matching time strings for analysis.
-This one does not require the space after the date, so it can be used
-on a string that terminates immediately after the date.")
-
-(defconst org-ts-regexp1 
"\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) *\\([^]+0-9>\r\n 
-]*\\)\\( \\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
-  "Regular expression matching time strings for analysis.")
-
-(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,16\\}>")
-  "Regular expression matching time stamps, with groups.")
-
-(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^]>\n]\\{0,16\\}[]>]")
-  "Regular expression matching time stamps (also [..]), with groups.")
-
-(defconst org-tr-regexp (concat org-ts-regexp "--?-?" org-ts-regexp)
-  "Regular expression matching a time stamp range.")
-
-(defconst org-tr-regexp-both
-  (concat org-ts-regexp-both "--?-?" org-ts-regexp-both)
-  "Regular expression matching a time stamp range.")
-
-(defconst org-tsr-regexp (concat org-ts-regexp "\\(--?-?"
-                                org-ts-regexp "\\)?")
-  "Regular expression matching a time stamp or time stamp range.")
-
-(defconst org-tsr-regexp-both
-  (concat org-ts-regexp-both "\\(--?-?"
-         org-ts-regexp-both "\\)?")
-  "Regular expression matching a time stamp or time stamp range.
-The time stamps may be either active or inactive.")
-
-(defconst org-repeat-re
-  "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\
-\\([.+]?\\+[0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)"
-  "Regular expression for specifying repeated events.
-After a match, group 1 contains the repeat expression.")
-
-(defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>")
-  "Formats for `format-time-string' which are used for time stamps.")
+Effort estimates given in this property need to be in the format
+defined in org-duration.el.")
 
 
 ;;; The custom variables
@@ -645,6 +664,7 @@ After a match, group 1 contains the repeat expression.")
 (defvar org-modules-loaded nil
   "Have the modules been loaded already?")
 
+;;;###autoload
 (defun org-load-modules-maybe (&optional force)
   "Load all extensions listed in `org-modules'."
   (when (or force (not org-modules-loaded))
@@ -853,6 +873,7 @@ cursor keys will then execute Org commands in the following 
contexts:
 - in a plain list item, changing the bullet type
 - in a property definition line, switching between allowed values
 - in the BEGIN line of a clock table (changing the time block).
+- in a table, moving the cell in the specified direction.
 Outside these contexts, the commands will throw an error.
 
 When this variable is t and the cursor is not in a special
@@ -862,9 +883,9 @@ cycling will no longer happen anywhere in an item line, but 
only
 if the cursor is exactly on the bullet.
 
 If you set this variable to the symbol `always', then the keys
-will not be special in headlines, property lines, and item lines,
-to make shift selection work there as well.  If this is what you
-want, you can use the following alternative commands:
+will not be special in headlines, property lines, item lines, and
+table cells, to make shift selection work there as well.  If this is
+what you want, you can use the following alternative commands:
 `\\[org-todo]' and `\\[org-priority]' \
 to change TODO state and priority,
 `\\[universal-argument] \\[universal-argument] \\[org-todo]' \
@@ -880,7 +901,7 @@ will still edit the time stamp - this is just too good to 
give up."
          (const :tag "When outside special context" t)
          (const :tag "Everywhere except timestamps" always)))
 
-(defcustom org-loop-over-headlines-in-active-region nil
+(defcustom org-loop-over-headlines-in-active-region t
   "Shall some commands act upon headlines in the active region?
 
 When set to t, some commands will be performed in all headlines
@@ -898,16 +919,19 @@ The list of commands is: `org-schedule', `org-deadline',
 `org-todo', `org-set-tags-command', `org-archive-subtree',
 `org-archive-set-tag', `org-toggle-archive-tag' and
 `org-archive-to-archive-sibling'.  The archiving commands skip
-already archived entries."
+already archived entries.
+
+See `org-agenda-loop-over-headlines-in-active-region' for the
+equivalent option for agenda views."
   :type '(choice (const :tag "Don't loop" nil)
                 (const :tag "All headlines in active region" t)
                 (const :tag "In active region, headlines at the same level 
than the first one" start-level)
                 (string :tag "Tags/Property/Todo matcher"))
-  :version "24.1"
+  :package-version '(Org . "9.4")
   :group 'org-todo
   :group 'org-archive)
 
-(defcustom org-startup-folded t
+(defcustom org-startup-folded 'showeverything
   "Non-nil means entering Org mode will switch to OVERVIEW.
 
 This can also be configured on a per-file basis by adding one of
@@ -922,6 +946,7 @@ Set `org-agenda-inhibit-startup' to a non-nil value if you 
want
 to ignore this option when Org opens agenda files for the first
 time."
   :group 'org-startup
+  :package-version '(Org . "9.4")
   :type '(choice
          (const :tag "nofold: show all" nil)
          (const :tag "fold: overview" t)
@@ -938,7 +963,7 @@ truncation for Org mode different to the other modes that 
use the
 variable `truncate-lines' and as a shortcut instead of putting
 the variable `truncate-lines' into the `org-mode-hook'.  If one
 wants to configure truncation for Org mode not statically but
-dynamically e. g. in a hook like `ediff-prepare-buffer-hook' then
+dynamically e.g. in a hook like `ediff-prepare-buffer-hook' then
 the variable `truncate-lines' has to be used because in such a
 case it is too late to set the variable `org-startup-truncated'."
   :group 'org-startup
@@ -956,13 +981,24 @@ the following lines anywhere in the buffer:
          (const :tag "Not" nil)
          (const :tag "Globally (slow on startup in large files)" t)))
 
+(defcustom org-startup-numerated nil
+  "Non-nil means turn on `org-num-mode' on startup.
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+
+   #+STARTUP: num
+   #+STARTUP: nonum"
+  :group 'org-structure
+  :package-version '(Org . "9.4")
+  :type '(choice
+         (const :tag "Not" nil)
+         (const :tag "Globally" t)))
+
 (defcustom org-use-sub-superscripts t
   "Non-nil means interpret \"_\" and \"^\" for display.
 
 If you want to control how Org exports those characters, see
-`org-export-with-sub-superscripts'.  `org-use-sub-superscripts'
-used to be an alias for `org-export-with-sub-superscripts' in
-Org <8.0, it is not anymore.
+`org-export-with-sub-superscripts'.
 
 When this option is turned on, you can use TeX-like syntax for
 sub- and superscripts within the buffer.  Several characters after
@@ -1059,15 +1095,51 @@ use that string instead.
 
 The change affects only Org mode (which will then use its own display table).
 Changing this requires executing `\\[org-mode]' in a buffer to become
-effective."
+effective.  It cannot be set as a local variable."
   :group 'org-startup
   :type '(choice (const :tag "Default" nil)
-                (string :tag "String" :value "...#"))
-  :safe (lambda (v) (and (string-or-null-p v) (not (equal "" v)))))
+                (string :tag "String" :value "...#")))
 
 (defvar org-display-table nil
   "The display table for Org mode, in case `org-ellipsis' is non-nil.")
 
+(defcustom org-directory "~/org"
+  "Directory with Org files.
+This is just a default location to look for Org files.  There is no need
+at all to put your files into this directory.  It is used in the
+following situations:
+
+1. When a capture template specifies a target file that is not an
+   absolute path.  The path will then be interpreted relative to
+   `org-directory'
+2. When the value of variable `org-agenda-files' is a single file, any
+   relative paths in this file will be taken as relative to
+   `org-directory'."
+  :group 'org-refile
+  :group 'org-capture
+  :type 'directory)
+
+(defcustom org-default-notes-file (convert-standard-filename "~/.notes")
+  "Default target for storing notes.
+Used as a fall back file for org-capture.el, for templates that
+do not specify a target file."
+  :group 'org-refile
+  :group 'org-capture
+  :type 'file)
+
+(defcustom org-reverse-note-order nil
+  "Non-nil means store new notes at the beginning of a file or entry.
+When nil, new notes will be filed to the end of a file or entry.
+This can also be a list with cons cells of regular expressions that
+are matched against file names, and values."
+  :group 'org-capture
+  :group 'org-refile
+  :type '(choice
+         (const :tag "Reverse always" t)
+         (const :tag "Reverse never" nil)
+         (repeat :tag "By file name regexp"
+                 (cons regexp boolean))))
+
 (defgroup org-keywords nil
   "Keywords in Org mode."
   :tag "Org Keywords"
@@ -1098,7 +1170,7 @@ effective."
   "Alist between context and visibility span when revealing a location.
 
 \\<org-mode-map>Some actions may move point into invisible
-locations.  As a consequence, Org always expose a neighborhood
+locations.  As a consequence, Org always exposes a neighborhood
 around point.  How much is shown depends on the initial action,
 or context.  Valid contexts are
 
@@ -1220,16 +1292,17 @@ See `org-file-apps'.")
 
 (defcustom org-file-apps
   '((auto-mode . emacs)
+    (directory . emacs)
     ("\\.mm\\'" . default)
     ("\\.x?html?\\'" . default)
     ("\\.pdf\\'" . default))
-  "External applications for opening `file:path' items in a document.
+  "Applications for opening `file:path' items in a document.
 
 \\<org-mode-map>
-Org mode uses system defaults for different file types, but
-you can use this variable to set the application for a given file
-extension.  The entries in this list are cons cells where the car identifies
-files and the cdr the corresponding command.
+Org mode uses system defaults for different file types, but you
+can use this variable to set the application for a given file
+extension.  The entries in this list are cons cells where the car
+identifies files and the cdr the corresponding command.
 
 Possible values for the file identifier are:
 
@@ -1305,6 +1378,7 @@ For more examples, see the system specific constants
 `org-file-apps-windowsnt'
 `org-file-apps-gnu'."
   :group 'org
+  :package-version '(Org . "9.4")
   :type '(repeat
          (cons (choice :value ""
                        (string :tag "Extension")
@@ -1467,6 +1541,7 @@ the values `folded', `children', or `subtree'."
   :type 'hook)
 
 (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees
+                           org-cycle-hide-drawers
                            org-cycle-show-empty-lines
                            org-optimize-window-after-visibility-change)
   "Hook that is run after `org-cycle' has changed the buffer visibility.
@@ -1476,9 +1551,8 @@ argument is a symbol.  After a global state change, it 
can have the values
 `overview', `contents', or `all'.  After a local state change, it can have
 the values `folded', `children', or `subtree'."
   :group 'org-cycle
-  :type 'hook
-  :version "26.1"
-  :package-version '(Org . "8.3"))
+  :package-version '(Org . "9.4")
+  :type 'hook)
 
 (defgroup org-edit-structure nil
   "Options concerning structure editing in Org mode."
@@ -1504,9 +1578,15 @@ lines to the buffer:
 (defcustom org-adapt-indentation t
   "Non-nil means adapt indentation to outline node level.
 
-When this variable is set, Org assumes that you write outlines by
-indenting text in each node to align with the headline (after the
-stars).  The following issues are influenced by this variable:
+When this variable is set to t, Org assumes that you write
+outlines by indenting text in each node to align with the
+headline (after the stars).
+
+When this variable is set to 'headline-data, only adapt the
+indentation of the data lines right below the headline, such as
+planning/clock lines and property/logbook drawers.
+
+The following issues are influenced by this variable:
 
 - The indentation is increased by one space in a demotion
   command, and decreased by one in a promotion command.  However,
@@ -1518,14 +1598,18 @@ stars).  The following issues are influenced by this 
variable:
   when this variable is set.  When nil, they will not be indented.
 
 - TAB indents a line relative to current level.  The lines below
-  a headline will be indented when this variable is set.
+  a headline will be indented when this variable is set to t.
 
 Note that this is all about true indentation, by adding and
 removing space characters.  See also \"org-indent.el\" which does
 level-dependent indentation in a virtual way, i.e. at display
 time in Emacs."
   :group 'org-edit-structure
-  :type 'boolean
+  :type '(choice
+         (const :tag "Adapt indentation for all lines" t)
+         (const :tag "Adapt indentation for headline data lines"
+                'headline-data)
+         (const :tag "Do not adapt indentation at all" nil))
   :safe #'booleanp)
 
 (defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e)
@@ -1573,16 +1657,15 @@ This may also be a cons cell where the behavior for 
`C-a' and
 When nil, `C-k' will call the default `kill-line' command.
 When t, the following will happen while the cursor is in the headline:
 
-- When the cursor is at the beginning of a headline, kill the entire
-  line and possible the folded subtree below the line.
-- When in the middle of the headline text, kill the headline up to the tags.
-- When after the headline text, kill the tags."
+- When at the beginning of a headline, kill the entire subtree.
+- When in the middle of the headline text, kill the text up to the tags.
+- When after the headline text and before the tags, kill all the tags."
   :group 'org-edit-structure
   :type 'boolean)
 
 (defcustom org-ctrl-k-protect-subtree nil
-  "Non-nil means, do not delete a hidden subtree with C-k.
-When set to the symbol `error', simply throw an error when C-k is
+  "Non-nil means, do not delete a hidden subtree with `C-k'.
+When set to the symbol `error', simply throw an error when `C-k' is
 used to kill (part-of) a headline that has hidden text behind it.
 Any other non-nil value will result in a query to the user, if it is
 OK to kill that hidden subtree.  When nil, kill without remorse."
@@ -1787,213 +1870,6 @@ Changing this requires a restart of Emacs to work 
correctly."
   :group 'org-link-follow
   :type 'integer)
 
-(defgroup org-refile nil
-  "Options concerning refiling entries in Org mode."
-  :tag "Org Refile"
-  :group 'org)
-
-(defcustom org-directory "~/org"
-  "Directory with Org files.
-This is just a default location to look for Org files.  There is no need
-at all to put your files into this directory.  It is used in the
-following situations:
-
-1. When a capture template specifies a target file that is not an
-   absolute path.  The path will then be interpreted relative to
-   `org-directory'
-2. When the value of variable `org-agenda-files' is a single file, any
-   relative paths in this file will be taken as relative to
-   `org-directory'."
-  :group 'org-refile
-  :group 'org-capture
-  :type 'directory)
-
-(defcustom org-default-notes-file (convert-standard-filename "~/.notes")
-  "Default target for storing notes.
-Used as a fall back file for org-capture.el, for templates that
-do not specify a target file."
-  :group 'org-refile
-  :group 'org-capture
-  :type 'file)
-
-(defcustom org-reverse-note-order nil
-  "Non-nil means store new notes at the beginning of a file or entry.
-When nil, new notes will be filed to the end of a file or entry.
-This can also be a list with cons cells of regular expressions that
-are matched against file names, and values."
-  :group 'org-capture
-  :group 'org-refile
-  :type '(choice
-         (const :tag "Reverse always" t)
-         (const :tag "Reverse never" nil)
-         (repeat :tag "By file name regexp"
-                 (cons regexp boolean))))
-
-(defcustom org-log-refile nil
-  "Information to record when a task is refiled.
-
-Possible values are:
-
-nil     Don't add anything
-time    Add a time stamp to the task
-note    Prompt for a note and add it with template `org-log-note-headings'
-
-This option can also be set with on a per-file-basis with
-
-   #+STARTUP: nologrefile
-   #+STARTUP: logrefile
-   #+STARTUP: lognoterefile
-
-You can have local logging settings for a subtree by setting the LOGGING
-property to one or more of these keywords.
-
-When bulk-refiling, e.g., from the agenda, the value `note' is
-forbidden and will temporarily be changed to `time'."
-  :group 'org-refile
-  :group 'org-progress
-  :version "24.1"
-  :type '(choice
-         (const :tag "No logging" nil)
-         (const :tag "Record timestamp" time)
-         (const :tag "Record timestamp with note." note)))
-
-(defcustom org-refile-targets nil
-  "Targets for refiling entries with `\\[org-refile]'.
-This is a list of cons cells.  Each cell contains:
-- a specification of the files to be considered, either a list of files,
-  or a symbol whose function or variable value will be used to retrieve
-  a file name or a list of file names.  If you use `org-agenda-files' for
-  that, all agenda files will be scanned for targets.  Nil means consider
-  headings in the current buffer.
-- A specification of how to find candidate refile targets.  This may be
-  any of:
-  - a cons cell (:tag . \"TAG\") to identify refile targets by a tag.
-    This tag has to be present in all target headlines, inheritance will
-    not be considered.
-  - a cons cell (:todo . \"KEYWORD\") to identify refile targets by
-    todo keyword.
-  - a cons cell (:regexp . \"REGEXP\") with a regular expression matching
-    headlines that are refiling targets.
-  - a cons cell (:level . N).  Any headline of level N is considered a target.
-    Note that, when `org-odd-levels-only' is set, level corresponds to
-    order in hierarchy, not to the number of stars.
-  - a cons cell (:maxlevel . N).  Any headline with level <= N is a target.
-    Note that, when `org-odd-levels-only' is set, level corresponds to
-    order in hierarchy, not to the number of stars.
-
-Each element of this list generates a set of possible targets.
-The union of these sets is presented (with completion) to
-the user by `org-refile'.
-
-You can set the variable `org-refile-target-verify-function' to a function
-to verify each headline found by the simple criteria above.
-
-When this variable is nil, all top-level headlines in the current buffer
-are used, equivalent to the value `((nil . (:level . 1))'."
-  :group 'org-refile
-  :type '(repeat
-         (cons
-          (choice :value org-agenda-files
-                  (const :tag "All agenda files" org-agenda-files)
-                  (const :tag "Current buffer" nil)
-                  (function) (variable) (file))
-          (choice :tag "Identify target headline by"
-                  (cons :tag "Specific tag" (const :value :tag) (string))
-                  (cons :tag "TODO keyword" (const :value :todo) (string))
-                  (cons :tag "Regular expression" (const :value :regexp) 
(regexp))
-                  (cons :tag "Level number" (const :value :level) (integer))
-                  (cons :tag "Max Level number" (const :value :maxlevel) 
(integer))))))
-
-(defcustom org-refile-target-verify-function nil
-  "Function to verify if the headline at point should be a refile target.
-The function will be called without arguments, with point at the
-beginning of the headline.  It should return t and leave point
-where it is if the headline is a valid target for refiling.
-
-If the target should not be selected, the function must return nil.
-In addition to this, it may move point to a place from where the search
-should be continued.  For example, the function may decide that the entire
-subtree of the current entry should be excluded and move point to the end
-of the subtree."
-  :group 'org-refile
-  :type '(choice
-         (const nil)
-         (function)))
-
-(defcustom org-refile-use-cache nil
-  "Non-nil means cache refile targets to speed up the process.
-\\<org-mode-map>\
-The cache for a particular file will be updated automatically when
-the buffer has been killed, or when any of the marker used for flagging
-refile targets no longer points at a live buffer.
-If you have added new entries to a buffer that might themselves be targets,
-you need to clear the cache manually by pressing `C-0 \\[org-refile]' or,
-if you find that easier, \
-`\\[universal-argument] \\[universal-argument] \\[universal-argument] \
-\\[org-refile]'."
-  :group 'org-refile
-  :version "24.1"
-  :type 'boolean)
-
-(defcustom org-refile-use-outline-path nil
-  "Non-nil means provide refile targets as paths.
-So a level 3 headline will be available as level1/level2/level3.
-
-When the value is `file', also include the file name (without directory)
-into the path.  In this case, you can also stop the completion after
-the file name, to get entries inserted as top level in the file.
-
-When `full-file-path', include the full file path.
-
-When `buffer-name', use the buffer name."
-  :group 'org-refile
-  :type '(choice
-         (const :tag "Not" nil)
-         (const :tag "Yes" t)
-         (const :tag "Start with file name" file)
-         (const :tag "Start with full file path" full-file-path)
-         (const :tag "Start with buffer name" buffer-name)))
-
-(defcustom org-outline-path-complete-in-steps t
-  "Non-nil means complete the outline path in hierarchical steps.
-When Org uses the refile interface to select an outline path (see
-`org-refile-use-outline-path'), the completion of the path can be
-done in a single go, or it can be done in steps down the headline
-hierarchy.  Going in steps is probably the best if you do not use
-a special completion package like `ido' or `icicles'.  However,
-when using these packages, going in one step can be very fast,
-while still showing the whole path to the entry."
-  :group 'org-refile
-  :type 'boolean)
-
-(defcustom org-refile-allow-creating-parent-nodes nil
-  "Non-nil means allow the creation of new nodes as refile targets.
-New nodes are then created by adding \"/new node name\" to the completion
-of an existing node.  When the value of this variable is `confirm',
-new node creation must be confirmed by the user (recommended).
-When nil, the completion must match an existing entry.
-
-Note that, if the new heading is not seen by the criteria
-listed in `org-refile-targets', multiple instances of the same
-heading would be created by trying again to file under the new
-heading."
-  :group 'org-refile
-  :type '(choice
-         (const :tag "Never" nil)
-         (const :tag "Always" t)
-         (const :tag "Prompt for confirmation" confirm)))
-
-(defcustom org-refile-active-region-within-subtree nil
-  "Non-nil means also refile active region within a subtree.
-
-By default `org-refile' doesn't allow refiling regions if they
-don't contain a set of subtrees, but it might be convenient to
-do so sometimes: in that case, the first line of the region is
-converted to a headline before refiling."
-  :group 'org-refile
-  :version "24.1"
-  :type 'boolean)
-
 (defgroup org-todo nil
   "Options concerning TODO items in Org mode."
   :tag "Org TODO"
@@ -2549,53 +2425,69 @@ property to one or more of these keywords."
   :tag "Org Priorities"
   :group 'org-todo)
 
-(defcustom org-enable-priority-commands t
+(defvaralias 'org-enable-priority-commands 'org-priority-enable-commands)
+(defcustom org-priority-enable-commands t
   "Non-nil means priority commands are active.
 When nil, these commands will be disabled, so that you never accidentally
 set a priority."
   :group 'org-priorities
   :type 'boolean)
 
-(defcustom org-highest-priority ?A
-  "The highest priority of TODO items.  A character like ?A, ?B etc.
-Must have a smaller ASCII number than `org-lowest-priority'."
-  :group 'org-priorities
-  :type 'character)
+(defvaralias 'org-highest-priority 'org-priority-highest)
 
-(defcustom org-lowest-priority ?C
-  "The lowest priority of TODO items.  A character like ?A, ?B etc.
-Must have a larger ASCII number than `org-highest-priority'."
+(defcustom org-priority-highest ?A
+  "The highest priority of TODO items.
+A character like ?A, ?B, etc., or a numeric value like 1, 2, etc.
+Must be smaller than `org-priority-lowest'."
+  :group 'org-priorities
+  :type '(choice
+         (character :tag "Character")
+         (integer :tag "Integer (< 65)")))
+
+(defvaralias 'org-lowest-priority 'org-priority-lowest)
+(defcustom org-priority-lowest ?C
+  "The lowest priority of TODO items.
+A character like ?A, ?B, etc., or a numeric value like 1, 2, etc.
+Must be higher than `org-priority-highest'."
   :group 'org-priorities
-  :type 'character)
+  :type '(choice
+         (character :tag "Character")
+         (integer :tag "Integer (< 65)")))
 
-(defcustom org-default-priority ?B
+(defvaralias 'org-default-priority 'org-priority-default)
+(defcustom org-priority-default ?B
   "The default priority of TODO items.
 This is the priority an item gets if no explicit priority is given.
 When starting to cycle on an empty priority the first step in the cycle
 depends on `org-priority-start-cycle-with-default'.  The resulting first
-step priority must not exceed the range from `org-highest-priority' to
-`org-lowest-priority' which means that `org-default-priority' has to be
-in this range exclusive or inclusive the range boundaries.  Else the
-first step refuses to set the default and the second will fall back
-to (depending on the command used) the highest or lowest priority."
+step priority must not exceed the range from `org-priority-highest' to
+`org-priority-lowest' which means that `org-priority-default' has to be
+in this range exclusive or inclusive to the range boundaries.  Else the
+first step refuses to set the default and the second will fall back on
+\(depending on the command used) the highest or lowest priority."
   :group 'org-priorities
-  :type 'character)
+  :type '(choice
+         (character :tag "Character")
+         (integer :tag "Integer (< 65)")))
 
 (defcustom org-priority-start-cycle-with-default t
   "Non-nil means start with default priority when starting to cycle.
 When this is nil, the first step in the cycle will be (depending on the
 command used) one higher or lower than the default priority.
-See also `org-default-priority'."
+See also `org-priority-default'."
   :group 'org-priorities
   :type 'boolean)
 
-(defcustom org-get-priority-function nil
+(defvaralias 'org-get-priority-function 'org-priority-get-priority-function)
+(defcustom org-priority-get-priority-function nil
   "Function to extract the priority from a string.
-The string is normally the headline.  If this is nil Org computes the
-priority from the priority cookie like [#A] in the headline.  It returns
-an integer, increasing by 1000 for each priority level.
-The user can set a different function here, which should take a string
-as an argument and return the numeric priority."
+The string is normally the headline.  If this is nil, Org
+computes the priority from the priority cookie like [#A] in the
+headline.  It returns an integer, increasing by 1000 for each
+priority level.
+
+The user can set a different function here, which should take a
+string as an argument and return the numeric priority."
   :group 'org-priorities
   :version "24.1"
   :type '(choice
@@ -2768,7 +2660,9 @@ stamps outside of this range."
 
 (defcustom org-read-date-display-live t
   "Non-nil means display current interpretation of date prompt live.
-This display will be in an overlay, in the minibuffer."
+This display will be in an overlay, in the minibuffer.  Note that
+live display is only active when `org-read-date-popup-calendar'
+is non-nil."
   :group 'org-time
   :type 'boolean)
 
@@ -2945,7 +2839,7 @@ automatically if necessary."
 When nil, you have to press RET to exit it.
 During fast tag selection, you can toggle this flag with `C-c'.
 This variable can also have the value `expert'.  In this case, the window
-displaying the tags menu is not even shown, until you press C-c again."
+displaying the tags menu is not even shown, until you press `C-c' again."
   :group 'org-tags
   :type '(choice
          (const :tag "No" nil)
@@ -3181,8 +3075,13 @@ This list will be combined with the constant 
`org-global-properties-fixed'.
 The entries in this list are cons cells where the car is a property
 name and cdr is a string with the value.
 
-You can set buffer-local values for the same purpose in the variable
-`org-file-properties' this by adding lines like
+Buffer local properties are added either by a document property drawer
+
+:PROPERTIES:
+:NAME: VALUE
+:END:
+
+or by adding lines like
 
 #+PROPERTY: NAME VALUE"
   :group 'org-properties
@@ -3190,10 +3089,15 @@ You can set buffer-local values for the same purpose in 
the variable
          (cons (string :tag "Property")
                (string :tag "Value"))))
 
-(defvar-local org-file-properties nil
-  "List of property/value pairs that can be inherited by any entry.
-Valid for the current buffer.
-This variable is populated from #+PROPERTY lines.")
+(defvar-local org-keyword-properties nil
+  "List of property/value pairs inherited by any entry.
+
+Valid for the current buffer.  This variable is populated from
+PROPERTY keywords.
+
+Note that properties are defined also in property drawers.
+Properties defined there take precedence over properties defined
+as keywords.")
 
 (defgroup org-agenda nil
   "Options concerning agenda views in Org mode."
@@ -3202,11 +3106,18 @@ This variable is populated from #+PROPERTY lines.")
 
 (defvar-local org-category nil
   "Variable used by Org files to set a category for agenda display.
-Such files should use a file variable to set it, for example
+There are multiple ways to set the category.  One way is to set
+it in the document property drawer.  For example:
+
+:PROPERTIES:
+:CATEGORY: ELisp
+:END:
+
+Other ways to define it is as an emacs file variable, for example
 
 #   -*- mode: org; org-category: \"ELisp\"
 
-or contain a special line
+or for the file to contain a special line:
 
 #+CATEGORY: ELisp
 
@@ -3267,16 +3178,6 @@ A nil value means to remove them, after a query, from 
the list."
   :group 'org-agenda
   :type 'boolean)
 
-(defcustom org-agenda-diary-file 'diary-file
-  "File to which to add new entries with the `i' key in agenda and calendar.
-When this is the symbol `diary-file', the functionality in the Emacs
-calendar will be used to add entries to the `diary-file'.  But when this
-points to a file, `org-agenda-diary-entry' will be used instead."
-  :group 'org-agenda
-  :type '(choice
-         (const :tag "The standard Emacs diary file" diary-file)
-         (file :tag "Special Org file diary entries")))
-
 (defgroup org-latex nil
   "Options for embedding LaTeX code into Org mode."
   :tag "Org LaTeX"
@@ -3350,6 +3251,22 @@ When using LaTeXML set this option to
          (const :tag "None" nil)
          (string :tag "\nShell command")))
 
+(defcustom org-latex-to-html-convert-command nil
+  "Command to convert LaTeX fragments to HTML.
+This command is very open-ended: the output of the command will
+directly replace the LaTeX fragment in the resulting HTML.
+Replace format-specifiers in the command as noted below and use
+`shell-command' to convert LaTeX to HTML.
+%i:     The LaTeX fragment to be converted.
+
+For example, this could be used with LaTeXML as
+\"latexmlc 'literal:%i' --profile=math --preload=siunitx.sty 2>/dev/null\"."
+  :group 'org-latex
+  :package-version '(Org . "9.4")
+  :type '(choice
+         (const :tag "None" nil)
+         (string :tag "Shell command")))
+
 (defcustom org-preview-latex-default-process 'dvipng
   "The default process to convert LaTeX fragments to image files.
 All available processes and theirs documents can be found in
@@ -3668,12 +3585,23 @@ hide them with 
`org-toggle-custom-properties-visibility'."
   :version "24.3"
   :type '(repeat (string :tag "Property Name")))
 
-(defcustom org-fontify-done-headline nil
+(defcustom org-fontify-todo-headline nil
+  "Non-nil means change the face of a headline if it is marked as TODO.
+Normally, only the TODO/DONE keyword indicates the state of a headline.
+When this is non-nil, the headline after the keyword is set to the
+`org-headline-todo' as an additional indication."
+  :group 'org-appearance
+  :package-version '(Org . "9.4")
+  :type 'boolean
+  :safe t)
+
+(defcustom org-fontify-done-headline t
   "Non-nil means change the face of a headline if it is marked DONE.
 Normally, only the TODO/DONE keyword indicates the state of a headline.
 When this is non-nil, the headline after the keyword is set to the
 `org-headline-done' as an additional indication."
   :group 'org-appearance
+  :package-version '(Org . "9.4")
   :type 'boolean)
 
 (defcustom org-fontify-emphasized-text t
@@ -3775,7 +3703,7 @@ After a match, the match groups contain these elements:
 
 ;; This used to be a defcustom (Org <8.0) but allowing the users to
 ;; set this option proved cumbersome.  See this message/thread:
-;; http://article.gmane.org/gmane.emacs.orgmode/68681
+;; https://orgmode.org/list/B72CDC2B-72F6-43A8-AC70-E6E6295766EC@gmail.com
 (defvar org-emphasis-regexp-components
   '("-[:space:]('\"{" "-[:space:].,:!?;'\")}\\[" "[:space:]" "." 1)
   "Components used to build the regular expression for emphasis.
@@ -3921,6 +3849,14 @@ If yes, offer to stop it and to save the buffer with the 
changes."
   (add-hook 'org-mode-hook 'org-clock-load)
   (add-hook 'kill-emacs-hook 'org-clock-save))
 
+(defun org-clock-auto-clockout-insinuate ()
+  "Set up hook for auto clocking out when Emacs is idle.
+See `org-clock-auto-clockout-timer'.
+
+This function is meant to be added to the user configuration."
+  (require 'org-clock)
+  (add-hook 'org-clock-in-hook #'org-clock-auto-clockout t))
+
 (defgroup org-archive nil
   "Options concerning archiving in Org mode."
   :tag "Org Archive"
@@ -3974,14 +3910,13 @@ Here are a few examples:
        Archive in file ./basement (relative path), as level 3 trees
        below the level 2 heading \"** Finished Tasks\".
 
-You may set this option on a per-file basis by adding to the buffer a
-line like
+You may define it locally by setting an ARCHIVE property.  If
+such a property is found in the file or in an entry, and anywhere
+up the hierarchy, it will be used.
 
-#+ARCHIVE: basement::** Finished Tasks
+You can also set it for the whole file using the keyword-syntax:
 
-You may also define it locally for a subtree by setting an ARCHIVE property
-in the entry.  If such a property is found in an entry, or anywhere up
-the hierarchy, it will be used."
+#+ARCHIVE: basement::** Finished Tasks"
   :group 'org-archive
   :type 'string)
 
@@ -4177,7 +4112,8 @@ groups carry important information:
   "Regular expression to match a timestamp time or time range.
 After a match, the following groups carry important information:
 0  the full match
-1  date plus weekday, for back referencing to make sure both times are on the 
same day
+1  date plus weekday, for back referencing to make sure
+     both times are on the same day
 2  the first time, range or not
 4  the second time, if it is a range.")
 
@@ -4190,6 +4126,8 @@ After a match, the following groups carry important 
information:
     ("content" org-startup-folded content)
     ("indent" org-startup-indented t)
     ("noindent" org-startup-indented nil)
+    ("num" org-startup-numerated t)
+    ("nonum" org-startup-numerated nil)
     ("hidestars" org-hide-leading-stars t)
     ("showstars" org-hide-leading-stars nil)
     ("odd" org-odd-levels-only t)
@@ -4243,7 +4181,7 @@ After a match, the following groups carry important 
information:
   "Variable associated with STARTUP options for Org.
 Each element is a list of three items: the startup options (as written
 in the #+STARTUP line), the corresponding variable, and the value to set
-this variable to if the option is found.  An optional forth element PUSH
+this variable to if the option is found.  An optional fourth element PUSH
 means to push this value onto the list in the variable.")
 
 (defcustom org-group-tags t
@@ -4303,72 +4241,112 @@ See `org-tag-alist' for their structure."
       ;; Preserve order of ALIST1.
       (append (nreverse to-add) alist2)))))
 
+(defun org-priority-to-value (s)
+  "Convert priority string S to its numeric value."
+  (or (save-match-data
+       (and (string-match "\\([0-9]+\\)" s)
+            (string-to-number (match-string 1 s))))
+      (string-to-char s)))
+
 (defun org-set-regexps-and-options (&optional tags-only)
   "Precompute regular expressions used in the current buffer.
 When optional argument TAGS-ONLY is non-nil, only compute tags
 related expressions."
   (when (derived-mode-p 'org-mode)
-    (let ((alist (org--setup-collect-keywords
-                 (org-make-options-regexp
-                  (append '("FILETAGS" "TAGS" "SETUPFILE")
-                          (and (not tags-only)
-                               '("ARCHIVE" "CATEGORY" "COLUMNS" "CONSTANTS"
-                                 "LINK" "OPTIONS" "PRIORITIES" "PROPERTY"
-                                 "SEQ_TODO" "STARTUP" "TODO" "TYP_TODO")))))))
+    (let ((alist (org-collect-keywords
+                 (append '("FILETAGS" "TAGS")
+                         (and (not tags-only)
+                              '("ARCHIVE" "CATEGORY" "COLUMNS" "CONSTANTS"
+                                "LINK" "OPTIONS" "PRIORITIES" "PROPERTY"
+                                "SEQ_TODO" "STARTUP" "TODO" "TYP_TODO")))
+                 '("ARCHIVE" "CATEGORY" "COLUMNS" "PRIORITIES"))))
       ;; Startup options.  Get this early since it does change
       ;; behavior for other options (e.g., tags).
-      (let ((startup (cdr (assq 'startup alist))))
+      (let ((startup (cl-mapcan (lambda (value) (split-string value))
+                               (cdr (assoc "STARTUP" alist)))))
        (dolist (option startup)
-         (let ((entry (assoc-string option org-startup-options t)))
-           (when entry
-             (let ((var (nth 1 entry))
-                   (val (nth 2 entry)))
-               (if (not (nth 3 entry)) (set (make-local-variable var) val)
-                 (unless (listp (symbol-value var))
-                   (set (make-local-variable var) nil))
-                 (add-to-list var val)))))))
+         (pcase (assoc-string option org-startup-options t)
+           (`(,_ ,variable ,value t)
+            (unless (listp (symbol-value variable))
+              (set (make-local-variable variable) nil))
+            (add-to-list variable value))
+           (`(,_ ,variable ,value . ,_)
+            (set (make-local-variable variable) value))
+           (_ nil))))
       (setq-local org-file-tags
                  (mapcar #'org-add-prop-inherited
-                         (cdr (assq 'filetags alist))))
+                         (cl-mapcan (lambda (value)
+                                      (cl-mapcan
+                                       (lambda (k) (org-split-string k ":"))
+                                       (split-string value)))
+                                    (cdr (assoc "FILETAGS" alist)))))
       (setq org-current-tag-alist
            (org--tag-add-to-alist
             org-tag-persistent-alist
-            (let ((tags (cdr (assq 'tags alist))))
-              (if tags (org-tag-string-to-alist tags)
+            (let ((tags (cdr (assoc "TAGS" alist))))
+              (if tags
+                  (org-tag-string-to-alist
+                   (mapconcat #'identity tags "\n"))
                 org-tag-alist))))
       (setq org-tag-groups-alist
            (org-tag-alist-to-groups org-current-tag-alist))
       (unless tags-only
-       ;; File properties.
-       (setq-local org-file-properties (cdr (assq 'property alist)))
+       ;; Properties.
+       (let ((properties nil))
+         (dolist (value (cdr (assoc "PROPERTY" alist)))
+           (when (string-match "\\(\\S-+\\)[ \t]+\\(.*\\)" value)
+             (setq properties (org--update-property-plist
+                               (match-string-no-properties 1 value)
+                               (match-string-no-properties 2 value)
+                               properties))))
+         (setq-local org-keyword-properties properties))
        ;; Archive location.
-       (let ((archive (cdr (assq 'archive alist))))
+       (let ((archive (cdr (assoc "ARCHIVE" alist))))
          (when archive (setq-local org-archive-location archive)))
        ;; Category.
-       (let ((cat (org-string-nw-p (cdr (assq 'category alist)))))
-         (when cat
-           (setq-local org-category (intern cat))
-           (setq-local org-file-properties
+       (let ((category (cdr (assoc "CATEGORY" alist))))
+         (when category
+           (setq-local org-category (intern category))
+           (setq-local org-keyword-properties
                        (org--update-property-plist
-                        "CATEGORY" cat org-file-properties))))
+                        "CATEGORY" category org-keyword-properties))))
        ;; Columns.
-       (let ((column (cdr (assq 'columns alist))))
+       (let ((column (cdr (assoc "COLUMNS" alist))))
          (when column (setq-local org-columns-default-format column)))
        ;; Constants.
-       (setq org-table-formula-constants-local (cdr (assq 'constants alist)))
+       (let ((store nil))
+         (dolist (pair (cl-mapcan #'split-string
+                                  (cdr (assoc "CONSTANTS" alist))))
+           (when (string-match "^\\([a-zA-Z0][_a-zA-Z0-9]*\\)=\\(.*\\)" pair)
+             (let* ((name (match-string 1 pair))
+                    (value (match-string 2 pair))
+                    (old (assoc name store)))
+               (if old (setcdr old value)
+                 (push (cons name value) store)))))
+         (setq org-table-formula-constants-local store))
        ;; Link abbreviations.
-       (let ((links (cdr (assq 'link alist))))
+       (let ((links
+              (delq nil
+                    (mapcar
+                     (lambda (value)
+                       (and (string-match "\\`\\(\\S-+\\)[ \t]+\\(.+\\)" value)
+                            (cons (match-string-no-properties 1 value)
+                                  (match-string-no-properties 2 value))))
+                     (cdr (assoc "LINK" alist))))))
          (when links (setq org-link-abbrev-alist-local (nreverse links))))
        ;; Priorities.
-       (let ((priorities (cdr (assq 'priorities alist))))
-         (when priorities
-           (setq-local org-highest-priority (nth 0 priorities))
-           (setq-local org-lowest-priority (nth 1 priorities))
-           (setq-local org-default-priority (nth 2 priorities))))
+       (let ((value (cdr (assoc "PRIORITIES" alist))))
+         (pcase (and value (split-string value))
+           (`(,high ,low ,default . ,_)
+            (setq-local org-priority-highest (org-priority-to-value high))
+            (setq-local org-priority-lowest (org-priority-to-value low))
+            (setq-local org-priority-default (org-priority-to-value 
default)))))
        ;; Scripts.
-       (let ((scripts (assq 'scripts alist)))
-         (when scripts
-           (setq-local org-use-sub-superscripts (cdr scripts))))
+       (let ((value (cdr (assoc "OPTIONS" alist))))
+         (dolist (option value)
+           (when (string-match "\\^:\\(t\\|nil\\|{}\\)" option)
+             (setq-local org-use-sub-superscripts
+                         (read (match-string 1 option))))))
        ;; TODO keywords.
        (setq-local org-todo-kwd-alist nil)
        (setq-local org-todo-key-alist nil)
@@ -4379,7 +4357,13 @@ related expressions."
        (setq-local org-todo-sets nil)
        (setq-local org-todo-log-states nil)
        (let ((todo-sequences
-              (or (nreverse (cdr (assq 'todo alist)))
+              (or (append (mapcar (lambda (value)
+                                    (cons 'type (split-string value)))
+                                  (cdr (assoc "TYP_TODO" alist)))
+                          (mapcar (lambda (value)
+                                    (cons 'sequence (split-string value)))
+                                  (append (cdr (assoc "TODO" alist))
+                                          (cdr (assoc "SEQ_TODO" alist)))))
                   (let ((d (default-value 'org-todo-keywords)))
                     (if (not (stringp (car d))) d
                       ;; XXX: Backward compatibility code.
@@ -4464,109 +4448,90 @@ related expressions."
                      "[ \t]*$"))
        (org-compute-latex-and-related-regexp)))))
 
-(defun org--setup-collect-keywords (regexp &optional files alist)
-  "Return setup keywords values as an alist.
+(defun org-collect-keywords (keywords &optional unique directory)
+  "Return values for KEYWORDS in current buffer, as an alist.
 
-REGEXP matches a subset of setup keywords.  FILES is a list of
-file names already visited.  It is used to avoid circular setup
-files.  ALIST, when non-nil, is the alist computed so far.
+KEYWORDS is a list of strings.  Return value is a list of
+elements with the pattern:
 
-Return value contains the following keys: `archive', `category',
-`columns', `constants', `filetags', `link', `priorities',
-`property', `scripts', `startup', `tags' and `todo'."
-  (org-with-wide-buffer
-   (goto-char (point-min))
-   (let ((case-fold-search t))
-     (while (re-search-forward regexp nil t)
-       (let ((element (org-element-at-point)))
-        (when (eq (org-element-type element) 'keyword)
-          (let ((key (org-element-property :key element))
-                (value (org-element-property :value element)))
-            (cond
-             ((equal key "ARCHIVE")
-              (when (org-string-nw-p value)
-                (push (cons 'archive value) alist)))
-             ((equal key "CATEGORY") (push (cons 'category value) alist))
-             ((equal key "COLUMNS") (push (cons 'columns value) alist))
-             ((equal key "CONSTANTS")
-              (let* ((constants (assq 'constants alist))
-                     (store (cdr constants)))
-                (dolist (pair (split-string value))
-                  (when (string-match "^\\([a-zA-Z0][_a-zA-Z0-9]*\\)=\\(.*\\)"
-                                      pair)
-                    (let* ((name (match-string 1 pair))
-                           (value (match-string 2 pair))
-                           (old (assoc name store)))
-                      (if old (setcdr old value)
-                        (push (cons name value) store)))))
-                (if constants (setcdr constants store)
-                  (push (cons 'constants store) alist))))
-             ((equal key "FILETAGS")
-              (when (org-string-nw-p value)
-                (let ((old (assq 'filetags alist))
-                      (new (apply #'nconc
-                                  (mapcar (lambda (x) (org-split-string x ":"))
-                                          (split-string value)))))
-                  (if old (setcdr old (append new (cdr old)))
-                    (push (cons 'filetags new) alist)))))
-             ((equal key "LINK")
-              (when (string-match "\\`\\(\\S-+\\)[ \t]+\\(.+\\)" value)
-                (let ((links (assq 'link alist))
-                      (pair (cons (match-string-no-properties 1 value)
-                                  (match-string-no-properties 2 value))))
-                  (if links (push pair (cdr links))
-                    (push (list 'link pair) alist)))))
-             ((equal key "OPTIONS")
-              (when (and (org-string-nw-p value)
-                         (string-match "\\^:\\(t\\|nil\\|{}\\)" value))
-                (push (cons 'scripts (read (match-string 1 value))) alist)))
-             ((equal key "PRIORITIES")
-              (push (cons 'priorities
-                          (let ((prio (split-string value)))
-                            (if (< (length prio) 3) '(?A ?C ?B)
-                              (mapcar #'string-to-char prio))))
-                    alist))
-             ((equal key "PROPERTY")
-              (when (string-match "\\(\\S-+\\)[ \t]+\\(.*\\)" value)
-                (let* ((property (assq 'property alist))
-                       (value (org--update-property-plist
-                               (match-string-no-properties 1 value)
-                               (match-string-no-properties 2 value)
-                               (cdr property))))
-                  (if property (setcdr property value)
-                    (push (cons 'property value) alist)))))
-             ((equal key "STARTUP")
-              (let ((startup (assq 'startup alist)))
-                (if startup
-                    (setcdr startup
-                            (append (cdr startup) (split-string value)))
-                  (push (cons 'startup (split-string value)) alist))))
-             ((equal key "TAGS")
-              (let ((tag-cell (assq 'tags alist)))
-                (if tag-cell
-                    (setcdr tag-cell (concat (cdr tag-cell) "\n" value))
-                  (push (cons 'tags value) alist))))
-             ((member key '("TODO" "SEQ_TODO" "TYP_TODO"))
-              (let ((todo (assq 'todo alist))
-                    (value (cons (if (equal key "TYP_TODO") 'type 'sequence)
-                                 (split-string value))))
-                (if todo (push value (cdr todo))
-                  (push (list 'todo value) alist))))
-             ((equal key "SETUPFILE")
-              (unless buffer-read-only ; Do not check in Gnus messages.
-                (let ((f (and (org-string-nw-p value)
-                              (expand-file-name (org-strip-quotes value)))))
-                  (when (and f (file-readable-p f) (not (member f files)))
-                    (with-temp-buffer
-                      (setq default-directory (file-name-directory f))
-                      (insert-file-contents f)
-                      (setq alist
-                            ;; Fake Org mode to benefit from cache
-                            ;; without recurring needlessly.
+  (NAME . LIST-OF-VALUES)
+
+where NAME is the upcase name of the keyword, and LIST-OF-VALUES
+is a list of non-empty values, as strings, in order of appearance
+in the buffer.
+
+When KEYWORD appears in UNIQUE list, LIST-OF-VALUE is its first
+value, empty or not, appearing in the buffer, as a string.
+
+When KEYWORD appears in DIRECTORIES, each value is a cons cell:
+
+  (VALUE . DIRECTORY)
+
+where VALUE is the regular value, and DIRECTORY is the variable
+`default-directory' for the buffer containing the keyword.  This
+is important for values containing relative file names, since the
+function follows SETUPFILE keywords, and may change its working
+directory."
+  (let* ((keywords (cons "SETUPFILE" (mapcar #'upcase keywords)))
+        (unique (mapcar #'upcase unique))
+        (alist (org--collect-keywords-1
+                keywords unique directory
+                (and buffer-file-name (list buffer-file-name))
+                nil)))
+    ;; Re-order results.
+    (dolist (entry alist)
+      (pcase entry
+       (`(,_ . ,(and value (pred consp)))
+        (setcdr entry (nreverse value)))))
+    (nreverse alist)))
+
+(defun org--collect-keywords-1 (keywords unique directory files alist)
+  (org-with-point-at 1
+    (let ((case-fold-search t)
+         (regexp (org-make-options-regexp keywords)))
+      (while (and keywords (re-search-forward regexp nil t))
+        (let ((element (org-element-at-point)))
+          (when (eq 'keyword (org-element-type element))
+            (let ((value (org-element-property :value element)))
+              (pcase (org-element-property :key element)
+               ("SETUPFILE"
+                (when (and (org-string-nw-p value)
+                           (not buffer-read-only)) ;FIXME: bug in Gnus?
+                  (let* ((uri (org-strip-quotes value))
+                         (uri-is-url (org-file-url-p uri))
+                         (uri (if uri-is-url
+                                  uri
+                                (expand-file-name uri))))
+                    (unless (member uri files)
+                      (with-temp-buffer
+                        (unless uri-is-url
+                          (setq default-directory (file-name-directory uri)))
+                        (let ((contents (org-file-contents uri :noerror)))
+                          (when contents
+                            (insert contents)
+                            ;; Fake Org mode: `org-element-at-point'
+                            ;; doesn't need full set-up.
                             (let ((major-mode 'org-mode))
-                              (org--setup-collect-keywords
-                               regexp (cons f files) alist)))))))))))))))
-  alist)
+                              (setq alist
+                                    (org--collect-keywords-1
+                                     keywords unique directory
+                                     (cons uri files)
+                                     alist))))))))))
+               (keyword
+                (let ((entry (assoc keyword alist))
+                      (final
+                       (cond ((not (member keyword directory)) value)
+                             (buffer-file-name
+                              (cons value
+                                    (file-name-directory buffer-file-name)))
+                             (t (cons value default-directory)))))
+                  (cond ((member keyword unique)
+                         (push (cons keyword final) alist)
+                         (setq keywords (remove keyword keywords))
+                         (setq regexp (org-make-options-regexp keywords)))
+                        ((null entry) (push (list keyword final) alist))
+                        (t (push final (cdr entry)))))))))))
+      alist)))
 
 (defun org-tag-string-to-alist (s)
   "Return tag alist associated to string S.
@@ -4678,7 +4643,7 @@ already cached in the `org--file-cache' hash table, the 
download step
 is skipped.
 
 If NOERROR is non-nil, ignore the error when unable to read the FILE
-from file or URL.
+from file or URL, and return nil.
 
 If NOCACHE is non-nil, do a fresh fetch of FILE even if cached version
 is available.  This option applies only if FILE is a URL."
@@ -4702,7 +4667,8 @@ is available.  This option applies only if FILE is a URL."
                     org--file-cache)
          (funcall (if noerror #'message #'user-error)
                   "Unable to fetch file from %S"
-                  file))))
+                  file)
+         nil)))
      (t
       (with-temp-buffer
         (condition-case nil
@@ -4712,7 +4678,8 @@ is available.  This option applies only if FILE is a URL."
          (file-error
            (funcall (if noerror #'message #'user-error)
                    "Unable to read file %S"
-                   file))))))))
+                   file)
+          nil)))))))
 
 (defun org-extract-log-state-settings (x)
   "Extract the log state setting from a TODO keyword string.
@@ -4793,9 +4760,7 @@ This is for getting out of special buffers like capture.")
 (require 'easymenu)
 (require 'overlay)
 
-;; (require 'org-macs) moved higher up in the file before it is first used
 (require 'org-entities)
-;; (require 'org-compat) moved higher up in the file before it is first used
 (require 'org-faces)
 (require 'org-list)
 (require 'org-pcomplete)
@@ -4829,7 +4794,6 @@ The following commands are available:
   (org-install-agenda-files-menu)
   (when org-link-descriptive (add-to-invisibility-spec '(org-link)))
   (add-to-invisibility-spec '(org-hide-block . t))
-  (add-to-invisibility-spec '(org-hide-drawer . t))
   (setq-local outline-regexp org-outline-regexp)
   (setq-local outline-level 'org-outline-level)
   (setq bidi-paragraph-direction 'left-to-right)
@@ -4905,10 +4869,6 @@ The following commands are available:
       (regexp . "^[ \t]*#\\+[A-Z_]+:\\(\\s-*\\)\\S-+")
       (modes . '(org-mode)))))
 
-  ;; Make isearch reveal context
-  (setq-local outline-isearch-open-invisible-function
-             (lambda (&rest _) (org-show-context 'isearch)))
-
   ;; Setup the pcomplete hooks
   (setq-local pcomplete-command-completion-function #'org-pcomplete-initial)
   (setq-local pcomplete-command-name-function #'org-command-at-point)
@@ -4940,11 +4900,20 @@ The following commands are available:
      (when org-startup-with-latex-preview (org-latex-preview '(16)))
      (unless org-inhibit-startup-visibility-stuff (org-set-startup-visibility))
      (when org-startup-truncated (setq truncate-lines t))
+     (when org-startup-numerated (require 'org-num) (org-num-mode 1))
      (when org-startup-indented (require 'org-indent) (org-indent-mode 1))))
+
+  ;; Activate `org-table-header-line-mode'
+  (when org-table-header-line-p
+    (org-table-header-line-mode 1))
   ;; Try to set `org-hide' face correctly.
   (let ((foreground (org-find-invisible-foreground)))
     (when foreground
-      (set-face-foreground 'org-hide foreground))))
+      (set-face-foreground 'org-hide foreground)))
+  ;; Set face extension as requested.
+  (org--set-faces-extend '(org-block-begin-line org-block-end-line)
+                         org-fontify-whole-block-delimiter-line)
+  (org--set-faces-extend org-level-faces org-fontify-whole-heading-line))
 
 ;; Update `customize-package-emacs-version-alist'
 (add-to-list 'customize-package-emacs-version-alist
@@ -4955,7 +4924,9 @@ The following commands are available:
                   ("8.3" . "26.1")
                   ("9.0" . "26.1")
                   ("9.1" . "26.1")
-                  ("9.2" . "27.1")))
+                  ("9.2" . "27.1")
+                  ("9.3" . "27.1")
+                  ("9.4" . "27.2")))
 
 (defvar org-mode-transpose-word-syntax-table
   (let ((st (make-syntax-table text-mode-syntax-table)))
@@ -5074,9 +5045,10 @@ stacked delimiters is N.  Escaping delimiters is not 
possible."
                   ;; Do not span over cells in table rows.
                   (not (and (save-match-data (org-match-line "[ \t]*|"))
                             (string-match-p "|" (match-string 4))))))
-           (pcase-let ((`(,_ ,face ,_) (assoc marker org-emphasis-alist)))
+           (pcase-let ((`(,_ ,face ,_) (assoc marker org-emphasis-alist))
+                       (m (if org-hide-emphasis-markers 4 2)))
              (font-lock-prepend-text-property
-              (match-beginning 2) (match-end 2) 'face face)
+              (match-beginning m) (match-end m) 'face face)
              (when verbatim?
                (org-remove-flyspell-overlays-in
                 (match-beginning 0) (match-end 0))
@@ -5084,7 +5056,8 @@ stacked delimiters is N.  Escaping delimiters is not 
possible."
                                        '(display t invisible t intangible t)))
              (add-text-properties (match-beginning 2) (match-end 2)
                                   '(font-lock-multiline t org-emphasis t))
-             (when org-hide-emphasis-markers
+             (when (and org-hide-emphasis-markers
+                        (not (org-at-comment-p)))
                (add-text-properties (match-end 4) (match-beginning 5)
                                     '(invisible org-link))
                (add-text-properties (match-beginning 3) (match-end 3)
@@ -5247,13 +5220,23 @@ by a #."
   "Fontify #+ lines and blocks."
   (let ((case-fold-search t))
     (when (re-search-forward
-          "^\\([ \t]*#\\(\\(\\+[a-zA-Z]+:?\\| 
\\|$\\)\\(_\\([a-zA-Z]+\\)\\)?\\)[ \t]*\\(\\([^ \t\n]*\\)[ \t]*\\(.*\\)\\)\\)"
+          (rx bol (group (zero-or-more (any " \t")) "#"
+                         (group (group (or (seq "+" (one-or-more (any 
"a-zA-Z")) (optional ":"))
+                                           (any " \t")
+                                           eol))
+                                (optional (group "_" (group (one-or-more (any 
"a-zA-Z"))))))
+                         (zero-or-more (any " \t"))
+                         (group (group (zero-or-more (not (any " \t\n"))))
+                                (zero-or-more (any " \t"))
+                                (group (zero-or-more any)))))
           limit t)
       (let ((beg (match-beginning 0))
            (end-of-beginline (match-end 0))
-           (block-start (match-end 0))  ; includes the \n at end of #+begin 
line
-           (block-end nil)              ; will include \n after end of block 
content
-           (lang (match-string 7))      ; the language, if it is an src block
+           ;; Including \n at end of #+begin line will include \n
+           ;; after the end of block content.
+           (block-start (match-end 0))
+           (block-end nil)
+           (lang (match-string 7)) ; The language, if it is a source block.
            (bol-after-beginline (line-beginning-position 2))
            (dc1 (downcase (match-string 2)))
            (dc3 (downcase (match-string 3)))
@@ -5263,15 +5246,22 @@ by a #."
         ((and (match-end 4) (equal dc3 "+begin"))
          ;; Truly a block
          (setq block-type (downcase (match-string 5))
-               quoting (member block-type org-protecting-blocks)) ; src, 
example, export, maybe more
+               ;; Src, example, export, maybe more.
+               quoting (member block-type org-protecting-blocks))
          (when (re-search-forward
-                (concat "^[ \t]*#\\+end" (match-string 4) "\\>.*")
-                nil t)  ;; on purpose, we look further than LIMIT
-           ;; We do have a matching #+end line
+                (rx-to-string `(group bol (or (seq (one-or-more "*") space)
+                                              (seq (zero-or-more (any " \t"))
+                                                   "#+end"
+                                                   ,(match-string 4)
+                                                   word-end
+                                                   (zero-or-more any)))))
+                ;; We look further than LIMIT on purpose.
+                nil t)
+           ;; We do have a matching #+end line.
            (setq beg-of-endline (match-beginning 0)
                  end-of-endline (match-end 0)
                  nl-before-endline (1- (match-beginning 0)))
-           (setq block-end (match-beginning 0)) ; includes the final newline.
+           (setq block-end (match-beginning 0)) ; Include the final newline.
            (when quoting
              (org-remove-flyspell-overlays-in bol-after-beginline 
nl-before-endline)
              (remove-text-properties beg end-of-endline
@@ -5304,10 +5294,14 @@ by a #."
            (add-text-properties
             beg (if whole-blockline bol-after-beginline end-of-beginline)
             '(face org-block-begin-line))
-           (add-text-properties
-            beg-of-endline
-            (min (point-max) (if whole-blockline (min (point-max) (1+ 
end-of-endline)) end-of-endline))
-            '(face org-block-end-line))
+           (unless (eq (char-after beg-of-endline) ?*)
+             (add-text-properties
+              beg-of-endline
+              (if whole-blockline
+                  (let ((beg-of-next-line (1+ end-of-endline)))
+                    (min (point-max) beg-of-next-line))
+                (min (point-max) end-of-endline))
+              '(face org-block-end-line)))
            t))
         ((member dc1 '("+title:" "+author:" "+email:" "+date:"))
          (org-remove-flyspell-overlays-in
@@ -5327,22 +5321,26 @@ by a #."
          (org-remove-flyspell-overlays-in (match-end 2) (match-end 0))
          (remove-text-properties (match-beginning 0) (match-end 0)
                                  '(display t invisible t intangible t))
-         ;; Handle short captions.
+         ;; Handle short captions
          (save-excursion
            (beginning-of-line)
-           (looking-at "\\([ \t]*#\\+caption\\(?:\\[.*\\]\\)?:\\)[ \t]*"))
+           (looking-at (rx (group (zero-or-more (any " \t"))
+                                  "#+caption"
+                                  (optional "[" (zero-or-more any) "]")
+                                  ":")
+                           (zero-or-more (any " \t")))))
          (add-text-properties (line-beginning-position) (match-end 1)
                               '(font-lock-fontified t face org-meta-line))
          (add-text-properties (match-end 0) (line-end-position)
                               '(font-lock-fontified t face org-block))
          t)
         ((member dc3 '(" " ""))
-                                        ; Just a comment, the plus was not 
there
+         ;; Just a comment, the plus was not there
          (org-remove-flyspell-overlays-in beg (match-end 0))
          (add-text-properties
           beg (match-end 0)
           '(font-lock-fontified t face font-lock-comment-face)))
-        (t ;; just any other in-buffer setting, but not indented
+        (t ;; Just any other in-buffer setting, but not indented
          (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
          (remove-text-properties (match-beginning 0) (match-end 0)
                                  '(display t invisible t intangible t))
@@ -5353,9 +5351,8 @@ by a #."
 (defun org-fontify-drawers (limit)
   "Fontify drawers."
   (when (re-search-forward org-drawer-regexp limit t)
-    (add-text-properties
-     (line-beginning-position) (line-beginning-position 2)
-     '(font-lock-fontified t face org-drawer))
+    (add-text-properties (1- (match-beginning 1)) (1+ (match-end 1))
+                        '(font-lock-fontified t face org-drawer))
     (org-remove-flyspell-overlays-in
      (line-beginning-position) (line-beginning-position 2))
     t))
@@ -5383,8 +5380,8 @@ by a #."
        (end-re "\\(\\\\\\]\\|\\(#\\+end_\\|\\\\end{\\)\\S-+\\)")
        (extend (lambda (r1 r2 dir)
                  (let ((re (replace-regexp-in-string "\\(begin\\|end\\)" r1
-                                                     (replace-regexp-in-string 
"[][]" r2
-                                                                               
(match-string-no-properties 0)))))
+                            (replace-regexp-in-string "[][]" r2
+                             (match-string-no-properties 0)))))
                    (re-search-forward (regexp-quote re) nil t dir)))))
     (save-match-data
       (save-excursion
@@ -5480,33 +5477,46 @@ Result depends on variable 
`org-highlight-latex-and-related'."
                           (append re-latex re-entities re-sub)
                           "\\|"))))
 
-(defun org-do-latex-and-related (_limit)
+(defun org-do-latex-and-related (limit)
   "Highlight LaTeX snippets and environments, entities and sub/superscript.
 Stop at first highlighted object, if any.  Return t if some
 highlighting was done, nil otherwise."
   (when (org-string-nw-p org-latex-and-related-regexp)
-    (catch 'found
-      (while (re-search-forward org-latex-and-related-regexp
-                               nil t) ;; on purpose, we ignore LIMIT
-       (unless (cl-some (lambda (f) (memq f '(org-code org-verbatim underline
-                                                       org-special-keyword)))
-                        (save-excursion
-                          (goto-char (1+ (match-beginning 0)))
-                          (face-at-point nil t)))
-         (let* ((offset (if (memq (char-after (1+ (match-beginning 0)))
-                                  '(?_ ?^))
-                            1
-                          0))
-                (start (+ offset (match-beginning 0)))
-                (end (match-end 0)))
-           (if (memq 'native org-highlight-latex-and-related)
-               (org-src-font-lock-fontify-block "latex" start end)
-             (font-lock-prepend-text-property start end
-                                              'face 'org-latex-and-related))
-           (add-text-properties (+ offset (match-beginning 0)) (match-end 0)
-                                '(font-lock-multiline t)))
-         (throw 'found t)))
-      nil)))
+    (let ((latex-prefix-re (rx (or "$" "\\(" "\\[")))
+         (blank-line-re (rx (and "\n" (zero-or-more (or " " "\t")) "\n"))))
+      (catch 'found
+       (while (and (< (point) limit)
+                   (re-search-forward org-latex-and-related-regexp nil t))
+         (cond
+          ((cl-some (lambda (f)
+                      (memq f '(org-code org-verbatim underline
+                                         org-special-keyword)))
+                    (save-excursion
+                      (goto-char (1+ (match-beginning 0)))
+                      (face-at-point nil t))))
+          ;; Try to limit false positives.  In this case, ignore
+          ;; $$...$$, \(...\), and \[...\] LaTeX constructs if they
+          ;; contain an empty line.
+          ((save-excursion
+             (goto-char (match-beginning 0))
+             (and (looking-at-p latex-prefix-re)
+                  (save-match-data
+                    (re-search-forward blank-line-re (1- (match-end 0)) t)))))
+          (t
+           (let* ((offset (if (memq (char-after (1+ (match-beginning 0)))
+                                    '(?_ ?^))
+                              1
+                            0))
+                  (start (+ offset (match-beginning 0)))
+                  (end (match-end 0)))
+             (if (memq 'native org-highlight-latex-and-related)
+                 (org-src-font-lock-fontify-block "latex" start end)
+               (font-lock-prepend-text-property start end
+                                                'face 'org-latex-and-related))
+             (add-text-properties (+ offset (match-beginning 0)) (match-end 0)
+                                  '(font-lock-multiline t))
+             (throw 'found t)))))
+       nil))))
 
 (defun org-restart-font-lock ()
   "Restart `font-lock-mode', to force refontification."
@@ -5634,15 +5644,22 @@ needs to be inserted at a specific position in the 
font-lock sequence.")
           (list (format org-heading-keyword-regexp-format
                         org-todo-regexp)
                 '(2 (org-get-todo-face 2) t))
+          ;; TODO
+          (when org-fontify-todo-headline
+            (list (format org-heading-keyword-regexp-format
+                          (concat
+                           "\\(?:"
+                           (mapconcat 'regexp-quote org-not-done-keywords 
"\\|")
+                           "\\)"))
+                  '(2 'org-headline-todo t)))
           ;; DONE
-          (if org-fontify-done-headline
-              (list (format org-heading-keyword-regexp-format
-                            (concat
-                             "\\(?:"
-                             (mapconcat 'regexp-quote org-done-keywords "\\|")
-                             "\\)"))
-                    '(2 'org-headline-done t))
-            nil)
+          (when org-fontify-done-headline
+            (list (format org-heading-keyword-regexp-format
+                          (concat
+                           "\\(?:"
+                           (mapconcat 'regexp-quote org-done-keywords "\\|")
+                           "\\)"))
+                  '(2 'org-headline-done t)))
           ;; Priorities
           '(org-font-lock-add-priority-faces)
           ;; Tags
@@ -5776,20 +5793,17 @@ needs to be inserted at a specific position in the 
font-lock sequence.")
       (org-font-lock-ensure)
       (buffer-string))))
 
-(defvar org-m nil)
-(defvar org-l nil)
-(defvar org-f nil)
 (defun org-get-level-face (n)
   "Get the right face for match N in font-lock matching of headlines."
-  (setq org-l (- (match-end 2) (match-beginning 1) 1))
-  (when org-odd-levels-only (setq org-l (1+ (/ org-l 2))))
-  (if org-cycle-level-faces
-      (setq org-f (nth (% (1- org-l) org-n-level-faces) org-level-faces))
-    (setq org-f (nth (1- (min org-l org-n-level-faces)) org-level-faces)))
-  (cond
-   ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
-   ((eq n 2) org-f)
-   (t (unless org-level-color-stars-only org-f))))
+  (let* ((org-l0 (- (match-end 2) (match-beginning 1) 1))
+        (org-l (if org-odd-levels-only (1+ (/ org-l0 2)) org-l0))
+        (org-f (if org-cycle-level-faces
+                   (nth (% (1- org-l) org-n-level-faces) org-level-faces)
+                 (nth (1- (min org-l org-n-level-faces)) org-level-faces))))
+    (cond
+     ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
+     ((eq n 2) org-f)
+     (t (unless org-level-color-stars-only org-f)))))
 
 (defun org-face-from-face-or-color (context inherit face-or-color)
   "Create a face list that inherits INHERIT, but sets the foreground color.
@@ -5824,11 +5838,13 @@ If TAG is a number, get the corresponding match group."
         'tag 'org-tag (cdr (assoc tag org-tag-faces)))
        'org-tag)))
 
+(defvar org-priority-regexp) ; defined later in the file
+
 (defun org-font-lock-add-priority-faces (limit)
   "Add the special priority faces."
-  (while (re-search-forward "^\\*+ .*?\\(\\[#\\(.\\)\\]\\)" limit t)
+  (while (re-search-forward org-priority-regexp limit t)
     (add-text-properties
-     (match-beginning 1) (match-end 1)
+     (match-beginning 1) (1+ (match-end 2))
      (list 'face (org-get-priority-face (string-to-char (match-string 2)))
           'font-lock-fontified t))))
 
@@ -5912,7 +5928,7 @@ and subscripts."
   "Remove outline overlays that do not contain non-white stuff."
   (dolist (o (overlays-at pos))
     (and (eq 'outline (overlay-get o 'invisible))
-        (not (string-match "\\S-" (buffer-substring (overlay-start o)
+        (not (string-match-p "\\S-" (buffer-substring (overlay-start o)
                                                     (overlay-end o))))
         (delete-overlay o))))
 
@@ -5961,21 +5977,37 @@ open and agenda-wise Org files."
 ;;;; Headlines visibility
 
 (defun org-show-entry ()
-  "Show the body directly following this heading.
+  "Show the body directly following its heading.
 Show the heading too, if it is currently invisible."
   (interactive)
   (save-excursion
-    (ignore-errors
-      (org-back-to-heading t)
-      (org-flag-region
-       (line-end-position 0)
-       (save-excursion
-        (if (re-search-forward
-             (concat "[\r\n]\\(" org-outline-regexp "\\)") nil t)
-            (match-beginning 1)
-          (point-max)))
-       nil
-       'outline))))
+    (org-back-to-heading-or-point-min t)
+    (org-flag-region
+     (line-end-position 0)
+     (save-excursion
+       (if (re-search-forward
+           (concat "[\r\n]\\(" org-outline-regexp "\\)") nil t)
+          (match-beginning 1)
+        (point-max)))
+     nil
+     'outline)
+    (org-cycle-hide-drawers 'children)))
+
+(defun org-hide-entry ()
+  "Hide the body directly following its heading."
+  (interactive)
+  (save-excursion
+    (org-back-to-heading-or-point-min t)
+    (when (org-at-heading-p) (forward-line))
+    (org-flag-region
+     (line-end-position 0)
+     (save-excursion
+       (if (re-search-forward
+           (concat "[\r\n]" org-outline-regexp) nil t)
+           (line-end-position 0)
+        (point-max)))
+     t
+     'outline)))
 
 (defun org-show-children (&optional level)
   "Show all direct subheadings of this heading.
@@ -5983,36 +6015,37 @@ Prefix arg LEVEL is how many levels below the current 
level
 should be shown.  Default is enough to cause the following
 heading to appear."
   (interactive "p")
-  (save-excursion
-    (org-back-to-heading t)
-    (let* ((current-level (funcall outline-level))
-          (max-level (org-get-valid-level
-                      current-level
-                      (if level (prefix-numeric-value level) 1)))
-          (end (save-excursion (org-end-of-subtree t t)))
-          (regexp-fmt "^\\*\\{%d,%s\\}\\(?: \\|$\\)")
-          (past-first-child nil)
-          ;; Make sure to skip inlinetasks.
-          (re (format regexp-fmt
-                      current-level
-                      (cond
-                       ((not (featurep 'org-inlinetask)) "")
-                       (org-odd-levels-only (- (* 2 org-inlinetask-min-level)
-                                               3))
-                       (t (1- org-inlinetask-min-level))))))
-      ;; Display parent heading.
-      (org-flag-heading nil)
-      (forward-line)
-      ;; Display children.  First child may be deeper than expected
-      ;; MAX-LEVEL.  Since we want to display it anyway, adjust
-      ;; MAX-LEVEL accordingly.
-      (while (re-search-forward re end t)
-       (unless past-first-child
-         (setq re (format regexp-fmt
-                          current-level
-                          (max (funcall outline-level) max-level)))
-         (setq past-first-child t))
-       (org-flag-heading nil)))))
+  (unless (org-before-first-heading-p)
+    (save-excursion
+      (org-with-limited-levels (org-back-to-heading t))
+      (let* ((current-level (funcall outline-level))
+            (max-level (org-get-valid-level
+                        current-level
+                        (if level (prefix-numeric-value level) 1)))
+            (end (save-excursion (org-end-of-subtree t t)))
+            (regexp-fmt "^\\*\\{%d,%s\\}\\(?: \\|$\\)")
+            (past-first-child nil)
+            ;; Make sure to skip inlinetasks.
+            (re (format regexp-fmt
+                        current-level
+                        (cond
+                         ((not (featurep 'org-inlinetask)) "")
+                         (org-odd-levels-only (- (* 2 org-inlinetask-min-level)
+                                                 3))
+                         (t (1- org-inlinetask-min-level))))))
+       ;; Display parent heading.
+       (org-flag-heading nil)
+       (forward-line)
+       ;; Display children.  First child may be deeper than expected
+       ;; MAX-LEVEL.  Since we want to display it anyway, adjust
+       ;; MAX-LEVEL accordingly.
+       (while (re-search-forward re end t)
+         (unless past-first-child
+           (setq re (format regexp-fmt
+                            current-level
+                            (max (funcall outline-level) max-level)))
+           (setq past-first-child t))
+         (org-flag-heading nil))))))
 
 (defun org-show-subtree ()
   "Show everything after this heading at deeper levels."
@@ -6020,117 +6053,135 @@ heading to appear."
   (org-flag-region
    (point) (save-excursion (org-end-of-subtree t t)) nil 'outline))
 
-;;;; Blocks visibility
+;;;; Blocks and drawers visibility
 
-(defun org-hide-block-toggle-maybe ()
-  "Toggle visibility of block at point.
-Unlike to `org-hide-block-toggle', this function does not throw
-an error.  Return a non-nil value when toggling is successful."
-  (interactive)
-  (ignore-errors (org-hide-block-toggle)))
+(defun org--hide-wrapper-toggle (element category force no-error)
+  "Toggle visibility for ELEMENT.
+
+ELEMENT is a block or drawer type parsed element.  CATEGORY is
+either `block' or `drawer'.  When FORCE is `off', show the block
+or drawer.  If it is non-nil, hide it unconditionally.  Throw an
+error when not at a block or drawer, unless NO-ERROR is non-nil.
+
+Return a non-nil value when toggling is successful."
+  (let ((type (org-element-type element)))
+    (cond
+     ((memq type
+           (pcase category
+             (`drawer '(drawer property-drawer))
+             (`block '(center-block
+                       comment-block dynamic-block example-block export-block
+                       quote-block special-block src-block verse-block))
+             (_ (error "Unknown category: %S" category))))
+      (let* ((post (org-element-property :post-affiliated element))
+            (start (save-excursion
+                     (goto-char post)
+                     (line-end-position)))
+            (end (save-excursion
+                   (goto-char (org-element-property :end element))
+                   (skip-chars-backward " \t\n")
+                   (line-end-position))))
+       ;; Do nothing when not before or at the block opening line or
+       ;; at the block closing line.
+       (unless (let ((eol (line-end-position)))
+                 (and (> eol start) (/= eol end)))
+         (let* ((spec (if (eq category 'block) 'org-hide-block 'outline))
+                (flag
+                 (cond ((eq force 'off) nil)
+                       (force t)
+                       ((eq spec (get-char-property start 'invisible)) nil)
+                       (t t))))
+           (org-flag-region start end flag spec))
+         ;; When the block is hidden away, make sure point is left in
+         ;; a visible part of the buffer.
+         (when (invisible-p (max (1- (point)) (point-min)))
+           (goto-char post))
+         ;; Signal success.
+         t)))
+     (no-error nil)
+     (t
+      (user-error (if (eq category 'drawer)
+                     "Not at a drawer"
+                   "Not at a block"))))))
 
-(defun org-hide-block-toggle (&optional force)
+(defun org-hide-block-toggle (&optional force no-error element)
   "Toggle the visibility of the current block.
+
 When optional argument FORCE is `off', make block visible.  If it
 is non-nil, hide it unconditionally.  Throw an error when not at
-a block.  Return a non-nil value when toggling is successful."
+a block, unless NO-ERROR is non-nil.  When optional argument
+ELEMENT is provided, consider it instead of the current block.
+
+Return a non-nil value when toggling is successful."
   (interactive)
-  (let ((element (org-element-at-point)))
-    (unless (memq (org-element-type element)
-                 '(center-block comment-block dynamic-block example-block
-                                export-block quote-block special-block
-                                src-block verse-block))
-      (user-error "Not at a block"))
-    (let* ((post (org-element-property :post-affiliated element))
-          (start (save-excursion
-                   (goto-char post)
-                   (line-end-position)))
-          (end (save-excursion
-                 (goto-char (org-element-property :end element))
-                 (skip-chars-backward " \t\n")
-                 (line-end-position))))
-      ;; Do nothing when not before or at the block opening line or at
-      ;; the block closing line.
-      (unless (let ((eol (line-end-position))) (and (> eol start) (/= eol 
end)))
-       (cond ((eq force 'off)
-              (org-flag-region start end nil 'org-hide-block))
-             (force
-              (org-flag-region start end t 'org-hide-block))
-             ((eq (get-char-property start 'invisible) 'org-hide-block)
-              (org-flag-region start end nil 'org-hide-block))
-             (t
-              (org-flag-region start end t 'org-hide-block)))
-       ;; When the block is hidden away, make sure point is left in
-       ;; a visible part of the buffer.
-       (when (invisible-p (max (1- (point)) (point-min)))
-         (goto-char post))
-       ;; Signal success.
-       t))))
+  (org--hide-wrapper-toggle
+   (or element (org-element-at-point)) 'block force no-error))
 
-(defun org-hide-block-toggle-all ()
-  "Toggle the visibility of all blocks in the current buffer."
-  (org-block-map 'org-hide-block-toggle))
+(defun org-hide-drawer-toggle (&optional force no-error element)
+  "Toggle the visibility of the current drawer.
+
+When optional argument FORCE is `off', make drawer visible.  If
+it is non-nil, hide it unconditionally.  Throw an error when not
+at a drawer, unless NO-ERROR is non-nil.  When optional argument
+ELEMENT is provided, consider it instead of the current drawer.
+
+Return a non-nil value when toggling is successful."
+  (interactive)
+  (org--hide-wrapper-toggle
+   (or element (org-element-at-point)) 'drawer force no-error))
 
 (defun org-hide-block-all ()
   "Fold all blocks in the current buffer."
   (interactive)
   (org-show-all '(blocks))
-  (org-block-map 'org-hide-block-toggle-maybe))
-
-;;;; Drawers visibility
+  (org-block-map 'org-hide-block-toggle))
 
-(defun org-cycle-hide-drawers (state &optional exceptions)
+(defun org-hide-drawer-all ()
+  "Fold all drawers in the current buffer."
+  (save-excursion
+    (goto-char (point-min))
+    (while (re-search-forward org-drawer-regexp nil t)
+      (let* ((pair (get-char-property-and-overlay (line-beginning-position)
+                                                 'invisible))
+            (o (cdr-safe pair)))
+       (if (overlayp o) (goto-char (overlay-end o)) ;invisible drawer
+         (pcase (get-char-property-and-overlay (point) 'invisible)
+           (`(outline . ,o) (goto-char (overlay-end o))) ;already folded
+           (_
+            (let* ((drawer (org-element-at-point))
+                   (type (org-element-type drawer)))
+              (when (memq type '(drawer property-drawer))
+                (org-hide-drawer-toggle t nil drawer)
+                ;; Make sure to skip drawer entirely or we might flag it
+                ;; another time when matching its ending line with
+                ;; `org-drawer-regexp'.
+                (goto-char (org-element-property :end drawer)))))))))))
+
+(defun org-cycle-hide-drawers (state)
   "Re-hide all drawers after a visibility state change.
 STATE should be one of the symbols listed in the docstring of
-`org-cycle-hook'.  When non-nil, optional argument EXCEPTIONS is
-a list of strings specifying which drawers should not be hidden."
+`org-cycle-hook'."
   (when (and (derived-mode-p 'org-mode)
             (not (memq state '(overview folded contents))))
-    (save-excursion
-      (let* ((globalp (eq state 'all))
-             (beg (if globalp (point-min) (point)))
-             (end (if globalp (point-max)
-                   (if (eq state 'children)
-                       (save-excursion (outline-next-heading) (point))
-                     (org-end-of-subtree t)))))
+    (let* ((global? (eq state 'all))
+          (beg (if global? (point-min) (line-beginning-position)))
+          (end (cond (global? (point-max))
+                     ((eq state 'children) (org-entry-end-position))
+                     (t (save-excursion (org-end-of-subtree t t))))))
+      (save-excursion
        (goto-char beg)
-       (while (re-search-forward org-drawer-regexp (max end (point)) t)
-         (unless (member-ignore-case (match-string 1) exceptions)
-           (let ((drawer (org-element-at-point)))
-             (when (memq (org-element-type drawer) '(drawer property-drawer))
-               (org-flag-drawer t drawer)
-               ;; Make sure to skip drawer entirely or we might flag
-               ;; it another time when matching its ending line with
-               ;; `org-drawer-regexp'.
-               (goto-char (org-element-property :end drawer))))))))))
-
-(defun org-flag-drawer (flag &optional element beg end)
-  "When FLAG is non-nil, hide the drawer we are at.
-Otherwise make it visible.
-
-When optional argument ELEMENT is a parsed drawer, as returned by
-`org-element-at-point', hide or show that drawer instead.
-
-When buffer positions BEG and END are provided, hide or show that
-region as a drawer without further ado."
-  (if (and beg end) (org-flag-region beg end flag 'org-hide-drawer)
-    (let ((drawer (or element
-                     (and (save-excursion
-                            (beginning-of-line)
-                            (looking-at-p org-drawer-regexp))
-                          (org-element-at-point)))))
-      (when (memq (org-element-type drawer) '(drawer property-drawer))
-       (let ((post (org-element-property :post-affiliated drawer)))
-         (org-flag-region
-          (save-excursion (goto-char post) (line-end-position))
-          (save-excursion (goto-char (org-element-property :end drawer))
-                          (skip-chars-backward " \t\n")
-                          (line-end-position))
-          flag 'org-hide-drawer)
-         ;; When the drawer is hidden away, make sure point lies in
-         ;; a visible part of the buffer.
-         (when (invisible-p (max (1- (point)) (point-min)))
-           (goto-char post)))))))
+       (while (re-search-forward org-drawer-regexp end t)
+         (pcase (get-char-property-and-overlay (point) 'invisible)
+           ;; Do not fold already folded drawers.
+           (`(outline . ,o) (goto-char (overlay-end o)))
+           (_
+            (let ((drawer (org-element-at-point)))
+              (when (memq (org-element-type drawer) '(drawer property-drawer))
+                (org-hide-drawer-toggle t nil drawer)
+                ;; Make sure to skip drawer entirely or we might flag
+                ;; it another time when matching its ending line with
+                ;; `org-drawer-regexp'.
+                (goto-char (org-element-property :end drawer)))))))))))
 
 ;;;; Visibility cycling
 
@@ -6145,13 +6196,31 @@ By default, the function expands headings, blocks and 
drawers.
 When optional argument TYPE is a list of symbols among `blocks',
 `drawers' and `headings', to only expand one specific type."
   (interactive)
-  (dolist (type (or types '(blocks drawers headings)))
-    (org-flag-region (point-min) (point-max) nil
-                    (pcase type
-                      (`blocks 'org-hide-block)
-                      (`drawers 'org-hide-drawer)
-                      (`headings 'outline)
-                      (_ (error "Invalid type: %S" type))))))
+  (let ((types (or types '(blocks drawers headings))))
+    (when (memq 'blocks types)
+      (org-flag-region (point-min) (point-max) nil 'org-hide-block))
+    (cond
+     ;; Fast path.  Since headings and drawers share the same
+     ;; invisible spec, clear everything in one go.
+     ((and (memq 'headings types)
+          (memq 'drawers types))
+      (org-flag-region (point-min) (point-max) nil 'outline))
+     ((memq 'headings types)
+      (org-flag-region (point-min) (point-max) nil 'outline)
+      (org-cycle-hide-drawers 'all))
+     ((memq 'drawers types)
+      (save-excursion
+       (goto-char (point-min))
+       (while (re-search-forward org-drawer-regexp nil t)
+         (let* ((pair (get-char-property-and-overlay (line-beginning-position)
+                                                     'invisible))
+                (o (cdr-safe pair)))
+           (if (overlayp o) (goto-char (overlay-end o))
+             (pcase (get-char-property-and-overlay (point) 'invisible)
+               (`(outline . ,o)
+                (goto-char (overlay-end o))
+                (delete-overlay o))
+               (_ nil))))))))))
 
 ;;;###autoload
 (defun org-cycle (&optional arg)
@@ -6202,11 +6271,11 @@ When point is not at the beginning of a headline, 
execute the global
 binding for `TAB', which is re-indenting the line.  See the option
 `org-cycle-emulate-tab' for details.
 
-As a special case, if point is at the beginning of the buffer and there is
-no headline in line 1, this function will act as if called with prefix arg
-\(`\\[universal-argument] TAB', same as `S-TAB') also when called without \
-prefix arg, but only
-if the variable `org-cycle-global-at-bob' is t."
+As a special case, if point is at the very beginning of the buffer, if
+there is no headline there, and if the variable `org-cycle-global-at-bob'
+is non-nil, this function acts as if called with prefix argument \
+\(`\\[universal-argument] TAB',
+same as `S-TAB') also when called without prefix argument."
   (interactive "P")
   (org-load-modules-maybe)
   (unless (or (run-hook-with-args-until-success 'org-tab-first-hook)
@@ -6218,63 +6287,22 @@ if the variable `org-cycle-global-at-bob' is t."
                (and (boundp 'org-inlinetask-min-level)
                     org-inlinetask-min-level
                     (1- org-inlinetask-min-level))))
-          (nstars (and limit-level
-                       (if org-odd-levels-only
-                           (and limit-level (1- (* limit-level 2)))
-                         limit-level)))
+          (nstars
+           (and limit-level
+                (if org-odd-levels-only
+                    (1- (* 2 limit-level))
+                  limit-level)))
           (org-outline-regexp
-           (if (not (derived-mode-p 'org-mode))
-               outline-regexp
-             (concat "\\*" (if nstars (format "\\{1,%d\\} " nstars) "+ "))))
-          (bob-special (and org-cycle-global-at-bob (not arg) (bobp)
-                            (not (looking-at org-outline-regexp))))
-          (org-cycle-hook
-           (if bob-special
-               (delq 'org-optimize-window-after-visibility-change
-                     (copy-sequence org-cycle-hook))
-             org-cycle-hook))
-          (pos (point)))
-
+           (format "\\*%s " (if nstars (format "\\{1,%d\\}" nstars) "+"))))
       (cond
-
        ((equal arg '(16))
        (setq last-command 'dummy)
        (org-set-startup-visibility)
        (org-unlogged-message "Startup visibility, plus VISIBILITY properties"))
-
        ((equal arg '(64))
        (org-show-all)
        (org-unlogged-message "Entire buffer visible, including drawers"))
-
        ((equal arg '(4)) (org-cycle-internal-global))
-
-       ;; Try hiding block at point.
-       ((org-hide-block-toggle-maybe))
-
-       ;; Try cdlatex TAB completion
-       ((org-try-cdlatex-tab))
-
-       ;; Table: enter it or move to the next field.
-       ((org-at-table-p 'any)
-       (if (org-at-table.el-p)
-           (message "%s" (substitute-command-keys "\\<org-mode-map>\
-Use `\\[org-edit-special]' to edit table.el tables"))
-         (if arg (org-table-edit-field t)
-           (org-table-justify-field-maybe)
-           (call-interactively 'org-table-next-field))))
-
-       ((run-hook-with-args-until-success 'org-tab-after-check-for-table-hook))
-
-       ;; Global cycling: delegate to `org-cycle-internal-global'.
-       (bob-special (org-cycle-internal-global))
-
-       ;; Drawers: delegate to `org-flag-drawer'.
-       ((save-excursion
-         (beginning-of-line 1)
-         (looking-at org-drawer-regexp))
-       (org-flag-drawer                ; toggle block visibility
-        (not (get-char-property (match-end 0) 'invisible))))
-
        ;; Show-subtree, ARG levels up from here.
        ((integerp arg)
        (save-excursion
@@ -6282,52 +6310,79 @@ Use `\\[org-edit-special]' to edit table.el tables"))
          (outline-up-heading (if (< arg 0) (- arg)
                                (- (funcall outline-level) arg)))
          (org-show-subtree)))
-
+       ;; Global cycling at BOB: delegate to `org-cycle-internal-global'.
+       ((and org-cycle-global-at-bob
+            (bobp)
+            (not (looking-at org-outline-regexp)))
+       (let ((org-cycle-hook
+              (remq 'org-optimize-window-after-visibility-change
+                    org-cycle-hook)))
+         (org-cycle-internal-global)))
+       ;; Try CDLaTeX TAB completion.
+       ((org-try-cdlatex-tab))
        ;; Inline task: delegate to `org-inlinetask-toggle-visibility'.
        ((and (featurep 'org-inlinetask)
             (org-inlinetask-at-task-p)
             (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol))))
        (org-inlinetask-toggle-visibility))
-
-       ;; At an item/headline: delegate to `org-cycle-internal-local'.
-       ((and (or (and org-cycle-include-plain-lists (org-at-item-p))
-                (save-excursion (move-beginning-of-line 1)
-                                (looking-at org-outline-regexp)))
-            (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol))))
-       (org-cycle-internal-local))
-
-       ;; From there: TAB emulation and template completion.
-       (buffer-read-only (org-back-to-heading))
-
-       ((run-hook-with-args-until-success
-        'org-tab-after-check-for-cycling-hook))
-
-       ((run-hook-with-args-until-success
-        'org-tab-before-tab-emulation-hook))
-
-       ((and (eq org-cycle-emulate-tab 'exc-hl-bol)
-            (or (not (bolp))
-                (not (looking-at org-outline-regexp))))
-       (call-interactively (global-key-binding "\t")))
-
-       ((if (and (memq org-cycle-emulate-tab '(white whitestart))
-                (save-excursion (beginning-of-line 1) (looking-at "[ \t]*"))
-                (or (and (eq org-cycle-emulate-tab 'white)
-                         (= (match-end 0) (point-at-eol)))
-                    (and (eq org-cycle-emulate-tab 'whitestart)
-                         (>= (match-end 0) pos))))
-           t
-         (eq org-cycle-emulate-tab t))
-       (call-interactively (global-key-binding "\t")))
-
-       (t (save-excursion
-           (org-back-to-heading)
-           (org-cycle)))))))
+       (t
+       (let ((pos (point))
+             (element (org-element-at-point)))
+         (cond
+          ;; Try toggling visibility for block at point.
+          ((org-hide-block-toggle nil t element))
+          ;; Try toggling visibility for drawer at point.
+          ((org-hide-drawer-toggle nil t element))
+          ;; Table: enter it or move to the next field.
+          ((and (org-match-line "[ \t]*[|+]")
+                (org-element-lineage element '(table) t))
+           (if (and (eq 'table (org-element-type element))
+                    (eq 'table.el (org-element-property :type element)))
+               (message (substitute-command-keys "\\<org-mode-map>\
+Use `\\[org-edit-special]' to edit table.el tables"))
+             (org-table-justify-field-maybe)
+             (call-interactively #'org-table-next-field)))
+          ((run-hook-with-args-until-success
+            'org-tab-after-check-for-table-hook))
+          ;; At an item/headline: delegate to `org-cycle-internal-local'.
+          ((and (or (and org-cycle-include-plain-lists
+                         (let ((item (org-element-lineage element
+                                                          '(item plain-list)
+                                                          t)))
+                           (and item
+                                (= (line-beginning-position)
+                                   (org-element-property :post-affiliated
+                                                         item)))))
+                    (org-match-line org-outline-regexp))
+                (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol))))
+           (org-cycle-internal-local))
+          ;; From there: TAB emulation and template completion.
+          (buffer-read-only (org-back-to-heading))
+          ((run-hook-with-args-until-success
+            'org-tab-after-check-for-cycling-hook))
+          ((run-hook-with-args-until-success
+            'org-tab-before-tab-emulation-hook))
+          ((and (eq org-cycle-emulate-tab 'exc-hl-bol)
+                (or (not (bolp))
+                    (not (looking-at org-outline-regexp))))
+           (call-interactively (global-key-binding (kbd "TAB"))))
+          ((or (eq org-cycle-emulate-tab t)
+               (and (memq org-cycle-emulate-tab '(white whitestart))
+                    (save-excursion (beginning-of-line 1) (looking-at "[ 
\t]*"))
+                    (or (and (eq org-cycle-emulate-tab 'white)
+                             (= (match-end 0) (point-at-eol)))
+                        (and (eq org-cycle-emulate-tab 'whitestart)
+                             (>= (match-end 0) pos)))))
+           (call-interactively (global-key-binding (kbd "TAB"))))
+          (t
+           (save-excursion
+             (org-back-to-heading)
+             (org-cycle))))))))))
 
 (defun org-cycle-internal-global ()
   "Do the global cycling action."
   ;; Hack to avoid display of messages for .org  attachments in Gnus
-  (let ((ga (string-match "\\*fontification" (buffer-name))))
+  (let ((ga (string-match-p "\\*fontification" (buffer-name))))
     (cond
      ((and (eq last-command this-command)
           (eq org-cycle-global-status 'overview))
@@ -6375,19 +6430,23 @@ Use `\\[org-edit-special]' to edit table.el tables"))
            (setq has-children (org-list-has-child-p (point) struct)))
        (org-back-to-heading)
        (setq eoh (save-excursion (outline-end-of-heading) (point)))
-       (setq eos (save-excursion (org-end-of-subtree t t)
-                                 (when (bolp) (backward-char)) (point)))
+       (setq eos (save-excursion
+                   (org-end-of-subtree t t)
+                   (unless (eobp) (forward-char -1))
+                   (point)))
        (setq has-children
-             (or (save-excursion
-                   (let ((level (funcall outline-level)))
-                     (outline-next-heading)
-                     (and (org-at-heading-p t)
-                          (> (funcall outline-level) level))))
-                 (save-excursion
-                   (org-list-search-forward (org-item-beginning-re) eos t)))))
+             (or
+              (save-excursion
+                (let ((level (funcall outline-level)))
+                  (outline-next-heading)
+                  (and (org-at-heading-p t)
+                       (> (funcall outline-level) level))))
+              (and (eq org-cycle-include-plain-lists 'integrate)
+                   (save-excursion
+                     (org-list-search-forward (org-item-beginning-re) eos 
t))))))
       ;; Determine end invisible part of buffer (EOL)
       (beginning-of-line 2)
-      (while (and (not (eobp)) ;This is like `next-line'.
+      (while (and (not (eobp))         ;this is like `next-line'
                  (get-char-property (1- (point)) 'invisible))
        (goto-char (next-single-char-property-change (point) 'invisible))
        (and (eolp) (beginning-of-line 2)))
@@ -6465,18 +6524,15 @@ Use `\\[org-edit-special]' to edit table.el tables"))
 With `\\[universal-argument]' prefix ARG, switch to startup visibility.
 With a numeric prefix, show all headlines up to that level."
   (interactive "P")
-  (let ((org-cycle-include-plain-lists
-        (if (derived-mode-p 'org-mode) org-cycle-include-plain-lists nil)))
-    (cond
-     ((integerp arg)
-      (org-show-all '(headings blocks))
-      (outline-hide-sublevels arg)
-      (setq org-cycle-global-status 'contents))
-     ((equal arg '(4))
-      (org-set-startup-visibility)
-      (org-unlogged-message "Startup visibility, plus VISIBILITY properties."))
-     (t
-      (org-cycle '(4))))))
+  (cond
+   ((integerp arg)
+    (org-content arg)
+    (setq org-cycle-global-status 'contents))
+   ((equal arg '(4))
+    (org-set-startup-visibility)
+    (org-unlogged-message "Startup visibility, plus VISIBILITY properties."))
+   (t
+    (org-cycle '(4)))))
 
 (defun org-set-startup-visibility ()
   "Set the visibility required by startup options and properties."
@@ -6524,51 +6580,60 @@ With a numeric prefix, show all headlines up to that 
level."
            (org-end-of-subtree)))))))
 
 (defun org-overview ()
-  "Switch to overview mode, showing only top-level headlines.
-This shows all headlines with a level equal or greater than the level
-of the first headline in the buffer.  This is important, because if the
-first headline is not level one, then (hide-sublevels 1) gives confusing
-results."
+  "Switch to overview mode, showing only top-level headlines."
   (interactive)
+  (org-show-all '(headings drawers))
   (save-excursion
-    (let ((level
-          (save-excursion
-            (goto-char (point-min))
-            (when (re-search-forward org-outline-regexp-bol nil t)
-              (goto-char (match-beginning 0))
-              (funcall outline-level)))))
-      (and level (outline-hide-sublevels level)))))
+    (goto-char (point-min))
+    (when (re-search-forward org-outline-regexp-bol nil t)
+      (let* ((last (line-end-position))
+             (level (- (match-end 0) (match-beginning 0) 1))
+             (regexp (format "^\\*\\{1,%d\\} " level)))
+        (while (re-search-forward regexp nil :move)
+          (org-flag-region last (line-end-position 0) t 'outline)
+          (setq last (line-end-position))
+          (setq level (- (match-end 0) (match-beginning 0) 1))
+          (setq regexp (format "^\\*\\{1,%d\\} " level)))
+        (org-flag-region last (point) t 'outline)))))
 
 (defun org-content (&optional arg)
   "Show all headlines in the buffer, like a table of contents.
 With numerical argument N, show content up to level N."
-  (interactive "P")
-  (org-overview)
+  (interactive "p")
+  (org-show-all '(headings drawers))
   (save-excursion
-    ;; Visit all headings and show their offspring
-    (and (integerp arg) (org-overview))
     (goto-char (point-max))
-    (catch 'exit
-      (while (and (progn (condition-case nil
-                            (outline-previous-visible-heading 1)
-                          (error (goto-char (point-min))))
-                        t)
-                 (looking-at org-outline-regexp))
-       (if (integerp arg)
-           (org-show-children (1- arg))
-         (outline-show-branches))
-       (when (bobp) (throw 'exit nil))))))
-
+    (let ((regexp (if (and (wholenump arg) (> arg 0))
+                      (format "^\\*\\{1,%d\\} " arg)
+                    "^\\*+ "))
+          (last (point)))
+      (while (re-search-backward regexp nil t)
+        (org-flag-region (line-end-position) last t 'outline)
+        (setq last (line-end-position 0))))))
+
+(defvar org-scroll-position-to-restore nil
+  "Temporarily store scroll position to restore.")
 (defun org-optimize-window-after-visibility-change (state)
   "Adjust the window after a change in outline visibility.
 This function is the default value of the hook `org-cycle-hook'."
   (when (get-buffer-window (current-buffer))
-    (cond
-     ((eq state 'content)  nil)
-     ((eq state 'all)      nil)
-     ((eq state 'folded)   nil)
-     ((eq state 'children) (or (org-subtree-end-visible-p) (recenter 1)))
-     ((eq state 'subtree)  (or (org-subtree-end-visible-p) (recenter 1))))))
+    (let ((repeat (eq last-command this-command)))
+      (unless repeat
+       (setq org-scroll-position-to-restore nil))
+      (cond
+       ((eq state 'content)  nil)
+       ((eq state 'all)      nil)
+       ((and org-scroll-position-to-restore repeat
+            (eq state 'folded))
+       (set-window-start nil org-scroll-position-to-restore))
+       ((eq state 'folded) nil)
+       ((eq state 'children)
+       (setq org-scroll-position-to-restore (window-start))
+       (or (org-subtree-end-visible-p) (recenter 1)))
+       ((eq state 'subtree)
+       (unless repeat
+         (setq org-scroll-position-to-restore (window-start)))
+       (or (org-subtree-end-visible-p) (recenter 1)))))))
 
 (defun org-clean-visibility-after-subtree-move ()
   "Fix visibility issues after moving a subtree."
@@ -6669,8 +6734,7 @@ information."
     ;; If point is hidden within a drawer or a block, make sure to
     ;; expose it.
     (dolist (o (overlays-at (point)))
-      (when (memq (overlay-get o 'invisible)
-                 '(org-hide-block org-hide-drawer outline))
+      (when (memq (overlay-get o 'invisible) '(org-hide-block outline))
        (delete-overlay o)))
     (unless (org-before-first-heading-p)
       (org-with-limited-levels
@@ -6783,7 +6847,7 @@ frame is not changed."
       (pop-to-buffer ibuf))
      (t (error "Invalid value")))
     (narrow-to-region beg end)
-    (org-show-all '(headings blocks))
+    (org-show-all '(headings drawers blocks))
     (goto-char pos)
     (run-hook-with-args 'org-cycle-hook 'all)
     (and (window-live-p cwin) (select-window cwin))))
@@ -6810,27 +6874,6 @@ frame is not changed."
 
 ;;; Inserting headlines
 
-(defun org--line-empty-p (n)
-  "Is the Nth next line empty?
-
-Counts the current line as N = 1 and the previous line as N = 0;
-see `beginning-of-line'."
-  (save-excursion
-    (and (not (bobp))
-        (or (beginning-of-line n) t)
-        (save-match-data
-          (looking-at "[ \t]*$")))))
-
-(defun org-previous-line-empty-p ()
-  "Is the previous line a blank line?
-When NEXT is non-nil, check the next line instead."
-  (org--line-empty-p 0))
-
-(defun org-next-line-empty-p ()
-  "Is the previous line a blank line?
-When NEXT is non-nil, check the next line instead."
-  (org--line-empty-p 2))
-
 (defun org--blank-before-heading-p (&optional parent)
   "Non-nil when an empty line should precede a new heading here.
 When optional argument PARENT is non-nil, consider parent
@@ -7342,9 +7385,17 @@ Assume point is at a heading or an inlinetask beginning."
    (when (looking-at org-property-drawer-re)
      (goto-char (match-end 0))
      (forward-line)
-     (save-excursion (org-indent-region (match-beginning 0) (match-end 0))))
+     (org-indent-region (match-beginning 0) (match-end 0)))
+   (when (looking-at org-logbook-drawer-re)
+     (let ((end-marker  (move-marker (make-marker) (match-end 0)))
+          (col (+ (current-indentation) diff)))
+       (when (wholenump col)
+        (while (< (point) end-marker)
+          (indent-line-to col)
+          (forward-line)))))
    (catch 'no-shift
-     (when (zerop diff) (throw 'no-shift nil))
+     (when (or (zerop diff) (not (eq org-adapt-indentation t)))
+       (throw 'no-shift nil))
      ;; If DIFF is negative, first check if a shift is possible at all
      ;; (e.g., it doesn't break structure).  This can only happen if
      ;; some contents are not properly indented.
@@ -7759,8 +7810,9 @@ If yes, remember the marker and the distance to BEG."
   "Narrow to the subtree at point or widen a narrowed buffer."
   (interactive)
   (if (buffer-narrowed-p)
-      (widen)
-    (org-narrow-to-subtree)))
+      (progn (widen) (message "Buffer widen"))
+    (org-narrow-to-subtree)
+    (message "Buffer narrowed to current subtree")))
 
 (defun org-narrow-to-block ()
   "Narrow buffer to the current block."
@@ -7841,7 +7893,8 @@ with the original repeater."
           (nmin 1)
           (nmax n)
           (n-no-remove -1)
-          (idprop (org-entry-get nil "ID")))
+          (org-id-overriding-file-name (buffer-file-name (buffer-base-buffer)))
+          (idprop (org-entry-get beg "ID")))
       (when (and doshift
                 (string-match-p "<[^<>\n]+ [.+]?\\+[0-9]+[hdwmy][^<>\n]*>"
                                 template))
@@ -7883,6 +7936,131 @@ with the original repeater."
                  (buffer-string)))))
     (goto-char beg)))
 
+;;; Outline path
+
+(defvar org-outline-path-cache nil
+  "Alist between buffer positions and outline paths.
+It value is an alist (POSITION . PATH) where POSITION is the
+buffer position at the beginning of an entry and PATH is a list
+of strings describing the outline path for that entry, in reverse
+order.")
+
+(defun org--get-outline-path-1 (&optional use-cache)
+  "Return outline path to current headline.
+
+Outline path is a list of strings, in reverse order.  When
+optional argument USE-CACHE is non-nil, make use of a cache.  See
+`org-get-outline-path' for details.
+
+Assume buffer is widened and point is on a headline."
+  (or (and use-cache (cdr (assq (point) org-outline-path-cache)))
+      (let ((p (point))
+           (heading (let ((case-fold-search nil))
+                      (looking-at org-complex-heading-regexp)
+                      (if (not (match-end 4)) ""
+                        ;; Remove statistics cookies.
+                        (org-trim
+                         (org-link-display-format
+                          (replace-regexp-in-string
+                           "\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" ""
+                           (match-string-no-properties 4))))))))
+       (if (org-up-heading-safe)
+           (let ((path (cons heading (org--get-outline-path-1 use-cache))))
+             (when use-cache
+               (push (cons p path) org-outline-path-cache))
+             path)
+         ;; This is a new root node.  Since we assume we are moving
+         ;; forward, we can drop previous cache so as to limit number
+         ;; of associations there.
+         (let ((path (list heading)))
+           (when use-cache (setq org-outline-path-cache (list (cons p path))))
+           path)))))
+
+(defun org-get-outline-path (&optional with-self use-cache)
+  "Return the outline path to the current entry.
+
+An outline path is a list of ancestors for current headline, as
+a list of strings.  Statistics cookies are removed and links are
+replaced with their description, if any, or their path otherwise.
+
+When optional argument WITH-SELF is non-nil, the path also
+includes the current headline.
+
+When optional argument USE-CACHE is non-nil, cache outline paths
+between calls to this function so as to avoid backtracking.  This
+argument is useful when planning to find more than one outline
+path in the same document.  In that case, there are two
+conditions to satisfy:
+  - `org-outline-path-cache' is set to nil before starting the
+    process;
+  - outline paths are computed by increasing buffer positions."
+  (org-with-wide-buffer
+   (and (or (and with-self (org-back-to-heading t))
+           (org-up-heading-safe))
+       (reverse (org--get-outline-path-1 use-cache)))))
+
+(defun org-format-outline-path (path &optional width prefix separator)
+  "Format the outline path PATH for display.
+WIDTH is the maximum number of characters that is available.
+PREFIX is a prefix to be included in the returned string,
+such as the file name.
+SEPARATOR is inserted between the different parts of the path,
+the default is \"/\"."
+  (setq width (or width 79))
+  (setq path (delq nil path))
+  (unless (> width 0)
+    (user-error "Argument `width' must be positive"))
+  (setq separator (or separator "/"))
+  (let* ((org-odd-levels-only nil)
+        (fpath (concat
+                prefix (and prefix path separator)
+                (mapconcat
+                 (lambda (s) (replace-regexp-in-string "[ \t]+\\'" "" s))
+                 (cl-loop for head in path
+                          for n from 0
+                          collect (org-add-props
+                                      head nil 'face
+                                      (nth (% n org-n-level-faces) 
org-level-faces)))
+                 separator))))
+    (when (> (length fpath) width)
+      (if (< width 7)
+         ;; It's unlikely that `width' will be this small, but don't
+         ;; waste characters by adding ".." if it is.
+         (setq fpath (substring fpath 0 width))
+       (setf (substring fpath (- width 2)) "..")))
+    fpath))
+
+(defun org-display-outline-path (&optional file current separator 
just-return-string)
+  "Display the current outline path in the echo area.
+
+If FILE is non-nil, prepend the output with the file name.
+If CURRENT is non-nil, append the current heading to the output.
+SEPARATOR is passed through to `org-format-outline-path'.  It separates
+the different parts of the path and defaults to \"/\".
+If JUST-RETURN-STRING is non-nil, return a string, don't display a message."
+  (interactive "P")
+  (let* (case-fold-search
+        (bfn (buffer-file-name (buffer-base-buffer)))
+        (path (and (derived-mode-p 'org-mode) (org-get-outline-path)))
+        res)
+    (when current (setq path (append path
+                                    (save-excursion
+                                      (org-back-to-heading t)
+                                      (when (looking-at 
org-complex-heading-regexp)
+                                        (list (match-string 4)))))))
+    (setq res
+         (org-format-outline-path
+          path
+          (1- (frame-width))
+          (and file bfn (concat (file-name-nondirectory bfn) separator))
+          separator))
+    (add-face-text-property 0 (length res)
+                           `(:height ,(face-attribute 'default :height))
+                           nil res)
+    (if just-return-string
+       res
+      (org-unlogged-message "%s" res))))
+
 ;;; Outline Sorting
 
 (defun org-sort (&optional with-case)
@@ -7905,8 +8083,6 @@ Optional argument WITH-CASE means sort case-sensitively."
     (org-link-display-format s)
     t t) t t))
 
-(defvar org-priority-regexp) ; defined later in the file
-
 (defvar org-after-sorting-entries-or-items-hook nil
   "Hook that is run after a bunch of entries or items have been sorted.
 When children are sorted, the cursor is in the parent line when this
@@ -8000,7 +8176,7 @@ function is being called interactively."
       (setq end (point-max))
       (setq what "top-level")
       (goto-char start)
-      (org-show-all '(headings blocks))))
+      (org-show-all '(headings drawers blocks))))
 
     (setq beg (point))
     (when (>= beg end) (goto-char start) (user-error "Nothing to sort"))
@@ -8110,7 +8286,7 @@ function is being called interactively."
             ((= dcst ?p)
              (if (re-search-forward org-priority-regexp (point-at-eol) t)
                  (string-to-char (match-string 2))
-               org-default-priority))
+               org-priority-default))
             ((= dcst ?r)
              (or (org-entry-get nil property) ""))
             ((= dcst ?o)
@@ -8267,13 +8443,14 @@ the value of the drawer property."
         (inhibit-read-only t)
         (inherit? (org-property-inherit-p dprop))
         (property-re (org-re-property (concat (regexp-quote dprop) "\\+?") t))
-        (global (and inherit? (org--property-global-value dprop nil))))
+        (global-or-keyword (and inherit?
+                                (org--property-global-or-keyword-value dprop 
nil))))
     (with-silent-modifications
       (org-with-point-at 1
-       ;; Set global values (e.g., values defined through
-       ;; "#+PROPERTY:" keywords) to the whole buffer.
-       (when global (put-text-property (point-min) (point-max) tprop global))
-       ;; Set local values.
+       ;; Set global and keyword based values to the whole buffer.
+       (when global-or-keyword
+         (put-text-property (point-min) (point-max) tprop global-or-keyword))
+       ;; Set values based on property-drawers throughout the document.
        (while (re-search-forward property-re nil t)
          (when (org-at-property-p)
            (org-refresh-property tprop (org-entry-get (point) dprop) inherit?))
@@ -8281,21 +8458,30 @@ the value of the drawer property."
 
 (defun org-refresh-property (tprop p &optional inherit)
   "Refresh the buffer text property TPROP from the drawer property P.
-The refresh happens only for the current headline, or the whole
-sub-tree if optional argument INHERIT is non-nil."
-  (unless (org-before-first-heading-p)
-    (save-excursion
-      (org-back-to-heading t)
-      (let ((start (point))
-           (end (save-excursion
-                  (if inherit (org-end-of-subtree t t)
-                    (or (outline-next-heading) (point-max))))))
-       (if (symbolp tprop)
-           ;; TPROP is a text property symbol.
-           (put-text-property start end tprop p)
-         ;; TPROP is an alist with (property . function) elements.
-         (pcase-dolist (`(,prop . ,f) tprop)
-           (put-text-property start end prop (funcall f p))))))))
+
+The refresh happens only for the current entry, or the whole
+sub-tree if optional argument INHERIT is non-nil.
+
+If point is before first headline, the function applies to the
+part before the first headline.  In that particular case, when
+optional argument INHERIT is non-nil, it refreshes properties for
+the whole buffer."
+  (save-excursion
+    (org-back-to-heading-or-point-min t)
+    (let ((start (point))
+         (end (save-excursion
+                (cond ((and inherit (org-before-first-heading-p))
+                       (point-max))
+                      (inherit
+                       (org-end-of-subtree t t))
+                      ((outline-next-heading))
+                      ((point-max))))))
+      (if (symbolp tprop)
+         ;; TPROP is a text property symbol.
+         (put-text-property start end tprop p)
+       ;; TPROP is an alist with (property . function) elements.
+       (pcase-dolist (`(,prop . ,f) tprop)
+         (put-text-property start end prop (funcall f p)))))))
 
 (defun org-refresh-category-properties ()
   "Refresh category text properties in the buffer."
@@ -8311,9 +8497,9 @@ sub-tree if optional argument INHERIT is non-nil."
                (t org-category))))
     (with-silent-modifications
       (org-with-wide-buffer
-       ;; Set buffer-wide category.  Search last #+CATEGORY keyword.
-       ;; This is the default category for the buffer.  If none is
-       ;; found, fall-back to `org-category' or buffer file name.
+       ;; Set buffer-wide property from keyword.  Search last #+CATEGORY
+       ;; keyword.  If none is found, fall-back to `org-category' or
+       ;; buffer file name, or set it by the document property drawer.
        (put-text-property
        (point-min) (point-max)
        'org-category
@@ -8325,15 +8511,20 @@ sub-tree if optional argument INHERIT is non-nil."
                (throw 'buffer-category
                       (org-element-property :value element)))))
          default-category))
-       ;; Set sub-tree specific categories.
+       ;; Set categories from the document property drawer or
+       ;; property drawers in the outline.  If category is found in
+       ;; the property drawer for the whole buffer that value
+       ;; overrides the keyword-based value set above.
        (goto-char (point-min))
        (let ((regexp (org-re-property "CATEGORY")))
         (while (re-search-forward regexp nil t)
           (let ((value (match-string-no-properties 3)))
             (when (org-at-property-p)
               (put-text-property
-               (save-excursion (org-back-to-heading t) (point))
-               (save-excursion (org-end-of-subtree t t) (point))
+               (save-excursion (org-back-to-heading-or-point-min t))
+               (save-excursion (if (org-before-first-heading-p)
+                                   (point-max)
+                                 (org-end-of-subtree t t)))
                'org-category
                value)))))))))
 
@@ -8657,31 +8848,30 @@ a link."
        ;; a link, a footnote reference.
        ((memq type '(headline inlinetask))
        (org-match-line org-complex-heading-regexp)
-       (if (and (match-beginning 5)
-                (>= (point) (match-beginning 5))
-                (< (point) (match-end 5)))
-           ;; On tags.
-           (org-tags-view
-            arg
-            (save-excursion
-              (let* ((beg (match-beginning 5))
-                     (end (match-end 5))
-                     (beg-tag (or (search-backward ":" beg 'at-limit) (point)))
-                     (end-tag (search-forward ":" end nil 2)))
-                (buffer-substring (1+ beg-tag) (1- end-tag)))))
-         ;; Not on tags.
-         (pcase (org-offer-links-in-entry (current-buffer) (point) arg)
-           (`(nil . ,_)
-            (require 'org-attach)
-            (message "Opening attachment-dir")
-            (if (equal arg '(4))
-                (org-attach-reveal-in-emacs)
-              (org-attach-reveal)))
-           (`(,links . ,links-end)
-            (dolist (link (if (stringp links) (list links) links))
-              (search-forward link nil links-end)
-              (goto-char (match-beginning 0))
-              (org-open-at-point arg))))))
+       (let ((tags-beg (match-beginning 5))
+             (tags-end (match-end 5)))
+         (if (and tags-beg (>= (point) tags-beg) (< (point) tags-end))
+             ;; On tags.
+             (org-tags-view
+              arg
+              (save-excursion
+                (let* ((beg-tag (or (search-backward ":" tags-beg 'at-limit) 
(point)))
+                       (end-tag (search-forward ":" tags-end nil 2)))
+                  (buffer-substring (1+ beg-tag) (1- end-tag)))))
+           ;; Not on tags.
+           (pcase (org-offer-links-in-entry (current-buffer) (point) arg)
+             (`(nil . ,_)
+              (require 'org-attach)
+              (when (org-attach-dir)
+                (message "Opening attachment")
+                (if (equal arg '(4))
+                    (org-attach-reveal-in-emacs)
+                  (org-attach-reveal))))
+             (`(,links . ,links-end)
+              (dolist (link (if (stringp links) (list links) links))
+                (search-forward link nil links-end)
+                (goto-char (match-beginning 0))
+                (org-open-at-point arg)))))))
        ;; On a footnote reference or at definition's label.
        ((or (eq type 'footnote-reference)
            (and (eq type 'footnote-definition)
@@ -8901,639 +9091,10 @@ or to another Org file, automatically push the old 
position onto the ring."
           (when (string-match (car entry) buffer-file-name)
            (throw 'exit (cdr entry))))))))
 
-(defvar org-refile-target-table nil
-  "The list of refile targets, created by `org-refile'.")
-
 (defvar org-agenda-new-buffers nil
   "Buffers created to visit agenda files.")
 
-(defvar org-refile-cache nil
-  "Cache for refile targets.")
-
-(defvar org-refile-markers nil
-  "All the markers used for caching refile locations.")
-
-(defun org-refile-marker (pos)
-  "Get a new refile marker, but only if caching is in use."
-  (if (not org-refile-use-cache)
-      pos
-    (let ((m (make-marker)))
-      (move-marker m pos)
-      (push m org-refile-markers)
-      m)))
-
-(defun org-refile-cache-clear ()
-  "Clear the refile cache and disable all the markers."
-  (dolist (m org-refile-markers) (move-marker m nil))
-  (setq org-refile-markers nil)
-  (setq org-refile-cache nil)
-  (message "Refile cache has been cleared"))
-
-(defun org-refile-cache-check-set (set)
-  "Check if all the markers in the cache still have live buffers."
-  (let (marker)
-    (catch 'exit
-      (while (and set (setq marker (nth 3 (pop set))))
-       ;; If `org-refile-use-outline-path' is 'file, marker may be nil
-       (when (and marker (null (marker-buffer marker)))
-         (message "Please regenerate the refile cache with `C-0 C-c C-w'")
-         (sit-for 3)
-         (throw 'exit nil)))
-      t)))
-
-(defun org-refile-cache-put (set &rest identifiers)
-  "Push the refile targets SET into the cache, under IDENTIFIERS."
-  (let* ((key (sha1 (prin1-to-string identifiers)))
-        (entry (assoc key org-refile-cache)))
-    (if entry
-       (setcdr entry set)
-      (push (cons key set) org-refile-cache))))
-
-(defun org-refile-cache-get (&rest identifiers)
-  "Retrieve the cached value for refile targets given by IDENTIFIERS."
-  (cond
-   ((not org-refile-cache) nil)
-   ((not org-refile-use-cache) (org-refile-cache-clear) nil)
-   (t
-    (let ((set (cdr (assoc (sha1 (prin1-to-string identifiers))
-                          org-refile-cache))))
-      (and set (org-refile-cache-check-set set) set)))))
-
-(defvar org-outline-path-cache nil
-  "Alist between buffer positions and outline paths.
-It value is an alist (POSITION . PATH) where POSITION is the
-buffer position at the beginning of an entry and PATH is a list
-of strings describing the outline path for that entry, in reverse
-order.")
-
-(defun org-refile-get-targets (&optional default-buffer)
-  "Produce a table with refile targets."
-  (let ((case-fold-search nil)
-       ;; otherwise org confuses "TODO" as a kw and "Todo" as a word
-       (entries (or org-refile-targets '((nil . (:level . 1)))))
-       targets tgs files desc descre)
-    (message "Getting targets...")
-    (with-current-buffer (or default-buffer (current-buffer))
-      (dolist (entry entries)
-       (setq files (car entry) desc (cdr entry))
-       (cond
-        ((null files) (setq files (list (current-buffer))))
-        ((eq files 'org-agenda-files)
-         (setq files (org-agenda-files 'unrestricted)))
-        ((and (symbolp files) (fboundp files))
-         (setq files (funcall files)))
-        ((and (symbolp files) (boundp files))
-         (setq files (symbol-value files))))
-       (when (stringp files) (setq files (list files)))
-       (cond
-        ((eq (car desc) :tag)
-         (setq descre (concat "^\\*+[ \t]+.*?:" (regexp-quote (cdr desc)) 
":")))
-        ((eq (car desc) :todo)
-         (setq descre (concat "^\\*+[ \t]+" (regexp-quote (cdr desc)) "[ 
\t]")))
-        ((eq (car desc) :regexp)
-         (setq descre (cdr desc)))
-        ((eq (car desc) :level)
-         (setq descre (concat "^\\*\\{" (number-to-string
-                                         (if org-odd-levels-only
-                                             (1- (* 2 (cdr desc)))
-                                           (cdr desc)))
-                              "\\}[ \t]")))
-        ((eq (car desc) :maxlevel)
-         (setq descre (concat "^\\*\\{1," (number-to-string
-                                           (if org-odd-levels-only
-                                               (1- (* 2 (cdr desc)))
-                                             (cdr desc)))
-                              "\\}[ \t]")))
-        (t (error "Bad refiling target description %s" desc)))
-       (dolist (f files)
-         (with-current-buffer (if (bufferp f) f (org-get-agenda-file-buffer f))
-           (or
-            (setq tgs (org-refile-cache-get (buffer-file-name) descre))
-            (progn
-              (when (bufferp f)
-                (setq f (buffer-file-name (buffer-base-buffer f))))
-              (setq f (and f (expand-file-name f)))
-              (when (eq org-refile-use-outline-path 'file)
-                (push (list (file-name-nondirectory f) f nil nil) tgs))
-              (when (eq org-refile-use-outline-path 'buffer-name)
-                (push (list (buffer-name (buffer-base-buffer)) f nil nil) tgs))
-              (when (eq org-refile-use-outline-path 'full-file-path)
-                (push (list (file-truename (buffer-file-name 
(buffer-base-buffer))) f nil nil) tgs))
-              (org-with-wide-buffer
-               (goto-char (point-min))
-               (setq org-outline-path-cache nil)
-               (while (re-search-forward descre nil t)
-                 (beginning-of-line)
-                 (let ((case-fold-search nil))
-                   (looking-at org-complex-heading-regexp))
-                 (let ((begin (point))
-                       (heading (match-string-no-properties 4)))
-                   (unless (or (and
-                                org-refile-target-verify-function
-                                (not
-                                 (funcall org-refile-target-verify-function)))
-                               (not heading))
-                     (let ((re (format org-complex-heading-regexp-format
-                                       (regexp-quote heading)))
-                           (target
-                            (if (not org-refile-use-outline-path) heading
-                              (mapconcat
-                               #'identity
-                               (append
-                                (pcase org-refile-use-outline-path
-                                  (`file (list (file-name-nondirectory
-                                                (buffer-file-name
-                                                 (buffer-base-buffer)))))
-                                  (`full-file-path
-                                   (list (buffer-file-name
-                                          (buffer-base-buffer))))
-                                  (`buffer-name
-                                   (list (buffer-name
-                                          (buffer-base-buffer))))
-                                  (_ nil))
-                                (mapcar (lambda (s) (replace-regexp-in-string
-                                                     "/" "\\/" s nil t))
-                                        (org-get-outline-path t t)))
-                               "/"))))
-                       (push (list target f re (org-refile-marker (point)))
-                             tgs)))
-                   (when (= (point) begin)
-                     ;; Verification function has not moved point.
-                     (end-of-line)))))))
-           (when org-refile-use-cache
-             (org-refile-cache-put tgs (buffer-file-name) descre))
-           (setq targets (append tgs targets))))))
-    (message "Getting targets...done")
-    (delete-dups (nreverse targets))))
-
-(defun org--get-outline-path-1 (&optional use-cache)
-  "Return outline path to current headline.
-
-Outline path is a list of strings, in reverse order.  When
-optional argument USE-CACHE is non-nil, make use of a cache.  See
-`org-get-outline-path' for details.
-
-Assume buffer is widened and point is on a headline."
-  (or (and use-cache (cdr (assq (point) org-outline-path-cache)))
-      (let ((p (point))
-           (heading (let ((case-fold-search nil))
-                      (looking-at org-complex-heading-regexp)
-                      (if (not (match-end 4)) ""
-                        ;; Remove statistics cookies.
-                        (org-trim
-                         (org-link-display-format
-                          (replace-regexp-in-string
-                           "\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" ""
-                           (match-string-no-properties 4))))))))
-       (if (org-up-heading-safe)
-           (let ((path (cons heading (org--get-outline-path-1 use-cache))))
-             (when use-cache
-               (push (cons p path) org-outline-path-cache))
-             path)
-         ;; This is a new root node.  Since we assume we are moving
-         ;; forward, we can drop previous cache so as to limit number
-         ;; of associations there.
-         (let ((path (list heading)))
-           (when use-cache (setq org-outline-path-cache (list (cons p path))))
-           path)))))
-
-(defun org-get-outline-path (&optional with-self use-cache)
-  "Return the outline path to the current entry.
-
-An outline path is a list of ancestors for current headline, as
-a list of strings.  Statistics cookies are removed and links are
-replaced with their description, if any, or their path otherwise.
-
-When optional argument WITH-SELF is non-nil, the path also
-includes the current headline.
-
-When optional argument USE-CACHE is non-nil, cache outline paths
-between calls to this function so as to avoid backtracking.  This
-argument is useful when planning to find more than one outline
-path in the same document.  In that case, there are two
-conditions to satisfy:
-  - `org-outline-path-cache' is set to nil before starting the
-    process;
-  - outline paths are computed by increasing buffer positions."
-  (org-with-wide-buffer
-   (and (or (and with-self (org-back-to-heading t))
-           (org-up-heading-safe))
-       (reverse (org--get-outline-path-1 use-cache)))))
-
-(defun org-format-outline-path (path &optional width prefix separator)
-  "Format the outline path PATH for display.
-WIDTH is the maximum number of characters that is available.
-PREFIX is a prefix to be included in the returned string,
-such as the file name.
-SEPARATOR is inserted between the different parts of the path,
-the default is \"/\"."
-  (setq width (or width 79))
-  (setq path (delq nil path))
-  (unless (> width 0)
-    (user-error "Argument `width' must be positive"))
-  (setq separator (or separator "/"))
-  (let* ((org-odd-levels-only nil)
-        (fpath (concat
-                prefix (and prefix path separator)
-                (mapconcat
-                 (lambda (s) (replace-regexp-in-string "[ \t]+\\'" "" s))
-                 (cl-loop for head in path
-                          for n from 0
-                          collect (org-add-props
-                                      head nil 'face
-                                      (nth (% n org-n-level-faces) 
org-level-faces)))
-                 separator))))
-    (when (> (length fpath) width)
-      (if (< width 7)
-         ;; It's unlikely that `width' will be this small, but don't
-         ;; waste characters by adding ".." if it is.
-         (setq fpath (substring fpath 0 width))
-       (setf (substring fpath (- width 2)) "..")))
-    fpath))
-
-(defun org-display-outline-path (&optional file current separator 
just-return-string)
-  "Display the current outline path in the echo area.
-
-If FILE is non-nil, prepend the output with the file name.
-If CURRENT is non-nil, append the current heading to the output.
-SEPARATOR is passed through to `org-format-outline-path'.  It separates
-the different parts of the path and defaults to \"/\".
-If JUST-RETURN-STRING is non-nil, return a string, don't display a message."
-  (interactive "P")
-  (let* (case-fold-search
-        (bfn (buffer-file-name (buffer-base-buffer)))
-        (path (and (derived-mode-p 'org-mode) (org-get-outline-path)))
-        res)
-    (when current (setq path (append path
-                                    (save-excursion
-                                      (org-back-to-heading t)
-                                      (when (looking-at 
org-complex-heading-regexp)
-                                        (list (match-string 4)))))))
-    (setq res
-         (org-format-outline-path
-          path
-          (1- (frame-width))
-          (and file bfn (concat (file-name-nondirectory bfn) separator))
-          separator))
-    (if just-return-string
-       (org-no-properties res)
-      (org-unlogged-message "%s" res))))
-
-(defvar org-refile-history nil
-  "History for refiling operations.")
-
-(defvar org-after-refile-insert-hook nil
-  "Hook run after `org-refile' has inserted its stuff at the new location.
-Note that this is still *before* the stuff will be removed from
-the *old* location.")
-
-(defvar org-capture-last-stored-marker)
-(defvar org-refile-keep nil
-  "Non-nil means `org-refile' will copy instead of refile.")
-
-(defun org-copy ()
-  "Like `org-refile', but copy."
-  (interactive)
-  (let ((org-refile-keep t))
-    (org-refile nil nil nil "Copy")))
-
-(defun org-refile (&optional arg default-buffer rfloc msg)
-  "Move the entry or entries at point to another heading.
-
-The list of target headings is compiled using the information in
-`org-refile-targets', which see.
-
-At the target location, the entry is filed as a subitem of the
-target heading.  Depending on `org-reverse-note-order', the new
-subitem will either be the first or the last subitem.
-
-If there is an active region, all entries in that region will be
-refiled.  However, the region must fulfill the requirement that
-the first heading sets the top-level of the moved text.
-
-With a `\\[universal-argument]' ARG, the command will only visit the target \
-location
-and not actually move anything.
-
-With a prefix `\\[universal-argument] \\[universal-argument]', go to the \
-location where the last
-refiling operation has put the subtree.
-
-With a numeric prefix argument of `2', refile to the running clock.
-
-With a numeric prefix argument of `3', emulate `org-refile-keep'
-being set to t and copy to the target location, don't move it.
-Beware that keeping refiled entries may result in duplicated ID
-properties.
-
-RFLOC can be a refile location obtained in a different way.
-
-MSG is a string to replace \"Refile\" in the default prompt with
-another verb.  E.g. `org-copy' sets this parameter to \"Copy\".
-
-See also `org-refile-use-outline-path'.
-
-If you are using target caching (see `org-refile-use-cache'), you
-have to clear the target cache in order to find new targets.
-This can be done with a `0' prefix (`C-0 C-c C-w') or a triple
-prefix argument (`C-u C-u C-u C-c C-w')."
-  (interactive "P")
-  (if (member arg '(0 (64)))
-      (org-refile-cache-clear)
-    (let* ((actionmsg (cond (msg msg)
-                           ((equal arg 3) "Refile (and keep)")
-                           (t "Refile")))
-          (regionp (org-region-active-p))
-          (region-start (and regionp (region-beginning)))
-          (region-end (and regionp (region-end)))
-          (org-refile-keep (if (equal arg 3) t org-refile-keep))
-          pos it nbuf file level reversed)
-      (setq last-command nil)
-      (when regionp
-       (goto-char region-start)
-       (beginning-of-line)
-       (setq region-start (point))
-       (unless (or (org-kill-is-subtree-p
-                    (buffer-substring region-start region-end))
-                   (prog1 org-refile-active-region-within-subtree
-                     (let ((s (point-at-eol)))
-                       (org-toggle-heading)
-                       (setq region-end (+ (- (point-at-eol) s) region-end)))))
-         (user-error "The region is not a (sequence of) subtree(s)")))
-      (if (equal arg '(16))
-         (org-refile-goto-last-stored)
-       (when (or
-              (and (equal arg 2)
-                   org-clock-hd-marker (marker-buffer org-clock-hd-marker)
-                   (prog1
-                       (setq it (list (or org-clock-heading "running clock")
-                                      (buffer-file-name
-                                       (marker-buffer org-clock-hd-marker))
-                                      ""
-                                      (marker-position org-clock-hd-marker)))
-                     (setq arg nil)))
-              (setq it
-                    (or rfloc
-                        (let (heading-text)
-                          (save-excursion
-                            (unless (and arg (listp arg))
-                              (org-back-to-heading t)
-                              (setq heading-text
-                                    (replace-regexp-in-string
-                                     org-link-bracket-re
-                                     "\\2"
-                                     (or (nth 4 (org-heading-components))
-                                         ""))))
-                            (org-refile-get-location
-                             (cond ((and arg (listp arg)) "Goto")
-                                   (regionp (concat actionmsg " region to"))
-                                   (t (concat actionmsg " subtree \""
-                                              heading-text "\" to")))
-                             default-buffer
-                             (and (not (equal '(4) arg))
-                                  org-refile-allow-creating-parent-nodes)))))))
-         (setq file (nth 1 it)
-               pos (nth 3 it))
-         (when (and (not arg)
-                    pos
-                    (equal (buffer-file-name) file)
-                    (if regionp
-                        (and (>= pos region-start)
-                             (<= pos region-end))
-                      (and (>= pos (point))
-                           (< pos (save-excursion
-                                    (org-end-of-subtree t t))))))
-           (error "Cannot refile to position inside the tree or region"))
-         (setq nbuf (or (find-buffer-visiting file)
-                        (find-file-noselect file)))
-         (if (and arg (not (equal arg 3)))
-             (progn
-               (pop-to-buffer-same-window nbuf)
-               (goto-char (cond (pos)
-                                ((org-notes-order-reversed-p) (point-min))
-                                (t (point-max))))
-               (org-show-context 'org-goto))
-           (if regionp
-               (progn
-                 (org-kill-new (buffer-substring region-start region-end))
-                 (org-save-markers-in-region region-start region-end))
-             (org-copy-subtree 1 nil t))
-           (with-current-buffer (setq nbuf (or (find-buffer-visiting file)
-                                               (find-file-noselect file)))
-             (setq reversed (org-notes-order-reversed-p))
-             (org-with-wide-buffer
-              (if pos
-                  (progn
-                    (goto-char pos)
-                    (setq level (org-get-valid-level (funcall outline-level) 
1))
-                    (goto-char
-                     (if reversed
-                         (or (outline-next-heading) (point-max))
-                       (or (save-excursion (org-get-next-sibling))
-                           (org-end-of-subtree t t)
-                           (point-max)))))
-                (setq level 1)
-                (if (not reversed)
-                    (goto-char (point-max))
-                  (goto-char (point-min))
-                  (or (outline-next-heading) (goto-char (point-max)))))
-              (unless (bolp) (newline))
-              (org-paste-subtree level nil nil t)
-              ;; Record information, according to `org-log-refile'.
-              ;; Do not prompt for a note when refiling multiple
-              ;; headlines, however.  Simply add a time stamp.
-              (cond
-               ((not org-log-refile))
-               (regionp
-                (org-map-region
-                 (lambda () (org-add-log-setup 'refile nil nil 'time))
-                 (point)
-                 (+ (point) (- region-end region-start))))
-               (t
-                (org-add-log-setup 'refile nil nil org-log-refile)))
-              (and org-auto-align-tags
-                   (let ((org-loop-over-headlines-in-active-region nil))
-                     (org-align-tags)))
-              (let ((bookmark-name (plist-get org-bookmark-names-plist
-                                              :last-refile)))
-                (when bookmark-name
-                  (with-demoted-errors
-                      (bookmark-set bookmark-name))))
-              ;; If we are refiling for capture, make sure that the
-              ;; last-capture pointers point here
-              (when (bound-and-true-p org-capture-is-refiling)
-                (let ((bookmark-name (plist-get org-bookmark-names-plist
-                                                :last-capture-marker)))
-                  (when bookmark-name
-                    (with-demoted-errors
-                        (bookmark-set bookmark-name))))
-                (move-marker org-capture-last-stored-marker (point)))
-              (when (fboundp 'deactivate-mark) (deactivate-mark))
-              (run-hooks 'org-after-refile-insert-hook)))
-           (unless org-refile-keep
-             (if regionp
-                 (delete-region (point) (+ (point) (- region-end 
region-start)))
-               (org-preserve-local-variables
-                (delete-region
-                 (and (org-back-to-heading t) (point))
-                 (min (1+ (buffer-size)) (org-end-of-subtree t t) (point))))))
-           (when (featurep 'org-inlinetask)
-             (org-inlinetask-remove-END-maybe))
-           (setq org-markers-to-move nil)
-           (message "%s to \"%s\" in file %s: done" actionmsg
-                    (car it) file)))))))
-
-(defun org-refile-goto-last-stored ()
-  "Go to the location where the last refile was stored."
-  (interactive)
-  (bookmark-jump (plist-get org-bookmark-names-plist :last-refile))
-  (message "This is the location of the last refile"))
-
-(defun org-refile--get-location (refloc tbl)
-  "When user refile to REFLOC, find the associated target in TBL.
-Also check `org-refile-target-table'."
-  (car (delq
-       nil
-       (mapcar
-        (lambda (r) (or (assoc r tbl)
-                        (assoc r org-refile-target-table)))
-        (list (replace-regexp-in-string "/$" "" refloc)
-              (replace-regexp-in-string "\\([^/]\\)$" "\\1/" refloc))))))
-
-(defun org-refile-get-location (&optional prompt default-buffer new-nodes)
-  "Prompt the user for a refile location, using PROMPT.
-PROMPT should not be suffixed with a colon and a space, because
-this function appends the default value from
-`org-refile-history' automatically, if that is not empty."
-  (let ((org-refile-targets org-refile-targets)
-       (org-refile-use-outline-path org-refile-use-outline-path))
-    (setq org-refile-target-table (org-refile-get-targets default-buffer)))
-  (unless org-refile-target-table
-    (user-error "No refile targets"))
-  (let* ((cbuf (current-buffer))
-        (cfn (buffer-file-name (buffer-base-buffer cbuf)))
-        (cfunc (if (and org-refile-use-outline-path
-                        org-outline-path-complete-in-steps)
-                   #'org-olpath-completing-read
-                 #'completing-read))
-        (extra (if org-refile-use-outline-path "/" ""))
-        (cbnex (concat (buffer-name) extra))
-        (filename (and cfn (expand-file-name cfn)))
-        (tbl (mapcar
-              (lambda (x)
-                (if (and (not (member org-refile-use-outline-path
-                                      '(file full-file-path)))
-                         (not (equal filename (nth 1 x))))
-                    (cons (concat (car x) extra " ("
-                                  (file-name-nondirectory (nth 1 x)) ")")
-                          (cdr x))
-                  (cons (concat (car x) extra) (cdr x))))
-              org-refile-target-table))
-        (completion-ignore-case t)
-        cdef
-        (prompt (concat prompt
-                        (or (and (car org-refile-history)
-                                 (concat " (default " (car org-refile-history) 
")"))
-                            (and (assoc cbnex tbl) (setq cdef cbnex)
-                                 (concat " (default " cbnex ")"))) ": "))
-        pa answ parent-target child parent old-hist)
-    (setq old-hist org-refile-history)
-    (setq answ (funcall cfunc prompt tbl nil (not new-nodes)
-                       nil 'org-refile-history (or cdef (car 
org-refile-history))))
-    (if (setq pa (org-refile--get-location answ tbl))
-       (progn
-         (org-refile-check-position pa)
-         (when (or (not org-refile-history)
-                   (not (eq old-hist org-refile-history))
-                   (not (equal (car pa) (car org-refile-history))))
-           (setq org-refile-history
-                 (cons (car pa) (if (assoc (car org-refile-history) tbl)
-                                    org-refile-history
-                                  (cdr org-refile-history))))
-           (when (equal (car org-refile-history) (nth 1 org-refile-history))
-             (pop org-refile-history)))
-         pa)
-      (if (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ)
-         (progn
-           (setq parent (match-string 1 answ)
-                 child (match-string 2 answ))
-           (setq parent-target (org-refile--get-location parent tbl))
-           (when (and parent-target
-                      (or (eq new-nodes t)
-                          (and (eq new-nodes 'confirm)
-                               (y-or-n-p (format "Create new node \"%s\"? "
-                                                 child)))))
-             (org-refile-new-child parent-target child)))
-       (user-error "Invalid target location")))))
-
 (declare-function org-string-nw-p "org-macs" (s))
-(defun org-refile-check-position (refile-pointer)
-  "Check if the refile pointer matches the headline to which it points."
-  (let* ((file (nth 1 refile-pointer))
-        (re (nth 2 refile-pointer))
-        (pos (nth 3 refile-pointer))
-        buffer)
-    (if (and (not (markerp pos)) (not file))
-       (user-error "Please indicate a target file in the refile path")
-      (when (org-string-nw-p re)
-       (setq buffer (if (markerp pos)
-                        (marker-buffer pos)
-                      (or (find-buffer-visiting file)
-                          (find-file-noselect file))))
-       (with-current-buffer buffer
-         (org-with-wide-buffer
-          (goto-char pos)
-          (beginning-of-line 1)
-          (unless (looking-at-p re)
-            (user-error "Invalid refile position, please clear the cache with 
`C-0 C-c C-w' before refiling"))))))))
-
-(defun org-refile-new-child (parent-target child)
-  "Use refile target PARENT-TARGET to add new CHILD below it."
-  (unless parent-target
-    (error "Cannot find parent for new node"))
-  (let ((file (nth 1 parent-target))
-       (pos (nth 3 parent-target))
-       level)
-    (with-current-buffer (or (find-buffer-visiting file)
-                            (find-file-noselect file))
-      (org-with-wide-buffer
-       (if pos
-          (goto-char pos)
-        (goto-char (point-max))
-        (unless (bolp) (newline)))
-       (when (looking-at org-outline-regexp)
-        (setq level (funcall outline-level))
-        (org-end-of-subtree t t))
-       (org-back-over-empty-lines)
-       (insert "\n" (make-string
-                    (if pos (org-get-valid-level level 1) 1) ?*)
-              " " child "\n")
-       (beginning-of-line 0)
-       (list (concat (car parent-target) "/" child) file "" (point))))))
-
-(defun org-olpath-completing-read (prompt collection &rest args)
-  "Read an outline path like a file name."
-  (let ((thetable collection))
-    (apply #'completing-read
-          prompt
-          (lambda (string predicate &optional flag)
-            (cond
-             ((eq flag nil) (try-completion string thetable))
-             ((eq flag t)
-              (let ((l (length string)))
-                (mapcar (lambda (x)
-                          (let ((r (substring x l))
-                                (f (if (string-match " ([^)]*)$" x)
-                                       (match-string 0 x)
-                                     "")))
-                            (if (string-match "/" r)
-                                (concat string (substring r 0 (match-end 0)) f)
-                              x)))
-                        (all-completions string thetable predicate))))
-             ;; Exact match?
-             ((eq flag 'lambda) (assoc string thetable))))
-          args)))
-
 ;;;; Dynamic blocks
 
 (defun org-find-dblock (name)
@@ -9629,15 +9190,18 @@ block of such type."
     (`nil (push (cons type func) org-dynamic-block-alist))
     (def (setcdr def func))))
 
-(defun org-dynamic-block-insert-dblock (type)
+(defun org-dynamic-block-insert-dblock (type &optional interactive-p)
   "Insert a dynamic block of type TYPE.
 When used interactively, select the dynamic block types among
-defined types, per `org-dynamic-block-define'."
+defined types, per `org-dynamic-block-define'.  If INTERACTIVE-P
+is non-nil, call the dynamic block function interactively."
   (interactive (list (completing-read "Dynamic block: "
-                                     (org-dynamic-block-types))))
+                                     (org-dynamic-block-types))
+                    t))
   (pcase (org-dynamic-block-function type)
     (`nil (error "No such dynamic block: %S" type))
-    ((and f (pred functionp)) (funcall f))
+    ((and f (pred functionp))
+     (if interactive-p (call-interactively f) (funcall f)))
     (_ (error "Invalid function for dynamic block %S" type))))
 
 (defun org-dblock-update (&optional arg)
@@ -9761,8 +9325,7 @@ block can be inserted by pressing TAB after the string 
\"<KEY\"."
 (defun org--check-org-structure-template-alist (&optional checklist)
   "Check whether `org-structure-template-alist' is set up correctly.
 In particular, check if the Org 9.2 format is used as opposed to
-previous format.
-"
+previous format."
   (let ((elm (cl-remove-if-not (lambda (x) (listp (cdr x)))
                               (or (eval checklist)
                                   org-structure-template-alist))))
@@ -10037,9 +9600,9 @@ When called through ELisp, arg is also interpreted in 
the following way:
                    'region-start-level 'region))
            org-loop-over-headlines-in-active-region)
        (org-map-entries
-        `(org-todo ,arg)
-        org-loop-over-headlines-in-active-region
-        cl (when (org-invisible-p) (org-end-of-subtree nil t))))
+        (lambda () (org-todo arg))
+        nil cl
+        (when (org-invisible-p) (org-end-of-subtree nil t))))
     (when (equal arg '(16)) (setq arg 'nextset))
     (when (equal arg -1) (org-cancel-repeater) (setq arg nil))
     (let ((org-blocker-hook org-blocker-hook)
@@ -10156,7 +9719,7 @@ When called through ELisp, arg is also interpreted in 
the following way:
                    (throw 'exit nil)))))
            (store-match-data match-data)
            (replace-match next t t)
-           (cond ((equal this org-state)
+           (cond ((and org-state (equal this org-state))
                   (message "TODO state was already %s" (org-trim next)))
                  ((not (pos-visible-in-window-p hl-pos))
                   (message "TODO state changed to %s" (org-trim next))))
@@ -10532,8 +10095,7 @@ when there is a statistics cookie in the headline!
  (defun org-summary-todo (n-done n-not-done)
    \"Switch entry to DONE when all subentries are done, to TODO otherwise.\"
    (let (org-log-done org-log-states)   ; turn off logging
-     (org-todo (if (= n-not-done 0) \"DONE\" \"TODO\"))))
-")
+     (org-todo (if (= n-not-done 0) \"DONE\" \"TODO\"))))")
 
 (defvar org-todo-statistics-hook nil
   "Hook that is run whenever Org thinks TODO statistics should be updated.
@@ -10822,9 +10384,13 @@ This function is run automatically after each state 
change to a DONE state."
                        (repeater-type (match-string 1 ts)))
                    (cond
                     ((equal "." repeater-type)
-                     ;; Shift starting date to today.
-                     (org-timestamp-change (- (org-today) (time-to-days time))
-                                           'day))
+                     ;; Shift starting date to today, or now if
+                     ;; repeater is by hours.
+                     (if (equal what "h")
+                         (org-timestamp-change
+                          (floor (- (org-time-stamp-to-now ts t)) 60) 'minute)
+                       (org-timestamp-change
+                        (- (org-today) (time-to-days time)) 'day)))
                     ((equal "+" repeater-type)
                      (let ((nshiftmax 10)
                            (nshift 0))
@@ -10963,7 +10529,11 @@ TYPE is either `deadline' or `scheduled'.  See 
`org-deadline' or
                org-last-inserted-timestamp)))))
 
 (defun org-deadline (arg &optional time)
-  "Insert the \"DEADLINE:\" string with a timestamp to make a deadline.
+  "Insert a \"DEADLINE:\" string with a timestamp to make a deadline.
+
+When called interactively, this command pops up the Emacs calendar to let
+the user select a date.
+
 With one universal prefix argument, remove any deadline from the item.
 With two universal prefix arguments, prompt for a warning delay.
 With argument TIME, set the deadline at the corresponding date.  TIME
@@ -10980,7 +10550,11 @@ can either be an Org date like \"2011-07-24\" or a 
delta like \"+2d\"."
     (org--deadline-or-schedule arg 'deadline time)))
 
 (defun org-schedule (arg &optional time)
-  "Insert the SCHEDULED: string with a timestamp to schedule a TODO item.
+  "Insert a \"SCHEDULED:\" string with a timestamp to schedule an item.
+
+When called interactively, this command pops up the Emacs calendar to let
+the user select a date.
+
 With one universal prefix argument, remove any scheduling date from the item.
 With two universal prefix arguments, prompt for a delay cookie.
 With argument TIME, scheduled at the corresponding date.  TIME can
@@ -11055,97 +10629,100 @@ the time to use.  If none is given, the user is 
prompted for
 a date.  REMOVE indicates what kind of entries to remove.  An old
 WHAT entry will also be removed."
   (let (org-time-was-given org-end-time-was-given default-time default-input)
-    (catch 'exit
-      (when (and (memq what '(scheduled deadline))
-                (or (not time)
-                    (and (stringp time)
-                         (string-match "^[-+]+[0-9]" time))))
-       ;; Try to get a default date/time from existing timestamp
-       (save-excursion
-         (org-back-to-heading t)
-         (let ((end (save-excursion (outline-next-heading) (point))) ts)
-           (when (re-search-forward (if (eq what 'scheduled)
-                                        org-scheduled-time-regexp
-                                      org-deadline-time-regexp)
-                                    end t)
-             (setq ts (match-string 1)
-                   default-time (org-time-string-to-time ts)
-                   default-input (and ts (org-get-compact-tod ts)))))))
-      (when what
-       (setq time
-             (if (stringp time)
-                 ;; This is a string (relative or absolute), set
-                 ;; proper date.
-                 (apply #'encode-time
-                        (org-read-date-analyze
-                         time default-time (decode-time default-time)))
-               ;; If necessary, get the time from the user
-               (or time (org-read-date nil 'to-time nil
-                                       (cl-case what
-                                         (deadline "DEADLINE")
-                                         (scheduled "SCHEDULED")
-                                         (otherwise nil))
-                                       default-time default-input)))))
-      (org-with-wide-buffer
-       (org-back-to-heading t)
-       (forward-line)
-       (unless (bolp) (insert "\n"))
-       (cond ((looking-at-p org-planning-line-re)
-             ;; Move to current indentation.
-             (skip-chars-forward " \t")
-             ;; Check if we have to remove something.
-             (dolist (type (if what (cons what remove) remove))
-               (save-excursion
-                 (when (re-search-forward
-                        (cl-case type
-                          (closed org-closed-time-regexp)
-                          (deadline org-deadline-time-regexp)
-                          (scheduled org-scheduled-time-regexp)
-                          (otherwise
-                           (error "Invalid planning type: %s" type)))
-                        (line-end-position) t)
-                   ;; Delete until next keyword or end of line.
-                   (delete-region
-                    (match-beginning 0)
-                    (if (re-search-forward org-keyword-time-not-clock-regexp
-                                           (line-end-position)
-                                           t)
-                        (match-beginning 0)
-                      (line-end-position))))))
-             ;; If there is nothing more to add and no more keyword
-             ;; is left, remove the line completely.
-             (if (and (looking-at-p "[ \t]*$") (not what))
-                 (delete-region (line-beginning-position)
-                                (line-beginning-position 2))
-               ;; If we removed last keyword, do not leave trailing
-               ;; white space at the end of line.
-               (let ((p (point)))
-                 (save-excursion
-                   (end-of-line)
-                   (unless (= (skip-chars-backward " \t" p) 0)
-                     (delete-region (point) (line-end-position)))))))
-            ((not what) (throw 'exit nil)) ; Nothing to do.
-            (t (insert-before-markers "\n")
-               (backward-char 1)
-               (when org-adapt-indentation
-                 (indent-to-column (1+ (org-outline-level))))))
-       (when what
-        ;; Insert planning keyword.
-        (insert (cl-case what
-                  (closed org-closed-string)
-                  (deadline org-deadline-string)
-                  (scheduled org-scheduled-string)
-                  (otherwise (error "Invalid planning type: %s" what)))
-                " ")
-        ;; Insert associated timestamp.
-        (let ((ts (org-insert-time-stamp
-                   time
-                   (or org-time-was-given
-                       (and (eq what 'closed) org-log-done-with-time))
-                   (eq what 'closed)
-                   nil nil (list org-end-time-was-given))))
-          (unless (eolp) (insert " "))
-          ts))))))
+    (when (and (memq what '(scheduled deadline))
+              (or (not time)
+                  (and (stringp time)
+                       (string-match "^[-+]+[0-9]" time))))
+      ;; Try to get a default date/time from existing timestamp
+      (save-excursion
+       (org-back-to-heading t)
+       (let ((end (save-excursion (outline-next-heading) (point))) ts)
+         (when (re-search-forward (if (eq what 'scheduled)
+                                      org-scheduled-time-regexp
+                                    org-deadline-time-regexp)
+                                  end t)
+           (setq ts (match-string 1)
+                 default-time (org-time-string-to-time ts)
+                 default-input (and ts (org-get-compact-tod ts)))))))
+    (when what
+      (setq time
+           (if (stringp time)
+               ;; This is a string (relative or absolute), set
+               ;; proper date.
+               (apply #'encode-time
+                      (org-read-date-analyze
+                       time default-time (decode-time default-time)))
+             ;; If necessary, get the time from the user
+             (or time (org-read-date nil 'to-time nil
+                                     (cl-case what
+                                       (deadline "DEADLINE")
+                                       (scheduled "SCHEDULED")
+                                       (otherwise nil))
+                                     default-time default-input)))))
+    (org-with-wide-buffer
+     (org-back-to-heading t)
+     (let ((planning? (save-excursion
+                       (forward-line)
+                       (looking-at-p org-planning-line-re))))
+       (cond
+       (planning?
+        (forward-line)
+        ;; Move to current indentation.
+        (skip-chars-forward " \t")
+        ;; Check if we have to remove something.
+        (dolist (type (if what (cons what remove) remove))
+          (save-excursion
+            (when (re-search-forward
+                   (cl-case type
+                     (closed org-closed-time-regexp)
+                     (deadline org-deadline-time-regexp)
+                     (scheduled org-scheduled-time-regexp)
+                     (otherwise (error "Invalid planning type: %s" type)))
+                   (line-end-position)
+                   t)
+              ;; Delete until next keyword or end of line.
+              (delete-region
+               (match-beginning 0)
+               (if (re-search-forward org-keyword-time-not-clock-regexp
+                                      (line-end-position)
+                                      t)
+                   (match-beginning 0)
+                 (line-end-position))))))
+        ;; If there is nothing more to add and no more keyword is
+        ;; left, remove the line completely.
+        (if (and (looking-at-p "[ \t]*$") (not what))
+            (delete-region (line-end-position 0)
+                           (line-end-position))
+          ;; If we removed last keyword, do not leave trailing white
+          ;; space at the end of line.
+          (let ((p (point)))
+            (save-excursion
+              (end-of-line)
+              (unless (= (skip-chars-backward " \t" p) 0)
+                (delete-region (point) (line-end-position)))))))
+       (what
+        (end-of-line)
+        (insert "\n")
+        (when org-adapt-indentation
+          (indent-to-column (1+ (org-outline-level)))))
+       (t nil)))
+     (when what
+       ;; Insert planning keyword.
+       (insert (cl-case what
+                (closed org-closed-string)
+                (deadline org-deadline-string)
+                (scheduled org-scheduled-string)
+                (otherwise (error "Invalid planning type: %s" what)))
+              " ")
+       ;; Insert associated timestamp.
+       (let ((ts (org-insert-time-stamp
+                 time
+                 (or org-time-was-given
+                     (and (eq what 'closed) org-log-done-with-time))
+                 (eq what 'closed)
+                 nil nil (list org-end-time-was-given))))
+        (unless (eolp) (insert " "))
+        ts)))))
 
 (defvar org-log-note-marker (make-marker)
   "Marker pointing at the entry where the note is to be inserted.")
@@ -11156,8 +10733,9 @@ WHAT entry will also be removed."
 (defvar org-log-note-window-configuration nil)
 (defvar org-log-note-return-to (make-marker))
 (defvar org-log-note-effective-time nil
-  "Remembered current time so that dynamically scoped
-`org-extend-today-until' affects timestamps in state change log")
+  "Remembered current time.
+So that dynamically scoped `org-extend-today-until' affects
+timestamps in state change log.")
 
 (defvar org-log-post-message nil
   "Message to be displayed after a log note has been stored.
@@ -11198,8 +10776,7 @@ narrowing."
             (let ((beg (point)))
               (insert ":" drawer ":\n:END:\n")
               (org-indent-region beg (point))
-              (org-flag-region
-               (line-end-position -1) (1- (point)) t 'org-hide-drawer))
+              (org-flag-region (line-end-position -1) (1- (point)) t 'outline))
             (end-of-line -1)))))
       (t
        (org-end-of-meta-data org-log-state-notes-insert-after-drawers)
@@ -11264,19 +10841,19 @@ EXTRA is additional text that will be inserted into 
the notes buffer."
     (insert (format "# Insert note for %s.
 # Finish with C-c C-c, or cancel with C-c C-k.\n\n"
                    (cl-case org-log-note-purpose
-                     (clock-out "stopped clock")
-                     (done  "closed todo item")
-                     (reschedule "rescheduling")
-                     (delschedule "no longer scheduled")
-                     (redeadline "changing deadline")
-                     (deldeadline "removing deadline")
-                     (refile "refiling")
-                     (note "this entry")
-                     (state
-                      (format "state change from \"%s\" to \"%s\""
-                              (or org-log-note-previous-state "")
-                              (or org-log-note-state "")))
-                     (t (error "This should not happen")))))
+                    (clock-out "stopped clock")
+                    (done  "closed todo item")
+                    (reschedule "rescheduling")
+                    (delschedule "no longer scheduled")
+                    (redeadline "changing deadline")
+                    (deldeadline "removing deadline")
+                    (refile "refiling")
+                    (note "this entry")
+                    (state
+                     (format "state change from \"%s\" to \"%s\""
+                             (or org-log-note-previous-state "")
+                             (or org-log-note-state "")))
+                    (t (error "This should not happen")))))
     (when org-log-note-extra (insert org-log-note-extra))
     (setq-local org-finish-function 'org-store-log-note)
     (run-hooks 'org-log-buffer-setup-hook)))
@@ -11457,7 +11034,7 @@ on `org-remove-highlights-with-change'), this variable 
is emptied
 as well.")
 
 (defun org-occur (regexp &optional keep-previous callback)
-  "Make a compact tree which shows all matches of REGEXP.
+  "Make a compact tree showing all matches of REGEXP.
 
 The tree will show the lines where the regexp matches, and any other context
 defined in `org-show-context-detail', which see.
@@ -11551,10 +11128,13 @@ from the `before-change-functions' in the current 
buffer."
 
 ;;;; Priorities
 
-(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\] ?\\)"
-  "Regular expression matching the priority indicator.")
-
-(defvar org-remove-priority-next-time nil)
+(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]+\\)\\] ?\\)"
+  "Regular expression matching the priority indicator.
+A priority indicator can be e.g. [#A] or [#1].
+This regular expression matches these groups:
+0 : the whole match, e.g. \"TODO [#A] Hack\"
+1 : the priority cookie, e.g. \"[#A]\"
+2 : the value of the priority cookie, e.g. \"A\".")
 
 (defun org-priority-up ()
   "Increase the priority of the current item."
@@ -11580,16 +11160,18 @@ or a character."
     ;; passed the SHOW argument should be removed.
     (warn "`org-priority' called with deprecated SHOW argument"))
   (if (equal action '(4))
-      (org-show-priority)
-    (unless org-enable-priority-commands
+      (org-priority-show)
+    (unless org-priority-enable-commands
       (user-error "Priority commands are disabled"))
     (setq action (or action 'set))
-    (let (current new news have remove)
+    (let ((nump (< org-priority-lowest 65))
+         current new news have remove)
       (save-excursion
        (org-back-to-heading t)
        (when (looking-at org-priority-regexp)
-         (setq current (string-to-char (match-string 2))
-               have t))
+         (let ((ms (match-string 2)))
+           (setq current (org-priority-to-value ms)
+                 have t)))
        (cond
         ((eq action 'remove)
          (setq remove t new ?\ ))
@@ -11597,49 +11179,61 @@ or a character."
              (integerp action))
          (if (not (eq action 'set))
              (setq new action)
-           (message "Priority %c-%c, SPC to remove: "
-                    org-highest-priority org-lowest-priority)
-           (save-match-data
-             (setq new (read-char-exclusive))))
-         (when (and (= (upcase org-highest-priority) org-highest-priority)
-                    (= (upcase org-lowest-priority) org-lowest-priority))
+           (setq
+            new
+            (if nump
+                (string-to-number
+                 (read-string (format "Priority %s-%s, SPC to remove: "
+                                      (number-to-string org-priority-highest)
+                                      (number-to-string org-priority-lowest))))
+              (progn (message "Priority %c-%c, SPC to remove: "
+                                org-priority-highest org-priority-lowest)
+                       (save-match-data
+                         (setq new (read-char-exclusive)))))))
+         (when (and (= (upcase org-priority-highest) org-priority-highest)
+                    (= (upcase org-priority-lowest) org-priority-lowest))
            (setq new (upcase new)))
          (cond ((equal new ?\s) (setq remove t))
-               ((or (< (upcase new) org-highest-priority) (> (upcase new) 
org-lowest-priority))
-                (user-error "Priority must be between `%c' and `%c'"
-                            org-highest-priority org-lowest-priority))))
+               ((or (< (upcase new) org-priority-highest) (> (upcase new) 
org-priority-lowest))
+                (user-error
+                 (if nump
+                     "Priority must be between `%s' and `%s'"
+                   "Priority must be between `%c' and `%c'")
+                 org-priority-highest org-priority-lowest))))
         ((eq action 'up)
          (setq new (if have
                        (1- current)  ; normal cycling
                      ;; last priority was empty
                      (if (eq last-command this-command)
-                         org-lowest-priority  ; wrap around empty to lowest
+                         org-priority-lowest  ; wrap around empty to lowest
                        ;; default
                        (if org-priority-start-cycle-with-default
-                           org-default-priority
-                         (1- org-default-priority))))))
+                           org-priority-default
+                         (1- org-priority-default))))))
         ((eq action 'down)
          (setq new (if have
                        (1+ current)  ; normal cycling
                      ;; last priority was empty
                      (if (eq last-command this-command)
-                         org-highest-priority  ; wrap around empty to highest
+                         org-priority-highest  ; wrap around empty to highest
                        ;; default
                        (if org-priority-start-cycle-with-default
-                           org-default-priority
-                         (1+ org-default-priority))))))
+                           org-priority-default
+                         (1+ org-priority-default))))))
         (t (user-error "Invalid action")))
-       (when (or (< (upcase new) org-highest-priority)
-                 (> (upcase new) org-lowest-priority))
+       (when (or (< (upcase new) org-priority-highest)
+                 (> (upcase new) org-priority-lowest))
          (if (and (memq action '(up down))
                   (not have) (not (eq last-command this-command)))
              ;; `new' is from default priority
              (error
-              "The default can not be set, see `org-default-priority' why")
+              "The default can not be set, see `org-priority-default' why")
            ;; normal cycling: `new' is beyond highest/lowest priority
            ;; and is wrapped around to the empty priority
            (setq remove t)))
-       (setq news (format "%c" new))
+       ;; Numerical priorities are limited to 64, beyond that number,
+       ;; assume the priority cookie is a character.
+       (setq news (if (> new 64) (format "%c" new) (format "%s" new)))
        (if have
            (if remove
                (replace-match "" t t nil 1)
@@ -11658,7 +11252,8 @@ or a character."
          (message "Priority removed")
        (message "Priority of current item set to %s" news)))))
 
-(defun org-show-priority ()
+(defalias 'org-show-priority 'org-priority-show)
+(defun org-priority-show ()
   "Show the priority of the current item.
 This priority is composed of the main priority given with the [#A] cookies,
 and by additional input from the age of a schedules or deadline entry."
@@ -11673,14 +11268,18 @@ and by additional input from the age of a schedules 
or deadline entry."
     (message "Priority is %d" (if pri pri -1000))))
 
 (defun org-get-priority (s)
-  "Find priority cookie and return priority."
+  "Find priority cookie and return priority.
+S is a string against which you can match `org-priority-regexp'.
+If `org-priority-get-priority-function' is set to a custom
+function, use it.  Otherwise process S and output the priority
+value, an integer."
   (save-match-data
-    (if (functionp org-get-priority-function)
-       (funcall org-get-priority-function s)
+    (if (functionp org-priority-get-priority-function)
+       (funcall org-priority-get-priority-function s)
       (if (not (string-match org-priority-regexp s))
-         (* 1000 (- org-lowest-priority org-default-priority))
-       (* 1000 (- org-lowest-priority
-                  (string-to-char (match-string 2 s))))))))
+         (* 1000 (- org-priority-lowest org-priority-default))
+       (* 1000 (- org-priority-lowest
+                  (org-priority-to-value (match-string 2 s))))))))
 
 ;;;; Tags
 
@@ -11905,7 +11504,7 @@ are also TODO tasks."
   (interactive "P")
   (org-agenda-prepare-buffers (list (current-buffer)))
   (let ((org--matcher-tags-todo-only todo-only))
-    (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match))
+    (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match t))
                   org--matcher-tags-todo-only)))
 
 (defalias 'org-tags-sparse-tree 'org-match-sparse-tree)
@@ -11946,7 +11545,7 @@ instead of the agenda files."
                   (if (car-safe files) files
                     (org-agenda-files))))))))
 
-(defun org-make-tags-matcher (match)
+(defun org-make-tags-matcher (match &optional only-local-tags)
   "Create the TAGS/TODO matcher form for the selection string MATCH.
 
 Returns a cons of the selection string MATCH and a function
@@ -11964,6 +11563,9 @@ This function sets the variable 
`org--matcher-tags-todo-only' to
 a non-nil value if the matcher restricts matching to TODO
 entries, otherwise it is not touched.
 
+When ONLY-LOCAL-TAGS is non-nil, ignore the global tag completion
+table, only get buffer tags.
+
 See also `org-scan-tags'."
   (unless match
     ;; Get a new match request, with completion against the global
@@ -11971,7 +11573,8 @@ See also `org-scan-tags'."
     (let ((org-last-tags-completion-table
           (org--tag-add-to-alist
            (org-get-buffer-tags)
-           (org-global-tags-completion-table))))
+           (unless only-local-tags
+             (org-global-tags-completion-table)))))
       (setq match
            (completing-read
             "Match: "
@@ -12098,7 +11701,7 @@ See also `org-scan-tags'."
       (cons match0 `(lambda (todo tags-list level) ,matcher)))))
 
 (defun org--tags-expand-group (group tag-groups expanded)
-  "Recursively Expand all tags in GROUP, according to TAG-GROUPS.
+  "Recursively expand all tags in GROUP, according to TAG-GROUPS.
 TAG-GROUPS is the list of groups used for expansion.  EXPANDED is
 an accumulator used in recursive calls."
   (dolist (tag group)
@@ -12146,7 +11749,9 @@ When DOWNCASED is non-nil, expand downcased TAGS."
           (if (not downcased) g
             (mapcar (lambda (s) (mapcar #'downcase s)) g)))))
     (cond
-     (single-as-list (org--tags-expand-group (list match) tag-groups nil))
+     (single-as-list (org--tags-expand-group
+                     (list (if downcased (downcase match) match))
+                     tag-groups nil))
      (org-group-tags
       (let* ((case-fold-search t)
             (tag-syntax org-mode-syntax-table)
@@ -12329,7 +11934,12 @@ in Lisp code use `org-set-tags' instead."
                                #'org-tags-completion-function
                                nil nil (org-make-tag-string current-tags)
                                'org-tags-history)))))))
-         (org-set-tags tags)))))))
+         (org-set-tags tags)))))
+    ;; `save-excursion' may not replace the point at the right
+    ;; position.
+    (when (and (save-excursion (skip-chars-backward "*") (bolp))
+              (looking-at-p " "))
+      (forward-char))))
 
 (defun org-align-tags (&optional all)
   "Align tags in current entry.
@@ -12710,7 +12320,8 @@ According to `org-use-tag-inheritance', tags may be 
inherited
 from parent headlines, and from the whole document, through
 `org-file-tags'.  In this case, the returned list of tags
 contains tags in this order: file tags, tags inherited from
-parent headlines, local tags.
+parent headlines, local tags.  If a tag appears multiple times,
+only the most local tag is returned.
 
 However, when optional argument LOCAL is non-nil, only return
 tags specified at the headline.
@@ -12726,12 +12337,13 @@ Inherited tags have the `inherited' text property."
         (let ((ltags (org--get-local-tags)) itags)
           (if (or local (not org-use-tag-inheritance)) ltags
             (while (org-up-heading-safe)
-              (setq itags (append (mapcar #'org-add-prop-inherited
-                                          (org--get-local-tags))
-                                  itags)))
+              (setq itags (nconc (mapcar #'org-add-prop-inherited
+                                        (org--get-local-tags))
+                                itags)))
             (setq itags (append org-file-tags itags))
-            (delete-dups
-             (append (org-remove-uninherited-tags itags) ltags))))))))
+            (nreverse
+            (delete-dups
+             (nreverse (nconc (org-remove-uninherited-tags itags) 
ltags))))))))))
 
 (defun org-get-buffer-tags ()
   "Get a table of all tags used in the buffer, for completion."
@@ -12919,30 +12531,52 @@ Modifications are made by side-effect.  Return new 
alist."
 
 (defun org-get-property-block (&optional beg force)
   "Return the (beg . end) range of the body of the property drawer.
-BEG is the beginning of the current subtree, or of the part
-before the first headline.  If it is not given, it will be found.
-If the drawer does not exist, create it if FORCE is non-nil, or
-return nil."
+BEG is the beginning of the current subtree or the beginning of
+the document if before the first headline.  If it is not given,
+it will be found.  If the drawer does not exist, create it if
+FORCE is non-nil, or return nil."
   (org-with-wide-buffer
-   (when beg (goto-char beg))
-   (unless (org-before-first-heading-p)
-     (let ((beg (cond (beg)
+   (let ((beg (cond (beg (goto-char beg))
                      ((or (not (featurep 'org-inlinetask))
                           (org-inlinetask-in-task-p))
-                      (org-back-to-heading t))
-                     (t (org-with-limited-levels (org-back-to-heading t))))))
-       (forward-line)
-       (when (looking-at-p org-planning-line-re) (forward-line))
-       (cond ((looking-at org-property-drawer-re)
-             (forward-line)
-             (cons (point) (progn (goto-char (match-end 0))
-                                  (line-beginning-position))))
-            (force
-             (goto-char beg)
-             (org-insert-property-drawer)
-             (let ((pos (save-excursion (search-forward ":END:")
-                                        (line-beginning-position))))
-               (cons pos pos))))))))
+                      (org-back-to-heading-or-point-min t) (point))
+                     (t (org-with-limited-levels
+                         (org-back-to-heading-or-point-min t))
+                        (point)))))
+     ;; Move point to its position according to its positional rules.
+     (cond ((org-before-first-heading-p)
+           (while (and (org-at-comment-p) (bolp)) (forward-line)))
+          (t (forward-line)
+             (when (looking-at-p org-planning-line-re) (forward-line))))
+     (cond ((looking-at org-property-drawer-re)
+           (forward-line)
+           (cons (point) (progn (goto-char (match-end 0))
+                                (line-beginning-position))))
+          (force
+           (goto-char beg)
+           (org-insert-property-drawer)
+           (let ((pos (save-excursion (re-search-forward 
org-property-drawer-re)
+                                      (line-beginning-position))))
+             (cons pos pos)))))))
+
+(defun org-at-property-drawer-p ()
+  "Non-nil when point is at the first line of a property drawer."
+  (org-with-wide-buffer
+   (beginning-of-line)
+   (and (looking-at org-property-drawer-re)
+       (or (bobp)
+           (progn
+             (forward-line -1)
+             (cond ((org-at-heading-p))
+                   ((looking-at org-planning-line-re)
+                    (forward-line -1)
+                    (org-at-heading-p))
+                   ((looking-at org-comment-regexp)
+                    (forward-line -1)
+                    (while (and (not (bobp)) (looking-at org-comment-regexp))
+                      (forward-line -1))
+                    (looking-at org-comment-regexp))
+                   (t nil)))))))
 
 (defun org-at-property-p ()
   "Non-nil when point is inside a property drawer.
@@ -12998,6 +12632,10 @@ variables is set."
                        (not (get-text-property 0 'org-unrestricted
                                                (caar allowed))))))
              (completing-read "Effort: " allowed nil must-match))))))
+    ;; Test whether the value can be interpreted as a duration before
+    ;; inserting it in the buffer:
+    (org-duration-to-minutes value)
+    ;; Maybe update the effort value:
     (unless (equal current value)
       (org-entry-put nil org-effort-property value))
     (org-refresh-property '((effort . identity)
@@ -13027,7 +12665,7 @@ Return value is an alist.  Keys are properties, as 
upcased
 strings."
   (org-with-point-at pom
     (when (and (derived-mode-p 'org-mode)
-              (ignore-errors (org-back-to-heading t)))
+              (org-back-to-heading-or-point-min t))
       (catch 'exit
        (let* ((beg (point))
               (specific (and (stringp which) (upcase which)))
@@ -13070,7 +12708,7 @@ strings."
              (push (cons "PRIORITY"
                          (if (looking-at org-priority-regexp)
                              (match-string-no-properties 2)
-                           (char-to-string org-default-priority)))
+                           (char-to-string org-priority-default)))
                    props)
              (when specific (throw 'exit props)))
            (when (or (not specific) (string= specific "FILE"))
@@ -13236,13 +12874,13 @@ unless LITERAL-NIL is non-nil."
        ;; Return final values.
        (and (not (equal value '(nil))) (nreverse value))))))
 
-(defun org--property-global-value (property literal-nil)
-  "Return value for PROPERTY in current buffer.
+(defun org--property-global-or-keyword-value (property literal-nil)
+  "Return value for PROPERTY as defined by global properties or by keyword.
 Return value is a string.  Return nil if property is not set
-globally.  Also return nil when PROPERTY is set to \"nil\",
-unless LITERAL-NIL is non-nil."
+globally or by keyword.  Also return nil when PROPERTY is set to
+\"nil\", unless LITERAL-NIL is non-nil."
   (let ((global
-        (cdr (or (assoc-string property org-file-properties t)
+        (cdr (or (assoc-string property org-keyword-properties t)
                  (assoc-string property org-global-properties t)
                  (assoc-string property org-global-properties-fixed t)))))
     (if literal-nil global (org-not-nil global))))
@@ -13391,12 +13029,12 @@ However, if LITERAL-NIL is set, return the string 
value \"nil\" instead."
                           value)))
           (cond
            ((car v)
-            (org-back-to-heading t)
+            (org-back-to-heading-or-point-min t)
             (move-marker org-entry-property-inherited-from (point))
             (throw 'exit nil))
-           ((org-up-heading-safe))
+           ((org-up-heading-or-point-min))
            (t
-            (let ((global (org--property-global-value property literal-nil)))
+            (let ((global (org--property-global-or-keyword-value property 
literal-nil)))
               (cond ((not global))
                     (value (setq value (concat global " " value)))
                     (t (setq value global))))
@@ -13428,8 +13066,8 @@ decreases scheduled or deadline date by one day."
         (user-error "Invalid property name: \"%s\"" property)))
   (org-with-point-at pom
     (if (or (not (featurep 'org-inlinetask)) (org-inlinetask-in-task-p))
-       (org-back-to-heading t)
-      (org-with-limited-levels (org-back-to-heading t)))
+       (org-back-to-heading-or-point-min t)
+      (org-with-limited-levels (org-back-to-heading-or-point-min t)))
     (let ((beg (point)))
       (cond
        ((equal property "TODO")
@@ -13499,7 +13137,10 @@ COLUMN formats in the current buffer."
        (props (append
                (and specials org-special-properties)
                (and defaults (cons org-effort-property org-default-properties))
-               nil)))
+               ;; Get property names from #+PROPERTY keywords as well
+               (mapcar (lambda (s)
+                         (nth 0 (split-string s)))
+                       (cdar (org-collect-keywords '("PROPERTY")))))))
     (org-with-wide-buffer
      (goto-char (point-min))
      (while (re-search-forward org-property-start-re nil t)
@@ -13547,7 +13188,15 @@ COLUMN formats in the current buffer."
                 (let ((p (match-string-no-properties 1 value)))
                   (unless (member-ignore-case p org-special-properties)
                     (push p props))))))))))
-    (sort (delete-dups props) (lambda (a b) (string< (upcase a) (upcase b))))))
+    (sort (delete-dups
+          (append props
+                  ;; for each xxx_ALL property, make sure the bare
+                  ;; xxx property is also included
+                  (delq nil (mapcar (lambda (p)
+                                      (and (string-match-p "._ALL\\'" p)
+                                           (substring p 0 -4)))
+                                    props))))
+         (lambda (a b) (string< (upcase a) (upcase b))))))
 
 (defun org-property-values (key)
   "List all non-nil values of property KEY in current buffer."
@@ -13565,21 +13214,26 @@ COLUMN formats in the current buffer."
 Do nothing if the drawer already exists.  The newly created
 drawer is immediately hidden."
   (org-with-wide-buffer
+   ;; Set point to the position where the drawer should be inserted.
    (if (or (not (featurep 'org-inlinetask)) (org-inlinetask-in-task-p))
-       (org-back-to-heading t)
-     (org-with-limited-levels (org-back-to-heading t)))
-   (forward-line)
-   (when (looking-at-p org-planning-line-re) (forward-line))
+       (org-back-to-heading-or-point-min t)
+     (org-with-limited-levels (org-back-to-heading-or-point-min t)))
+   (if (org-before-first-heading-p)
+       (while (and (org-at-comment-p) (bolp)) (forward-line))
+     (progn
+       (forward-line)
+       (when (looking-at-p org-planning-line-re) (forward-line))))
    (unless (looking-at-p org-property-drawer-re)
      ;; Make sure we start editing a line from current entry, not from
      ;; next one.  It prevents extending text properties or overlays
      ;; belonging to the latter.
-     (when (bolp) (backward-char))
-     (let ((begin (1+ (point)))
+     (when (and (bolp) (> (point) (point-min))) (backward-char))
+     (let ((begin (if (bobp) (point) (1+ (point))))
           (inhibit-read-only t))
-       (insert "\n:PROPERTIES:\n:END:")
-       (org-flag-drawer t nil (line-end-position 0) (point))
-       (when (eobp) (insert "\n"))
+       (unless (bobp) (insert "\n"))
+       (insert ":PROPERTIES:\n:END:")
+       (org-flag-region (line-end-position 0) (point) t 'outline)
+       (when (or (eobp) (= begin (point-min))) (insert "\n"))
        (org-indent-region begin (point))))))
 
 (defun org-insert-drawer (&optional arg drawer)
@@ -13759,7 +13413,8 @@ part of the buffer."
        (while (re-search-forward re nil t)
          (when (if value (org-at-property-p)
                  (org-entry-get (point) property nil t))
-           (throw 'exit (progn (org-back-to-heading t) (point)))))))))
+           (throw 'exit (progn (org-back-to-heading-or-point-min t)
+                               (point)))))))))
 
 (defun org-delete-property (property)
   "In the current entry, delete PROPERTY."
@@ -13829,8 +13484,8 @@ completion."
       (setq vals (org-with-point-at pom
                   (append org-todo-keywords-1 '("")))))
      ((equal property "PRIORITY")
-      (let ((n org-lowest-priority))
-       (while (>= n org-highest-priority)
+      (let ((n org-priority-lowest))
+       (while (>= n org-priority-highest)
          (push (char-to-string n) vals)
          (setq n (1- n)))))
      ((equal property "CATEGORY"))
@@ -13895,15 +13550,9 @@ completion."
 
 (defun org-find-olp (path &optional this-buffer)
   "Return a marker pointing to the entry at outline path OLP.
-If anything goes wrong, throw an error.
-You can wrap this call to catch the error like this:
-
-  (condition-case msg
-      (org-mobile-locate-entry (match-string 4))
-    (error (nth 1 msg)))
-
-The return value will then be either a string with the error message,
-or a marker if everything is OK.
+If anything goes wrong, throw an error, and if you need to do
+something based on this error, you can catch it with
+`condition-case'.
 
 If THIS-BUFFER is set, the outline path does not contain a file,
 only headings."
@@ -14079,16 +13728,16 @@ non-nil."
 (defun org-time-stamp-inactive (&optional arg)
   "Insert an inactive time stamp.
 
-An inactive time stamp is enclosed in square brackets instead of angle
-brackets.  It is inactive in the sense that it does not trigger agenda entries,
-does not link to the calendar and cannot be changed with the S-cursor keys.
-So these are more for recording a certain time/date.
+An inactive time stamp is enclosed in square brackets instead of
+angle brackets.  It is inactive in the sense that it does not
+trigger agenda entries.  So these are more for recording a
+certain time/date.
 
 If the user specifies a time like HH:MM or if this command is called with
 at least one prefix argument, the time stamp contains the date and the time.
 Otherwise, only the date is included.
 
-When called with two universal prefix arguments, insert an active time stamp
+When called with two universal prefix arguments, insert an inactive time stamp
 with the current time without prompting the user."
   (interactive "P")
   (org-time-stamp arg 'inactive))
@@ -14104,7 +13753,6 @@ with the current time without prompting the user."
 
 (defvar org-overriding-default-time nil) ; dynamically scoped
 (defvar org-read-date-overlay nil)
-(defvar org-dcst nil) ; dynamically scoped
 (defvar org-read-date-history nil)
 (defvar org-read-date-final-answer nil)
 (defvar org-read-date-analyze-futurep nil)
@@ -14174,7 +13822,6 @@ user."
          (if (equal org-with-time '(16))
              '(0 0)
            org-time-stamp-rounding-minutes))
-        (org-dcst org-display-custom-times)
         (ct (org-current-time))
         (org-def (or org-overriding-default-time default-time ct))
         (org-defdecode (decode-time org-def))
@@ -14293,7 +13940,7 @@ user."
                          " " (or org-ans1 org-ans2)))
             (org-end-time-was-given nil)
             (f (org-read-date-analyze ans org-def org-defdecode))
-            (fmts (if org-dcst
+            (fmts (if org-display-custom-times
                       org-time-stamp-custom-formats
                     org-time-stamp-formats))
             (fmt (if (or org-with-time
@@ -14959,7 +14606,7 @@ signaled."
                       (cdr errdata))))))))
 
 (defun org-days-to-iso-week (days)
-  "Return the iso week number."
+  "Return the ISO week number."
   (require 'cal-iso)
   (car (calendar-iso-from-absolute days)))
 
@@ -16039,7 +15686,7 @@ environment remains unintended."
       ;; Get indentation of next line unless at column 0.
       (let ((ind (if (bolp) 0
                   (save-excursion
-                    (org-return-indent)
+                    (org-return t)
                     (prog1 (current-indentation)
                       (when (progn (skip-chars-forward " \t") (eolp))
                         (delete-region beg (point)))))))
@@ -16084,7 +15731,10 @@ looks only before point, not after."
   (catch 'exit
     (let ((pos (point))
          (dodollar (member "$" (plist-get org-format-latex-options :matchers)))
-         (lim (save-excursion (org-backward-paragraph) (point)))
+         (lim (progn
+                (re-search-backward (concat "^\\(" paragraph-start "\\)") nil
+                                    'move)
+                (point)))
          dd-on str (start 0) m re)
       (goto-char pos)
       (when dodollar
@@ -16152,7 +15802,7 @@ BEG and END are buffer positions."
        ;; Emacs cannot overlay images from remote hosts.  Create it in
        ;; `temporary-file-directory' instead.
        (if (or (not file) (file-remote-p file))
-           temporary-file-directory
+          temporary-file-directory
         default-directory)
        'overlays nil 'forbuffer org-preview-latex-default-process))))
 
@@ -16263,6 +15913,10 @@ Some of the options can be changed using the variable
                    (if (string= (match-string 0 value) "$$")
                        (insert "\\[" (substring value 2 -2) "\\]")
                      (insert "\\(" (substring value 1 -1) "\\)"))))
+                ((eq processing-type 'html)
+                 (goto-char beg)
+                 (delete-region beg end)
+                 (insert (org-format-latex-as-html value)))
                 ((assq processing-type org-preview-latex-process-alist)
                  ;; Process to an image.
                  (cl-incf cnt)
@@ -16391,7 +16045,7 @@ inspection."
        (write-region mathml nil mathml-file))
       (when (called-interactively-p 'any)
        (message mathml)))
-     ((message "LaTeX to MathML conversion failed")
+     ((warn "LaTeX to MathML conversion failed")
       (message shell-command-output)))
     (delete-file tmp-in-file)
     (when (file-exists-p tmp-out-file)
@@ -16428,6 +16082,14 @@ inspection."
       ;; Failed conversion.  Return the LaTeX fragment verbatim
       latex-frag)))
 
+(defun org-format-latex-as-html (latex-fragment)
+  "Convert LATEX-FRAGMENT to HTML.
+This uses  `org-latex-to-html-convert-command', which see."
+  (let ((cmd (format-spec org-latex-to-html-convert-command
+                         `((?i . ,latex-fragment)))))
+    (message "Running %s" cmd)
+    (shell-command-to-string cmd)))
+
 (defun org--get-display-dpi ()
   "Get the DPI of the display.
 The function assumes that the display has the same pixel width in
@@ -16497,12 +16159,16 @@ a HTML file."
        (setq bg (org-latex-color :background))
       (setq bg (org-latex-color-format
                (if (string= bg "Transparent") "white" bg))))
+    ;; Remove TeX \par at end of snippet to avoid trailing space.
+    (if (string-suffix-p string "\n")
+        (aset string (1- (length string)) ?%)
+      (setq string (concat string "%")))
     (with-temp-file texfile
       (insert latex-header)
       (insert "\n\\begin{document}\n"
-             "\\definecolor{fg}{rgb}{" fg "}\n"
-             "\\definecolor{bg}{rgb}{" bg "}\n"
-             "\n\\pagecolor{bg}\n"
+             "\\definecolor{fg}{rgb}{" fg "}%\n"
+             "\\definecolor{bg}{rgb}{" bg "}%\n"
+             "\n\\pagecolor{bg}%\n"
              "\n{\\color{fg}\n"
              string
              "\n}\n"
@@ -16629,16 +16295,60 @@ INCLUDE-LINKED is passed to 
`org-display-inline-images'."
                 "No images to display inline")))))
 
 (defun org-redisplay-inline-images ()
-  "Refresh the display of inline images."
+  "Assure display of inline images and refresh them."
   (interactive)
-  (if (not org-inline-image-overlays)
-      (org-toggle-inline-images)
-    (org-toggle-inline-images)
+  (org-toggle-inline-images)
+  (unless org-inline-image-overlays
     (org-toggle-inline-images)))
 
 ;; For without-x builds.
 (declare-function image-refresh "image" (spec &optional frame))
 
+(defcustom org-display-remote-inline-images 'skip
+  "How to display remote inline images.
+Possible values of this option are:
+
+skip        Don't display remote images.
+download    Always download and display remote images.
+cache       Display remote images, and open them in separate buffers
+            for caching.  Silently update the image buffer when a file
+            change is detected."
+  :group 'org-appearance
+  :package-version '(Org . "9.4")
+  :type '(choice
+         (const :tag "Ignore remote images" skip)
+         (const :tag "Always display remote images" download)
+         (const :tag "Display and silently update remote images" cache))
+  :safe #'symbolp)
+
+(defun org--create-inline-image (file width)
+  "Create image located at FILE, or return nil.
+WIDTH is the width of the image.  The image may not be created
+according to the value of `org-display-remote-inline-images'."
+  (let* ((remote? (file-remote-p file))
+        (file-or-data
+         (pcase org-display-remote-inline-images
+           ((guard (not remote?)) file)
+           (`download (with-temp-buffer
+                        (set-buffer-multibyte nil)
+                        (insert-file-contents-literally file)
+                        (buffer-string)))
+           (`cache (let ((revert-without-query '(".")))
+                     (with-current-buffer (find-file-noselect file)
+                       (buffer-string))))
+           (`skip nil)
+           (other
+            (message "Invalid value of `org-display-remote-inline-images': %S"
+                     other)
+            nil))))
+    (when file-or-data
+      (create-image file-or-data
+                   (and (image-type-available-p 'imagemagick)
+                        width
+                        'imagemagick)
+                   remote?
+                   :width width))))
+
 (defun org-display-inline-images (&optional include-linked refresh beg end)
   "Display inline images.
 
@@ -16757,11 +16467,7 @@ buffer boundaries with possible narrowing."
                                'org-image-overlay)))
                      (if (and (car-safe old) refresh)
                          (image-refresh (overlay-get (cdr old) 'display))
-                       (let ((image (create-image file
-                                                  (and (image-type-available-p 
'imagemagick)
-                                                       width 'imagemagick)
-                                                  nil
-                                                  :width width)))
+                       (let ((image (org--create-inline-image file width)))
                          (when image
                            (let ((ov (make-overlay
                                       (org-element-property :begin link)
@@ -16776,7 +16482,9 @@ buffer boundaries with possible narrowing."
                              (overlay-put
                               ov 'modification-hooks
                               (list 'org-display-inline-remove-overlay))
-                             (overlay-put ov 'keymap image-map)
+                             (when (<= 26 emacs-major-version)
+                               (cl-assert (boundp 'image-map))
+                               (overlay-put ov 'keymap image-map))
                              (push ov org-inline-image-overlays))))))))))))))))
 
 (defun org-display-inline-remove-overlay (ov after _beg _end &optional _len)
@@ -16863,7 +16571,7 @@ overwritten, and the table is not marked as requiring 
realignment."
                (1+ org-self-insert-command-undo-counter))))))))
 
 (defun org-check-before-invisible-edit (kind)
-  "Check is editing if kind KIND would be dangerous with invisible text around.
+  "Check if editing kind KIND would be dangerous with invisible text around.
 The detailed reaction depends on the user option `org-catch-invisible-edits'."
   ;; First, try to get out of here as quickly as possible, to reduce overhead
   (when (and org-catch-invisible-edits
@@ -17023,7 +16731,7 @@ word constituents."
 (defvar org-ctrl-c-ctrl-c-hook nil
   "Hook for functions attaching themselves to `C-c C-c'.
 
-This can be used to add additional functionality to the C-c C-c
+This can be used to add additional functionality to the `C-c C-c'
 key which executes context-dependent commands.  This hook is run
 before any other test, while `org-ctrl-c-ctrl-c-final-hook' is
 run after the last test.
@@ -17036,7 +16744,7 @@ context is wrong, just do nothing and return nil.")
 (defvar org-ctrl-c-ctrl-c-final-hook nil
   "Hook for functions attaching themselves to `C-c C-c'.
 
-This can be used to add additional functionality to the C-c C-c
+This can be used to add additional functionality to the `C-c C-c'
 key which executes context-dependent commands.  This hook is run
 after any other test, while `org-ctrl-c-ctrl-c-hook' is run
 before the first test.
@@ -17401,13 +17109,15 @@ individual commands for more information."
     (call-interactively (if org-edit-timestamp-down-means-later
                            'org-timestamp-down 'org-timestamp-up)))
    ((and (not (eq org-support-shift-select 'always))
-        org-enable-priority-commands
+        org-priority-enable-commands
         (org-at-heading-p))
     (call-interactively 'org-priority-up))
    ((and (not org-support-shift-select) (org-at-item-p))
     (call-interactively 'org-previous-item))
    ((org-clocktable-try-shift 'up arg))
-   ((org-at-table-p) (org-table-move-cell-up))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-at-table-p))
+    (org-table-move-cell-up))
    ((run-hook-with-args-until-success 'org-shiftup-final-hook))
    (org-support-shift-select
     (org-call-for-shift-select 'previous-line))
@@ -17427,13 +17137,15 @@ individual commands for more information."
     (call-interactively (if org-edit-timestamp-down-means-later
                            'org-timestamp-up 'org-timestamp-down)))
    ((and (not (eq org-support-shift-select 'always))
-        org-enable-priority-commands
+        org-priority-enable-commands
         (org-at-heading-p))
     (call-interactively 'org-priority-down))
    ((and (not org-support-shift-select) (org-at-item-p))
     (call-interactively 'org-next-item))
    ((org-clocktable-try-shift 'down arg))
-   ((org-at-table-p) (org-table-move-cell-down))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-at-table-p))
+    (org-table-move-cell-down))
    ((run-hook-with-args-until-success 'org-shiftdown-final-hook))
    (org-support-shift-select
     (org-call-for-shift-select 'next-line))
@@ -17471,7 +17183,9 @@ This does one of the following:
         (org-at-property-p))
     (call-interactively 'org-property-next-allowed-value))
    ((org-clocktable-try-shift 'right arg))
-   ((org-at-table-p) (org-table-move-cell-right))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-at-table-p))
+    (org-table-move-cell-right))
    ((run-hook-with-args-until-success 'org-shiftright-final-hook))
    (org-support-shift-select
     (org-call-for-shift-select 'forward-char))
@@ -17509,7 +17223,9 @@ This does one of the following:
         (org-at-property-p))
     (call-interactively 'org-property-previous-allowed-value))
    ((org-clocktable-try-shift 'left arg))
-   ((org-at-table-p) (org-table-move-cell-left))
+   ((and (not (eq org-support-shift-select 'always))
+        (org-at-table-p))
+    (org-table-move-cell-left))
    ((run-hook-with-args-until-success 'org-shiftleft-final-hook))
    (org-support-shift-select
     (org-call-for-shift-select 'backward-char))
@@ -17586,23 +17302,12 @@ this numeric value."
   (org-increase-number-at-point (- (or inc 1))))
 
 (defun org-ctrl-c-ret ()
-  "Call `org-table-hline-and-move' or `org-insert-heading' dep. on context."
+  "Call `org-table-hline-and-move' or `org-insert-heading'."
   (interactive)
   (cond
    ((org-at-table-p) (call-interactively 'org-table-hline-and-move))
    (t (call-interactively 'org-insert-heading))))
 
-(defun org-find-visible ()
-  (let ((s (point)))
-    (while (and (not (= (point-max) (setq s (next-overlay-change s))))
-               (get-char-property s 'invisible)))
-    s))
-(defun org-find-invisible ()
-  (let ((s (point)))
-    (while (and (not (= (point-max) (setq s (next-overlay-change s))))
-               (not (get-char-property s 'invisible))))
-    s))
-
 (defun org-copy-visible (beg end)
   "Copy the visible parts of the region."
   (interactive "r")
@@ -17710,6 +17415,7 @@ Otherwise, return a user error."
         (pcase (org-element-type context)
           (`footnote-reference (org-edit-footnote-reference))
           (`inline-src-block (org-edit-inline-src-code))
+          (`latex-fragment (org-edit-latex-fragment))
           (`timestamp (if (eq 'inactive (org-element-property :type context))
                           (call-interactively #'org-time-stamp-inactive)
                         (call-interactively #'org-time-stamp)))
@@ -17721,14 +17427,19 @@ Otherwise, return a user error."
 
 This command does many different things, depending on context:
 
+- If column view is active, in agenda or org buffers, quit it.
+
+- If there are highlights, remove them.
+
 - If a function in `org-ctrl-c-ctrl-c-hook' recognizes this location,
   this is what we do.
 
 - If the cursor is on a statistics cookie, update it.
 
-- If the cursor is in a headline, prompt for tags and insert them
-  into the current line, aligned to `org-tags-column'.  When called
-  with prefix arg, realign all tags in the current buffer.
+- If the cursor is in a headline, in an agenda or an org buffer,
+  prompt for tags and insert them into the current line, aligned
+  to `org-tags-column'.  When called with prefix arg, realign all
+  tags in the current buffer.
 
 - If the cursor is in one of the special #+KEYWORD lines, this
   triggers scanning the buffer for these lines and updating the
@@ -17762,6 +17473,7 @@ This command does many different things, depending on 
context:
   inhibited by setting `org-babel-no-eval-on-ctrl-c-ctrl-c'."
   (interactive "P")
   (cond
+   ((bound-and-true-p org-columns-overlays) (org-columns-quit))
    ((or (bound-and-true-p org-clock-overlays) org-occur-highlights)
     (when (boundp 'org-clock-overlays) (org-clock-remove-overlays))
     (org-remove-occur-highlights)
@@ -17783,6 +17495,7 @@ This command does many different things, depending on 
context:
                          src-block statistics-cookie table table-cell table-row
                          timestamp)
             t))
+          (radio-list-p (org-at-radio-list-p))
           (type (org-element-type context)))
       ;; For convenience: at the first line of a paragraph on the same
       ;; line as an item, apply function on that item instead.
@@ -17829,39 +17542,81 @@ This command does many different things, depending on 
context:
         ;; unconditionally, whereas `C-u' will toggle its presence.
         ;; Without a universal argument, if the item has a checkbox,
         ;; toggle it.  Otherwise repair the list.
-        (let* ((box (org-element-property :checkbox context))
-               (struct (org-element-property :structure context))
-               (old-struct (copy-tree struct))
-               (parents (org-list-parents-alist struct))
-               (prevs (org-list-prevs-alist struct))
-               (orderedp (org-not-nil (org-entry-get nil "ORDERED"))))
-          (org-list-set-checkbox
-           (org-element-property :begin context) struct
-           (cond ((equal arg '(16)) "[-]")
-                 ((and (not box) (equal arg '(4))) "[ ]")
-                 ((or (not box) (equal arg '(4))) nil)
-                 ((eq box 'on) "[ ]")
-                 (t "[X]")))
-          ;; Mimic `org-list-write-struct' but with grabbing a return
-          ;; value from `org-list-struct-fix-box'.
-          (org-list-struct-fix-ind struct parents 2)
-          (org-list-struct-fix-item-end struct)
-          (org-list-struct-fix-bul struct prevs)
-          (org-list-struct-fix-ind struct parents)
-          (let ((block-item
-                 (org-list-struct-fix-box struct parents prevs orderedp)))
-            (if (and box (equal struct old-struct))
-                (if (equal arg '(16))
-                    (message "Checkboxes already reset")
-                  (user-error "Cannot toggle this checkbox: %s"
-                              (if (eq box 'on)
-                                  "all subitems checked"
-                                "unchecked subitems")))
-              (org-list-struct-apply-struct struct old-struct)
-              (org-update-checkbox-count-maybe))
-            (when block-item
-              (message "Checkboxes were removed due to empty box at line %d"
-                       (org-current-line block-item))))))
+        (if (or radio-list-p
+                (and (boundp org-list-checkbox-radio-mode)
+                     org-list-checkbox-radio-mode))
+            (org-toggle-radio-button arg)
+          (let* ((box (org-element-property :checkbox context))
+                 (struct (org-element-property :structure context))
+                 (old-struct (copy-tree struct))
+                 (parents (org-list-parents-alist struct))
+                 (prevs (org-list-prevs-alist struct))
+                 (orderedp (org-not-nil (org-entry-get nil "ORDERED"))))
+            (org-list-set-checkbox
+             (org-element-property :begin context) struct
+             (cond ((equal arg '(16)) "[-]")
+                   ((and (not box) (equal arg '(4))) "[ ]")
+                   ((or (not box) (equal arg '(4))) nil)
+                   ((eq box 'on) "[ ]")
+                   (t "[X]")))
+            ;; Mimic `org-list-write-struct' but with grabbing a return
+            ;; value from `org-list-struct-fix-box'.
+            (org-list-struct-fix-ind struct parents 2)
+            (org-list-struct-fix-item-end struct)
+            (org-list-struct-fix-bul struct prevs)
+            (org-list-struct-fix-ind struct parents)
+            (let ((block-item
+                   (org-list-struct-fix-box struct parents prevs orderedp)))
+              (if (and box (equal struct old-struct))
+                  (if (equal arg '(16))
+                      (message "Checkboxes already reset")
+                    (user-error "Cannot toggle this checkbox: %s"
+                                (if (eq box 'on)
+                                    "all subitems checked"
+                                  "unchecked subitems")))
+                (org-list-struct-apply-struct struct old-struct)
+                (org-update-checkbox-count-maybe))
+              (when block-item
+                (message "Checkboxes were removed due to empty box at line %d"
+                         (org-current-line block-item)))))))
+       (`plain-list
+        ;; At a plain list, with a double C-u argument, set
+        ;; checkboxes of each item to "[-]", whereas a single one
+        ;; will toggle their presence according to the state of the
+        ;; first item in the list.  Without an argument, repair the
+        ;; list.
+        (if (or radio-list-p
+                (and (boundp org-list-checkbox-radio-mode)
+                     org-list-checkbox-radio-mode))
+            (org-toggle-radio-button arg)
+          (let* ((begin (org-element-property :contents-begin context))
+                 (struct (org-element-property :structure context))
+                 (old-struct (copy-tree struct))
+                 (first-box (save-excursion
+                              (goto-char begin)
+                              (looking-at org-list-full-item-re)
+                              (match-string-no-properties 3)))
+                 (new-box (cond ((equal arg '(16)) "[-]")
+                                ((equal arg '(4)) (unless first-box "[ ]"))
+                                ((equal first-box "[X]") "[ ]")
+                                (t "[X]"))))
+            (cond
+             (arg
+              (dolist (pos
+                       (org-list-get-all-items
+                        begin struct (org-list-prevs-alist struct)))
+                (org-list-set-checkbox pos struct new-box)))
+             ((and first-box (eq (point) begin))
+              ;; For convenience, when point is at bol on the first
+              ;; item of the list and no argument is provided, simply
+              ;; toggle checkbox of that item, if any.
+              (org-list-set-checkbox begin struct new-box)))
+            (when (equal
+                   (org-list-write-struct
+                    struct (org-list-parents-alist struct) old-struct)
+                   old-struct)
+              (message "Cannot update this checkbox"))
+            (org-update-checkbox-count-maybe))))
        (`keyword
         (let ((org-inhibit-startup-visibility-stuff t)
               (org-startup-align-all-tables nil))
@@ -17870,40 +17625,6 @@ This command does many different things, depending on 
context:
             (setq org-table-coordinate-overlays nil))
           (org-save-outline-visibility 'use-markers (org-mode-restart)))
         (message "Local setup has been refreshed"))
-       (`plain-list
-        ;; At a plain list, with a double C-u argument, set
-        ;; checkboxes of each item to "[-]", whereas a single one
-        ;; will toggle their presence according to the state of the
-        ;; first item in the list.  Without an argument, repair the
-        ;; list.
-        (let* ((begin (org-element-property :contents-begin context))
-               (struct (org-element-property :structure context))
-               (old-struct (copy-tree struct))
-               (first-box (save-excursion
-                            (goto-char begin)
-                            (looking-at org-list-full-item-re)
-                            (match-string-no-properties 3)))
-               (new-box (cond ((equal arg '(16)) "[-]")
-                              ((equal arg '(4)) (unless first-box "[ ]"))
-                              ((equal first-box "[X]") "[ ]")
-                              (t "[X]"))))
-          (cond
-           (arg
-            (dolist (pos
-                     (org-list-get-all-items
-                      begin struct (org-list-prevs-alist struct)))
-              (org-list-set-checkbox pos struct new-box)))
-           ((and first-box (eq (point) begin))
-            ;; For convenience, when point is at bol on the first
-            ;; item of the list and no argument is provided, simply
-            ;; toggle checkbox of that item, if any.
-            (org-list-set-checkbox begin struct new-box)))
-          (when (equal
-                 (org-list-write-struct
-                  struct (org-list-parents-alist struct) old-struct)
-                 old-struct)
-            (message "Cannot update this checkbox"))
-          (org-update-checkbox-count-maybe)))
        ((or `property-drawer `node-property)
         (call-interactively #'org-property-action))
        (`radio-target
@@ -17947,6 +17668,7 @@ Use `\\[org-edit-special]' to edit table.el tables"))
           "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here"))))))))
 
 (defun org-mode-restart ()
+"Restart `org-mode'."
   (interactive)
   (let ((indent-status (bound-and-true-p org-indent-mode)))
     (funcall major-mode)
@@ -17978,13 +17700,17 @@ Move point to the beginning of first heading or end 
of buffer."
 (defun org-kill-note-or-show-branches ()
   "Abort storing current note, or show just branches."
   (interactive)
-  (if org-finish-function
-      (let ((org-note-abort t))
-        (funcall org-finish-function))
-    (if (org-before-first-heading-p)
-        (org-show-branches-buffer)
-      (outline-hide-subtree)
-      (outline-show-branches))))
+  (cond (org-finish-function
+        (let ((org-note-abort t)) (funcall org-finish-function)))
+       ((org-before-first-heading-p)
+        (org-show-branches-buffer)
+        (org-hide-archived-subtrees (point-min) (point-max)))
+       (t
+        (let ((beg (progn (org-back-to-heading) (point)))
+              (end (save-excursion (org-end-of-subtree t t) (point))))
+          (outline-hide-subtree)
+          (outline-show-branches)
+          (org-hide-archived-subtrees beg end)))))
 
 (defun org-delete-indentation (&optional arg)
   "Join current line to previous and fix whitespace at join.
@@ -17992,7 +17718,9 @@ Move point to the beginning of first heading or end of 
buffer."
 If previous line is a headline add to headline title.  Otherwise
 the function calls `delete-indentation'.
 
-With a non-nil optional argument, join it to the following one."
+I.e. with a non-nil optional argument, join the line with the
+following one.  If there is a region then join the lines in that
+region."
   (interactive "*P")
   (if (save-excursion
        (beginning-of-line (if arg 1 0))
@@ -18017,7 +17745,8 @@ With a non-nil optional argument, join it to the 
following one."
         ((not tags-column))            ;no tags
         (org-auto-align-tags (org-align-tags))
         (t (org--align-tags-here tags-column)))) ;preserve tags column
-    (delete-indentation arg)))
+    (let ((current-prefix-arg arg))
+      (call-interactively #'delete-indentation))))
 
 (defun org-open-line (n)
   "Insert a new row in tables, call `open-line' elsewhere.
@@ -18029,20 +17758,31 @@ call `open-line' on the very first character."
       (org-table-insert-row)
     (open-line n)))
 
-(defun org-return (&optional indent)
+(defun org--newline (indent arg interactive)
+  "Call `newline-and-indent' or just `newline'.
+If INDENT is non-nil, call `newline-and-indent' with ARG to
+indent unconditionally; otherwise, call `newline' with ARG and
+INTERACTIVE, which can trigger indentation if
+`electric-indent-mode' is enabled."
+  (if indent
+      (org-newline-and-indent arg)
+    (newline arg interactive)))
+
+(defun org-return (&optional indent arg interactive)
   "Goto next table row or insert a newline.
 
 Calls `org-table-next-row' or `newline', depending on context.
 
 When optional INDENT argument is non-nil, call
-`newline-and-indent' instead of `newline'.
+`newline-and-indent' with ARG, otherwise call `newline' with ARG
+and INTERACTIVE.
 
 When `org-return-follows-link' is non-nil and point is on
 a timestamp or a link, call `org-open-at-point'.  However, it
 will not happen if point is in a table or on a \"dead\"
 object (e.g., within a comment).  In these case, you need to use
 `org-open-at-point' directly."
-  (interactive)
+  (interactive "i\nP\np")
   (let ((context (if org-return-follows-link (org-element-context)
                   (org-element-at-point))))
     (cond
@@ -18093,45 +17833,47 @@ object (e.g., within a comment).  In these case, you 
need to use
         (t (org--align-tags-here tags-column))) ;preserve tags column
        (end-of-line)
        (org-show-entry)
-       (if indent (newline-and-indent) (newline))
+       (org--newline indent arg interactive)
        (when string (save-excursion (insert (org-trim string))))))
      ;; In a list, make sure indenting keeps trailing text within.
-     ((and indent
-          (not (eolp))
+     ((and (not (eolp))
           (org-element-lineage context '(item)))
       (let ((trailing-data
             (delete-and-extract-region (point) (line-end-position))))
-       (newline-and-indent)
+       (org--newline indent arg interactive)
        (save-excursion (insert trailing-data))))
      (t
       ;; Do not auto-fill when point is in an Org property drawer.
       (let ((auto-fill-function (and (not (org-at-property-p))
                                     auto-fill-function)))
-       (if indent
-           (newline-and-indent)
-         (newline)))))))
+       (org--newline indent arg interactive))))))
 
-(defun org-return-indent ()
-  "Goto next table row or insert a newline and indent.
-Calls `org-table-next-row' or `newline-and-indent', depending on
-context.  See the individual commands for more information."
+(defun org-return-and-maybe-indent ()
+  "Goto next table row, or insert a newline.
+Call `org-table-next-row' or `org-return', depending on context.
+See the individual commands for more information.
+
+When inserting a newline, indent the new line if
+`electric-indent-mode' is disabled."
   (interactive)
-  (org-return t))
+  (org-return (not electric-indent-mode)))
 
 (defun org-ctrl-c-tab (&optional arg)
   "Toggle columns width in a table, or show children.
 Call `org-table-toggle-column-width' if point is in a table.
-Otherwise, call `org-show-children'.  ARG is the level to hide."
+Otherwise provide a compact view of the children.  ARG is the
+level to hide."
   (interactive "p")
-  (if (org-at-table-p)
-      (call-interactively #'org-table-toggle-column-width)
-    (if (org-before-first-heading-p)
-        (progn
-          (org-flag-above-first-heading)
-          (outline-hide-sublevels (or arg 1))
-          (goto-char (point-min)))
-      (outline-hide-subtree)
-      (org-show-children arg))))
+  (cond
+   ((org-at-table-p)
+    (call-interactively #'org-table-toggle-column-width))
+   ((org-before-first-heading-p)
+    (save-excursion
+      (org-flag-above-first-heading)
+      (outline-hide-sublevels (or arg 1))))
+   (t
+    (outline-hide-subtree)
+    (org-show-children arg))))
 
 (defun org-ctrl-c-star ()
   "Compute table, or change heading status of lines.
@@ -18275,79 +18017,14 @@ an argument, unconditionally call 
`org-insert-heading'."
                                (t #'org-insert-heading)))))
 
 ;;; Menu entries
-
 (defsubst org-in-subtree-not-table-p ()
   "Are we in a subtree and not in a table?"
   (and (not (org-before-first-heading-p))
        (not (org-at-table-p))))
 
 ;; Define the Org mode menus
-(easy-menu-define org-tbl-menu org-mode-map "Tbl menu"
-  '("Tbl"
-    ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p)]
-    ["Next Field" org-cycle (org-at-table-p)]
-    ["Previous Field" org-shifttab (org-at-table-p)]
-    ["Next Row" org-return (org-at-table-p)]
-    "--"
-    ["Blank Field" org-table-blank-field (org-at-table-p)]
-    ["Edit Field" org-table-edit-field (org-at-table-p)]
-    ["Copy Field from Above" org-table-copy-down (org-at-table-p)]
-    "--"
-    ("Column"
-     ["Move Column Left" org-metaleft (org-at-table-p)]
-     ["Move Column Right" org-metaright (org-at-table-p)]
-     ["Delete Column" org-shiftmetaleft (org-at-table-p)]
-     ["Insert Column" org-shiftmetaright (org-at-table-p)]
-     ["Shrink Column" org-table-toggle-column-width (org-at-table-p)])
-    ("Row"
-     ["Move Row Up" org-metaup (org-at-table-p)]
-     ["Move Row Down" org-metadown (org-at-table-p)]
-     ["Delete Row" org-shiftmetaup (org-at-table-p)]
-     ["Insert Row" org-shiftmetadown (org-at-table-p)]
-     ["Sort lines in region" org-table-sort-lines (org-at-table-p)]
-     "--"
-     ["Insert Hline" org-ctrl-c-minus (org-at-table-p)])
-    ("Rectangle"
-     ["Copy Rectangle" org-copy-special (org-at-table-p)]
-     ["Cut Rectangle" org-cut-special (org-at-table-p)]
-     ["Paste Rectangle" org-paste-special (org-at-table-p)]
-     ["Fill Rectangle" org-table-wrap-region (org-at-table-p)])
-    "--"
-    ("Calculate"
-     ["Set Column Formula" org-table-eval-formula (org-at-table-p)]
-     ["Set Field Formula" (org-table-eval-formula '(4)) :active 
(org-at-table-p) :keys "C-u C-c ="]
-     ["Edit Formulas" org-edit-special (org-at-table-p)]
-     "--"
-     ["Recalculate line" org-table-recalculate (org-at-table-p)]
-     ["Recalculate all" (lambda () (interactive) (org-table-recalculate '(4))) 
:active (org-at-table-p) :keys "C-u C-c *"]
-     ["Iterate all" (lambda () (interactive) (org-table-recalculate '(16))) 
:active (org-at-table-p) :keys "C-u C-u C-c *"]
-     "--"
-     ["Toggle Recalculate Mark" org-table-rotate-recalc-marks (org-at-table-p)]
-     "--"
-     ["Sum Column/Rectangle" org-table-sum
-      (or (org-at-table-p) (org-region-active-p))]
-     ["Which Column?" org-table-current-column (org-at-table-p)])
-    ["Debug Formulas"
-     org-table-toggle-formula-debugger
-     :style toggle :selected (bound-and-true-p org-table-formula-debug)]
-    ["Show Col/Row Numbers"
-     org-table-toggle-coordinate-overlays
-     :style toggle
-     :selected (bound-and-true-p org-table-overlay-coordinates)]
-    "--"
-    ["Create" org-table-create (not (org-at-table-p))]
-    ["Convert Region" org-table-convert-region (not (org-at-table-p 'any))]
-    ["Import from File" org-table-import (not (org-at-table-p))]
-    ["Export to File" org-table-export (org-at-table-p)]
-    "--"
-    ["Create/Convert from/to table.el" org-table-create-with-table.el t]
-    "--"
-    ("Plot"
-     ["Ascii plot" orgtbl-ascii-plot :active (org-at-table-p) :keys "C-c \" a"]
-     ["Gnuplot" org-plot/gnuplot :active (org-at-table-p) :keys "C-c \" g"])))
-
 (easy-menu-define org-org-menu org-mode-map "Org menu"
-  '("Org"
+  `("Org"
     ("Show/Hide"
      ["Cycle Visibility" org-cycle :active (or (bobp) (outline-on-heading-p))]
      ["Cycle Global Visibility" org-shifttab :active (not (org-at-table-p))]
@@ -18367,8 +18044,6 @@ an argument, unconditionally call `org-insert-heading'."
      "--"
      ["Jump" org-goto t])
     ("Edit Structure"
-     ["Refile Subtree" org-refile (org-in-subtree-not-table-p)]
-     "--"
      ["Move Subtree Up" org-metaup (org-at-heading-p)]
      ["Move Subtree Down" org-metadown (org-at-heading-p)]
      "--"
@@ -18391,6 +18066,7 @@ an argument, unconditionally call `org-insert-heading'."
      ["Convert to odd/even levels" org-convert-to-oddeven-levels t])
     ("Editing"
      ["Emphasis..." org-emphasize t]
+     ["Add block structure" org-insert-structure-template t]
      ["Edit Source Example" org-edit-special t]
      "--"
      ["Footnote new/jump" org-footnote-action t]
@@ -18400,8 +18076,7 @@ an argument, unconditionally call `org-insert-heading'."
      "--"
      ["Move Subtree to Archive file" org-archive-subtree 
(org-in-subtree-not-table-p)]
      ["Toggle ARCHIVE tag" org-toggle-archive-tag (org-in-subtree-not-table-p)]
-     ["Move subtree to Archive sibling" org-archive-to-archive-sibling 
(org-in-subtree-not-table-p)]
-     )
+     ["Move subtree to Archive sibling" org-archive-to-archive-sibling 
(org-in-subtree-not-table-p)])
     "--"
     ("Hyperlinks"
      ["Store Link (Global)" org-store-link t]
@@ -18518,13 +18193,6 @@ an argument, unconditionally call 
`org-insert-heading'."
       (org-inside-LaTeX-fragment-p)]
      ["Insert citation" org-reftex-citation t])
     "--"
-    ("MobileOrg"
-     ["Push Files and Views" org-mobile-push t]
-     ["Get Captured and Flagged" org-mobile-pull t]
-     ["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys 
"\\[org-agenda] ?"]
-     "--"
-     ["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t])
-    "--"
     ("Documentation"
      ["Show Version" org-version t]
      ["Info Documentation" org-info t]
@@ -18540,6 +18208,70 @@ an argument, unconditionally call 
`org-insert-heading'."
      ["Reload Org (after update)" org-reload t]
      ["Reload Org uncompiled" (org-reload t) :active t :keys "C-u C-c C-x 
!"])))
 
+(easy-menu-define org-tbl-menu org-mode-map "Org Table menu"
+  '("Table"
+    ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p)]
+    ["Next Field" org-cycle (org-at-table-p)]
+    ["Previous Field" org-shifttab (org-at-table-p)]
+    ["Next Row" org-return (org-at-table-p)]
+    "--"
+    ["Blank Field" org-table-blank-field (org-at-table-p)]
+    ["Edit Field" org-table-edit-field (org-at-table-p)]
+    ["Copy Field from Above" org-table-copy-down (org-at-table-p)]
+    "--"
+    ("Column"
+     ["Move Column Left" org-metaleft (org-at-table-p)]
+     ["Move Column Right" org-metaright (org-at-table-p)]
+     ["Delete Column" org-shiftmetaleft (org-at-table-p)]
+     ["Insert Column" org-shiftmetaright (org-at-table-p)]
+     ["Shrink Column" org-table-toggle-column-width (org-at-table-p)])
+    ("Row"
+     ["Move Row Up" org-metaup (org-at-table-p)]
+     ["Move Row Down" org-metadown (org-at-table-p)]
+     ["Delete Row" org-shiftmetaup (org-at-table-p)]
+     ["Insert Row" org-shiftmetadown (org-at-table-p)]
+     ["Sort lines in region" org-table-sort-lines (org-at-table-p)]
+     "--"
+     ["Insert Hline" org-ctrl-c-minus (org-at-table-p)])
+    ("Rectangle"
+     ["Copy Rectangle" org-copy-special (org-at-table-p)]
+     ["Cut Rectangle" org-cut-special (org-at-table-p)]
+     ["Paste Rectangle" org-paste-special (org-at-table-p)]
+     ["Fill Rectangle" org-table-wrap-region (org-at-table-p)])
+    "--"
+    ("Calculate"
+     ["Set Column Formula" org-table-eval-formula (org-at-table-p)]
+     ["Set Field Formula" (org-table-eval-formula '(4)) :active 
(org-at-table-p) :keys "C-u C-c ="]
+     ["Edit Formulas" org-edit-special (org-at-table-p)]
+     "--"
+     ["Recalculate line" org-table-recalculate (org-at-table-p)]
+     ["Recalculate all" (lambda () (interactive) (org-table-recalculate '(4))) 
:active (org-at-table-p) :keys "C-u C-c *"]
+     ["Iterate all" (lambda () (interactive) (org-table-recalculate '(16))) 
:active (org-at-table-p) :keys "C-u C-u C-c *"]
+     "--"
+     ["Toggle Recalculate Mark" org-table-rotate-recalc-marks (org-at-table-p)]
+     "--"
+     ["Sum Column/Rectangle" org-table-sum
+      (or (org-at-table-p) (org-region-active-p))]
+     ["Which Column?" org-table-current-column (org-at-table-p)])
+    ["Debug Formulas"
+     org-table-toggle-formula-debugger
+     :style toggle :selected (bound-and-true-p org-table-formula-debug)]
+    ["Show Col/Row Numbers"
+     org-table-toggle-coordinate-overlays
+     :style toggle
+     :selected (bound-and-true-p org-table-overlay-coordinates)]
+    "--"
+    ["Create" org-table-create (not (org-at-table-p))]
+    ["Convert Region" org-table-convert-region (not (org-at-table-p 'any))]
+    ["Import from File" org-table-import (not (org-at-table-p))]
+    ["Export to File" org-table-export (org-at-table-p)]
+    "--"
+    ["Create/Convert from/to table.el" org-table-create-with-table.el t]
+    "--"
+    ("Plot"
+     ["Ascii plot" orgtbl-ascii-plot :active (org-at-table-p) :keys "C-c \" a"]
+     ["Gnuplot" org-plot/gnuplot :active (org-at-table-p) :keys "C-c \" g"])))
+
 (defun org-info (&optional node)
   "Read documentation for Org in the info system.
 With optional NODE, go directly to that node."
@@ -18576,14 +18308,22 @@ information about your Org version and configuration."
         (erase-buffer)
         (insert "You are about to submit a bug report to the Org mailing list.
 
-We would like to add your full Org and Outline configuration to the
-bug report.  This greatly simplifies the work of the maintainer and
-other experts on the mailing list.
+If your report is about Org installation, please read this section:
+https://orgmode.org/org.html#Installation
+
+Please read https://orgmode.org/org.html#Feedback on how to make
+a good report, it will help Org contributors fixing your problem.
+
+Search https://lists.gnu.org/archive/html/emacs-orgmode/ to see
+if the issue you are about to raise has already been dealt with.
 
-HOWEVER, some variables you have customized may contain private
+We also would like to add your full Org and Outline configuration
+to the bug report.  It will help us debugging the issue.
+
+*HOWEVER*, some variables you have customized may contain private
 information.  The names of customers, colleagues, or friends, might
-appear in the form of file names, tags, todo states, or search strings.
-If you answer yes to the prompt, you might want to check and remove
+appear in the form of file names, tags, todo states or search strings.
+If you answer \"yes\" to the prompt, you might want to check and remove
 such private information before sending the email.")
         (add-text-properties (point-min) (point-max) '(face org-warning))
         (when (yes-or-no-p "Include your Org configuration ")
@@ -18613,6 +18353,7 @@ Your bug report will be posted to the Org mailing list.
 
 
 (defun org-install-agenda-files-menu ()
+  "Install agenda file menu."
   (let ((bl (buffer-list)))
     (save-excursion
       (while bl
@@ -18845,7 +18586,8 @@ and :keyword."
       (when (memq 'org-formula faces)
        (push (list :table-special
                    (previous-single-property-change p 'face)
-                   (next-single-property-change p 'face)) clist)))
+                   (next-single-property-change p 'face))
+             clist)))
      ((org-at-table-p 'any)
       (push (list :table-table) clist)))
     (goto-char p)
@@ -18858,14 +18600,16 @@ and :keyword."
                                  (re-search-backward "[ \t]*\\(#+BEGIN: 
clocktable\\)" nil t))
                              (match-beginning 1))
                         (and (re-search-forward "[ \t]*#\\+END:?" nil t)
-                             (match-end 0))) clist))
+                             (match-end 0)))
+                  clist))
            ((org-in-src-block-p)
             (push (list :src-block
                         (and (or (looking-at "[ \t]*\\(#\\+BEGIN_SRC\\)")
                                  (re-search-backward "[ \t]*\\(#+BEGIN_SRC\\)" 
nil t))
                              (match-beginning 1))
                         (and (search-forward "#+END_SRC" nil t)
-                             (match-beginning 0))) clist))))
+                             (match-beginning 0)))
+                  clist))))
     (goto-char p)
 
     ;; Now the small context
@@ -18875,20 +18619,24 @@ and :keyword."
      ((memq 'org-link faces)
       (push (list :link
                  (previous-single-property-change p 'face)
-                 (next-single-property-change p 'face)) clist))
+                 (next-single-property-change p 'face))
+           clist))
      ((memq 'org-special-keyword faces)
       (push (list :keyword
                  (previous-single-property-change p 'face)
-                 (next-single-property-change p 'face)) clist))
+                 (next-single-property-change p 'face))
+           clist))
      ((setq o (cl-some
               (lambda (o)
                 (and (eq (overlay-get o 'org-overlay-type) 'org-latex-overlay)
                      o))
               (overlays-at (point))))
       (push (list :latex-fragment
-                 (overlay-start o) (overlay-end o)) clist)
+                 (overlay-start o) (overlay-end o))
+           clist)
       (push (list :latex-preview
-                 (overlay-start o) (overlay-end o)) clist))
+                 (overlay-start o) (overlay-end o))
+           clist))
      ((org-inside-LaTeX-fragment-p)
       ;; FIXME: positions wrong.
       (push (list :latex-fragment (point) (point)) clist)))
@@ -19017,7 +18765,7 @@ earliest time on the cursor date that Org treats as 
that date
   (let (date day defd tp hod mod)
     (when with-time
       (setq tp (get-text-property (point) 'time))
-      (when (and tp (string-match "\\([0-9][0-9]\\):\\([0-9][0-9]\\)" tp))
+      (when (and tp (string-match "\\([0-2]?[0-9]\\):\\([0-5][0-9]\\)" tp))
        (setq hod (string-to-number (match-string 1 tp))
              mod (string-to-number (match-string 2 tp))))
       (or tp (let ((now (decode-time)))
@@ -19075,6 +18823,11 @@ ELEMENT."
         (t
          (goto-char start)
          (current-indentation))))
+      ((and
+       (eq org-adapt-indentation 'headline-data)
+       (memq type '(planning clock node-property property-drawer drawer)))
+       (org--get-expected-indentation
+       (org-element-property :parent element) t))
       ((memq type '(headline inlinetask nil))
        (if (org-match-line "[ \t]*$")
           (org--get-expected-indentation element t)
@@ -19088,7 +18841,8 @@ ELEMENT."
       ;; At first line: indent according to previous sibling, if any,
       ;; ignoring footnote definitions and inline tasks, or parent's
       ;; contents.
-      ((= (line-beginning-position) start)
+      ((and ( = (line-beginning-position) start)
+           (eq org-adapt-indentation t))
        (catch 'exit
         (while t
           (if (= (point-min) start) (throw 'exit 0)
@@ -19113,7 +18867,7 @@ ELEMENT."
                            (org--get-expected-indentation
                             (org-element-property :parent previous) t))))))))))
       ;; Otherwise, move to the first non-blank line above.
-      (t
+      ((not (eq org-adapt-indentation 'headline-data))
        (beginning-of-line)
        (let ((pos (point)))
         (skip-chars-backward " \r\t\n")
@@ -19155,7 +18909,9 @@ ELEMENT."
             (goto-char start)
             (current-indentation)))
          ;; In any other case, indent like the current line.
-         (t (current-indentation)))))))))
+         (t (current-indentation)))))
+      ;; Finally, no indentation is needed, fall back to 0.
+      (t (current-indentation))))))
 
 (defun org--align-node-property ()
   "Align node property at point.
@@ -19213,31 +18969,28 @@ list structure.  Instead, use 
\\<org-mode-map>`\\[org-shiftmetaleft]' or \
 
 Also align node properties according to `org-property-format'."
   (interactive)
-  (cond
-   ((org-at-heading-p) 'noindent)
-   (t
+  (unless (org-at-heading-p)
     (let* ((element (save-excursion (beginning-of-line) 
(org-element-at-point)))
           (type (org-element-type element)))
       (cond ((and (memq type '(plain-list item))
                  (= (line-beginning-position)
                     (org-element-property :post-affiliated element)))
-            'noindent)
+            nil)
            ((and (eq type 'latex-environment)
                  (>= (point) (org-element-property :post-affiliated element))
-                 (< (point) (org-with-wide-buffer
-                             (goto-char (org-element-property :end element))
-                             (skip-chars-backward " \r\t\n")
-                             (line-beginning-position 2))))
-            'noindent)
+                 (< (point)
+                    (org-with-point-at (org-element-property :end element)
+                      (skip-chars-backward " \t\n")
+                      (line-beginning-position 2))))
+            nil)
            ((and (eq type 'src-block)
                  org-src-tab-acts-natively
                  (> (line-beginning-position)
                     (org-element-property :post-affiliated element))
                  (< (line-beginning-position)
-                    (org-with-wide-buffer
-                     (goto-char (org-element-property :end element))
-                     (skip-chars-backward " \r\t\n")
-                     (line-beginning-position))))
+                    (org-with-point-at (org-element-property :end element)
+                      (skip-chars-backward " \t\n")
+                      (line-beginning-position))))
             (org-babel-do-key-sequence-in-edit-buffer (kbd "TAB")))
            (t
             (let ((column (org--get-expected-indentation element nil)))
@@ -19249,7 +19002,7 @@ Also align node properties according to 
`org-property-format'."
             (when (eq type 'node-property)
               (let ((column (current-column)))
                 (org--align-node-property)
-                (org-move-to-column column)))))))))
+                (org-move-to-column column))))))))
 
 (defun org-indent-region (start end)
   "Indent each non-blank line in the region.
@@ -19664,12 +19417,17 @@ filling the current element."
        (unwind-protect
            (progn
              (goto-char (region-end))
+             (skip-chars-backward " \t\n")
              (while (> (point) start)
-               (org-backward-paragraph)
-               (org-fill-element justify)))
+               (org-fill-element justify)
+               (org-backward-paragraph)))
          (goto-char origin)
          (set-marker origin nil))))
-     (t (org-fill-element justify)))
+     (t
+      (save-excursion
+       (when (org-match-line "[ \t]*$")
+         (skip-chars-forward " \t\n"))
+       (org-fill-element justify))))
     ;; If we didn't change anything in the buffer (and the buffer was
     ;; previously unmodified), then flip the modification status back
     ;; to "unchanged".
@@ -20371,7 +20129,8 @@ depending on context."
       (if (<= end (point))             ;on tags part
          (kill-region (point) (line-end-position))
        (kill-region (point) end)))
-    (org-align-tags))
+    ;; Only align tags when we are still on a heading:
+    (if (org-at-heading-p) (org-align-tags)))
    (t (kill-region (point) (line-end-position)))))
 
 (defun org-yank (&optional arg)
@@ -20480,8 +20239,18 @@ interactive command with similar behavior."
   "Call `outline-back-to-heading', but provide a better error message."
   (condition-case nil
       (outline-back-to-heading invisible-ok)
-    (error (error "Before first headline at position %d in buffer %s"
-                 (point) (current-buffer)))))
+    (error
+     (user-error "Before first headline at position %d in buffer %s"
+                (point) (current-buffer)))))
+
+(defun org-back-to-heading-or-point-min (&optional invisible-ok)
+  "Go back to heading or first point in buffer.
+If point is before first heading go to first point in buffer
+instead of back to heading."
+  (condition-case nil
+      (outline-back-to-heading invisible-ok)
+    (error
+     (goto-char (point-min)))))
 
 (defun org-before-first-heading-p ()
   "Before first heading?"
@@ -20509,12 +20278,31 @@ unless optional argument NO-INHERITANCE is non-nil."
    (t
     (save-excursion (and (org-up-heading-safe) 
(org-in-commented-heading-p))))))
 
+(defun org-in-archived-heading-p (&optional no-inheritance)
+  "Non-nil if point is under an archived heading.
+This function also checks ancestors of the current headline,
+unless optional argument NO-INHERITANCE is non-nil."
+  (cond
+   ((org-before-first-heading-p) nil)
+   ((let ((tags (org-get-tags nil 'local)))
+      (and tags
+          (cl-some (apply-partially #'string= org-archive-tag) tags))))
+   (no-inheritance nil)
+   (t
+    (save-excursion (and (org-up-heading-safe) (org-in-archived-heading-p))))))
+
 (defun org-at-comment-p nil
   "Return t if cursor is in a commented line."
   (save-excursion
     (save-match-data
       (beginning-of-line)
-      (looking-at "^[ \t]*# "))))
+      (looking-at org-comment-regexp))))
+
+(defun org-at-keyword-p nil
+  "Return t if cursor is at a keyword-line."
+  (save-excursion
+    (move-beginning-of-line 1)
+    (looking-at org-keyword-regexp)))
 
 (defun org-at-drawer-p nil
   "Return t if cursor is at a drawer keyword."
@@ -20563,6 +20351,17 @@ make a significant difference in outlines with very 
many siblings."
           (re-search-backward (format "^\\*\\{1,%d\\} " level-up) nil t)
           (funcall outline-level)))))
 
+(defun org-up-heading-or-point-min ()
+  "Move to the heading line of which the present is a subheading, or point-min.
+This version is needed to make point-min behave like a virtual
+heading of level 0 for property-inheritance.  It will return the
+level of the headline found (down to 0) or nil if already at a
+point before the first headline or at point-min."
+  (when (ignore-errors (org-back-to-heading t))
+    (if (< 1 (funcall outline-level))
+       (org-up-heading-safe)
+      (unless (= (point) (point-min)) (goto-char (point-min))))))
+
 (defun org-first-sibling-p ()
   "Is this heading the first child of its parents?"
   (interactive)
@@ -20663,28 +20462,31 @@ If there is no such heading, return nil."
 (defun org-end-of-subtree (&optional invisible-ok to-heading)
   "Goto to the end of a subtree."
   ;; This contains an exact copy of the original function, but it uses
-  ;; `org-back-to-heading', to make it work also in invisible
-  ;; trees.  And is uses an invisible-ok argument.
+  ;; `org-back-to-heading-or-point-min', to make it work also in invisible
+  ;; trees and before first headline.  And is uses an invisible-ok argument.
   ;; Under Emacs this is not needed, but the old outline.el needs this fix.
   ;; Furthermore, when used inside Org, finding the end of a large subtree
   ;; with many children and grandchildren etc, this can be much faster
   ;; than the outline version.
-  (org-back-to-heading invisible-ok)
+  (org-back-to-heading-or-point-min invisible-ok)
   (let ((first t)
        (level (funcall outline-level)))
-    (if (and (derived-mode-p 'org-mode) (< level 1000))
-       ;; A true heading (not a plain list item), in Org
-       ;; This means we can easily find the end by looking
-       ;; only for the right number of stars.  Using a regexp to do
-       ;; this is so much faster than using a Lisp loop.
-       (let ((re (concat "^\\*\\{1," (int-to-string level) "\\} ")))
-         (forward-char 1)
-         (and (re-search-forward re nil 'move) (beginning-of-line 1)))
-      ;; something else, do it the slow way
-      (while (and (not (eobp))
-                 (or first (> (funcall outline-level) level)))
-       (setq first nil)
-       (outline-next-heading)))
+    (cond ((= level 0)
+          (goto-char (point-max)))
+         ((and (derived-mode-p 'org-mode) (< level 1000))
+          ;; A true heading (not a plain list item), in Org
+          ;; This means we can easily find the end by looking
+          ;; only for the right number of stars.  Using a regexp to do
+          ;; this is so much faster than using a Lisp loop.
+          (let ((re (concat "^\\*\\{1," (number-to-string level) "\\} ")))
+            (forward-char 1)
+            (and (re-search-forward re nil 'move) (beginning-of-line 1))))
+         (t
+          ;; something else, do it the slow way
+          (while (and (not (eobp))
+                      (or first (> (funcall outline-level) level)))
+            (setq first nil)
+            (outline-next-heading))))
     (unless to-heading
       (when (memq (preceding-char) '(?\n ?\^M))
        ;; Go to end of line before heading
@@ -20696,26 +20498,50 @@ If there is no such heading, return nil."
 
 (defun org-end-of-meta-data (&optional full)
   "Skip planning line and properties drawer in current entry.
-When optional argument FULL is non-nil, also skip empty lines,
-clocking lines and regular drawers at the beginning of the
-entry."
+
+When optional argument FULL is t, also skip planning information,
+clocking lines and any kind of drawer.
+
+When FULL is non-nil but not t, skip planning information,
+clocking lines and only non-regular drawers, i.e. properties and
+logbook drawers."
   (org-back-to-heading t)
   (forward-line)
+  ;; Skip planning information.
   (when (looking-at-p org-planning-line-re) (forward-line))
+  ;; Skip property drawer.
   (when (looking-at org-property-drawer-re)
     (goto-char (match-end 0))
     (forward-line))
+  ;; When FULL is not nil, skip more.
   (when (and full (not (org-at-heading-p)))
     (catch 'exit
       (let ((end (save-excursion (outline-next-heading) (point)))
            (re (concat "[ \t]*$" "\\|" org-clock-line-re)))
        (while (not (eobp))
-         (cond ((looking-at-p org-drawer-regexp)
-                (if (re-search-forward "^[ \t]*:END:[ \t]*$" end t)
-                    (forward-line)
-                  (throw 'exit t)))
-               ((looking-at-p re) (forward-line))
-               (t (throw 'exit t))))))))
+         (cond ;; Skip clock lines.
+          ((looking-at-p re) (forward-line))
+          ;; Skip logbook drawer.
+          ((looking-at-p org-logbook-drawer-re)
+           (if (re-search-forward "^[ \t]*:END:[ \t]*$" end t)
+               (forward-line)
+             (throw 'exit t)))
+          ;; When FULL is t, skip regular drawer too.
+          ((and (eq full t) (looking-at-p org-drawer-regexp))
+           (if (re-search-forward "^[ \t]*:END:[ \t]*$" end t)
+               (forward-line)
+             (throw 'exit t)))
+          (t (throw 'exit t))))))))
+
+(defun org--line-fully-invisible-p ()
+  "Return non-nil if the current line is fully invisible."
+  (let ((line-beg (line-beginning-position))
+       (line-pos (1- (line-end-position)))
+       (is-invisible t))
+    (while (and (< line-beg line-pos) is-invisible)
+      (setq is-invisible (org-invisible-p line-pos))
+      (setq line-pos (1- line-pos)))
+    is-invisible))
 
 (defun org-forward-heading-same-level (arg &optional invisible-ok)
   "Move forward to the ARG'th subheading at same level as this one.
@@ -20738,8 +20564,14 @@ non-nil it will also look at invisible ones."
            (cond ((< l level) (setq count 0))
                  ((and (= l level)
                        (or invisible-ok
-                           (not (org-invisible-p
-                                 (line-beginning-position)))))
+                           ;; FIXME: See commit a700fadd72 and the
+                           ;; related discussion on why using
+                           ;; `org--line-fully-invisible-p' is needed
+                           ;; here, which is to serve the needs of an
+                           ;; external package.  If the change is
+                           ;; wrong regarding Org itself, it should
+                           ;; be removed.
+                           (not (org--line-fully-invisible-p))))
                   (cl-decf count)
                   (when (= l level) (setq result (point)))))))
        (goto-char result))
@@ -20752,175 +20584,332 @@ Stop at the first and last subheadings of a 
superior heading."
   (org-forward-heading-same-level (if arg (- arg) -1) invisible-ok))
 
 (defun org-next-visible-heading (arg)
-  "Move to the next visible heading.
-
-This function wraps `outline-next-visible-heading' with
-`org-with-limited-levels' in order to skip over inline tasks and
-respect customization of `org-odd-levels-only'."
+  "Move to the next visible heading line.
+With ARG, repeats or can move backward if negative."
   (interactive "p")
-  (org-with-limited-levels
-   (outline-next-visible-heading arg)))
+  (let ((regexp (concat "^" (org-get-limited-outline-regexp))))
+    (if (< arg 0)
+       (beginning-of-line)
+      (end-of-line))
+    (while (and (< arg 0) (re-search-backward regexp nil :move))
+      (unless (bobp)
+       (while (pcase (get-char-property-and-overlay (point) 'invisible)
+                (`(outline . ,o)
+                 (goto-char (overlay-start o))
+                 (re-search-backward regexp nil :move))
+                (_ nil))))
+      (cl-incf arg))
+    (while (and (> arg 0) (re-search-forward regexp nil t))
+      (while (pcase (get-char-property-and-overlay (point) 'invisible)
+              (`(outline . ,o)
+               (goto-char (overlay-end o))
+               (re-search-forward regexp nil :move))
+              (_
+               (end-of-line)
+               nil)))                  ;leave the loop
+      (cl-decf arg))
+    (if (> arg 0) (goto-char (point-max)) (beginning-of-line))))
 
 (defun org-previous-visible-heading (arg)
   "Move to the previous visible heading.
-
-This function wraps `outline-previous-visible-heading' with
-`org-with-limited-levels' in order to skip over inline tasks and
-respect customization of `org-odd-levels-only'."
+With ARG, repeats or can move forward if negative."
   (interactive "p")
-  (org-with-limited-levels
-   (outline-previous-visible-heading arg)))
+  (org-next-visible-heading (- arg)))
+
+(defun org-forward-paragraph (&optional arg)
+  "Move forward by a paragraph, or equivalent, unit.
+
+With argument ARG, do it ARG times;
+a negative argument ARG = -N means move backward N paragraphs.
+
+The function moves point between two structural
+elements (paragraphs, tables, lists, etc.).
+
+It also provides the following special moves for convenience:
+
+  - on a table or a property drawer, move to its beginning;
+  - on comment, example, export, source and verse blocks, stop
+    at blank lines;
+  - skip consecutive clocks, diary S-exps, and keywords."
+  (interactive "^p")
+  (unless arg (setq arg 1))
+  (if (< arg 0) (org-backward-paragraph (- arg))
+    (while (and (> arg 0) (not (eobp)))
+      (org--forward-paragraph-once)
+      (cl-decf arg))
+    ;; Return moves left.
+    arg))
+
+(defun org-backward-paragraph (&optional arg)
+  "Move backward by a paragraph, or equivalent, unit.
+
+With argument ARG, do it ARG times;
+a negative argument ARG = -N means move forward N paragraphs.
 
-(defun org-forward-paragraph ()
-  "Move forward to beginning of next paragraph or equivalent.
+The function moves point between two structural
+elements (paragraphs, tables, lists, etc.).
 
-The function moves point to the beginning of the next visible
-structural element, which can be a paragraph, a table, a list
-item, etc.  It also provides some special moves for convenience:
+It also provides the following special moves for convenience:
 
-  - On an affiliated keyword, jump to the beginning of the
-    relative element.
-  - On an item or a footnote definition, move to the second
-    element inside, if any.
-  - On a table or a property drawer, jump after it.
-  - On a verse or source block, stop after blank lines."
+  - on a table or a property drawer, move to its beginning;
+  - on comment, example, export, source and verse blocks, stop
+    at blank lines;
+  - skip consecutive clocks, diary S-exps, and keywords."
+  (interactive "^p")
+  (unless arg (setq arg 1))
+  (if (< arg 0) (org-forward-paragraph (- arg))
+    (while (and (> arg 0) (not (bobp)))
+      (org--backward-paragraph-once)
+      (cl-decf arg))
+    ;; Return moves left.
+    arg))
+
+(defun org--paragraph-at-point ()
+  "Return paragraph, or equivalent, element at point.
+
+Paragraph element at point is the element at point, with the
+following special cases:
+
+- treat table rows (resp. node properties) as the table
+  \(resp. property drawer) containing them.
+
+- treat plain lists with an item every line as a whole.
+
+- treat consecutive keywords, clocks, and diary-sexps as a single
+  block.
+
+Function may return a real element, or a pseudo-element with type
+`pseudo-paragraph'."
+  (let* ((e (org-element-at-point))
+        (type (org-element-type e))
+        ;; If we need to fake a new pseudo-element, triplet is
+        ;;
+        ;;   (BEG END PARENT)
+        ;;
+        ;; where BEG and END are element boundaries, and PARENT the
+        ;; element containing it, or nil.
+        (triplet
+         (cond
+          ((memq type '(table property-drawer))
+           (list (org-element-property :begin e)
+                 (org-element-property :end e)
+                 (org-element-property :parent e)))
+          ((memq type '(node-property table-row))
+           (let ((e (org-element-property :parent e)))
+             (list (org-element-property :begin e)
+                   (org-element-property :end e)
+                   (org-element-property :parent e))))
+          ((memq type '(clock diary-sexp keyword))
+           (let* ((regexp (pcase type
+                            (`clock org-clock-line-re)
+                            (`diary-sexp "%%(")
+                            (_ org-keyword-regexp)))
+                  (end (if (< 0 (org-element-property :post-blank e))
+                           (org-element-property :end e)
+                         (org-with-wide-buffer
+                          (forward-line)
+                          (while (looking-at regexp) (forward-line))
+                          (skip-chars-forward " \t\n")
+                          (line-beginning-position))))
+                  (begin (org-with-point-at (org-element-property :begin e)
+                           (while (and (not (bobp)) (looking-at regexp))
+                             (forward-line -1))
+                           ;; We may have gotten one line too far.
+                           (if (looking-at regexp)
+                               (point)
+                             (line-beginning-position 2)))))
+             (list begin end (org-element-property :parent e))))
+          ;; Find the full plain list containing point, the check it
+          ;; contains exactly one line per item.
+          ((let ((l (org-element-lineage e '(plain-list) t)))
+             (while (memq (org-element-type (org-element-property :parent l))
+                          '(item plain-list))
+               (setq l (org-element-property :parent l)))
+             (and l
+                  (org-with-point-at (org-element-property :post-affiliated l)
+                    (forward-line (length (org-element-property :structure l)))
+                    (= (point) (org-element-property :contents-end l)))
+                  ;; Return value.
+                  (list (org-element-property :begin l)
+                        (org-element-property :end l)
+                        (org-element-property :parent l)))))
+          (t nil))))                   ;no triplet: return element
+    (pcase triplet
+      (`(,b ,e ,p)
+       (org-element-create
+       'pseudo-paragraph
+       (list :begin b :end e :parent p :post-blank 0 :post-affiliated b)))
+      (_ e))))
+
+(defun org--forward-paragraph-once ()
+  "Move forward to end of paragraph or equivalent, once.
+See `org-forward-paragraph'."
   (interactive)
-  (unless (eobp)
-    (let* ((deactivate-mark nil)
-          (element (org-element-at-point))
-          (type (org-element-type element))
-          (post-affiliated (org-element-property :post-affiliated element))
-          (contents-begin (org-element-property :contents-begin element))
-          (contents-end (org-element-property :contents-end element))
-          (end (let ((end (org-element-property :end element)) (parent 
element))
-                 (while (and (setq parent (org-element-property :parent 
parent))
-                             (= (org-element-property :contents-end parent) 
end))
-                   (setq end (org-element-property :end parent)))
-                 end)))
-      (cond ((not element)
-            (skip-chars-forward " \r\t\n")
-            (or (eobp) (beginning-of-line)))
-           ;; On affiliated keywords, move to element's beginning.
-           ((< (point) post-affiliated)
-            (goto-char post-affiliated))
-           ;; At a table row, move to the end of the table.  Similarly,
-           ;; at a node property, move to the end of the property
-           ;; drawer.
-           ((memq type '(node-property table-row))
-            (goto-char (org-element-property
-                        :end (org-element-property :parent element))))
-           ((memq type '(property-drawer table)) (goto-char end))
-           ;; Consider blank lines as separators in verse and source
-           ;; blocks to ease editing.
-           ((memq type '(src-block verse-block))
-            (when (eq type 'src-block)
-              (setq contents-end
-                    (save-excursion (goto-char end)
-                                    (skip-chars-backward " \r\t\n")
-                                    (line-beginning-position))))
-            (beginning-of-line)
-            (when (looking-at "[ \t]*$") (skip-chars-forward " \r\t\n"))
-            (if (not (re-search-forward "^[ \t]*$" contents-end t))
-                (goto-char end)
-              (skip-chars-forward " \r\t\n")
-              (if (= (point) contents-end) (goto-char end)
-                (beginning-of-line))))
-           ;; With no contents, just skip element.
-           ((not contents-begin) (goto-char end))
-           ;; If contents are invisible, skip the element altogether.
-           ((org-invisible-p (line-end-position))
-            (cl-case type
-              (headline
-               (org-with-limited-levels (outline-next-visible-heading 1)))
-              ;; At a plain list, make sure we move to the next item
-              ;; instead of skipping the whole list.
-              (plain-list (forward-char)
-                          (org-forward-paragraph))
-              (otherwise (goto-char end))))
-           ((>= (point) contents-end) (goto-char end))
-           ((>= (point) contents-begin)
-            ;; This can only happen on paragraphs and plain lists.
-            (cl-case type
-              (paragraph (goto-char end))
-              ;; At a plain list, try to move to second element in
-              ;; first item, if possible.
-              (plain-list (end-of-line)
-                          (org-forward-paragraph))))
-           ;; When contents start on the middle of a line (e.g. in
-           ;; items and footnote definitions), try to reach first
-           ;; element starting after current line.
-           ((> (line-end-position) contents-begin)
-            (end-of-line)
-            (org-forward-paragraph))
-           (t (goto-char contents-begin))))))
-
-(defun org-backward-paragraph ()
-  "Move backward to start of previous paragraph or equivalent.
-
-The function moves point to the beginning of the current
-structural element, which can be a paragraph, a table, a list
-item, etc., or to the beginning of the previous visible one if
-point is already there.  It also provides some special moves for
-convenience:
-
-  - On an affiliated keyword, jump to the first one.
-  - On a table or a property drawer, move to its beginning.
-  - On comment, example, export, src and verse blocks, stop
-    before blank lines."
+  (save-restriction
+    (widen)
+    (skip-chars-forward " \t\n")
+    (cond
+     ((eobp) nil)
+     ;; When inside a folded part, move out of it.
+     ((pcase (get-char-property-and-overlay (point) 'invisible)
+       (`(,(or `outline `org-hide-block) . ,o)
+        (goto-char (overlay-end o))
+        (forward-line)
+        t)
+       (_ nil)))
+     (t
+      (let* ((element (org--paragraph-at-point))
+            (type (org-element-type element))
+            (contents-begin (org-element-property :contents-begin element))
+            (end (org-element-property :end element))
+            (post-affiliated (org-element-property :post-affiliated element)))
+       (cond
+        ((eq type 'plain-list)
+         (forward-char)
+         (org--forward-paragraph-once))
+        ;; If the element is folded, skip it altogether.
+        ((pcase (org-with-point-at post-affiliated
+                  (get-char-property-and-overlay (line-end-position)
+                                                 'invisible))
+           (`(,(or `outline `org-hide-block) . ,o)
+            (goto-char (overlay-end o))
+            (forward-line)
+            t)
+           (_ nil)))
+        ;; At a greater element, move inside.
+        ((and contents-begin
+              (> contents-begin (point))
+              (not (eq type 'paragraph)))
+         (goto-char contents-begin)
+         ;; Items and footnote definitions contents may not start at
+         ;; the beginning of the line.  In this case, skip until the
+         ;; next paragraph.
+         (cond
+          ((not (bolp)) (org--forward-paragraph-once))
+          ((org-previous-line-empty-p) (forward-line -1))
+          (t nil)))
+        ;; Move between empty lines in some blocks.
+        ((memq type '(comment-block example-block export-block src-block
+                                    verse-block))
+         (let ((contents-start
+                (org-with-point-at post-affiliated
+                  (line-beginning-position 2))))
+           (if (< (point) contents-start)
+               (goto-char contents-start)
+             (let ((contents-end
+                    (org-with-point-at end
+                      (skip-chars-backward " \t\n")
+                      (line-beginning-position))))
+               (cond
+                ((>= (point) contents-end)
+                 (goto-char end)
+                 (skip-chars-backward " \t\n")
+                 (forward-line))
+                ((re-search-forward "^[ \t]*\n" contents-end :move)
+                 (forward-line -1))
+                (t nil))))))
+        (t
+         ;; Move to element's end.
+         (goto-char end)
+         (skip-chars-backward " \t\n")
+         (forward-line))))))))
+
+(defun org--backward-paragraph-once ()
+  "Move backward to start of paragraph or equivalent, once.
+See `org-backward-paragraph'."
   (interactive)
-  (unless (bobp)
-    (let* ((deactivate-mark nil)
-          (element (org-element-at-point))
-          (type (org-element-type element))
-          (contents-end (org-element-property :contents-end element))
-          (post-affiliated (org-element-property :post-affiliated element))
-          (begin (org-element-property :begin element))
-          (special?                    ;blocks handled specially
-           (memq type '(comment-block example-block export-block src-block
-                                      verse-block)))
-          (contents-begin
-           (if special?
-               ;; These types have no proper contents.  Fake line
-               ;; below the block opening line as contents beginning.
-               (save-excursion (goto-char begin) (line-beginning-position 2))
-             (org-element-property :contents-begin element))))
-      (cond
-       ((not element) (goto-char (point-min)))
-       ((= (point) begin)
-       (backward-char)
-       (org-backward-paragraph))
-       ((<= (point) post-affiliated) (goto-char begin))
-       ;; Special behavior: on a table or a property drawer, move to
-       ;; its beginning.
-       ((memq type '(node-property table-row))
-       (goto-char (org-element-property
-                   :post-affiliated (org-element-property :parent element))))
-       (special?
-       (if (<= (point) contents-begin) (goto-char post-affiliated)
-         ;; Inside a verse block, see blank lines as paragraph
-         ;; separators.
-         (let ((origin (point)))
-           (skip-chars-backward " \r\t\n" contents-begin)
-           (when (re-search-backward "^[ \t]*$" contents-begin 'move)
-             (skip-chars-forward " \r\t\n" origin)
-             (if (= (point) origin) (goto-char contents-begin)
-               (beginning-of-line))))))
-       ((eq type 'paragraph) (goto-char contents-begin)
-       ;; When at first paragraph in an item or a footnote definition,
-       ;; move directly to beginning of line.
-       (let ((parent-contents
-              (org-element-property
-               :contents-begin (org-element-property :parent element))))
-         (when (and parent-contents (= parent-contents contents-begin))
-           (beginning-of-line))))
-       ;; At the end of a greater element, move to the beginning of
-       ;; the last element within.
-       ((and contents-end (>= (point) contents-end))
-       (goto-char (1- contents-end))
-       (org-backward-paragraph))
-       (t (goto-char (or post-affiliated begin))))
-      ;; Ensure we never leave point invisible.
-      (when (org-invisible-p (point)) (beginning-of-visual-line)))))
+  (save-restriction
+    (widen)
+    (cond
+     ((bobp) nil)
+     ;; Blank lines at the beginning of the buffer.
+     ((and (org-match-line "^[ \t]*$")
+          (save-excursion (skip-chars-backward " \t\n") (bobp)))
+      (goto-char (point-min)))
+     ;; When inside a folded part, move out of it.
+     ((pcase (get-char-property-and-overlay (1- (point)) 'invisible)
+       (`(,(or `outline `org-hide-block) . ,o)
+        (goto-char (1- (overlay-start o)))
+        (org--backward-paragraph-once)
+        t)
+       (_ nil)))
+     (t
+      (let* ((element (org--paragraph-at-point))
+            (type (org-element-type element))
+            (begin (org-element-property :begin element))
+            (post-affiliated (org-element-property :post-affiliated element))
+            (contents-end (org-element-property :contents-end element))
+            (end (org-element-property :end element))
+            (parent (org-element-property :parent element))
+            (reach
+             ;; Move to the visible empty line above position P, or
+             ;; to position P.  Return t.
+             (lambda (p)
+               (goto-char p)
+               (when (and (org-previous-line-empty-p)
+                          (let ((end (line-end-position 0)))
+                            (or (= end (point-min))
+                                (not (org-invisible-p (1- end))))))
+                 (forward-line -1))
+               t)))
+       (cond
+        ;; Already at the beginning of an element.
+        ((= begin (point))
+         (cond
+          ;; There is a blank line above.  Move there.
+          ((and (org-previous-line-empty-p)
+                (not (org-invisible-p (1- (line-end-position 0)))))
+           (forward-line -1))
+          ;; At the beginning of the first element within a greater
+          ;; element.  Move to the beginning of the greater element.
+          ((and parent (= begin (org-element-property :contents-begin parent)))
+           (funcall reach (org-element-property :begin parent)))
+          ;; Since we have to move anyway, find the beginning
+          ;; position of the element above.
+          (t
+           (forward-char -1)
+           (org--backward-paragraph-once))))
+        ;; Skip paragraphs at the very beginning of footnote
+        ;; definitions or items.
+        ((and (eq type 'paragraph)
+              (org-with-point-at begin (not (bolp))))
+         (funcall reach (progn (goto-char begin) (line-beginning-position))))
+        ;; If the element is folded, skip it altogether.
+        ((org-with-point-at post-affiliated
+           (org-invisible-p (line-end-position) t))
+         (funcall reach begin))
+        ;; At the end of a greater element, move inside.
+        ((and contents-end
+              (<= contents-end (point))
+              (not (eq type 'paragraph)))
+         (cond
+          ((memq type '(footnote-definition plain-list))
+           (skip-chars-backward " \t\n")
+           (org--backward-paragraph-once))
+          ((= contents-end (point))
+           (forward-char -1)
+           (org--backward-paragraph-once))
+          (t
+           (goto-char contents-end))))
+        ;; Move between empty lines in some blocks.
+        ((and (memq type '(comment-block example-block export-block src-block
+                                         verse-block))
+              (let ((contents-start
+                     (org-with-point-at post-affiliated
+                       (line-beginning-position 2))))
+                (when (> (point) contents-start)
+                  (let ((contents-end
+                         (org-with-point-at end
+                           (skip-chars-backward " \t\n")
+                           (line-beginning-position))))
+                    (if (> (point) contents-end)
+                        (progn (goto-char contents-end) t)
+                      (skip-chars-backward " \t\n" begin)
+                      (re-search-backward "^[ \t]*\n" contents-start :move)
+                      t))))))
+        ;; Move to element's start.
+        (t
+         (funcall reach begin))))))))
 
 (defun org-forward-element ()
   "Move forward by one element.
@@ -21102,10 +21091,11 @@ ones already marked."
        (set-mark
         (save-excursion
           (goto-char (mark))
-          (goto-char (org-element-property :end (org-element-at-point)))))
+          (goto-char (org-element-property :end (org-element-at-point)))
+          (point)))
       (let ((element (org-element-at-point)))
        (end-of-line)
-       (push-mark (org-element-property :end element) t t)
+       (push-mark (min (point-max) (org-element-property :end element)) t t)
        (goto-char (org-element-property :begin element))))))
 
 (defun org-narrow-to-element ()
diff --git a/lisp/org/ox-ascii.el b/lisp/org/ox-ascii.el
index 972b58a..70bd1c4 100644
--- a/lisp/org/ox-ascii.el
+++ b/lisp/org/ox-ascii.el
@@ -1,6 +1,6 @@
 ;;; ox-ascii.el --- ASCII Back-End for Org Export Engine -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -31,6 +31,8 @@
 (require 'ox-publish)
 (require 'cl-lib)
 
+;;; Function Declarations
+
 (declare-function aa2u "ext:ascii-art-to-unicode" ())
 
 ;;; Define Back-End
@@ -954,7 +956,7 @@ channel."
        ((not (org-element-contents link)) nil)
        ;; Do not add a link already handled by custom export
        ;; functions.
-       ((org-export-custom-protocol-maybe link anchor 'ascii) nil)
+       ((org-export-custom-protocol-maybe link anchor 'ascii info) nil)
        (t
         (concat
          (org-ascii--fill-string
@@ -1270,7 +1272,8 @@ CONTENTS is nil.  INFO is a plist holding contextual 
information."
   (org-ascii--justify-element
    (org-ascii--box-string
     (org-remove-indentation
-     (org-element-property :value fixed-width)) info)
+     (org-element-property :value fixed-width))
+    info)
    fixed-width info))
 
 
@@ -1569,7 +1572,7 @@ DESC is the description part of the link, or the empty 
string.
 INFO is a plist holding contextual information."
   (let ((type (org-element-property :type link)))
     (cond
-     ((org-export-custom-protocol-maybe link desc 'ascii))
+     ((org-export-custom-protocol-maybe link desc 'ascii info))
      ((string= type "coderef")
       (let ((ref (org-element-property :path link)))
        (format (org-export-get-coderef-format ref desc)
@@ -1605,13 +1608,11 @@ INFO is a plist holding contextual information."
          ;; Don't know what to do.  Signal it.
          (_ "???"))))
      (t
-      (let ((raw-link (concat (org-element-property :type link)
-                             ":"
-                             (org-element-property :path link))))
-       (if (not (org-string-nw-p desc)) (format "<%s>" raw-link)
+      (let ((path (org-element-property :raw-link link)))
+       (if (not (org-string-nw-p desc)) (format "<%s>" path)
          (concat (format "[%s]" desc)
                  (and (not (plist-get info :ascii-links-to-notes))
-                      (format " (<%s>)" raw-link)))))))))
+                      (format " (<%s>)" path)))))))))
 
 
 ;;;; Node Properties
diff --git a/lisp/org/ox-beamer.el b/lisp/org/ox-beamer.el
index 23656db..1a1732b 100644
--- a/lisp/org/ox-beamer.el
+++ b/lisp/org/ox-beamer.el
@@ -1,6 +1,6 @@
 ;;; ox-beamer.el --- Beamer Back-End for Org Export Engine -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten.dominik AT gmail DOT com>
 ;;         Nicolas Goaziou <n.goaziou AT gmail DOT com>
@@ -731,7 +731,7 @@ channel."
   "Transcode a LINK object into Beamer code.
 CONTENTS is the description part of the link.  INFO is a plist
 used as a communication channel."
-  (or (org-export-custom-protocol-maybe link contents 'beamer)
+  (or (org-export-custom-protocol-maybe link contents 'beamer info)
       ;; Fall-back to LaTeX export.  However, prefer "\hyperlink" over
       ;; "\hyperref" since the former handles overlay specifications.
       (let ((latex-link (org-export-with-backend 'latex link contents info)))
diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el
index 678506a..03145e3 100644
--- a/lisp/org/ox-html.el
+++ b/lisp/org/ox-html.el
@@ -1,6 +1,6 @@
 ;;; ox-html.el --- HTML Back-End for Org Export Engine -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;      Jambunathan K <kjambunathan at gmail dot com>
@@ -62,7 +62,6 @@
     (export-block . org-html-export-block)
     (export-snippet . org-html-export-snippet)
     (fixed-width . org-html-fixed-width)
-    (footnote-definition . org-html-footnote-definition)
     (footnote-reference . org-html-footnote-reference)
     (headline . org-html-headline)
     (horizontal-rule . org-html-horizontal-rule)
@@ -121,6 +120,7 @@
     (:html-link-home "HTML_LINK_HOME" nil org-html-link-home)
     (:html-link-up "HTML_LINK_UP" nil org-html-link-up)
     (:html-mathjax "HTML_MATHJAX" nil "" space)
+    (:html-equation-reference-format "HTML_EQUATION_REFERENCE_FORMAT" nil 
org-html-equation-reference-format t)
     (:html-postamble nil "html-postamble" org-html-postamble)
     (:html-preamble nil "html-preamble" org-html-preamble)
     (:html-head "HTML_HEAD" nil org-html-head newline)
@@ -152,6 +152,7 @@
     (:html-metadata-timestamp-format nil nil 
org-html-metadata-timestamp-format)
     (:html-postamble-format nil nil org-html-postamble-format)
     (:html-preamble-format nil nil org-html-preamble-format)
+    (:html-prefer-user-labels nil nil org-html-prefer-user-labels)
     (:html-self-link-headlines nil nil org-html-self-link-headlines)
     (:html-table-align-individual-fields
      nil nil org-html-table-align-individual-fields)
@@ -232,50 +233,26 @@ property on the headline itself.")
 
 (defconst org-html-scripts
   "<script type=\"text/javascript\">
-/*
-@licstart  The following is the entire license notice for the
-JavaScript code in this tag.
-
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
-
-The JavaScript code in this tag is free software: you can
-redistribute it and/or modify it under the terms of the GNU
-General Public License (GNU GPL) as published by the Free Software
-Foundation, either version 3 of the License, or (at your option)
-any later version.  The code is distributed WITHOUT ANY WARRANTY;
-without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.
-
-As additional permission under GNU GPL version 3 section 7, you
-may distribute non-source (e.g., minimized or compacted) forms of
-that code without the copy of the GNU GPL normally required by
-section 4, provided you include this license notice and a URL
-through which recipients can access the Corresponding Source.
-
-
-@licend  The above is the entire license notice
-for the JavaScript code in this tag.
-*/
+// @license 
magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt
 Public Domain
 <!--/*--><![CDATA[/*><!--*/
- function CodeHighlightOn(elem, id)
- {
-   var target = document.getElementById(id);
-   if(null != target) {
-     elem.cacheClassElem = elem.className;
-     elem.cacheClassTarget = target.className;
-     target.className = \"code-highlighted\";
-     elem.className   = \"code-highlighted\";
-   }
- }
- function CodeHighlightOff(elem, id)
- {
-   var target = document.getElementById(id);
-   if(elem.cacheClassElem)
-     elem.className = elem.cacheClassElem;
-   if(elem.cacheClassTarget)
-     target.className = elem.cacheClassTarget;
- }
-/*]]>*///-->
+     function CodeHighlightOn(elem, id)
+     {
+       var target = document.getElementById(id);
+       if(null != target) {
+         elem.classList.add(\"code-highlighted\");
+         target.classList.add(\"code-highlighted\");
+       }
+     }
+     function CodeHighlightOff(elem, id)
+     {
+       var target = document.getElementById(id);
+       if(null != target) {
+         elem.classList.remove(\"code-highlighted\");
+         target.classList.remove(\"code-highlighted\");
+       }
+     }
+    /*]]>*///-->
+// @license-end
 </script>"
   "Basic JavaScript that is needed by HTML files produced by Org mode.")
 
@@ -311,7 +288,7 @@ for the JavaScript code in this tag.
   }
   pre.src {
     position: relative;
-    overflow: visible;
+    overflow: auto;
     padding-top: 1.2em;
   }
   pre.src:before {
@@ -323,7 +300,7 @@ for the JavaScript code in this tag.
     padding: 3px;
     border: 1px solid black;
   }
-  pre.src:hover:before { display: inline;}
+  pre.src:hover:before { display: inline; margin-top: 14px;}
   /* Languages per Org manual */
   pre.src-asymptote:before { content: 'Asymptote'; }
   pre.src-awk:before { content: 'Awk'; }
@@ -532,73 +509,22 @@ means to use the maximum value consistent with other 
options."
 
 (defcustom org-html-infojs-template
   "<script type=\"text/javascript\" src=\"%SCRIPT_PATH\">
-/**
- *
- * @source: %SCRIPT_PATH
- *
- * @licstart  The following is the entire license notice for the
- *  JavaScript code in %SCRIPT_PATH.
- *
- * Copyright (C) 2012-2020 Free Software Foundation, Inc.
- *
- *
- * The JavaScript code in this tag is free software: you can
- * redistribute it and/or modify it under the terms of the GNU
- * General Public License (GNU GPL) as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option)
- * any later version.  The code is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.
- *
- * As additional permission under GNU GPL version 3 section 7, you
- * may distribute non-source (e.g., minimized or compacted) forms of
- * that code without the copy of the GNU GPL normally required by
- * section 4, provided you include this license notice and a URL
- * through which recipients can access the Corresponding Source.
- *
- * @licend  The above is the entire license notice
- * for the JavaScript code in %SCRIPT_PATH.
- *
- */
+// @license 
magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt 
GPL-v3-or-Later
+// @license-end
 </script>
 
 <script type=\"text/javascript\">
-
-/*
-@licstart  The following is the entire license notice for the
-JavaScript code in this tag.
-
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
-
-The JavaScript code in this tag is free software: you can
-redistribute it and/or modify it under the terms of the GNU
-General Public License (GNU GPL) as published by the Free Software
-Foundation, either version 3 of the License, or (at your option)
-any later version.  The code is distributed WITHOUT ANY WARRANTY;
-without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.
-
-As additional permission under GNU GPL version 3 section 7, you
-may distribute non-source (e.g., minimized or compacted) forms of
-that code without the copy of the GNU GPL normally required by
-section 4, provided you include this license notice and a URL
-through which recipients can access the Corresponding Source.
-
-
-@licend  The above is the entire license notice
-for the JavaScript code in this tag.
-*/
-
+// @license 
magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt 
GPL-v3-or-Later
 <!--/*--><![CDATA[/*><!--*/
 %MANAGER_OPTIONS
 org_html_manager.setup();  // activate after the parameters are set
 /*]]>*///-->
+// @license-end
 </script>"
   "The template for the export style additions when org-info.js is used.
 Option settings will replace the %MANAGER-OPTIONS cookie."
   :group 'org-export-html
-  :version "24.4"
-  :package-version '(Org . "8.0")
+  :package-version '(Org . "9.4")
   :type 'string)
 
 (defun org-html-infojs-install-script (exp-plist _backend)
@@ -811,6 +737,24 @@ but without \"name\" attribute."
   :type 'boolean
   :safe #'booleanp)
 
+(defcustom org-html-prefer-user-labels nil
+  "When non-nil use user-defined names and ID over internal ones.
+
+By default, Org generates its own internal ID values during HTML
+export.  This process ensures that these values are unique and
+valid, but the keys are not available in advance of the export
+process, and not so readable.
+
+When this variable is non-nil, Org will use NAME keyword, or the
+real name of the target to create the ID attribute.
+
+Independently of this variable, however, CUSTOM_ID are always
+used as a reference."
+  :group 'org-export-html
+  :package-version '(Org . "9.4")
+  :type 'boolean
+  :safe #'booleanp)
+
 ;;;; Inlinetasks
 
 (defcustom org-html-format-inlinetask-function
@@ -834,6 +778,24 @@ The function should return the string to be exported."
 
 ;;;; LaTeX
 
+(defcustom org-html-equation-reference-format "\\eqref{%s}"
+  "The MathJax command to use when referencing equations.
+
+This is a format control string that expects a single string argument
+specifying the label that is being referenced. The argument is
+generated automatically on export.
+
+The default is to wrap equations in parentheses (using \"\\eqref{%s}\)\".
+
+Most common values are:
+
+  \\eqref{%s}    Wrap the equation in parentheses
+  \\ref{%s}      Do not wrap the equation in parentheses"
+  :group 'org-export-html
+  :package-version '(Org . "9.4")
+  :type 'string
+  :safe t)
+
 (defcustom org-html-with-latex org-export-with-latex
   "Non-nil means process LaTeX math snippets.
 
@@ -847,6 +809,8 @@ e.g. \"tex:mathjax\".  Allowed values are:
   `verbatim'    Keep everything in verbatim
   `mathjax', t  Do MathJax preprocessing and arrange for MathJax.js to
                 be loaded.
+  `html'        Use `org-latex-to-html-convert-command' to convert
+                LaTeX fragments to HTML.
   SYMBOL        Any symbol defined in `org-preview-latex-process-alist',
                 e.g., `dvipng'."
   :group 'org-export-html
@@ -884,10 +848,9 @@ link to the image."
   :type 'boolean)
 
 (defcustom org-html-inline-image-rules
-  '(("file" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'")
-    ("attachment" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'")
-    ("http" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'")
-    ("https" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'"))
+  `(("file" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg")))
+    ("http" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg")))
+    ("https" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg"))))
   "Rules characterizing image files that can be inlined into HTML.
 A rule consists in an association whose key is the type of link
 to consider, and value is a regexp that will be matched against
@@ -1350,9 +1313,10 @@ like that: \"%%\"."
                (string :tag "Format string"))))
 
 (defcustom org-html-validation-link
-  "<a href=\"http://validator.w3.org/check?uri=referer\";>Validate</a>"
+  "<a href=\"https://validator.w3.org/check?uri=referer\";>Validate</a>"
   "Link to HTML validation service."
   :group 'org-export-html
+  :package-version '(Org . "9.4")
   :type 'string)
 
 (defcustom org-html-creator-string
@@ -1662,6 +1626,36 @@ attribute with a nil value will be omitted from the 
result."
                              "\"" "&quot;" (org-html-encode-plain-text item))))
                  (setcar output (format "%s=\"%s\"" key value))))))))
 
+(defun org-html--reference (datum info &optional named-only)
+  "Return an appropriate reference for DATUM.
+
+DATUM is an element or a `target' type object.  INFO is the
+current export state, as a plist.
+
+When NAMED-ONLY is non-nil and DATUM has no NAME keyword, return
+nil.  This doesn't apply to headlines, inline tasks, radio
+targets and targets."
+  (let* ((type (org-element-type datum))
+        (user-label
+         (org-element-property
+          (pcase type
+            ((or `headline `inlinetask) :CUSTOM_ID)
+            ((or `radio-target `target) :value)
+            (_ :name))
+          datum)))
+    (cond
+     ((and user-label
+          (or (plist-get info :html-prefer-user-labels)
+              ;; Used CUSTOM_ID property unconditionally.
+              (memq type '(headline inlinetask))))
+      user-label)
+     ((and named-only
+          (not (memq type '(headline inlinetask radio-target target)))
+          (not user-label))
+      nil)
+     (t
+      (org-export-get-reference datum info)))))
+
 (defun org-html--wrap-image (contents info &optional caption label)
   "Wrap CONTENTS string within an appropriate environment for images.
 INFO is a plist used as a communication channel.  When optional
@@ -1693,7 +1687,8 @@ a communication channel."
      (org-html--make-attribute-string
       (org-combine-plists
        (list :src source
-            :alt (if (string-match-p "^ltxpng/" source)
+            :alt (if (string-match-p
+                      (concat "^" org-preview-latex-image-directory) source)
                      (org-html-encode-plain-text
                       (org-find-text-property-in-string 'org-latex-src source))
                    (file-name-nondirectory source)))
@@ -1853,13 +1848,8 @@ INFO is a plist used as a communication channel."
          (title (if (org-string-nw-p title) title "&lrm;"))
          (author (and (plist-get info :with-author)
                       (let ((auth (plist-get info :author)))
-                        (and auth
-                             ;; Return raw Org syntax, skipping non
-                             ;; exportable objects.
-                             (org-element-interpret-data
-                              (org-element-map auth
-                                  (cons 'plain-text org-element-all-objects)
-                                'identity info))))))
+                       ;; Return raw Org syntax.
+                        (and auth (org-element-interpret-data auth)))))
          (description (plist-get info :description))
          (keywords (plist-get info :keywords))
          (charset (or (and org-html-coding-system
@@ -1882,7 +1872,7 @@ INFO is a plist used as a communication channel."
       charset) "\n"
      (let ((viewport-options
            (cl-remove-if-not (lambda (cell) (org-string-nw-p (cadr cell)))
-                              (plist-get info :html-viewport))))
+                             (plist-get info :html-viewport))))
        (and viewport-options
            (concat
             (org-html-close-tag
@@ -2213,7 +2203,8 @@ is the language used for CODE, as a string, or nil."
          ;; htmlize
          (setq code
                (let ((output-type org-html-htmlize-output-type)
-                     (font-prefix org-html-htmlize-font-prefix))
+                     (font-prefix org-html-htmlize-font-prefix)
+                     (inhibit-read-only t))
                  (with-temp-buffer
                    ;; Switch to language-specific mode.
                    (funcall lang-mode)
@@ -2372,8 +2363,7 @@ INFO is a plist used as a communication channel."
                    (org-export-get-tags headline info))))
     (format "<a href=\"#%s\">%s</a>"
            ;; Label.
-           (or (org-element-property :CUSTOM_ID headline)
-               (org-export-get-reference headline info))
+           (org-html--reference headline info)
            ;; Body.
            (concat
             (and (not (org-export-low-level-p headline info))
@@ -2401,8 +2391,7 @@ of listings as a string, or nil if it is empty."
                                         (org-html--translate "Listing %d:" 
info))))
                (mapconcat
                 (lambda (entry)
-                  (let ((label (and (org-element-property :name entry)
-                                    (org-export-get-reference entry info)))
+                  (let ((label (org-html--reference entry info t))
                         (title (org-trim
                                 (org-export-data
                                  (or (org-export-get-caption entry t)
@@ -2440,8 +2429,7 @@ of tables as a string, or nil if it is empty."
                                         (org-html--translate "Table %d:" 
info))))
                (mapconcat
                 (lambda (entry)
-                  (let ((label (and (org-element-property :name entry)
-                                    (org-export-get-reference entry info)))
+                  (let ((label (org-html--reference entry info t))
                         (title (org-trim
                                 (org-export-data
                                  (or (org-export-get-caption entry t)
@@ -2542,11 +2530,11 @@ information."
     (if (plist-get attributes :textarea)
        (org-html--textarea-block example-block)
       (format "<pre class=\"example\"%s>\n%s</pre>"
-             (let* ((name (org-element-property :name example-block))
+             (let* ((reference (org-html--reference example-block info))
                     (a (org-html--make-attribute-string
-                        (if (or (not name) (plist-member attributes :id))
+                        (if (or (not reference) (plist-member attributes :id))
                             attributes
-                          (plist-put attributes :id name)))))
+                          (plist-put attributes :id reference)))))
                (if (org-string-nw-p a) (concat " " a) ""))
              (org-html-format-code example-block info)))))
 
@@ -2622,8 +2610,7 @@ holding contextual information."
            (full-text (funcall (plist-get info :html-format-headline-function)
                                todo todo-type priority text tags info))
            (contents (or contents ""))
-          (id (or (org-element-property :CUSTOM_ID headline)
-                  (org-export-get-reference headline info)))
+          (id (org-html--reference headline info))
           (formatted-text
            (if (plist-get info :html-self-link-headlines)
                (format "<a href=\"#%s\">%s</a>" id full-text)
@@ -2649,8 +2636,7 @@ holding contextual information."
               (first-content (car (org-element-contents headline))))
           (format "<%s id=\"%s\" class=\"%s\">%s%s</%s>\n"
                   (org-html--container headline info)
-                  (concat "outline-container-"
-                         (org-export-get-reference headline info))
+                  (format "outline-container-%s" id)
                   (concat (format "outline-%d" level)
                           (and extra-class " ")
                           extra-class)
@@ -2711,8 +2697,7 @@ contextual information."
                (org-element-property :value inline-src-block)
                lang))
         (label
-         (let ((lbl (and (org-element-property :name inline-src-block)
-                         (org-export-get-reference inline-src-block info))))
+         (let ((lbl (org-html--reference inline-src-block info t)))
            (if (not lbl) "" (format " id=\"%s\"" lbl)))))
     (format "<code class=\"src src-%s\"%s>%s</code>" lang label code)))
 
@@ -2848,12 +2833,13 @@ CONTENTS is nil.  INFO is a plist holding contextual 
information."
 (defun org-html-format-latex (latex-frag processing-type info)
   "Format a LaTeX fragment LATEX-FRAG into HTML.
 PROCESSING-TYPE designates the tool used for conversion.  It can
-be `mathjax', `verbatim', nil, t or symbols in
+be `mathjax', `verbatim', `html', nil, t or symbols in
 `org-preview-latex-process-alist', e.g., `dvipng', `dvisvgm' or
 `imagemagick'.  See `org-html-with-latex' for more information.
 INFO is a plist containing export properties."
   (let ((cache-relpath "") (cache-dir ""))
-    (unless (eq processing-type 'mathjax)
+    (unless (or (eq processing-type 'mathjax)
+                (eq processing-type 'html))
       (let ((bfn (or (buffer-file-name)
                     (make-temp-name
                      (expand-file-name "latex" temporary-file-directory))))
@@ -2903,6 +2889,12 @@ used as a predicate for `org-export-get-ordinal' or a 
value to
   (string-match-p org-latex-math-environments-re
                   (org-element-property :value element)))
 
+(defun org-html--latex-environment-numbered-p (element)
+  "Non-nil when ELEMENT contains a numbered LaTeX math environment.
+Starred and \"displaymath\" environments are not numbered."
+  (not (string-match-p "\\`[ \t]*\\\\begin{\\(.*\\*\\|displaymath\\)}"
+                      (org-element-property :value element))))
+
 (defun org-html--unlabel-latex-environment (latex-frag)
   "Change environment in LATEX-FRAG string to an unnumbered one.
 For instance, change an 'equation' environment to 'equation*'."
@@ -2921,12 +2913,14 @@ CONTENTS is nil.  INFO is a plist holding contextual 
information."
        (latex-frag (org-remove-indentation
                     (org-element-property :value latex-environment)))
         (attributes (org-export-read-attribute :attr_html latex-environment))
-        (label (and (org-element-property :name latex-environment)
-                    (org-export-get-reference latex-environment info)))
-        (caption (number-to-string
-                  (org-export-get-ordinal
-                   latex-environment info nil
-                   #'org-html--math-environment-p))))
+        (label (org-html--reference latex-environment info t))
+        (caption (and (org-html--latex-environment-numbered-p 
latex-environment)
+                     (number-to-string
+                      (org-export-get-ordinal
+                       latex-environment info nil
+                       (lambda (l _)
+                         (and (org-html--math-environment-p l)
+                              (org-html--latex-environment-numbered-p l))))))))
     (cond
      ((memq processing-type '(t mathjax))
       (org-html-format-latex
@@ -2942,10 +2936,10 @@ CONTENTS is nil.  INFO is a plist holding contextual 
information."
               (org-html--unlabel-latex-environment latex-frag)
               processing-type info)))
         (when (and formula-link (string-match "file:\\([^]]*\\)" formula-link))
-          (org-html--wrap-latex-environment
-           (org-html--format-image
-            (match-string 1 formula-link) attributes info)
-           info caption label))))
+          (let ((source (org-export-file-uri (match-string 1 formula-link))))
+           (org-html--wrap-latex-environment
+            (org-html--format-image source attributes info)
+            info caption label)))))
      (t (org-html--wrap-latex-environment latex-frag info caption label)))))
 
 ;;;; Latex Fragment
@@ -2958,11 +2952,14 @@ CONTENTS is nil.  INFO is a plist holding contextual 
information."
     (cond
      ((memq processing-type '(t mathjax))
       (org-html-format-latex latex-frag 'mathjax info))
+     ((memq processing-type '(t html))
+      (org-html-format-latex latex-frag 'html info))
      ((assq processing-type org-preview-latex-process-alist)
       (let ((formula-link
             (org-html-format-latex latex-frag processing-type info)))
        (when (and formula-link (string-match "file:\\([^]]*\\)" formula-link))
-         (org-html--format-image (match-string 1 formula-link) nil info))))
+         (let ((source (org-export-file-uri (match-string 1 formula-link))))
+           (org-html--format-image source nil info)))))
      (t latex-frag))))
 
 ;;;; Line Break
@@ -3044,7 +3041,9 @@ images, set it to:
 DESC is the description part of the link, or the empty string.
 INFO is a plist holding contextual information.  See
 `org-export-data'."
-  (let* ((link-org-files-as-html-maybe
+  (let* ((html-ext (plist-get info :html-extension))
+        (dot (when (> (length html-ext) 0) "."))
+        (link-org-files-as-html-maybe
          (lambda (raw-path info)
            ;; Treat links to `file.org' as links to `file.html', if
            ;; needed.  See `org-html-link-org-files-as-html'.
@@ -3052,8 +3051,7 @@ INFO is a plist holding contextual information.  See
             ((and (plist-get info :html-link-org-files-as-html)
                   (string= ".org"
                            (downcase (file-name-extension raw-path "."))))
-             (concat (file-name-sans-extension raw-path) "."
-                     (plist-get info :html-extension)))
+             (concat (file-name-sans-extension raw-path) dot html-ext))
             (t raw-path))))
         (type (org-element-property :type link))
         (raw-path (org-element-property :path link))
@@ -3063,7 +3061,7 @@ INFO is a plist holding contextual information.  See
          (cond
           ((member type '("http" "https" "ftp" "mailto" "news"))
            (url-encode-url (concat type ":" raw-path)))
-          ((string= type "file")
+          ((string= "file" type)
            ;; During publishing, turn absolute file names belonging
            ;; to base directory into relative file names.  Otherwise,
            ;; append "file" protocol to absolute file name.
@@ -3114,7 +3112,7 @@ INFO is a plist holding contextual information.  See
            (if (org-string-nw-p attr) (concat " " attr) ""))))
     (cond
      ;; Link type is handled by a special function.
-     ((org-export-custom-protocol-maybe link desc 'html))
+     ((org-export-custom-protocol-maybe link desc 'html info))
      ;; Image file.
      ((and (plist-get info :html-inline-images)
           (org-export-inline-image-p
@@ -3152,8 +3150,7 @@ INFO is a plist holding contextual information.  See
                        (org-element-property :raw-link link) info))))
          ;; Link points to a headline.
          (`headline
-          (let ((href (or (org-element-property :CUSTOM_ID destination)
-                          (org-export-get-reference destination info)))
+          (let ((href (org-html--reference destination info))
                 ;; What description to use?
                 (desc
                  ;; Case 1: Headline is numbered and LINK has no
@@ -3177,11 +3174,11 @@ INFO is a plist holding contextual information.  See
                     (eq 'latex-environment (org-element-type destination))
                     (eq 'math (org-latex--environment-type destination)))
                ;; Caption and labels are introduced within LaTeX
-              ;; environment.  Use "eqref" macro to refer to those in
-              ;; the document.
-               (format "\\eqref{%s}"
-                       (org-export-get-reference destination info))
-             (let* ((ref (org-export-get-reference destination info))
+              ;; environment.  Use "ref" or "eqref" macro, depending on user
+               ;; preference to refer to those in the document.
+               (format (plist-get info :html-equation-reference-format)
+                       (org-html--reference destination info))
+             (let* ((ref (org-html--reference destination info))
                     (org-html-standalone-image-predicate
                      #'org-html--has-caption-p)
                     (counter-predicate
@@ -3278,8 +3275,7 @@ the plist used as a communication channel."
                                  info nil #'org-html-standalone-image-p))
                         " </span>"
                         raw))))
-           (label (and (org-element-property :name paragraph)
-                       (org-export-get-reference paragraph info))))
+           (label (org-html--reference paragraph info)))
        (org-html--wrap-image contents info caption label)))
      ;; Regular paragraph.
      (t (format "<p%s%s>\n%s</p>"
@@ -3385,17 +3381,17 @@ holding contextual information."
 
 ;;;; Quote Block
 
-(defun org-html-quote-block (quote-block contents _info)
+(defun org-html-quote-block (quote-block contents info)
   "Transcode a QUOTE-BLOCK element from Org to HTML.
 CONTENTS holds the contents of the block.  INFO is a plist
 holding contextual information."
   (format "<blockquote%s>\n%s</blockquote>"
-         (let* ((name (org-element-property :name quote-block))
+         (let* ((reference (org-html--reference quote-block info t))
                 (attributes (org-export-read-attribute :attr_html quote-block))
                 (a (org-html--make-attribute-string
-                    (if (or (not name) (plist-member attributes :id))
+                    (if (or (not reference) (plist-member attributes :id))
                         attributes
-                      (plist-put attributes :id name)))))
+                      (plist-put attributes :id reference)))))
            (if (org-string-nw-p a) (concat " " a) ""))
          contents))
 
@@ -3430,7 +3426,7 @@ holding contextual information."
   "Transcode a RADIO-TARGET object from Org to HTML.
 TEXT is the text of the target.  INFO is a plist holding
 contextual information."
-  (let ((ref (org-export-get-reference radio-target info)))
+  (let ((ref (org-html--reference radio-target info)))
     (org-html--anchor ref text nil info)))
 
 ;;;; Special Block
@@ -3449,11 +3445,11 @@ holding contextual information."
                                     (if class (concat class " " block-type)
                                       block-type)))))
     (let* ((contents (or contents ""))
-          (name (org-element-property :name special-block))
+          (reference (org-html--reference special-block info))
           (a (org-html--make-attribute-string
-              (if (or (not name) (plist-member attributes :id))
+              (if (or (not reference) (plist-member attributes :id))
                   attributes
-                (plist-put attributes :id name))))
+                (plist-put attributes :id reference))))
           (str (if (org-string-nw-p a) (concat " " a) "")))
       (if html5-fancy
          (format "<%s%s>\n%s</%s>" block-type str contents block-type)
@@ -3469,8 +3465,7 @@ contextual information."
       (org-html--textarea-block src-block)
     (let* ((lang (org-element-property :language src-block))
          (code (org-html-format-code src-block info))
-         (label (let ((lbl (and (org-element-property :name src-block)
-                                (org-export-get-reference src-block info))))
+         (label (let ((lbl (org-html--reference src-block info t)))
                   (if lbl (format " id=\"%s\"" lbl) "")))
          (klipsify  (and  (plist-get info :html-klipsify-src)
                            (member lang '("javascript" "js"
@@ -3665,8 +3660,7 @@ contextual information."
           (attributes
            (org-html--make-attribute-string
             (org-combine-plists
-             (and (org-element-property :name table)
-                  (list :id (org-export-get-reference table info)))
+             (list :id (org-html--reference table info t))
              (and (not (org-html-html5-p info))
                   (plist-get info :html-table-attributes))
              (org-export-read-attribute :attr_html table))))
@@ -3713,7 +3707,7 @@ contextual information."
   "Transcode a TARGET object from Org to HTML.
 CONTENTS is nil.  INFO is a plist holding contextual
 information."
-  (let ((ref (org-export-get-reference target info)))
+  (let ((ref (org-html--reference target info)))
     (org-html--anchor ref nil nil info)))
 
 ;;;; Timestamp
@@ -3852,9 +3846,11 @@ file-local settings.
 
 Return output file's name."
   (interactive)
-  (let* ((extension (concat "." (or (plist-get ext-plist :html-extension)
-                                   org-html-extension
-                                   "html")))
+  (let* ((extension (concat
+                    (when (> (length org-html-extension) 0) ".")
+                    (or (plist-get ext-plist :html-extension)
+                        org-html-extension
+                        "html")))
         (file (org-export-output-file-name extension subtreep))
         (org-export-coding-system org-html-coding-system))
     (org-export-to-file 'html file
@@ -3870,9 +3866,10 @@ publishing directory.
 
 Return output file name."
   (org-publish-org-to 'html filename
-                     (concat "." (or (plist-get plist :html-extension)
-                                     org-html-extension
-                                     "html"))
+                     (concat (when (> (length org-html-extension) 0) ".")
+                             (or (plist-get plist :html-extension)
+                                 org-html-extension
+                                 "html"))
                      plist pub-dir))
 
 
diff --git a/lisp/org/ox-icalendar.el b/lisp/org/ox-icalendar.el
index 5968d4e..b8834c4 100644
--- a/lisp/org/ox-icalendar.el
+++ b/lisp/org/ox-icalendar.el
@@ -1,6 +1,6 @@
 ;;; ox-icalendar.el --- iCalendar Back-End for Org Export Engine -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;;      Nicolas Goaziou <n dot goaziou at gmail dot com>
@@ -367,7 +367,8 @@ A headline is blocked when either
 (defun org-icalendar-use-UTC-date-time-p ()
   "Non-nil when `org-icalendar-date-time-format' requires UTC time."
   (char-equal (elt org-icalendar-date-time-format
-                  (1- (length org-icalendar-date-time-format))) ?Z))
+                  (1- (length org-icalendar-date-time-format)))
+             ?Z))
 
 (defvar org-agenda-default-appointment-duration) ; From org-agenda.el.
 (defun org-icalendar-convert-timestamp (timestamp keyword &optional end tz)
@@ -763,10 +764,10 @@ Return VTODO component as a string."
             "SEQUENCE:1\n"
             (format "PRIORITY:%d\n"
                     (let ((pri (or (org-element-property :priority entry)
-                                   org-default-priority)))
-                      (floor (- 9 (* 8. (/ (float (- org-lowest-priority pri))
-                                           (- org-lowest-priority
-                                              org-highest-priority)))))))
+                                   org-priority-default)))
+                      (floor (- 9 (* 8. (/ (float (- org-priority-lowest pri))
+                                           (- org-priority-lowest
+                                              org-priority-highest)))))))
             (format "STATUS:%s\n"
                     (if (eq (org-element-property :todo-type entry) 'todo)
                         "NEEDS-ACTION"
diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el
index 2f61aba..149492f 100644
--- a/lisp/org/ox-latex.el
+++ b/lisp/org/ox-latex.el
@@ -1,6 +1,6 @@
 ;;; ox-latex.el --- LaTeX Back-End for Org Export Engine -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -30,6 +30,8 @@
 (require 'ox)
 (require 'ox-publish)
 
+;;; Function Declarations
+
 (defvar org-latex-default-packages-alist)
 (defvar org-latex-packages-alist)
 (defvar orgtbl-exp-regexp)
@@ -736,8 +738,9 @@ environment."
   :safe #'stringp)
 
 (defcustom org-latex-inline-image-rules
-  `(("file" . ,(regexp-opt
-               '("pdf" "jpeg" "jpg" "png" "ps" "eps" "tikz" "pgf" "svg"))))
+  `(("file" . ,(rx "."
+                  (or "pdf" "jpeg" "jpg" "png" "ps" "eps" "tikz" "pgf" "svg")
+                  eos)))
   "Rules characterizing image files that can be inlined into LaTeX.
 
 A rule consists in an association whose key is the type of link
@@ -750,8 +753,7 @@ pdflatex, pdf, jpg and png images are OK.  When processing
 through dvi to Postscript, only ps and eps are allowed.  The
 default we use here encompasses both."
   :group 'org-export-latex
-  :version "24.4"
-  :package-version '(Org . "8.0")
+  :package-version '(Org . "9.4")
   :type '(alist :key-type (string :tag "Type")
                :value-type (regexp :tag "Path")))
 
@@ -1586,6 +1588,7 @@ INFO is a plist used as a communication channel."
                        lang))))
     `((?a . ,(org-export-data (plist-get info :author) info))
       (?t . ,(org-export-data (plist-get info :title) info))
+      (?s . ,(org-export-data (plist-get info :subtitle) info))
       (?k . ,(org-export-data (org-latex--wrap-latex-math-block
                               (plist-get info :keywords) info)
                              info))
@@ -2171,25 +2174,27 @@ contextual information."
   "Transcode an ITEM element from Org to LaTeX.
 CONTENTS holds the contents of the item.  INFO is a plist holding
 contextual information."
-  (let* ((counter
-         (let ((count (org-element-property :counter item))
-               (level
-                ;; Determine level of current item to determine the
-                ;; correct LaTeX counter to use (enumi, enumii...).
-                (let ((parent item) (level 0))
-                  (while (memq (org-element-type
-                                (setq parent (org-export-get-parent parent)))
-                               '(plain-list item))
-                    (when (and (eq (org-element-type parent) 'plain-list)
-                               (eq (org-element-property :type parent)
-                                   'ordered))
-                      (cl-incf level)))
-                  level)))
-           (and count
-                (< level 5)
-                (format "\\setcounter{enum%s}{%s}\n"
-                        (nth (1- level) '("i" "ii" "iii" "iv"))
-                        (1- count)))))
+  (let* ((orderedp (eq (org-element-property
+                       :type (org-export-get-parent item))
+                      'ordered))
+        (level
+         ;; Determine level of current item to determine the
+         ;; correct LaTeX counter to use (enumi, enumii...).
+         (let ((parent item) (level 0))
+           (while (memq (org-element-type
+                         (setq parent (org-export-get-parent parent)))
+                        '(plain-list item))
+             (when (and (eq (org-element-type parent) 'plain-list)
+                        (eq (org-element-property :type parent)
+                            'ordered))
+               (cl-incf level)))
+           level))
+        (count (org-element-property :counter item))
+        (counter (and count
+                      (< level 5)
+                      (format "\\setcounter{enum%s}{%s}\n"
+                              (nth (1- level) '("i" "ii" "iii" "iv"))
+                              (1- count))))
         (checkbox (cl-case (org-element-property :checkbox item)
                     (on "$\\boxtimes$")
                     (off "$\\square$")
@@ -2208,9 +2213,11 @@ contextual information."
            "\\item"
            (cond
             ((and checkbox tag)
-             (format "[{%s %s}] %s" checkbox tag tag-footnotes))
+             (format (if orderedp "{%s %s} %s" "[{%s %s}] %s")
+                     checkbox tag tag-footnotes))
             ((or checkbox tag)
-             (format "[{%s}] %s" (or checkbox tag) tag-footnotes))
+             (format (if orderedp "{%s} %s" "[{%s}] %s")
+                     (or checkbox tag) tag-footnotes))
             ;; Without a tag or a check-box, if CONTENTS starts with
             ;; an opening square bracket, add "\relax" to "\item",
             ;; unless the brackets comes from an initial export
@@ -2382,8 +2389,11 @@ used as a communication channel."
              (format "[%s]" (plist-get info :latex-default-figure-position)))
             (t ""))))
         (center
-         (if (plist-member attr :center) (plist-get attr :center)
-           (plist-get info :latex-images-centered)))
+         (cond
+          ;; If link is an image link, do not center.
+          ((eq 'link (org-element-type (org-export-get-parent link))) nil)
+          ((plist-member attr :center) (plist-get attr :center))
+          (t (plist-get info :latex-images-centered))))
         (comment-include (if (plist-get attr :comment-include) "%" ""))
         ;; It is possible to specify scale or width and height in
         ;; the ATTR_LATEX line, and also via default variables.
@@ -2425,7 +2435,8 @@ used as a communication channel."
                       (format "\\resizebox{%s}{%s}{%s}"
                               (if (org-string-nw-p width) width "!")
                               (if (org-string-nw-p height) height "!")
-                              image-code)))))
+                              image-code))
+                     (t image-code))))
       ;; For other images:
       ;; - add scale, or width and height to options.
       ;; - include the image with \includegraphics.
@@ -2517,15 +2528,16 @@ INFO is a plist holding contextual information.  See
         (imagep (org-export-inline-image-p
                  link (plist-get info :latex-inline-image-rules)))
         (path (org-latex--protect-text
-               (cond ((member type '("http" "https" "ftp" "mailto" "doi"))
-                      (concat type ":" raw-path))
-                     ((string= type "file")
-                      (org-export-file-uri raw-path))
-                     (t
-                      raw-path)))))
+               (pcase type
+                 ((or "http" "https" "ftp" "mailto" "doi")
+                  (concat type ":" raw-path))
+                 ("file"
+                  (org-export-file-uri raw-path))
+                 (_
+                  raw-path)))))
     (cond
      ;; Link type is handled by a special function.
-     ((org-export-custom-protocol-maybe link desc 'latex))
+     ((org-export-custom-protocol-maybe link desc 'latex info))
      ;; Image file.
      (imagep (org-latex--inline-image link info))
      ;; Radio link: Transcode target's contents and use them as link's
@@ -2576,7 +2588,9 @@ INFO is a plist holding contextual information.  See
      ;; equivalent line number.
      ((string= type "coderef")
       (format (org-export-get-coderef-format path desc)
-             (org-export-resolve-coderef path info)))
+             ;; Resolve with RAW-PATH since PATH could be tainted
+             ;; with `org-latex--protect-text' call above.
+             (org-export-resolve-coderef raw-path info)))
      ;; External link with a description part.
      ((and path desc) (format "\\href{%s}{%s}" path desc))
      ;; External link without a description part.
diff --git a/lisp/org/ox-man.el b/lisp/org/ox-man.el
index 36822ff..6cace7e 100644
--- a/lisp/org/ox-man.el
+++ b/lisp/org/ox-man.el
@@ -1,6 +1,6 @@
 ;; ox-man.el --- Man Back-End for Org Export Engine -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
 ;;      Luis R Anaya <papoanaya aroba hot mail punto com>
@@ -40,6 +40,8 @@
 (require 'cl-lib)
 (require 'ox)
 
+;;; Function Declarations
+
 (defvar org-export-man-default-packages-alist)
 (defvar org-export-man-packages-alist)
 (defvar orgtbl-exp-regexp)
@@ -599,24 +601,24 @@ CONTENTS is nil.  INFO is a plist holding contextual 
information."
 ;;; Link
 
 
-(defun org-man-link (link desc _info)
+(defun org-man-link (link desc info)
   "Transcode a LINK object from Org to Man.
 
 DESC is the description part of the link, or the empty string.
 INFO is a plist holding contextual information.  See
 `org-export-data'."
   (let* ((type (org-element-property :type link))
-         (raw-path (org-element-property :path link))
+        (raw-path (org-element-property :path link))
          ;; Ensure DESC really exists, or set it to nil.
          (desc (and (not (string= desc "")) desc))
-         (path (cond
-                ((member type '("http" "https" "ftp" "mailto"))
-                 (concat type ":" raw-path))
-                ((string= type "file") (org-export-file-uri raw-path))
-                (t raw-path))))
+         (path (pcase type
+                 ((or "http" "https" "ftp" "mailto")
+                  (concat type ":" raw-path))
+                 ("file" (org-export-file-uri raw-path))
+                 (_ raw-path))))
     (cond
      ;; Link type is handled by a special function.
-     ((org-export-custom-protocol-maybe link desc 'man))
+     ((org-export-custom-protocol-maybe link desc 'man info))
      ;; External link with a description part.
      ((and path desc) (format "%s \\fBat\\fP \\fI%s\\fP" path desc))
      ;; External link without a description part.
@@ -1136,8 +1138,4 @@ Return PDF file name or an error if it couldn't be 
produced."
 
 (provide 'ox-man)
 
-;; Local variables:
-;; generated-autoload-file: "org-loaddefs.el"
-;; End:
-
 ;;; ox-man.el ends here
diff --git a/lisp/org/ox-md.el b/lisp/org/ox-md.el
index 91d5c0b..f4afe6b 100644
--- a/lisp/org/ox-md.el
+++ b/lisp/org/ox-md.el
@@ -1,6 +1,6 @@
 ;;; ox-md.el --- Markdown Back-End for Org Export Engine -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <n.goaziou@gmail.com>
 ;; Keywords: org, wp, markdown
@@ -85,13 +85,17 @@ The %s will be replaced by the footnote reference itself."
              (if a (org-md-export-to-markdown t s v)
                (org-open-file (org-md-export-to-markdown nil s v)))))))
   :translate-alist '((bold . org-md-bold)
+                    (center-block . org-md--convert-to-html)
                     (code . org-md-verbatim)
+                    (drawer . org-md--identity)
+                    (dynamic-block . org-md--identity)
                     (example-block . org-md-example-block)
                     (export-block . org-md-export-block)
                     (fixed-width . org-md-example-block)
                     (headline . org-md-headline)
                     (horizontal-rule . org-md-horizontal-rule)
                     (inline-src-block . org-md-verbatim)
+                    (inlinetask . org-md--convert-to-html)
                     (inner-template . org-md-inner-template)
                     (italic . org-md-italic)
                     (item . org-md-item)
@@ -105,7 +109,9 @@ The %s will be replaced by the footnote reference itself."
                     (property-drawer . org-md-property-drawer)
                     (quote-block . org-md-quote-block)
                     (section . org-md-section)
+                    (special-block . org-md--convert-to-html)
                     (src-block . org-md-example-block)
+                    (table . org-md--convert-to-html)
                     (template . org-md-template)
                     (verbatim . org-md-verbatim))
   :options-alist
@@ -147,6 +153,145 @@ Assume BACKEND is `md'."
   ;; Return updated tree.
   tree)
 
+
+;;; Internal functions
+
+(defun org-md--headline-referred-p (headline info)
+  "Non-nil when HEADLINE is being referred to.
+INFO is a plist used as a communication channel.  Links and table
+of contents can refer to headlines."
+  (unless (org-element-property :footnote-section-p headline)
+    (or
+     ;; Global table of contents includes HEADLINE.
+     (and (plist-get info :with-toc)
+         (memq headline
+               (org-export-collect-headlines info (plist-get info :with-toc))))
+     ;; A local table of contents includes HEADLINE.
+     (cl-some
+      (lambda (h)
+       (let ((section (car (org-element-contents h))))
+         (and
+          (eq 'section (org-element-type section))
+          (org-element-map section 'keyword
+            (lambda (keyword)
+              (when (equal "TOC" (org-element-property :key keyword))
+                (let ((case-fold-search t)
+                      (value (org-element-property :value keyword)))
+                  (and (string-match-p "\\<headlines\\>" value)
+                       (let ((n (and
+                                 (string-match "\\<[0-9]+\\>" value)
+                                 (string-to-number (match-string 0 value))))
+                             (local? (string-match-p "\\<local\\>" value)))
+                         (memq headline
+                               (org-export-collect-headlines
+                                info n (and local? keyword))))))))
+            info t))))
+      (org-element-lineage headline))
+     ;; A link refers internally to HEADLINE.
+     (org-element-map (plist-get info :parse-tree) 'link
+       (lambda (link)
+        (eq headline
+            (pcase (org-element-property :type link)
+              ((or "custom-id" "id") (org-export-resolve-id-link link info))
+              ("fuzzy" (org-export-resolve-fuzzy-link link info))
+              (_ nil))))
+       info t))))
+
+(defun org-md--headline-title (style level title &optional anchor tags)
+  "Generate a headline title in the preferred Markdown headline style.
+STYLE is the preferred style (`atx' or `setext').  LEVEL is the
+header level.  TITLE is the headline title.  ANCHOR is the HTML
+anchor tag for the section as a string.  TAGS are the tags set on
+the section."
+  (let ((anchor-lines (and anchor (concat anchor "\n\n"))))
+    ;; Use "Setext" style
+    (if (and (eq style 'setext) (< level 3))
+        (let* ((underline-char (if (= level 1) ?= ?-))
+               (underline (concat (make-string (length title) underline-char)
+                                 "\n")))
+          (concat "\n" anchor-lines title tags "\n" underline "\n"))
+        ;; Use "Atx" style
+        (let ((level-mark (make-string level ?#)))
+          (concat "\n" anchor-lines level-mark " " title tags "\n\n")))))
+
+(defun org-md--build-toc (info &optional n _keyword scope)
+  "Return a table of contents.
+
+INFO is a plist used as a communication channel.
+
+Optional argument N, when non-nil, is an integer specifying the
+depth of the table.
+
+When optional argument SCOPE is non-nil, build a table of
+contents according to the specified element."
+  (concat
+   (unless scope
+     (let ((style (plist-get info :md-headline-style))
+          (title (org-html--translate "Table of Contents" info)))
+       (org-md--headline-title style 1 title nil)))
+   (mapconcat
+    (lambda (headline)
+      (let* ((indentation
+             (make-string
+              (* 4 (1- (org-export-get-relative-level headline info)))
+              ?\s))
+            (bullet
+             (if (not (org-export-numbered-headline-p headline info)) "-   "
+               (let ((prefix
+                      (format "%d." (org-last (org-export-get-headline-number
+                                               headline info)))))
+                 (concat prefix (make-string (max 1 (- 4 (length prefix)))
+                                             ?\s)))))
+            (title
+             (format "[%s](#%s)"
+                     (org-export-data-with-backend
+                      (org-export-get-alt-title headline info)
+                      (org-export-toc-entry-backend 'md)
+                      info)
+                     (or (org-element-property :CUSTOM_ID headline)
+                         (org-export-get-reference headline info))))
+            (tags (and (plist-get info :with-tags)
+                       (not (eq 'not-in-toc (plist-get info :with-tags)))
+                       (org-make-tag-string
+                        (org-export-get-tags headline info)))))
+       (concat indentation bullet title tags)))
+    (org-export-collect-headlines info n scope) "\n")
+   "\n"))
+
+(defun org-md--footnote-formatted (footnote info)
+  "Formats a single footnote entry FOOTNOTE.
+FOOTNOTE is a cons cell of the form (number . definition).
+INFO is a plist with contextual information."
+  (let* ((fn-num (car footnote))
+         (fn-text (cdr footnote))
+         (fn-format (plist-get info :md-footnote-format))
+         (fn-anchor (format "fn.%d" fn-num))
+         (fn-href (format " href=\"#fnr.%d\"" fn-num))
+         (fn-link-to-ref (org-html--anchor fn-anchor fn-num fn-href info)))
+    (concat (format fn-format fn-link-to-ref) " " fn-text "\n")))
+
+(defun org-md--footnote-section (info)
+  "Format the footnote section.
+INFO is a plist used as a communication channel."
+  (let* ((fn-alist (org-export-collect-footnote-definitions info))
+         (fn-alist (cl-loop for (n _type raw) in fn-alist collect
+                            (cons n (org-trim (org-export-data raw info)))))
+         (headline-style (plist-get info :md-headline-style))
+         (section-title (org-html--translate "Footnotes" info)))
+    (when fn-alist
+      (format (plist-get info :md-footnotes-section)
+              (org-md--headline-title headline-style 1 section-title)
+              (mapconcat (lambda (fn) (org-md--footnote-formatted fn info))
+                         fn-alist
+                         "\n")))))
+
+(defun org-md--convert-to-html (datum _contents info)
+  "Convert DATUM into raw HTML, including contents."
+  (org-export-data-with-backend datum 'html info))
+
+(defun org-md--identity (_datum contents _info)
+  "Return CONTENTS only."
+  contents)
 
 
 ;;; Transcode Functions
@@ -242,65 +387,6 @@ a communication channel."
          (concat (org-md--headline-title style level heading anchor tags)
                  contents)))))))
 
-
-(defun org-md--headline-referred-p (headline info)
-  "Non-nil when HEADLINE is being referred to.
-INFO is a plist used as a communication channel.  Links and table
-of contents can refer to headlines."
-  (unless (org-element-property :footnote-section-p headline)
-    (or
-     ;; Global table of contents includes HEADLINE.
-     (and (plist-get info :with-toc)
-         (memq headline
-               (org-export-collect-headlines info (plist-get info :with-toc))))
-     ;; A local table of contents includes HEADLINE.
-     (cl-some
-      (lambda (h)
-       (let ((section (car (org-element-contents h))))
-         (and
-          (eq 'section (org-element-type section))
-          (org-element-map section 'keyword
-            (lambda (keyword)
-              (when (equal "TOC" (org-element-property :key keyword))
-                (let ((case-fold-search t)
-                      (value (org-element-property :value keyword)))
-                  (and (string-match-p "\\<headlines\\>" value)
-                       (let ((n (and
-                                 (string-match "\\<[0-9]+\\>" value)
-                                 (string-to-number (match-string 0 value))))
-                             (local? (string-match-p "\\<local\\>" value)))
-                         (memq headline
-                               (org-export-collect-headlines
-                                info n (and local? keyword))))))))
-            info t))))
-      (org-element-lineage headline))
-     ;; A link refers internally to HEADLINE.
-     (org-element-map (plist-get info :parse-tree) 'link
-       (lambda (link)
-        (eq headline
-            (pcase (org-element-property :type link)
-              ((or "custom-id" "id") (org-export-resolve-id-link link info))
-              ("fuzzy" (org-export-resolve-fuzzy-link link info))
-              (_ nil))))
-       info t))))
-
-(defun org-md--headline-title (style level title &optional anchor tags)
-  "Generate a headline title in the preferred Markdown headline style.
-STYLE is the preferred style (`atx' or `setext').  LEVEL is the
-header level.  TITLE is the headline title.  ANCHOR is the HTML
-anchor tag for the section as a string.  TAGS are the tags set on
-the section."
-  (let ((anchor-lines (and anchor (concat anchor "\n\n"))))
-    ;; Use "Setext" style
-    (if (and (eq style 'setext) (< level 3))
-        (let* ((underline-char (if (= level 1) ?= ?-))
-               (underline (concat (make-string (length title) underline-char)
-                                 "\n")))
-          (concat "\n" anchor-lines title tags "\n" underline "\n"))
-        ;; Use "Atx" style
-        (let ((level-mark (make-string level ?#)))
-          (concat "\n" anchor-lines level-mark " " title tags "\n\n")))))
-
 ;;;; Horizontal Rule
 
 (defun org-md-horizontal-rule (_horizontal-rule _contents _info)
@@ -385,20 +471,28 @@ channel."
 
 ;;;; Link
 
-(defun org-md-link (link contents info)
-  "Transcode LINE-BREAK object into Markdown format.
-CONTENTS is the link's description.  INFO is a plist used as
-a communication channel."
-  (let ((link-org-files-as-md
-        (lambda (raw-path)
-          ;; Treat links to `file.org' as links to `file.md'.
-          (if (string= ".org" (downcase (file-name-extension raw-path ".")))
-              (concat (file-name-sans-extension raw-path) ".md")
-            raw-path)))
-       (type (org-element-property :type link)))
+(defun org-md-link (link desc info)
+  "Transcode LINK object into Markdown format.
+DESC is the description part of the link, or the empty string.
+INFO is a plist holding contextual information.  See
+`org-export-data'."
+  (let* ((link-org-files-as-md
+         (lambda (raw-path)
+           ;; Treat links to `file.org' as links to `file.md'.
+           (if (string= ".org" (downcase (file-name-extension raw-path ".")))
+               (concat (file-name-sans-extension raw-path) ".md")
+             raw-path)))
+        (type (org-element-property :type link))
+        (raw-path (org-element-property :path link))
+        (path (cond
+               ((member type '("http" "https" "ftp" "mailto"))
+                (concat type ":" raw-path))
+               ((string-equal  type "file")
+                (org-export-file-uri (funcall link-org-files-as-md raw-path)))
+               (t raw-path))))
     (cond
      ;; Link type is handled by a special function.
-     ((org-export-custom-protocol-maybe link contents 'md))
+     ((org-export-custom-protocol-maybe link desc 'md info))
      ((member type '("custom-id" "id" "fuzzy"))
       (let ((destination (if (string= type "fuzzy")
                             (org-export-resolve-fuzzy-link link info)
@@ -406,13 +500,13 @@ a communication channel."
        (pcase (org-element-type destination)
          (`plain-text                  ; External file.
           (let ((path (funcall link-org-files-as-md destination)))
-            (if (not contents) (format "<%s>" path)
-              (format "[%s](%s)" contents path))))
+            (if (not desc) (format "<%s>" path)
+              (format "[%s](%s)" desc path))))
          (`headline
           (format
            "[%s](#%s)"
            ;; Description.
-           (cond ((org-string-nw-p contents))
+           (cond ((org-string-nw-p desc))
                  ((org-export-numbered-headline-p destination info)
                   (mapconcat #'number-to-string
                              (org-export-get-headline-number destination info)
@@ -424,7 +518,7 @@ a communication channel."
                (org-export-get-reference destination info))))
          (_
           (let ((description
-                 (or (org-string-nw-p contents)
+                 (or (org-string-nw-p desc)
                      (let ((number (org-export-get-ordinal destination info)))
                        (cond
                         ((not number) nil)
@@ -435,31 +529,23 @@ a communication channel."
                       description
                       (org-export-get-reference destination info))))))))
      ((org-export-inline-image-p link org-html-inline-image-rules)
-      (let ((path (let ((raw-path (org-element-property :path link)))
-                   (cond ((not (equal "file" type)) (concat type ":" raw-path))
-                         ((not (file-name-absolute-p raw-path)) raw-path)
-                         (t (expand-file-name raw-path)))))
+      (let ((path (cond ((not (string-equal type "file"))
+                        (concat type ":" raw-path))
+                       ((not (file-name-absolute-p raw-path)) raw-path)
+                       (t (expand-file-name raw-path))))
            (caption (org-export-data
                      (org-export-get-caption
-                      (org-export-get-parent-element link)) info)))
+                      (org-export-get-parent-element link))
+                     info)))
        (format "![img](%s)"
                (if (not (org-string-nw-p caption)) path
                  (format "%s \"%s\"" path caption)))))
      ((string= type "coderef")
-      (let ((ref (org-element-property :path link)))
-       (format (org-export-get-coderef-format ref contents)
-               (org-export-resolve-coderef ref info))))
-     ((equal type "radio") contents)
-     (t (let* ((raw-path (org-element-property :path link))
-              (path
-               (cond
-                ((member type '("http" "https" "ftp" "mailto"))
-                 (concat type ":" raw-path))
-                ((string= type "file")
-                 (org-export-file-uri (funcall link-org-files-as-md raw-path)))
-                (t raw-path))))
-         (if (not contents) (format "<%s>" path)
-           (format "[%s](%s)" contents path)))))))
+      (format (org-export-get-coderef-format path desc)
+             (org-export-resolve-coderef path info)))
+     ((equal type "radio") desc)
+     (t (if (not desc) (format "<%s>" path)
+         (format "[%s](%s)" desc path))))))
 
 
 ;;;; Node Property
@@ -555,77 +641,6 @@ a communication channel."
 
 ;;;; Template
 
-(defun org-md--build-toc (info &optional n _keyword scope)
-  "Return a table of contents.
-
-INFO is a plist used as a communication channel.
-
-Optional argument N, when non-nil, is an integer specifying the
-depth of the table.
-
-When optional argument SCOPE is non-nil, build a table of
-contents according to the specified element."
-  (concat
-   (unless scope
-     (let ((style (plist-get info :md-headline-style))
-          (title (org-html--translate "Table of Contents" info)))
-       (org-md--headline-title style 1 title nil)))
-   (mapconcat
-    (lambda (headline)
-      (let* ((indentation
-             (make-string
-              (* 4 (1- (org-export-get-relative-level headline info)))
-              ?\s))
-            (bullet
-             (if (not (org-export-numbered-headline-p headline info)) "-   "
-               (let ((prefix
-                      (format "%d." (org-last (org-export-get-headline-number
-                                               headline info)))))
-                 (concat prefix (make-string (max 1 (- 4 (length prefix)))
-                                             ?\s)))))
-            (title
-             (format "[%s](#%s)"
-                     (org-export-data-with-backend
-                      (org-export-get-alt-title headline info)
-                      (org-export-toc-entry-backend 'md)
-                      info)
-                     (or (org-element-property :CUSTOM_ID headline)
-                         (org-export-get-reference headline info))))
-            (tags (and (plist-get info :with-tags)
-                       (not (eq 'not-in-toc (plist-get info :with-tags)))
-                       (org-make-tag-string
-                        (org-export-get-tags headline info)))))
-       (concat indentation bullet title tags)))
-    (org-export-collect-headlines info n scope) "\n")
-   "\n"))
-
-(defun org-md--footnote-formatted (footnote info)
-  "Formats a single footnote entry FOOTNOTE.
-FOOTNOTE is a cons cell of the form (number . definition).
-INFO is a plist with contextual information."
-  (let* ((fn-num (car footnote))
-         (fn-text (cdr footnote))
-         (fn-format (plist-get info :md-footnote-format))
-         (fn-anchor (format "fn.%d" fn-num))
-         (fn-href (format " href=\"#fnr.%d\"" fn-num))
-         (fn-link-to-ref (org-html--anchor fn-anchor fn-num fn-href info)))
-    (concat (format fn-format fn-link-to-ref) " " fn-text "\n")))
-
-(defun org-md--footnote-section (info)
-  "Format the footnote section.
-INFO is a plist used as a communication channel."
-  (let* ((fn-alist (org-export-collect-footnote-definitions info))
-         (fn-alist (cl-loop for (n _type raw) in fn-alist collect
-                            (cons n (org-trim (org-export-data raw info)))))
-         (headline-style (plist-get info :md-headline-style))
-         (section-title (org-html--translate "Footnotes" info)))
-    (when fn-alist
-      (format (plist-get info :md-footnotes-section)
-              (org-md--headline-title headline-style 1 section-title)
-              (mapconcat (lambda (fn) (org-md--footnote-formatted fn info))
-                         fn-alist
-                         "\n")))))
-
 (defun org-md-inner-template (contents info)
   "Return body of document after converting it to Markdown syntax.
 CONTENTS is the transcoded contents string.  INFO is a plist
diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el
index 229b524..2d550d9 100644
--- a/lisp/org/ox-odt.el
+++ b/lisp/org/ox-odt.el
@@ -1,6 +1,6 @@
 ;;; ox-odt.el --- OpenDocument Text Exporter for Org Mode -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Jambunathan K <kjambunathan at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -96,7 +96,7 @@
              (if a (org-odt-export-to-odt t s v)
                (org-open-file (org-odt-export-to-odt nil s v) 'system))))))
   :options-alist
-  '((:odt-styles-file "ODT_STYLES_FILE" nil nil t)
+  '((:odt-styles-file "ODT_STYLES_FILE" nil org-odt-styles-file t)
     (:description "DESCRIPTION" nil nil newline)
     (:keywords "KEYWORDS" nil nil space)
     (:subtitle "SUBTITLE" nil nil parse)
@@ -110,7 +110,6 @@
     (:odt-inline-formula-rules nil nil org-odt-inline-formula-rules)
     (:odt-inline-image-rules nil nil org-odt-inline-image-rules)
     (:odt-pixels-per-inch nil nil org-odt-pixels-per-inch)
-    (:odt-styles-file nil nil org-odt-styles-file)
     (:odt-table-styles nil nil org-odt-table-styles)
     (:odt-use-date-fields nil nil org-odt-use-date-fields)
     ;; Redefine regular option.
@@ -741,7 +740,7 @@ link's path."
                :value-type (regexp :tag "Path")))
 
 (defcustom org-odt-inline-image-rules
-  '(("file" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'"))
+  `(("file" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg"))))
   "Rules characterizing image files that can be inlined into ODT.
 
 A rule consists in an association whose key is the type of link
@@ -1383,6 +1382,8 @@ original parsed data.  INFO is a plist holding export 
options."
 
     ;; create a manifest entry for styles.xml
     (org-odt-create-manifest-file-entry "text/xml" "styles.xml")
+    ;; Ensure we have write permissions to this file.
+    (set-file-modes (concat org-odt-zip-dir "styles.xml") #o600)
 
     ;; FIXME: Who is opening an empty styles.xml before this point?
     (with-current-buffer
@@ -2204,11 +2205,10 @@ SHORT-CAPTION are strings."
                   (inches (/ pixels dpi)))
               (* cms-per-inch inches))))
         (--size-in-cms
-         (function
-          (lambda (size-in-pixels dpi)
-            (and size-in-pixels
-                 (cons (funcall --pixels-to-cms (car size-in-pixels) dpi)
-                       (funcall --pixels-to-cms (cdr size-in-pixels) dpi))))))
+         (lambda (size-in-pixels dpi)
+           (and size-in-pixels
+                (cons (funcall --pixels-to-cms (car size-in-pixels) dpi)
+                      (funcall --pixels-to-cms (cdr size-in-pixels) dpi)))))
         (dpi (or dpi (plist-get info :odt-pixels-per-inch)))
         (anchor-type (or embed-as "paragraph"))
         (user-width (and (not scale) user-width))
@@ -2699,13 +2699,14 @@ INFO is a plist holding contextual information.  See
         (path (cond
                ((member type '("http" "https" "ftp" "mailto"))
                 (concat type ":" raw-path))
-               ((string= type "file") (org-export-file-uri raw-path))
+               ((string= type "file")
+                (org-export-file-uri raw-path))
                (t raw-path)))
         ;; Convert & to &amp; for correct XML representation
         (path (replace-regexp-in-string "&" "&amp;" path)))
     (cond
      ;; Link type is handled by a special function.
-     ((org-export-custom-protocol-maybe link desc 'odt))
+     ((org-export-custom-protocol-maybe link desc 'odt info))
      ;; Image file.
      ((and (not desc) imagep) (org-odt-link--inline-image link info))
      ;; Formula file.
@@ -2946,7 +2947,7 @@ channel."
             (when scheduled
               (concat
                (format "<text:span text:style-name=\"%s\">%s</text:span>"
-                       "OrgScheduledKeyword" org-deadline-string)
+                       "OrgScheduledKeyword" org-scheduled-string)
                (org-odt-timestamp scheduled contents info)))))))
 
 
@@ -3728,7 +3729,8 @@ contextual information."
                 (cache-dir (file-name-directory input-file))
                 (cache-subdir (concat
                                (cl-case processing-type
-                                 ((dvipng imagemagick) "ltxpng/")
+                                 ((dvipng imagemagick)
+                                  org-preview-latex-image-directory)
                                  (mathml "ltxmathml/"))
                                (file-name-sans-extension
                                 (file-name-nondirectory input-file))))
@@ -4239,7 +4241,7 @@ Return output file's name."
                           `((?i . ,(shell-quote-argument in-file))
                             (?I . ,(browse-url-file-url in-file))
                             (?f . ,out-fmt)
-                            (?o . ,out-file)
+                            (?o . ,(shell-quote-argument out-file))
                             (?O . ,(browse-url-file-url out-file))
                             (?d . , (shell-quote-argument out-dir))
                             (?D . ,(browse-url-file-url out-dir))
diff --git a/lisp/org/ox-org.el b/lisp/org/ox-org.el
index 97d8d0e..26259d8 100644
--- a/lisp/org/ox-org.el
+++ b/lisp/org/ox-org.el
@@ -1,6 +1,6 @@
 ;;; ox-org.el --- Org Back-End for Org Export Engine -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <n.goaziou@gmail.com>
 ;; Keywords: org, wp
@@ -165,11 +165,11 @@ CONTENTS is nil.  INFO is ignored."
                    '("AUTHOR" "CREATOR" "DATE" "EMAIL" "OPTIONS" "TITLE"))
       (org-element-keyword-interpreter keyword nil))))
 
-(defun org-org-link (link contents _info)
+(defun org-org-link (link contents info)
   "Transcode LINK object back into Org syntax.
 CONTENTS is the description of the link, as a string, or nil.
 INFO is a plist containing current export state."
-  (or (org-export-custom-protocol-maybe link contents 'org)
+  (or (org-export-custom-protocol-maybe link contents 'org info)
       (org-element-link-interpreter link contents)))
 
 (defun org-org-template (contents info)
diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el
index a476796..6f82b48 100644
--- a/lisp/org/ox-publish.el
+++ b/lisp/org/ox-publish.el
@@ -1,5 +1,5 @@
 ;;; ox-publish.el --- Publish Related Org Mode Files as a Website -*- 
lexical-binding: t; -*-
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: David O'Toole <dto@gnu.org>
 ;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
@@ -659,8 +659,8 @@ If `:auto-sitemap' is set, publish the sitemap too.  If
     (let ((plist (cdr project)))
       (let ((fun (org-publish-property :preparation-function project)))
        (cond
-        ((consp fun) (dolist (f fun) (funcall f plist)))
-        ((functionp fun) (funcall fun plist))))
+        ((functionp fun) (funcall fun plist))
+        ((consp fun) (dolist (f fun) (funcall f plist)))))
       ;; Each project uses its own cache file.
       (org-publish-initialize-cache (car project))
       (when (org-publish-property :auto-sitemap project)
@@ -685,8 +685,8 @@ If `:auto-sitemap' is set, publish the sitemap too.  If
          (org-publish-file theindex project t)))
       (let ((fun (org-publish-property :completion-function project)))
        (cond
-        ((consp fun) (dolist (f fun) (funcall f plist)))
-        ((functionp fun) (funcall fun plist)))))
+        ((functionp fun) (funcall fun plist))
+        ((consp fun) (dolist (f fun) (funcall f plist))))))
     (org-publish-write-cache-file)))
 
 
@@ -754,7 +754,8 @@ Default for SITEMAP-FILENAME is `sitemap.org'."
   (let* ((root (expand-file-name
                (file-name-as-directory
                 (org-publish-property :base-directory project))))
-        (sitemap-filename (concat root (or sitemap-filename "sitemap.org")))
+        (sitemap-filename (expand-file-name (or sitemap-filename "sitemap.org")
+                                            root))
         (title (or (org-publish-property :sitemap-title project)
                    (concat "Sitemap for project " (car project))))
         (style (or (org-publish-property :sitemap-style project)
diff --git a/lisp/org/ox-texinfo.el b/lisp/org/ox-texinfo.el
index 4265a85..cf08054 100644
--- a/lisp/org/ox-texinfo.el
+++ b/lisp/org/ox-texinfo.el
@@ -1,6 +1,6 @@
 ;;; ox-texinfo.el --- Texinfo Back-End for Org Export Engine -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 ;; Author: Jonathan Leech-Pepin <jonathan.leechpepin at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
 
@@ -600,7 +600,8 @@ holding export options."
         "^@documentencoding \\(AUTO\\)$"
         coding
         (replace-regexp-in-string
-         "^@documentlanguage \\(AUTO\\)$" language header t nil 1) t nil 1)))
+         "^@documentlanguage \\(AUTO\\)$" language header t nil 1)
+        t nil 1)))
      ;; Additional header options set by #+TEXINFO_HEADER.
      (let ((texinfo-header (plist-get info :texinfo-header)))
        (and texinfo-header (org-element-normalize-string texinfo-header)))
@@ -1049,13 +1050,15 @@ INFO is a plist holding contextual information.  See
         (raw-path (org-element-property :path link))
         ;; Ensure DESC really exists, or set it to nil.
         (desc (and (not (string= desc "")) desc))
-        (path (cond
-               ((member type '("http" "https" "ftp"))
-                (concat type ":" raw-path))
-               ((string= type "file") (org-export-file-uri raw-path))
-               (t raw-path))))
+        (path (org-texinfo--sanitize-content
+               (cond
+                ((member type '("http" "https" "ftp"))
+                 (concat type ":" raw-path))
+                ((string-equal type "file")
+                 (org-export-file-uri raw-path))
+                (t raw-path)))))
     (cond
-     ((org-export-custom-protocol-maybe link desc 'texinfo))
+     ((org-export-custom-protocol-maybe link desc 'texinfo info))
      ((org-export-inline-image-p link org-texinfo-inline-image-rules)
       (org-texinfo--inline-image link info))
      ((equal type "radio")
@@ -1069,8 +1072,7 @@ INFO is a plist holding contextual information.  See
               (org-export-resolve-id-link link info))))
        (pcase (org-element-type destination)
          (`nil
-          (format org-texinfo-link-with-unknown-path-format
-                  (org-texinfo--sanitize-content path)))
+          (format org-texinfo-link-with-unknown-path-format path))
          ;; Id link points to an external file.
          (`plain-text
           (if desc (format "@uref{file://%s,%s}" destination desc)
@@ -1088,8 +1090,7 @@ INFO is a plist holding contextual information.  See
          (_ (org-texinfo--@ref destination desc info)))))
      ((string= type "mailto")
       (format "@email{%s}"
-             (concat (org-texinfo--sanitize-content path)
-                     (and desc (concat ", " desc)))))
+             (concat path (and desc (concat ", " desc)))))
      ;; External link with a description part.
      ((and path desc) (format "@uref{%s, %s}" path desc))
      ;; External link without a description part.
diff --git a/lisp/org/ox.el b/lisp/org/ox.el
index 2f8fd0c..050a809 100644
--- a/lisp/org/ox.el
+++ b/lisp/org/ox.el
@@ -1,6 +1,6 @@
 ;;; ox.el --- Export Framework for Org Mode          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -172,12 +172,6 @@ All these properties should be back-end agnostic.  Back-end
 specific properties are set through `org-export-define-backend'.
 Properties redefined there have precedence over these.")
 
-(defconst org-export-special-keywords '("FILETAGS" "SETUPFILE" "OPTIONS")
-  "List of in-buffer keywords that require special treatment.
-These keywords are not directly associated to a property.  The
-way they are handled must be hard-coded into
-`org-export--get-inbuffer-options' function.")
-
 (defconst org-export-filters-alist
   '((:filter-body . org-export-filter-body-functions)
     (:filter-bold . org-export-filter-bold-functions)
@@ -1474,104 +1468,57 @@ Assume buffer is in Org mode.  Narrowing, if any, is 
ignored."
                   ;; Priority is given to back-end specific options.
                   (org-export-get-all-options backend)
                   org-export-options-alist))
-        (regexp (format "^[ \t]*#\\+%s:"
-                        (regexp-opt (nconc (delq nil (mapcar #'cadr options))
-                                           org-export-special-keywords))))
         plist to-parse)
-    (letrec ((find-properties
-             (lambda (keyword)
-               ;; Return all properties associated to KEYWORD.
-               (let (properties)
-                 (dolist (option options properties)
-                   (when (equal (nth 1 option) keyword)
-                     (cl-pushnew (car option) properties))))))
-            (get-options
-             (lambda (&optional files)
-               ;; Recursively read keywords in buffer.  FILES is
-               ;; a list of files read so far.  PLIST is the current
-               ;; property list obtained.
-               (org-with-wide-buffer
-                (goto-char (point-min))
-                (while (re-search-forward regexp nil t)
-                  (let ((element (org-element-at-point)))
-                    (when (eq (org-element-type element) 'keyword)
-                      (let ((key (org-element-property :key element))
-                            (val (org-element-property :value element)))
-                        (cond
-                         ;; Options in `org-export-special-keywords'.
-                         ((equal key "SETUPFILE")
-                          (let* ((uri (org-strip-quotes (org-trim val)))
-                                 (uri-is-url (org-file-url-p uri))
-                                 (uri (if uri-is-url
-                                          uri
-                                        (expand-file-name uri))))
-                            ;; Avoid circular dependencies.
-                            (unless (member uri files)
-                              (with-temp-buffer
-                                (unless uri-is-url
-                                  (setq default-directory
-                                        (file-name-directory uri)))
-                                (insert (org-file-contents uri 'noerror))
-                                (let ((org-inhibit-startup t)) (org-mode))
-                                (funcall get-options (cons uri files))))))
-                         ((equal key "OPTIONS")
-                          (setq plist
-                                (org-combine-plists
-                                 plist
-                                 (org-export--parse-option-keyword
-                                  val backend))))
-                         ((equal key "FILETAGS")
-                          (setq plist
-                                (org-combine-plists
-                                 plist
-                                 (list :filetags
-                                       (org-uniquify
-                                        (append
-                                         (org-split-string val ":")
-                                         (plist-get plist :filetags)))))))
-                         (t
-                          ;; Options in `org-export-options-alist'.
-                          (dolist (property (funcall find-properties key))
-                            (setq
-                             plist
-                             (plist-put
-                              plist property
-                              ;; Handle value depending on specified
-                              ;; BEHAVIOR.
-                              (cl-case (nth 4 (assq property options))
-                                (parse
-                                 (unless (memq property to-parse)
-                                   (push property to-parse))
-                                 ;; Even if `parse' implies `space'
-                                 ;; behavior, we separate line with
-                                 ;; "\n" so as to preserve
-                                 ;; line-breaks.  However, empty
-                                 ;; lines are forbidden since `parse'
-                                 ;; doesn't allow more than one
-                                 ;; paragraph.
-                                 (let ((old (plist-get plist property)))
-                                   (cond ((not (org-string-nw-p val)) old)
-                                         (old (concat old "\n" val))
-                                         (t val))))
-                                (space
-                                 (if (not (plist-get plist property))
-                                     (org-trim val)
-                                   (concat (plist-get plist property)
-                                           " "
-                                           (org-trim val))))
-                                (newline
-                                 (org-trim
-                                  (concat (plist-get plist property)
-                                          "\n"
-                                          (org-trim val))))
-                                (split `(,@(plist-get plist property)
-                                         ,@(split-string val)))
-                                ((t) val)
-                                (otherwise
-                                 (if (not (plist-member plist property)) val
-                                   (plist-get plist property)))))))))))))))))
+    (let ((find-properties
+          (lambda (keyword)
+            ;; Return all properties associated to KEYWORD.
+            (let (properties)
+              (dolist (option options properties)
+                (when (equal (nth 1 option) keyword)
+                  (cl-pushnew (car option) properties)))))))
       ;; Read options in the current buffer and return value.
-      (funcall get-options (and buffer-file-name (list buffer-file-name)))
+      (dolist (entry (org-collect-keywords
+                     (nconc (delq nil (mapcar #'cadr options))
+                            '("FILETAGS" "OPTIONS"))))
+       (pcase entry
+         (`("OPTIONS" . ,values)
+          (setq plist
+                (apply #'org-combine-plists
+                       plist
+                       (mapcar (lambda (v)
+                                 (org-export--parse-option-keyword v backend))
+                               values))))
+         (`("FILETAGS" . ,values)
+          (setq plist
+                (plist-put plist
+                           :filetags
+                           (org-uniquify
+                            (cl-mapcan (lambda (v) (org-split-string v ":"))
+                                       values)))))
+         (`(,keyword . ,values)
+          (dolist (property (funcall find-properties keyword))
+            (setq plist
+                  (plist-put
+                   plist property
+                   ;; Handle value depending on specified BEHAVIOR.
+                   (cl-case (nth 4 (assq property options))
+                     (parse
+                      (unless (memq property to-parse)
+                        (push property to-parse))
+                      ;; Even if `parse' implies `space' behavior, we
+                      ;; separate line with "\n" so as to preserve
+                      ;; line-breaks.
+                      (mapconcat #'identity values "\n"))
+                     (space
+                      (mapconcat #'identity values " "))
+                     (newline
+                      (mapconcat #'identity values "\n"))
+                     (split
+                      (cl-mapcan (lambda (v) (split-string v)) values))
+                     ((t)
+                      (org-last values))
+                     (otherwise
+                      (car values)))))))))
       ;; Parse properties in TO-PARSE.  Remove newline characters not
       ;; involved in line breaks to simulate `space' behavior.
       ;; Finally return options.
@@ -1633,44 +1580,10 @@ process."
 Also look for BIND keywords in setup files.  The return value is
 an alist where associations are (VARIABLE-NAME VALUE)."
   (when org-export-allow-bind-keywords
-    (letrec ((collect-bind
-             (lambda (files alist)
-               ;; Return an alist between variable names and their
-               ;; value.  FILES is a list of setup files names read
-               ;; so far, used to avoid circular dependencies.  ALIST
-               ;; is the alist collected so far.
-               (let ((case-fold-search t))
-                 (org-with-wide-buffer
-                  (goto-char (point-min))
-                  (while (re-search-forward
-                          "^[ \t]*#\\+\\(BIND\\|SETUPFILE\\):" nil t)
-                    (let ((element (org-element-at-point)))
-                      (when (eq (org-element-type element) 'keyword)
-                        (let ((val (org-element-property :value element)))
-                          (if (equal (org-element-property :key element)
-                                     "BIND")
-                              (push (read (format "(%s)" val)) alist)
-                            ;; Enter setup file.
-                            (let* ((uri (org-strip-quotes val))
-                                   (uri-is-url (org-file-url-p uri))
-                                   (uri (if uri-is-url
-                                            uri
-                                          (expand-file-name uri))))
-                              ;; Avoid circular dependencies.
-                              (unless (member uri files)
-                                (with-temp-buffer
-                                  (unless uri-is-url
-                                    (setq default-directory
-                                          (file-name-directory uri)))
-                                  (let ((org-inhibit-startup t)) (org-mode))
-                                  (insert (org-file-contents uri 'noerror))
-                                  (setq alist
-                                        (funcall collect-bind
-                                                 (cons uri files)
-                                                 alist))))))))))
-                  alist)))))
-      ;; Return value in appropriate order of appearance.
-      (nreverse (funcall collect-bind nil nil)))))
+    (pcase (org-collect-keywords '("BIND"))
+      (`(("BIND" . ,values))
+       (mapcar (lambda (v) (read (format "(%s)" v)))
+              values)))))
 
 ;; defsubst org-export-get-parent must be defined before first use,
 ;; was originally defined in the topology section
@@ -3461,15 +3374,16 @@ Move point after the link."
        (goto-char (org-element-property :end link))
       (let ((new-path (file-relative-name (expand-file-name path file-dir)
                                          includer-dir))
-           (new-link (org-element-copy link))
-           (contents (and (org-element-property :contents-begin link)
-                          (buffer-substring
-                           (org-element-property :contents-begin link)
-                           (org-element-property :contents-end link)))))
+           (new-link (org-element-copy link)))
        (org-element-put-property new-link :path new-path)
+       (when (org-element-property :contents-begin link)
+         (org-element-adopt-elements new-link
+           (buffer-substring
+            (org-element-property :contents-begin link)
+            (org-element-property :contents-end link))))
        (delete-region (org-element-property :begin link)
                       (org-element-property :end link))
-       (insert (org-element-link-interpreter new-link contents))))))
+       (insert (org-element-interpret-data new-link))))))
 
 (defun org-export--prepare-file-contents
     (file &optional lines ind minlevel id footnotes includer)
@@ -4184,8 +4098,8 @@ meant to be translated with `org-export-data' or alike."
 
 (org-define-error 'org-link-broken "Unable to resolve link; aborting")
 
-(defun org-export-custom-protocol-maybe (link desc backend)
-  "Try exporting LINK with a dedicated function.
+(defun org-export-custom-protocol-maybe (link desc backend &optional info)
+  "Try exporting LINK object with a dedicated function.
 
 DESC is its description, as a string, or nil.  BACKEND is the
 back-end used for export, as a symbol.
@@ -4196,14 +4110,20 @@ A custom protocol has precedence over regular back-end 
export.
 The function ignores links with an implicit type (e.g.,
 \"custom-id\")."
   (let ((type (org-element-property :type link)))
-    (unless (or (member type '("coderef" "custom-id" "fuzzy" "radio"))
+    (unless (or (member type '("coderef" "custom-id" "fuzzy" "radio" nil))
                (not backend))
-      (let ((protocol (org-link-get-parameter type :export)))
+      (let ((protocol (org-link-get-parameter type :export))
+           (path (org-element-property :path link)))
        (and (functionp protocol)
-            (funcall protocol
-                     (org-element-property :path link)
-                     desc
-                     backend))))))
+            (condition-case nil
+                (funcall protocol path desc backend info)
+              ;; XXX: The function used (< Org 9.4) to accept only
+              ;; three mandatory arguments.  Type-specific `:export'
+              ;; functions in the wild may not handle current
+              ;; signature.  Provide backward compatibility support
+              ;; for them.
+              (wrong-number-of-arguments
+               (funcall protocol path desc backend))))))))
 
 (defun org-export-get-coderef-format (path desc)
   "Return format string for code reference link.
@@ -4332,7 +4252,7 @@ ignores white spaces and statistics cookies, if 
applicable."
     (`headline
      (let ((title (split-string
                   (replace-regexp-in-string
-                   "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]" ""
+                   "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]" " "
                    (org-element-property :raw-value datum)))))
        (delq nil
             (list
@@ -4805,9 +4725,6 @@ code."
 ;; `org-export-table-row-is-special-p' are predicates used to look for
 ;; meta-information about the table structure.
 ;;
-;; `org-table-has-header-p' tells when the rows before the first rule
-;;  should be considered as table's header.
-;;
 ;; `org-export-table-cell-width', `org-export-table-cell-alignment'
 ;; and `org-export-table-cell-borders' extract information from
 ;; a table-cell element.
@@ -5243,7 +5160,8 @@ rows (resp. columns)."
       (lambda (row)
        (when (eq (org-element-property :type row) 'standard)
          (cl-incf rows)
-         (unless first-row (setq first-row row)))) info)
+         (unless first-row (setq first-row row))))
+      info)
     ;; Set number of columns.
     (org-element-map first-row 'table-cell (lambda (_) (cl-incf columns)) info)
     ;; Return value.
@@ -5552,6 +5470,17 @@ transcoding it."
      (secondary-opening :utf-8 "‘" :html "&lsquo;" :latex "`" :texinfo "`")
      (secondary-closing :utf-8 "’" :html "&rsquo;" :latex "'" :texinfo "'")
      (apostrophe :utf-8 "’" :html "&rsquo;"))
+    ("ro"
+     (primary-opening
+      :utf-8 "„" :html "&bdquo;" :latex "\"`" :texinfo "@quotedblbase{}")
+     (primary-closing :utf-8 "”" :html "&rdquo;" :latex "''" :texinfo "''")
+     (secondary-opening
+      :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
+      :texinfo "@guillemetleft{}")
+     (secondary-closing
+      :utf-8 "»" :html "&raquo;" :latex "\\guillemotright{}"
+      :texinfo "@guillemetright{}")
+     (apostrophe :utf-8 "’" :html "&rsquo;"))
     ("ru"
      ;; 
https://ru.wikipedia.org/wiki/%D0%9A%D0%B0%D0%B2%D1%8B%D1%87%D0%BA%D0%B8#.D0.9A.D0.B0.D0.B2.D1.8B.D1.87.D0.BA.D0.B8.2C_.D0.B8.D1.81.D0.BF.D0.BE.D0.BB.D1.8C.D0.B7.D1.83.D0.B5.D0.BC.D1.8B.D0.B5_.D0.B2_.D1.80.D1.83.D1.81.D1.81.D0.BA.D0.BE.D0.BC_.D1.8F.D0.B7.D1.8B.D0.BA.D0.B5
      ;; http://www.artlebedev.ru/kovodstvo/sections/104/
@@ -5812,6 +5741,7 @@ them."
      ("nn" :default "Forfattar")
      ("pl" :default "Autor")
      ("pt_BR" :default "Autor")
+     ("ro" :default "Autor")
      ("ru" :html "&#1040;&#1074;&#1090;&#1086;&#1088;" :utf-8 "Автор")
      ("sl" :default "Avtor")
      ("sv" :html "F&ouml;rfattare")
@@ -5829,6 +5759,7 @@ them."
      ("nl" :default "Vervolg van vorige pagina")
      ("pt" :default "Continuação da página anterior")
      ("pt_BR" :html "Continua&ccedil;&atilde;o da p&aacute;gina anterior" 
:ascii "Continuacao da pagina anterior" :default "Continuação da página 
anterior")
+     ("ro" :default "Continuare de pe pagina precedentă")
      ("ru" :html 
"(&#1055;&#1088;&#1086;&#1076;&#1086;&#1083;&#1078;&#1077;&#1085;&#1080;&#1077;)"
       :utf-8 "(Продолжение)")
      ("sl" :default "Nadaljevanje s prejšnje strani"))
@@ -5843,12 +5774,15 @@ them."
      ("nl" :default "Vervolg op volgende pagina")
      ("pt" :default "Continua na página seguinte")
      ("pt_BR" :html "Continua na pr&oacute;xima p&aacute;gina" :ascii 
"Continua na proxima pagina" :default "Continua na próxima página")
+     ("ro" :default "Continuare pe pagina următoare")
      ("ru" :html 
"(&#1055;&#1088;&#1086;&#1076;&#1086;&#1083;&#1078;&#1077;&#1085;&#1080;&#1077; 
&#1089;&#1083;&#1077;&#1076;&#1091;&#1077;&#1090;)"
       :utf-8 "(Продолжение следует)")
      ("sl" :default "Nadaljevanje na naslednji strani"))
     ("Created"
      ("cs" :default "Vytvořeno")
+     ("nl" :default "Gemaakt op")  ;; must be followed by a date or date+time
      ("pt_BR" :default "Criado em")
+     ("ro" :default "Creat")
      ("sl" :default "Ustvarjeno"))
     ("Date"
      ("ar" :default "بتاريخ")
@@ -5869,6 +5803,7 @@ them."
      ("nb" :default "Dato")
      ("nn" :default "Dato")
      ("pl" :default "Data")
+     ("ro" :default "Data")
      ("pt_BR" :default "Data")
      ("ru" :html "&#1044;&#1072;&#1090;&#1072;" :utf-8 "Дата")
      ("sl" :default "Datum")
@@ -5886,10 +5821,12 @@ them."
      ("fr" :ascii "Equation" :default "Équation")
      ("is" :default "Jafna")
      ("ja" :default "方程式")
+     ("nl" :default "Vergelijking")
      ("no" :default "Ligning")
      ("nb" :default "Ligning")
      ("nn" :default "Likning")
      ("pt_BR" :html "Equa&ccedil;&atilde;o" :default "Equação" :ascii 
"Equacao")
+     ("ro" :default "Ecuația")
      ("ru" :html 
"&#1059;&#1088;&#1072;&#1074;&#1085;&#1077;&#1085;&#1080;&#1077;"
       :utf-8 "Уравнение")
      ("sl" :default "Enačba")
@@ -5905,10 +5842,12 @@ them."
      ("is" :default "Mynd")
      ("it" :default "Figura")
      ("ja" :default "図" :html "&#22259;")
+     ("nl" :default "Figuur")
      ("no" :default "Illustrasjon")
      ("nb" :default "Illustrasjon")
      ("nn" :default "Illustrasjon")
      ("pt_BR" :default "Figura")
+     ("ro" :default "Imaginea")
      ("ru" :html "&#1056;&#1080;&#1089;&#1091;&#1085;&#1086;&#1082;" :utf-8 
"Рисунок")
      ("sv" :default "Illustration")
      ("zh-CN" :html "&#22270;" :utf-8 "图"))
@@ -5923,10 +5862,12 @@ them."
      ("is" :default "Mynd %d")
      ("it" :default "Figura %d:")
      ("ja" :default "図%d: " :html "&#22259;%d: ")
+     ("nl" :default "Figuur %d:" :html "Figuur&nbsp;%d:")
      ("no" :default "Illustrasjon %d")
      ("nb" :default "Illustrasjon %d")
      ("nn" :default "Illustrasjon %d")
      ("pt_BR" :default "Figura %d:")
+     ("ro" :default "Imaginea %d:")
      ("ru" :html "&#1056;&#1080;&#1089;. %d.:" :utf-8 "Рис. %d.:")
      ("sl" :default "Slika %d")
      ("sv" :default "Illustration %d")
@@ -5952,6 +5893,7 @@ them."
      ("nn" :default "Fotnotar")
      ("pl" :default "Przypis")
      ("pt_BR" :html "Notas de Rodap&eacute;" :default "Notas de Rodapé" :ascii 
"Notas de Rodape")
+     ("ro" :default "Note de subsol")
      ("ru" :html "&#1057;&#1085;&#1086;&#1089;&#1082;&#1080;" :utf-8 "Сноски")
      ("sl" :default "Opombe")
      ("sv" :default "Fotnoter")
@@ -5968,6 +5910,7 @@ them."
      ("et" :default "Loendite nimekiri")
      ("fr" :default "Liste des programmes")
      ("ja" :default "ソースコード目次")
+     ("nl" :default "Lijst van programma's")
      ("no" :default "Dataprogrammer")
      ("nb" :default "Dataprogrammer")
      ("pt_BR" :html "&Iacute;ndice de Listagens" :default "Índice de 
Listagens" :ascii "Indice de Listagens")
@@ -5986,10 +5929,12 @@ them."
      ("is" :default "Töfluskrá" :html "T&ouml;fluskr&aacute;")
      ("it" :default "Indice delle tabelle")
      ("ja" :default "表目次")
+     ("nl" :default "Lijst van tabellen")
      ("no" :default "Tabeller")
      ("nb" :default "Tabeller")
      ("nn" :default "Tabeller")
      ("pt_BR" :html "&Iacute;ndice de Tabelas" :default "Índice de Tabelas" 
:ascii "Indice de Tabelas")
+     ("ro" :default "Tabele")
      ("ru" :html "&#1057;&#1087;&#1080;&#1089;&#1086;&#1082; 
&#1090;&#1072;&#1073;&#1083;&#1080;&#1094;"
       :utf-8 "Список таблиц")
      ("sl" :default "Seznam tabel")
@@ -6005,9 +5950,11 @@ them."
      ("fr" :default "Programme" :html "Programme")
      ("it" :default "Listato")
      ("ja" :default "ソースコード")
+     ("nl" :default "Programma")
      ("no" :default "Dataprogram")
      ("nb" :default "Dataprogram")
      ("pt_BR" :default "Listagem")
+     ("ro" :default "Lista")
      ("ru" :html 
"&#1056;&#1072;&#1089;&#1087;&#1077;&#1095;&#1072;&#1090;&#1082;&#1072;"
       :utf-8 "Распечатка")
      ("sl" :default "Izpis programa")
@@ -6022,8 +5969,10 @@ them."
      ("fr" :default "Programme %d :" :html "Programme&nbsp;%d&nbsp;:")
      ("it" :default "Listato %d :")
      ("ja" :default "ソースコード%d:")
+     ("nl" :default "Programma %d:" :html "Programma&nbsp;%d:")
      ("no" :default "Dataprogram %d")
      ("nb" :default "Dataprogram %d")
+     ("ro" :default "Lista %d")
      ("pt_BR" :default "Listagem %d:")
      ("ru" :html 
"&#1056;&#1072;&#1089;&#1087;&#1077;&#1095;&#1072;&#1090;&#1082;&#1072; %d.:"
       :utf-8 "Распечатка %d.:")
@@ -6036,20 +5985,28 @@ them."
      ("es" :default "Referencias")
      ("fr" :ascii "References" :default "Références")
      ("it" :default "Riferimenti")
+     ("nl" :default "Bronverwijzingen")
      ("pt_BR" :html "Refer&ecirc;ncias" :default "Referências" :ascii 
"Referencias")
+     ("ro" :default "Bibliografie")
      ("sl" :default "Reference"))
     ("See figure %s"
      ("cs" :default "Viz obrázek %s")
      ("fr" :default "cf. figure %s"
       :html "cf.&nbsp;figure&nbsp;%s" :latex "cf.~figure~%s")
      ("it" :default "Vedi figura %s")
+     ("nl" :default "Zie figuur %s"
+      :html "Zie figuur&nbsp;%s" :latex "Zie figuur~%s")
      ("pt_BR" :default "Veja a figura %s")
+     ("ro" :default "Vezi figura %s")
      ("sl" :default "Glej sliko %s"))
     ("See listing %s"
      ("cs" :default "Viz program %s")
      ("fr" :default "cf. programme %s"
       :html "cf.&nbsp;programme&nbsp;%s" :latex "cf.~programme~%s")
+     ("nl" :default "Zie programma %s"
+      :html "Zie programma&nbsp;%s" :latex "Zie programma~%s")
      ("pt_BR" :default "Veja a listagem %s")
+     ("ro" :default "Vezi tabelul %s")
      ("sl" :default "Glej izpis programa %s"))
     ("See section %s"
      ("ar" :default "انظر قسم %s")
@@ -6061,8 +6018,11 @@ them."
      ("fr" :default "cf. section %s")
      ("it" :default "Vedi sezione %s")
      ("ja" :default "セクション %s を参照")
+     ("nl" :default "Zie sectie %s"
+      :html "Zie sectie&nbsp;%s" :latex "Zie sectie~%s")
      ("pt_BR" :html "Veja a se&ccedil;&atilde;o %s" :default "Veja a seção %s"
       :ascii "Veja a secao %s")
+     ("ro" :default "Vezi secțiunea %s")
      ("ru" :html "&#1057;&#1084;. &#1088;&#1072;&#1079;&#1076;&#1077;&#1083; 
%s"
       :utf-8 "См. раздел %s")
      ("sl" :default "Glej poglavje %d")
@@ -6072,7 +6032,10 @@ them."
      ("fr" :default "cf. tableau %s"
       :html "cf.&nbsp;tableau&nbsp;%s" :latex "cf.~tableau~%s")
      ("it" :default "Vedi tabella %s")
+     ("nl" :default "Zie tabel %s"
+      :html "Zie tabel&nbsp;%s" :latex "Zie tabel~%s")
      ("pt_BR" :default "Veja a tabela %s")
+     ("ro" :default "Vezi tabelul %s")
      ("sl" :default "Glej tabelo %s"))
     ("Table"
      ("ar" :default "جدول")
@@ -6084,7 +6047,9 @@ them."
      ("is" :default "Tafla")
      ("it" :default "Tabella")
      ("ja" :default "表" :html "&#34920;")
+     ("nl" :default "Tabel")
      ("pt_BR" :default "Tabela")
+     ("ro" :default "Tabel")
      ("ru" :html "&#1058;&#1072;&#1073;&#1083;&#1080;&#1094;&#1072;"
       :utf-8 "Таблица")
      ("zh-CN" :html "&#34920;" :utf-8 "表"))
@@ -6099,10 +6064,12 @@ them."
      ("is" :default "Tafla %d")
      ("it" :default "Tabella %d:")
      ("ja" :default "表%d:" :html "&#34920;%d:")
+     ("nl" :default "Tabel %d:" :html "Tabel&nbsp;%d:")
      ("no" :default "Tabell %d")
      ("nb" :default "Tabell %d")
      ("nn" :default "Tabell %d")
      ("pt_BR" :default "Tabela %d:")
+     ("ro" :default "Tabel %d")
      ("ru" :html "&#1058;&#1072;&#1073;&#1083;&#1080;&#1094;&#1072; %d.:"
       :utf-8 "Таблица %d.:")
      ("sl" :default "Tabela %d")
@@ -6129,6 +6096,7 @@ them."
      ("nn" :default "Innhald")
      ("pl" :html "Spis tre&#x015b;ci")
      ("pt_BR" :html "&Iacute;ndice" :utf8 "Índice" :ascii "Indice")
+     ("ro" :default "Cuprins")
      ("ru" :html 
"&#1057;&#1086;&#1076;&#1077;&#1088;&#1078;&#1072;&#1085;&#1080;&#1077;"
       :utf-8 "Содержание")
      ("sl" :default "Kazalo")
@@ -6145,7 +6113,9 @@ them."
      ("fr" :ascii "Destination inconnue" :default "Référence inconnue")
      ("it" :default "Riferimento sconosciuto")
      ("ja" :default "不明な参照先")
+     ("nl" :default "Onbekende verwijzing")
      ("pt_BR" :html "Refer&ecirc;ncia desconhecida" :default "Referência 
desconhecida" :ascii "Referencia desconhecida")
+     ("ro" :default "Referință necunoscută")
      ("ru" :html 
"&#1053;&#1077;&#1080;&#1079;&#1074;&#1077;&#1089;&#1090;&#1085;&#1072;&#1103; 
&#1089;&#1089;&#1099;&#1083;&#1082;&#1072;"
       :utf-8 "Неизвестная ссылка")
      ("sl" :default "Neznana referenca")
@@ -6877,10 +6847,12 @@ back to standard interface."
       (with-current-buffer "*Org Export Dispatcher*"
        ;; Refresh help.  Maintain display continuity by re-visiting
        ;; previous window position.
-       (let ((pos (window-start)))
+       (let ((pt (point))
+             (wstart (window-start)))
          (erase-buffer)
          (insert help)
-         (set-window-start nil pos)))
+         (goto-char pt)
+         (set-window-start nil wstart)))
       (org-fit-window-to-buffer)
       (org-export--dispatch-action
        standard-prompt allowed-keys entries options first-key expertp))))
@@ -6903,24 +6875,10 @@ options as CDR."
     ;; C-p, SPC, DEL).
     (while (and (setq key (read-char-exclusive prompt))
                (not expertp)
-               (memq key '(14 16 ?\s ?\d)))
-      (cl-case key
-       (14 (if (not (pos-visible-in-window-p (point-max)))
-               (ignore-errors (scroll-up 1))
-             (message "End of buffer")
-             (sit-for 1)))
-       (16 (if (not (pos-visible-in-window-p (point-min)))
-               (ignore-errors (scroll-down 1))
-             (message "Beginning of buffer")
-             (sit-for 1)))
-       (?\s (if (not (pos-visible-in-window-p (point-max)))
-                (scroll-up nil)
-              (message "End of buffer")
-              (sit-for 1)))
-       (?\d (if (not (pos-visible-in-window-p (point-min)))
-                (scroll-down nil)
-              (message "Beginning of buffer")
-              (sit-for 1)))))
+               ;; FIXME: Don't use C-v (22) here, as it is used as a
+               ;; modifier key in the export dispatch.
+               (memq key '(14 16 ?\s ?\d 134217846)))
+      (org-scroll key t))
     (cond
      ;; Ignore undefined associations.
      ((not (memq key allowed-keys))
@@ -6929,7 +6887,7 @@ options as CDR."
       (org-export--dispatch-ui options first-key expertp))
      ;; q key at first level aborts export.  At second level, cancel
      ;; first key instead.
-     ((eq key ?q) (if (not first-key) (error "Export aborted")
+     ((eq key ?q) (if (not first-key) (user-error "Export aborted")
                    (org-export--dispatch-ui options nil expertp)))
      ;; Help key: Switch back to standard interface if expert UI was
      ;; active.
diff --git a/lisp/outline.el b/lisp/outline.el
index 9b11b86..57909b3 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -1,6 +1,6 @@
 ;;; outline.el --- outline mode commands for Emacs  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1986, 1993-1995, 1997, 2000-2020 Free Software
+;; Copyright (C) 1986, 1993-1995, 1997, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -318,7 +318,7 @@ See the command `outline-mode' for more information on this 
mode."
        (add-hook 'change-major-mode-hook
                  (lambda () (outline-minor-mode -1))
                  nil t)
-       (set (make-local-variable 'line-move-ignore-invisible) t)
+        (setq-local line-move-ignore-invisible t)
        ;; Cause use of ellipses for invisible text.
        (add-to-invisibility-spec '(outline . t)))
     (setq line-move-ignore-invisible nil)
diff --git a/lisp/paren.el b/lisp/paren.el
index b56a787..a45a08a 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -1,6 +1,6 @@
 ;;; paren.el --- highlight matching paren  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1993, 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: rms@gnu.org
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/password-cache.el b/lisp/password-cache.el
index 375d06c..83a2572 100644
--- a/lisp/password-cache.el
+++ b/lisp/password-cache.el
@@ -1,6 +1,6 @@
 ;;; password-cache.el --- Read passwords, possibly using a password cache.  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 1999-2000, 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2000, 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;; Created: 2003-12-21
diff --git a/lisp/pcmpl-cvs.el b/lisp/pcmpl-cvs.el
index 13f3093..588a5e7 100644
--- a/lisp/pcmpl-cvs.el
+++ b/lisp/pcmpl-cvs.el
@@ -1,6 +1,6 @@
 ;;; pcmpl-cvs.el --- functions for dealing with cvs completions  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Package: pcomplete
diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el
index c605009..dd964e3 100644
--- a/lisp/pcmpl-gnu.el
+++ b/lisp/pcmpl-gnu.el
@@ -1,6 +1,6 @@
 ;;; pcmpl-gnu.el --- completions for GNU project tools -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Package: pcomplete
 
diff --git a/lisp/pcmpl-linux.el b/lisp/pcmpl-linux.el
index df9d245..2f42dbd 100644
--- a/lisp/pcmpl-linux.el
+++ b/lisp/pcmpl-linux.el
@@ -1,6 +1,6 @@
 ;;; pcmpl-linux.el --- functions for dealing with GNU/Linux completions  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Package: pcomplete
 
diff --git a/lisp/pcmpl-rpm.el b/lisp/pcmpl-rpm.el
index efd2559..39f700c 100644
--- a/lisp/pcmpl-rpm.el
+++ b/lisp/pcmpl-rpm.el
@@ -1,6 +1,6 @@
 ;;; pcmpl-rpm.el --- functions for dealing with rpm completions  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Package: pcomplete
 
diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el
index 13de4b6..70273b9 100644
--- a/lisp/pcmpl-unix.el
+++ b/lisp/pcmpl-unix.el
@@ -1,6 +1,6 @@
 ;;; pcmpl-unix.el --- standard UNIX completions  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Package: pcomplete
 
diff --git a/lisp/pcmpl-x.el b/lisp/pcmpl-x.el
index 0fd426e..61d8866 100644
--- a/lisp/pcmpl-x.el
+++ b/lisp/pcmpl-x.el
@@ -1,6 +1,6 @@
 ;;; pcmpl-x.el --- completion for miscellaneous tools  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Leo Liu <sdl.web@gmail.com>
 ;; Keywords: processes, tools, convenience
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index a744165..0dd99ce 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -1,6 +1,6 @@
 ;;; pcomplete.el --- programmable completion -*- lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Keywords: processes abbrev
@@ -738,8 +738,8 @@ user actually typed in."
 COMPLETEF-SYM should be the symbol where the
 dynamic-complete-functions are kept.  For comint mode itself,
 this is `comint-dynamic-complete-functions'."
-  (set (make-local-variable 'pcomplete-parse-arguments-function)
-       #'pcomplete-parse-comint-arguments)
+  (setq-local pcomplete-parse-arguments-function
+              #'pcomplete-parse-comint-arguments)
   (add-hook 'completion-at-point-functions
             #'pcomplete-completions-at-point nil 'local)
   (set (make-local-variable completef-sym)
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 9e86e46..cc0e159 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -1,6 +1,6 @@
 ;;; pixel-scroll.el --- Scroll a line smoothly
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 ;; Author: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
 ;; Keywords: mouse
 ;; Package: emacs
diff --git a/lisp/play/5x5.el b/lisp/play/5x5.el
index 3d4843a..07ef30c 100644
--- a/lisp/play/5x5.el
+++ b/lisp/play/5x5.el
@@ -1,6 +1,6 @@
 ;;; 5x5.el --- simple little puzzle game
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Pearson <davep@davep.org>
 ;; Created: 1998-10-03
@@ -31,7 +31,7 @@
 ;; o The code for updating the grid needs to be re-done.  At the moment it
 ;;   simply re-draws the grid every time a move is made.
 ;;
-;; o Look into tarting up the display with color.  gamegrid.el looks
+;; o Look into improving the display with color.  gamegrid.el looks
 ;;   interesting, perhaps that is the way to go?
 
 ;;; Thanks:
@@ -47,8 +47,6 @@
 
 ;;; Code:
 
-;; Things we need.
-
 (eval-when-compile (require 'cl-lib))
 
 ;; Customize options.
@@ -60,33 +58,27 @@
 
 (defcustom 5x5-grid-size 5
   "Size of the playing area."
-  :type  'integer
-  :group '5x5)
+  :type  'integer)
 
 (defcustom 5x5-x-scale 4
   "X scaling factor for drawing the grid."
-  :type  'integer
-  :group '5x5)
+  :type  'integer)
 
 (defcustom 5x5-y-scale 3
   "Y scaling factor for drawing the grid."
-  :type  'integer
-  :group '5x5)
+  :type  'integer)
 
 (defcustom 5x5-animate-delay .01
   "Delay in seconds when animating a solution crack."
-  :type  'number
-  :group '5x5)
+  :type  'number)
 
 (defcustom 5x5-hassle-me t
   "Should 5x5 ask you when you want to do a destructive operation?"
-  :type  'boolean
-  :group '5x5)
+  :type  'boolean)
 
 (defcustom 5x5-mode-hook nil
   "Hook run on starting 5x5."
-  :type  'hook
-  :group '5x5)
+  :type  'hook)
 
 ;; Non-customize variables.
 
diff --git a/lisp/play/animate.el b/lisp/play/animate.el
index 8dec551..7eb1b27 100644
--- a/lisp/play/animate.el
+++ b/lisp/play/animate.el
@@ -1,6 +1,6 @@
 ;;; animate.el --- make text dance  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: Richard Stallman <rms@gnu.org>
 ;; Keywords: games
diff --git a/lisp/play/blackbox.el b/lisp/play/blackbox.el
index 2b4a10c..e3854b5 100644
--- a/lisp/play/blackbox.el
+++ b/lisp/play/blackbox.el
@@ -1,6 +1,6 @@
 ;;; blackbox.el --- blackbox game in Emacs Lisp
 
-;; Copyright (C) 1985-1987, 1992, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1985-1987, 1992, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: F. Thomas May <uw-nsr!uw-warp!tom@beaver.cs.washington.edu>
diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el
index ca23a78..f317ad5 100644
--- a/lisp/play/bubbles.el
+++ b/lisp/play/bubbles.el
@@ -1,6 +1,6 @@
 ;;; bubbles.el --- Puzzle game for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author:      Ulf Jasper <ulf.jasper@web.de>
 ;; URL:         http://ulf.epplejasper.de/
diff --git a/lisp/play/cookie1.el b/lisp/play/cookie1.el
index 44a82c4..9cecb70 100644
--- a/lisp/play/cookie1.el
+++ b/lisp/play/cookie1.el
@@ -1,6 +1,6 @@
 ;;; cookie1.el --- retrieve random phrases from fortune cookie files
 
-;; Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el
index 674ddce..a7a4b89 100644
--- a/lisp/play/decipher.el
+++ b/lisp/play/decipher.el
@@ -1,6 +1,6 @@
 ;;; decipher.el --- cryptanalyze monoalphabetic substitution ciphers
 ;;
-;; Copyright (C) 1995-1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1996, 2001-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Christopher J. Madsen <chris_madsen@geocities.com>
 ;; Keywords: games
diff --git a/lisp/play/dissociate.el b/lisp/play/dissociate.el
index 9a6300c..a1cc472 100644
--- a/lisp/play/dissociate.el
+++ b/lisp/play/dissociate.el
@@ -1,6 +1,6 @@
 ;;; dissociate.el --- scramble text amusingly for Emacs  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: games
diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el
index 8fc207d..028f04c 100644
--- a/lisp/play/doctor.el
+++ b/lisp/play/doctor.el
@@ -1,6 +1,6 @@
 ;;; doctor.el --- psychological help for frustrated users
 
-;; Copyright (C) 1985, 1987, 1994, 1996, 2000-2020 Free Software
+;; Copyright (C) 1985, 1987, 1994, 1996, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el
index 1df28a0..e328b6e 100644
--- a/lisp/play/dunnet.el
+++ b/lisp/play/dunnet.el
@@ -1,6 +1,6 @@
 ;;; dunnet.el --- text adventure for Emacs -*- lexical-binding: t -*-
 
-;; Copyright (C) 1992-1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Ron Schnell <ronnie@driver-aces.com>
 ;; Created: 25 Jul 1992
@@ -46,10 +46,10 @@
 
 ;;;;
 ;;;; This section defines the globals that are used in dunnet.
-;;;;
-;;;; IMPORTANT
-;;;; All globals which can change must be saved from 'save-game.  Add
-;;;; all new globals to bottom of this section.
+;;
+;; IMPORTANT
+;; All globals which can change must be saved from 'save-game.
+;; Add all new globals to bottom of this section.
 
 (defvar dun-visited '(27))
 (defvar dun-current-room 1)
@@ -771,7 +771,6 @@ A hole leads north."
 )
 
 
-;;; How the user references *all* objects, permanent and regular.
 (defconst dun-objnames
   '((shovel . 0)
     (lamp . 1)
@@ -831,7 +830,8 @@ A hole leads north."
     (ladder . -27)
     (subway . -28) (train . -28)
     (pc . -29) (drive . -29) (coconut . -30) (coconuts . -30)
-    (lake . -32) (water . -32)))
+    (lake . -32) (water . -32))
+  "How the user references *all* objects, permanent and regular.")
 
 (dolist (x dun-objnames)
   (let (name)
@@ -840,13 +840,6 @@ A hole leads north."
 
 (defconst obj-special 255)
 
-;;; The initial setup of what objects are in each room.
-;;; Regular objects have whole numbers lower than 255.
-;;; Objects that cannot be taken but might move and are
-;;; described during room description are negative.
-;;; Stuff that is described and might change are 255, and are
-;;; handled specially by 'dun-describe-room.
-
 (defvar dun-room-objects (list nil
 
         (list obj-shovel)                     ;; treasure-room
@@ -899,10 +892,13 @@ A hole leads north."
 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
-nil))
-
-;;; These are objects in a room that are only described in the
-;;; room description.  They are permanent.
+nil)
+  "The initial setup of what objects are in each room.
+Regular objects have whole numbers lower than 255.
+Objects that cannot be taken but might move and are
+described during room description are negative.
+Stuff that is described and might change are 255, and are
+handled specially by 'dun-describe-room.")
 
 (defconst dun-room-silents (list nil
         (list obj-tree obj-coconut)            ;; dead-end
@@ -947,12 +943,11 @@ nil))
         nil nil nil nil nil nil nil nil
        (list obj-pc)                          ;; pc-area
        nil nil nil nil nil nil
-))
+       )
+  "These are objects in a room that are only described in the
+room description.  They are permanent.")
 (defvar dun-inventory '(1))
 
-;;; Descriptions of objects, as they appear in the room description, and
-;;; the inventory.
-
 (defconst dun-objects
   '(("There is a shovel here." "A shovel")                ;0
     ("There is a lamp nearby." "A lamp")                  ;1
@@ -982,26 +977,24 @@ nil))
     ("There is a valuable amethyst here." "An amethyst") ;24
     ("The Mona Lisa is here." "The Mona Lisa") ;25
     ("There is a 100 dollar bill here." "A $100 bill") ;26
-    ("There is a floppy disk here." "A floppy disk"))) ;27
-
-;;; Weight of objects
+    ("There is a floppy disk here." "A floppy disk")) ;27
+  "Descriptions of objects, as they appear in the room description, and
+the inventory.")
 
 (defconst dun-object-lbs
-  '(2 1 1 1 1 0 2 2 10 3 1 1 1 0 1 1 0 1 1 1 1 0 0 2 2 1 0 0))
+  '(2 1 1 1 1 0 2 2 10 3 1 1 1 0 1 1 0 1 1 1 1 0 0 2 2 1 0 0)
+  "Weight of objects.")
 (defconst dun-object-pts
   '(0 0 0 0 0 0 0 10 0 0 10 10 10 0 0 10 0 10 10 0 0 0 0 10 10 10 10 0))
 
 
-;;; Unix representation of objects.
 (defconst dun-objfiles
   '("shovel.o" "lamp.o" "cpu.o" "food.o" "key.o" "paper.o"
     "rms.o" "diamond.o" "weight.o" "preserver.o" "bracelet.o"
     "gold.o" "platinum.o" "towel.o" "axe.o" "silver.o" "license.o"
     "coins.o" "egg.o" "jar.o" "bone.o" "nitric.o" "glycerine.o"
-    "ruby.o" "amethyst.o"))
-
-;;; These are the descriptions for the negative numbered objects from
-;;; dun-room-objects
+    "ruby.o" "amethyst.o")
+  "Unix representation of objects.")
 
 (defconst dun-perm-objects
   '(nil
@@ -1016,12 +1009,11 @@ nil))
     ("There is a box with a slit in it, bolted to the wall here.")
     nil nil
     ("There is a bus here.")
-    nil nil nil))
+    nil nil nil)
+  "These are the descriptions for the negative numbered objects from
+`dun-room-objects'.")
 
 
-;;; These are the descriptions the user gets when regular objects are
-;;; examined.
-
 (defconst dun-physobj-desc '(
 "It is a normal shovel with a price tag attached that says $19.99."
 "The lamp is hand-crafted by Geppetto."
@@ -1043,10 +1035,8 @@ nil nil
 "They are old coins from the 19th century."
 "It is a valuable Fabrege egg."
 "It is a plain glass jar."
-nil nil nil nil nil))
-
-;;; These are the descriptions the user gets when non-regular objects
-;;; are examined.
+nil nil nil nil nil)
+  "The descriptions the user gets when regular objects are examined.")
 
 (defconst dun-permobj-desc
   '(nil
@@ -1087,7 +1077,8 @@ it.  It is very big, though."
 nil nil nil nil
 "It is a normal ladder that is permanently attached to the hole."
 "It is a passenger train that is ready to go."
-"It is a personal computer that has only one floppy disk drive."))
+"It is a personal computer that has only one floppy disk drive.")
+  "The descriptions the user gets when non-regular objects are examined.")
 
 (defconst dun-diggables
       (list nil nil nil (list obj-cpu) nil nil nil nil nil nil nil
@@ -1189,10 +1180,9 @@ treasures for points?" "4" "four")
 ;;;; This section contains all of the verbs and commands.
 ;;;;
 
-;;; Give long description of room if haven't been there yet.  Otherwise
-;;; short.  Also give long if we were called with negative room number.
-
 (defun dun-describe-room (room)
+  "Give long description of room if haven't been there yet.
+Otherwise short.  Also give long if we were called with negative room number."
   (if (and (not (member (abs room) dun-light-rooms))
           (not (member obj-lamp dun-inventory))
           (not (member obj-lamp (nth dun-current-room dun-room-objects))))
@@ -1222,10 +1212,9 @@ treasures for points?" "4" "four")
     (if (and (member obj-bus (nth dun-current-room dun-room-objects)) 
dun-inbus)
        (dun-mprincl "You are on the bus."))))
 
-;;; There is a special object in the room.  This object's description,
-;;; or lack thereof, depends on certain conditions.
-
 (defun dun-special-object ()
+  "There is a special object in the room.  This object's description,
+or lack thereof, depends on certain conditions."
   (cond
    ((= dun-current-room computer-room)
     (if dun-computer
@@ -1298,10 +1287,9 @@ disk bursts into flames, and disintegrates.")
 (defun dun-quit (_args)
   (dun-die nil))
 
-;;; Print every object in player's inventory.  Special case for the jar,
-;;; as we must also print what is in it.
-
 (defun dun-inven (_args)
+  "Print every object in player's inventory.
+Special case for the jar, as we must also print what is in it."
   (dun-mprincl "You currently have:")
   (dolist (curobj dun-inventory)
     (when curobj
@@ -1352,9 +1340,8 @@ on your head.")
         (if (member objnum (list obj-food obj-weight obj-jar))
             (dun-drop-check objnum)))))))
 
-;;; Dropping certain things causes things to happen.
-
 (defun dun-drop-check (objnum)
+  "Dropping certain things causes things to happen."
   (cond
    ((and (= objnum obj-food) (= dun-room bear-hangout)
          (member obj-bear (nth bear-hangout dun-room-objects)))
@@ -1381,9 +1368,8 @@ through.")))
    ((and (= objnum obj-weight) (= dun-current-room maze-button-room))
     (dun-mprincl "A passageway opens."))))
 
-;;; Give long description of current room, or an object.
-
 (defun dun-examine (obj)
+  "Give long description of current room, or an object."
   (let ((objnum (dun-objnum-from-args obj)))
     (cond
      ((eq objnum obj-special)
@@ -1474,10 +1460,9 @@ For an explosive time, go to Fourth St. and Vermont.")
       (setq total (+ total (nth x dun-object-lbs))))
     total))
 
-;;; We try to take an object that is untakable.  Print a message
-;;; depending on what it is.
-
 (defun dun-try-take (_obj)
+  "We try to take an object that is untakable.
+Print a message depending on what it is."
   (dun-mprinc "You cannot take that."))
 
 (defun dun-dig (_args)
@@ -1670,15 +1655,15 @@ just try dropping it."))
 (defun dun-go (args)
   (if (or (not (car args))
          (eq (dun-doverb dun-ignore dun-verblist (car args)
-                         (cdr (cdr args))) -1))
+                         (cdr (cdr args)))
+             -1))
       (dun-mprincl "I don't understand where you want me to go.")))
 
-;;; Uses the dungeon-map to figure out where we are going.  If the
-;;; requested direction yields 255, we know something special is
-;;; supposed to happen, or perhaps you can't go that way unless
-;;; certain conditions are met.
-
 (defun dun-move (dir)
+  ;; Uses the dungeon-map to figure out where we are going.  If the
+  ;; requested direction yields 255, we know something special is
+  ;; supposed to happen, or perhaps you can't go that way unless
+  ;; certain conditions are met.
   (if (and (not (member dun-current-room dun-light-rooms))
           (not (member obj-lamp dun-inventory))
           (not (member obj-lamp (nth dun-current-room dun-room-objects))))
@@ -1709,17 +1694,17 @@ body.")
                                   (list obj-bus)))))
            (setq dun-current-room newroom)))))))
 
-;;; Movement in this direction causes something special to happen if the
-;;; right conditions exist.  It may be that you can't go this way unless
-;;; you have a key, or a passage has been opened.
+(defun dun-special-move (dir)
+  ;; Movement in this direction causes something special to happen if the
+  ;; right conditions exist.  It may be that you can't go this way unless
+  ;; you have a key, or a passage has been opened.
 
-;;; coding note: Each check of the current room is on the same 'if' level,
-;;; i.e. there aren't else's.  If two rooms next to each other have
-;;; specials, and they are connected by specials, this could cause
-;;; a problem.  Be careful when adding them to consider this, and
-;;; perhaps use else's.
+  ;; coding note: Each check of the current room is on the same 'if' level,
+  ;; i.e. there aren't else's.  If two rooms next to each other have
+  ;; specials, and they are connected by specials, this could cause
+  ;; a problem.  Be careful when adding them to consider this, and
+  ;; perhaps use else's.
 
-(defun dun-special-move (dir)
   (if (= dun-current-room building-front)
       (if (not (member obj-key dun-inventory))
          (dun-mprincl "You don't have a key that can open this door.")
@@ -2152,10 +2137,10 @@ for a moment, then straighten yourself up.\n")
 ;;;;
 
 
-;;; Function which takes a verb and a list of other words.  Calls proper
-;;; function associated with the verb, and passes along the other words.
-
 (defun dun-doverb (ignore verblist verb rest)
+  "Take a verb and a list of other words.
+Calls proper function associated with the verb, and passes along the
+other words."
   (when verb
     (if (member (intern verb) ignore)
        (if (not (car rest)) -1
@@ -2165,9 +2150,8 @@ for a moment, then straighten yourself up.\n")
        (funcall (cdr (assq (intern verb) verblist)) rest)))))
 
 
-;;; Function to take a string and change it into a list of lowercase words.
-
 (defun dun-listify-string (strin)
+  "Take a string and change it into a list of lowercase words."
   (let (pos ret-list end-pos)
     (setq pos 0)
     (setq ret-list nil)
@@ -2177,7 +2161,8 @@ for a moment, then straighten yourself up.\n")
          (setq ret-list (append ret-list (list
                                           (downcase
                                            (substring strin pos end-pos))))))
-      (setq pos (+ end-pos 1))) ret-list))
+      (setq pos (+ end-pos 1)))
+    ret-list))
 
 (defun dun-listify-string2 (strin)
   (let (pos ret-list end-pos)
@@ -2194,10 +2179,8 @@ for a moment, then straighten yourself up.\n")
 (defun dun-replace (list n number)
   (rplaca (nthcdr n list) number))
 
-
-;;; Get the first non-ignored word from a list.
-
 (defun dun-firstword (list)
+  "Get the first non-ignored word from a list."
   (when (car list)
     (while (and list (memq (intern (car list)) dun-ignore))
       (setq list (cdr list)))
@@ -2209,10 +2192,9 @@ for a moment, then straighten yourself up.\n")
       (setq list (cdr list)))
     list))
 
-;;; parse a line passed in as a string  Call the proper verb with the
-;;; rest of the line passed in as a list.
-
 (defun dun-vparse (ignore verblist line)
+  "Parse a line passed in as a string.
+Call the proper verb with the rest of the line passed in as a list."
   (dun-mprinc "\n")
   (setq dun-line-list (dun-listify-string (concat line " ")))
   (dun-doverb ignore verblist (car dun-line-list) (cdr dun-line-list)))
@@ -2222,54 +2204,47 @@ for a moment, then straighten yourself up.\n")
   (setq dun-line-list (dun-listify-string2 (concat line " ")))
   (dun-doverb ignore verblist (car dun-line-list) (cdr dun-line-list)))
 
-;;; Read a line, in window mode
-
 (defun dun-read-line ()
+  "Read a line, in window mode."
   (let ((line (read-string "")))
     (dun-mprinc line)
     line))
 
-;;; Insert something into the window buffer
-
 (defun dun-minsert (&rest args)
+  "Insert something into the window buffer."
   (dolist (arg args)
     (if (stringp arg)
         (insert arg)
       (insert (prin1-to-string arg)))))
 
-;;; Print something out, in window mode
-
 (defun dun-mprinc (&rest args)
+  "Print something out, in window mode."
   (dolist (arg args)
     (if (stringp arg)
         (insert arg)
       (insert (prin1-to-string arg)))))
 
-;;; In window mode, keep screen from jumping by keeping last line at
-;;; the bottom of the screen.
-
 (defun dun-fix-screen ()
+  "In window mode, keep screen from jumping by keeping last line at
+the bottom of the screen."
   (interactive)
   (forward-line (- 0 (- (window-height) 2 )))
   (set-window-start (selected-window) (point))
   (goto-char (point-max)))
 
-;;; Insert something into the buffer, followed by newline.
-
 (defun dun-minsertl (&rest args)
+  "Insert something into the buffer, followed by newline."
   (apply #'dun-minsert args)
   (dun-minsert "\n"))
 
-;;; Print something, followed by a newline.
-
 (defun dun-mprincl (&rest args)
+  "Print something, followed by a newline."
   (apply #'dun-mprinc args)
   (dun-mprinc "\n"))
 
-;;; Function which will get an object number given the list of
-;;; words in the command, except for the verb.
-
 (defun dun-objnum-from-args (obj)
+  "Get an object number given the list of words in the command,
+except for the verb."
   (setq obj (dun-firstword obj))
   (if (not obj)
       obj-special
@@ -2285,9 +2260,8 @@ for a moment, then straighten yourself up.\n")
       nil
     result)))
 
-;;; Given a unix style pathname, build a list of path components (recursive)
-
 (defun dun-get-path (dirstring startlist)
+  "Given a unix style pathname, build a list of path components (recursive)"
   (let (slash)
     (if (= (length dirstring) 0)
        startlist
@@ -2299,10 +2273,9 @@ for a moment, then straighten yourself up.\n")
                    (append startlist
                            (list (substring dirstring 0 slash)))))))))
 
-;;; Function to put objects in the treasure room.  Also prints current
-;;; score to let user know he has scored.
-
 (defun dun-put-objs-in-treas (objlist)
+  "Put objects in the treasure room.
+Also prints current score to let user know he has scored."
   (let (oscore newscore)
     (setq oscore (dun-reg-score))
     (dun-replace dun-room-objects 0 (append (nth 0 dun-room-objects) objlist))
@@ -2310,9 +2283,8 @@ for a moment, then straighten yourself up.\n")
     (if (not (= oscore newscore))
        (dun-score nil))))
 
-;;; Load an encrypted file, and eval it.
-
 (defun dun-load-d (filename)
+  "Load an encrypted file, and eval it."
   (let ((result t))
     (with-temp-buffer
       (condition-case nil
@@ -3154,14 +3126,16 @@ File not found")))
   (dun-mprinc "\n")
   (dun-batch-loop))
 
-(when noninteractive
-  (fset 'dun-mprinc 'dun-batch-mprinc)
-  (fset 'dun-mprincl 'dun-batch-mprincl)
-  (fset 'dun-vparse 'dun-batch-parse)
-  (fset 'dun-parse2 'dun-batch-parse2)
-  (fset 'dun-read-line 'dun-batch-read-line)
-  (fset 'dun-dos-interface 'dun-batch-dos-interface)
-  (fset 'dun-unix-interface 'dun-batch-unix-interface)
+;;;###autoload
+(defun dun-batch ()
+  "Start `dunnet' in batch mode."
+  (fset 'dun-mprinc #'dun-batch-mprinc)
+  (fset 'dun-mprincl #'dun-batch-mprincl)
+  (fset 'dun-vparse #'dun-batch-parse)
+  (fset 'dun-parse2 #'dun-batch-parse2)
+  (fset 'dun-read-line #'dun-batch-read-line)
+  (fset 'dun-dos-interface #'dun-batch-dos-interface)
+  (fset 'dun-unix-interface #'dun-batch-unix-interface)
   (dun-mprinc "\n")
   (setq dun-batch-mode t)
   (dun-batch-loop))
diff --git a/lisp/play/fortune.el b/lisp/play/fortune.el
index ce40aba..fb02edf 100644
--- a/lisp/play/fortune.el
+++ b/lisp/play/fortune.el
@@ -1,6 +1,6 @@
 ;;; fortune.el --- use fortune to create signatures  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Holger Schauer <Holger.Schauer@gmx.de>
 ;; Keywords: games utils mail
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index bb8ae56..e540ca7 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -1,6 +1,6 @@
 ;;; gamegrid.el --- library for implementing grid-based games on Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Glynn Clements <glynn@sensei.co.uk>
 ;; Old-Version: 1.02
diff --git a/lisp/play/gametree.el b/lisp/play/gametree.el
index a9417e9..1a1d2d7 100644
--- a/lisp/play/gametree.el
+++ b/lisp/play/gametree.el
@@ -1,6 +1,6 @@
 ;;; gametree.el --- manage game analysis trees in Emacs
 
-;; Copyright (C) 1997, 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Ian T Zimmerman <itz@rahul.net>
 ;; Created: Wed Dec 10 07:41:46 PST 1997
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el
index 8ede82a..1856db8 100644
--- a/lisp/play/gomoku.el
+++ b/lisp/play/gomoku.el
@@ -1,6 +1,6 @@
 ;;; gomoku.el --- Gomoku game between you and Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1988, 1994, 1996, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1988, 1994, 1996, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Philippe Schnoebelen <phs@lsv.ens-cachan.fr>
diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el
index 06ea54c..7ad3de6 100644
--- a/lisp/play/handwrite.el
+++ b/lisp/play/handwrite.el
@@ -1,6 +1,6 @@
 ;;; handwrite.el --- turns your emacs buffer into a handwritten document
 
-;; Copyright (C) 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Danny Roozendaal (was: <danny@tvs.kun.nl>)
 ;; Created: October 21 1996
diff --git a/lisp/play/life.el b/lisp/play/life.el
index 56ecc52..2abf8cc 100644
--- a/lisp/play/life.el
+++ b/lisp/play/life.el
@@ -1,6 +1,6 @@
 ;;; life.el --- John Horton Conway's Game of Life  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1988, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Kyle Jones <kyleuunet.uu.net>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/play/morse.el b/lisp/play/morse.el
index da26835..8e09c22 100644
--- a/lisp/play/morse.el
+++ b/lisp/play/morse.el
@@ -1,6 +1,6 @@
 ;;; morse.el --- convert text to morse code and back  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Rick Farnbach <rick_farnbach@MENTORG.COM>
 ;; Keywords: games
diff --git a/lisp/play/mpuz.el b/lisp/play/mpuz.el
index 2413467..7fff604 100644
--- a/lisp/play/mpuz.el
+++ b/lisp/play/mpuz.el
@@ -1,6 +1,6 @@
 ;;; mpuz.el --- multiplication puzzle for GNU Emacs
 
-;; Copyright (C) 1990, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Philippe Schnoebelen <phs@lsv.ens-cachan.fr>
 ;; Overhauled: Daniel Pfeiffer <occitan@esperanto.org>
diff --git a/lisp/play/pong.el b/lisp/play/pong.el
index 4e6d73b..b73dbc1 100644
--- a/lisp/play/pong.el
+++ b/lisp/play/pong.el
@@ -1,6 +1,6 @@
 ;;; pong.el --- classical implementation of pong  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Benjamin Drieu <bdrieu@april.org>
 ;; Keywords: games
diff --git a/lisp/play/snake.el b/lisp/play/snake.el
index 8ea214d..5584bf8 100644
--- a/lisp/play/snake.el
+++ b/lisp/play/snake.el
@@ -1,6 +1,6 @@
 ;;; snake.el --- implementation of Snake for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Glynn Clements <glynn@sensei.co.uk>
 ;; Created: 1997-09-10
diff --git a/lisp/play/solitaire.el b/lisp/play/solitaire.el
index 1383efe..e74ba98 100644
--- a/lisp/play/solitaire.el
+++ b/lisp/play/solitaire.el
@@ -1,6 +1,6 @@
 ;;; solitaire.el --- game of solitaire in Emacs Lisp  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Jan Schormann <Jan.Schormann@rechen-gilde.de>
 ;; Created: Fri afternoon, Jun  3,  1994
diff --git a/lisp/play/spook.el b/lisp/play/spook.el
index ed91dad..d0669eb 100644
--- a/lisp/play/spook.el
+++ b/lisp/play/spook.el
@@ -1,6 +1,6 @@
 ;;; spook.el --- spook phrase utility for overloading the NSA line eater  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1988, 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: games
diff --git a/lisp/play/tetris.el b/lisp/play/tetris.el
index e25cacb..8205d3f 100644
--- a/lisp/play/tetris.el
+++ b/lisp/play/tetris.el
@@ -1,9 +1,9 @@
 ;;; tetris.el --- implementation of Tetris for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Glynn Clements <glynn@sensei.co.uk>
-;; Version: 2.01
+;; Old-Version: 2.01
 ;; Created: 1997-08-13
 ;; Keywords: games
 
@@ -39,22 +39,18 @@
 
 (defcustom tetris-use-glyphs t
   "Non-nil means use glyphs when available."
-  :group 'tetris
   :type 'boolean)
 
 (defcustom tetris-use-color t
   "Non-nil means use color when available."
-  :group 'tetris
   :type 'boolean)
 
 (defcustom tetris-draw-border-with-glyphs t
   "Non-nil means draw a border even when using glyphs."
-  :group 'tetris
   :type 'boolean)
 
 (defcustom tetris-default-tick-period 0.3
   "The default time taken for a shape to drop one row."
-  :group 'tetris
   :type 'number)
 
 (defcustom tetris-update-speed-function
@@ -65,18 +61,15 @@ SHAPES is the number of shapes which have been dropped.
 ROWS is the number of rows which have been completed.
 
 If the return value is a number, it is used as the timer period."
-  :group 'tetris
   :type 'function)
 
 (defcustom tetris-mode-hook nil
   "Hook run upon starting Tetris."
-  :group 'tetris
   :type 'hook)
 
 (defcustom tetris-tty-colors
   ["blue" "white" "yellow" "magenta" "cyan" "green" "red"]
   "Vector of colors of the various shapes in text mode."
-  :group 'tetris
   :type '(vector (color :tag "Shape 1")
                 (color :tag "Shape 2")
                 (color :tag "Shape 3")
@@ -88,7 +81,6 @@ If the return value is a number, it is used as the timer 
period."
 (defcustom tetris-x-colors
   [[0 0 1] [0.7 0 1] [1 1 0] [1 0 1] [0 1 1] [0 1 0] [1 0 0]]
   "Vector of RGB colors of the various shapes."
-  :group 'tetris
   :type '(vector (vector :tag "Shape 1" number number number)
                  (vector :tag "Shape 2" number number number)
                  (vector :tag "Shape 3" number number number)
@@ -99,37 +91,30 @@ If the return value is a number, it is used as the timer 
period."
 
 (defcustom tetris-buffer-name "*Tetris*"
   "Name used for Tetris buffer."
-  :group 'tetris
   :type 'string)
 
 (defcustom tetris-buffer-width 30
   "Width of used portion of buffer."
-  :group 'tetris
   :type 'number)
 
 (defcustom tetris-buffer-height 22
   "Height of used portion of buffer."
-  :group 'tetris
   :type 'number)
 
 (defcustom tetris-width 10
   "Width of playing area."
-  :group 'tetris
   :type 'number)
 
 (defcustom tetris-height 20
   "Height of playing area."
-  :group 'tetris
   :type 'number)
 
 (defcustom tetris-top-left-x 3
   "X position of top left of playing area."
-  :group 'tetris
   :type 'number)
 
 (defcustom tetris-top-left-y 1
   "Y position of top left of playing area."
-  :group 'tetris
   :type 'number)
 
 (defvar tetris-next-x (+ (* 2 tetris-top-left-x) tetris-width)
@@ -335,11 +320,10 @@ each one of its four blocks.")
     options))
 
 (defun tetris-get-tick-period ()
-  (if (boundp 'tetris-update-speed-function)
-      (let ((period (apply tetris-update-speed-function
-                          tetris-n-shapes
-                          tetris-n-rows nil)))
-       (and (numberp period) period))))
+  (let ((period (apply tetris-update-speed-function
+                       tetris-n-shapes
+                       tetris-n-rows nil)))
+    (and (numberp period) period)))
 
 (defun tetris-get-shape-cell (block)
   (aref (aref  (aref tetris-shapes
@@ -646,17 +630,15 @@ rotate the shape to fit in with those at the bottom of 
the screen so
 as to form complete rows.
 
 tetris-mode keybindings:
-   \\<tetris-mode-map>
-\\[tetris-start-game]  Starts a new game of Tetris
-\\[tetris-end-game]    Terminates the current game
-\\[tetris-pause-game]  Pauses (or resumes) the current game
-\\[tetris-move-left]   Moves the shape one square to the left
-\\[tetris-move-right]  Moves the shape one square to the right
-\\[tetris-rotate-prev] Rotates the shape clockwise
-\\[tetris-rotate-next] Rotates the shape anticlockwise
-\\[tetris-move-bottom] Drops the shape to the bottom of the playing area
-
-"
+\\<tetris-mode-map>
+\\[tetris-start-game]  Start a new game of Tetris
+\\[tetris-end-game]    Terminate the current game
+\\[tetris-pause-game]  Pause (or resume) the current game
+\\[tetris-move-left]   Move the shape one square to the left
+\\[tetris-move-right]  Move the shape one square to the right
+\\[tetris-rotate-prev] Rotate the shape clockwise
+\\[tetris-rotate-next] Rotate the shape anticlockwise
+\\[tetris-move-bottom] Drop the shape to the bottom of the playing area"
   (interactive)
 
   (select-window (or (get-buffer-window tetris-buffer-name)
diff --git a/lisp/play/zone.el b/lisp/play/zone.el
index 6e341e7..70b6a01 100644
--- a/lisp/play/zone.el
+++ b/lisp/play/zone.el
@@ -1,6 +1,6 @@
 ;;; zone.el --- idle display hacks
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Victor Zandy <zandy@cs.wisc.edu>
 ;; Maintainer: Thien-Thi Nguyen <ttn@gnu.org>
diff --git a/lisp/plstore.el b/lisp/plstore.el
index c08e079..4653366 100644
--- a/lisp/plstore.el
+++ b/lisp/plstore.el
@@ -1,5 +1,5 @@
 ;;; plstore.el --- secure plist store -*- lexical-binding: t -*-
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@gnu.org>
 ;; Keywords: PGP, GnuPG
diff --git a/lisp/printing.el b/lisp/printing.el
index 90ef02f..2f234b7 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -1,6 +1,6 @@
 ;;; printing.el --- printing utilities  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2000-2001, 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2001, 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Keywords: wp, print, PostScript
diff --git a/lisp/proced.el b/lisp/proced.el
index 203d703..d1a243d 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -1,6 +1,6 @@
 ;;; proced.el --- operate on system processes like dired  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Roland Winkler <winkler@gnu.org>
 ;; Keywords: Processes, Unix
@@ -664,9 +664,9 @@ After displaying or updating a Proced buffer, Proced runs 
the normal hook
         truncate-lines t
         header-line-format '(:eval (proced-header-line)))
   (add-hook 'post-command-hook #'force-mode-line-update nil t)  ;; FIXME: Why?
-  (set (make-local-variable 'revert-buffer-function) #'proced-revert)
-  (set (make-local-variable 'font-lock-defaults)
-       '(proced-font-lock-keywords t nil nil beginning-of-line))
+  (setq-local revert-buffer-function #'proced-revert)
+  (setq-local font-lock-defaults
+              '(proced-font-lock-keywords t nil nil beginning-of-line))
   (if (and (not proced-auto-update-timer) proced-auto-update-interval)
       (setq proced-auto-update-timer
             (run-at-time t proced-auto-update-interval
diff --git a/lisp/profiler.el b/lisp/profiler.el
index bf8aacc..64d71f4 100644
--- a/lisp/profiler.el
+++ b/lisp/profiler.el
@@ -1,6 +1,6 @@
 ;;; profiler.el --- UI and helper functions for Emacs's native profiler -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Tomohiro Matsuyama <tomo@cx4a.org>
 ;; Keywords: lisp
@@ -34,7 +34,7 @@
   :version "24.3"
   :prefix "profiler-")
 
-(defconst profiler-version "24.3")
+(defconst profiler-version "28.1")
 
 (defcustom profiler-sampling-interval 1000000
   "Default sampling interval in nanoseconds."
@@ -85,6 +85,9 @@
                      (t
                       (profiler-ensure-string arg)))
           for len = (length str)
+           if (zerop width)
+           collect str into frags
+           else
           if (< width len)
            collect (progn (put-text-property (max 0 (- width 2)) len
                                              'invisible 'profiler str)
@@ -445,14 +448,16 @@ Optional argument MODE means only check for the specified 
mode (cpu or mem)."
   :group 'profiler)
 
 (defvar profiler-report-cpu-line-format
-  '((50 left)
-    (24 right ((19 right)
-              (5 right)))))
+  '((17 right ((12 right)
+              (5 right)))
+    (1 left "%s")
+    (0 left)))
 
 (defvar profiler-report-memory-line-format
-  '((55 left)
-    (19 right ((14 right profiler-format-number)
-              (5 right)))))
+  '((20 right ((15 right profiler-format-number)
+              (5 right)))
+    (1 left "%s")
+    (0 left)))
 
 (defvar-local profiler-report-profile nil
   "The current profile.")
@@ -495,7 +500,11 @@ RET: expand or collapse"))
 (defun profiler-report-header-line-format (fmt &rest args)
   (let* ((header (apply #'profiler-format fmt args))
         (escaped (replace-regexp-in-string "%" "%%" header)))
-    (concat " " escaped)))
+    (concat
+     (propertize " "
+                 'display '(space :align-to 0)
+                'face 'fixed-pitch)
+     escaped)))
 
 (defun profiler-report-line-format (tree)
   (let ((diff-p (profiler-profile-diff-p profiler-report-profile))
@@ -505,13 +514,14 @@ RET: expand or collapse"))
     (profiler-format (cl-ecase (profiler-profile-type profiler-report-profile)
                       (cpu profiler-report-cpu-line-format)
                       (memory profiler-report-memory-line-format))
-                    name-part
                     (if diff-p
                         (list (if (> count 0)
                                   (format "+%s" count)
                                 count)
                               "")
-                      (list count count-percent)))))
+                      (list count count-percent))
+                     " "
+                     name-part)))
 
 (defun profiler-report-insert-calltree (tree)
   (let ((line (profiler-report-line-format tree)))
@@ -735,11 +745,11 @@ below entry at point."
            (cpu
             (profiler-report-header-line-format
              profiler-report-cpu-line-format
-             "Function" (list "CPU samples" "%")))
+             (list "Samples" "%") " " "  Function"))
            (memory
             (profiler-report-header-line-format
              profiler-report-memory-line-format
-             "Function" (list "Bytes" "%")))))
+             (list "Bytes" "%") " " "  Function"))))
     (let ((predicate (cl-ecase order
                       (ascending #'profiler-calltree-count<)
                       (descending #'profiler-calltree-count>))))
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 2d86f88..527cb03 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -1,6 +1,6 @@
 ;;; antlr-mode.el --- major mode for ANTLR grammar files
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Christoph Wedler <Christoph.Wedler@sap.com>
 ;; Keywords: languages, ANTLR, code generator
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el
index 3fde01d..62ff783 100644
--- a/lisp/progmodes/asm-mode.el
+++ b/lisp/progmodes/asm-mode.el
@@ -1,6 +1,6 @@
 ;;; asm-mode.el --- mode for editing assembler code  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 1991, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el
index d12bed7..73cf290 100644
--- a/lisp/progmodes/autoconf.el
+++ b/lisp/progmodes/autoconf.el
@@ -1,6 +1,6 @@
 ;;; autoconf.el --- mode for editing Autoconf configure.ac files  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: languages
diff --git a/lisp/progmodes/bat-mode.el b/lisp/progmodes/bat-mode.el
index 98e58be..44295c3 100644
--- a/lisp/progmodes/bat-mode.el
+++ b/lisp/progmodes/bat-mode.el
@@ -1,6 +1,6 @@
 ;;; bat-mode.el --- Major mode for editing DOS/Windows scripts
 
-;; Copyright (C) 2003, 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Arni Magnusson <arnima@hafro.is>
 ;; Keywords: languages
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
index c52331f..a759394 100644
--- a/lisp/progmodes/bug-reference.el
+++ b/lisp/progmodes/bug-reference.el
@@ -1,6 +1,6 @@
 ;; bug-reference.el --- buttonize bug references  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Tom Tromey <tromey@redhat.com>
 ;; Created: 21 Mar 2007
diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el
index 7884d4b..d14ef17 100644
--- a/lisp/progmodes/cc-align.el
+++ b/lisp/progmodes/cc-align.el
@@ -1,6 +1,6 @@
 ;;; cc-align.el --- custom indentation functions for CC Mode
 
-;; Copyright (C) 1985, 1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:    2004- Alan Mackenzie
 ;;             1998- Martin Stjernholm
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el
index 52e6da6..3228944 100644
--- a/lisp/progmodes/cc-awk.el
+++ b/lisp/progmodes/cc-awk.el
@@ -1,6 +1,6 @@
 ;;; cc-awk.el --- AWK specific code within cc-mode.
 
-;; Copyright (C) 1988, 1994, 1996, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1988, 1994, 1996, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Alan Mackenzie <acm@muc.de> (originally based on awk-mode.el)
@@ -49,9 +49,11 @@
     (load "cc-bytecomp" nil t)))
 
 (cc-require 'cc-defs)
+(cc-require-when-compile 'cc-langs)
+(cc-require-when-compile 'cc-fonts)
+(cc-require 'cc-engine)
 
 ;; Silence the byte compiler.
-(cc-bytecomp-defvar font-lock-mode)    ; Checked with boundp before use.
 (cc-bytecomp-defvar c-new-BEG)
 (cc-bytecomp-defvar c-new-END)
 
@@ -649,6 +651,46 @@
 ;; several lines back.  The elisp "advice" feature is used on these functions
 ;; to allow this.
 
+(defun c-awk-font-lock-invalid-namespace-separators (limit)
+  ;; This function will be called from font-lock for a region bounded by POINT
+  ;; and LIMIT, as though it were to identify a keyword for
+  ;; font-lock-keyword-face.  It always returns NIL to inhibit this and
+  ;; prevent a repeat invocation.  See elisp/lispref page "Search-based
+  ;; Fontification".
+  ;;
+  ;; This function gives invalid GAWK namepace separators (::)
+  ;; font-lock-warning-face.  "Invalid" here means there are spaces, etc.,
+  ;; around a separator, or there are more than one of them in an identifier.
+  ;; Invalid separators inside function declaration parentheses are handled
+  ;; elsewhere.
+  (while (and
+         (< (point) limit)
+         (c-syntactic-re-search-forward
+          (eval-when-compile
+            (concat "\\([^" (c-lang-const c-symbol-chars awk) "]::\\)"
+                    "\\|"
+                    ;; "\\(::[^" (c-lang-const c-symbol-start awk) "]\\)"
+                    "\\(::[^" c-alpha "_" "]\\)"
+                    "\\|"
+                    "\\(::[" (c-lang-const c-symbol-chars awk) "]*::\\)"))
+          limit 'bound))
+    (cond
+     ((match-beginning 1)              ; " ::"
+      (c-put-font-lock-face (1+ (match-beginning 1)) (match-end 1)
+                           'font-lock-warning-face)
+      (goto-char (- (match-end 1) 2)))
+     ((match-beginning 2)              ; ":: "
+      (c-put-font-lock-face (match-beginning 2) (1- (match-end 2))
+                           'font-lock-warning-face)
+      (goto-char (1- (match-end 2))))
+     (t                                        ; "::foo::"
+      (c-put-font-lock-face (match-beginning 3) (+ 2 (match-beginning 3))
+                           'font-lock-warning-face)
+      (c-put-font-lock-face (- (match-end 3) 2) (match-end 3)
+                           'font-lock-warning-face)
+      (goto-char (- (match-end 3) 2)))))
+    nil)
+
 (defun c-awk-beginning-of-logical-line (&optional pos)
 ;; Go back to the start of the (apparent) current line (or the start of the
 ;; line containing POS), returning the buffer position of that point.  I.e.,
@@ -900,6 +942,13 @@
     (goto-char c-new-BEG)
     (c-awk-set-syntax-table-properties c-new-END)))
 
+(defun c-awk-context-expand-fl-region (beg end)
+  ;; Return a cons (NEW-BEG . NEW-END), where NEW-BEG is the beginning of the
+  ;; logical line BEG is on, and NEW-END is the beginning of the line after
+  ;; the end of the logical line that END is on.
+  (cons (save-excursion (c-awk-beginning-of-logical-line beg))
+       (c-awk-beyond-logical-line end)))
+
 ;; Awk regexps written with help from Peter Galbraith
 ;; <galbraith@mixing.qc.dfo.ca>.
 ;; Take GNU Emacs's 'words out of the following regexp-opts.  They don't work
@@ -907,18 +956,34 @@
 (defconst awk-font-lock-keywords
   (eval-when-compile
     (list
-     ;; Function names.
-     '("^\\s *\\(func\\(tion\\)?\\)\\>\\s *\\(\\sw+\\)?"
-       (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t))
-     ;;
+     ;; Function declarations.
+     `(,(c-make-font-lock-search-function
+        "^\\s *\\(func\\(tion\\)?\\)\\s +\\(\\(\\sw+\\(::\\sw+\\)?\\)\\s 
*\\)?\\(([^()]*)\\)?"
+        '(1 font-lock-keyword-face t)
+        ;; We can't use LAXMATCH in `c-make-font-lock-search-function', so....
+        '((when (match-beginning 4)
+            (c-put-font-lock-face
+             (match-beginning 4) (match-end 4) font-lock-function-name-face)
+            nil))
+        ;; Put warning face on any use of :: inside the parens.
+        '((when (match-beginning 6)
+            (goto-char (1+ (match-beginning 6)))
+            (let ((end (1- (match-end 6))))
+              (while (and (< (point) end)
+                          (c-syntactic-re-search-forward "::" end t))
+                (c-put-font-lock-face (- (point) 2) (point)
+                                      'font-lock-warning-face)))
+            nil))))
+
      ;; Variable names.
      (cons
       (concat "\\<"
              (regexp-opt
               '("ARGC" "ARGIND" "ARGV" "BINMODE" "CONVFMT" "ENVIRON"
-                "ERRNO" "FIELDWIDTHS" "FILENAME" "FNR" "FS" "IGNORECASE"
-                "LINT" "NF" "NR" "OFMT" "OFS" "ORS" "PROCINFO" "RLENGTH"
-                "RS" "RSTART" "RT" "SUBSEP" "TEXTDOMAIN") t) "\\>")
+                "ERRNO" "FIELDWIDTHS" "FILENAME" "FNR" "FPAT" "FS" "FUNCTAB"
+                "IGNORECASE" "LINT" "NF" "NR" "OFMT" "OFS" "ORS" "PREC"
+                "PROCINFO" "RLENGTH" "ROUNDMODE" "RS" "RSTART" "RT" "SUBSEP"
+                "SYNTAB" "TEXTDOMAIN") t) "\\>")
       'font-lock-variable-name-face)
 
      ;; Special file names.  (acm, 2002/7/22)
@@ -949,7 +1014,8 @@ std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\
      ;; Keywords.
      (concat "\\<"
             (regexp-opt
-             '("BEGIN" "END" "break" "case" "continue" "default" "delete"
+             '("BEGIN" "BEGINFILE" "END" "ENDFILE"
+               "break" "case" "continue" "default" "delete"
                "do" "else" "exit" "for" "getline" "if" "in" "next"
                "nextfile" "return" "switch" "while")
              t) "\\>")
@@ -959,16 +1025,20 @@ std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\
               ,(concat
                 "\\<"
                 (regexp-opt
-                 '("adump" "and" "asort" "atan2" "bindtextdomain" "close"
-                   "compl" "cos" "dcgettext" "exp" "extension" "fflush"
-                   "gensub" "gsub" "index" "int" "length" "log" "lshift"
-                   "match" "mktime" "or" "print" "printf" "rand" "rshift"
+                 '("adump" "and" "asort" "asorti" "atan2" "bindtextdomain" 
"close"
+                   "compl" "cos" "dcgettext" "dcngettext" "exp" "extension" 
"fflush"
+                   "gensub" "gsub" "index" "int" "isarray" "length" "log" 
"lshift"
+                   "match" "mktime" "or" "patsplit" "print" "printf" "rand" 
"rshift"
                    "sin" "split" "sprintf" "sqrt" "srand" "stopme"
                    "strftime" "strtonum" "sub" "substr"  "system"
-                   "systime" "tolower" "toupper" "xor") t)
+                   "systime" "tolower" "toupper" "typeof" "xor")
+                 t)
                 "\\>")
               0 c-preprocessor-face-name))
 
+     ;; Directives
+     `(eval . '("@\\(include\\|load\\|namespace\\)\\>" 0 
,c-preprocessor-face-name))
+
      ;; gawk debugging keywords.  (acm, 2002/7/21)
      ;; (Removed, 2003/6/6.  These functions are now fontified as built-ins)
      ;;        (list (concat "\\<" (regexp-opt '("adump" "stopme") t) "\\>")
@@ -980,6 +1050,9 @@ std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\
                c-awk-escaped-nls*-with-space* "(")
        (0 'font-lock-warning-face))
 
+     ;; Double :: tokens, or the same with space(s) around them.
+     #'c-awk-font-lock-invalid-namespace-separators
+
      ;; Space after \ in what looks like an escaped newline.  2002/5/31
      '("\\\\\\s +$" 0 font-lock-warning-face t)
 
diff --git a/lisp/progmodes/cc-bytecomp.el b/lisp/progmodes/cc-bytecomp.el
index 959261c..3f7caf3 100644
--- a/lisp/progmodes/cc-bytecomp.el
+++ b/lisp/progmodes/cc-bytecomp.el
@@ -1,6 +1,6 @@
 ;;; cc-bytecomp.el --- compile time setup for proper compilation
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author:     Martin Stjernholm
 ;; Maintainer: bug-cc-mode@gnu.org
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 0ce3b3f..33a0360 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1,6 +1,6 @@
 ;;; cc-cmds.el --- user level commands for CC Mode
 
-;; Copyright (C) 1985, 1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:    2003- Alan Mackenzie
 ;;             1998- Martin Stjernholm
@@ -2357,7 +2357,7 @@ With a prefix arg, push the name onto the kill ring too."
 (put 'c-display-defun-name 'isearch-scroll t)
 
 (defun c-mark-function ()
-  "Put mark at end of the current top-level declaration or macro, point at 
beginning.
+  "Put mark at end of current top-level declaration or macro, point at 
beginning.
 If point is not inside any then the closest following one is
 chosen.  Each successive call of this command extends the marked
 region by one function.
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index c82b3a3..38fe23b 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1,6 +1,6 @@
 ;;; cc-defs.el --- compile time definitions for CC Mode
 
-;; Copyright (C) 1985, 1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:    2003- Alan Mackenzie
 ;;             1998- Martin Stjernholm
@@ -87,7 +87,7 @@
 
 ;;; Variables also used at compile time.
 
-(defconst c-version "5.34.2"
+(defconst c-version "5.35.1"
   "CC Mode version number.")
 
 (defconst c-version-sym (intern c-version))
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 5e2ce71..3fce7db 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -1,6 +1,6 @@
 ;;; cc-engine.el --- core syntax guessing engine for CC mode -*- coding: utf-8 
-*-
 
-;; Copyright (C) 1985, 1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:    2001- Alan Mackenzie
 ;;             1998- Martin Stjernholm
@@ -972,7 +972,7 @@ comment at the start of cc-engine.el for more info."
       ;; that we've moved.
       (while (progn
               (setq pos (point))
-              (c-backward-syntactic-ws)
+              (c-backward-syntactic-ws lim)
               ;; Protect post-++/-- operators just before a virtual semicolon.
               (and (not (c-at-vsemi-p))
                    (/= (skip-chars-backward "-+!*&~@`#") 0))))
@@ -984,7 +984,7 @@ comment at the start of cc-engine.el for more info."
       (if (and (memq (char-before) delims)
               (progn (forward-char -1)
                      (setq saved (point))
-                     (c-backward-syntactic-ws)
+                     (c-backward-syntactic-ws lim)
                      (or (memq (char-before) delims)
                          (memq (char-before) '(?: nil))
                          (eq (char-syntax (char-before)) ?\()
@@ -1164,7 +1164,7 @@ comment at the start of cc-engine.el for more info."
                 ;; HERE IS THE SINGLE PLACE INSIDE THE PDA LOOP WHERE WE MOVE
                ;; BACKWARDS THROUGH THE SOURCE.
 
-               (c-backward-syntactic-ws)
+               (c-backward-syntactic-ws lim)
                (let ((before-sws-pos (point))
                      ;; The end position of the area to search for statement
                      ;; barriers in this round.
@@ -1174,33 +1174,35 @@ comment at the start of cc-engine.el for more info."
                  ;; Go back over exactly one logical sexp, taking proper
                  ;; account of macros and escaped EOLs.
                  (while
-                     (progn
-                       (setq comma-delimited (and (not comma-delim)
-                                                  (eq (char-before) ?\,)))
-                       (unless (c-safe (c-backward-sexp) t)
-                         ;; Give up if we hit an unbalanced block.  Since the
-                         ;; stack won't be empty the code below will report a
-                         ;; suitable error.
-                         (setq pre-stmt-found t)
-                         (throw 'loop nil))
-                       (cond
-                        ;; Have we moved into a macro?
-                        ((and (not macro-start)
-                              (c-beginning-of-macro))
-                         (save-excursion
-                           (c-backward-syntactic-ws)
-                           (setq before-sws-pos (point)))
-                         ;; Have we crossed a statement boundary?  If not,
-                         ;; keep going back until we find one or a "real" sexp.
-                         (and
+                     (and
+                      (progn
+                        (setq comma-delimited (and (not comma-delim)
+                                                   (eq (char-before) ?\,)))
+                        (unless (c-safe (c-backward-sexp) t)
+                          ;; Give up if we hit an unbalanced block.  Since the
+                          ;; stack won't be empty the code below will report a
+                          ;; suitable error.
+                          (setq pre-stmt-found t)
+                          (throw 'loop nil))
+                        (cond
+                         ;; Have we moved into a macro?
+                         ((and (not macro-start)
+                               (c-beginning-of-macro))
                           (save-excursion
-                            (c-end-of-macro)
-                            (not (c-crosses-statement-barrier-p
-                                  (point) maybe-after-boundary-pos)))
-                          (setq maybe-after-boundary-pos (point))))
-                        ;; Have we just gone back over an escaped NL?  This
-                        ;; doesn't count as a sexp.
-                        ((looking-at "\\\\$")))))
+                            (c-backward-syntactic-ws lim)
+                            (setq before-sws-pos (point)))
+                          ;; Have we crossed a statement boundary?  If not,
+                          ;; keep going back until we find one or a "real" 
sexp.
+                          (and
+                           (save-excursion
+                             (c-end-of-macro)
+                             (not (c-crosses-statement-barrier-p
+                                   (point) maybe-after-boundary-pos)))
+                           (setq maybe-after-boundary-pos (point))))
+                         ;; Have we just gone back over an escaped NL?  This
+                         ;; doesn't count as a sexp.
+                         ((looking-at "\\\\$"))))
+                      (>= (point) lim)))
 
                  ;; Have we crossed a statement boundary?
                  (setq boundary-pos
@@ -1412,12 +1414,14 @@ comment at the start of cc-engine.el for more info."
            (setq ret 'label)))
 
       ;; Skip over the unary operators that can start the statement.
-      (while (progn
-              (c-backward-syntactic-ws)
-              ;; protect AWK post-inc/decrement operators, etc.
-              (and (not (c-at-vsemi-p (point)))
-                   (/= (skip-chars-backward "-.+!*&~@`#") 0)))
+      (while (and (> (point) lim)
+                 (progn
+                   (c-backward-syntactic-ws lim)
+                   ;; protect AWK post-inc/decrement operators, etc.
+                   (and (not (c-at-vsemi-p (point)))
+                        (/= (skip-chars-backward "-.+!*&~@`#") 0))))
        (setq pos (point)))
+
       (goto-char pos)
       ret)))
 
@@ -3565,18 +3569,23 @@ mhtml-mode."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Defuns which analyze the buffer, yet don't change `c-state-cache'.
 (defun c-get-fallback-scan-pos (here)
-  ;; Return a start position for building `c-state-cache' from
-  ;; scratch.  This will be at the top level, 2 defuns back.
+  ;; Return a start position for building `c-state-cache' from scratch.  This
+  ;; will be at the top level, 2 defuns back.  Return nil if we don't find
+  ;; these defun starts a reasonable way back.
   (save-excursion
-    ;; Go back 2 bods, but ignore any bogus positions returned by
-    ;; beginning-of-defun (i.e. open paren in column zero).
-    (goto-char here)
-    (let ((cnt 2))
-      (while (not (or (bobp) (zerop cnt)))
-       (c-beginning-of-defun-1)        ; Pure elisp BOD.
-       (if (eq (char-after) ?\{)
-           (setq cnt (1- cnt)))))
-    (point)))
+    (save-restriction
+      (when (> here (* 10 c-state-cache-too-far))
+       (narrow-to-region (- here (* 10 c-state-cache-too-far)) here))
+      ;; Go back 2 bods, but ignore any bogus positions returned by
+      ;; beginning-of-defun (i.e. open paren in column zero).
+      (goto-char here)
+      (let ((cnt 2))
+       (while (not (or (bobp) (zerop cnt)))
+         (c-beginning-of-defun-1)      ; Pure elisp BOD.
+         (if (eq (char-after) ?\{)
+             (setq cnt (1- cnt)))))
+      (and (not (bobp))
+          (point)))))
 
 (defun c-state-balance-parens-backwards (here- here+ top)
   ;; Return the position of the opening paren/brace/bracket before HERE- which
@@ -3667,9 +3676,7 @@ mhtml-mode."
            how-far 0))
      ((<= good-pos here)
       (setq strategy 'forward
-           start-point (if changed-macro-start
-                           cache-pos
-                         (max good-pos cache-pos))
+           start-point (max good-pos cache-pos)
            how-far (- here start-point)))
      ((< (- good-pos here) (- here cache-pos)) ; FIXME!!! ; apply some sort of 
weighting.
       (setq strategy 'backward
@@ -3688,7 +3695,8 @@ mhtml-mode."
               ;; (not (c-major-mode-is 'c++-mode))
               (> how-far c-state-cache-too-far))
       (setq BOD-pos (c-get-fallback-scan-pos here)) ; somewhat EXPENSIVE!!!
-      (if (< (- here BOD-pos) how-far)
+      (if (and BOD-pos
+              (< (- here BOD-pos) how-far))
          (setq strategy 'BOD
                start-point BOD-pos)))
 
@@ -4337,8 +4345,12 @@ mhtml-mode."
       (if (and dropped-cons
               (<= too-high-pa here))
          (c-append-lower-brace-pair-to-state-cache too-high-pa here here-bol))
-      (setq c-state-cache-good-pos (or (c-state-cache-after-top-paren)
-                                      (c-state-get-min-scan-pos)))))
+      (if (and c-state-cache-good-pos (< here c-state-cache-good-pos))
+         (setq c-state-cache-good-pos
+               (or (save-excursion
+                     (goto-char here)
+                     (c-literal-start))
+                   here)))))
 
   ;; The brace-pair desert marker:
   (when (car c-state-brace-pair-desert)
@@ -4796,7 +4808,7 @@ comment at the start of cc-engine.el for more info."
 
      ;; Handle the "operator +" syntax in C++.
      (when (and c-overloadable-operators-regexp
-               (= (c-backward-token-2 0) 0))
+               (= (c-backward-token-2 0 nil (c-determine-limit 500)) 0))
 
        (cond ((and (looking-at c-overloadable-operators-regexp)
                   (or (not c-opt-op-identifier-prefix)
@@ -5065,7 +5077,8 @@ See `c-forward-token-2' for details."
          (while (and
                  (> count 0)
                  (progn
-                   (c-backward-syntactic-ws)
+                   (c-backward-syntactic-ws
+                    limit)
                    (backward-char)
                    (if (looking-at jump-syntax)
                        (goto-char (scan-sexps (1+ (point)) -1))
@@ -5402,8 +5415,12 @@ comment at the start of cc-engine.el for more info."
               ;; Optimize for, in particular, large blocks of comments from
               ;; `comment-region'.
               (progn (when opt-ws
-                       (c-backward-syntactic-ws)
-                       (setq paren-level-pos (point)))
+                       (let ((opt-pos (point)))
+                         (c-backward-syntactic-ws limit)
+                         (if (or (null limit)
+                             (> (point) limit))
+                             (setq paren-level-pos (point))
+                           (goto-char opt-pos))))
                      t)
               ;; Move back to a candidate end point which isn't in a literal
               ;; or in a macro we didn't start in.
@@ -5423,7 +5440,11 @@ comment at the start of cc-engine.el for more info."
                                     (setq macro-start (point))))
                            (goto-char macro-start))))
                   (when opt-ws
-                    (c-backward-syntactic-ws)))
+                    (let ((opt-pos (point)))
+                      (c-backward-syntactic-ws limit)
+                      (if (and limit
+                          (<= (point) limit))
+                          (goto-char opt-pos)))))
                 (< (point) pos))
 
               ;; Check whether we're at the wrong level of nesting (when
@@ -5474,7 +5495,7 @@ comment at the start of cc-engine.el for more info."
             (progn
               ;; Skip syntactic ws afterwards so that we don't stop at the
               ;; end of a comment if `skip-chars' is something like "^/".
-              (c-backward-syntactic-ws)
+              (c-backward-syntactic-ws limit)
               (point)))))
 
     ;; We might want to extend this with more useful return values in
@@ -5762,12 +5783,23 @@ comment at the start of cc-engine.el for more info."
              (t 'c)))                  ; Assuming the range is valid.
     range))
 
+(defun c-determine-limit-no-macro (here org-start)
+  ;; If HERE is inside a macro, and ORG-START is not also in the same macro,
+  ;; return the beginning of the macro.  Otherwise return HERE.  Point is not
+  ;; preserved by this function.
+  (goto-char here)
+  (let ((here-BOM (and (c-beginning-of-macro) (point))))
+    (if (and here-BOM
+            (not (eq (progn (goto-char org-start)
+                            (and (c-beginning-of-macro) (point)))
+                     here-BOM)))
+       here-BOM
+      here)))
+
 (defsubst c-determine-limit-get-base (start try-size)
   ;; Get a "safe place" approximately TRY-SIZE characters before START.
   ;; This defsubst doesn't preserve point.
   (goto-char start)
-  (c-backward-syntactic-ws)
-  (setq start (point))
   (let* ((pos (max (- start try-size) (point-min)))
         (s (c-semi-pp-to-literal pos))
         (cand (or (car (cddr s)) pos)))
@@ -5776,20 +5808,23 @@ comment at the start of cc-engine.el for more info."
       (parse-partial-sexp pos start nil nil (car s) 'syntax-table)
       (point))))
 
-(defun c-determine-limit (how-far-back &optional start try-size)
+(defun c-determine-limit (how-far-back &optional start try-size org-start)
   ;; Return a buffer position approximately HOW-FAR-BACK non-literal
   ;; characters from START (default point).  The starting position, either
   ;; point or START may not be in a comment or string.
   ;;
   ;; The position found will not be before POINT-MIN and won't be in a
-  ;; literal.
+  ;; literal.  It will also not be inside a macro, unless START/point is also
+  ;; in the same macro.
   ;;
   ;; We start searching for the sought position TRY-SIZE (default
   ;; twice HOW-FAR-BACK) bytes back from START.
   ;;
   ;; This function must be fast.  :-)
+
   (save-excursion
     (let* ((start (or start (point)))
+          (org-start (or org-start start))
           (try-size (or try-size (* 2 how-far-back)))
           (base (c-determine-limit-get-base start try-size))
           (pos base)
@@ -5842,21 +5877,27 @@ comment at the start of cc-engine.el for more info."
        (setq elt (car stack)
              stack (cdr stack))
        (setq count (+ count (cdr elt))))
-
-      ;; Have we found enough yet?
       (cond
        ((null elt)                     ; No non-literal characters found.
-       (if (> base (point-min))
-           (c-determine-limit how-far-back base (* 2 try-size))
-         (point-min)))
+       (cond
+        ((> pos start)                 ; Nothing but literals
+         base)
+        ((> base (point-min))
+         (c-determine-limit how-far-back base (* 2 try-size) org-start))
+        (t base)))
        ((>= count how-far-back)
-       (+ (car elt) (- count how-far-back)))
+       (c-determine-limit-no-macro
+       (+ (car elt) (- count how-far-back))
+       org-start))
        ((eq base (point-min))
        (point-min))
        ((> base (- start try-size)) ; Can only happen if we hit point-min.
-       (car elt))
+       (c-determine-limit-no-macro
+       (car elt)
+       org-start))
        (t
-       (c-determine-limit (- how-far-back count) base (* 2 try-size)))))))
+       (c-determine-limit (- how-far-back count) base (* 2 try-size)
+                          org-start))))))
 
 (defun c-determine-+ve-limit (how-far &optional start-pos)
   ;; Return a buffer position about HOW-FAR non-literal characters forward
@@ -6248,8 +6289,14 @@ comment at the start of cc-engine.el for more info."
        ;; preceding syntactic ws to set `cfd-match-pos' and to catch
        ;; any decl spots in the syntactic ws.
        (unless cfd-re-match
-        (c-backward-syntactic-ws)
-        (setq cfd-re-match (point))))
+        (let ((cfd-cbsw-lim
+               (max (- (point) 1000) (point-min))))
+          (c-backward-syntactic-ws cfd-cbsw-lim)
+          (setq cfd-re-match
+                (if (or (bobp) (> (point) cfd-cbsw-lim))
+                    (point)
+                  (point-min))))  ; Set BOB case if the token's too far back.
+        ))
 
      ;; Choose whichever match is closer to the start.
      (if (< cfd-re-match cfd-prop-match)
@@ -6410,7 +6457,7 @@ comment at the start of cc-engine.el for more info."
           (while (and (not (bobp))
                       (c-got-face-at (1- (point)) c-literal-faces))
             (goto-char (previous-single-property-change
-                        (point) 'face nil (point-min))))
+                        (point) 'face nil (point-min)))) ; No limit.  FIXME, 
perhaps?  2020-12-07.
 
           ;; XEmacs doesn't fontify the quotes surrounding string
           ;; literals.
@@ -6482,12 +6529,15 @@ comment at the start of cc-engine.el for more info."
        (c-invalidate-find-decl-cache cfd-start-pos)
 
        (setq syntactic-pos (point))
-       (unless (eq syntactic-pos c-find-decl-syntactic-pos)
+       (unless
+           (eq syntactic-pos c-find-decl-syntactic-pos)
          ;; Don't have to do this if the cache is relevant here,
          ;; typically if the same line is refontified again.  If
          ;; we're just some syntactic whitespace further down we can
          ;; still use the cache to limit the skipping.
-         (c-backward-syntactic-ws c-find-decl-syntactic-pos))
+         (c-backward-syntactic-ws
+          (max (or c-find-decl-syntactic-pos (point-min))
+               (- (point) 10000) (point-min))))
 
        ;; If we hit `c-find-decl-syntactic-pos' and
        ;; `c-find-decl-match-pos' is set then we install the cached
@@ -6613,7 +6663,8 @@ comment at the start of cc-engine.el for more info."
          ;; syntactic ws.
          (when (and cfd-match-pos (< cfd-match-pos syntactic-pos))
            (goto-char syntactic-pos)
-           (c-forward-syntactic-ws)
+           (c-forward-syntactic-ws
+            (min (+ (point) 2000) (point-max)))
            (and cfd-continue-pos
                 (< cfd-continue-pos (point))
                 (setq cfd-token-pos (point))))
@@ -6654,7 +6705,8 @@ comment at the start of cc-engine.el for more info."
                        ;; can't be nested, and that's already been done in
                        ;; `c-find-decl-prefix-search'.
                        (when (> cfd-continue-pos cfd-token-pos)
-                         (c-forward-syntactic-ws)
+                         (c-forward-syntactic-ws
+                          (min (+ (point) 2000) (point-max)))
                          (setq cfd-token-pos (point)))
 
                        ;; Continue if the following token fails the
@@ -8262,7 +8314,8 @@ comment at the start of cc-engine.el for more info."
        ;; typically called from `c-forward-type' in this case, and
        ;; the caller only wants the top level type that it finds to
        ;; be promoted.
-       c-promote-possible-types)
+       c-promote-possible-types
+       (lim+ (c-determine-+ve-limit 500)))
     (while
        (and
         (looking-at c-identifier-key)
@@ -8292,7 +8345,7 @@ comment at the start of cc-engine.el for more info."
 
                 ;; Handle a C++ operator or template identifier.
                 (goto-char id-end)
-                (c-forward-syntactic-ws)
+                (c-forward-syntactic-ws lim+)
                 (cond ((eq (char-before id-end) ?e)
                        ;; Got "... ::template".
                        (let ((subres (c-forward-name)))
@@ -8322,13 +8375,13 @@ comment at the start of cc-engine.el for more info."
                                             (looking-at "::")
                                             (progn
                                               (goto-char (match-end 0))
-                                              (c-forward-syntactic-ws)
+                                              (c-forward-syntactic-ws lim+)
                                               (eq (char-after) ?*))
                                             (progn
                                               (forward-char)
                                               t))))
                            (while (progn
-                                    (c-forward-syntactic-ws)
+                                    (c-forward-syntactic-ws lim+)
                                     (setq pos (point))
                                     (looking-at c-opt-type-modifier-key))
                              (goto-char (match-end 1))))))
@@ -8338,7 +8391,7 @@ comment at the start of cc-engine.el for more info."
                        (setq c-last-identifier-range
                              (cons (point) (match-end 0)))
                        (goto-char (match-end 0))
-                       (c-forward-syntactic-ws)
+                       (c-forward-syntactic-ws lim+)
                        (setq pos (point)
                              res 'operator)))
 
@@ -8352,7 +8405,7 @@ comment at the start of cc-engine.el for more info."
               (setq c-last-identifier-range
                     (cons id-start id-end)))
             (goto-char id-end)
-            (c-forward-syntactic-ws)
+            (c-forward-syntactic-ws lim+)
             (setq pos (point)
                   res t)))
 
@@ -8368,7 +8421,7 @@ comment at the start of cc-engine.el for more info."
               ;; cases with tricky syntactic whitespace that aren't
               ;; covered in `c-identifier-key'.
               (goto-char (match-end 0))
-              (c-forward-syntactic-ws)
+              (c-forward-syntactic-ws lim+)
               t)
 
              ((and c-recognize-<>-arglists
@@ -8377,7 +8430,7 @@ comment at the start of cc-engine.el for more info."
               (when (let (c-last-identifier-range)
                       (c-forward-<>-arglist nil))
 
-                (c-forward-syntactic-ws)
+                (c-forward-syntactic-ws lim+)
                 (unless (eq (char-after) ?\()
                   (setq c-last-identifier-range nil)
                   (c-add-type start (1+ pos)))
@@ -8392,7 +8445,7 @@ comment at the start of cc-engine.el for more info."
                       (when (and c-record-type-identifiers id-start)
                         (c-record-ref-id (cons id-start id-end)))
                       (forward-char 2)
-                      (c-forward-syntactic-ws)
+                      (c-forward-syntactic-ws lim+)
                       t)
 
                   (when (and c-record-type-identifiers id-start
@@ -8817,7 +8870,7 @@ comment at the start of cc-engine.el for more info."
     (or res (goto-char here))
     res))
 
-(defmacro c-back-over-list-of-member-inits ()
+(defmacro c-back-over-list-of-member-inits (limit)
   ;; Go back over a list of elements, each looking like:
   ;; <symbol> (<expression>) ,
   ;; or <symbol> {<expression>} , (with possibly a <....> expressions
@@ -8826,21 +8879,21 @@ comment at the start of cc-engine.el for more info."
   ;; a comma.  If either of <symbol> or bracketed <expression> is missing,
   ;; throw nil to 'level.  If the terminating } or ) is unmatched, throw nil
   ;; to 'done.  This is not a general purpose macro!
-  '(while (eq (char-before) ?,)
+  `(while (eq (char-before) ?,)
      (backward-char)
-     (c-backward-syntactic-ws)
+     (c-backward-syntactic-ws ,limit)
      (when (not (memq (char-before) '(?\) ?})))
        (throw 'level nil))
      (when (not (c-go-list-backward))
        (throw 'done nil))
-     (c-backward-syntactic-ws)
+     (c-backward-syntactic-ws ,limit)
      (while (eq (char-before) ?>)
        (when (not (c-backward-<>-arglist nil))
         (throw 'done nil))
-       (c-backward-syntactic-ws))
+       (c-backward-syntactic-ws ,limit))
      (when (not (c-back-over-compound-identifier))
        (throw 'level nil))
-     (c-backward-syntactic-ws)))
+     (c-backward-syntactic-ws ,limit)))
 
 (defun c-back-over-member-initializers (&optional limit)
   ;; Test whether we are in a C++ member initializer list, and if so, go back
@@ -8859,14 +8912,14 @@ comment at the start of cc-engine.el for more info."
            (catch 'done
              (setq level-plausible
                    (catch 'level
-                     (c-backward-syntactic-ws)
+                     (c-backward-syntactic-ws limit)
                      (when (memq (char-before) '(?\) ?}))
                        (when (not (c-go-list-backward))
                          (throw 'done nil))
-                       (c-backward-syntactic-ws))
+                       (c-backward-syntactic-ws limit))
                      (when (c-back-over-compound-identifier)
-                       (c-backward-syntactic-ws))
-                     (c-back-over-list-of-member-inits)
+                       (c-backward-syntactic-ws limit))
+                     (c-back-over-list-of-member-inits limit)
                      (and (eq (char-before) ?:)
                           (save-excursion
                             (c-backward-token-2)
@@ -8880,14 +8933,14 @@ comment at the start of cc-engine.el for more info."
                (setq level-plausible
                      (catch 'level
                        (goto-char pos)
-                       (c-backward-syntactic-ws)
+                       (c-backward-syntactic-ws limit)
                        (when (not (c-back-over-compound-identifier))
                          (throw 'level nil))
-                       (c-backward-syntactic-ws)
-                       (c-back-over-list-of-member-inits)
+                       (c-backward-syntactic-ws limit)
+                       (c-back-over-list-of-member-inits limit)
                        (and (eq (char-before) ?:)
                             (save-excursion
-                              (c-backward-token-2)
+                              (c-backward-token-2 nil nil limit)
                               (not (looking-at c-:$-multichar-token-regexp)))
                             (c-just-after-func-arglist-p)))))
 
@@ -10837,11 +10890,11 @@ comment at the start of cc-engine.el for more info."
             (low-lim (max (or lim (point-min))   (or macro-start (point-min))))
             before-lparen after-rparen
             (here (point))
-            (pp-count-out 20)  ; Max number of paren/brace constructs before
-                               ; we give up.
+            (pp-count-out 20)   ; Max number of paren/brace constructs before
+                                       ; we give up
             ids              ; List of identifiers in the parenthesized list.
-            id-start after-prec-token decl-or-cast decl-res
-            c-last-identifier-range identifier-ok)
+            id-start after-prec-token decl-or-cast
+            c-last-identifier-range semi-position+1)
        (narrow-to-region low-lim (or macro-end (point-max)))
 
        ;; Search backwards for the defun's argument list.  We give up if we
@@ -10875,8 +10928,8 @@ comment at the start of cc-engine.el for more info."
                   (setq after-rparen (point)))
                  ((eq (char-before) ?\])
                   (setq after-rparen nil))
-                 (t ; either } (hit previous defun) or = or no more
-                    ; parens/brackets.
+                 (t           ; either } (hit previous defun) or = or no more
+                                       ; parens/brackets.
                   (throw 'knr nil)))
 
            (if after-rparen
@@ -10933,31 +10986,35 @@ comment at the start of cc-engine.el for more info."
                       (forward-char)   ; over the )
                       (setq after-prec-token after-rparen)
                       (c-forward-syntactic-ws)
+                      ;; Each time around the following checks one
+                      ;; declaration (which may contain several identifiers).
                       (while (and
-                              (or (consp (setq decl-or-cast
-                                               (c-forward-decl-or-cast-1
-                                                after-prec-token
-                                                nil ; Or 'arglist ???
-                                                nil)))
-                                  (progn
-                                    (goto-char after-prec-token)
-                                    (c-forward-syntactic-ws)
-                                    (setq identifier-ok (eq (char-after) ?{))
-                                    nil))
-                              (eq (char-after) ?\;)
-                              (setq after-prec-token (1+ (point)))
+                              (consp (setq decl-or-cast
+                                           (c-forward-decl-or-cast-1
+                                            after-prec-token
+                                            nil ; Or 'arglist ???
+                                            nil)))
+                              (memq (char-after) '(?\; ?\,))
                               (goto-char (car decl-or-cast))
-                              (setq decl-res (c-forward-declarator))
-                              (setq identifier-ok
-                                    (member (buffer-substring-no-properties
-                                       (car decl-res) (cadr decl-res))
-                                      ids))
-                              (progn
-                                (goto-char after-prec-token)
-                                (prog1 (< (point) here)
-                                  (c-forward-syntactic-ws))))
-                        (setq identifier-ok nil))
-                      identifier-ok))
+                              (save-excursion
+                                (setq semi-position+1
+                                      (c-syntactic-re-search-forward
+                                       ";" (+ (point) 1000) t)))
+                              (c-do-declarators
+                               semi-position+1 t nil nil
+                               (lambda (id-start id-end _next _not-top
+                                                 _func _init)
+                                 (if (not (member
+                                           (buffer-substring-no-properties
+                                            id-start id-end)
+                                           ids))
+                                     (throw 'knr nil))))
+
+                              (progn (forward-char)
+                                     (<= (point) here))
+                              (progn (c-forward-syntactic-ws)
+                                     t)))
+                      t))
                    ;; ...Yes.  We've identified the function's argument list.
                    (throw 'knr
                           (progn (goto-char after-rparen)
@@ -11123,6 +11180,7 @@ comment at the start of cc-engine.el for more info."
                  (c-backward-syntactic-ws lim)
                  (not (or (memq (char-before) '(?\; ?} ?: nil))
                           (c-at-vsemi-p))))
+               (not (and lim (<= (point) lim)))
                (save-excursion
                  (backward-char)
                  (not (looking-at "\\s(")))
@@ -11561,6 +11619,194 @@ comment at the start of cc-engine.el for more info."
     (or (looking-at c-brace-list-key)
        (progn (goto-char here) nil))))
 
+(defun c-laomib-loop (lim)
+  ;; The "expensive" loop from `c-looking-at-or-maybe-in-bracelist'.  Move
+  ;; backwards over comma separated sexps as far as possible, but no further
+  ;; than LIM, which may be nil, meaning no limit.  Return the final value of
+  ;; `braceassignp', which is t if we encountered "= {", usually nil
+  ;; otherwise.
+  (let ((braceassignp 'dontknow)
+         (class-key
+          ;; Pike can have class definitions anywhere, so we must
+          ;; check for the class key here.
+          (and (c-major-mode-is 'pike-mode)
+               c-decl-block-key)))
+    (while (eq braceassignp 'dontknow)
+      (cond ((eq (char-after) ?\;)
+            (setq braceassignp nil))
+           ((and class-key
+                 (looking-at class-key))
+            (setq braceassignp nil))
+           ((and c-has-compound-literals
+                 (looking-at c-return-key))
+            (setq braceassignp t)
+            nil)
+           ((eq (char-after) ?=)
+            ;; We've seen a =, but must check earlier tokens so
+            ;; that it isn't something that should be ignored.
+            (setq braceassignp 'maybe)
+            (while (and (eq braceassignp 'maybe)
+                        (zerop (c-backward-token-2 1 t lim)))
+              (setq braceassignp
+                    (cond
+                     ;; Check for operator =
+                     ((and c-opt-op-identifier-prefix
+                           (looking-at c-opt-op-identifier-prefix))
+                      nil)
+                     ;; Check for `<opchar>= in Pike.
+                     ((and (c-major-mode-is 'pike-mode)
+                           (or (eq (char-after) ?`)
+                               ;; Special case for Pikes
+                               ;; `[]=, since '[' is not in
+                               ;; the punctuation class.
+                               (and (eq (char-after) ?\[)
+                                    (eq (char-before) ?`))))
+                      nil)
+                     ((looking-at "\\s.") 'maybe)
+                     ;; make sure we're not in a C++ template
+                     ;; argument assignment
+                     ((and
+                       (c-major-mode-is 'c++-mode)
+                       (save-excursion
+                         (let ((here (point))
+                               (pos< (progn
+                                       (skip-chars-backward "^<>")
+                                       (point))))
+                           (and (eq (char-before) ?<)
+                                (not (c-crosses-statement-barrier-p
+                                      pos< here))
+                                (not (c-in-literal))
+                                ))))
+                      nil)
+                     (t t)))))
+           ((and
+             (c-major-mode-is 'c++-mode)
+             (eq (char-after) ?\[)
+             ;; Be careful of "operator []"
+             (not (save-excursion
+                    (c-backward-token-2 1 nil lim)
+                    (looking-at c-opt-op-identifier-prefix))))
+            (setq braceassignp t)
+            nil))
+      (when (eq braceassignp 'dontknow)
+       (cond ((and
+               (not (eq (char-after) ?,))
+               (save-excursion
+                 (c-backward-syntactic-ws)
+                 (eq (char-before) ?})))
+              (setq braceassignp nil))
+             ((/= (c-backward-token-2 1 t lim) 0)
+              (if (save-excursion
+                    (and c-has-compound-literals
+                         (eq (c-backward-token-2 1 nil lim) 0)
+                         (eq (char-after) ?\()))
+                  (setq braceassignp t)
+                (setq braceassignp nil))))))
+    braceassignp))
+
+;; The following variable is a cache of up to four entries, each entry of
+;; which is a list representing a call to c-laomib-loop.  It contains the
+;; following elements:
+;; 0: `lim' argument - used as an alist key, never nil.
+;; 1: Position in buffer where the scan started.
+;; 2: Position in buffer where the scan ended.
+;; 3: Result of the call to `c-laomib-loop'.
+(defvar c-laomib-cache nil)
+(make-variable-buffer-local 'c-laomib-cache)
+
+(defun c-laomib-get-cache (containing-sexp)
+  ;; Get an element from `c-laomib-cache' matching CONTAINING-SEXP.
+  ;; Return that element or nil if one wasn't found.
+  (let ((elt (assq containing-sexp c-laomib-cache)))
+    (when elt
+      ;; Move the fetched `elt' to the front of the cache.
+      (setq c-laomib-cache (delq elt c-laomib-cache))
+      (push elt c-laomib-cache)
+      elt)))
+
+(defun c-laomib-put-cache (lim start end result)
+  ;; Insert a new element into `c-laomib-cache', removing another element to
+  ;; make room, if necessary.  The four parameters LIM, START, END, RESULT are
+  ;; the components of the new element (see comment for `c-laomib-cache').
+  ;; The return value is of no significance.
+  (when lim
+    (let ((old-elt (assq lim c-laomib-cache))
+         ;; (elt (cons containing-sexp (cons start nil)))
+         (new-elt (list lim start end result))
+         big-ptr
+         (cur-ptr c-laomib-cache)
+         togo (size 0) cur-size
+         )
+      (if old-elt (setq c-laomib-cache (delq old-elt c-laomib-cache)))
+
+      (while (>= (length c-laomib-cache) 4)
+       ;; We delete the least recently used elt which doesn't enclose START,
+       ;; or..
+       (dolist (elt c-laomib-cache)
+         (if (or (<= start (cadr elt))
+                 (> start (car (cddr elt))))
+             (setq togo elt)))
+
+       ;; ... delete the least recently used elt which isn't the biggest.
+       (when (not togo)
+         (while (cdr cur-ptr)
+           (setq cur-size (- (nth 2 (cadr cur-ptr)) (car (cadr cur-ptr))))
+           (when (> cur-size size)
+             (setq size cur-size
+                   big-ptr cur-ptr))
+           (setq cur-ptr (cdr cur-ptr)))
+         (setq togo (if (cddr big-ptr)
+                        (car (last big-ptr))
+                      (car big-ptr))))
+
+       (setq c-laomib-cache (delq togo c-laomib-cache)))
+
+      (push new-elt c-laomib-cache))))
+
+(defun c-laomib-fix-elt (lwm elt paren-state)
+  ;; Correct a c-laomib-cache entry ELT with respect to buffer changes, either
+  ;; doing nothing, signalling it is to be deleted, or replacing its start
+  ;; point with one lower in the buffer than LWM.  PAREN-STATE is the paren
+  ;; state at LWM.  Return the corrected entry, or nil (if it needs deleting).
+  ;; Note that corrections are made by `setcar'ing the original structure,
+  ;; which thus remains intact.
+  (cond
+   ((or (not lwm) (> lwm (cadr elt)))
+    elt)
+   ((<= lwm (nth 2 elt))
+    nil)
+   (t
+    ;; Search for the last brace in `paren-state' before (car `lim').  This
+    ;; brace will become our new 2nd element of `elt'.
+    (while
+       ;; Search one brace level per iteration.
+       (and paren-state
+            (progn
+              ;; (setq cur-brace (c-laomib-next-BRACE paren-state))
+              (while
+                  ;; Go past non-brace levels, one per iteration.
+                  (and paren-state
+                       (not (eq (char-after
+                                 (c-state-cache-top-lparen paren-state))
+                                ?{)))
+                (setq paren-state (cdr paren-state)))
+              (cadr paren-state))
+            (> (c-state-cache-top-lparen (cdr paren-state)) (car elt)))
+      (setq paren-state (cdr paren-state)))
+    (when (cadr paren-state)
+      (setcar (cdr elt) (c-state-cache-top-lparen paren-state))
+      elt))))
+
+(defun c-laomib-invalidate-cache (beg _end)
+  ;; Called from late in c-before-change.  Amend `c-laomib-cache' to remove
+  ;; details pertaining to the buffer after position BEG.
+  (save-excursion
+    (goto-char beg)
+    (let ((paren-state (c-parse-state)))
+      (dolist (elt c-laomib-cache)
+       (when (not (c-laomib-fix-elt beg elt paren-state))
+         (setq c-laomib-cache (delq elt c-laomib-cache)))))))
+
 (defun c-looking-at-or-maybe-in-bracelist (&optional containing-sexp lim)
   ;; Point is at an open brace.  If this starts a brace list, return a list
   ;; whose car is the buffer position of the start of the construct which
@@ -11581,14 +11827,10 @@ comment at the start of cc-engine.el for more info."
   ;; Here, "brace list" does not include the body of an enum.
   (save-excursion
     (let ((start (point))
-         (class-key
-          ;; Pike can have class definitions anywhere, so we must
-          ;; check for the class key here.
-          (and (c-major-mode-is 'pike-mode)
-               c-decl-block-key))
          (braceassignp 'dontknow)
          inexpr-brace-list bufpos macro-start res pos after-type-id-pos
-         in-paren parens-before-brace)
+         in-paren parens-before-brace
+         paren-state paren-pos)
 
       (setq res (c-backward-token-2 1 t lim))
       ;; Checks to do only on the first sexp before the brace.
@@ -11597,8 +11839,10 @@ comment at the start of cc-engine.el for more info."
               (cond
                ((and (or (not (eq res 0))
                          (eq (char-after) ?,))
-                     (c-go-up-list-backward nil lim) ; FIXME!!! Check ; `lim' 
2016-07-12.
-                     (eq (char-after) ?\())
+                     (setq paren-state (c-parse-state))
+                     (setq paren-pos (c-pull-open-brace paren-state))
+                     (eq (char-after paren-pos) ?\())
+                (goto-char paren-pos)
                 (setq braceassignp 'c++-noassign
                       in-paren 'in-paren))
                ((looking-at c-pre-id-bracelist-key)
@@ -11615,9 +11859,11 @@ comment at the start of cc-engine.el for more info."
                 (cond
                  ((or (not (eq res 0))
                       (eq (char-after) ?,))
-                  (and (c-go-up-list-backward nil lim) ; FIXME!!! Check `lim' 
2016-07-12.
-                       (eq (char-after) ?\()
-                       (setq in-paren 'in-paren)))
+                  (and (setq paren-state (c-parse-state))
+                       (setq paren-pos (c-pull-open-brace paren-state))
+                       (eq (char-after paren-pos) ?\()
+                       (setq in-paren 'in-paren)
+                       (goto-char paren-pos)))
                  ((looking-at c-pre-id-bracelist-key))
                  ((looking-at c-return-key))
                  (t (setq after-type-id-pos (point))
@@ -11670,79 +11916,36 @@ comment at the start of cc-engine.el for more info."
 
        (t
        (goto-char pos)
-       ;; Checks to do on all sexps before the brace, up to the
-       ;; beginning of the statement.
-       (while (eq braceassignp 'dontknow)
-         (cond ((eq (char-after) ?\;)
-                (setq braceassignp nil))
-               ((and class-key
-                     (looking-at class-key))
-                (setq braceassignp nil))
-               ((and c-has-compound-literals
-                     (looking-at c-return-key))
-                (setq braceassignp t)
-                nil)
-               ((eq (char-after) ?=)
-                ;; We've seen a =, but must check earlier tokens so
-                ;; that it isn't something that should be ignored.
-                (setq braceassignp 'maybe)
-                (while (and (eq braceassignp 'maybe)
-                            (zerop (c-backward-token-2 1 t lim)))
-                  (setq braceassignp
-                        (cond
-                         ;; Check for operator =
-                         ((and c-opt-op-identifier-prefix
-                               (looking-at c-opt-op-identifier-prefix))
-                          nil)
-                         ;; Check for `<opchar>= in Pike.
-                         ((and (c-major-mode-is 'pike-mode)
-                               (or (eq (char-after) ?`)
-                                   ;; Special case for Pikes
-                                   ;; `[]=, since '[' is not in
-                                   ;; the punctuation class.
-                                   (and (eq (char-after) ?\[)
-                                        (eq (char-before) ?`))))
-                          nil)
-                         ((looking-at "\\s.") 'maybe)
-                         ;; make sure we're not in a C++ template
-                         ;; argument assignment
-                         ((and
-                           (c-major-mode-is 'c++-mode)
-                           (save-excursion
-                             (let ((here (point))
-                                   (pos< (progn
-                                           (skip-chars-backward "^<>")
-                                           (point))))
-                               (and (eq (char-before) ?<)
-                                    (not (c-crosses-statement-barrier-p
-                                          pos< here))
-                                    (not (c-in-literal))
-                                    ))))
-                          nil)
-                         (t t)))))
-               ((and
-                 (c-major-mode-is 'c++-mode)
-                 (eq (char-after) ?\[)
-                ;; Be careful of "operator []"
-                 (not (save-excursion
-                        (c-backward-token-2 1 nil lim)
-                        (looking-at c-opt-op-identifier-prefix))))
-                (setq braceassignp t)
-                nil))
-         (when (eq braceassignp 'dontknow)
-           (cond ((and
-                   (not (eq (char-after) ?,))
-                   (save-excursion
-                     (c-backward-syntactic-ws)
-                     (eq (char-before) ?})))
-                  (setq braceassignp nil))
-                 ((/= (c-backward-token-2 1 t lim) 0)
-                  (if (save-excursion
-                        (and c-has-compound-literals
-                             (eq (c-backward-token-2 1 nil lim) 0)
-                             (eq (char-after) ?\()))
-                      (setq braceassignp t)
-                    (setq braceassignp nil))))))
+       (when (eq braceassignp 'dontknow)
+         (let* ((cache-entry (and containing-sexp
+                                  (c-laomib-get-cache containing-sexp)))
+                (lim2 (or (cadr cache-entry) lim))
+                sub-bassign-p)
+           (if cache-entry
+               (cond
+                ((<= (point) (cadr cache-entry))
+                 ;; We're inside the region we've already scanned over, so
+                 ;; just go to that scan's end position.
+                 (goto-char (nth 2 cache-entry))
+                 (setq braceassignp (nth 3 cache-entry)))
+                ((> (point) (cadr cache-entry))
+                 ;; We're beyond the previous scan region, so just scan as
+                 ;; far as the end of that region.
+                 (setq sub-bassign-p (c-laomib-loop lim2))
+                 (if (<= (point) (cadr cache-entry))
+                     (progn
+                       (c-laomib-put-cache containing-sexp
+                                           start (nth 2 cache-entry)
+                                           (nth 3 cache-entry) ;; sub-bassign-p
+                                           )
+                       (setq braceassignp (nth 3 cache-entry))
+                       (goto-char (nth 2 cache-entry)))
+                   (setq braceassignp sub-bassign-p)))
+                (t))
+
+             (setq braceassignp (c-laomib-loop lim))
+             (when lim
+               (c-laomib-put-cache lim start (point) braceassignp)))))
 
        (cond
         (braceassignp
@@ -12012,7 +12215,7 @@ comment at the start of cc-engine.el for more info."
        (goto-char haskell-op-pos))
 
       (while (and (eq res 'maybe)
-                 (progn (c-backward-syntactic-ws)
+                 (progn (c-backward-syntactic-ws lim)
                         (> (point) closest-lim))
                  (not (bobp))
                  (progn (backward-char)
@@ -12717,7 +12920,7 @@ comment at the start of cc-engine.el for more info."
         literal char-before-ip before-ws-ip char-after-ip macro-start
         in-macro-expr c-syntactic-context placeholder
         step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos
-        containing-<
+        tmp-pos2 containing-<
         ;; The following record some positions for the containing
         ;; declaration block if we're directly within one:
         ;; `containing-decl-open' is the position of the open
@@ -12783,7 +12986,7 @@ comment at the start of cc-engine.el for more info."
                  (setq paren-state (cons containing-sexp paren-state)
                        containing-sexp nil)))
              (setq lim (1+ containing-sexp))))
-       (setq lim (point-min)))
+       (setq lim (c-determine-limit 1000)))
 
       ;; If we're in a parenthesis list then ',' delimits the
       ;; "statements" rather than being an operator (with the
@@ -13025,7 +13228,9 @@ comment at the start of cc-engine.el for more info."
        ;; CASE 4: In-expression statement.  C.f. cases 7B, 16A and
        ;; 17E.
        ((setq placeholder (c-looking-at-inexpr-block
-                          (c-safe-position containing-sexp paren-state)
+                          (or
+                           (c-safe-position containing-sexp paren-state)
+                           (c-determine-limit 1000 containing-sexp))
                           containing-sexp
                           ;; Have to turn on the heuristics after
                           ;; the point even though it doesn't work
@@ -13150,7 +13355,8 @@ comment at the start of cc-engine.el for more info."
         ;; init lists can, in practice, be very large.
         ((save-excursion
            (when (and (c-major-mode-is 'c++-mode)
-                      (setq placeholder (c-back-over-member-initializers)))
+                      (setq placeholder (c-back-over-member-initializers
+                                         lim)))
              (setq tmp-pos (point))))
          (if (= (c-point 'bosws) (1+ tmp-pos))
                (progn
@@ -13469,7 +13675,7 @@ comment at the start of cc-engine.el for more info."
         ;; CASE 5I: ObjC method definition.
         ((and c-opt-method-key
               (looking-at c-opt-method-key))
-         (c-beginning-of-statement-1 nil t)
+         (c-beginning-of-statement-1 (c-determine-limit 1000) t)
          (if (= (point) indent-point)
              ;; Handle the case when it's the first (non-comment)
              ;; thing in the buffer.  Can't look for a 'same return
@@ -13542,7 +13748,16 @@ comment at the start of cc-engine.el for more info."
                          (if (>= (point) indent-point)
                              (throw 'not-in-directive t))
                          (setq placeholder (point)))
-                       nil)))))
+                       nil))
+                (and macro-start
+                     (not (c-beginning-of-statement-1 lim nil nil nil t))
+                     (setq placeholder
+                           (let ((ps-top (car paren-state)))
+                             (if (consp ps-top)
+                                 (progn
+                                   (goto-char (cdr ps-top))
+                                   (c-forward-syntactic-ws indent-point))
+                               (point-min))))))))
          ;; For historic reasons we anchor at bol of the last
          ;; line of the previous declaration.  That's clearly
          ;; highly bogus and useless, and it makes our lives hard
@@ -13591,31 +13806,47 @@ comment at the start of cc-engine.el for more info."
               (eq (char-before) ?<)
               (not (and c-overloadable-operators-regexp
                         (c-after-special-operator-id lim))))
-         (c-beginning-of-statement-1 (c-safe-position (point) paren-state))
+         (c-beginning-of-statement-1
+          (or
+           (c-safe-position (point) paren-state)
+           (c-determine-limit 1000)))
          (c-add-syntax 'template-args-cont (c-point 'boi)))
 
         ;; CASE 5Q: we are at a statement within a macro.
-        (macro-start
-         (c-beginning-of-statement-1 containing-sexp)
+        ((and
+          macro-start
+          (save-excursion
+            (prog1
+                (not (eq (c-beginning-of-statement-1
+                          (or containing-sexp (c-determine-limit 1000))
+                          nil nil nil t)
+                         nil)))
+              (setq placeholder (point))))
+         (goto-char placeholder)
          (c-add-stmt-syntax 'statement nil t containing-sexp paren-state))
 
-        ;;CASE 5N: We are at a topmost continuation line and the only
+        ;;CASE 5S: We are at a topmost continuation line and the only
         ;;preceding items are annotations.
         ((and (c-major-mode-is 'java-mode)
               (setq placeholder (point))
-              (c-beginning-of-statement-1)
+              (c-beginning-of-statement-1 lim)
               (progn
-                (while (and (c-forward-annotation))
-                  (c-forward-syntactic-ws))
+                (while (and (setq tmp-pos (point))
+                            (< (point) placeholder)
+                            (c-forward-annotation))
+                  (c-forward-syntactic-ws)
+                  (setq tmp-pos2 tmp-pos))
                 t)
               (prog1
                   (>= (point) placeholder)
                 (goto-char placeholder)))
-         (c-add-syntax 'annotation-top-cont (c-point 'boi)))
+         (c-add-syntax 'annotation-top-cont (c-point 'boi tmp-pos2)))
 
         ;; CASE 5M: we are at a topmost continuation line
         (t
-         (c-beginning-of-statement-1 (c-safe-position (point) paren-state))
+         (c-beginning-of-statement-1
+          (or (c-safe-position (point) paren-state)
+              (c-determine-limit 1000)))
          (when (c-major-mode-is 'objc-mode)
            (setq placeholder (point))
            (while (and (c-forward-objc-directive)
@@ -13671,8 +13902,9 @@ comment at the start of cc-engine.el for more info."
                   (setq tmpsymbol '(block-open . inexpr-statement)
                         placeholder
                         (cdr-safe (c-looking-at-inexpr-block
-                                   (c-safe-position containing-sexp
-                                                    paren-state)
+                                   (or
+                                    (c-safe-position containing-sexp 
paren-state)
+                                    (c-determine-limit 1000 containing-sexp))
                                    containing-sexp)))
                   ;; placeholder is nil if it's a block directly in
                   ;; a function arglist.  That makes us skip out of
@@ -13804,7 +14036,9 @@ comment at the start of cc-engine.el for more info."
                          (setq placeholder (c-guess-basic-syntax))))
              (setq c-syntactic-context placeholder)
            (c-beginning-of-statement-1
-            (c-safe-position (1- containing-sexp) paren-state))
+            (or
+             (c-safe-position (1- containing-sexp) paren-state)
+             (c-determine-limit 1000 (1- containing-sexp))))
            (c-forward-token-2 0)
            (while (cond
                    ((looking-at c-specifier-key)
@@ -13838,7 +14072,8 @@ comment at the start of cc-engine.el for more info."
              (c-add-syntax 'brace-list-close (point))
            (setq lim (or (save-excursion
                            (and
-                            (c-back-over-member-initializers)
+                            (c-back-over-member-initializers
+                             (c-determine-limit 1000))
                             (point)))
                          (c-most-enclosing-brace state-cache (point))))
            (c-beginning-of-statement-1 lim nil nil t)
@@ -13871,7 +14106,8 @@ comment at the start of cc-engine.el for more info."
                (c-add-syntax 'brace-list-intro (point))
              (setq lim (or (save-excursion
                              (and
-                              (c-back-over-member-initializers)
+                              (c-back-over-member-initializers
+                               (c-determine-limit 1000))
                               (point)))
                            (c-most-enclosing-brace state-cache (point))))
              (c-beginning-of-statement-1 lim nil nil t)
@@ -13927,7 +14163,9 @@ comment at the start of cc-engine.el for more info."
         ;; CASE 16A: closing a lambda defun or an in-expression
         ;; block?  C.f. cases 4, 7B and 17E.
         ((setq placeholder (c-looking-at-inexpr-block
-                            (c-safe-position containing-sexp paren-state)
+                            (or
+                             (c-safe-position containing-sexp paren-state)
+                             (c-determine-limit 1000 containing-sexp))
                             nil))
          (setq tmpsymbol (if (eq (car placeholder) 'inlambda)
                              'inline-close
@@ -14090,7 +14328,9 @@ comment at the start of cc-engine.el for more info."
         ;; CASE 17E: first statement in an in-expression block.
         ;; C.f. cases 4, 7B and 16A.
         ((setq placeholder (c-looking-at-inexpr-block
-                            (c-safe-position containing-sexp paren-state)
+                            (or
+                             (c-safe-position containing-sexp paren-state)
+                             (c-determine-limit 1000 containing-sexp))
                             nil))
          (setq tmpsymbol (if (eq (car placeholder) 'inlambda)
                              'defun-block-intro
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index bb7e5be..4e28376 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1,6 +1,6 @@
 ;;; cc-fonts.el --- font lock support for CC Mode
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Authors:    2003- Alan Mackenzie
 ;;             2002- Martin Stjernholm
@@ -76,9 +76,6 @@
 (cc-require-when-compile 'cc-langs)
 (cc-require 'cc-vars)
 (cc-require 'cc-engine)
-(cc-require-when-compile 'cc-awk) ; Change from cc-require, 2003/6/18 to
-;; prevent cc-awk being loaded when it's not needed.  There is now a (require
-;; 'cc-awk) in (defun awk-mode ..).
 
 ;; Avoid repeated loading through the eval-after-load directive in
 ;; cc-mode.el.
@@ -947,7 +944,7 @@ casts and declarations are fontified.  Used on level 2 and 
higher."
     ;; closest token before the region.
     (save-excursion
       (let ((pos (point)))
-       (c-backward-syntactic-ws)
+       (c-backward-syntactic-ws (max (- (point) 500) (point-min)))
        (c-clear-char-properties
         (if (and (not (bobp))
                  (memq (c-get-char-property (1- (point)) 'c-type)
@@ -969,7 +966,7 @@ casts and declarations are fontified.  Used on level 2 and 
higher."
     ;; The declared identifiers are font-locked correctly as types, if
     ;; that is what they are.
     (let ((prop (save-excursion
-                 (c-backward-syntactic-ws)
+                 (c-backward-syntactic-ws (max (- (point) 500) (point-min)))
                  (unless (bobp)
                    (c-get-char-property (1- (point)) 'c-type)))))
       (when (memq prop '(c-decl-id-start c-decl-type-start))
@@ -1008,66 +1005,75 @@ casts and declarations are fontified.  Used on level 2 
and higher."
             (boundp 'parse-sexp-lookup-properties)))
          (c-parse-and-markup-<>-arglists t)
          c-restricted-<>-arglists
-         id-start id-end id-face pos kwd-sym)
+         id-start id-end id-face pos kwd-sym
+         old-pos)
 
       (while (and (< (point) limit)
-                 (re-search-forward c-opt-<>-arglist-start limit t))
-
-       (setq id-start (match-beginning 1)
-             id-end (match-end 1)
-             pos (point))
-
-       (goto-char id-start)
-       (unless (c-skip-comments-and-strings limit)
-         (setq kwd-sym nil
-               c-restricted-<>-arglists nil
-               id-face (get-text-property id-start 'face))
-
-         (if (cond
-              ((eq id-face 'font-lock-type-face)
-               ;; The identifier got the type face so it has already been
-               ;; handled in `c-font-lock-declarations'.
-               nil)
-
-              ((eq id-face 'font-lock-keyword-face)
-               (when (looking-at c-opt-<>-sexp-key)
-                 ;; There's a special keyword before the "<" that tells
-                 ;; that it's an angle bracket arglist.
-                 (setq kwd-sym (c-keyword-sym (match-string 1)))))
-
-              (t
-               ;; There's a normal identifier before the "<".  If we're not in
-               ;; a declaration context then we set `c-restricted-<>-arglists'
-               ;; to avoid recognizing templates in function calls like "foo (a
-               ;; < b, c > d)".
-               (c-backward-syntactic-ws)
-               (when (and (memq (char-before) '(?\( ?,))
-                          (not (eq (get-text-property (1- (point)) 'c-type)
-                                   'c-decl-arg-start)))
-                 (setq c-restricted-<>-arglists t))
-               t))
+                 (setq old-pos (point))
+                 (c-syntactic-re-search-forward "<" limit t nil t))
+       (setq pos (point))
+       (save-excursion
+         (backward-char)
+         (c-backward-syntactic-ws old-pos)
+         (if (re-search-backward
+              (concat "\\(\\`\\|" c-nonsymbol-key "\\)\\(" 
c-symbol-key"\\)\\=")
+              old-pos t)
+             (setq id-start (match-beginning 2)
+                   id-end (match-end 2))
+           (setq id-start nil id-end nil)))
+
+       (when id-start
+         (goto-char id-start)
+         (unless (c-skip-comments-and-strings limit)
+           (setq kwd-sym nil
+                 c-restricted-<>-arglists nil
+                 id-face (get-text-property id-start 'face))
+
+           (if (cond
+                ((eq id-face 'font-lock-type-face)
+                 ;; The identifier got the type face so it has already been
+                 ;; handled in `c-font-lock-declarations'.
+                 nil)
 
-             (progn
-               (goto-char (1- pos))
-               ;; Check for comment/string both at the identifier and
-               ;; at the "<".
-               (unless (c-skip-comments-and-strings limit)
-
-                 (c-fontify-types-and-refs ()
-                   (when (c-forward-<>-arglist (c-keyword-member
-                                                kwd-sym 'c-<>-type-kwds))
-                     (when (and c-opt-identifier-concat-key
-                                (not (get-text-property id-start 'face)))
-                       (c-forward-syntactic-ws)
-                       (cond ((looking-at c-opt-identifier-concat-key)
-                              (c-put-font-lock-face id-start id-end
-                                                    c-reference-face-name))
-                             ((eq (char-after) ?\())
-                             (t (c-put-font-lock-face id-start id-end
-                                                      
'font-lock-type-face))))))
-
-                 (goto-char pos)))
-           (goto-char pos))))))
+                ((eq id-face 'font-lock-keyword-face)
+                 (when (looking-at c-opt-<>-sexp-key)
+                   ;; There's a special keyword before the "<" that tells
+                   ;; that it's an angle bracket arglist.
+                   (setq kwd-sym (c-keyword-sym (match-string 2)))))
+
+                (t
+                 ;; There's a normal identifier before the "<".  If we're not 
in
+                 ;; a declaration context then we set 
`c-restricted-<>-arglists'
+                 ;; to avoid recognizing templates in function calls like "foo 
(a
+                 ;; < b, c > d)".
+                 (c-backward-syntactic-ws)
+                 (when (and (memq (char-before) '(?\( ?,))
+                            (not (eq (get-text-property (1- (point)) 'c-type)
+                                     'c-decl-arg-start)))
+                   (setq c-restricted-<>-arglists t))
+                 t))
+
+               (progn
+                 (goto-char (1- pos))
+                 ;; Check for comment/string both at the identifier and
+                 ;; at the "<".
+                 (unless (c-skip-comments-and-strings limit)
+
+                   (c-fontify-types-and-refs ()
+                     (when (c-forward-<>-arglist (c-keyword-member
+                                                  kwd-sym 'c-<>-type-kwds))
+                       (when (and c-opt-identifier-concat-key
+                                  (not (get-text-property id-start 'face)))
+                         (c-forward-syntactic-ws)
+                         (cond ((looking-at c-opt-identifier-concat-key)
+                                (c-put-font-lock-face id-start id-end
+                                                      c-reference-face-name))
+                               ((eq (char-after) ?\())
+                               (t (c-put-font-lock-face id-start id-end
+                                                        
'font-lock-type-face))))))
+
+                   (goto-char pos)))
+             (goto-char pos)))))))
   nil)
 
 (defun c-font-lock-declarators (limit list types not-top
@@ -1496,7 +1502,8 @@ casts and declarations are fontified.  Used on level 2 
and higher."
 
                 ;; Check we haven't missed a preceding "typedef".
                 (when (not (looking-at c-typedef-key))
-                  (c-backward-syntactic-ws)
+                  (c-backward-syntactic-ws
+                   (max (- (point) 1000) (point-min)))
                   (c-backward-token-2)
                   (or (looking-at c-typedef-key)
                       (goto-char start-pos)))
@@ -1536,8 +1543,10 @@ casts and declarations are fontified.  Used on level 2 
and higher."
                                     (c-backward-token-2)
                                     (and
                                      (not (looking-at c-opt-<>-sexp-key))
-                                     (progn (c-backward-syntactic-ws)
-                                            (memq (char-before) '(?\( ?,)))
+                                     (progn
+                                       (c-backward-syntactic-ws
+                                        (max (- (point) 1000) (point-min)))
+                                       (memq (char-before) '(?\( ?,)))
                                      (not (eq (c-get-char-property (1- (point))
                                                                    'c-type)
                                               'c-decl-arg-start))))))
@@ -2295,7 +2304,8 @@ need for `c-font-lock-extra-types'.")
                  (and c-colon-type-list-re
                       (c-go-up-list-backward)
                       (eq (char-after) ?{)
-                      (eq (car (c-beginning-of-decl-1)) 'same)
+                      (eq (car (c-beginning-of-decl-1
+                                (c-determine-limit 1000))) 'same)
                       (looking-at c-colon-type-list-re)))
                ;; Inherited protected member: leave unfontified
                )
diff --git a/lisp/progmodes/cc-guess.el b/lisp/progmodes/cc-guess.el
index 8c4b381..1b852ec 100644
--- a/lisp/progmodes/cc-guess.el
+++ b/lisp/progmodes/cc-guess.el
@@ -1,6 +1,6 @@
 ;;; cc-guess.el --- guess indentation values by scanning existing code
 
-;; Copyright (C) 1985, 1987, 1992-2006, 2011-2020 Free Software
+;; Copyright (C) 1985, 1987, 1992-2006, 2011-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author:     1994-1995 Barry A. Warsaw
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index d6089ea..f4dcbcd 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -1,6 +1,6 @@
 ;;; cc-langs.el --- language specific settings for CC Mode -*- coding: utf-8 
-*-
 
-;; Copyright (C) 1985, 1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:    2002- Alan Mackenzie
 ;;             1998- Martin Stjernholm
@@ -457,13 +457,11 @@ so that all identifiers are recognized as words.")
        c-before-change-check-raw-strings
        c-before-change-check-<>-operators
        c-depropertize-CPP
-       c-invalidate-macro-cache
        c-truncate-bs-cache
        c-before-change-check-unbalanced-strings
        c-parse-quotes-before-change)
   (c objc) '(c-extend-region-for-CPP
             c-depropertize-CPP
-            c-invalidate-macro-cache
             c-truncate-bs-cache
             c-before-change-check-unbalanced-strings
             c-parse-quotes-before-change)
@@ -549,7 +547,7 @@ parameters (point-min), (point-max) and <buffer size>.")
 
 (c-lang-defconst c-before-context-fontification-functions
   t 'c-context-expand-fl-region
-  awk nil)
+  awk 'c-awk-context-expand-fl-region)
   ;; For documentation see the following c-lang-defvar of the same name.
   ;; The value here may be a list of functions or a single function.
 (c-lang-defvar c-before-context-fontification-functions
@@ -581,12 +579,14 @@ don't have EOL terminated statements. "
 (c-lang-defvar c-at-vsemi-p-fn (c-lang-const c-at-vsemi-p-fn))
 
 (c-lang-defconst c-vsemi-status-unknown-p-fn
-  "Contains a function \"are we unsure whether there is a virtual semicolon on 
this line?\".
-The (admittedly kludgy) purpose of such a function is to prevent an infinite
-recursion in c-beginning-of-statement-1 when point starts at a `while' token.
-The function MUST NOT UNDER ANY CIRCUMSTANCES call c-beginning-of-statement-1,
-even indirectly.  This variable contains nil for languages which don't have
-EOL terminated statements."
+  "Contains a predicate regarding the presence of virtual semicolons.
+More precisely, the function answers the question, \"are we unsure whether a
+virtual semicolon exists on this line?\".  The (admittedly kludgy) purpose of
+such a function is to prevent an infinite recursion in
+`c-beginning-of-statement-1' when point starts at a `while' token.  The 
function
+MUST NOT UNDER ANY CIRCUMSTANCES call `c-beginning-of-statement-1', even
+indirectly.  This variable contains nil for languages which don't have EOL
+terminated statements."
   t nil
   (c c++ objc) 'c-macro-vsemi-status-unknown-p
   awk 'c-awk-vsemi-status-unknown-p)
@@ -699,6 +699,7 @@ It's assumed to not contain any submatchers."
   ;; The same thing regarding Unicode identifiers applies here as to
   ;; `c-symbol-key'.
   t (concat "[" (c-lang-const c-nonsymbol-chars) "]"))
+(c-lang-defvar c-nonsymbol-key (c-lang-const c-nonsymbol-key))
 
 (c-lang-defconst c-identifier-ops
   "The operators that make up fully qualified identifiers.  nil in
diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el
index 97037de..0ff6efb 100644
--- a/lisp/progmodes/cc-menus.el
+++ b/lisp/progmodes/cc-menus.el
@@ -1,6 +1,6 @@
 ;;; cc-menus.el --- imenu support for CC Mode
 
-;; Copyright (C) 1985, 1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 5e8cf61..cfb23d0 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1,6 +1,6 @@
 ;;; cc-mode.el --- major mode for editing C and similar languages
 
-;; Copyright (C) 1985, 1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:    2003- Alan Mackenzie
 ;;             1998- Martin Stjernholm
@@ -113,6 +113,7 @@
 ;; Silence the compiler.
 (cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs
 (cc-bytecomp-defun run-mode-hooks)     ; Emacs 21.1
+(cc-bytecomp-defvar awk-mode-syntax-table)
 
 ;; We set this variable during mode init, yet we don't require
 ;; font-lock.
@@ -499,11 +500,14 @@ preferably use the `c-mode-menu' language constant 
directly."
   (save-excursion
     (when (< beg end)
       (goto-char beg)
+      (let ((lim (c-determine-limit 1000))
+           (lim+ (c-determine-+ve-limit 1000 end)))
       (when
          (and (not (bobp))
-              (progn (c-backward-syntactic-ws) (eq (point) beg))
+              (progn (c-backward-syntactic-ws lim) (eq (point) beg))
               (/= (skip-chars-backward c-symbol-chars (1- (point))) 0)
-              (progn (goto-char beg) (c-forward-syntactic-ws) (<= (point) end))
+              (progn (goto-char beg) (c-forward-syntactic-ws lim+)
+                     (<= (point) end))
               (> (point) beg)
               (goto-char end)
               (looking-at c-symbol-char-key))
@@ -514,14 +518,14 @@ preferably use the `c-mode-menu' language constant 
directly."
       (goto-char end)
       (when
          (and (not (eobp))
-              (progn (c-forward-syntactic-ws) (eq (point) end))
+              (progn (c-forward-syntactic-ws lim+) (eq (point) end))
               (looking-at c-symbol-char-key)
-              (progn (c-backward-syntactic-ws) (>= (point) beg))
+              (progn (c-backward-syntactic-ws lim) (>= (point) beg))
               (< (point) end)
               (/= (skip-chars-backward c-symbol-chars (1- (point))) 0))
        (goto-char (1+ end))
        (c-end-of-current-token)
-       (c-unfind-type (buffer-substring-no-properties end (point)))))))
+       (c-unfind-type (buffer-substring-no-properties end (point))))))))
 
 ;; c-maybe-stale-found-type records a place near the region being
 ;; changed where an element of `found-types' might become stale.  It
@@ -636,6 +640,8 @@ that requires a literal mode spec at compile time."
   ;; doesn't work with filladapt but it's better than nothing.
   (set (make-local-variable 'fill-paragraph-function) 'c-fill-paragraph)
 
+  ;; Initialize the cache for `c-looking-at-or-maybe-in-bracelist'.
+  (setq c-laomib-cache nil)
   ;; Initialize the three literal sub-caches.
   (c-truncate-lit-pos-cache 1)
   ;; Initialize the cache of brace pairs, and opening braces/brackets/parens.
@@ -725,8 +731,8 @@ that requires a literal mode spec at compile time."
 ;;   ;; Put submode indicators onto minor-mode-alist, but only once.
 ;;   (or (assq 'c-submode-indicators minor-mode-alist)
 ;;       (setq minor-mode-alist
-;;         (cons '(c-submode-indicators c-submode-indicators)
-;;               minor-mode-alist)))
+;;         (cons '(c-submode-indicators c-submode-indicators)
+;;               minor-mode-alist)))
   (c-update-modeline)
 
   ;; Install the functions that ensure that various internal caches
@@ -1252,7 +1258,7 @@ Note that the style variables are always made local to 
the buffer."
   ;; Set both the syntax-table and the c-fl-syn-tab text properties at POS to
   ;; VALUE (which should not be nil).
   ;; `(let ((-pos- ,pos)
-  ;;    (-value- ,value))
+  ;;    (-value- ,value))
   (c-put-char-property pos 'syntax-table value)
   (c-put-char-property pos 'c-fl-syn-tab value)
   (cond
@@ -1482,7 +1488,7 @@ Note that the style variables are always made local to 
the buffer."
           ((and
             (c-is-escaped end)
             (or (eq beg end) ; .... by inserting stuff between \ and \n?
-                (c-will-be-unescaped beg))) ;  ... by removing an odd number 
of \s?
+                (c-will-be-unescaped beg))) ;  ... by removing an odd number 
of \s?
            (goto-char (1+ end))) ; To after the NL which is being unescaped.
           (t
            (goto-char end)))
@@ -1996,7 +2002,7 @@ Note that this is a strict tail, so won't match, e.g. 
\"0x....\".")
                ;; We search for appropriate c-type properties "near"
                ;; the change.  First, find an appropriate boundary
                ;; for this property search.
-               (let (lim
+               (let (lim lim-2
                      type type-pos
                      marked-id term-pos
                      (end1
@@ -2007,8 +2013,11 @@ Note that this is a strict tail, so won't match, e.g. 
\"0x....\".")
                  (when (>= end1 beg) ; Don't hassle about changes entirely in
                                        ; comments.
                    ;; Find a limit for the search for a `c-type' property
+                   ;; Point is currently undefined.  A `goto-char' somewhere 
is needed.  (2020-12-06).
+                   (setq lim-2 (c-determine-limit 1000 (point) ; that is 
wrong.  FIXME!!!  (2020-12-06)
+                                                  ))
                    (while
-                       (and (/= (skip-chars-backward "^;{}") 0)
+                       (and (/= (skip-chars-backward "^;{}" lim-2) 0)
                             (> (point) (point-min))
                             (memq (c-get-char-property (1- (point)) 'face)
                                   '(font-lock-comment-face 
font-lock-string-face))))
@@ -2032,7 +2041,8 @@ Note that this is a strict tail, so won't match, e.g. 
\"0x....\".")
                                (buffer-substring-no-properties (point) 
type-pos)))
 
                        (goto-char end1)
-                       (skip-chars-forward "^;{}") ; FIXME!!!  loop for
+                       (setq lim-2 (c-determine-+ve-limit 1000))
+                       (skip-chars-forward "^;{}" lim-2) ; FIXME!!!  loop for
                                        ; comment, maybe
                        (setq lim (point))
                        (setq term-pos
@@ -2047,13 +2057,19 @@ Note that this is a strict tail, so won't match, e.g. 
\"0x....\".")
                (if c-get-state-before-change-functions
                    (mapc (lambda (fn)
                            (funcall fn beg end))
-                         c-get-state-before-change-functions))))
+                         c-get-state-before-change-functions))
+
+               (c-laomib-invalidate-cache beg end)))
          (c-clear-string-fences))))
     (c-truncate-lit-pos-cache beg)
     ;; The following must be done here rather than in `c-after-change'
     ;; because newly inserted parens would foul up the invalidation
     ;; algorithm.
-    (c-invalidate-state-cache beg)))
+    (c-invalidate-state-cache beg)
+    ;; The following must happen after the previous, which likely alters
+    ;; the macro cache.
+    (when c-opt-cpp-symbol
+      (c-invalidate-macro-cache beg end))))
 
 (defvar c-in-after-change-fontification nil)
 (make-variable-buffer-local 'c-in-after-change-fontification)
@@ -2198,7 +2214,8 @@ Note that this is a strict tail, so won't match, e.g. 
\"0x....\".")
        old-pos
        (new-pos pos)
        capture-opener
-       bod-lim bo-decl)
+       bod-lim bo-decl
+       paren-state containing-brace)
     (goto-char (c-point 'bol new-pos))
     (unless lit-start
       (setq bod-lim (c-determine-limit 500))
@@ -2217,12 +2234,16 @@ Note that this is a strict tail, so won't match, e.g. 
\"0x....\".")
           (setq old-pos (point))
           (let (pseudo)
             (while
-                (progn
-                  (c-syntactic-skip-backward "^;{}" bod-lim t)
-                  (and (eq (char-before) ?})
-                       (save-excursion
-                         (backward-char)
-                         (setq pseudo (c-cheap-inside-bracelist-p 
(c-parse-state))))))
+                (and
+                 ;; N.B. `c-syntactic-skip-backward' doesn't check (> (point)
+                 ;; lim) and can loop if that's not the case.
+                 (> (point) bod-lim)
+                 (progn
+                   (c-syntactic-skip-backward "^;{}" bod-lim t)
+                   (and (eq (char-before) ?})
+                        (save-excursion
+                          (backward-char)
+                          (setq pseudo (c-cheap-inside-bracelist-p 
(c-parse-state)))))))
               (goto-char pseudo))
             t)
           (> (point) bod-lim)
@@ -2255,7 +2276,14 @@ Note that this is a strict tail, so won't match, e.g. 
\"0x....\".")
                      (and (eq (char-before) ?{)
                           (save-excursion
                             (backward-char)
-                            (consp (c-looking-at-or-maybe-in-bracelist))))
+                            (setq paren-state (c-parse-state))
+                            (while
+                                (and
+                                 (setq containing-brace
+                                       (c-pull-open-brace paren-state))
+                                 (not (eq (char-after containing-brace) ?{))))
+                            (consp (c-looking-at-or-maybe-in-bracelist
+                                    containing-brace containing-brace))))
                      )))
           (not (bobp)))
        (backward-char))                ; back over (, [, <.
@@ -2270,9 +2298,11 @@ Note that this is a strict tail, so won't match, e.g. 
\"0x....\".")
   ;; preserved.
   (goto-char pos)
   (let ((lit-start (c-literal-start))
+       (lim (c-determine-limit 1000))
        enclosing-attribute pos1)
     (unless lit-start
-      (c-backward-syntactic-ws)
+      (c-backward-syntactic-ws
+       lim)
       (when (setq enclosing-attribute (c-enclosing-c++-attribute))
        (goto-char (car enclosing-attribute))) ; Only happens in C++ Mode.
       (when (setq pos1 (c-on-identifier))
@@ -2296,14 +2326,14 @@ Note that this is a strict tail, so won't match, e.g. 
\"0x....\".")
                           (setq pos1 (c-on-identifier))
                           (goto-char pos1)
                           (progn
-                            (c-backward-syntactic-ws)
+                            (c-backward-syntactic-ws lim)
                             (eq (char-before) ?\())
                           (c-fl-decl-end (1- (point))))
-                       (c-backward-syntactic-ws)
+                       (c-backward-syntactic-ws lim)
                        (point))))
                 (and (progn (c-forward-syntactic-ws lim)
                             (not (eobp)))
-                     (c-backward-syntactic-ws)
+                     (c-backward-syntactic-ws lim)
                      (point)))))))))
 
 (defun c-change-expand-fl-region (_beg _end _old-len)
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el
index 855e467..aec259f 100644
--- a/lisp/progmodes/cc-styles.el
+++ b/lisp/progmodes/cc-styles.el
@@ -1,6 +1,6 @@
 ;;; cc-styles.el --- support for styles in CC Mode
 
-;; Copyright (C) 1985, 1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:    2004- Alan Mackenzie
 ;;             1998- Martin Stjernholm
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 9e6f952..88ee092 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1,6 +1,6 @@
 ;;; cc-vars.el --- user customization variables for CC Mode
 
-;; Copyright (C) 1985, 1987, 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:    2002- Alan Mackenzie
 ;;             1998- Martin Stjernholm
@@ -575,7 +575,8 @@ comment styles:
 
  javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode).
  autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode).
- gtkdoc  -- GtkDoc style for \"/** ... **/\" comments (default in C and C++ 
modes).
+ gtkdoc  -- GtkDoc style for \"/** ... **/\" comments
+                                                  (default in C and C++ modes).
  doxygen -- Doxygen style.
 
 The value may also be a list of doc comment styles, in which case all
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index a8fe485..f516664 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -1,6 +1,6 @@
 ;;; cfengine.el --- mode for editing Cfengine files
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Maintainer: Ted Zlatanov <tzz@lifelogs.com>
@@ -1314,19 +1314,19 @@ see.  Use it by enabling `eldoc-mode'."
       (append bounds (list (cdr flist))))))
 
 (defun cfengine-common-settings ()
-  (set (make-local-variable 'syntax-propertize-function)
-       ;; In the main syntax-table, \ is marked as a punctuation, because
-       ;; of its use in DOS-style directory separators.  Here we try to
-       ;; recognize the cases where \ is used as an escape inside strings.
-       (syntax-propertize-rules ("\\(\\(?:\\\\\\)+\\)\"" (1 "\\"))))
-  (set (make-local-variable 'parens-require-spaces) nil)
-  (set (make-local-variable 'comment-start)  "# ")
-  (set (make-local-variable 'comment-start-skip)
-       "\\(\\(?:^\\|[^\\\n]\\)\\(?:\\\\\\\\\\)*\\)#+[ \t]*")
+  (setq-local syntax-propertize-function
+              ;; In the main syntax-table, \ is marked as a punctuation, 
because
+              ;; of its use in DOS-style directory separators.  Here we try to
+              ;; recognize the cases where \ is used as an escape inside 
strings.
+              (syntax-propertize-rules ("\\(\\(?:\\\\\\)+\\)\"" (1 "\\"))))
+  (setq-local parens-require-spaces nil)
+  (setq-local comment-start  "# ")
+  (setq-local comment-start-skip
+              "\\(\\(?:^\\|[^\\\n]\\)\\(?:\\\\\\\\\\)*\\)#+[ \t]*")
   ;; Like Lisp mode.  Without this, we lose with, say,
   ;; `backward-up-list' when there's an unbalanced quote in a
   ;; preceding comment.
-  (set (make-local-variable 'parse-sexp-ignore-comments) t))
+  (setq-local parse-sexp-ignore-comments t))
 
 (defun cfengine-common-syntax (table)
   ;; The syntax defaults seem OK to give reasonable word movement.
@@ -1374,7 +1374,7 @@ to the action header."
   (cfengine-common-settings)
   (cfengine-common-syntax cfengine3-mode-syntax-table)
 
-  (set (make-local-variable 'indent-line-function) #'cfengine3-indent-line)
+  (setq-local indent-line-function #'cfengine3-indent-line)
 
   (setq font-lock-defaults
         '(cfengine3-font-lock-keywords
@@ -1384,11 +1384,11 @@ to the action header."
   ;; `compile-command' is almost never a `make' call with CFEngine so
   ;; we override it
   (when cfengine-cf-promises
-    (set (make-local-variable 'compile-command)
-         (concat cfengine-cf-promises
-                 " -f "
-                 (when buffer-file-name
-                   (shell-quote-argument buffer-file-name)))))
+    (setq-local compile-command
+                (concat cfengine-cf-promises
+                        " -f "
+                        (when buffer-file-name
+                          (shell-quote-argument buffer-file-name)))))
 
   (add-hook 'eldoc-documentation-functions
             #'cfengine3-documentation-function nil t)
@@ -1418,20 +1418,18 @@ to the action header."
   ;; should avoid potential confusion in some cases.
   (modify-syntax-entry ?\` "\"" cfengine2-mode-syntax-table)
 
-  (set (make-local-variable 'indent-line-function) #'cfengine2-indent-line)
-  (set (make-local-variable 'outline-regexp) "[ \t]*\\(\\sw\\|\\s_\\)+:+")
-  (set (make-local-variable 'outline-level) #'cfengine2-outline-level)
-  (set (make-local-variable 'fill-paragraph-function)
-       #'cfengine-fill-paragraph)
+  (setq-local indent-line-function #'cfengine2-indent-line)
+  (setq-local outline-regexp "[ \t]*\\(\\sw\\|\\s_\\)+:+")
+  (setq-local outline-level #'cfengine2-outline-level)
+  (setq-local fill-paragraph-function #'cfengine-fill-paragraph)
   (define-abbrev-table 'cfengine2-mode-abbrev-table cfengine-mode-abbrevs)
   (setq font-lock-defaults
         '(cfengine2-font-lock-keywords nil nil nil beginning-of-line))
   ;; Fixme: set the args of functions in evaluated classes to string
   ;; syntax, and then obey syntax properties.
   (setq imenu-generic-expression cfengine2-imenu-expression)
-  (set (make-local-variable 'beginning-of-defun-function)
-       #'cfengine2-beginning-of-defun)
-  (set (make-local-variable 'end-of-defun-function) #'cfengine2-end-of-defun))
+  (setq-local beginning-of-defun-function #'cfengine2-beginning-of-defun)
+  (setq-local end-of-defun-function #'cfengine2-end-of-defun))
 
 ;;;###autoload
 (defun cfengine-auto-mode ()
diff --git a/lisp/progmodes/cl-font-lock.el b/lisp/progmodes/cl-font-lock.el
index cb6bd6c..178fe94 100644
--- a/lisp/progmodes/cl-font-lock.el
+++ b/lisp/progmodes/cl-font-lock.el
@@ -1,5 +1,5 @@
 ;;; cl-font-lock.el --- Pretty Common Lisp font locking -*- lexical-binding: 
t; -*-
-;; Copyright (C) 2019-2020  Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Yue Daian <sheepduke@gmail.com>
 ;; Maintainer: Spenser Truex <web@spensertruex.com>
diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el
index 78e0a5b..d3a33bd 100644
--- a/lisp/progmodes/cmacexp.el
+++ b/lisp/progmodes/cmacexp.el
@@ -1,6 +1,6 @@
 ;;; cmacexp.el --- expand C macros in a region
 
-;; Copyright (C) 1992, 1994, 1996, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1992, 1994, 1996, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Francesco Potortì <pot@gnu.org>
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 787f5d5..94e4f3c 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1,6 +1,6 @@
 ;;; compile.el --- run compiler as inferior of Emacs, parse error messages  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1987, 1993-1999, 2001-2020 Free Software
+;; Copyright (C) 1985-1987, 1993-1999, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Authors: Roland McGrath <roland@gnu.org>,
@@ -241,11 +241,20 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
     ;; GradleStyleMessagerRenderer.kt in kotlin sources, see
     ;; https://youtrack.jetbrains.com/issue/KT-34683).
     (gradle-kotlin
-     ,(concat
-       "^\\(?:\\(w\\)\\|.\\): *"            ;type
-       "\\(\\(?:[A-Za-z]:\\)?[^:\n]+\\): *" ;file
-       "(\\([0-9]+\\), *\\([0-9]+\\))")     ;line, column
-     2 3 4 (1))
+     ,(rx bol
+          (| (group "w")                ; 1: warning
+             (group (in "iv"))          ; 2: info
+             "e")                       ; error
+          ": "
+          (group                        ; 3: file
+           (? (in "A-Za-z") ":")
+           (+ (not (in "\n:"))))
+          ": ("
+          (group (+ digit))             ; 4: line
+          ", "
+          (group (+ digit))             ; 5: column
+          "): ")
+     3 4 5 (1 . 2))
 
     (iar
      
"^\"\\(.*\\)\",\\([0-9]+\\)\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[0-9]+\\]:"
@@ -807,7 +816,7 @@ You might also use mode hooks to specify it in certain 
modes, like this:
        (lambda ()
         (unless (or (file-exists-p \"makefile\")
                     (file-exists-p \"Makefile\"))
-          (set (make-local-variable \\='compile-command)
+           (setq-local compile-command
                (concat \"make -k \"
                        (if buffer-file-name
                          (shell-quote-argument
@@ -1568,10 +1577,10 @@ to `compilation-error-regexp-alist' if RULES is nil."
                       (put-text-property
                        (match-beginning mn) (match-end mn)
                        'font-lock-face face))
-                    ((and (listp face)
-                          (eq (car face) 'face)
-                          (or (symbolp (cadr face))
-                              (stringp (cadr face))))
+                    ((and (listp face)
+                          (eq (car face) 'face)
+                          (or (symbolp (cadr face))
+                              (stringp (cadr face))))
                       (compilation--put-prop mn 'font-lock-face (cadr face))
                       (add-text-properties
                        (match-beginning mn) (match-end mn)
@@ -1839,14 +1848,13 @@ Returns the compilation buffer created."
         ;; default-directory' can't be used reliably for that because it may be
         ;; affected by the special handling of "cd ...;".
         ;; NB: must be done after (funcall mode) as that resets local variables
-        (set (make-local-variable 'compilation-directory) thisdir)
-       (set (make-local-variable 'compilation-environment) thisenv)
+        (setq-local compilation-directory thisdir)
+        (setq-local compilation-environment thisenv)
        (if highlight-regexp
-           (set (make-local-variable 'compilation-highlight-regexp)
-                highlight-regexp))
+            (setq-local compilation-highlight-regexp highlight-regexp))
         (if (or compilation-auto-jump-to-first-error
                (eq compilation-scroll-output 'first-error))
-            (set (make-local-variable 'compilation-auto-jump-to-next) t))
+            (setq-local compilation-auto-jump-to-next t))
        ;; Output a mode setter, for saving and later reloading this buffer.
        (insert "-*- mode: " name-of-mode
                "; default-directory: "
@@ -1868,13 +1876,13 @@ Returns the compilation buffer created."
       (let ((process-environment
             (append
              compilation-environment
-              (comint-term-environment)
+              (and (derived-mode-p 'comint-mode)
+                   (comint-term-environment))
              (list (format "INSIDE_EMACS=%s,compile" emacs-version))
              (copy-sequence process-environment))))
-       (set (make-local-variable 'compilation-arguments)
-            (list command mode name-function highlight-regexp))
-       (set (make-local-variable 'revert-buffer-function)
-            'compilation-revert-buffer)
+        (setq-local compilation-arguments
+                    (list command mode name-function highlight-regexp))
+        (setq-local revert-buffer-function 'compilation-revert-buffer)
        (and outwin
             ;; Forcing the window-start overrides the usual redisplay
             ;; feature of bringing point into view, so setting the
@@ -2179,20 +2187,19 @@ Runs `compilation-mode-hook' with `run-mode-hooks' 
(which see).
   (kill-all-local-variables)
   (use-local-map compilation-mode-map)
   ;; Let windows scroll along with the output.
-  (set (make-local-variable 'window-point-insertion-type) t)
-  (set (make-local-variable 'tool-bar-map) compilation-mode-tool-bar-map)
+  (setq-local window-point-insertion-type t)
+  (setq-local tool-bar-map compilation-mode-tool-bar-map)
   (setq major-mode 'compilation-mode ; FIXME: Use define-derived-mode.
        mode-name (or name-of-mode "Compilation"))
-  (set (make-local-variable 'page-delimiter)
-       compilation-page-delimiter)
-  ;; (set (make-local-variable 'compilation-buffer-modtime) nil)
+  (setq-local page-delimiter compilation-page-delimiter)
+  ;; (setq-local compilation-buffer-modtime nil)
   (compilation-setup)
   ;; Turn off deferred fontifications in the compilation buffer, if
   ;; the user turned them on globally.  This is because idle timers
   ;; aren't re-run after receiving input from a subprocess, so the
   ;; buffer is left unfontified after the compilation exits, until
   ;; some other input event happens.
-  (set (make-local-variable 'jit-lock-defer-time) nil)
+  (setq-local jit-lock-defer-time nil)
   (setq buffer-read-only t)
   (run-mode-hooks 'compilation-mode-hook))
 
@@ -2262,7 +2269,7 @@ Optional argument MINOR indicates this is called from
   (setq-local compilation-num-errors-found 0)
   (setq-local compilation-num-warnings-found 0)
   (setq-local compilation-num-infos-found 0)
-  (set (make-local-variable 'overlay-arrow-string) "")
+  (setq-local overlay-arrow-string "")
   (setq next-error-overlay-arrow-position nil)
   (add-hook 'kill-buffer-hook
            (lambda () (setq next-error-overlay-arrow-position nil)) nil t)
@@ -2270,10 +2277,10 @@ Optional argument MINOR indicates this is called from
   ;; with the next-error function in simple.el, and it's only
   ;; coincidentally named similarly to compilation-next-error.
   (setq next-error-function 'compilation-next-error-function)
-  (set (make-local-variable 'comint-file-name-prefix)
-       (or (file-remote-p default-directory) ""))
-  (set (make-local-variable 'compilation-locs)
-       (make-hash-table :test 'equal :weakness 'value))
+  (setq-local comint-file-name-prefix
+              (or (file-remote-p default-directory) ""))
+  (setq-local compilation-locs
+              (make-hash-table :test 'equal :weakness 'value))
   ;; It's generally preferable to use after-change-functions since they
   ;; can be subject to combine-after-change-calls, but if we do that, we risk
   ;; running our hook after font-lock, resulting in incorrect refontification.
@@ -2411,8 +2418,7 @@ and runs `compilation-filter-hook'."
               (set-marker (process-mark proc) (point))
               ;; Update the number of errors in compilation-mode-line-errors
               (compilation--ensure-parse (point))
-              ;; (set (make-local-variable 'compilation-buffer-modtime)
-              ;;      (current-time))
+              ;; (setq-local compilation-buffer-modtime (current-time))
               (run-hooks 'compilation-filter-hook))
          (goto-char pos)
           (narrow-to-region min max)
@@ -3166,9 +3172,9 @@ TRUE-DIRNAME is the `file-truename' of DIRNAME, if given."
   ;; Again, since this command is used in buffers that contain several
   ;; compilations, to set the beginning of "this compilation", it's a good
   ;; place to reset compilation-auto-jump-to-next.
-  (set (make-local-variable 'compilation-auto-jump-to-next)
-       (or compilation-auto-jump-to-first-error
-          (eq compilation-scroll-output 'first-error))))
+  (setq-local compilation-auto-jump-to-next
+              (or compilation-auto-jump-to-first-error
+                  (eq compilation-scroll-output 'first-error))))
 
 (provide 'compile)
 
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 48f0a34..d401513 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1,6 +1,6 @@
 ;;; cperl-mode.el --- Perl code editing commands for Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1985-1987, 1991-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1987, 1991-2021 Free Software Foundation, Inc.
 
 ;; Author: Ilya Zakharevich
 ;;     Bob Olson
@@ -232,7 +232,9 @@ Versions 5.2 ... 5.20 behaved as if this were nil."
   :group 'cperl-indentation-details)
 
 (defcustom cperl-indent-subs-specially t
-  "Non-nil means indent subs that are inside other blocks (hash values, for 
example) relative to the beginning of the \"sub\" keyword, rather than relative 
to the statement that contains the declaration."
+  "If non-nil, indent subs inside other blocks relative to \"sub\" keyword.
+Otherwise, indent them relative to statement that contains the declaration.
+This applies to, for example, hash values."
   :type 'boolean
   :group 'cperl-indentation-details)
 
@@ -1599,111 +1601,106 @@ or as help on variables `cperl-tips', 
`cperl-problems',
   ;; Until Emacs is multi-threaded, we do not actually need it local:
   (make-local-variable 'cperl-font-lock-multiline-start)
   (make-local-variable 'cperl-font-locking)
-  (set (make-local-variable 'outline-regexp) cperl-outline-regexp)
-  (set (make-local-variable 'outline-level) 'cperl-outline-level)
-  (set (make-local-variable 'add-log-current-defun-function)
-       (lambda ()
-         (save-excursion
-           (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t)
-               (match-string-no-properties 1)))))
-
-  (set (make-local-variable 'paragraph-start) (concat "^$\\|" page-delimiter))
-  (set (make-local-variable 'paragraph-separate) paragraph-start)
-  (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
-  (set (make-local-variable 'indent-line-function) #'cperl-indent-line)
-  (set (make-local-variable 'require-final-newline) mode-require-final-newline)
-  (set (make-local-variable 'comment-start) "# ")
-  (set (make-local-variable 'comment-end) "")
-  (set (make-local-variable 'comment-column) cperl-comment-column)
-  (set (make-local-variable 'comment-start-skip) "#+ *")
+  (setq-local outline-regexp cperl-outline-regexp)
+  (setq-local outline-level 'cperl-outline-level)
+  (setq-local add-log-current-defun-function
+              (lambda ()
+                (save-excursion
+                  (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t)
+                      (match-string-no-properties 1)))))
+
+  (setq-local paragraph-start (concat "^$\\|" page-delimiter))
+  (setq-local paragraph-separate paragraph-start)
+  (setq-local paragraph-ignore-fill-prefix t)
+  (setq-local indent-line-function #'cperl-indent-line)
+  (setq-local require-final-newline mode-require-final-newline)
+  (setq-local comment-start "# ")
+  (setq-local comment-end "")
+  (setq-local comment-column cperl-comment-column)
+  (setq-local comment-start-skip "#+ *")
 
 ;;       "[ \t]*sub"
 ;;       (cperl-after-sub-regexp 'named nil) ; 8=name 11=proto 14=attr-start
 ;;       cperl-maybe-white-and-comment-rex     ; 15=pre-block
-  (set (make-local-variable 'defun-prompt-regexp)
-       (concat "^[ \t]*\\("
-               cperl-sub-regexp
-              (cperl-after-sub-regexp 'named 'attr-groups)
-              "\\|"                    ; per toke.c
-              
"\\(BEGIN\\|UNITCHECK\\|CHECK\\|INIT\\|END\\|AUTOLOAD\\|DESTROY\\)"
-              "\\)"
-              cperl-maybe-white-and-comment-rex))
-  (set (make-local-variable 'comment-indent-function) #'cperl-comment-indent)
-  (set (make-local-variable 'fill-paragraph-function)
-       #'cperl-fill-paragraph)
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
-  (set (make-local-variable 'indent-region-function) #'cperl-indent-region)
+  (setq-local defun-prompt-regexp
+              (concat "^[ \t]*\\("
+                      cperl-sub-regexp
+                      (cperl-after-sub-regexp 'named 'attr-groups)
+                      "\\|"                    ; per toke.c
+                      
"\\(BEGIN\\|UNITCHECK\\|CHECK\\|INIT\\|END\\|AUTOLOAD\\|DESTROY\\)"
+                      "\\)"
+                      cperl-maybe-white-and-comment-rex))
+  (setq-local comment-indent-function #'cperl-comment-indent)
+  (setq-local fill-paragraph-function #'cperl-fill-paragraph)
+  (setq-local parse-sexp-ignore-comments t)
+  (setq-local indent-region-function #'cperl-indent-region)
   ;;(setq auto-fill-function #'cperl-do-auto-fill) ; Need to switch on and off!
-  (set (make-local-variable 'imenu-create-index-function)
-       #'cperl-imenu--create-perl-index)
-  (set (make-local-variable 'imenu-sort-function) nil)
-  (set (make-local-variable 'vc-rcs-header) cperl-vc-rcs-header)
-  (set (make-local-variable 'vc-sccs-header) cperl-vc-sccs-header)
+  (setq-local imenu-create-index-function #'cperl-imenu--create-perl-index)
+  (setq-local imenu-sort-function nil)
+  (setq-local vc-rcs-header cperl-vc-rcs-header)
+  (setq-local vc-sccs-header cperl-vc-sccs-header)
   (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x
-        (set (make-local-variable 'compilation-error-regexp-alist-alist)
-             (cons (cons 'cperl (car cperl-compilation-error-regexp-alist))
-                   compilation-error-regexp-alist-alist))
+         (setq-local compilation-error-regexp-alist-alist
+                     (cons (cons 'cperl (car 
cperl-compilation-error-regexp-alist))
+                           compilation-error-regexp-alist-alist))
         (if (fboundp 'compilation-build-compilation-error-regexp-alist)
             (let ((f 'compilation-build-compilation-error-regexp-alist))
               (funcall f))
           (make-local-variable 'compilation-error-regexp-alist)
           (push 'cperl compilation-error-regexp-alist)))
        ((boundp 'compilation-error-regexp-alist);; xemacs 19.x
-        (set (make-local-variable 'compilation-error-regexp-alist)
-              (append cperl-compilation-error-regexp-alist
-                      compilation-error-regexp-alist))))
-  (set (make-local-variable 'font-lock-defaults)
-       '((cperl-load-font-lock-keywords
-          cperl-load-font-lock-keywords-1
-          cperl-load-font-lock-keywords-2) nil nil ((?_ . "w"))))
+         (setq-local compilation-error-regexp-alist
+                     (append cperl-compilation-error-regexp-alist
+                             compilation-error-regexp-alist))))
+  (setq-local font-lock-defaults
+              '((cperl-load-font-lock-keywords
+                 cperl-load-font-lock-keywords-1
+                 cperl-load-font-lock-keywords-2)
+                nil nil ((?_ . "w"))))
   ;; Reset syntaxification cache.
-  (set (make-local-variable 'cperl-syntax-state) nil)
+  (setq-local cperl-syntax-state nil)
   (if cperl-use-syntax-table-text-property
       (if (eval-when-compile (fboundp 'syntax-propertize-rules))
           (progn
             ;; Reset syntaxification cache.
-            (set (make-local-variable 'cperl-syntax-done-to) nil)
-            (set (make-local-variable 'syntax-propertize-function)
-                 (lambda (start end)
-                   (goto-char start)
-                   ;; Even if cperl-fontify-syntaxically has already gone
-                   ;; beyond `start', syntax-propertize has just removed
-                   ;; syntax-table properties between start and end, so we have
-                   ;; to re-apply them.
-                   (setq cperl-syntax-done-to start)
-                   (cperl-fontify-syntaxically end))))
+            (setq-local cperl-syntax-done-to nil)
+            (setq-local syntax-propertize-function
+                        (lambda (start end)
+                          (goto-char start)
+                          ;; Even if cperl-fontify-syntaxically has already 
gone
+                          ;; beyond `start', syntax-propertize has just removed
+                          ;; syntax-table properties between start and end, so 
we have
+                          ;; to re-apply them.
+                          (setq cperl-syntax-done-to start)
+                          (cperl-fontify-syntaxically end))))
        ;; Do not introduce variable if not needed, we check it!
-       (set (make-local-variable 'parse-sexp-lookup-properties) t)
-       ;; Fix broken font-lock:
-       (or (boundp 'font-lock-unfontify-region-function)
-           (setq font-lock-unfontify-region-function
-                #'font-lock-default-unfontify-region))
+        (setq-local parse-sexp-lookup-properties t)
        ;; Our: just a plug for wrong font-lock
-       (set (make-local-variable 'font-lock-unfontify-region-function)
-             ;; not present with old Emacs
-            #'cperl-font-lock-unfontify-region-function)
+        (setq-local font-lock-unfontify-region-function
+                    ;; not present with old Emacs
+                    #'cperl-font-lock-unfontify-region-function)
        ;; Reset syntaxification cache.
-       (set (make-local-variable 'cperl-syntax-done-to) nil)
-       (set (make-local-variable 'font-lock-syntactic-keywords)
-             (if cperl-syntaxify-by-font-lock
-                 '((cperl-fontify-syntaxically))
-                ;; unless font-lock-syntactic-keywords, font-lock (pre-22.1)
-                ;;  used to ignore syntax-table text-properties.  (t) is a hack
-                ;;  to make font-lock think that font-lock-syntactic-keywords
-                ;;  are defined.
-               '(t)))))
+        (setq-local cperl-syntax-done-to nil)
+        (setq-local font-lock-syntactic-keywords
+                    (if cperl-syntaxify-by-font-lock
+                        '((cperl-fontify-syntaxically))
+                      ;; unless font-lock-syntactic-keywords, font-lock 
(pre-22.1)
+                      ;;  used to ignore syntax-table text-properties.  (t) is 
a hack
+                      ;;  to make font-lock think that 
font-lock-syntactic-keywords
+                      ;;  are defined.
+                      '(t)))))
   (setq cperl-font-lock-multiline t) ; Not localized...
-  (set (make-local-variable 'font-lock-multiline) t)
-  (set (make-local-variable 'font-lock-fontify-region-function)
-       #'cperl-font-lock-fontify-region-function)
+  (setq-local font-lock-multiline t)
+  (setq-local font-lock-fontify-region-function
+              #'cperl-font-lock-fontify-region-function)
   (make-local-variable 'cperl-old-style)
-  (set (make-local-variable 'normal-auto-fill-function)
-       #'cperl-do-auto-fill)
+  (setq-local normal-auto-fill-function
+              #'cperl-do-auto-fill)
   (if (cperl-val 'cperl-font-lock)
       (progn (or cperl-faces-init (cperl-init-faces))
             (font-lock-mode 1)))
-  (set (make-local-variable 'facemenu-add-face-function)
-       #'cperl-facemenu-add-face-function) ; XXXX What this guy is for???
+  (setq-local facemenu-add-face-function
+              #'cperl-facemenu-add-face-function) ; XXXX What this guy is 
for???
   (and (boundp 'msb-menu-cond)
        (not cperl-msb-fixed)
        (cperl-msb-fix))
@@ -3478,49 +3475,18 @@ the sections using `cperl-pod-head-face', 
`cperl-pod-face',
         (font-lock-string-face (if (boundp 'font-lock-string-face)
                                    font-lock-string-face
                                  'font-lock-string-face))
-        (my-cperl-delimiters-face (if (boundp 'font-lock-constant-face)
-                                     font-lock-constant-face
-                                   'font-lock-constant-face))
+        (my-cperl-delimiters-face
+         font-lock-constant-face)
         (my-cperl-REx-spec-char-face   ; [] ^.$ and wrapper-of ({})
-         (if (boundp 'font-lock-function-name-face)
-             font-lock-function-name-face
-           'font-lock-function-name-face))
-        (font-lock-variable-name-face  ; interpolated vars and ({})-code
-         (if (boundp 'font-lock-variable-name-face)
-             font-lock-variable-name-face
-           'font-lock-variable-name-face))
-        (font-lock-function-name-face  ; used in `cperl-find-sub-attrs'
-         (if (boundp 'font-lock-function-name-face)
-             font-lock-function-name-face
-           'font-lock-function-name-face))
-        (font-lock-constant-face       ; used in `cperl-find-sub-attrs'
-         (if (boundp 'font-lock-constant-face)
-             font-lock-constant-face
-           'font-lock-constant-face))
+          font-lock-function-name-face)
         (my-cperl-REx-0length-face ; 0-length, (?:)etc, non-literal \
-         (if (boundp 'font-lock-builtin-face)
-             font-lock-builtin-face
-           'font-lock-builtin-face))
-        (font-lock-comment-face
-         (if (boundp 'font-lock-comment-face)
-             font-lock-comment-face
-           'font-lock-comment-face))
-        (font-lock-warning-face
-         (if (boundp 'font-lock-warning-face)
-             font-lock-warning-face
-           'font-lock-warning-face))
+          font-lock-builtin-face)
         (my-cperl-REx-ctl-face         ; (|)
-         (if (boundp 'font-lock-keyword-face)
-             font-lock-keyword-face
-           'font-lock-keyword-face))
+          font-lock-keyword-face)
         (my-cperl-REx-modifiers-face   ; //gims
-         (if (boundp 'cperl-nonoverridable-face)
-             cperl-nonoverridable-face
-           'cperl-nonoverridable-face))
+         'cperl-nonoverridable-face)
         (my-cperl-REx-length1-face     ; length=1 escaped chars, POSIX classes
-         (if (boundp 'font-lock-type-face)
-             font-lock-type-face
-           'font-lock-type-face))
+          font-lock-type-face)
         (stop-point (if ignore-max
                         (point-max)
                       max))
@@ -3730,13 +3696,14 @@ the sections using `cperl-pod-head-face', 
`cperl-pod-face',
               ;;    ;; "\\([^= \t0-9$@%&]\\|[ \t]+[^ \t\n0-9$@%&]\\)" ; 6 + 1
               ;;    "\\(\\)"           ; To preserve count of pars :-( 6 + 1
               ;;  "\\)"
-              ((match-beginning 3)     ; 2 + 1
+              ((match-beginning 3)     ; 2 + 1: found "<<", detect its type
                (setq b (point)
                      tb (match-beginning 0)
                      c (and            ; not HERE-DOC
                         (match-beginning 6)
                         (save-match-data
                           (or (looking-at "[ \t]*(") ; << function_call()
+                              (looking-at ">>")      ; <<>> operator
                               (save-excursion ; 1 << func_name, or $foo << 10
                                 (condition-case nil
                                     (progn
@@ -5699,7 +5666,7 @@ indentation and initial hashes.  Behaves usually outside 
of comment."
                  'cperl-hash-face
                'cperl-array-face)
              nil)                      ; arrays and hashes
-            ("\\(\\([$@]+\\)[a-zA-Z_:][a-zA-Z0-9_:]*\\)[ \t]*\\([[{]\\)"
+            ("\\(\\([$@%]+\\)[a-zA-Z_:][a-zA-Z0-9_:]*\\)[ \t]*\\([[{]\\)"
              1
              (if (= (- (match-end 2) (match-beginning 2)) 1)
                  (if (eq (char-after (match-beginning 3)) ?{)
@@ -6107,7 +6074,7 @@ side-effect of memorizing only.  Examples in 
`cperl-style-examples'."
               (set-buffer "*info-perl-tmp*")
               (rename-buffer "*info*")
               (set-buffer bname)))
-       (set (make-local-variable 'window-min-height) 2)
+        (setq-local window-min-height 2)
        (current-buffer)))))
 
 (defun cperl-word-at-point (&optional p)
@@ -6425,7 +6392,7 @@ by CPerl."
   (if cperl-use-syntax-table-text-property-for-tags
       (progn
        ;; Do not introduce variable if not needed, we check it!
-       (set (make-local-variable 'parse-sexp-lookup-properties) t))))
+        (setq-local parse-sexp-lookup-properties t))))
 
 ;; Copied from imenu-example--name-and-position.
 (defvar imenu-use-markers)
@@ -6566,7 +6533,7 @@ Does not move point."
 (defun cperl-add-tags-recurse-noxs ()
   "Add to TAGS data for \"pure\" Perl files in the current directory and kids.
 Use as
-  emacs -batch -q -no-site-file -l emacs/cperl-mode.el \
+  emacs -batch -q -no-site-file -l emacs/cperl-mode.el \\
         -f cperl-add-tags-recurse-noxs
 "
   (cperl-write-tags nil nil t t nil t))
@@ -6575,7 +6542,7 @@ Use as
   "Add to TAGS data for \"pure\" Perl in the current directory and kids.
 Writes down fullpath, so TAGS is relocatable (but if the build directory
 is relocated, the file TAGS inside it breaks). Use as
-  emacs -batch -q -no-site-file -l emacs/cperl-mode.el \
+  emacs -batch -q -no-site-file -l emacs/cperl-mode.el \\
         -f cperl-add-tags-recurse-noxs-fullpath
 "
   (cperl-write-tags nil nil t t nil t ""))
@@ -6583,7 +6550,7 @@ is relocated, the file TAGS inside it breaks). Use as
 (defun cperl-add-tags-recurse ()
   "Add to TAGS file data for Perl files in the current directory and kids.
 Use as
-  emacs -batch -q -no-site-file -l emacs/cperl-mode.el \
+  emacs -batch -q -no-site-file -l emacs/cperl-mode.el \\
         -f cperl-add-tags-recurse
 "
   (cperl-write-tags nil nil t t))
@@ -7296,6 +7263,7 @@ __DATA__  Ends program source.
 __FILE__       Current (source) filename.
 __LINE__       Current line in current source.
 __PACKAGE__    Current package.
+__SUB__        Current sub.
 ARGV   Default multi-file input filehandle.  <ARGV> is a synonym for <>.
 ARGVOUT        Output filehandle with -i flag.
 BEGIN { ... }  Immediately executed (during compilation) piece of code.
@@ -7561,14 +7529,17 @@ use PACKAGE [SYMBOL1, ...]  Compile-time `require' with 
consequent `import'.
 prototype \\&SUB       Returns prototype of the function given a reference.
 =head1         Top-level heading.
 =head2         Second-level heading.
-=head3         Third-level heading (is there such?).
+=head3         Third-level heading.
+=head4         Fourth-level heading.
 =over [ NUMBER ]       Start list.
 =item [ TITLE ]                Start new item in the list.
 =back          End list.
 =cut           Switch from POD to Perl.
 =pod           Switch from Perl to POD.
-=begin         Switch from Perl6 to POD.
-=end           Switch from POD to Perl6.
+=begin formatname      Start directly formatted region.
+=end formatname        End directly formatted region.
+=for formatname text   Paragraph in special format.
+=encoding encodingname Encoding of the document.
 ")
 
 (defun cperl-switch-to-doc-buffer (&optional interactive)
@@ -8347,7 +8318,7 @@ may be used to debug problems with delayed incremental 
fontification."
     (goto-char pos)
     (normal-mode)
     ;; Why needed???  With older font-locks???
-    (set (make-local-variable 'font-lock-cache-position) (make-marker))
+    (setq-local font-lock-cache-position (make-marker))
     (while (if (> window-size 0)
               (< pos (point-max))
             (> pos (point-min)))
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el
index 65ef83f..4ea1674 100644
--- a/lisp/progmodes/cpp.el
+++ b/lisp/progmodes/cpp.el
@@ -1,6 +1,6 @@
 ;;; cpp.el --- highlight or hide text according to cpp conditionals -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1994-1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: c, faces, tools
diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el
index b09a2ed..042030d 100644
--- a/lisp/progmodes/cwarn.el
+++ b/lisp/progmodes/cwarn.el
@@ -1,6 +1,6 @@
 ;;; cwarn.el --- highlight suspicious C and C++ constructions
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Anders Lindgren
 ;; Keywords: c, languages, faces
diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el
index ca45795..3815b17 100644
--- a/lisp/progmodes/dcl-mode.el
+++ b/lisp/progmodes/dcl-mode.el
@@ -1,6 +1,6 @@
 ;;; dcl-mode.el --- major mode for editing DCL command files
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Odd Gripenstam <gripenstamol@decus.se>
 ;; Maintainer: emacs-devel@gnu.org
@@ -588,17 +588,17 @@ $
 
 There is some minimal font-lock support (see vars
 `dcl-font-lock-defaults' and `dcl-font-lock-keywords')."
-  (set (make-local-variable 'indent-line-function) 'dcl-indent-line)
-  (set (make-local-variable 'comment-start) "!")
-  (set (make-local-variable 'comment-end) "")
-  (set (make-local-variable 'comment-multi-line) nil)
+  (setq-local indent-line-function 'dcl-indent-line)
+  (setq-local comment-start "!")
+  (setq-local comment-end "")
+  (setq-local comment-multi-line nil)
 
   ;; This used to be "^\\$[ \t]*![ \t]*" which looks more correct.
   ;; The drawback was that you couldn't make empty comment lines by pressing
   ;; C-M-j repeatedly - only the first line became a comment line.
   ;; This version has the drawback that the "$" can be anywhere in the line,
   ;; and something inappropriate might be interpreted as a comment.
-  (set (make-local-variable 'comment-start-skip) "\\$[ \t]*![ \t]*")
+  (setq-local comment-start-skip "\\$[ \t]*![ \t]*")
 
   (if (boundp 'imenu-generic-expression)
       (progn (setq imenu-generic-expression dcl-imenu-generic-expression)
@@ -619,7 +619,7 @@ There is some minimal font-lock support (see vars
   (make-local-variable 'dcl-electric-reindent-regexps)
 
   ;; font lock
-  (set (make-local-variable 'font-lock-defaults) dcl-font-lock-defaults)
+  (setq-local font-lock-defaults dcl-font-lock-defaults)
 
   (tempo-use-tag-list 'dcl-tempo-tags))
 
diff --git a/lisp/progmodes/ebnf-abn.el b/lisp/progmodes/ebnf-abn.el
index be82c72..9e570b6 100644
--- a/lisp/progmodes/ebnf-abn.el
+++ b/lisp/progmodes/ebnf-abn.el
@@ -1,6 +1,6 @@
 ;;; ebnf-abn.el --- parser for ABNF (Augmented BNF)
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Keywords: wp, ebnf, PostScript
diff --git a/lisp/progmodes/ebnf-bnf.el b/lisp/progmodes/ebnf-bnf.el
index 4e11862..93ebfe8 100644
--- a/lisp/progmodes/ebnf-bnf.el
+++ b/lisp/progmodes/ebnf-bnf.el
@@ -1,6 +1,6 @@
 ;;; ebnf-bnf.el --- parser for EBNF
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Keywords: wp, ebnf, PostScript
diff --git a/lisp/progmodes/ebnf-dtd.el b/lisp/progmodes/ebnf-dtd.el
index ddddb27..66e5dd0 100644
--- a/lisp/progmodes/ebnf-dtd.el
+++ b/lisp/progmodes/ebnf-dtd.el
@@ -1,6 +1,6 @@
 ;;; ebnf-dtd.el --- parser for DTD (Data Type Description for XML)
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Keywords: wp, ebnf, PostScript
diff --git a/lisp/progmodes/ebnf-ebx.el b/lisp/progmodes/ebnf-ebx.el
index 546f1f8..389049e 100644
--- a/lisp/progmodes/ebnf-ebx.el
+++ b/lisp/progmodes/ebnf-ebx.el
@@ -1,6 +1,6 @@
 ;;; ebnf-ebx.el --- parser for EBNF used to specify XML (EBNFX)
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Keywords: wp, ebnf, PostScript
diff --git a/lisp/progmodes/ebnf-iso.el b/lisp/progmodes/ebnf-iso.el
index 466e778..d25ff3e 100644
--- a/lisp/progmodes/ebnf-iso.el
+++ b/lisp/progmodes/ebnf-iso.el
@@ -1,6 +1,6 @@
 ;;; ebnf-iso.el --- parser for ISO EBNF
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Keywords: wp, ebnf, PostScript
diff --git a/lisp/progmodes/ebnf-otz.el b/lisp/progmodes/ebnf-otz.el
index a510574..b724d75 100644
--- a/lisp/progmodes/ebnf-otz.el
+++ b/lisp/progmodes/ebnf-otz.el
@@ -1,6 +1,6 @@
 ;;; ebnf-otz.el --- syntactic chart OpTimiZer
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Keywords: wp, ebnf, PostScript
diff --git a/lisp/progmodes/ebnf-yac.el b/lisp/progmodes/ebnf-yac.el
index a657c63..2765d03 100644
--- a/lisp/progmodes/ebnf-yac.el
+++ b/lisp/progmodes/ebnf-yac.el
@@ -1,6 +1,6 @@
 ;;; ebnf-yac.el --- parser for Yacc/Bison
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Keywords: wp, ebnf, PostScript
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 991cd6f..6f9509d 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -1,6 +1,6 @@
 ;;; ebnf2ps.el --- translate an EBNF to a syntactic chart on PostScript  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Keywords: wp, ebnf, PostScript
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index ffd7d03..a174d48 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -1,6 +1,6 @@
 ;;; ebrowse.el --- Emacs C++ class browser & tags facility  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
 ;; Author: Gerd Moellmann <gerd@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 12788ea..9348a7f 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1,6 +1,6 @@
 ;;; elisp-mode.el --- Emacs Lisp mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1999-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: lisp, languages
@@ -38,9 +38,10 @@ It has `lisp-mode-abbrev-table' as its parent."
   :parents (list lisp-mode-abbrev-table))
 
 (defvar emacs-lisp-mode-syntax-table
-  (let ((table (make-syntax-table lisp--mode-syntax-table)))
-    (modify-syntax-entry ?\[ "(]  " table)
-    (modify-syntax-entry ?\] ")[  " table)
+  (let ((table (make-syntax-table lisp-data-mode-syntax-table)))
+    ;; These are redundant, now.
+    ;;(modify-syntax-entry ?\[ "(]  " table)
+    ;;(modify-syntax-entry ?\] ")[  " table)
     table)
   "Syntax table used in `emacs-lisp-mode'.")
 
@@ -681,7 +682,7 @@ otherwise build the summary from TYPE and SYMBOL."
             (xref-make-elisp-location symbol type file)))
 
 (defvar elisp-xref-find-def-functions nil
-  "List of functions to be run from `elisp--xref-find-definitions' to add 
additional xrefs.
+  "List of functions run from `elisp--xref-find-definitions' to add more xrefs.
 Called with one arg; the symbol whose definition is desired.
 Each function should return a list of xrefs, or nil; the first
 non-nil result supersedes the xrefs produced by
@@ -1719,7 +1720,8 @@ Calls REPORT-FN directly."
                       collect
                       (flymake-make-diagnostic
                        (current-buffer)
-                       start end :note text)))
+                       (or start 1) (or end (1+ (or start 1)))
+                       :note text)))
     collected))
 
 (defun elisp-flymake--byte-compile-done (report-fn
@@ -1826,12 +1828,9 @@ Runs in a batch-mode Emacs.  Interactively use variable
   (interactive (list buffer-file-name))
   (let* ((file (or file
                    (car command-line-args-left)))
-         (dummy-elc-file)
          (byte-compile-log-buffer
           (generate-new-buffer " *dummy-byte-compile-log-buffer*"))
-         (byte-compile-dest-file-function
-          (lambda (source)
-            (setq dummy-elc-file (make-temp-file (file-name-nondirectory 
source)))))
+         (byte-compile-dest-file-function #'ignore)
          (collected)
          (byte-compile-log-warning-function
           (lambda (string &optional position fill level)
@@ -1841,7 +1840,6 @@ Runs in a batch-mode Emacs.  Interactively use variable
     (unwind-protect
         (byte-compile-file file)
       (ignore-errors
-        (delete-file dummy-elc-file)
         (kill-buffer byte-compile-log-buffer)))
     (prin1 :elisp-flymake-output-start)
     (terpri)
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 0072360..c9514d3 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1,6 +1,6 @@
 ;;; etags.el --- etags facility for Emacs  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1988-1989, 1992-1996, 1998, 2000-2020 Free
+;; Copyright (C) 1985-1986, 1988-1989, 1992-1996, 1998, 2000-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Author: Roland McGrath <roland@gnu.org>
@@ -258,9 +258,9 @@ One argument, the tag info returned by 
`snarf-tag-function'.")
 Return non-nil if it is a valid tags table, and
 in that case, also make the tags table state variables
 buffer-local and set them to nil."
-  (set (make-local-variable 'tags-table-files) nil)
-  (set (make-local-variable 'tags-completion-table) nil)
-  (set (make-local-variable 'tags-included-tables) nil)
+  (setq-local tags-table-files nil)
+  (setq-local tags-completion-table nil)
+  (setq-local tags-included-tables nil)
   ;; We used to initialize find-tag-marker-ring and tags-location-ring
   ;; here, to new empty rings.  But that is wrong, because those
   ;; are global.
@@ -1234,34 +1234,29 @@ error message."
   "If `etags-verify-tags-table', make buffer-local format variables.
 If current buffer is a valid etags TAGS file, then give it
 buffer-local values of tags table format variables."
-  (and (etags-verify-tags-table)
-       ;; It is annoying to flash messages on the screen briefly,
-       ;; and this message is not useful.  -- rms
-       ;; (message "%s is an `etags' TAGS file" buffer-file-name)
-       (mapc (lambda (elt) (set (make-local-variable (car elt)) (cdr elt)))
-            '((file-of-tag-function . etags-file-of-tag)
-              (tags-table-files-function . etags-tags-table-files)
-              (tags-completion-table-function . etags-tags-completion-table)
-              (snarf-tag-function . etags-snarf-tag)
-              (goto-tag-location-function . etags-goto-tag-location)
-              (find-tag-regexp-search-function . re-search-forward)
-              (find-tag-regexp-tag-order . (tag-re-match-p))
-              (find-tag-regexp-next-line-after-failure-p . t)
-              (find-tag-search-function . search-forward)
-              (find-tag-tag-order . (tag-exact-file-name-match-p
-                                      tag-file-name-match-p
-                                     tag-exact-match-p
-                                     tag-implicit-name-match-p
-                                     tag-symbol-match-p
-                                     tag-word-match-p
-                                     tag-partial-file-name-match-p
-                                     tag-any-match-p))
-              (find-tag-next-line-after-failure-p . nil)
-              (list-tags-function . etags-list-tags)
-              (tags-apropos-function . etags-tags-apropos)
-              (tags-included-tables-function . etags-tags-included-tables)
-              (verify-tags-table-function . etags-verify-tags-table)
-              ))))
+  (when (etags-verify-tags-table)
+    (setq-local file-of-tag-function 'etags-file-of-tag)
+    (setq-local tags-table-files-function 'etags-tags-table-files)
+    (setq-local tags-completion-table-function 'etags-tags-completion-table)
+    (setq-local snarf-tag-function 'etags-snarf-tag)
+    (setq-local goto-tag-location-function 'etags-goto-tag-location)
+    (setq-local find-tag-regexp-search-function 're-search-forward)
+    (setq-local find-tag-regexp-tag-order '(tag-re-match-p))
+    (setq-local find-tag-regexp-next-line-after-failure-p t)
+    (setq-local find-tag-search-function 'search-forward)
+    (setq-local find-tag-tag-order '(tag-exact-file-name-match-p
+                                     tag-file-name-match-p
+                                     tag-exact-match-p
+                                     tag-implicit-name-match-p
+                                     tag-symbol-match-p
+                                     tag-word-match-p
+                                     tag-partial-file-name-match-p
+                                     tag-any-match-p))
+    (setq-local find-tag-next-line-after-failure-p nil)
+    (setq-local list-tags-function 'etags-list-tags)
+    (setq-local tags-apropos-function 'etags-tags-apropos)
+    (setq-local tags-included-tables-function 'etags-tags-included-tables)
+    (setq-local verify-tags-table-function 'etags-verify-tags-table)))
 
 (defun etags-verify-tags-table ()
   "Return non-nil if the current buffer is a valid etags TAGS file."
@@ -1593,16 +1588,16 @@ hits the start of file."
   "Return non-nil if current buffer is empty.
 If empty, make buffer-local values of the tags table format variables
 that do nothing."
-  (and (zerop (buffer-size))
-       (mapc (lambda (sym) (set (make-local-variable sym) 'ignore))
-            '(tags-table-files-function
-              tags-completion-table-function
-              find-tag-regexp-search-function
-              find-tag-search-function
-              tags-apropos-function
-              tags-included-tables-function))
-       (set (make-local-variable 'verify-tags-table-function)
-            (lambda () (zerop (buffer-size))))))
+  (when (zerop (buffer-size))
+    (setq-local tags-table-files-function #'ignore)
+    (setq-local tags-completion-table-function #'ignore)
+    (setq-local find-tag-regexp-search-function #'ignore)
+    (setq-local find-tag-search-function #'ignore)
+    (setq-local tags-apropos-function #'ignore)
+    (setq-local tags-included-tables-function #'ignore)
+    (setq-local verify-tags-table-function
+                (lambda () (zerop (buffer-size))))))
+
 
 ;; Match qualifier functions for tagnames.
 ;; These functions assume the etags file format defined in etc/ETAGS.EBNF.
@@ -1819,8 +1814,8 @@ argument is passed to `next-file', which see)."
 Stops when a match is found.
 To continue searching for next match, use command \\[tags-loop-continue].
 
-If FILES if non-nil should be a list or an iterator returning the files to 
search.
-The search will be restricted to these files.
+If FILES if non-nil should be a list or an iterator returning the
+files to search.  The search will be restricted to these files.
 
 Also see the documentation of the `tags-file-name' variable."
   (interactive "sTags search (regexp): ")
diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el
index cc72809..fa5724a 100644
--- a/lisp/progmodes/executable.el
+++ b/lisp/progmodes/executable.el
@@ -1,6 +1,6 @@
 ;;; executable.el --- base functionality for executable interpreter scripts
 
-;; Copyright (C) 1994-1996, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1996, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>
 ;; Keywords: languages, unix
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 3c5c29b..2641387 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -1,6 +1,6 @@
 ;;; f90.el --- Fortran-90 mode (free format)  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1995-1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Torbjörn Einarsson <Torbjorn.Einarsson@era.ericsson.se>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/progmodes/flymake-cc.el b/lisp/progmodes/flymake-cc.el
index 19cef85..bd403fa 100644
--- a/lisp/progmodes/flymake-cc.el
+++ b/lisp/progmodes/flymake-cc.el
@@ -1,6 +1,6 @@
 ;;; flymake-cc.el --- Flymake support for GNU tools for C/C++     -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: João Távora <joaotavora@gmail.com>
 ;; Keywords: languages, c
diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el
index 152dc72..9cbad12 100644
--- a/lisp/progmodes/flymake-proc.el
+++ b/lisp/progmodes/flymake-proc.el
@@ -1,6 +1,6 @@
 ;;; flymake-proc.el --- Flymake backend for external tools  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
 ;; Maintainer: João Távora <joaotavora@gmail.com>
@@ -120,8 +120,10 @@ This is an alist with elements of the form:
   REGEXP INIT [CLEANUP [NAME]]
 REGEXP is a regular expression that matches a file name.
 INIT is the init function to use.
-CLEANUP is the cleanup function to use, default `flymake-proc-simple-cleanup'.
-NAME is the file name function to use, default 
`flymake-proc-get-real-file-name'."
+CLEANUP is the cleanup function to use, default
+  `flymake-proc-simple-cleanup'.
+NAME is the file name function to use, default
+  `flymake-proc-get-real-file-name'."
   :group 'flymake
   :type '(alist :key-type (regexp :tag "File regexp")
                 :value-type
@@ -429,16 +431,15 @@ instead of reading master file from disk."
 
 (defun flymake-proc--read-file-to-temp-buffer (file-name)
   "Insert contents of FILE-NAME into newly created temp buffer."
-  (let* ((temp-buffer (get-buffer-create (generate-new-buffer-name (concat 
"flymake:" (file-name-nondirectory file-name))))))
-    (with-current-buffer temp-buffer
-      (insert-file-contents file-name))
-    temp-buffer))
+  (with-current-buffer (generate-new-buffer
+                        (concat "flymake:" (file-name-nondirectory file-name)))
+    (insert-file-contents file-name)
+    (current-buffer)))
 
 (defun flymake-proc--copy-buffer-to-temp-buffer (buffer)
   "Copy contents of BUFFER into newly created temp buffer."
-  (with-current-buffer
-      (get-buffer-create (generate-new-buffer-name
-                          (concat "flymake:" (buffer-name buffer))))
+  (with-current-buffer (generate-new-buffer
+                        (concat "flymake:" (buffer-name buffer)))
     (insert-buffer-substring buffer)
     (current-buffer)))
 
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index efa7b2f..fddc13f 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1,10 +1,10 @@
 ;;; flymake.el --- A universal on-the-fly syntax checker  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
 ;; Maintainer: João Távora <joaotavora@gmail.com>
-;; Version: 1.0.9
+;; Version: 1.1.0
 ;; Keywords: c languages tools
 ;; Package-Requires: ((emacs "26.1") (eldoc "1.1.0"))
 
@@ -412,44 +412,46 @@ verify FILTER, a function, and sort them by COMPARE 
(using KEY)."
 (defun flymake-diag-region (buffer line &optional col)
   "Compute BUFFER's region (BEG . END) corresponding to LINE and COL.
 If COL is nil, return a region just for LINE.  Return nil if the
-region is invalid."
+region is invalid.  This function saves match data."
   (condition-case-unless-debug _err
       (with-current-buffer buffer
         (let ((line (min (max line 1)
                          (line-number-at-pos (point-max) 'absolute))))
           (save-excursion
-            (goto-char (point-min))
-            (forward-line (1- line))
-            (cl-flet ((fallback-bol
-                       ()
-                       (back-to-indentation)
-                       (if (eobp)
-                           (line-beginning-position 0)
-                         (point)))
-                      (fallback-eol
-                       (beg)
-                       (progn
-                         (end-of-line)
-                         (skip-chars-backward " \t\f\n" beg)
-                         (if (eq (point) beg)
-                             (line-beginning-position 2)
-                           (point)))))
-              (if (and col (cl-plusp col))
-                  (let* ((beg (progn (forward-char (1- col))
-                                     (point)))
-                         (sexp-end (ignore-errors (end-of-thing 'sexp)))
-                         (end (or (and sexp-end
-                                       (not (= sexp-end beg))
-                                       sexp-end)
-                                  (and (< (goto-char (1+ beg)) (point-max))
-                                       (point)))))
-                    (if end
-                        (cons beg end)
-                      (cons (setq beg (fallback-bol))
-                            (fallback-eol beg))))
-                (let* ((beg (fallback-bol))
-                       (end (fallback-eol beg)))
-                  (cons beg end)))))))
+            (save-match-data
+              (goto-char (point-min))
+              (forward-line (1- line))
+              (cl-flet ((fallback-bol
+                         ()
+                         (back-to-indentation)
+                         (if (eobp)
+                             (line-beginning-position 0)
+                           (point)))
+                        (fallback-eol
+                         (beg)
+                         (progn
+                           (end-of-line)
+                           (skip-chars-backward " \t\f\n" beg)
+                           (if (eq (point) beg)
+                               (line-beginning-position 2)
+                             (point)))))
+                (if (and col (cl-plusp col))
+                    (let* ((beg (progn (forward-char (1- col))
+                                       (point)))
+                           (sexp-end (or (ignore-errors (end-of-thing 'sexp))
+                                         (ignore-errors (end-of-thing 
'symbol))))
+                           (end (or (and sexp-end
+                                         (not (= sexp-end beg))
+                                         sexp-end)
+                                    (and (< (goto-char (1+ beg)) (point-max))
+                                         (point)))))
+                      (if end
+                          (cons beg end)
+                        (cons (setq beg (fallback-bol))
+                              (fallback-eol beg))))
+                  (let* ((beg (fallback-bol))
+                         (end (fallback-eol beg)))
+                    (cons beg end))))))))
     (error (flymake-log :warning "Invalid region line=%s col=%s" line col)
            nil)))
 
@@ -995,7 +997,7 @@ suitable for the current buffer.  The commands
 `flymake-running-backends', `flymake-disabled-backends' and
 `flymake-reporting-backends' summarize the situation, as does the
 special *Flymake log* buffer."  :group 'flymake :lighter
-  flymake--mode-line-format :keymap flymake-mode-map
+  flymake-mode-line-format :keymap flymake-mode-map
   (cond
    ;; Turning the mode ON.
    (flymake-mode
@@ -1184,123 +1186,141 @@ default) no filter is applied."
     [ "Go to log buffer"        flymake-switch-to-log-buffer t ]
     [ "Turn off Flymake"        flymake-mode t ]))
 
-(defvar flymake--mode-line-format '(:eval (flymake--mode-line-format)))
-
-(put 'flymake--mode-line-format 'risky-local-variable t)
-
-
-(defun flymake--mode-line-format ()
-  "Produce a pretty minor mode indicator."
-  (let* ((known (hash-table-keys flymake--backend-state))
-         (running (flymake-running-backends))
-         (disabled (flymake-disabled-backends))
-         (reported (flymake-reporting-backends))
-         (diags-by-type (make-hash-table))
-         (all-disabled (and disabled (null running)))
-         (some-waiting (cl-set-difference running reported)))
-    (maphash (lambda (_b state)
-               (mapc (lambda (diag)
-                       (push diag
-                             (gethash (flymake--diag-type diag)
-                                      diags-by-type)))
-                     (flymake--backend-state-diags state)))
-             flymake--backend-state)
-    `((:propertize " Flymake"
-                   mouse-face mode-line-highlight
-                   help-echo
-                   ,(concat (format "%s known backends\n" (length known))
-                            (format "%s running\n" (length running))
-                            (format "%s disabled\n" (length disabled))
-                            "mouse-1: Display minor mode menu\n"
-                            "mouse-2: Show help for minor mode")
-                   keymap
-                   ,(let ((map (make-sparse-keymap)))
-                      (define-key map [mode-line down-mouse-1]
-                        flymake-menu)
-                      (define-key map [mode-line mouse-2]
-                        (lambda ()
-                          (interactive)
-                          (describe-function 'flymake-mode)))
-                      map))
-      ,@(pcase-let ((`(,ind ,face ,explain)
-                     (cond ((null known)
-                            '("?" nil "No known backends"))
-                           (some-waiting
-                            `("Wait" compilation-mode-line-run
-                              ,(format "Waiting for %s running backend(s)"
-                                       (length some-waiting))))
-                           (all-disabled
-                            '("!" compilation-mode-line-run
-                              "All backends disabled"))
-                           (t
-                            '(nil nil nil)))))
-          (when ind
-            `((":"
-               (:propertize ,ind
-                            face ,face
-                            help-echo ,explain
-                            keymap
-                            ,(let ((map (make-sparse-keymap)))
+(defcustom flymake-mode-line-format
+  '(" " flymake-mode-line-title flymake-mode-line-exception
+    flymake-mode-line-counters)
+  "Mode line construct for customizing Flymake information."
+  :group 'flymake
+  :type '(repeat (choice string symbol)))
+
+(defcustom flymake-mode-line-counter-format
+  '("["
+    flymake-mode-line-error-counter
+    flymake-mode-line-warning-counter
+    flymake-mode-line-note-counter "]")
+  "Mode-line construct for formatting Flymake diagnostic counters.
+This is a suitable place for placing the `flymake-error-counter',
+`flymake-warning-counter' and `flymake-note-counter' constructs.
+Separating each of these with space is not necessary."
+  :group 'flymake
+  :type '(repeat (choice string symbol)))
+
+(defvar flymake-mode-line-title '(:eval (flymake--mode-line-title))
+  "Mode-line construct to show Flymake's mode name and menu.")
+
+(defvar flymake-mode-line-exception '(:eval (flymake--mode-line-exception))
+  "Mode-line construct to report on exceptional Flymake status.")
+
+(defvar flymake-mode-line-counters '(:eval (flymake--mode-line-counters))
+  "Mode-line construct for counting Flymake diagnostics.
+The counters are only placed if some Flymake backend initialized
+correctly.")
+
+(defvar flymake-mode-line-error-counter
+  `(:eval (flymake--mode-line-counter :error t)))
+(defvar flymake-mode-line-warning-counter
+  `(:eval (flymake--mode-line-counter :warning)))
+(defvar flymake-mode-line-note-counter
+  `(:eval (flymake--mode-line-counter :note)))
+
+(put 'flymake-mode-line-format 'risky-local-variable t)
+(put 'flymake-mode-line-title 'risky-local-variable t)
+(put 'flymake-mode-line-exception 'risky-local-variable t)
+(put 'flymake-mode-line-counters 'risky-local-variable t)
+(put 'flymake-mode-line-error-counter 'risky-local-variable t)
+(put 'flymake-mode-line-warning-counter 'risky-local-variable t)
+(put 'flymake-mode-line-note-counter 'risky-local-variable t)
+
+(defun flymake--mode-line-title ()
+  `(:propertize
+    "Flymake"
+    mouse-face mode-line-highlight
+    help-echo
+    (lambda (&rest whatever)
+      (concat
+       (format "%s known backends\n" (hash-table-count flymake--backend-state))
+       (format "%s running\n" (length (flymake-running-backends)))
+       (format "%s disabled\n" (length (flymake-disabled-backends)))
+       "mouse-1: Display minor mode menu\n"
+       "mouse-2: Show help for minor mode"))
+    keymap
+    ,(let ((map (make-sparse-keymap)))
+       (define-key map [mode-line down-mouse-1]
+         flymake-menu)
+       (define-key map [mode-line mouse-2]
+         (lambda ()
+           (interactive)
+           (describe-function 'flymake-mode)))
+       map)))
+
+(defun flymake--mode-line-exception ()
+  "Helper for `flymake-mode-line-exception'."
+  (pcase-let* ((running) (reported)
+               (`(,ind ,face ,explain)
+                (cond ((zerop (hash-table-count flymake--backend-state))
+                       '("?" nil "No known backends"))
+                      ((cl-set-difference
+                        (setq running (flymake-running-backends))
+                        (setq reported (flymake-reporting-backends)))
+                       `("Wait" compilation-mode-line-run
+                         ,(format "Waiting for %s running backend(s)"
+                                  (length (cl-set-difference running 
reported)))))
+                      ((and (flymake-disabled-backends) (null running))
+                       '("!" compilation-mode-line-run
+                         "All backends disabled"))
+                      (t
+                       '(nil nil nil)))))
+    (when ind
+      `(":"
+        (:propertize ,ind face ,face
+                     help-echo ,explain
+                     keymap ,(let ((map (make-sparse-keymap)))
                                (define-key map [mode-line mouse-1]
                                  'flymake-switch-to-log-buffer)
                                map))))))
-      ,@(unless (or all-disabled
-                    (null known))
-          (cl-loop
-           with types = (hash-table-keys diags-by-type)
-           with _augmented = (cl-loop for extra in '(:error :warning)
-                                      do (cl-pushnew extra types
-                                                     :key #'flymake--severity))
-           for type in (cl-sort types #'> :key #'flymake--severity)
-           for diags = (gethash type diags-by-type)
-           for face = (flymake--lookup-type-property type
-                                                     'mode-line-face
-                                                     'compilation-error)
-           when (or diags
-                    (cond ((eq flymake-suppress-zero-counters t)
-                           nil)
-                          (flymake-suppress-zero-counters
-                           (>= (flymake--severity type)
-                               (warning-numeric-level
-                                flymake-suppress-zero-counters)))
-                          (t t)))
-           collect `(:propertize
-                     ,(format "%d" (length diags))
-                     face ,face
-                     mouse-face mode-line-highlight
-                     keymap
-                     ,(let ((map (make-sparse-keymap))
-                            (type type))
-                        (define-key map (vector 'mode-line
-                                                mouse-wheel-down-event)
-                          (lambda (event)
-                            (interactive "e")
-                            (with-selected-window (posn-window (event-start 
event))
-                              (flymake-goto-prev-error 1 (list type) t))))
-                        (define-key map (vector 'mode-line
-                                                mouse-wheel-up-event)
-                          (lambda (event)
-                            (interactive "e")
-                            (with-selected-window (posn-window (event-start 
event))
-                              (flymake-goto-next-error 1 (list type) t))))
-                        map)
-                     help-echo
-                     ,(concat (format "%s diagnostics of type %s\n"
-                                      (propertize (format "%d"
-                                                          (length diags))
-                                                  'face face)
-                                      (propertize (format "%s" type)
-                                                  'face face))
-                              (format "%s/%s: previous/next of this type"
-                                      mouse-wheel-down-event
-                                      mouse-wheel-up-event)))
-           into forms
-           finally return
-           `((:propertize "[")
-             ,@(cl-loop for (a . rest) on forms by #'cdr
-                        collect a when rest collect
-                        '(:propertize " "))
-             (:propertize "]")))))))
+
+(defun flymake--mode-line-counters ()
+  (when (flymake-running-backends) flymake-mode-line-counter-format))
+
+(defun flymake--mode-line-counter (type &optional no-space)
+  (let ((count 0)
+        (face (flymake--lookup-type-property type
+                                             'mode-line-face
+                                             'compilation-error)))
+    (maphash (lambda
+               (_b state)
+               (dolist (d (flymake--backend-state-diags state))
+                 (when (eq type (flymake--diag-type d))
+                   (cl-incf count))))
+             flymake--backend-state)
+    (when (or (cl-plusp count)
+              (cond ((eq flymake-suppress-zero-counters t)
+                     nil)
+                    (flymake-suppress-zero-counters
+                     (>= (flymake--severity type)
+                         (warning-numeric-level
+                          flymake-suppress-zero-counters)))
+                    (t t)))
+      `(,(if no-space "" '(:propertize " "))
+        (:propertize
+         ,(format "%d" count)
+         face ,face
+         mouse-face mode-line-highlight
+         keymap
+         ,(let ((map (make-sparse-keymap)))
+            (define-key map (vector 'mode-line
+                                    mouse-wheel-down-event)
+              (lambda (event)
+                (interactive "e")
+                (with-selected-window (posn-window (event-start event))
+                  (flymake-goto-prev-error 1 (list type) t))))
+            (define-key map (vector 'mode-line
+                                    mouse-wheel-up-event)
+              (lambda (event)
+                (interactive "e")
+                (with-selected-window (posn-window (event-start event))
+                  (flymake-goto-next-error 1 (list type) t))))
+            map))))))
 
 ;;; Diagnostics buffer
 
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index 3a0274c..3bef398 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -1,6 +1,6 @@
 ;;; fortran.el --- Fortran mode for GNU Emacs -*- lexical-binding: t -*-
 
-;; Copyright (C) 1986, 1993-1995, 1997-2020 Free Software Foundation,
+;; Copyright (C) 1986, 1993-1995, 1997-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Michael D. Prange <prange@erl.mit.edu>
@@ -1218,25 +1218,32 @@ Auto-indent does not happen if a numeric ARG is used."
 ;; Note that unlike the latter, we don't have to worry about nested
 ;; subprograms (?).
 ;; FIXME push-mark?
-(defun fortran-beginning-of-subprogram ()
-  "Move point to the beginning of the current Fortran subprogram."
+(defun fortran-beginning-of-subprogram (&optional arg)
+  "Move point to the beginning of the current Fortran subprogram.
+If ARG is negative, and point is between subprograms, the
+\"current\" subprogram is the next one."
   (interactive)
-  (let ((case-fold-search t))
-    ;; If called already at the start of subprogram, go to the previous.
-    (beginning-of-line (if (bolp) 0 1))
-    (save-match-data
-      (or (looking-at fortran-start-prog-re)
-          ;; This leaves us at bob if before the first subprogram.
-          (eq (fortran-previous-statement) 'first-statement)
-          (if (or (catch 'ok
-                    (while (re-search-backward fortran-end-prog-re nil 'move)
-                      (if (fortran-check-end-prog-re) (throw 'ok t))))
-                  ;; If the search failed, must be at bob.
-                  ;; First code line is the start of the subprogram.
-                  ;; FIXME use a more rigorous test, cf fortran-next-statement?
-                  ;; Though that needs to handle continuations too.
-                  (not (looking-at "^\\([ \t]*[0-9]\\|[ \t]+[^!#]\\)")))
-              (fortran-next-statement))))))
+  (if (and arg
+           (< arg 0))
+      (progn
+        (fortran-end-of-subprogram)
+        (fortran-beginning-of-subprogram))
+    (let ((case-fold-search t))
+      ;; If called already at the start of subprogram, go to the previous.
+      (beginning-of-line (if (bolp) 0 1))
+      (save-match-data
+        (or (looking-at fortran-start-prog-re)
+            ;; This leaves us at bob if before the first subprogram.
+            (eq (fortran-previous-statement) 'first-statement)
+            (if (or (catch 'ok
+                      (while (re-search-backward fortran-end-prog-re nil 'move)
+                        (if (fortran-check-end-prog-re) (throw 'ok t))))
+                    ;; If the search failed, must be at bob.
+                    ;; First code line is the start of the subprogram.
+                    ;; FIXME use a more rigorous test, cf 
fortran-next-statement?
+                    ;; Though that needs to handle continuations too.
+                    (not (looking-at "^\\([ \t]*[0-9]\\|[ \t]+[^!#]\\)")))
+                (fortran-next-statement)))))))
 
 ;; This is simpler than f-beginning-of-s because the end of a
 ;; subprogram is never implicit.
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 9030056..1a96755 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1,6 +1,6 @@
 ;;; gdb-mi.el --- User Interface for running GDB  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Nick Roberts <nickrob@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
@@ -744,7 +744,7 @@ NOARG must be t when this macro is used outside `gud-def'."
       ;; Use the old gud-gbd filter, not because it works, but because it
       ;; will properly display GDB's answers rather than hanging waiting for
       ;; answers that aren't coming.
-      (set (make-local-variable 'gud-marker-filter) #'gud-gdb-marker-filter))
+      (setq-local gud-marker-filter #'gud-gdb-marker-filter))
     (funcall filter proc string)))
 
 (defvar gdb-control-level 0)
@@ -831,8 +831,8 @@ detailed description of this mode.
   (let ((proc (get-buffer-process gud-comint-buffer)))
     (add-function :around (process-filter proc) #'gdb--check-interpreter))
 
-  (set (make-local-variable 'gud-minor-mode) 'gdbmi)
-  (set (make-local-variable 'gdb-control-level) 0)
+  (setq-local gud-minor-mode 'gdbmi)
+  (setq-local gdb-control-level 0)
   (setq comint-input-sender 'gdb-send)
   (when (ring-empty-p comint-input-ring) ; cf shell-mode
     (let ((hfile (expand-file-name (or (getenv "GDBHISTFILE")
@@ -861,9 +861,9 @@ detailed description of this mode.
       (and (stringp hsize)
           (integerp (setq hsize (string-to-number hsize)))
           (> hsize 0)
-          (set (make-local-variable 'comint-input-ring-size) hsize))
+           (setq-local comint-input-ring-size hsize))
       (if (stringp hfile)
-         (set (make-local-variable 'comint-input-ring-file-name) hfile))
+          (setq-local comint-input-ring-file-name hfile))
       (comint-read-input-ring t)))
   (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
           "Set temporary breakpoint at current line.")
@@ -966,8 +966,7 @@ detailed description of this mode.
   (define-key gud-minor-mode-map [left-margin C-mouse-3]
     'gdb-mouse-jump)
 
-  (set (make-local-variable 'gud-gdb-completion-function)
-       'gud-gdbmi-completions)
+  (setq-local gud-gdb-completion-function 'gud-gdbmi-completions)
 
   (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
             nil 'local)
@@ -1141,8 +1140,8 @@ no input, and GDB is waiting for input."
                     (lambda () (gdb-tooltip-print expr)))))))
 
 (defun gdb-init-buffer ()
-  (set (make-local-variable 'gud-minor-mode) 'gdbmi)
-  (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+  (setq-local gud-minor-mode 'gdbmi)
+  (setq-local tool-bar-map gud-tool-bar-map)
   (when gud-tooltip-mode
     (make-local-variable 'gdb-define-alist)
     (gdb-create-define-alist)
@@ -1558,10 +1557,10 @@ this trigger is subscribed to `gdb-buf-publisher' and 
called with
            (when mode (funcall mode))
            (setq gdb-buffer-type buffer-type)
             (when thread
-              (set (make-local-variable 'gdb-thread-number) thread))
-           (set (make-local-variable 'gud-minor-mode)
-                (buffer-local-value 'gud-minor-mode gud-comint-buffer))
-           (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+              (setq-local gdb-thread-number thread))
+            (setq-local gud-minor-mode
+                        (buffer-local-value 'gud-minor-mode gud-comint-buffer))
+            (setq-local tool-bar-map gud-tool-bar-map)
             (rename-buffer (funcall (gdb-rules-name-maker rules)))
            (when trigger
               (gdb-add-subscriber gdb-buf-publisher
@@ -3010,7 +3009,7 @@ If NOPRESERVE is non-nil, window point is not restored 
after CUSTOM-DEFUN."
        (,custom-defun)
        (gdb-update-buffer-name)
        ,@(when (not nopreserve)
-          '((set-window-start window start)
+          '((set-window-start window start t)
             (set-window-point window p))))))
 
 (defmacro def-gdb-trigger-and-handler (trigger-name gdb-command
@@ -3128,24 +3127,27 @@ See `def-gdb-auto-update-handler'."
   (concat "fullname=\\(" gdb--string-regexp "\\)"))
 
 (defun gdb-get-location (bptno line flag)
-  "Find the directory containing the relevant source file.
-Put in buffer and place breakpoint icon."
+  "Glean name of source file using `gdb-source-file-regexp', and visit it.
+Place breakpoint icon in its buffer."
   (goto-char (point-min))
   (catch 'file-not-found
-    (if (re-search-forward gdb-source-file-regexp nil t)
-       (delete (cons bptno "File not found") gdb-location-alist)
-      ;; FIXME: Why/how do we use (match-string 1) when the search failed?
-      (push (cons bptno (match-string 1)) gdb-location-alist)
-      (gdb-resync)
-      (unless (assoc bptno gdb-location-alist)
-       (push (cons bptno "File not found") gdb-location-alist)
-       (message-box "Cannot find source file for breakpoint location.
+    (let (source-file)
+      (if (re-search-forward gdb-source-file-regexp nil t)
+          (progn
+            (setq source-file (gdb-mi--c-string-from-string (match-string 1)))
+            (delete (cons bptno "File not found") gdb-location-alist)
+            (push (cons bptno source-file) gdb-location-alist))
+        (gdb-resync)
+        (unless (assoc bptno gdb-location-alist)
+         (push (cons bptno "File not found") gdb-location-alist)
+         (message-box "Cannot find source file for breakpoint location.
 Add directory to search path for source files using the GDB command, dir."))
-      (throw 'file-not-found nil))
-    (with-current-buffer (find-file-noselect (match-string 1))
-      (gdb-init-buffer)
-      ;; only want one breakpoint icon at each location
-      (gdb-put-breakpoint-icon (eq flag ?y) bptno (string-to-number line)))))
+        (throw 'file-not-found nil))
+      (with-current-buffer (find-file-noselect source-file)
+        (gdb-init-buffer)
+        ;; Only want one breakpoint icon at each location.
+        (gdb-put-breakpoint-icon (string-equal flag "y") bptno
+                                 (string-to-number line))))))
 
 (add-hook 'find-file-hook 'gdb-find-file-hook)
 
@@ -3364,8 +3366,7 @@ corresponding to the mode line clicked."
   (setq gdb-thread-position (make-marker))
   (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position)
   (setq header-line-format gdb-threads-header)
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-threads-font-lock-keywords))
+  (setq-local font-lock-defaults '(gdb-threads-font-lock-keywords))
   'gdb-invalidate-threads)
 
 (defun gdb-thread-list-handler-custom ()
@@ -3920,8 +3921,7 @@ DOC is an optional documentation string."
 (define-derived-mode gdb-memory-mode gdb-parent-mode "Memory"
   "Major mode for examining memory."
   (setq header-line-format gdb-memory-header)
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-memory-font-lock-keywords))
+  (setq-local font-lock-defaults '(gdb-memory-font-lock-keywords))
   'gdb-invalidate-memory)
 
 (defun gdb-memory-buffer-name ()
@@ -4013,9 +4013,8 @@ DOC is an optional documentation string."
   ;; TODO Rename overlay variable for disassembly mode
   (add-to-list 'overlay-arrow-variable-list 'gdb-disassembly-position)
   (setq fringes-outside-margins t)
-  (set (make-local-variable 'gdb-disassembly-position) (make-marker))
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-disassembly-font-lock-keywords))
+  (setq-local gdb-disassembly-position (make-marker))
+  (setq-local font-lock-defaults '(gdb-disassembly-font-lock-keywords))
   'gdb-invalidate-disassembly)
 
 (defun gdb-disassembly-handler-custom ()
@@ -4222,8 +4221,7 @@ member."
   (setq gdb-stack-position (make-marker))
   (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
   (setq truncate-lines t)  ;; Make it easier to see overlay arrow.
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-frames-font-lock-keywords))
+  (setq-local font-lock-defaults '(gdb-frames-font-lock-keywords))
   'gdb-invalidate-frames)
 
 (defun gdb-select-frame (&optional event)
diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el
index ab65a15..a0f5d36 100644
--- a/lisp/progmodes/glasses.el
+++ b/lisp/progmodes/glasses.el
@@ -1,6 +1,6 @@
 ;;; glasses.el --- make cantReadThis readable  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Milan Zamazal <pdm@zamazal.org>
 ;; Keywords: tools
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index dafba22..1a8435f 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -1,6 +1,6 @@
 ;;; grep.el --- run `grep' and display the results  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1987, 1993-1999, 2001-2020 Free Software
+;; Copyright (C) 1985-1987, 1993-1999, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Roland McGrath <roland@gnu.org>
@@ -79,7 +79,7 @@ This option sets the environment variable GREP_COLORS to 
specify
 markers for highlighting and adds the --color option in front of
 any explicit grep options before starting the grep.
 
-When this option is `auto', grep uses `--color' to highlight
+When this option is `auto', grep uses `--color=auto' to highlight
 matches only when it outputs to a terminal (when `grep' is the last
 command in the pipe), thus avoiding the use of any potentially-harmful
 escape sequences when standard output goes to a file or pipe.
@@ -95,12 +95,12 @@ To change the default value, use \\[customize] or call the 
function
   :type '(choice (const :tag "Do not highlight matches with grep markers" nil)
                 (const :tag "Highlight matches with grep markers" t)
                 (const :tag "Use --color=always" always)
-                (const :tag "Use --color" auto)
+                (const :tag "Use --color=auto" auto)
                 (other :tag "Not Set" auto-detect))
   :set #'grep-apply-setting
   :version "22.1")
 
-(defcustom grep-match-regexp "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m"
+(defcustom grep-match-regexp "\033\\[\\(?:0?1;\\)?31m\\(.*?\\)\033\\[[0-9]*m"
   "Regular expression matching grep markers to highlight.
 It matches SGR ANSI escape sequences which are emitted by grep to
 color its output.  This variable is used in `grep-filter'."
@@ -412,7 +412,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] 
modifies
                (- mend beg))))))
      nil nil
      (3 '(face nil display ":")))
-    ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1))
+    ("^Binary file \\(.+\\) matches" 1 nil nil 0 1))
   "Regexp used to match grep hits.
 See `compilation-error-regexp-alist' for format details.")
 
@@ -568,8 +568,7 @@ Set up `compilation-exit-message-function' and run 
`grep-setup-hook'."
     ;; GREP_COLORS is used in GNU grep 2.5.2 and later versions
     (setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:sl=:cx=:ne"))
   (setq-local grep-num-matches-found 0)
-  (set (make-local-variable 'compilation-exit-message-function)
-       #'grep-exit-message)
+  (setq-local compilation-exit-message-function #'grep-exit-message)
   (run-hooks 'grep-setup-hook))
 
 (defun grep-exit-message (status code msg)
@@ -744,7 +743,7 @@ The value depends on `grep-command', `grep-template',
                                `(nil nil nil "--color" "x" ,(null-device))
                                nil 1)
                               (if (eq grep-highlight-matches 'always)
-                                  "--color=always" "--color"))
+                                  "--color=always" "--color=auto"))
                          "")
                         grep-options)))
        (unless grep-template
@@ -880,22 +879,22 @@ The value depends on `grep-command', `grep-template',
 (define-compilation-mode grep-mode "Grep"
   "Sets `grep-last-buffer' and `compilation-window-height'."
   (setq grep-last-buffer (current-buffer))
-  (set (make-local-variable 'tool-bar-map) grep-mode-tool-bar-map)
-  (set (make-local-variable 'compilation-error-face)
-       grep-hit-face)
-  (set (make-local-variable 'compilation-error-regexp-alist)
-       grep-regexp-alist)
-  (set (make-local-variable 'compilation-mode-line-errors)
-       grep-mode-line-matches)
+  (setq-local tool-bar-map grep-mode-tool-bar-map)
+  (setq-local compilation-error-face
+              grep-hit-face)
+  (setq-local compilation-error-regexp-alist
+              grep-regexp-alist)
+  (setq-local compilation-mode-line-errors
+              grep-mode-line-matches)
   ;; compilation-directory-matcher can't be nil, so we set it to a regexp that
   ;; can never match.
-  (set (make-local-variable 'compilation-directory-matcher)
-       (list regexp-unmatchable))
-  (set (make-local-variable 'compilation-process-setup-function)
-       #'grep-process-setup)
-  (set (make-local-variable 'compilation-disable-input) t)
-  (set (make-local-variable 'compilation-error-screen-columns)
-       grep-error-screen-columns)
+  (setq-local compilation-directory-matcher
+              (list regexp-unmatchable))
+  (setq-local compilation-process-setup-function
+              #'grep-process-setup)
+  (setq-local compilation-disable-input t)
+  (setq-local compilation-error-screen-columns
+              grep-error-screen-columns)
   (add-hook 'compilation-filter-hook #'grep-filter nil t))
 
 (defun grep--save-buffers ()
@@ -1001,7 +1000,7 @@ these include `opts', `dir', `files', `null-device', 
`excl' and
                             ((eq grep-highlight-matches 'always)
                              (push "--color=always" opts))
                             ((eq grep-highlight-matches 'auto)
-                             (push "--color" opts)))
+                             (push "--color=auto" opts)))
                            opts))
                 (excl . ,excl)
                 (dir . ,dir)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 279a70b..259da2f 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1,6 +1,6 @@
 ;;; gud.el --- Grand Unified Debugger mode for running GDB and other debuggers 
 -*- lexical-binding:t -*-
 
-;; Copyright (C) 1992-1996, 1998, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1992-1996, 1998, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
@@ -1683,7 +1683,7 @@ and source-file directory for your debugger."
 
 ;;;###autoload
 (defun pdb (command-line)
-  "Run COMMAND-LINE in the `*gud-FILE*' buffer.
+  "Run COMMAND-LINE in the `*gud-FILE*' buffer to debug Python programs.
 
 COMMAND-LINE should include the pdb executable
 name (`gud-pdb-command-name') and the file to be debugged.
@@ -2566,7 +2566,11 @@ You may use the `gud-def' macro in the initialization 
hook to define other
 commands.
 
 Other commands for interacting with the debugger process are inherited from
-comint mode, which see."
+`comint-mode', which see.
+
+Commands:
+
+\\{gud-mode-map}"
   (setq mode-line-process '(":%s"))
   (define-key (current-local-map) "\C-c\C-l" 'gud-refresh)
   (setq-local gud-last-frame nil)
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el
index 25e7523..923f85f 100644
--- a/lisp/progmodes/hideif.el
+++ b/lisp/progmodes/hideif.el
@@ -1,6 +1,6 @@
 ;;; hideif.el --- hides selected code within ifdef  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1988, 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Brian Marick
 ;;     Daniel LaLiberte <liberte@holonexus.org>
@@ -153,8 +153,8 @@ The first time we visit such a file, 
_XXX_HEADER_FILE_INCLUDED_ is
 undefined, and so nothing is hidden.  The next time we visit it, everything 
will
 be hidden.
 
-This behavior is generally undesirable.  If this option is non-nil, the 
outermost
-#if is always visible."
+This behavior is generally undesirable.  If this option is non-nil, the
+outermost #if is always visible."
   :type 'boolean
   :version "25.1")
 
@@ -302,17 +302,17 @@ Several variables affect how the hiding is done:
         ;; We can still simulate the behavior of older hideif versions (i.e.
         ;; `hide-ifdef-env' being buffer local) by clearing this variable
         ;; (C-c @ C) every time before hiding current buffer.
-;;      (set (make-local-variable 'hide-ifdef-env)
+;;      (setq-local hide-ifdef-env
 ;;           (default-value 'hide-ifdef-env))
-        (set 'hide-ifdef-env (default-value 'hide-ifdef-env))
+        (setq hide-ifdef-env (default-value 'hide-ifdef-env))
         ;; Some C/C++ headers might have other ways to prevent reinclusion and
         ;; thus would like `hide-ifdef-expand-reinclusion-protection' to be 
nil.
-        (set (make-local-variable 'hide-ifdef-expand-reinclusion-protection)
-             (default-value 'hide-ifdef-expand-reinclusion-protection))
-        (set (make-local-variable 'hide-ifdef-hiding)
-             (default-value 'hide-ifdef-hiding))
-        (set (make-local-variable 'hif-outside-read-only) buffer-read-only)
-        (set (make-local-variable 'line-move-ignore-invisible) t)
+        (setq-local hide-ifdef-expand-reinclusion-protection
+                    (default-value 'hide-ifdef-expand-reinclusion-protection))
+        (setq-local hide-ifdef-hiding
+                    (default-value 'hide-ifdef-hiding))
+        (setq-local hif-outside-read-only buffer-read-only)
+        (setq-local line-move-ignore-invisible t)
         (add-hook 'change-major-mode-hook
                   (lambda () (hide-ifdef-mode -1)) nil t)
 
@@ -1792,7 +1792,7 @@ It does not do the work that's pointless to redo on a 
recursive entry."
 (defun hide-ifdef-toggle-shadowing ()
   "Toggle shadowing."
   (interactive)
-  (set (make-local-variable 'hide-ifdef-shadow) (not hide-ifdef-shadow))
+  (setq-local hide-ifdef-shadow (not hide-ifdef-shadow))
   (message "Shadowing %s" (if hide-ifdef-shadow "ON" "OFF"))
   (save-restriction
     (widen)
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index c882b7b..73d09e0 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -1,6 +1,6 @@
 ;;; hideshow.el --- minor mode cmds to selectively display code/comment blocks 
 -*- lexical-binding:t -*-
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Thien-Thi Nguyen <ttn@gnu.org>
 ;;      Dan Nicolaescu <dann@ics.uci.edu>
diff --git a/lisp/progmodes/icon.el b/lisp/progmodes/icon.el
index dd0ee95..933cb33 100644
--- a/lisp/progmodes/icon.el
+++ b/lisp/progmodes/icon.el
@@ -1,6 +1,6 @@
 ;;; icon.el --- mode for editing Icon code
 
-;; Copyright (C) 1989, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Chris Smith <csmith@convex.com>
 ;; Created: 15 Feb 89
diff --git a/lisp/progmodes/idlw-complete-structtag.el 
b/lisp/progmodes/idlw-complete-structtag.el
index 4cb8278..25bc5ad 100644
--- a/lisp/progmodes/idlw-complete-structtag.el
+++ b/lisp/progmodes/idlw-complete-structtag.el
@@ -1,6 +1,6 @@
 ;;; idlw-complete-structtag.el --- Completion of structure tags.
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@astro.uva.nl>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el
index af1a1b1..2e7b0aa 100644
--- a/lisp/progmodes/idlw-help.el
+++ b/lisp/progmodes/idlw-help.el
@@ -1,6 +1,6 @@
 ;;; idlw-help.el --- HTML Help code for IDLWAVE
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 ;;
 ;; Authors: JD Smith <jd.smith@utoledo.edu>
 ;;          Carsten Dominik <dominik@science.uva.nl>
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index 31f1845..4bc5224 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -1,6 +1,6 @@
 ;; idlw-shell.el --- run IDL as an inferior process of Emacs.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Authors: JD Smith <jd.smith@utoledo.edu>
 ;;          Carsten Dominik <dominik@astro.uva.nl>
diff --git a/lisp/progmodes/idlw-toolbar.el b/lisp/progmodes/idlw-toolbar.el
index 1866e50..4bd0afb 100644
--- a/lisp/progmodes/idlw-toolbar.el
+++ b/lisp/progmodes/idlw-toolbar.el
@@ -1,6 +1,6 @@
 ;;; idlw-toolbar.el --- a debugging toolbar for IDLWAVE
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@astro.uva.nl>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 9107086..c118924 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -1,6 +1,6 @@
 ;; idlwave.el --- IDL editing mode for GNU Emacs
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Authors: JD Smith <jd.smith@utoledo.edu>
 ;;          Carsten Dominik <dominik@science.uva.nl>
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 59db646..ac23059 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -1,6 +1,6 @@
 ;;; inf-lisp.el --- an inferior-lisp mode
 
-;; Copyright (C) 1988, 1993-1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1988, 1993-1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Olin Shivers <shivers@cs.cmu.edu>
@@ -124,9 +124,9 @@ mode.  Default is whitespace followed by 0 or 1 
single-letter colon-keyword
 (define-key lisp-mode-map "\C-c\C-v" 'lisp-show-variable-documentation)
 
 
-;;; This function exists for backwards compatibility.
-;;; Previous versions of this package bound commands to C-c <letter>
-;;; bindings, which is not allowed by the Emacs standard.
+;; This function exists for backwards compatibility.
+;; Previous versions of this package bound commands to C-c <letter>
+;; bindings, which is not allowed by the Emacs standard.
 
 ;;;  "This function binds many inferior-lisp commands to C-c <letter> bindings,
 ;;;where they are more accessible. C-c <letter> bindings are reserved for the
@@ -274,7 +274,8 @@ If you accidentally suspend your process, use 
\\[comint-continue-subjob]
 to continue it."
   (setq comint-prompt-regexp inferior-lisp-prompt)
   (setq mode-line-process '(":%s"))
-  (lisp-mode-variables t)
+  (lisp-mode-variables)
+  (set-syntax-table lisp-mode-syntax-table)
   (setq comint-get-old-input (function lisp-get-old-input))
   (setq comint-input-filter (function lisp-input-filter)))
 
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index f3cfbbb..33bea59 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1,6 +1,6 @@
 ;;; js.el --- Major mode for editing JavaScript  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Karl Landstrom <karl.landstrom@brgeight.se>
 ;;         Daniel Colascione <dancol@dancol.org>
diff --git a/lisp/progmodes/ld-script.el b/lisp/progmodes/ld-script.el
index 656af69..c4ea8e1 100644
--- a/lisp/progmodes/ld-script.el
+++ b/lisp/progmodes/ld-script.el
@@ -1,6 +1,6 @@
 ;;; ld-script.el --- GNU linker script editing mode for Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Masatake YAMATO <yamato@redhat.com>
 ;; Keywords: languages, faces
diff --git a/lisp/progmodes/m4-mode.el b/lisp/progmodes/m4-mode.el
index ec0f425..99f4be3 100644
--- a/lisp/progmodes/m4-mode.el
+++ b/lisp/progmodes/m4-mode.el
@@ -1,6 +1,6 @@
 ;;; m4-mode.el --- m4 code editing commands for Emacs  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1996-1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Andrew Csillag <drew@thecsillags.com>
 ;; Keywords: languages, faces
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 3e49f84..a0e09f5 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -1,6 +1,6 @@
 ;;; make-mode.el --- makefile editing commands for Emacs -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1992, 1994, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1994, 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Thomas Neumann <tom@smart.bo.open.de>
 ;;     Eric S. Raymond <esr@snark.thyrsus.com>
@@ -343,8 +343,9 @@ not be enclosed in { } or ( )."
   "List of keywords understood by gmake.")
 
 (defconst makefile-bsdmake-statements
-  '(".elif" ".elifdef" ".elifmake" ".elifndef" ".elifnmake" ".else" ".endfor"
-    ".endif" ".for" ".if" ".ifdef" ".ifmake" ".ifndef" ".ifnmake" ".undef")
+  '("elif" "elifdef" "elifmake" "elifndef" "elifnmake" "else" "endfor"
+    "endif" "for" "if" "ifdef" "ifmake" "ifndef" "ifnmake" "poison"
+    "undef" "include")
   "List of keywords understood by BSD make.")
 
 (defun makefile-make-font-lock-keywords (var keywords space
@@ -376,8 +377,9 @@ not be enclosed in { } or ( )."
     ("[^$]\\(\\$[@%*]\\)"
      1 'makefile-targets append)
 
-    ;; Fontify conditionals and includes.
-    (,(concat "^\\(?: [ \t]*\\)?"
+    ,@(if keywords
+          ;; Fontify conditionals and includes.
+          `((,(concat "^\\(?: [ \t]*\\)?"
              (replace-regexp-in-string
               " " "[ \t]+"
               (if (eq (car keywords) t)
@@ -385,7 +387,7 @@ not be enclosed in { } or ( )."
                                              (regexp-opt (cdr keywords) t))
                 (regexp-opt keywords t)))
              "\\>[ \t]*\\([^: \t\n#]*\\)")
-     (1 font-lock-keyword-face) (2 font-lock-variable-name-face))
+             (1 font-lock-keyword-face) (2 font-lock-variable-name-face))))
 
     ,@(if negation
          `((,negation (1 font-lock-negation-char-face prepend)
@@ -493,13 +495,17 @@ not be enclosed in { } or ( )."
      1 'makefile-makepp-perl t)))
 
 (defconst makefile-bsdmake-font-lock-keywords
-  (makefile-make-font-lock-keywords
-   ;; A lot more could be done for variables here:
-   makefile-var-use-regex
-   makefile-bsdmake-statements
-   t
-   "^\\(?: [ \t]*\\)?\\.\\(?:el\\)?if\\(n?\\)\\(?:def\\|make\\)?\\>[ 
\t]*\\(!?\\)"
-   '("^[ \t]*\\.for[ \t].+[ \t]\\(in\\)\\>" 1 font-lock-keyword-face)))
+  (append
+   (makefile-make-font-lock-keywords
+    ;; A lot more could be done for variables here:
+    makefile-var-use-regex
+    nil
+    t
+    "^\\(?: [ \t]*\\)?\\.\\(?:el\\)?if\\(n?\\)\\(?:def\\|make\\)?\\>[ 
\t]*\\(!?\\)"
+    '("^[ \t]*\\.for[ \t].+[ \t]\\(in\\)\\>" 1 font-lock-keyword-face))
+   `((,(concat "^\\. *" (regexp-opt makefile-bsdmake-statements) "\\>") 0
+      font-lock-keyword-face))))
+
 
 (defconst makefile-imake-font-lock-keywords
   (append
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el
index 87c20a2..9da968c 100644
--- a/lisp/progmodes/meta-mode.el
+++ b/lisp/progmodes/meta-mode.el
@@ -1,6 +1,6 @@
 ;;; meta-mode.el --- major mode for editing Metafont or MetaPost sources -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Ulrik Vieth <vieth@thphy.uni-duesseldorf.de>
 ;; Version: 1.0
@@ -919,57 +919,55 @@ The environment marked is the one that contains point or 
follows point."
 (define-derived-mode meta-common-mode prog-mode "-Meta-common-"
   "Common initialization for Metafont or MetaPost mode."
   :abbrev-table meta-mode-abbrev-table
-  (set (make-local-variable 'paragraph-start)
-       (concat page-delimiter "\\|$"))
-  (set (make-local-variable 'paragraph-separate)
-       (concat page-delimiter "\\|$"))
+  (setq-local paragraph-start (concat page-delimiter "\\|$"))
+  (setq-local paragraph-separate (concat page-delimiter "\\|$"))
 
-  (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
+  (setq-local paragraph-ignore-fill-prefix t)
 
-  (set (make-local-variable 'comment-start-skip) "%+[ \t\f]*")
-  (set (make-local-variable 'comment-start) "%")
-  (set (make-local-variable 'comment-end) "")
-  (set (make-local-variable 'comment-multi-line) nil)
+  (setq-local comment-start-skip "%+[ \t\f]*")
+  (setq-local comment-start "%")
+  (setq-local comment-end "")
+  (setq-local comment-multi-line nil)
 
   ;; We use `back-to-indentation' but \f is no indentation sign.
   (modify-syntax-entry ?\f "_   ")
 
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  (setq-local parse-sexp-ignore-comments t)
 
   (add-hook 'completion-at-point-functions #'meta-completions-at-point nil t)
-  (set (make-local-variable 'comment-indent-function) #'meta-comment-indent)
-  (set (make-local-variable 'indent-line-function) #'meta-indent-line)
+  (setq-local comment-indent-function #'meta-comment-indent)
+  (setq-local indent-line-function #'meta-indent-line)
   ;; No need to define a mode-specific 'indent-region-function.
   ;; Simply use the generic 'indent-region and 'comment-region.
 
   ;; Set defaults for font-lock mode.
-  (set (make-local-variable 'font-lock-defaults)
-       '(meta-font-lock-keywords
-         nil nil ((?_ . "w")) nil
-         (font-lock-comment-start-regexp . "%"))))
+  (setq-local font-lock-defaults
+              '(meta-font-lock-keywords
+                nil nil ((?_ . "w")) nil
+                (font-lock-comment-start-regexp . "%"))))
 
 
 ;;;###autoload
 (define-derived-mode metafont-mode meta-common-mode "Metafont"
   "Major mode for editing Metafont sources."
   ;; Set defaults for completion function.
-  (set (make-local-variable 'meta-symbol-list) nil)
-  (set (make-local-variable 'meta-symbol-changed) nil)
+  (setq-local meta-symbol-list nil)
+  (setq-local meta-symbol-changed nil)
   (apply 'meta-add-symbols metafont-symbol-list)
-  (set (make-local-variable 'meta-complete-list)
-        (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list)
-              (list "" 'ispell-complete-word))))
+  (setq-local meta-complete-list
+              (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list)
+                    (list "" 'ispell-complete-word))))
 
 ;;;###autoload
 (define-derived-mode metapost-mode meta-common-mode "MetaPost"
   "Major mode for editing MetaPost sources."
   ;; Set defaults for completion function.
-  (set (make-local-variable 'meta-symbol-list) nil)
-  (set (make-local-variable 'meta-symbol-changed) nil)
+  (setq-local meta-symbol-list nil)
+  (setq-local meta-symbol-changed nil)
   (apply 'meta-add-symbols metapost-symbol-list)
-  (set (make-local-variable 'meta-complete-list)
-        (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list)
-              (list "" 'ispell-complete-word))))
+  (setq-local meta-complete-list
+              (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list)
+                    (list "" 'ispell-complete-word))))
 
 
 ;;; Just in case ...
diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el
index 1f88e87..59e87b8 100644
--- a/lisp/progmodes/mixal-mode.el
+++ b/lisp/progmodes/mixal-mode.el
@@ -1,6 +1,6 @@
 ;;; mixal-mode.el --- Major mode for the mix asm language.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Pieter E.J. Pareit <pieter.pareit@gmail.com>
 ;; Maintainer: Jose A Ortega Ruiz <jao@gnu.org>
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index c313ad1..a14a8d7 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -1,6 +1,6 @@
 ;;; octave.el --- editing octave source files under emacs  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Kurt Hornik <Kurt.Hornik@wu-wien.ac.at>
 ;;        John Eaton <jwe@octave.org>
@@ -1512,28 +1512,12 @@ current buffer file unless called with a prefix arg 
\\[universal-argument]."
   (interactive "r")
   (inferior-octave t)
   (let ((proc inferior-octave-process)
-        (string (buffer-substring-no-properties beg end))
-        line)
+        (string (buffer-substring-no-properties beg end)))
     (with-current-buffer inferior-octave-buffer
       ;; https://lists.gnu.org/r/emacs-devel/2013-10/msg00095.html
       (compilation-forget-errors)
-      (setq inferior-octave-output-list nil)
-      (while (not (string-equal string ""))
-        (if (string-match "\n" string)
-            (setq line (substring string 0 (match-beginning 0))
-                  string (substring string (match-end 0)))
-          (setq line string string ""))
-        (setq inferior-octave-receive-in-progress t)
-        (inferior-octave-send-list-and-digest (list (concat line "\n")))
-        (while inferior-octave-receive-in-progress
-          (accept-process-output proc))
-        (insert-before-markers
-         (mapconcat 'identity
-                    (append
-                     (if octave-send-echo-input (list line) (list ""))
-                     inferior-octave-output-list
-                     (list inferior-octave-output-string))
-                    "\n")))))
+      (insert-before-markers string "\n")
+      (comint-send-string proc (concat string "\n"))))
   (if octave-send-show-buffer
       (display-buffer inferior-octave-buffer)))
 
@@ -1605,8 +1589,9 @@ code line."
 
 (defun octave-eldoc-function-signatures (fn)
   (unless (equal fn (car octave-eldoc-cache))
-    (inferior-octave-send-list-and-digest
-     (list (format "print_usage ('%s');\n" fn)))
+    (while-no-input
+      (inferior-octave-send-list-and-digest
+       (list (format "print_usage ('%s');\n" fn))))
     (let (result)
       (dolist (line inferior-octave-output-list)
         ;; The help output has changed a few times in GNU Octave.
diff --git a/lisp/progmodes/opascal.el b/lisp/progmodes/opascal.el
index 8c06099..662d2b4 100644
--- a/lisp/progmodes/opascal.el
+++ b/lisp/progmodes/opascal.el
@@ -1,6 +1,6 @@
 ;;; opascal.el --- major mode for editing Object Pascal source in Emacs  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1998-1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Authors: Ray Blaak <blaak@infomatch.com>,
 ;;          Simon South <ssouth@member.fsf.org>
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index fce059b..59f90d7 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -1,6 +1,6 @@
 ;;; pascal.el --- major mode for editing pascal source in Emacs -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1993-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-2021 Free Software Foundation, Inc.
 
 ;; Author: Espen Skoglund <esk@gnu.org>
 ;; Keywords: languages
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index fd8a51b..ec20b01 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -1,6 +1,6 @@
 ;;; perl-mode.el --- Perl code editing commands for GNU Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1990, 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: William F. Mann
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index d3d3dea..d88d350 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -1,6 +1,6 @@
 ;;; prog-mode.el --- Generic major mode for programming  -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 449eadc..d417382 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1,7 +1,7 @@
 ;;; project.el --- Operations on the current project  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
-;; Version: 0.5.2
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
+;; Version: 0.5.3
 ;; Package-Requires: ((emacs "26.3") (xref "1.0.2"))
 
 ;; This is a GNU ELPA :core package.  Avoid using functionality that
@@ -631,6 +631,7 @@ DIRS must contain directory names."
     (define-key map "g" 'project-find-regexp)
     (define-key map "G" 'project-or-external-find-regexp)
     (define-key map "r" 'project-query-replace-regexp)
+    (define-key map "x" 'project-execute-extended-command)
     map)
   "Keymap for project commands.")
 
@@ -1246,48 +1247,104 @@ It's also possible to enter an arbitrary directory not 
in the list."
   (project--ensure-read-project-list)
   (mapcar #'car project--list))
 
+;;;###autoload
+(defun project-execute-extended-command ()
+  "Execute an extended command in project root."
+  (declare (interactive-only command-execute))
+  (interactive)
+  (let ((default-directory (project-root (project-current t))))
+    (call-interactively #'execute-extended-command)))
+
 
 ;;; Project switching
 
 ;;;###autoload
-(defvar project-switch-commands
-  '((?f "Find file" project-find-file)
-    (?g "Find regexp" project-find-regexp)
-    (?d "Dired" project-dired)
-    (?v "VC-Dir" project-vc-dir)
-    (?e "Eshell" project-eshell))
-  "Alist mapping keys to project switching menu entries.
+(defcustom project-switch-commands
+  '((project-find-file "Find file")
+    (project-find-regexp "Find regexp")
+    (project-dired "Dired")
+    (project-vc-dir "VC-Dir")
+    (project-eshell "Eshell"))
+  "Alist mapping commands to descriptions.
 Used by `project-switch-project' to construct a dispatch menu of
 commands available upon \"switching\" to another project.
 
-Each element is of the form (KEY LABEL COMMAND), where COMMAND is the
-command to run when KEY is pressed.  LABEL is used to distinguish
-the menu entries in the dispatch menu.")
+Each element is of the form (COMMAND LABEL &optional KEY) where
+COMMAND is the command to run when KEY is pressed.  LABEL is used
+to distinguish the menu entries in the dispatch menu.  If KEY is
+absent, COMMAND must be bound in `project-prefix-map', and the
+key is looked up in that map."
+  :version "28.1"
+  :package-version '(project . "0.6.0")
+  :type '(repeat
+          (list
+           (symbol :tag "Command")
+           (string :tag "Label")
+           (choice :tag "Key to press"
+            (const :tag "Infer from the keymap" nil)
+            (character :tag "Explicit key")))))
+
+(defcustom project-switch-use-entire-map nil
+  "Make `project-switch-project' use entire `project-prefix-map'.
+If nil, `project-switch-project' will only recognize commands
+listed in `project-switch-commands' and signal an error when
+others are invoked.  Otherwise, all keys in `project-prefix-map'
+are legal even if they aren't listed in the dispatch menu."
+  :type 'boolean
+  :version "28.1")
 
 (defun project--keymap-prompt ()
   "Return a prompt for the project switching dispatch menu."
   (mapconcat
-   (pcase-lambda (`(,key ,label))
-     (format "[%s] %s"
-             (propertize (key-description `(,key)) 'face 'bold)
-             label))
+   (pcase-lambda (`(,cmd ,label ,key))
+     (when (characterp cmd) ; Old format, apparently user-customized.
+       (let ((tmp cmd))
+         ;; TODO: Add a deprecation warning, probably.
+         (setq cmd key
+               key tmp)))
+     (let ((key (if key
+                    (vector key)
+                  (where-is-internal cmd project-prefix-map t))))
+       (format "[%s] %s"
+               (propertize (key-description key) 'face 'bold)
+               label)))
    project-switch-commands
    "  "))
 
 ;;;###autoload
-(defun project-switch-project ()
+(defun project-switch-project (dir)
   "\"Switch\" to another project by running an Emacs command.
 The available commands are presented as a dispatch menu
-made from `project-switch-commands'."
-  (interactive)
-  (let ((dir (project-prompt-project-dir))
-        (choice nil))
-    (while (not choice)
-      (setq choice (assq (read-event (project--keymap-prompt))
-                         project-switch-commands)))
+made from `project-switch-commands'.
+
+When called in a program, it will use the project corresponding
+to directory DIR."
+  (interactive (list (project-prompt-project-dir)))
+  (let ((commands-menu
+         (mapcar
+          (lambda (row)
+            (if (characterp (car row))
+                ;; Deprecated format.
+                ;; XXX: Add a warning about it?
+                (reverse row)
+              row))
+          project-switch-commands))
+        command)
+    (while (not command)
+      (let ((choice (read-event (project--keymap-prompt))))
+        (when (setq command
+                    (or (car
+                         (seq-find (lambda (row) (equal choice (nth 2 row)))
+                                   commands-menu))
+                        (lookup-key project-prefix-map (vector choice))))
+          (unless (or project-switch-use-entire-map
+                      (assq command commands-menu))
+            ;; TODO: Add some hint to the prompt, like "key not
+            ;; recognized" or something.
+            (setq command nil)))))
     (let ((default-directory dir)
           (project-current-inhibit-prompt t))
-      (call-interactively (nth 2 choice)))))
+      (call-interactively command))))
 
 (provide 'project)
 ;;; project.el ends here
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index a4e677b..c8f6c12 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -1,6 +1,6 @@
 ;;; prolog.el --- major mode for Prolog (and Mercury) -*- lexical-binding:t -*-
 
-;; Copyright (C) 1986-1987, 1997-1999, 2002-2003, 2011-2020 Free
+;; Copyright (C) 1986-1987, 1997-1999, 2002-2003, 2011-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Authors: Emil Åström <emil_astrom(at)hotmail(dot)com>
diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el
index 6db7a14..15fd2e8 100644
--- a/lisp/progmodes/ps-mode.el
+++ b/lisp/progmodes/ps-mode.el
@@ -1,6 +1,6 @@
 ;;; ps-mode.el --- PostScript mode for GNU Emacs
 
-;; Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author:     Peter Kleiweg <p.c.j.kleiweg@rug.nl>
 ;; Created:    20 Aug 1997
@@ -501,18 +501,18 @@ point to the corresponding spot in the PostScript window, 
if input
 to the interpreter was sent from that window.
 Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the 
number has the same effect."
   (setq-local syntax-propertize-function #'ps-mode-syntax-propertize)
-  (set (make-local-variable 'font-lock-defaults)
-       '((ps-mode-font-lock-keywords
-         ps-mode-font-lock-keywords-1
-         ps-mode-font-lock-keywords-2
-         ps-mode-font-lock-keywords-3)
-        nil))
+  (setq-local font-lock-defaults
+              '((ps-mode-font-lock-keywords
+                 ps-mode-font-lock-keywords-1
+                 ps-mode-font-lock-keywords-2
+                 ps-mode-font-lock-keywords-3)
+                nil))
   (smie-setup nil #'ps-mode-smie-rules)
   (setq-local electric-indent-chars
               (append '(?> ?\] ?\}) electric-indent-chars))
-  (set (make-local-variable 'comment-start) "%")
+  (setq-local comment-start "%")
   ;; NOTE: `\' has a special meaning in strings only
-  (set (make-local-variable 'comment-start-skip) "%+[ \t]*")
+  (setq-local comment-start-skip "%+[ \t]*")
   ;; enable doc-view-minor-mode => C-c C-c starts viewing the current ps file
   ;; with doc-view-mode.
   (doc-view-minor-mode 1))
@@ -910,11 +910,11 @@ plus the usually uncoded characters inserted on positions 
1 through 28."
 (define-derived-mode ps-run-mode comint-mode "Interactive PS"
   "Major mode in interactive PostScript window.
 This mode is invoked from `ps-mode' and should not be called directly."
-  (set (make-local-variable 'font-lock-defaults)
-       '((ps-run-font-lock-keywords
-         ps-run-font-lock-keywords-1
-         ps-run-font-lock-keywords-2)
-        t))
+  (setq-local font-lock-defaults
+              '((ps-run-font-lock-keywords
+                 ps-run-font-lock-keywords-1
+                 ps-run-font-lock-keywords-2)
+                t))
   (setq mode-line-process '(":%s")))
 
 (defun ps-run-running ()
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index e9c3b39..0965fec 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1,11 +1,11 @@
 ;;; python.el --- Python's flying circus support for Emacs -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Fabián E. Gallina <fgallina@gnu.org>
 ;; URL: https://github.com/fgallina/python.el
-;; Version: 0.27
-;; Package-Requires: ((emacs "24.1") (cl-lib "1.0"))
+;; Version: 0.27.1
+;; Package-Requires: ((emacs "24.2") (cl-lib "1.0"))
 ;; Maintainer: emacs-devel@gnu.org
 ;; Created: Jul 2010
 ;; Keywords: languages
@@ -394,6 +394,12 @@ This variant of `rx' supports common Python named REGEXPS."
                                     (any ?' ?\") "__main__" (any ?' ?\")
                                     (* space) ?:))
             (symbol-name       (seq (any letter ?_) (* (any word ?_))))
+            (assignment-target (seq (? ?*)
+                                    (* symbol-name ?.) symbol-name
+                                    (? ?\[ (+ (not ?\])) ?\])))
+            (grouped-assignment-target (seq (? ?*)
+                                            (* symbol-name ?.) (group 
symbol-name)
+                                            (? ?\[ (+ (not ?\])) ?\])))
             (open-paren        (or "{" "[" "("))
             (close-paren       (or "}" "]" ")"))
             (simple-operator   (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%))
@@ -605,6 +611,18 @@ This is the medium decoration level, including everything 
in
 `python-font-lock-keywords-level-1', as well as keywords and
 builtins.")
 
+(defun python-font-lock-assignment-matcher (regexp)
+  "Font lock matcher for assignments based on REGEXP.
+Return nil if REGEXP matched within a `paren' context (to avoid,
+e.g., default values for arguments or passing arguments by name
+being treated as assignments) or is followed by an '=' sign (to
+avoid '==' being treated as an assignment."
+  (lambda (limit)
+    (let ((res (re-search-forward regexp limit t)))
+      (unless (or (python-syntax-context 'paren)
+                  (equal (char-after (point)) ?=))
+        res))))
+
 (defvar python-font-lock-keywords-maximum-decoration
   `((python--font-lock-f-strings)
     ,@python-font-lock-keywords-level-2
@@ -652,33 +670,57 @@ builtins.")
            )
           symbol-end)
      . font-lock-type-face)
-    ;; assignments
-    ;; support for a = b = c = 5
-    (,(lambda (limit)
-        (let ((re (python-rx (group symbol-name)
-                             ;; subscript, like "[5]"
-                             (? ?\[ (+ (not ?\])) ?\]) (* space)
-                             ;; type hint, like ": int" or ": Mapping[int, 
str]"
-                             (? ?: (* space) (+ not-simple-operator) (* space))
-                             assignment-operator))
-              (res nil))
-          (while (and (setq res (re-search-forward re limit t))
-                      (or (python-syntax-context 'paren)
-                          (equal (char-after (point)) ?=))))
-          res))
-     (1 font-lock-variable-name-face nil nil))
-    ;; support for a, b, c = (1, 2, 3)
-    (,(lambda (limit)
-        (let ((re (python-rx (group symbol-name) (* space)
-                             (* ?, (* space) symbol-name (* space))
-                             ?, (* space) symbol-name (* space)
-                             assignment-operator))
-              (res nil))
-          (while (and (setq res (re-search-forward re limit t))
-                      (goto-char (match-end 1))
-                      (python-syntax-context 'paren)))
-          res))
-     (1 font-lock-variable-name-face nil nil)))
+    ;; multiple assignment
+    ;; (note that type hints are not allowed for multiple assignments)
+    ;;   a, b, c = 1, 2, 3
+    ;;   a, *b, c = 1, 2, 3, 4, 5
+    ;;   [a, b] = (1, 2)
+    ;;   (l[1], l[2]) = (10, 11)
+    ;;   (a, b, c, *d) = *x, y = 5, 6, 7, 8, 9
+    ;;   (a,) = 'foo'
+    ;;   (*a,) = ['foo', 'bar', 'baz']
+    ;;   d.x, d.y[0], *d.z = 'a', 'b', 'c', 'd', 'e'
+    ;; and variants thereof
+    ;; the cases
+    ;;   (a) = 5
+    ;;   [a] = 5
+    ;;   [*a] = 5, 6
+    ;; are handled separately below
+    (,(python-font-lock-assignment-matcher
+        (python-rx (? (or "[" "(") (* space))
+                   grouped-assignment-target (* space) ?, (* space)
+                   (* assignment-target (* space) ?, (* space))
+                   (? assignment-target (* space))
+                   (? ?, (* space))
+                   (? (or ")" "]") (* space))
+                   (group assignment-operator)))
+     (1 font-lock-variable-name-face)
+     (,(python-rx grouped-assignment-target)
+      (progn
+        (goto-char (match-end 1))       ; go back after the first symbol
+        (match-beginning 2))            ; limit the search until the assignment
+      nil
+      (1 font-lock-variable-name-face)))
+    ;; single assignment with type hints, e.g.
+    ;;   a: int = 5
+    ;;   b: Tuple[Optional[int], Union[Sequence[str], str]] = (None, 'foo')
+    ;;   c: Collection = {1, 2, 3}
+    ;;   d: Mapping[int, str] = {1: 'bar', 2: 'baz'}
+    (,(python-font-lock-assignment-matcher
+        (python-rx grouped-assignment-target (* space)
+                   (? ?: (* space) (+ not-simple-operator) (* space))
+                   assignment-operator))
+     (1 font-lock-variable-name-face))
+    ;; special cases
+    ;;   (a) = 5
+    ;;   [a] = 5
+    ;;   [*a] = 5, 6
+    (,(python-font-lock-assignment-matcher
+       (python-rx (or "[" "(") (* space)
+                  grouped-assignment-target (* space)
+                  (or ")" "]") (* space)
+                  assignment-operator))
+     (1 font-lock-variable-name-face)))
   "Font lock keywords to use in python-mode for maximum decoration.
 
 This decoration level includes everything in
@@ -875,7 +917,7 @@ work on `python-indent-calculate-indentation' instead."
                  (python-util-forward-comment)
                  (current-indentation))))
           (if (and indentation (not (zerop indentation)))
-              (set (make-local-variable 'python-indent-offset) indentation)
+              (setq-local python-indent-offset indentation)
             (when python-indent-guess-indent-offset-verbose
               (message "Can't guess python-indent-offset, using defaults: %s"
                        python-indent-offset))))))))
@@ -1404,7 +1446,7 @@ With positive ARG search backwards, else search forwards."
          (line-beg-pos (line-beginning-position))
          (line-content-start (+ line-beg-pos (current-indentation)))
          (pos (point-marker))
-         (beg-indentation
+         (body-indentation
           (and (> arg 0)
                (save-excursion
                  (while (and
@@ -1415,9 +1457,16 @@ With positive ARG search backwards, else search 
forwards."
                      0))))
          (found
           (progn
-            (when (and (< arg 0)
-                       (python-info-looking-at-beginning-of-defun))
+            (when (and (python-info-looking-at-beginning-of-defun)
+                       (or (< arg 0)
+                           ;; If looking at beginning of defun, and if
+                           ;; pos is > line-content-start, ensure a
+                           ;; backward re search match this defun by
+                           ;; going to end of line before calling
+                           ;; re-search-fn bug#40563
+                           (and (> arg 0) (> pos line-content-start))))
               (end-of-line 1))
+
             (while (and (funcall re-search-fn
                                  python-nav-beginning-of-defun-regexp nil t)
                         (or (python-syntax-context-type)
@@ -1425,7 +1474,7 @@ With positive ARG search backwards, else search forwards."
                             ;; backwards by checking indentation.
                             (and (> arg 0)
                                  (not (= (current-indentation) 0))
-                                 (>= (current-indentation) beg-indentation)))))
+                                 (>= (current-indentation) 
body-indentation)))))
             (and (python-info-looking-at-beginning-of-defun)
                  (or (not (= (line-number-at-pos pos)
                              (line-number-at-pos)))
@@ -2623,7 +2672,7 @@ also `with-current-buffer'."
        (set-buffer python-shell--font-lock-buffer)
        (when (not font-lock-mode)
          (font-lock-mode 1))
-       (set (make-local-variable 'delay-mode-hooks) t)
+       (setq-local delay-mode-hooks t)
        (let ((python-indent-guess-indent-offset nil))
          (when (not (derived-mode-p 'python-mode))
            (python-mode))
@@ -2702,7 +2751,7 @@ With argument MSG show activation message."
   (interactive "p")
   (python-shell-with-shell-buffer
     (python-shell-font-lock-kill-buffer)
-    (set (make-local-variable 'python-shell--font-lock-buffer) nil)
+    (setq-local python-shell--font-lock-buffer nil)
     (add-hook 'post-command-hook
               #'python-shell-font-lock-post-command-hook nil 'local)
     (add-hook 'kill-buffer-hook
@@ -2725,7 +2774,7 @@ With argument MSG show deactivation message."
        (cdr (python-util-comint-last-prompt))
        (line-end-position)
        '(face nil font-lock-face nil)))
-    (set (make-local-variable 'python-shell--font-lock-buffer) nil)
+    (setq-local python-shell--font-lock-buffer nil)
     (remove-hook 'post-command-hook
                  #'python-shell-font-lock-post-command-hook 'local)
     (remove-hook 'kill-buffer-hook
@@ -2741,8 +2790,8 @@ With argument MSG show deactivation message."
 With argument MSG show activation/deactivation message."
   (interactive "p")
   (python-shell-with-shell-buffer
-    (set (make-local-variable 'python-shell-font-lock-enable)
-         (not python-shell-font-lock-enable))
+    (setq-local python-shell-font-lock-enable
+                (not python-shell-font-lock-enable))
     (if python-shell-font-lock-enable
         (python-shell-font-lock-turn-on msg)
       (python-shell-font-lock-turn-off msg))
@@ -2765,9 +2814,9 @@ eventually provide a shell."
 (defun python-shell-comint-watch-for-first-prompt-output-filter (output)
   "Run `python-shell-first-prompt-hook' when first prompt is found in OUTPUT."
   (when (not python-shell--first-prompt-received)
-    (set (make-local-variable 
'python-shell--first-prompt-received-output-buffer)
-         (concat python-shell--first-prompt-received-output-buffer
-                 (ansi-color-filter-apply output)))
+    (setq-local python-shell--first-prompt-received-output-buffer
+                (concat python-shell--first-prompt-received-output-buffer
+                        (ansi-color-filter-apply output)))
     (when (python-shell-comint-end-of-output-p
            python-shell--first-prompt-received-output-buffer)
       (if (string-match-p
@@ -2775,7 +2824,7 @@ eventually provide a shell."
            (or python-shell--first-prompt-received-output-buffer ""))
           ;; Skip pdb prompts and reset the buffer.
           (setq python-shell--first-prompt-received-output-buffer nil)
-        (set (make-local-variable 'python-shell--first-prompt-received) t)
+        (setq-local python-shell--first-prompt-received t)
         (setq python-shell--first-prompt-received-output-buffer nil)
         (with-current-buffer (current-buffer)
           (let ((inhibit-quit nil))
@@ -2815,30 +2864,30 @@ variable.
 \(Type \\[describe-mode] in the process buffer for a list of commands.)"
   (when python-shell--parent-buffer
     (python-util-clone-local-variables python-shell--parent-buffer))
-  (set (make-local-variable 'indent-tabs-mode) nil)
+  (setq-local indent-tabs-mode nil)
   ;; Users can interactively override default values for
   ;; `python-shell-interpreter' and `python-shell-interpreter-args'
   ;; when calling `run-python'.  This ensures values let-bound in
   ;; `python-shell-make-comint' are locally set if needed.
-  (set (make-local-variable 'python-shell-interpreter)
-       (or python-shell--interpreter python-shell-interpreter))
-  (set (make-local-variable 'python-shell-interpreter-args)
-       (or python-shell--interpreter-args python-shell-interpreter-args))
-  (set (make-local-variable 'python-shell--prompt-calculated-input-regexp) nil)
-  (set (make-local-variable 'python-shell--block-prompt) nil)
-  (set (make-local-variable 'python-shell--prompt-calculated-output-regexp) 
nil)
+  (setq-local python-shell-interpreter
+              (or python-shell--interpreter python-shell-interpreter))
+  (setq-local python-shell-interpreter-args
+              (or python-shell--interpreter-args 
python-shell-interpreter-args))
+  (setq-local python-shell--prompt-calculated-input-regexp nil)
+  (setq-local python-shell--block-prompt nil)
+  (setq-local python-shell--prompt-calculated-output-regexp nil)
   (python-shell-prompt-set-calculated-regexps)
   (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp)
-  (set (make-local-variable 'comint-prompt-read-only) t)
+  (setq-local comint-prompt-read-only t)
   (setq mode-line-process '(":%s"))
-  (set (make-local-variable 'comint-output-filter-functions)
-       '(ansi-color-process-output
-         python-shell-comint-watch-for-first-prompt-output-filter
-         python-comint-postoutput-scroll-to-bottom
-         comint-watch-for-password-prompt))
+  (setq-local comint-output-filter-functions
+              '(ansi-color-process-output
+                python-shell-comint-watch-for-first-prompt-output-filter
+                python-comint-postoutput-scroll-to-bottom
+                comint-watch-for-password-prompt))
   (setq-local comint-highlight-input nil)
-  (set (make-local-variable 'compilation-error-regexp-alist)
-       python-shell-compilation-regexp-alist)
+  (setq-local compilation-error-regexp-alist
+              python-shell-compilation-regexp-alist)
   (add-hook 'completion-at-point-functions
             #'python-shell-completion-at-point nil 'local)
   (define-key inferior-python-mode-map "\t"
@@ -3605,7 +3654,7 @@ __PYTHON_EL_native_completion_setup()" process)
 With argument MSG show deactivation message."
   (interactive "p")
   (python-shell-with-shell-buffer
-    (set (make-local-variable 'python-shell-completion-native-enable) nil)
+    (setq-local python-shell-completion-native-enable nil)
     (when msg
       (message "Shell native completion is disabled, using fallback"))))
 
@@ -3614,7 +3663,7 @@ With argument MSG show deactivation message."
 With argument MSG show deactivation message."
   (interactive "p")
   (python-shell-with-shell-buffer
-    (set (make-local-variable 'python-shell-completion-native-enable) t)
+    (setq-local python-shell-completion-native-enable t)
     (python-shell-completion-native-turn-on-maybe msg)))
 
 (defun python-shell-completion-native-turn-on-maybe (&optional msg)
@@ -3994,7 +4043,7 @@ Argument OUTPUT is a string with the output from the 
comint process."
                  (tracked-buffer-window (get-buffer-window tracked-buffer))
                  (tracked-buffer-line-pos))
             (with-current-buffer tracked-buffer
-              (set (make-local-variable 'overlay-arrow-position) (make-marker))
+              (setq-local overlay-arrow-position (make-marker))
               (setq tracked-buffer-line-pos (progn
                                               (goto-char (point-min))
                                               (forward-line (1- line-number))
@@ -5535,48 +5584,43 @@ REPORT-FN is Flymake's callback function."
   "Major mode for editing Python files.
 
 \\{python-mode-map}"
-  (set (make-local-variable 'tab-width) 8)
-  (set (make-local-variable 'indent-tabs-mode) nil)
+  (setq-local tab-width 8)
+  (setq-local indent-tabs-mode nil)
 
-  (set (make-local-variable 'comment-start) "# ")
-  (set (make-local-variable 'comment-start-skip) "#+\\s-*")
+  (setq-local comment-start "# ")
+  (setq-local comment-start-skip "#+\\s-*")
 
-  (set (make-local-variable 'parse-sexp-lookup-properties) t)
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  (setq-local parse-sexp-lookup-properties t)
+  (setq-local parse-sexp-ignore-comments t)
 
-  (set (make-local-variable 'forward-sexp-function)
-       'python-nav-forward-sexp)
+  (setq-local forward-sexp-function #'python-nav-forward-sexp)
 
-  (set (make-local-variable 'font-lock-defaults)
-       `(,python-font-lock-keywords
-         nil nil nil nil
-         (font-lock-syntactic-face-function
-          . python-font-lock-syntactic-face-function)))
+  (setq-local font-lock-defaults
+              `(,python-font-lock-keywords
+                nil nil nil nil
+                (font-lock-syntactic-face-function
+                 . python-font-lock-syntactic-face-function)))
 
-  (set (make-local-variable 'syntax-propertize-function)
-       python-syntax-propertize-function)
+  (setq-local syntax-propertize-function
+              python-syntax-propertize-function)
 
-  (set (make-local-variable 'indent-line-function)
-       #'python-indent-line-function)
-  (set (make-local-variable 'indent-region-function) #'python-indent-region)
+  (setq-local indent-line-function #'python-indent-line-function)
+  (setq-local indent-region-function #'python-indent-region)
   ;; Because indentation is not redundant, we cannot safely reindent code.
-  (set (make-local-variable 'electric-indent-inhibit) t)
-  (set (make-local-variable 'electric-indent-chars)
-       (cons ?: electric-indent-chars))
+  (setq-local electric-indent-inhibit t)
+  (setq-local electric-indent-chars
+              (cons ?: electric-indent-chars))
 
   ;; Add """ ... """ pairing to electric-pair-mode.
   (add-hook 'post-self-insert-hook
             #'python-electric-pair-string-delimiter 'append t)
 
-  (set (make-local-variable 'paragraph-start) "\\s-*$")
-  (set (make-local-variable 'fill-paragraph-function)
-       #'python-fill-paragraph)
-  (set (make-local-variable 'normal-auto-fill-function) #'python-do-auto-fill)
+  (setq-local paragraph-start "\\s-*$")
+  (setq-local fill-paragraph-function #'python-fill-paragraph)
+  (setq-local normal-auto-fill-function #'python-do-auto-fill)
 
-  (set (make-local-variable 'beginning-of-defun-function)
-       #'python-nav-beginning-of-defun)
-  (set (make-local-variable 'end-of-defun-function)
-       #'python-nav-end-of-defun)
+  (setq-local beginning-of-defun-function #'python-nav-beginning-of-defun)
+  (setq-local end-of-defun-function #'python-nav-end-of-defun)
 
   (add-hook 'completion-at-point-functions
             #'python-completion-at-point nil 'local)
@@ -5584,26 +5628,25 @@ REPORT-FN is Flymake's callback function."
   (add-hook 'post-self-insert-hook
             #'python-indent-post-self-insert-function 'append 'local)
 
-  (set (make-local-variable 'imenu-create-index-function)
-       #'python-imenu-create-index)
+  (setq-local imenu-create-index-function
+              #'python-imenu-create-index)
 
-  (set (make-local-variable 'add-log-current-defun-function)
-       #'python-info-current-defun)
+  (setq-local add-log-current-defun-function
+              #'python-info-current-defun)
 
   (add-hook 'which-func-functions #'python-info-current-defun nil t)
 
-  (set (make-local-variable 'skeleton-further-elements)
-       '((abbrev-mode nil)
-         (< '(backward-delete-char-untabify (min python-indent-offset
-                                                 (current-column))))
-         (^ '(- (1+ (current-indentation))))))
+  (setq-local skeleton-further-elements
+              '((abbrev-mode nil)
+                (< '(backward-delete-char-untabify (min python-indent-offset
+                                                        (current-column))))
+                (^ '(- (1+ (current-indentation))))))
 
   (with-no-warnings
     ;; suppress warnings about eldoc-documentation-function being obsolete
    (if (null eldoc-documentation-function)
        ;; Emacs<25
-       (set (make-local-variable 'eldoc-documentation-function)
-            #'python-eldoc-function)
+       (setq-local eldoc-documentation-function #'python-eldoc-function)
      (if (boundp 'eldoc-documentation-functions)
          (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil 
t)
        (add-function :before-until (local 'eldoc-documentation-function)
@@ -5620,16 +5663,14 @@ REPORT-FN is Flymake's callback function."
      python-hideshow-forward-sexp-function
      nil))
 
-  (set (make-local-variable 'outline-regexp)
-       (python-rx (* space) block-start))
-  (set (make-local-variable 'outline-heading-end-regexp) ":[^\n]*\n")
-  (set (make-local-variable 'outline-level)
-       #'(lambda ()
-           "`outline-level' function for Python mode."
-           (1+ (/ (current-indentation) python-indent-offset))))
+  (setq-local outline-regexp (python-rx (* space) block-start))
+  (setq-local outline-heading-end-regexp ":[^\n]*\n")
+  (setq-local outline-level
+              (lambda ()
+                "`outline-level' function for Python mode."
+                (1+ (/ (current-indentation) python-indent-offset))))
 
-  (set (make-local-variable 'prettify-symbols-alist)
-       python-prettify-symbols-alist)
+  (setq-local prettify-symbols-alist python-prettify-symbols-alist)
 
   (python-skeleton-add-menu-items)
 
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index fbc6e42..3effb6ed 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1,6 +1,6 @@
 ;;; ruby-mode.el --- Major mode for editing Ruby files -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Authors: Yukihiro Matsumoto
 ;;     Nobuyoshi Nakada
@@ -32,7 +32,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl-lib))
+(require 'cl-lib)
 
 (defgroup ruby nil
   "Major mode for editing Ruby code."
@@ -75,7 +75,7 @@
 
 (defconst ruby-block-mid-re
   (regexp-opt ruby-block-mid-keywords)
-  "Regexp to match where the indentation gets shallower in middle of block 
statements.")
+  "Regexp for where the indentation gets shallower in middle of block 
statements.")
 
 (defconst ruby-block-op-keywords
   '("and" "or" "not")
@@ -101,7 +101,7 @@
   "Regexp to match the beginning of a heredoc.")
 
   (defconst ruby-expression-expansion-re
-    
"\\(?:[^\\]\\|\\=\\)\\(\\\\\\\\\\)*\\(#\\({[^}\n\\]*\\(\\\\.[^}\n\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\|\\$[^a-zA-Z
 \n]\\)\\)"))
+    
"#\\({[^}\n\\]*\\(\\\\.[^}\n\\]*\\)*}\\|\\(?:\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\|\\$[^a-zA-Z
 \n]\\)"))
 
 (defun ruby-here-doc-end-match ()
   "Return a regexp to find the end of a heredoc.
@@ -401,7 +401,10 @@ It is used when `ruby-encoding-magic-comment-style' is set 
to `custom'."
                   (or (and (bolp)
                            ;; Newline is escaped.
                            (not (eq (char-before (1- (point))) ?\\)))
-                      (memq (char-before) '(?\; ?=)))))
+                      (eq (char-before) ?\;)
+                      (and (eq (char-before) ?=)
+                           (equal (syntax-after (1- (point)))
+                                  (string-to-syntax "."))))))
 
 (defun ruby-smie--implicit-semi-p ()
   (save-excursion
@@ -595,7 +598,7 @@ It is used when `ruby-encoding-magic-comment-style' is set 
to `custom'."
     (`(:before . ,(or "(" "[" "{"))
      (cond
       ((and (equal token "{")
-            (not (smie-rule-prev-p "(" "{" "[" "," "=>" "=" "return" ";"))
+            (not (smie-rule-prev-p "(" "{" "[" "," "=>" "=" "return" ";" "do"))
             (save-excursion
               (forward-comment -1)
               (not (eq (preceding-char) ?:))))
@@ -780,24 +783,25 @@ The style of the comment is controlled by 
`ruby-encoding-magic-comment-style'."
 (defun ruby-mode-set-encoding ()
   "Insert a magic comment header with the proper encoding if necessary."
   (save-excursion
-    (widen)
-    (goto-char (point-min))
-    (when (ruby--encoding-comment-required-p)
+    (save-restriction
+      (widen)
       (goto-char (point-min))
-      (let ((coding-system (ruby--detect-encoding)))
-        (when coding-system
-          (if (looking-at "^#!") (beginning-of-line 2))
-          (cond ((looking-at "\\s *#.*\\(en\\)?coding\\s *:\\s 
*\\([-a-z0-9_]*\\)")
-                 ;; update existing encoding comment if necessary
-                 (unless (string= (match-string 2) coding-system)
-                   (goto-char (match-beginning 2))
-                   (delete-region (point) (match-end 2))
-                   (insert coding-system)))
-                ((looking-at "\\s *#.*coding\\s *[:=]"))
-                (t (when ruby-insert-encoding-magic-comment
-                     (ruby--insert-coding-comment coding-system))))
-          (when (buffer-modified-p)
-            (basic-save-buffer-1)))))))
+      (when (ruby--encoding-comment-required-p)
+        (goto-char (point-min))
+        (let ((coding-system (ruby--detect-encoding)))
+          (when coding-system
+            (if (looking-at "^#!") (beginning-of-line 2))
+            (cond ((looking-at "\\s *#.*\\(en\\)?coding\\s *:\\s 
*\\([-a-z0-9_]*\\)")
+                   ;; update existing encoding comment if necessary
+                   (unless (string= (match-string 2) coding-system)
+                     (goto-char (match-beginning 2))
+                     (delete-region (point) (match-end 2))
+                     (insert coding-system)))
+                  ((looking-at "\\s *#.*coding\\s *[:=]"))
+                  (t (when ruby-insert-encoding-magic-comment
+                       (ruby--insert-coding-comment coding-system))))
+            (when (buffer-modified-p)
+              (basic-save-buffer-1))))))))
 
 (defvar ruby--electric-indent-chars '(?. ?\) ?} ?\]))
 
@@ -1860,10 +1864,18 @@ It will be properly highlighted even when the call 
omits parens.")
                                'syntax-table (string-to-syntax "_"))
             (string-to-syntax "'"))))
       ;; Symbols with special characters.
-      
("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\)\\)"
-       (3 (unless (nth 8 (syntax-ppss (match-beginning 3)))
+      
(":\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\)"
+       (1 (unless (or
+                   (eq (char-before (match-beginning 0)) ?:)
+                   (nth 8 (syntax-ppss (match-beginning 1))))
             (goto-char (match-end 0))
             (string-to-syntax "_"))))
+      ;; Symbols ending with '=' (bug#42846).
+      (":[[:alpha:]][[:alnum:]_]*\\(=\\)"
+       (1 (unless (or (nth 8 (syntax-ppss))
+                      (eq (char-before (match-beginning 0)) ?:)
+                      (eq (char-after (match-end 3)) ?>))
+            (string-to-syntax "_"))))
       ;; Part of method name when at the end of it.
       ("[!?]"
        (0 (unless (save-excursion
@@ -1878,9 +1890,14 @@ It will be properly highlighted even when the call omits 
parens.")
       ;; (semi-important for indentation).
       ("\\(:\\)\\(?:[({]\\|\\[[^]]\\)"
        (1 (string-to-syntax ".")))
-      ;; Regular expressions.  Start with matching unescaped slash.
-      ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)"
-       (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1)))))
+      ;; Regular expressions.
+      ("\\(/\\)"
+       (1
+        ;; No unescaped slashes in front.
+        (when (save-excursion
+                (forward-char -1)
+                (cl-evenp (skip-chars-backward "\\\\")))
+          (let ((state (save-excursion (syntax-ppss (match-beginning 1)))))
             (when (or
                    ;; Beginning of a regexp.
                    (and (null (nth 8 state))
@@ -1893,11 +1910,17 @@ It will be properly highlighted even when the call 
omits parens.")
                    ;; string interpolation inside, or span
                    ;; several lines.
                    (eq ?/ (nth 3 state)))
-              (string-to-syntax "\"/")))))
+              (string-to-syntax "\"/"))))))
       ;; Expression expansions in strings.  We're handling them
       ;; here, so that the regexp rule never matches inside them.
       (ruby-expression-expansion-re
-       (0 (ignore (ruby-syntax-propertize-expansion))))
+       (0 (ignore
+           (if (save-excursion
+                 (goto-char (match-beginning 0))
+                 ;; The hash character is not escaped.
+                 (cl-evenp (skip-chars-backward "\\\\")))
+               (ruby-syntax-propertize-expansion)
+             (goto-char (match-beginning 1))))))
       ("^=en\\(d\\)\\_>" (1 "!"))
       ("^\\(=\\)begin\\_>" (1 "!"))
       ;; Handle here documents.
@@ -1987,8 +2010,8 @@ It will be properly highlighted even when the call omits 
parens.")
 (defun ruby-syntax-propertize-expansion ()
   ;; Save the match data to a text property, for font-locking later.
   ;; Set the syntax of all double quotes and backticks to punctuation.
-  (let* ((beg (match-beginning 2))
-         (end (match-end 2))
+  (let* ((beg (match-beginning 0))
+         (end (match-end 0))
          (state (and beg (save-excursion (syntax-ppss beg)))))
     (when (ruby-syntax-expansion-allowed-p state)
       (put-text-property beg (1+ beg) 'ruby-expansion-match-data
@@ -2180,12 +2203,7 @@ It will be properly highlighted even when the call omits 
parens.")
      (0 font-lock-builtin-face))
     ;; Symbols.
     ("\\(^\\|[^:]\\)\\(:@\\{0,2\\}\\(?:\\sw\\|\\s_\\)+\\)"
-     (2 font-lock-constant-face)
-     (3 (unless (and (eq (char-before (match-end 3)) ?=)
-                     (eq (char-after (match-end 3)) ?>))
-          ;; bug#18644
-          font-lock-constant-face)
-        nil t))
+     (2 font-lock-constant-face))
     ;; Special globals.
     (,(concat "\\$\\(?:[:\"!@;,/._><\\$?~=*&`'+0-9]\\|-[0adFiIlpvw]\\|"
               (regexp-opt '("LOAD_PATH" "LOADED_FEATURES" "PROGRAM_NAME"
@@ -2220,7 +2238,7 @@ It will be properly highlighted even when the call omits 
parens.")
      (1 font-lock-builtin-face))
     ;; Expression expansion.
     (ruby-match-expression-expansion
-     2 font-lock-variable-name-face t)
+     0 font-lock-variable-name-face t)
     ;; Negation char.
     ("\\(?:^\\|[^[:alnum:]_]\\)\\(!+\\)[^=~]"
      1 font-lock-negation-char-face)
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index 33ba0d1..f610efb 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -1,6 +1,6 @@
 ;;; scheme.el --- Scheme (and DSSSL) editing mode    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 1986-1988, 1997-1998, 2001-2020 Free Software
+;; Copyright (C) 1986-1988, 1997-1998, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Bill Rozas <jinx@martigny.ai.mit.edu>
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index b7327e7..a417de3 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1,6 +1,6 @@
 ;;; sh-script.el --- shell-script editing commands for Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1993-1997, 1999, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1993-1997, 1999, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>
diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el
index 44d4a9c..7806a6b 100644
--- a/lisp/progmodes/simula.el
+++ b/lisp/progmodes/simula.el
@@ -1,6 +1,6 @@
 ;;; simula.el --- SIMULA 87 code editing commands for Emacs
 
-;; Copyright (C) 1992, 1994, 1996, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1992, 1994, 1996, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Hans Henrik Eriksen <hhe@ifi.uio.no>
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 0bf9a51..4d027f3 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -1,12 +1,11 @@
 ;;; sql.el --- specialized comint.el for SQL interpreters  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Maintainer: Michael Mauger <michael@mauger.com>
 ;; Version: 3.6
 ;; Keywords: comm languages processes
-;; URL: https://savannah.gnu.org/projects/emacs/
 
 ;; This file is part of GNU Emacs.
 
@@ -1725,7 +1724,7 @@ to add functions and PL/SQL keywords.")
                            "ORDER BY 2 DESC, 3 DESC, 4 DESC, 5 DESC, 6 DESC, 
1;")
                    nil nil)
       (with-current-buffer b
-        (set (make-local-variable 'sql-product) 'oracle)
+        (setq-local sql-product 'oracle)
         (sql-product-font-lock t nil)
         (font-lock-mode +1)))))
 
@@ -2812,7 +2811,7 @@ configured."
       ((syntax-alist (sql-product-font-lock-syntax-alist)))
 
     ;; Get the product-specific keywords.
-    (set (make-local-variable 'sql-mode-font-lock-keywords)
+    (setq-local sql-mode-font-lock-keywords
          (append
           (unless (eq sql-product 'ansi)
             (sql-get-product-feature sql-product :font-lock))
@@ -2824,7 +2823,7 @@ configured."
 
     ;; Setup font-lock.  Force re-parsing of `font-lock-defaults'.
     (kill-local-variable 'font-lock-set-defaults)
-    (set (make-local-variable 'font-lock-defaults)
+    (setq-local font-lock-defaults
          (list 'sql-mode-font-lock-keywords
                keywords-only t syntax-alist))
 
@@ -4134,8 +4133,8 @@ details or extends the listing to include other schemas 
objects."
     (sql-execute-feature sqlbuf "*List All*" :list-all enhanced nil)
     (with-current-buffer sqlbuf
       ;; Contains the name of database objects
-      (set (make-local-variable 'sql-contains-names) t)
-      (set (make-local-variable 'sql-buffer) sqlbuf))))
+      (setq-local sql-contains-names t)
+      (setq-local sql-buffer sqlbuf))))
 
 (defun sql-list-table (name &optional enhanced)
   "List the details of a database table named NAME.
@@ -4190,7 +4189,7 @@ must tell Emacs.  Here's how to do that in your init file:
       (easy-menu-add sql-mode-menu))
 
   ;; (smie-setup sql-smie-grammar #'sql-smie-rules)
-  (set (make-local-variable 'comment-start) "--")
+  (setq-local comment-start "--")
   ;; Make each buffer in sql-mode remember the "current" SQLi buffer.
   (make-local-variable 'sql-buffer)
   ;; Add imenu support for sql-mode.  Note that imenu-generic-expression
@@ -4200,12 +4199,12 @@ must tell Emacs.  Here's how to do that in your init 
file:
        imenu-case-fold-search t)
   ;; Make `sql-send-paragraph' work on paragraphs that contain indented
   ;; lines.
-  (set (make-local-variable 'paragraph-separate) "[\f]*$")
-  (set (make-local-variable 'paragraph-start) "[\n\f]")
+  (setq-local paragraph-separate "[\f]*$")
+  (setq-local paragraph-start "[\n\f]")
   ;; Abbrevs
   (setq-local abbrev-all-caps 1)
   ;; Contains the name of database objects
-  (set (make-local-variable 'sql-contains-names) t)
+  (setq-local sql-contains-names t)
   (setq-local syntax-propertize-function
               (syntax-propertize-rules
                ;; Handle escaped apostrophes within strings.
@@ -4304,9 +4303,8 @@ you entered, right above the output it created.
   :after-hook (sql--adjust-interactive-setup)
 
   ;; Get the `sql-product' for this interactive session.
-  (set (make-local-variable 'sql-product)
-       (or sql-interactive-product
-          sql-product))
+  (setq-local sql-product (or sql-interactive-product
+                           sql-product))
 
   ;; Setup the mode.
   (setq mode-name
@@ -4323,7 +4321,7 @@ you entered, right above the output it created.
   (sql-product-font-lock t nil)
 
   ;; Enable commenting and uncommenting of the region.
-  (set (make-local-variable 'comment-start) "--")
+  (setq-local comment-start "--")
   ;; Abbreviation table init and case-insensitive.  It is not activated
   ;; by default.
   (setq local-abbrev-table sql-mode-abbrev-table)
@@ -4332,27 +4330,27 @@ you entered, right above the output it created.
   (let ((proc (get-buffer-process (current-buffer))))
     (when proc (set-process-sentinel proc #'sql-stop)))
   ;; Save the connection and login params
-  (set (make-local-variable 'sql-user)       sql-user)
-  (set (make-local-variable 'sql-database)   sql-database)
-  (set (make-local-variable 'sql-server)     sql-server)
-  (set (make-local-variable 'sql-port)       sql-port)
-  (set (make-local-variable 'sql-connection) sql-connection)
+  (setq-local sql-user       sql-user)
+  (setq-local sql-database   sql-database)
+  (setq-local sql-server     sql-server)
+  (setq-local sql-port       sql-port)
+  (setq-local sql-connection sql-connection)
   (setq-default sql-connection nil)
   ;; Contains the name of database objects
-  (set (make-local-variable 'sql-contains-names) t)
+  (setq-local sql-contains-names t)
   ;; Keep track of existing object names
-  (set (make-local-variable 'sql-completion-object) nil)
-  (set (make-local-variable 'sql-completion-column) nil)
+  (setq-local sql-completion-object nil)
+  (setq-local sql-completion-column nil)
   ;; Create a useful name for renaming this buffer later.
-  (set (make-local-variable 'sql-alternate-buffer-name)
-       (sql-make-alternate-buffer-name))
+  (setq-local sql-alternate-buffer-name
+              (sql-make-alternate-buffer-name))
   ;; User stuff.  Initialize before the hook.
-  (set (make-local-variable 'sql-prompt-regexp)
-       (or (sql-get-product-feature sql-product :prompt-regexp) "^"))
-  (set (make-local-variable 'sql-prompt-length)
-       (sql-get-product-feature sql-product :prompt-length))
-  (set (make-local-variable 'sql-prompt-cont-regexp)
-       (sql-get-product-feature sql-product :prompt-cont-regexp))
+  (setq-local sql-prompt-regexp
+              (or (sql-get-product-feature sql-product :prompt-regexp) "^"))
+  (setq-local sql-prompt-length
+              (sql-get-product-feature sql-product :prompt-length))
+  (setq-local sql-prompt-cont-regexp
+              (sql-get-product-feature sql-product :prompt-cont-regexp))
   (make-local-variable 'sql-output-newline-count)
   (make-local-variable 'sql-preoutput-hold)
   (add-hook 'comint-preoutput-filter-functions
@@ -4370,7 +4368,7 @@ you entered, right above the output it created.
           sql-prompt-regexp))
   (setq left-margin (or sql-prompt-length 0))
   ;; Install input sender
-  (set (make-local-variable 'comint-input-sender) #'sql-input-sender)
+  (setq-local comint-input-sender #'sql-input-sender)
   ;; People wanting a different history file for each
   ;; buffer/process/client/whatever can change separator and file-name
   ;; on the sql-interactive-mode-hook.
@@ -4651,8 +4649,7 @@ the call to \\[sql-product-interactive] with
 
               ;; Set the new buffer name
               (setq new-sqli-buffer (current-buffer))
-              (set (make-local-variable 'sql-buffer)
-                   (buffer-name new-sqli-buffer))
+              (setq-local sql-buffer (buffer-name new-sqli-buffer))
 
               ;; Set `sql-buffer' in the start buffer
               (with-current-buffer start-buffer
diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el
index b0df909..33b70d8 100644
--- a/lisp/progmodes/subword.el
+++ b/lisp/progmodes/subword.el
@@ -1,6 +1,6 @@
 ;;; subword.el --- Handling capitalized subwords in a nomenclature -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Masatake YAMATO
 
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index ff3fb96..0a0118a 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -1,6 +1,6 @@
 ;;; tcl.el --- Tcl code editing commands for Emacs  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1994, 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Tom Tromey <tromey@redhat.com>
 ;;    Chris Lindblad <cjl@lcs.mit.edu>
@@ -616,41 +616,39 @@ Turning on Tcl mode runs `tcl-mode-hook'.  Read the 
documentation for
 `tcl-mode-hook' to see what kinds of interesting hook functions
 already exist."
   (unless (and (boundp 'filladapt-mode) filladapt-mode)
-    (set (make-local-variable 'paragraph-ignore-fill-prefix) t))
+    (setq-local paragraph-ignore-fill-prefix t))
 
-  (set (make-local-variable 'indent-line-function) #'tcl-indent-line)
-  (set (make-local-variable 'comment-indent-function) #'tcl-comment-indent)
+  (setq-local indent-line-function #'tcl-indent-line)
+  (setq-local comment-indent-function #'tcl-comment-indent)
   ;; Tcl doesn't require a final newline.
-  ;; (make-local-variable 'require-final-newline)
-  ;; (setq require-final-newline t)
+  ;; (setq-local require-final-newline t)
 
-  (set (make-local-variable 'comment-start) "# ")
-  (set (make-local-variable 'comment-start-skip)
-       "\\(\\(^\\|[;{[]\\)\\s-*\\)#+ *")
-  (set (make-local-variable 'comment-end) "")
+  (setq-local comment-start "# ")
+  (setq-local comment-start-skip
+              "\\(\\(^\\|[;{[]\\)\\s-*\\)#+ *")
+  (setq-local comment-end "")
 
-  (set (make-local-variable 'outline-regexp) ".")
-  (set (make-local-variable 'outline-level) 'tcl-outline-level)
+  (setq-local outline-regexp ".")
+  (setq-local outline-level 'tcl-outline-level)
 
-  (set (make-local-variable 'font-lock-defaults)
-       '(tcl-font-lock-keywords nil nil nil beginning-of-defun))
-  (set (make-local-variable 'syntax-propertize-function)
-       tcl-syntax-propertize-function)
+  (setq-local font-lock-defaults
+              '(tcl-font-lock-keywords nil nil nil beginning-of-defun))
+  (setq-local syntax-propertize-function
+              tcl-syntax-propertize-function)
   (add-hook 'syntax-propertize-extend-region-functions
             #'syntax-propertize-multiline 'append 'local)
 
-  (set (make-local-variable 'imenu-generic-expression)
-       tcl-imenu-generic-expression)
+  (setq-local imenu-generic-expression tcl-imenu-generic-expression)
 
   ;; Settings for new dabbrev code.
-  (set (make-local-variable 'dabbrev-case-fold-search) nil)
-  (set (make-local-variable 'dabbrev-case-replace) nil)
-  (set (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) "[$!]")
-  (set (make-local-variable 'dabbrev-abbrev-char-regexp) "\\sw\\|\\s_")
-
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
-  (set (make-local-variable 'defun-prompt-regexp) tcl-omit-ws-regexp)
-  (set (make-local-variable 'add-log-current-defun-function)
+  (setq-local dabbrev-case-fold-search nil)
+  (setq-local dabbrev-case-replace nil)
+  (setq-local dabbrev-abbrev-skip-leading-regexp "[$!]")
+  (setq-local dabbrev-abbrev-char-regexp "\\sw\\|\\s_")
+
+  (setq-local parse-sexp-ignore-comments t)
+  (setq-local defun-prompt-regexp tcl-omit-ws-regexp)
+  (setq-local add-log-current-defun-function
        #'tcl-add-log-defun)
 
   (setq-local beginning-of-defun-function #'tcl-beginning-of-defun-function)
@@ -1201,14 +1199,14 @@ Variables controlling Inferior Tcl mode:
 
 The following commands are available:
 \\{inferior-tcl-mode-map}"
-  (set (make-local-variable 'comint-prompt-regexp)
-       (or tcl-prompt-regexp
-          (concat "^" (regexp-quote tcl-application) ">")))
+  (setq-local comint-prompt-regexp
+              (or tcl-prompt-regexp
+                  (concat "^" (regexp-quote tcl-application) ">")))
   (setq mode-line-process '(": %s"))
   (setq local-abbrev-table tcl-mode-abbrev-table)
   (set-syntax-table tcl-mode-syntax-table)
-  (set (make-local-variable 'defun-prompt-regexp) tcl-omit-ws-regexp)
-  (set (make-local-variable 'inferior-tcl-delete-prompt-marker) (make-marker))
+  (setq-local defun-prompt-regexp tcl-omit-ws-regexp)
+  (setq-local inferior-tcl-delete-prompt-marker (make-marker))
   (set-process-filter (get-buffer-process (current-buffer)) 'tcl-filter))
 
 ;;;###autoload
@@ -1229,7 +1227,7 @@ See documentation for function `inferior-tcl-mode' for 
more information."
     (unless (process-tty-name (inferior-tcl-proc))
       (tcl-send-string (inferior-tcl-proc)
                        "set ::tcl_interactive 1; concat\n")))
-  (set (make-local-variable 'tcl-application) cmd)
+  (setq-local tcl-application cmd)
   (setq inferior-tcl-buffer "*inferior-tcl*")
   (pop-to-buffer "*inferior-tcl*"))
 
@@ -1493,7 +1491,7 @@ Prefix argument means switch to the Tcl buffer 
afterwards."
   (interactive "P")
   (auto-fill-mode arg)
   (if auto-fill-function
-      (set (make-local-variable 'comment-auto-fill-only-comments) t)
+      (setq-local comment-auto-fill-only-comments t)
     (kill-local-variable 'comment-auto-fill-only-comments)))
 
 (defun tcl-electric-hash (&optional count)
@@ -1574,7 +1572,7 @@ The first line is assumed to look like \"#!.../program 
...\"."
   (save-excursion
     (goto-char (point-min))
     (if (looking-at "#![^ \t]*/\\([^ \t\n/]+\\)\\([ \t]\\|$\\)")
-       (set (make-local-variable 'tcl-application) (match-string 1)))))
+        (setq-local tcl-application (match-string 1)))))
 
 (defun tcl-popup-menu (_e)
   "XEmacs menu support."
diff --git a/lisp/progmodes/vera-mode.el b/lisp/progmodes/vera-mode.el
index 8bde89e..c2e1719 100644
--- a/lisp/progmodes/vera-mode.el
+++ b/lisp/progmodes/vera-mode.el
@@ -1,6 +1,6 @@
 ;;; vera-mode.el --- major mode for editing Vera files  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author:      Reto Zimmermann <reto@gnu.org>
 ;; Version:     2.28
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index b1abefe..8dddcf0 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -1,6 +1,6 @@
 ;;; verilog-mode.el --- major mode for editing verilog source in Emacs
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael McNamara <mac@verilog.com>
 ;;    Wilson Snyder <wsnyder@wsnyder.org>
@@ -5193,7 +5193,7 @@ Useful for creating tri's and other expanded fields."
   (verilog-expand-vector-internal "[" "]"))
 
 (defun verilog-expand-vector-internal (bra ket)
-  "Given BRA, the start brace and KET, the end brace, expand one line into 
many lines."
+  "Given start brace BRA, and end brace KET, expand one line into many lines."
   (save-excursion
     (forward-line 0)
     (let ((signal-string (buffer-substring (point)
@@ -10112,7 +10112,8 @@ variables to build the path."
 ;; A modi is:  [module-name-string file-name begin-point]
 
 (defvar verilog-cache-enabled t
-  "Non-nil enables caching of signals, etc.  Set to nil for debugging to make 
things SLOW!")
+  "Non-nil enables caching of signals, etc.
+Set to nil for debugging to make things SLOW!")
 
 (defvar verilog-modi-cache-list nil
   "Cache of ((Module Function) Buf-Tick Buf-Modtime Func-Returns)...
@@ -10449,7 +10450,7 @@ if non-nil."
 ;;
 
 (defun verilog-auto-re-search-do (search-for func)
-  "Search for the given auto text regexp SEARCH-FOR, and perform FUNC where it 
occurs."
+  "Search for given auto text regexp SEARCH-FOR, and perform FUNC where it 
occurs."
   (goto-char (point-min))
   (while (verilog-re-search-forward-quick search-for nil t)
     (funcall func)))
@@ -10861,7 +10862,8 @@ removed."
 
 (defun verilog-delete-auto-buffer ()
   "Perform `verilog-delete-auto' on the current buffer.
-Intended for internal use inside a `verilog-save-font-no-change-functions' 
block."
+Intended for internal use inside a
+`verilog-save-font-no-change-functions' block."
   ;; Allow user to customize
   (verilog-run-hooks 'verilog-before-delete-auto-hook)
 
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 489092f..c4de800 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -1,6 +1,6 @@
 ;;; vhdl-mode.el --- major mode for editing VHDL code
 
-;; Copyright (C) 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
 ;; Authors:     Reto Zimmermann <reto@gnu.org>
 ;;              Rodney J. Whitby <software.vhdl-mode@rwhitby.net>
@@ -2286,7 +2286,7 @@ Ignore byte-compiler warnings you might see."
            (setq contents
                  (nconc
                   (if (and (car dirs) (not full))
-                      (mapcar (function (lambda (name) (concat (car dirs) 
name)))
+                       (mapcar (lambda (name) (concat (car dirs) name))
                               this-dir-contents)
                     this-dir-contents)
                   contents))))
@@ -2563,7 +2563,7 @@ conversion."
 
 (defun vhdl-sort-alist (alist)
   "Sort ALIST."
-  (sort alist (function (lambda (a b) (string< (car a) (car b))))))
+  (sort alist (lambda (a b) (string< (car a) (car b)))))
 
 (defun vhdl-get-subdirs (directory)
   "Recursively get subdirectories of DIRECTORY."
@@ -2941,10 +2941,9 @@ STRING are replaced by `-' and substrings are converted 
to lower case."
 ;; set up electric character functions to work with
 ;; `delete-selection-mode' (Emacs) and `pending-delete-mode' (XEmacs)
 (mapc
- (function
-  (lambda (sym)
-    (put sym 'delete-selection t)      ; for `delete-selection-mode' (Emacs)
-    (put sym 'pending-delete t)))      ; for `pending-delete-mode' (XEmacs)
+ (lambda (sym)
+   (put sym 'delete-selection t)       ; for `delete-selection-mode' (Emacs)
+   (put sym 'pending-delete t))        ; for `pending-delete-mode' (XEmacs)
  '(vhdl-electric-space
    vhdl-electric-tab
    vhdl-electric-return
@@ -3317,7 +3316,7 @@ STRING are replaced by `-' and substrings are converted 
to lower case."
        (setq menu-list
              (if vhdl-project-sort
                  (sort menu-list
-                       (function (lambda (a b) (string< (elt a 0) (elt b 0)))))
+                        (lambda (a b) (string< (elt a 0) (elt b 0))))
                (nreverse menu-list)))
        (vhdl-menu-split menu-list "Project"))
       '("--" "--"
@@ -5566,9 +5565,8 @@ offset for that syntactic element.  Optional ADD-P says 
to add SYMBOL to
                            (if current-prefix-arg " or add" "")
                            ": ")
                    (mapcar
-                    (function
-                     (lambda (langelem)
-                       (cons (format "%s" (car langelem)) nil)))
+                     (lambda (langelem)
+                       (cons (format "%s" (car langelem)) nil))
                     vhdl-offsets-alist)
                    nil (not current-prefix-arg)
                    ;; initial contents tries to be the last element
@@ -5615,26 +5613,24 @@ argument.  The styles are chosen from the 
`vhdl-style-alist' variable."
        (error "ERROR:  Invalid VHDL indentation style `%s'" style))
     ;; set all the variables
     (mapc
-     (function
-      (lambda (varentry)
-       (let ((var (car varentry))
-             (val (cdr varentry)))
-         ;; special case for vhdl-offsets-alist
-         (if (not (eq var 'vhdl-offsets-alist))
-             (set (if local (make-local-variable var) var) val)
-           ;; reset vhdl-offsets-alist to the default value first
-           (set (if local (make-local-variable var) var)
-                 (copy-alist vhdl-offsets-alist-default))
-           ;; now set the langelems that are different
-           (mapcar
-            (function
-             (lambda (langentry)
-               (let ((langelem (car langentry))
-                     (offset (cdr langentry)))
-                 (vhdl-set-offset langelem offset)
-                 )))
-            val))
-         )))
+     (lambda (varentry)
+       (let ((var (car varentry))
+             (val (cdr varentry)))
+         ;; special case for vhdl-offsets-alist
+         (if (not (eq var 'vhdl-offsets-alist))
+             (set (if local (make-local-variable var) var) val)
+           ;; reset vhdl-offsets-alist to the default value first
+           (set (if local (make-local-variable var) var)
+                (copy-alist vhdl-offsets-alist-default))
+           ;; now set the langelems that are different
+           (mapcar
+            (lambda (langentry)
+              (let ((langelem (car langentry))
+                    (offset (cdr langentry)))
+                (vhdl-set-offset langelem offset)
+                ))
+            val))
+         ))
      vars))
   (vhdl-keep-region-active))
 
@@ -7578,12 +7574,11 @@ ENDPOS is encountered."
        (expurgated))
     ;; remove the library unit symbols
     (mapc
-     (function
-      (lambda (elt)
-       (if (memq (car elt) '(entity configuration context package
-                                    package-body architecture))
-           nil
-         (setq expurgated (append expurgated (list elt))))))
+     (lambda (elt)
+       (if (memq (car elt) '(entity configuration context package
+                                    package-body architecture))
+           nil
+         (setq expurgated (append expurgated (list elt)))))
      actual)
     (if (and (not arg) expected (listp expected))
        (if (not (equal expected expurgated))
@@ -7950,7 +7945,7 @@ the token in MATCH."
           (push (cons start length) comment-list))
         (beginning-of-line 2))
        (setq comment-list
-            (sort comment-list (function (lambda (a b) (> (car a) (car b))))))
+             (sort comment-list (lambda (a b) (> (car a) (car b)))))
        ;; reduce start positions
        (setq start-list (list (caar comment-list)))
        (setq comment-list (cdr comment-list))
@@ -15886,8 +15881,7 @@ NO-POSITION non-nil means do not re-position cursor."
            (setq path-list-1
                  (append
                   (mapcar
-                   (function
-                    (lambda (var) (concat path-beg var path-end)))
+                    (lambda (var) (concat path-beg var path-end))
                    (let ((all-list (vhdl-directory-files
                                     (match-string 2 dir) t
                                     (concat "\\<" (wildcard-to-regexp
@@ -17440,8 +17434,8 @@ specified by a target."
        (setq tmp-list (cdr tmp-list)))
       (setq rule-alist                 ; sort by first rule target
            (sort rule-alist
-                 (function (lambda (a b)
-                             (string< (car (cadr a)) (car (cadr b)))))))
+                  (lambda (a b)
+                    (string< (car (cadr a)) (car (cadr b))))))
       ;; open and clear Makefile
       (set-buffer (find-file-noselect makefile-path-name t t))
       (erase-buffer)
@@ -17752,16 +17746,15 @@ specified by a target."
        'vhdl-word-completion-in-minibuffer
        'vhdl-underscore-is-part-of-word
        'vhdl-mode-hook)
-      (function
-       (lambda ()
-        (insert
-         (if vhdl-special-indent-hook
-             (concat "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
-                     "vhdl-special-indent-hook is set to '"
-                     (format "%s" vhdl-special-indent-hook)
-                     ".\nPerhaps this is your problem?\n"
-                     "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n")
-           "\n"))))
+      (lambda ()
+        (insert
+         (if vhdl-special-indent-hook
+             (concat "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+                     "vhdl-special-indent-hook is set to '"
+                     (format "%s" vhdl-special-indent-hook)
+                     ".\nPerhaps this is your problem?\n"
+                     "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n")
+           "\n")))
       nil
       "Hi Reto,"))))
 
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index a524bba..3303257 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -1,6 +1,6 @@
 ;;; which-func.el --- print current function in mode line  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1994, 1997-1998, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1994, 1997-1998, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author:   Alex Rezinsky <alexr@msil.sps.mot.com>
@@ -186,7 +186,7 @@ and you want to simplify them for the mode line
   "Non-nil means display current function name in mode line.
 This makes a difference only if `which-function-mode' is non-nil.")
 
-(add-hook 'after-change-major-mode-hook 'which-func-ff-hook t)
+(add-hook 'after-change-major-mode-hook #'which-func-ff-hook t)
 
 (defun which-func-try-to-enable ()
   (unless (or (not which-function-mode)
@@ -216,7 +216,8 @@ It creates the Imenu index for the buffer, if necessary."
 (defun which-func-update ()
   ;; "Update the Which-Function mode display for all windows."
   ;; (walk-windows 'which-func-update-1 nil 'visible))
-  (which-func-update-1 (selected-window)))
+  (let ((non-essential t))
+    (which-func-update-1 (selected-window))))
 
 (defun which-func-update-1 (window)
   "Update the Which Function mode display for window WINDOW."
@@ -356,7 +357,7 @@ This function is meant to be called from 
`ediff-select-hook'."
     (when ediff-window-C
       (which-func-update-1 ediff-window-C))))
 
-(add-hook 'ediff-select-hook 'which-func-update-ediff-windows)
+(add-hook 'ediff-select-hook #'which-func-update-ediff-windows)
 
 (provide 'which-func)
 
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 9f5fc57..d2b5acd 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1,7 +1,7 @@
 ;;; xref.el --- Cross-referencing commands              -*-lexical-binding:t-*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
-;; Version: 1.0.3
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
+;; Version: 1.0.4
 ;; Package-Requires: ((emacs "26.3"))
 
 ;; This is a GNU ELPA :core package.  Avoid functionality that is not
@@ -97,6 +97,10 @@ This is typically the filename.")
   "Return the line number corresponding to the location."
   nil)
 
+(cl-defgeneric xref-location-column (_location)
+  "Return the exact column corresponding to the location."
+  nil)
+
 (cl-defgeneric xref-match-length (_item)
   "Return the length of the match."
   nil)
@@ -105,12 +109,20 @@ This is typically the filename.")
 
 (defcustom xref-file-name-display 'abs
   "Style of file name display in *xref* buffers.
+
 If the value is the symbol `abs', the default, show the file names
 in their full absolute form.
+
 If `nondirectory', show only the nondirectory (a.k.a. \"base name\")
-part of the file name."
+part of the file name.
+
+If `project-relative', show only the file name relative to the
+current project root.  If there is no current project, or if the
+file resides outside of its root, show that particular file name
+in its full absolute form."
   :type '(choice (const :tag "absolute file name" abs)
-                 (const :tag "nondirectory file name" nondirectory))
+                 (const :tag "nondirectory file name" nondirectory)
+                 (const :tag "relative to project root" project-relative))
   :version "27.1")
 
 ;; FIXME: might be useful to have an optional "hint" i.e. a string to
@@ -118,7 +130,7 @@ part of the file name."
 (defclass xref-file-location (xref-location)
   ((file :type string :initarg :file)
    (line :type fixnum :initarg :line :reader xref-location-line)
-   (column :type fixnum :initarg :column :reader xref-file-location-column))
+   (column :type fixnum :initarg :column :reader xref-location-column))
   :documentation "A file location is a file/line/column triple.
 Line numbers start from 1 and columns from 0.")
 
@@ -145,10 +157,31 @@ Line numbers start from 1 and columns from 0.")
             (forward-char column))
           (point-marker))))))
 
+(defvar xref--project-root-memo nil
+  "Cons mapping `default-directory' value to the search root.")
+
 (cl-defmethod xref-location-group ((l xref-file-location))
   (cl-ecase xref-file-name-display
-    (abs (oref l file))
-    (nondirectory (file-name-nondirectory (oref l file)))))
+    (abs
+     (oref l file))
+    (nondirectory
+     (file-name-nondirectory (oref l file)))
+    (project-relative
+     (unless (and xref--project-root-memo
+                  (equal (car xref--project-root-memo)
+                         default-directory))
+       (setq xref--project-root-memo
+             (cons default-directory
+                   (let ((root
+                          (let ((pr (project-current)))
+                            (and pr (xref--project-root pr)))))
+                     (and root (expand-file-name root))))))
+     (let ((file (oref l file))
+           (search-root (cdr xref--project-root-memo)))
+       (if (and search-root
+                (string-prefix-p search-root file))
+           (substring file (length search-root))
+         file)))))
 
 (defclass xref-buffer-location (xref-location)
   ((buffer :type buffer :initarg :buffer)
@@ -269,10 +302,7 @@ current project's main and external roots."
      (xref-references-in-directory identifier dir))
    (let ((pr (project-current t)))
      (cons
-      (if (fboundp 'project-root)
-          (project-root pr)
-        (with-no-warnings
-          (project-roots pr)))
+      (xref--project-root pr)
       (project-external-roots pr)))))
 
 (cl-defgeneric xref-backend-apropos (backend pattern)
@@ -517,8 +547,7 @@ If SELECT is non-nil, select the target window."
   "Goto and display position POS of buffer BUF in a window.
 Honor `xref--original-window-intent', run `xref-after-jump-hook'
 and finally return the window."
-  (let* ((xref-buf (current-buffer))
-         (pop-up-frames
+  (let* ((pop-up-frames
           (or (eq xref--original-window-intent 'frame)
               pop-up-frames))
          (action
@@ -536,9 +565,6 @@ and finally return the window."
     (with-selected-window (display-buffer buf action)
       (xref--goto-char pos)
       (run-hooks 'xref-after-jump-hook)
-      (let ((buf (current-buffer)))
-        (with-current-buffer xref-buf
-          (setq-local other-window-scroll-buffer buf)))
       (selected-window))))
 
 (defun xref--display-buffer-in-other-window (buffer alist)
@@ -593,10 +619,29 @@ SELECT is `quit', also quit the *xref* window."
   (xref--search-property 'xref-item t)
   (xref-show-location-at-point))
 
+(defun xref-next-group ()
+  "Move to the first item of the next xref group and display its source."
+  (interactive)
+  (xref--search-property 'xref-group)
+  (xref--search-property 'xref-item)
+  (xref-show-location-at-point))
+
+(defun xref-prev-group ()
+  "Move to the first item of the previous xref group and display its source."
+  (interactive)
+  ;; Search for the xref group of the current item, provided that the
+  ;; point is not already in an xref group.
+  (unless (plist-member (text-properties-at (point)) 'xref-group)
+    (xref--search-property 'xref-group t))
+  ;; Search for the previous xref group.
+  (xref--search-property 'xref-group t)
+  (xref--search-property 'xref-item)
+  (xref-show-location-at-point))
+
 (defun xref--item-at-point ()
-  (save-excursion
-    (back-to-indentation)
-    (get-text-property (point) 'xref-item)))
+  (get-text-property
+   (if (eolp) (1- (point)) (point))
+   'xref-item))
 
 (defun xref-goto-xref (&optional quit)
   "Jump to the xref on the current line and select its window.
@@ -738,6 +783,8 @@ references displayed in the current *xref* buffer."
   (let ((map (make-sparse-keymap)))
     (define-key map (kbd "n") #'xref-next-line)
     (define-key map (kbd "p") #'xref-prev-line)
+    (define-key map (kbd "N") #'xref-next-group)
+    (define-key map (kbd "P") #'xref-prev-group)
     (define-key map (kbd "r") #'xref-query-replace-in-results)
     (define-key map (kbd "RET") #'xref-goto-xref)
     (define-key map (kbd "TAB")  #'xref-quit-and-goto-xref)
@@ -832,17 +879,30 @@ GROUP is a string for decoration purposes and XREF is an
                                (length (and line (format "%d" line)))))
            for line-format = (and max-line-width
                                   (format "%%%dd: " max-line-width))
+           with prev-line-key = nil
            do
            (xref--insert-propertized '(face xref-file-header xref-group t)
                                      group "\n")
            (cl-loop for (xref . more2) on xrefs do
                     (with-slots (summary location) xref
                       (let* ((line (xref-location-line location))
+                             (new-summary summary)
+                             (line-key (list (xref-location-group location) 
line))
                              (prefix
                               (if line
                                   (propertize (format line-format line)
                                               'face 'xref-line-number)
                                 "  ")))
+                        ;; Render multiple matches on the same line, together.
+                        (when (and line (equal prev-line-key line-key))
+                          (when-let ((column (xref-location-column location)))
+                            (delete-region
+                             (save-excursion
+                               (forward-line -1)
+                               (move-to-column (+ (length prefix) column))
+                               (point))
+                             (point))
+                            (setq new-summary (substring summary column) 
prefix "")))
                         (xref--insert-propertized
                          (list 'xref-item xref
                                'mouse-face 'highlight
@@ -850,7 +910,8 @@ GROUP is a string for decoration purposes and XREF is an
                                'help-echo
                                (concat "mouse-2: display in another window, "
                                        "RET or mouse-1: follow reference"))
-                         prefix summary)))
+                         prefix new-summary)
+                        (setq prev-line-key line-key)))
                     (insert "\n"))))
 
 (defun xref--analyze (xrefs)
@@ -874,6 +935,12 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
       (pop-to-buffer (current-buffer))
       (current-buffer))))
 
+(defun xref--project-root (project)
+  (if (fboundp 'project-root)
+      (project-root project)
+    (with-no-warnings
+      (car (project-roots project)))))
+
 (defun xref--show-common-initialize (xref-alist fetcher alist)
   (setq buffer-undo-list nil)
   (let ((inhibit-read-only t)
@@ -902,7 +969,10 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
            'face 'error))))
       (goto-char (point-min)))))
 
-(defun xref--show-defs-buffer (fetcher alist)
+(defun xref-show-definitions-buffer (fetcher alist)
+  "Show the definitions list in a regular window.
+
+When only one definition found, jump to it right away instead."
   (let ((xrefs (funcall fetcher)))
     (cond
      ((not (cdr xrefs))
@@ -913,8 +983,12 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
                               (cons (cons 'fetched-xrefs xrefs)
                                     alist))))))
 
-(defun xref--show-defs-buffer-at-bottom (fetcher alist)
-  "Show definitions list in a window at the bottom.
+(define-obsolete-function-alias
+  'xref--show-defs-buffer #'xref-show-definitions-buffer "28.1")
+
+(defun xref-show-definitions-buffer-at-bottom (fetcher alist)
+  "Show the definitions list in a window at the bottom.
+
 When there is more than one definition, split the selected window
 and show the list in a small window at the bottom.  And use a
 local keymap that binds `RET' to `xref-quit-and-goto-xref'."
@@ -931,7 +1005,14 @@ local keymap that binds `RET' to 
`xref-quit-and-goto-xref'."
                        '(display-buffer-in-direction . ((direction . below))))
         (current-buffer))))))
 
-(defun xref--show-defs-minibuffer (fetcher alist)
+(define-obsolete-function-alias
+  'xref--show-defs-buffer-at-bottom #'xref-show-definitions-buffer-at-bottom)
+
+(defun xref-show-definitions-completing-read (fetcher alist)
+  "Let the user choose the target definition with completion.
+
+When there is more than one definition, let the user choose
+between them by typing in the minibuffer with completion."
   (let* ((xrefs (funcall fetcher))
          (xref-alist (xref--analyze xrefs))
          xref-alist-with-line-info
@@ -965,12 +1046,27 @@ local keymap that binds `RET' to 
`xref-quit-and-goto-xref'."
 
     (setq xref (if (not (cdr xrefs))
                    (car xrefs)
-                 (cdr (assoc (completing-read "Jump to definition: "
-                                              (reverse 
xref-alist-with-line-info))
-                             xref-alist-with-line-info))))
+                 (let* ((collection (reverse xref-alist-with-line-info))
+                        (ctable
+                         (lambda (string pred action)
+                           (cond
+                            ((eq action 'metadata)
+                             '(metadata . ((category . xref-location))))
+                            (t
+                             (complete-with-action action collection string 
pred)))))
+                        (def (caar collection)))
+                   (cdr (assoc (completing-read "Choose definition: "
+                                                ctable nil t
+                                                nil nil
+                                                def)
+                               collection)))))
 
     (xref-pop-to-location xref (assoc-default 'display-action alist))))
 
+;; TODO: Can delete this alias before Emacs 28's release.
+(define-obsolete-function-alias
+  'xref--show-defs-minibuffer #'xref-show-definitions-completing-read "28.1")
+
 
 (defcustom xref-show-xrefs-function 'xref--show-xref-buffer
   "Function to display a list of search results.
@@ -991,11 +1087,22 @@ displayed.  The possible values are nil, `window' 
meaning the
 other window, or `frame' meaning the other frame."
   :type 'function)
 
-(defcustom xref-show-definitions-function 'xref--show-defs-buffer
-  "Function to display a list of definitions.
+(defcustom xref-show-definitions-function 'xref-show-definitions-buffer
+  "Function to handle the definition search results.
 
-Accepts the same arguments as `xref-show-xrefs-function'."
-  :type 'function)
+Accepts the same arguments as `xref-show-xrefs-function'.
+
+Generally, it is expected to jump to the definition if there's
+only one, and otherwise provide some way to choose among the
+definitions."
+  :type '(choice
+          (const :tag "Show a regular list of locations"
+                 xref-show-definitions-buffer)
+          (const :tag "Show a \"transient\" list at the bottom of the window"
+                 xref-show-definitions-buffer-at-bottom)
+          (const :tag "Choose the definition with completion"
+                 xref-show-definitions-completing-read)
+          (function :tag "Custom function")))
 
 (defvar xref--read-identifier-history nil)
 
@@ -1334,7 +1441,9 @@ The template should have the following fields:
   <R> for the regexp itself (in Extended format)"
   :type '(repeat
           (cons (symbol :tag "Program identifier")
-                (string :tag "Command template"))))
+                (string :tag "Command template")))
+  :version "28.1"
+  :package-version '(xref . "1.0.4"))
 
 (defcustom xref-search-program 'grep
   "The program to use for regexp search inside files.
@@ -1343,7 +1452,9 @@ This must reference a corresponding entry in 
`xref-search-program-alist'."
   :type `(choice
           (const :tag "Use Grep" grep)
           (const :tag "Use ripgrep" ripgrep)
-          (symbol :tag "User defined")))
+          (symbol :tag "User defined"))
+  :version "28.1"
+  :package-version '(xref . "1.0.4"))
 
 ;;;###autoload
 (defun xref-matches-in-files (regexp files)
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el
index c699786..e85e3cf 100644
--- a/lisp/progmodes/xscheme.el
+++ b/lisp/progmodes/xscheme.el
@@ -1,6 +1,6 @@
 ;;; xscheme.el --- run MIT Scheme under Emacs        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 1986-1987, 1989-1990, 2001-2020 Free Software
+;; Copyright (C) 1986-1987, 1989-1990, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -173,7 +173,7 @@ With argument, asks for a command line."
   (setq-default xscheme-process-command-line command-line)
   (switch-to-buffer
    (xscheme-start-process command-line process-name buffer-name))
-  (set (make-local-variable 'xscheme-process-command-line) command-line))
+  (setq-local xscheme-process-command-line command-line))
 
 (defun xscheme-read-command-line (arg)
   (let ((default
@@ -264,11 +264,11 @@ With argument, asks for a command line."
                      xscheme-buffer-name
                      t)))
   (let ((process-name (verify-xscheme-buffer buffer-name t)))
-    (set (make-local-variable 'xscheme-buffer-name) buffer-name)
-    (set (make-local-variable 'xscheme-process-name) process-name)
-    (set (make-local-variable 'xscheme-runlight)
-         (with-current-buffer buffer-name
-           xscheme-runlight))))
+    (setq-local xscheme-buffer-name buffer-name)
+    (setq-local xscheme-process-name process-name)
+    (setq-local xscheme-runlight
+                (with-current-buffer buffer-name
+                  xscheme-runlight))))
 
 (defun local-clear-scheme-interaction-buffer ()
   "Make the current buffer use the default scheme interaction buffer."
@@ -375,10 +375,10 @@ Entry to this mode runs `scheme-mode-hook' and then
         (kill-all-local-variables)
         (make-local-variable 'xscheme-runlight-string)
         (make-local-variable 'xscheme-runlight)
-        (set (make-local-variable 'xscheme-previous-mode) previous-mode)
+        (setq-local xscheme-previous-mode previous-mode)
         (let ((buffer (current-buffer)))
-          (set (make-local-variable 'xscheme-buffer-name) (buffer-name buffer))
-          (set (make-local-variable 'xscheme-last-input-end) (make-marker))
+          (setq-local xscheme-buffer-name (buffer-name buffer))
+          (setq-local xscheme-last-input-end (make-marker))
           (let ((process (get-buffer-process buffer)))
             (when process
               (setq-local xscheme-process-name (process-name process))
diff --git a/lisp/ps-bdf.el b/lisp/ps-bdf.el
index 9216cfd..7bf2f71 100644
--- a/lisp/ps-bdf.el
+++ b/lisp/ps-bdf.el
@@ -1,6 +1,6 @@
 ;;; ps-bdf.el --- BDF font file handler for ps-print
 
-;; Copyright (C) 1998-1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-1999, 2001-2021 Free Software Foundation, Inc.
 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
 ;;   2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/lisp/ps-def.el b/lisp/ps-def.el
index 571e1a6..b9c3ab5 100644
--- a/lisp/ps-def.el
+++ b/lisp/ps-def.el
@@ -1,6 +1,6 @@
 ;;; ps-def.el --- Emacs definitions for ps-print -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;;     Kenichi Handa <handa@gnu.org> (multi-byte characters)
diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el
index cba0873..db86f94 100644
--- a/lisp/ps-mule.el
+++ b/lisp/ps-mule.el
@@ -1,6 +1,6 @@
 ;;; ps-mule.el --- provide multi-byte character facility to ps-print
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;;     Kenichi Handa <handa@gnu.org> (multi-byte characters)
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 351c489..fcc6e1f 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -1,6 +1,6 @@
 ;;; ps-print.el --- print text from the buffer as PostScript -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1993-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-2021 Free Software Foundation, Inc.
 
 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>)
 ;;     Jacques Duthen (was <duthen@cegelec-red.fr>)
@@ -4114,7 +4114,6 @@ If EXTENSION is any other symbol, it is ignored."
 
 (defun ps-message-log-max ()
   (and (not (string= (buffer-name) "*Messages*"))
-       (boundp 'message-log-max)
        message-log-max))
 
 
diff --git a/lisp/ps-samp.el b/lisp/ps-samp.el
index c5dcf49..fdff0f1 100644
--- a/lisp/ps-samp.el
+++ b/lisp/ps-samp.el
@@ -1,6 +1,6 @@
 ;;; ps-samp.el --- ps-print sample setup code
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>)
 ;;     Jacques Duthen (was <duthen@cegelec-red.fr>)
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 61c39de..a28a397 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1,6 +1,6 @@
 ;;; recentf.el --- setup a menu of recently opened files
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: July 19 1999
@@ -1127,7 +1127,7 @@ IGNORE arguments."
   (unless recentf-list
     (error "The list of recent files is empty"))
   (recentf-dialog (format "*%s - Edit list*" recentf-menu-title)
-    (set (make-local-variable 'recentf-edit-list) nil)
+    (setq-local recentf-edit-list nil)
     (widget-insert
      (format-message
       "Click on OK to delete selected files from the recent list.
@@ -1196,8 +1196,8 @@ IGNORE other arguments."
 
 (defun recentf-open-files-items (files)
   "Return a list of widgets to display FILES in a dialog buffer."
-  (set (make-local-variable 'recentf--files-with-key)
-       (recentf-trunc-list files 10))
+  (setq-local recentf--files-with-key
+              (recentf-trunc-list files 10))
   (mapcar 'recentf-open-files-item
           (append
            ;; When requested group the files with shortcuts together
diff --git a/lisp/rect.el b/lisp/rect.el
index ebf309a..cb941b4 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -1,6 +1,6 @@
 ;;; rect.el --- rectangle functions for GNU Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1999-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: Didier Verna <didier@didierverna.net>
 ;; Keywords: internal
diff --git a/lisp/register.el b/lisp/register.el
index 2e8989f..11d9848 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -1,6 +1,6 @@
 ;;; register.el --- register commands for Emacs      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 1985, 1993-1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1985, 1993-1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/registry.el b/lisp/registry.el
index ef47f07..a5c30f2 100644
--- a/lisp/registry.el
+++ b/lisp/registry.el
@@ -1,6 +1,6 @@
 ;;; registry.el --- Track and remember data items by various fields
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Teodor Zlatanov <tzz@lifelogs.com>
 ;; Keywords: data
diff --git a/lisp/repeat.el b/lisp/repeat.el
index 1dabd76..d488889 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -1,6 +1,6 @@
 ;;; repeat.el --- convenient way to repeat the previous command  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Will Mengarini <seldon@eskimo.com>
 ;; Created: Mo 02 Mar 98
diff --git a/lisp/replace.el b/lisp/replace.el
index 3a2ab1d..d41dc98 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1,6 +1,6 @@
 ;;; replace.el --- replace commands for Emacs -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2020 Free
+;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -1706,7 +1706,7 @@ See also `multi-occur'."
            (buffer-undo-list t)
            (occur--final-pos nil))
        (erase-buffer)
-        (set (make-local-variable 'occur-highlight-regexp) regexp)
+        (setq-local occur-highlight-regexp regexp)
        (let ((count
               (if (stringp nlines)
                    ;; Treat nlines as a regexp to collect.
diff --git a/lisp/reposition.el b/lisp/reposition.el
index 7561cc4..008fa00 100644
--- a/lisp/reposition.el
+++ b/lisp/reposition.el
@@ -1,6 +1,6 @@
 ;;; reposition.el --- center a Lisp function or comment on the screen  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1991, 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael D. Ernst <mernst@theory.lcs.mit.edu>
 ;; Created: Jan 1991
diff --git a/lisp/reveal.el b/lisp/reveal.el
index f9e3864..c01afd9 100644
--- a/lisp/reveal.el
+++ b/lisp/reveal.el
@@ -1,6 +1,6 @@
 ;;; reveal.el --- Automatically reveal hidden text at point -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: outlines
@@ -233,7 +233,7 @@ Also see the `reveal-auto-hide' variable."
   :keymap reveal-mode-map
   (if reveal-mode
       (progn
-       (set (make-local-variable 'search-invisible) t)
+        (setq-local search-invisible t)
        (add-hook 'post-command-hook 'reveal-post-command nil t))
     (kill-local-variable 'search-invisible)
     (remove-hook 'post-command-hook 'reveal-post-command t)))
diff --git a/lisp/rfn-eshadow.el b/lisp/rfn-eshadow.el
index 0ed1c37..f9842b5 100644
--- a/lisp/rfn-eshadow.el
+++ b/lisp/rfn-eshadow.el
@@ -1,6 +1,6 @@
 ;;; rfn-eshadow.el --- Highlight `shadowed' part of read-file-name input text
 ;;
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Miles Bader <miles@gnu.org>
 ;; Keywords: convenience minibuffer
diff --git a/lisp/rot13.el b/lisp/rot13.el
index 7a1f607..dfcf4ad 100644
--- a/lisp/rot13.el
+++ b/lisp/rot13.el
@@ -1,6 +1,6 @@
 ;;; rot13.el --- display a buffer in ROT13  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1988, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Howard Gayle
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/rtree.el b/lisp/rtree.el
index b790d05..166c780 100644
--- a/lisp/rtree.el
+++ b/lisp/rtree.el
@@ -1,6 +1,6 @@
 ;;; rtree.el --- functions for manipulating range trees  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 
diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el
index 82e6178..7cda6c9 100644
--- a/lisp/ruler-mode.el
+++ b/lisp/ruler-mode.el
@@ -1,6 +1,6 @@
 ;;; ruler-mode.el --- display a ruler in the header line
 
-;; Copyright (C) 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: 24 Mar 2001
@@ -584,8 +584,8 @@ format first."
   (when (and (not ruler-mode)
             (local-variable-p 'header-line-format)
             (not (local-variable-p 'ruler-mode-header-line-format-old)))
-    (set (make-local-variable 'ruler-mode-header-line-format-old)
-        header-line-format))
+    (setq-local ruler-mode-header-line-format-old
+                header-line-format))
   (setq header-line-format ruler-mode-header-line-format))
 
 ;;;###autoload
diff --git a/lisp/savehist.el b/lisp/savehist.el
index 8931e83..b8e9d6b 100644
--- a/lisp/savehist.el
+++ b/lisp/savehist.el
@@ -1,6 +1,6 @@
 ;;; savehist.el --- Save minibuffer history  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1997, 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Hrvoje Nikšić <hrvoje.niksic@avl.com>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index d420bfb..f654702 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -1,6 +1,6 @@
 ;;; saveplace.el --- automatically save place in files  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Karl Fogel <kfogel@red-bean.com>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/scroll-all.el b/lisp/scroll-all.el
index d6e18ae..25b245e 100644
--- a/lisp/scroll-all.el
+++ b/lisp/scroll-all.el
@@ -1,6 +1,6 @@
 ;;; scroll-all.el --- scroll all buffers together minor mode
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Gary D. Foster <Gary.Foster@corp.sun.com>
 ;; Keywords: convenience scroll lock
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index 5b82934..802cb30 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -1,6 +1,6 @@
 ;;; scroll-bar.el --- window system-independent scroll bar support
 
-;; Copyright (C) 1993-1995, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 1999-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: hardware
diff --git a/lisp/scroll-lock.el b/lisp/scroll-lock.el
index f20ea1b..e8f69b2 100644
--- a/lisp/scroll-lock.el
+++ b/lisp/scroll-lock.el
@@ -1,6 +1,6 @@
 ;;; scroll-lock.el --- Scroll lock scrolling.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: emacs-devel@gnu.org
@@ -64,7 +64,7 @@ MS-Windows systems if `w32-scroll-lock-modifier' is non-nil."
       (progn
        (setq scroll-lock-preserve-screen-pos-save
              scroll-preserve-screen-position)
-       (set (make-local-variable 'scroll-preserve-screen-position) 'always))
+        (setq-local scroll-preserve-screen-position 'always))
     (setq scroll-preserve-screen-position
          scroll-lock-preserve-screen-pos-save)))
 
diff --git a/lisp/select.el b/lisp/select.el
index 596335b..c39bc93 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -1,6 +1,6 @@
 ;;; select.el --- lisp portion of standard selection support  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
diff --git a/lisp/server.el b/lisp/server.el
index 2fd9455..b82e301 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1,6 +1,6 @@
 ;;; server.el --- Lisp code for GNU Emacs running as server process -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1986-1987, 1992, 1994-2020 Free Software Foundation,
+;; Copyright (C) 1986-1987, 1992, 1994-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: William Sommerfeld <wesommer@athena.mit.edu>
@@ -268,6 +268,12 @@ the \"-f\" switch otherwise."
   :type 'string
   :version "23.1")
 
+(defcustom server-client-instructions t
+  "If non-nil, display instructions on how to exit the client on connection.
+If nil, no instructions are displayed."
+  :version "28.1"
+  :type 'boolean)
+
 ;; We do not use `temporary-file-directory' here, because emacsclient
 ;; does not read the init file.
 (defvar server-socket-dir
@@ -1360,8 +1366,10 @@ The following commands are accepted by the client:
             nil)
            ((and frame (null buffers))
             (run-hooks 'server-after-make-frame-hook)
-            (message "%s" (substitute-command-keys
-                           "When done with this frame, type 
\\[delete-frame]")))
+            (when server-client-instructions
+              (message "%s"
+                       (substitute-command-keys
+                        "When done with this frame, type \\[delete-frame]"))))
            ((not (null buffers))
             (run-hooks 'server-after-make-frame-hook)
             (server-switch-buffer
@@ -1372,9 +1380,11 @@ The following commands are accepted by the client:
              ;; where it may be displayed.
              (plist-get (process-plist proc) 'frame))
             (run-hooks 'server-switch-hook)
-            (unless nowait
-              (message "%s" (substitute-command-keys
-                             "When done with a buffer, type 
\\[server-edit]")))))
+            (when (and (not nowait)
+                       server-client-instructions)
+              (message "%s"
+                       (substitute-command-keys
+                        "When done with a buffer, type \\[server-edit]")))))
           (when (and frame (null tty-name))
             (server-unselect-display frame)))
       ((quit error)
diff --git a/lisp/ses.el b/lisp/ses.el
index bfafc13..d6090f3 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -1,6 +1,6 @@
 ;;; ses.el -- Simple Emacs Spreadsheet  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Jonathan Yavner <jyavner@member.fsf.org>
 ;; Maintainer: Vincent Belaïche <vincentb1@users.sourceforge.net>
@@ -430,7 +430,8 @@ when to emit a progress message.")
   local-printer-list)
 
 (defmacro ses-cell-symbol (row &optional col)
-  "From a CELL or a pair (ROW,COL), get the symbol that names the 
local-variable holding its value.  (0,0) => A1."
+  "Return symbol of the local-variable holding value of CELL or pair (ROW,COL).
+For example, (0,0) => A1."
   (declare (debug t))
   `(ses-cell--symbol ,(if col `(ses-get-cell ,row ,col) row)))
 (put 'ses-cell-symbol 'safe-function t)
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el
index a7343a9..a4f0eba 100644
--- a/lisp/shadowfile.el
+++ b/lisp/shadowfile.el
@@ -1,6 +1,6 @@
 ;;; shadowfile.el --- automatic file copying
 
-;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Boris Goldowsky <boris@gnu.org>
 ;; Keywords: comm files
diff --git a/lisp/shell.el b/lisp/shell.el
index 5fed651..c179dd2 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -1,6 +1,6 @@
 ;;; shell.el --- specialized comint.el for running the shell -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1988, 1993-1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1988, 1993-1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Olin Shivers <shivers@cs.cmu.edu>
@@ -471,32 +471,32 @@ Shell buffers.  It implements `shell-completion-execonly' 
for
 
 (defun shell-completion-vars ()
   "Setup completion vars for `shell-mode' and `read-shell-command'."
-  (set (make-local-variable 'comint-completion-fignore)
-       shell-completion-fignore)
-  (set (make-local-variable 'comint-delimiter-argument-list)
-       shell-delimiter-argument-list)
-  (set (make-local-variable 'comint-file-name-chars) shell-file-name-chars)
-  (set (make-local-variable 'comint-file-name-quote-list)
-       shell-file-name-quote-list)
-  (set (make-local-variable 'comint-file-name-prefix)
-       (or (file-remote-p default-directory) ""))
-  (set (make-local-variable 'comint-dynamic-complete-functions)
-       shell-dynamic-complete-functions)
+  (setq-local comint-completion-fignore
+              shell-completion-fignore)
+  (setq-local comint-delimiter-argument-list
+              shell-delimiter-argument-list)
+  (setq-local comint-file-name-chars shell-file-name-chars)
+  (setq-local comint-file-name-quote-list
+              shell-file-name-quote-list)
+  (setq-local comint-file-name-prefix
+              (or (file-remote-p default-directory) ""))
+  (setq-local comint-dynamic-complete-functions
+              shell-dynamic-complete-functions)
   (setq-local comint-unquote-function #'shell--unquote-argument)
   (setq-local comint-requote-function #'shell--requote-argument)
-  (set (make-local-variable 'pcomplete-parse-arguments-function)
-       #'shell--parse-pcomplete-arguments)
-  (set (make-local-variable 'pcomplete-termination-string)
-       (cond ((not comint-completion-addsuffix) "")
-             ((stringp comint-completion-addsuffix)
-              comint-completion-addsuffix)
-             ((not (consp comint-completion-addsuffix)) " ")
-             (t (cdr comint-completion-addsuffix))))
-  (set (make-local-variable 'pcomplete-command-completion-function)
-       #'shell-command-completion-function)
+  (setq-local pcomplete-parse-arguments-function
+              #'shell--parse-pcomplete-arguments)
+  (setq-local pcomplete-termination-string
+              (cond ((not comint-completion-addsuffix) "")
+                    ((stringp comint-completion-addsuffix)
+                     comint-completion-addsuffix)
+                    ((not (consp comint-completion-addsuffix)) " ")
+                    (t (cdr comint-completion-addsuffix))))
+  (setq-local pcomplete-command-completion-function
+              #'shell-command-completion-function)
   ;; Don't use pcomplete's defaulting mechanism, rely on
   ;; shell-dynamic-complete-functions instead.
-  (set (make-local-variable 'pcomplete-default-completion-function) #'ignore)
+  (setq-local pcomplete-default-completion-function #'ignore)
   (setq-local comint-input-autoexpand shell-input-autoexpand)
   ;; Not needed in shell-mode because it's inherited from comint-mode, but
   ;; placed here for read-shell-command.
@@ -596,7 +596,7 @@ buffer."
       (and (stringp hsize)
           (integerp (setq hsize (string-to-number hsize)))
           (> hsize 0)
-          (set (make-local-variable 'comint-input-ring-size) hsize))
+           (setq-local comint-input-ring-size hsize))
       (setq comint-input-ring-file-name
             (concat
              remote
diff --git a/lisp/simple.el b/lisp/simple.el
index 3c4f756..54c35c0 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1,6 +1,6 @@
 ;;; simple.el --- basic editing commands for Emacs  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1987, 1993-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1987, 1993-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
@@ -1264,7 +1264,6 @@ that uses or sets the mark."
   ;; minibuffer, this is at the end of the prompt.
   (goto-char (minibuffer-prompt-end)))
 
-
 ;; Counting lines, one way or another.
 
 (defvar goto-line-history nil
@@ -1276,15 +1275,8 @@ that uses or sets the mark."
   (if (and current-prefix-arg (not (consp current-prefix-arg)))
       (list (prefix-numeric-value current-prefix-arg))
     ;; Look for a default, a number in the buffer at point.
-    (let* ((default
-             (save-excursion
-               (skip-chars-backward "0-9")
-               (if (looking-at "[0-9]")
-                   (string-to-number
-                    (buffer-substring-no-properties
-                     (point)
-                     (progn (skip-chars-forward "0-9")
-                            (point)))))))
+    (let* ((number (number-at-point))
+           (default (and (natnump number) number))
            ;; Decide if we're switching buffers.
            (buffer
             (if (consp current-prefix-arg)
@@ -1922,7 +1914,7 @@ to get different commands to edit and resubmit."
                     (setq execute-extended-command--last-typed
                               (minibuffer-contents)))
                   nil 'local)
-       (set (make-local-variable 'minibuffer-default-add-function)
+        (setq-local minibuffer-default-add-function
             (lambda ()
               ;; Get a command name at point in the original buffer
               ;; to propose it after M-n.
@@ -1958,22 +1950,27 @@ to get different commands to edit and resubmit."
      (lambda (string pred action)
        (if (and suggest-key-bindings (eq action 'metadata))
           '(metadata
-            (annotation-function . read-extended-command--annotation)
+            (affixation-function . read-extended-command--affixation)
             (category . command))
          (complete-with-action action obarray string pred)))
      #'commandp t nil 'extended-command-history)))
 
-(defun read-extended-command--annotation (command-name)
-  (let* ((fun (and (stringp command-name) (intern-soft command-name)))
-         (binding (where-is-internal fun overriding-local-map t))
-         (obsolete (get fun 'byte-obsolete-info))
-         (alias (symbol-function fun)))
-    (cond ((symbolp alias)
-           (format " (%s)" alias))
-          (obsolete
-           (format " (%s)" (car obsolete)))
-          ((and binding (not (stringp binding)))
-           (format " (%s)" (key-description binding))))))
+(defun read-extended-command--affixation (command-names)
+  (with-selected-window (or (minibuffer-selected-window) (selected-window))
+    (mapcar
+     (lambda (command-name)
+       (let* ((fun (and (stringp command-name) (intern-soft command-name)))
+              (binding (where-is-internal fun overriding-local-map t))
+              (obsolete (get fun 'byte-obsolete-info))
+              (alias (symbol-function fun))
+              (suffix (cond ((symbolp alias)
+                             (format " (%s)" alias))
+                            (obsolete
+                             (format " (%s)" (car obsolete)))
+                            ((and binding (not (stringp binding)))
+                             (format " (%s)" (key-description binding))))))
+         (if suffix (list command-name suffix) command-name)))
+     command-names)))
 
 (defcustom suggest-key-bindings t
   "Non-nil means show the equivalent key-binding when M-x command has one.
@@ -2195,7 +2192,8 @@ in this use of the minibuffer.")
   "Minibuffer history variables for which matching should ignore case.
 If a history variable is a member of this list, then the
 \\[previous-matching-history-element] and \\[next-matching-history-element]\
- commands ignore case when searching it, regardless of `case-fold-search'."
+ commands ignore case when searching it,
+regardless of `case-fold-search'."
   :type '(repeat variable)
   :group 'minibuffer)
 
@@ -2372,10 +2370,10 @@ negative number -N means the Nth entry of \"future 
history.\""
     (unless (memq last-command '(next-history-element
                                 previous-history-element))
       (let ((prompt-end (minibuffer-prompt-end)))
-       (set (make-local-variable 'minibuffer-temporary-goal-position)
-            (cond ((<= (point) prompt-end) prompt-end)
-                  ((eobp) nil)
-                  (t (point))))))
+        (setq-local minibuffer-temporary-goal-position
+                    (cond ((<= (point) prompt-end) prompt-end)
+                          ((eobp) nil)
+                          (t (point))))))
     (goto-char (point-max))
     (delete-minibuffer-contents)
     (setq minibuffer-history-position nabs)
@@ -2548,14 +2546,14 @@ Return 0 if current buffer is not a minibuffer."
 (defun minibuffer-history-isearch-setup ()
   "Set up a minibuffer for using isearch to search the minibuffer history.
 Intended to be added to `minibuffer-setup-hook'."
-  (set (make-local-variable 'isearch-search-fun-function)
-       'minibuffer-history-isearch-search)
-  (set (make-local-variable 'isearch-message-function)
-       'minibuffer-history-isearch-message)
-  (set (make-local-variable 'isearch-wrap-function)
-       'minibuffer-history-isearch-wrap)
-  (set (make-local-variable 'isearch-push-state-function)
-       'minibuffer-history-isearch-push-state)
+  (setq-local isearch-search-fun-function
+              #'minibuffer-history-isearch-search)
+  (setq-local isearch-message-function
+              #'minibuffer-history-isearch-message)
+  (setq-local isearch-wrap-function
+              #'minibuffer-history-isearch-wrap)
+  (setq-local isearch-push-state-function
+              #'minibuffer-history-isearch-push-state)
   (add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t))
 
 (defun minibuffer-history-isearch-end ()
@@ -3585,8 +3583,8 @@ to `shell-command-history'."
   (minibuffer-with-setup-hook
       (lambda ()
         (shell-completion-vars)
-       (set (make-local-variable 'minibuffer-default-add-function)
-            'minibuffer-default-add-shell-commands))
+        (setq-local minibuffer-default-add-function
+                    #'minibuffer-default-add-shell-commands))
     (apply #'read-from-minibuffer prompt initial-contents
           minibuffer-local-shell-command-map
           nil
@@ -4301,8 +4299,7 @@ characters."
 (defun shell-command-to-string (command)
   "Execute shell command COMMAND and return its output as a string."
   (with-output-to-string
-    (with-current-buffer
-      standard-output
+    (with-current-buffer standard-output
       (shell-command command t))))
 
 (defun process-file (program &optional infile buffer display &rest args)
@@ -7202,6 +7199,12 @@ rests."
   "Move point to visible beginning of current logical line.
 This disregards any invisible newline characters.
 
+When moving from position that has no `field' property, this
+command doesn't enter text which has non-nil `field' property.
+In particular, when invoked in the minibuffer, the command will
+stop short of entering the text of the minibuffer prompt.
+See `inhibit-field-text-motion' for how to inhibit this.
+
 With argument ARG not nil or 1, move forward ARG - 1 lines first.
 If point reaches the beginning or end of buffer, it stops there.
 \(But if the buffer doesn't end in a newline, it stops at the
@@ -7431,8 +7434,8 @@ Mode' for details."
            (if (local-variable-p var)
                (push (cons var (symbol-value var))
                      visual-line--saved-state))))
-       (set (make-local-variable 'line-move-visual) t)
-       (set (make-local-variable 'truncate-partial-width-windows) nil)
+        (setq-local line-move-visual t)
+        (setq-local truncate-partial-width-windows nil)
        (setq truncate-lines nil
              word-wrap t
              fringe-indicator-alist
@@ -8825,10 +8828,9 @@ Called from `temp-buffer-show-hook'."
       (let ((base-position completion-base-position)
             (insert-fun completion-list-insert-choice-function))
         (completion-list-mode)
-        (set (make-local-variable 'completion-base-position) base-position)
-        (set (make-local-variable 'completion-list-insert-choice-function)
-            insert-fun))
-      (set (make-local-variable 'completion-reference-buffer) mainbuf)
+        (setq-local completion-base-position base-position)
+        (setq-local completion-list-insert-choice-function insert-fun))
+      (setq-local completion-reference-buffer mainbuf)
       (if base-dir (setq default-directory base-dir))
       (when completion-tab-width
         (setq tab-width completion-tab-width))
@@ -9288,8 +9290,7 @@ to a non-nil value."
   (cond
    ((and (not buffer-read-only) view-mode)
     (View-exit-and-edit)
-    (make-local-variable 'view-read-only)
-    (setq view-read-only t))           ; Must leave view mode.
+    (setq-local view-read-only t))             ; Must leave view mode.
    ((and buffer-read-only view-read-only
          ;; If view-mode is already active, `view-mode-enter' is a nop.
          (not view-mode)
@@ -9307,8 +9308,8 @@ and setting it to nil."
     (setq buffer-invisibility-spec vis-mode-saved-buffer-invisibility-spec)
     (kill-local-variable 'vis-mode-saved-buffer-invisibility-spec))
   (when visible-mode
-    (set (make-local-variable 'vis-mode-saved-buffer-invisibility-spec)
-        buffer-invisibility-spec)
+    (setq-local vis-mode-saved-buffer-invisibility-spec
+                buffer-invisibility-spec)
     (setq buffer-invisibility-spec nil)))
 
 (defvar messages-buffer-mode-map
diff --git a/lisp/skeleton.el b/lisp/skeleton.el
index 6e2c10d..48491e4 100644
--- a/lisp/skeleton.el
+++ b/lisp/skeleton.el
@@ -1,6 +1,6 @@
 ;;; skeleton.el --- Lisp language extension for writing statement skeletons  
-*- lexical-binding: t; -*-
 
-;; Copyright (C) 1993-1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>
 ;; Maintainer: emacs-devel@gnu.org
@@ -312,10 +312,15 @@ automatically, and you are prompted to fill in the 
variable parts.")))
         (save-excursion (insert "\n")))
     (unwind-protect
        (setq prompt (cond ((stringp prompt)
-                            (read-string (format prompt skeleton-subprompt)
-                                         (setq initial-input
-                                               (or initial-input
-                                                   (symbol-value 'input)))))
+                            ;; The user may issue commands to move
+                            ;; around (like `C-M-v').  Ensure that we
+                            ;; insert the skeleton at the correct
+                            ;; (initial) point.
+                            (save-excursion
+                              (read-string (format prompt skeleton-subprompt)
+                                           (setq initial-input
+                                                 (or initial-input
+                                                     (symbol-value 'input))))))
                            ((functionp prompt)
                             (funcall prompt))
                            (t (eval prompt))))
diff --git a/lisp/so-long.el b/lisp/so-long.el
index 431073a..f44d41d 100644
--- a/lisp/so-long.el
+++ b/lisp/so-long.el
@@ -1,6 +1,6 @@
 ;;; so-long.el --- Say farewell to performance problems with minified code.  
-*- lexical-binding:t -*-
 ;;
-;; Copyright (C) 2015-2016, 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2016, 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Phil Sainty <psainty@orcon.net.nz>
 ;; Maintainer: Phil Sainty <psainty@orcon.net.nz>
@@ -41,9 +41,9 @@
 ;; simply aren't optimised (remotely) for this scenario, so performance can
 ;; suffer significantly.
 ;;
-;; When such files are detected, the command `so-long' is automatically called,
-;; overriding certain minor modes and variables with performance implications
-;; (all configurable), in order to enhance performance in the buffer.
+;; When so-long detects such a file, it calls the command `so-long', which
+;; overrides certain minor modes and variables (you can configure the details)
+;; to improve performance in the buffer.
 ;;
 ;; The default action enables the major mode `so-long-mode' in place of the 
mode
 ;; that Emacs selected.  This ensures that the original major mode cannot 
affect
diff --git a/lisp/sort.el b/lisp/sort.el
index b9a27a8..0d2fd41 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -1,6 +1,6 @@
 ;;; sort.el --- commands to sort text in an Emacs buffer -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 1986-1987, 1994-1995, 2001-2020 Free Software
+;; Copyright (C) 1986-1987, 1994-1995, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Howie Kaye
diff --git a/lisp/soundex.el b/lisp/soundex.el
index fac63b1..ed98c65 100644
--- a/lisp/soundex.el
+++ b/lisp/soundex.el
@@ -1,6 +1,6 @@
 ;;; soundex.el --- implement Soundex algorithm -*- lexical-binding: t -*-
 
-;; Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Christian Plaunt <chris@bliss.berkeley.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 3468780..7f751ec 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -1,6 +1,6 @@
 ;;; speedbar --- quick access to files and tags in a frame
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: file, tags, tools
@@ -979,10 +979,9 @@ supported at a time.
     (speedbar-set-timer dframe-update-speed)
     )
   ;; Frame modifications
-  (set (make-local-variable 'dframe-delete-frame-function)
-       'speedbar-handle-delete-frame)
+  (setq-local dframe-delete-frame-function 'speedbar-handle-delete-frame)
   ;; hscroll
-  (set (make-local-variable 'auto-hscroll-mode) nil)
+  (setq-local auto-hscroll-mode nil)
   ;; reset the selection variable
   (setq speedbar-last-selected-file nil))
 
@@ -1075,9 +1074,8 @@ in the selected file.
   (save-excursion
     (setq font-lock-keywords nil) ;; no font-locking please
     (setq truncate-lines t)
-    (make-local-variable 'frame-title-format)
-    (setq frame-title-format "Speedbar"
-         case-fold-search nil
+    (setq-local frame-title-format "Speedbar")
+    (setq case-fold-search nil
          buffer-read-only t)
     (speedbar-set-mode-line-format)
     ;; Add in our dframe hooks.
@@ -1814,16 +1812,13 @@ of the special mode functions."
              (setq v (intern-soft (concat ms "-speedbar-key-map")))
              (if (not v)
                  nil ;; don't add special keymap
-               (make-local-variable 'speedbar-special-mode-key-map)
-               (setq speedbar-special-mode-key-map
-                     (symbol-value v)))
+                (setq-local speedbar-special-mode-key-map
+                            (symbol-value v)))
              (setq v (intern-soft (concat ms "-speedbar-menu-items")))
              (if (not v)
                  nil ;; don't add special menus
-               (make-local-variable 'speedbar-easymenu-definition-special)
-               (setq speedbar-easymenu-definition-special
-                     (symbol-value v)))
-             )))))))
+                (setq-local speedbar-easymenu-definition-special
+                            (symbol-value v))))))))))
 
 (defun speedbar-remove-localized-speedbar-support (buffer)
   "Remove any traces that BUFFER supports speedbar in a specialized way."
diff --git a/lisp/startup.el b/lisp/startup.el
index 9f67dfd..dfac0c8 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1,6 +1,6 @@
 ;;; startup.el --- process Emacs shell arguments  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1992, 1994-2020 Free Software Foundation,
+;; Copyright (C) 1985-1986, 1992, 1994-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -633,7 +633,7 @@ It is the default value of the variable `top-level'."
       (with-current-buffer "*Messages*"
         (messages-buffer-mode)
         ;; Make it easy to do like "tail -f".
-        (set (make-local-variable 'window-point-insertion-type) t)
+        (setq-local window-point-insertion-type t)
         ;; Give *Messages* the same default-directory as *scratch*,
         ;; just to keep things predictable.
        (setq default-directory (or dir (expand-file-name "~/")))))
@@ -949,10 +949,10 @@ init-file, or to a default value if loading is not 
possible."
 
               (when (and (eq user-init-file t) alternate-filename-function)
                 (let ((alt-file (funcall alternate-filename-function)))
-                  (and (equal (file-name-extension alt-file) "el")
-                       (setq alt-file (file-name-sans-extension alt-file)))
                  (unless init-file-name
                    (setq init-file-name alt-file))
+                  (and (equal (file-name-extension alt-file) "el")
+                       (setq alt-file (file-name-sans-extension alt-file)))
                   (load alt-file 'noerror 'nomessage)))
 
               ;; If we did not find the user's init file, set
@@ -1382,7 +1382,7 @@ please check its value")
          "~/.emacs")))
      (lambda ()
        (expand-file-name
-        "init"
+        "init.el"
         startup-init-directory))
      (not inhibit-default-init))
 
@@ -1999,7 +1999,7 @@ splash screen in another window."
       (setq buffer-read-only nil)
       (erase-buffer)
       (setq default-directory command-line-default-directory)
-      (set (make-local-variable 'tab-width) 8)
+      (setq-local tab-width 8)
 
       (if pure-space-overflow
          (insert pure-space-overflow-message))
diff --git a/lisp/strokes.el b/lisp/strokes.el
index 11bc07a..b0ab4f9 100644
--- a/lisp/strokes.el
+++ b/lisp/strokes.el
@@ -1,6 +1,6 @@
 ;;; strokes.el --- control Emacs through mouse strokes
 
-;; Copyright (C) 1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: David Bakhash <cadet@alum.mit.edu>
 ;; Maintainer: emacs-devel@gnu.org
@@ -1231,8 +1231,8 @@ the stroke as a character in some language."
 ;;     mode-popup-menu edit-strokes-menu) ; what about extent-specific stuff?
 ;;  (and (featurep 'menubar)
 ;;       current-menubar
-;;       (set (make-local-variable 'current-menubar)
-;;         (copy-sequence current-menubar))
+;;       (setq-local current-menubar
+;;                   (copy-sequence current-menubar))
 ;;       (add-submenu nil edit-strokes-menu)))
 
 ;;(let ((map edit-strokes-mode-map))
@@ -1363,13 +1363,13 @@ If STROKES-MAP is not given, `strokes-global-map' will 
be used instead."
      finally do (unless (eobp)
                   (kill-region (1+ (point)) (point-max))))
     (view-buffer "*Strokes List*" nil)
-    (set (make-local-variable 'view-mode-map)
-        (let ((map (copy-keymap view-mode-map)))
-          (define-key map "q" `(lambda ()
-                                 (interactive)
-                                 (View-quit)
-                                 (set-window-configuration ,config)))
-          map))
+    (setq-local view-mode-map
+                (let ((map (copy-keymap view-mode-map)))
+                  (define-key map "q" `(lambda ()
+                                         (interactive)
+                                         (View-quit)
+                                         (set-window-configuration ,config)))
+                  map))
     (goto-char (point-min))))
 
 (defun strokes-alphabetic-lessp (stroke1 stroke2)
diff --git a/lisp/subr.el b/lisp/subr.el
index 2236e93..1acc3c3 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1,6 +1,6 @@
 ;;; subr.el --- basic lisp subroutines for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2020 Free Software
+;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -1742,7 +1742,32 @@ FUNCTION isn't the value of HOOK, or, if FUNCTION 
doesn't appear in the
 list of hooks to run in HOOK, then nothing is done.  See `add-hook'.
 
 The optional third argument, LOCAL, if non-nil, says to modify
-the hook's buffer-local value rather than its default value."
+the hook's buffer-local value rather than its default value.
+
+Interactively, prompt for the various arguments (skipping local
+unless HOOK has both local and global functions).  If multiple
+functions have the same representation under `princ', the first
+one will be removed."
+  (interactive
+   (let* ((hook (intern (completing-read "Hook variable: " obarray #'boundp 
t)))
+          (local
+           (and
+            (local-variable-p hook)
+            (symbol-value hook)
+            ;; No need to prompt if there's nothing global
+            (or (not (default-value hook))
+                (y-or-n-p (format "%s has a buffer-local binding, use that? "
+                                  hook)))))
+          (fn-alist (mapcar
+                     (lambda (x) (cons (with-output-to-string (prin1 x)) x))
+                     (if local (symbol-value hook) (default-value hook))))
+          (function (alist-get (completing-read
+                                (format "%s hook to remove: "
+                                        (if local "Buffer-local" "Global"))
+                                fn-alist
+                                nil t)
+                               fn-alist nil nil 'string=)))
+     (list hook function local)))
   (or (boundp hook) (set hook nil))
   (or (default-boundp hook) (set-default hook nil))
   ;; Do nothing if LOCAL is t but this hook has no local binding.
@@ -1950,9 +1975,8 @@ can do the job."
   "Add ELEMENT to the value of LIST-VAR if it isn't there yet.
 The test for presence of ELEMENT is done with `eq'.
 
-The resulting list is reordered so that the elements are in the
-order given by each element's numeric list order.  Elements
-without a numeric list order are placed at the end of the list.
+The value of LIST-VAR is kept ordered based on the ORDER
+parameter.
 
 If the third optional argument ORDER is a number (integer or
 float), set the element's list order to the given value.  If
@@ -2601,6 +2625,10 @@ This function is used by the `interactive' code letter 
`n'."
            t)))
     n))
 
+(defvar read-char-choice-use-read-key nil
+  "Prefer `read-key' when reading a character by `read-char-choice'.
+Otherwise, use the minibuffer.")
+
 (defun read-char-choice (prompt chars &optional inhibit-keyboard-quit)
   "Read and return one of CHARS, prompting for PROMPT.
 Any input that is not one of CHARS is ignored.
@@ -2611,44 +2639,46 @@ keyboard-quit events while waiting for a valid input.
 If you bind the variable `help-form' to a non-nil value
 while calling this function, then pressing `help-char'
 causes it to evaluate `help-form' and display the result."
-  (unless (consp chars)
-    (error "Called `read-char-choice' without valid char choices"))
-  (let (char done show-help (helpbuf " *Char Help*"))
-    (let ((cursor-in-echo-area t)
-          (executing-kbd-macro executing-kbd-macro)
-         (esc-flag nil))
-      (save-window-excursion         ; in case we call help-form-show
-       (while (not done)
-         (unless (get-text-property 0 'face prompt)
-           (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
-         (setq char (let ((inhibit-quit inhibit-keyboard-quit))
-                      (read-key prompt)))
-         (and show-help (buffer-live-p (get-buffer helpbuf))
-              (kill-buffer helpbuf))
-         (cond
-          ((not (numberp char)))
-          ;; If caller has set help-form, that's enough.
-          ;; They don't explicitly have to add help-char to chars.
-          ((and help-form
-                (eq char help-char)
-                (setq show-help t)
-                (help-form-show)))
-          ((memq char chars)
-           (setq done t))
-          ((and executing-kbd-macro (= char -1))
-           ;; read-event returns -1 if we are in a kbd macro and
-           ;; there are no more events in the macro.  Attempt to
-           ;; get an event interactively.
-           (setq executing-kbd-macro nil))
-          ((not inhibit-keyboard-quit)
-           (cond
-            ((and (null esc-flag) (eq char ?\e))
-             (setq esc-flag t))
-            ((memq char '(?\C-g ?\e))
-             (keyboard-quit))))))))
-    ;; Display the question with the answer.  But without cursor-in-echo-area.
-    (message "%s%s" prompt (char-to-string char))
-    char))
+  (if (not read-char-choice-use-read-key)
+      (read-char-from-minibuffer prompt chars)
+    (unless (consp chars)
+      (error "Called `read-char-choice' without valid char choices"))
+    (let (char done show-help (helpbuf " *Char Help*"))
+      (let ((cursor-in-echo-area t)
+            (executing-kbd-macro executing-kbd-macro)
+            (esc-flag nil))
+        (save-window-excursion        ; in case we call help-form-show
+          (while (not done)
+            (unless (get-text-property 0 'face prompt)
+              (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
+            (setq char (let ((inhibit-quit inhibit-keyboard-quit))
+                         (read-key prompt)))
+            (and show-help (buffer-live-p (get-buffer helpbuf))
+                 (kill-buffer helpbuf))
+            (cond
+             ((not (numberp char)))
+             ;; If caller has set help-form, that's enough.
+             ;; They don't explicitly have to add help-char to chars.
+             ((and help-form
+                   (eq char help-char)
+                   (setq show-help t)
+                   (help-form-show)))
+             ((memq char chars)
+              (setq done t))
+             ((and executing-kbd-macro (= char -1))
+              ;; read-event returns -1 if we are in a kbd macro and
+              ;; there are no more events in the macro.  Attempt to
+              ;; get an event interactively.
+              (setq executing-kbd-macro nil))
+             ((not inhibit-keyboard-quit)
+              (cond
+               ((and (null esc-flag) (eq char ?\e))
+                (setq esc-flag t))
+               ((memq char '(?\C-g ?\e))
+                (keyboard-quit))))))))
+      ;; Display the question with the answer.  But without 
cursor-in-echo-area.
+      (message "%s%s" prompt (char-to-string char))
+      char)))
 
 (defun sit-for (seconds &optional nodisp obsolete)
   "Redisplay, then wait for SECONDS seconds.  Stop when input is available.
@@ -2719,6 +2749,15 @@ floating point support."
            (push (cons t read) unread-command-events)
            nil))))))
 
+(defun goto-char--read-natnum-interactive (prompt)
+  "Get a natural number argument, optionally prompting with PROMPT.
+If there is a natural number at point, use it as default."
+  (if (and current-prefix-arg (not (consp current-prefix-arg)))
+      (list (prefix-numeric-value current-prefix-arg))
+    (let* ((number (number-at-point))
+           (default (and (natnump number) number)))
+      (list (read-number prompt (list default (point)))))))
+
 
 (defvar read-char-history nil
   "The default history for the `read-char-from-minibuffer' function.")
@@ -2886,6 +2925,10 @@ Also discard all previous input in the minibuffer."
     (minibuffer-message "Please answer y or n")
     (sit-for 2)))
 
+(defvar y-or-n-p-use-read-key nil
+  "Prefer `read-key' when answering a \"y or n\" question by `y-or-n-p'.
+Otherwise, use the minibuffer.")
+
 (defvar empty-history)
 
 (defun y-or-n-p (prompt)
@@ -2946,6 +2989,41 @@ is nil and `use-dialog-box' is non-nil."
           use-dialog-box)
       (setq prompt (funcall padded prompt t)
            answer (x-popup-dialog t `(,prompt ("Yes" . act) ("No" . skip)))))
+     (y-or-n-p-use-read-key
+      ;; ¡Beware! when I tried to edebug this code, Emacs got into a weird 
state
+      ;; where all the keys were unbound (i.e. it somehow got triggered
+      ;; within read-key, apparently).  I had to kill it.
+      (setq prompt (funcall padded prompt))
+      (while
+          (let* ((scroll-actions '(recenter scroll-up scroll-down
+                                            scroll-other-window 
scroll-other-window-down))
+                 (key
+                  (let ((cursor-in-echo-area t))
+                    (when minibuffer-auto-raise
+                      (raise-frame (window-frame (minibuffer-window))))
+                    (read-key (propertize (if (memq answer scroll-actions)
+                                              prompt
+                                            (concat "Please answer y or n.  "
+                                                    prompt))
+                                          'face 'minibuffer-prompt)))))
+            (setq answer (lookup-key query-replace-map (vector key) t))
+            (cond
+             ((memq answer '(skip act)) nil)
+             ((eq answer 'recenter)
+              (recenter) t)
+             ((eq answer 'scroll-up)
+              (ignore-errors (scroll-up-command)) t)
+             ((eq answer 'scroll-down)
+              (ignore-errors (scroll-down-command)) t)
+             ((eq answer 'scroll-other-window)
+              (ignore-errors (scroll-other-window)) t)
+             ((eq answer 'scroll-other-window-down)
+              (ignore-errors (scroll-other-window-down)) t)
+             ((or (memq answer '(exit-prefix quit)) (eq key ?\e))
+              (signal 'quit nil) t)
+             (t t)))
+        (ding)
+        (discard-input)))
      (t
       (setq prompt (funcall padded prompt))
       (let* ((empty-history '())
@@ -3551,7 +3629,7 @@ Do nothing if FACE is nil."
 
 ;;;; Synchronous shell commands.
 
-(defun start-process-shell-command (name buffer &rest args)
+(defun start-process-shell-command (name buffer command)
   "Start a program in a subprocess.  Return the process object for it.
 NAME is name for process.  It is modified if necessary to make it unique.
 BUFFER is the buffer (or buffer name) to associate with the process.
@@ -3559,27 +3637,18 @@ BUFFER is the buffer (or buffer name) to associate with 
the process.
  an output stream or filter function to handle the output.
  BUFFER may be also nil, meaning that this process is not associated
  with any buffer
-COMMAND is the shell command to run.
-
-An old calling convention accepted any number of arguments after COMMAND,
-which were just concatenated to COMMAND.  This is still supported but strongly
-discouraged."
-  (declare (advertised-calling-convention (name buffer command) "23.1"))
+COMMAND is the shell command to run."
   ;; We used to use `exec' to replace the shell with the command,
   ;; but that failed to handle (...) and semicolon, etc.
-  (start-process name buffer shell-file-name shell-command-switch
-                (mapconcat 'identity args " ")))
+  (start-process name buffer shell-file-name shell-command-switch command))
 
-(defun start-file-process-shell-command (name buffer &rest args)
+(defun start-file-process-shell-command (name buffer command)
   "Start a program in a subprocess.  Return the process object for it.
 Similar to `start-process-shell-command', but calls `start-file-process'."
-  (declare (advertised-calling-convention (name buffer command) "23.1"))
   ;; On remote hosts, the local `shell-file-name' might be useless.
   (with-connection-local-variables
    (start-file-process
-    name buffer
-    shell-file-name shell-command-switch
-    (mapconcat 'identity args " "))))
+    name buffer shell-file-name shell-command-switch command)))
 
 (defun call-process-shell-command (command &optional infile buffer display
                                           &rest args)
@@ -3692,10 +3761,11 @@ also `with-temp-buffer'."
   (when (window-live-p (nth 1 state))
     (select-window (nth 1 state) 'norecord)))
 
-(defun generate-new-buffer (name)
+(defun generate-new-buffer (name &optional inhibit-buffer-hooks)
   "Create and return a buffer with a name based on NAME.
-Choose the buffer's name using `generate-new-buffer-name'."
-  (get-buffer-create (generate-new-buffer-name name)))
+Choose the buffer's name using `generate-new-buffer-name'.
+See `get-buffer-create' for the meaning of INHIBIT-BUFFER-HOOKS."
+  (get-buffer-create (generate-new-buffer-name name) inhibit-buffer-hooks))
 
 (defmacro with-selected-window (window &rest body)
   "Execute the forms in BODY with WINDOW as the selected window.
@@ -3857,12 +3927,14 @@ See the related form `with-temp-buffer-window'."
 (defmacro with-temp-file (file &rest body)
   "Create a new buffer, evaluate BODY there, and write the buffer to FILE.
 The value returned is the value of the last form in BODY.
+The buffer does not run the hooks `kill-buffer-hook',
+`kill-buffer-query-functions', and `buffer-list-update-hook'.
 See also `with-temp-buffer'."
   (declare (indent 1) (debug t))
   (let ((temp-file (make-symbol "temp-file"))
        (temp-buffer (make-symbol "temp-buffer")))
     `(let ((,temp-file ,file)
-          (,temp-buffer (generate-new-buffer " *temp file*")))
+           (,temp-buffer (generate-new-buffer " *temp file*" t)))
        (unwind-protect
           (prog1
               (with-current-buffer ,temp-buffer
@@ -3897,10 +3969,12 @@ Use a MESSAGE of \"\" to temporarily clear the echo 
area."
 
 (defmacro with-temp-buffer (&rest body)
   "Create a temporary buffer, and evaluate BODY there like `progn'.
+The buffer does not run the hooks `kill-buffer-hook',
+`kill-buffer-query-functions', and `buffer-list-update-hook'.
 See also `with-temp-file' and `with-output-to-string'."
   (declare (indent 0) (debug t))
   (let ((temp-buffer (make-symbol "temp-buffer")))
-    `(let ((,temp-buffer (generate-new-buffer " *temp*")))
+    `(let ((,temp-buffer (generate-new-buffer " *temp*" t)))
        ;; `kill-buffer' can change current-buffer in some odd cases.
        (with-current-buffer ,temp-buffer
          (unwind-protect
@@ -3935,7 +4009,7 @@ of that nature."
 (defmacro with-output-to-string (&rest body)
   "Execute BODY, return the text it sent to `standard-output', as a string."
   (declare (indent 0) (debug t))
-  `(let ((standard-output (generate-new-buffer " *string-output*")))
+  `(let ((standard-output (generate-new-buffer " *string-output*" t)))
      (unwind-protect
         (progn
           (let ((standard-output standard-output))
@@ -3964,7 +4038,7 @@ is allowed once again.  (Immediately, if `inhibit-quit' 
is nil.)"
 ;; Don't throw `throw-on-input' on those events by default.
 (setq while-no-input-ignore-events
       '(focus-in focus-out help-echo iconify-frame
-        make-frame-visible selection-request buffer-switch))
+        make-frame-visible selection-request))
 
 (defmacro while-no-input (&rest body)
   "Execute BODY only as long as there's no pending input.
@@ -5837,6 +5911,22 @@ This is the simplest safe way to acquire and release a 
mutex."
         (mutex-unlock ,sym)))))
 
 
+;;; Apropos.
+
+(defun apropos-internal (regexp &optional predicate)
+  "Show all symbols whose names contain match for REGEXP.
+If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done
+for each symbol and a symbol is mentioned only if that returns non-nil.
+Return list of symbols found."
+  (let (found)
+    (mapatoms (lambda (symbol)
+                (when (and (string-match regexp (symbol-name symbol))
+                           (or (not predicate)
+                               (funcall predicate symbol)))
+                  (push symbol found))))
+    (sort found #'string-lessp)))
+
+
 ;;; Misc.
 
 (defvar definition-prefixes (make-hash-table :test 'equal)
@@ -5909,4 +5999,40 @@ returned list are in the same order as in TREE.
 (defconst regexp-unmatchable "\\`a\\`"
   "Standard regexp guaranteed not to match any string at all.")
 
+(defun run-hook-query-error-with-timeout (hook)
+  "Run HOOK, catching errors, and querying the user about whether to continue.
+If a function in HOOK signals an error, the user will be prompted
+whether to continue or not.  If the user doesn't respond,
+evaluation will continue if the user doesn't respond within five
+seconds."
+  (run-hook-wrapped
+   hook
+   (lambda (fun)
+     (condition-case err
+         (funcall fun)
+       (error
+        (unless (y-or-n-p-with-timeout (format "Error %s; continue?" err)
+                                       5 t)
+          (error err))))
+     ;; Continue running.
+     nil)))
+
+(defun internal--fill-string-single-line (str)
+  "Fill string STR to `fill-column'.
+This is intended for very simple filling while bootstrapping
+Emacs itself, and does not support all the customization options
+of fill.el (for example `fill-region')."
+  (if (< (string-width str) fill-column)
+      str
+    (let ((fst (substring str 0 fill-column))
+          (lst (substring str fill-column)))
+      (if (string-match ".*\\( \\(.+\\)\\)$" fst)
+          (setq fst (replace-match "\n\\2" nil nil fst 1)))
+      (concat fst (internal--fill-string-single-line lst)))))
+
+(defun internal--format-docstring-line (string &rest objects)
+  "Format a documentation string out of STRING and OBJECTS.
+This is intended for internal use only."
+  (internal--fill-string-single-line (apply #'format string objects)))
+
 ;;; subr.el ends here
diff --git a/lisp/svg.el b/lisp/svg.el
index eeb945f..717c847 100644
--- a/lisp/svg.el
+++ b/lisp/svg.el
@@ -1,6 +1,6 @@
 ;;; svg.el --- SVG image creation functions -*- lexical-binding: t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;         Felix E. Klee <felix.klee@inka.de>
@@ -184,6 +184,19 @@ otherwise.  IMAGE-TYPE should be a MIME image type, like
     `((xlink:href . ,(svg--image-data image image-type datap))
       ,@(svg--arguments svg args)))))
 
+(defun svg-embed-base-uri-image (svg relative-filename &rest args)
+  "Insert image placed at RELATIVE-FILENAME into the SVG structure.
+RELATIVE-FILENAME will be searched in `file-name-directory' of the
+image's `:base-uri' property.  If `:base-uri' is not specified for the
+image, then embedding won't work. Embedding large images using this
+function is much faster than `svg-embed'."
+  (svg--append
+   svg
+   (dom-node
+    'image
+    `((xlink:href . ,relative-filename)
+      ,@(svg--arguments svg args)))))
+
 (defun svg-text (svg text &rest args)
   "Add TEXT to SVG."
   (svg--append
diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el
index 4feab71..ec36f54 100644
--- a/lisp/t-mouse.el
+++ b/lisp/t-mouse.el
@@ -4,7 +4,7 @@
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: mouse gpm linux
 
-;; Copyright (C) 1994-1995, 1998, 2006-2020 Free Software Foundation,
+;; Copyright (C) 1994-1995, 1998, 2006-2021 Free Software Foundation,
 ;; Inc.
 
 ;; This file is part of GNU Emacs.
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 2604955..935c97e 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1,6 +1,6 @@
 ;;; tab-bar.el --- frame-local tabs with named persistent window 
configurations -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Juri Linkov <juri@linkov.net>
 ;; Keywords: frames tabs
@@ -296,6 +296,16 @@ If nil, don't show it at all."
 (defvar tab-bar-forward-button " > "
   "Button for going forward in tab history.")
 
+(defcustom tab-bar-history-buttons-show t
+  "Show back and forward buttons when `tab-bar-history-mode' is enabled."
+  :type 'boolean
+  :initialize 'custom-initialize-default
+  :set (lambda (sym val)
+         (set-default sym val)
+         (force-mode-line-update))
+  :group 'tab-bar
+  :version "28.1")
+
 (defcustom tab-bar-tab-hints nil
   "Show absolute numbers on tabs in the tab bar before the tab name.
 This helps to select the tab by its number using `tab-bar-select-tab'
@@ -415,7 +425,7 @@ Return its existing value or a new value."
          (tabs (funcall tab-bar-tabs-function)))
     (append
      '(keymap (mouse-1 . tab-bar-handle-mouse))
-     (when tab-bar-history-mode
+     (when (and tab-bar-history-mode tab-bar-history-buttons-show)
        `((sep-history-back menu-item ,separator ignore)
          (history-back
           menu-item ,tab-bar-back-button tab-bar-history-back
@@ -762,6 +772,9 @@ After the tab is created, the hooks in
          (from-tab (tab-bar--tab)))
 
     (when tab-bar-new-tab-choice
+      ;; Handle the case when it's called in the active minibuffer.
+      (when (minibuffer-selected-window)
+        (select-window (minibuffer-selected-window)))
       (delete-other-windows)
       ;; Create a new window to get rid of old window parameters
       ;; (e.g. prev/next buffers) of old window.
@@ -839,8 +852,10 @@ If `recent', select the most recently visited tab."
   "Defines what to do when the last tab is closed.
 If nil, do nothing and show a message, like closing the last window or frame.
 If `delete-frame', delete the containing frame, as a web browser would do.
-If `tab-bar-mode-disable', disable tab-bar-mode so that tabs no longer show in 
the frame.
-If the value is a function, call that function with the tab to be closed as an 
argument."
+If `tab-bar-mode-disable', disable tab-bar-mode so that tabs no longer show in
+the frame.
+If the value is a function, call that function with the tab to be closed as an
+ argument."
   :type '(choice (const    :tag "Do nothing and show message" nil)
                  (const    :tag "Close the containing frame" delete-frame)
                  (const    :tag "Disable tab-bar-mode" tab-bar-mode-disable)
@@ -1198,18 +1213,11 @@ Type q to remove the list of window configurations from 
the display.
 The first column shows `D' for a window configuration you have
 marked for deletion."
   (interactive)
-  (let ((dir default-directory)
-        (minibuf (minibuffer-selected-window)))
-    (let ((tab-bar-show nil)) ; don't enable tab-bar-mode if it's disabled
+  (let ((dir default-directory))
+    (let ((tab-bar-new-tab-choice t)
+          ;; Don't enable tab-bar-mode if it's disabled
+          (tab-bar-show nil))
       (tab-bar-new-tab))
-    ;; Handle the case when it's called in the active minibuffer.
-    (when minibuf (select-window (minibuffer-selected-window)))
-    (delete-other-windows)
-    ;; Create a new window to replace the existing one, to not break the
-    ;; window parameters (e.g. prev/next buffers) of the window just saved
-    ;; to the window configuration.  So when a saved window is restored,
-    ;; its parameters left intact.
-    (split-window) (delete-window)
     (let ((switch-to-buffer-preserve-window-point nil))
       (switch-to-buffer (tab-switcher-noselect)))
     (setq default-directory dir))
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 46bf89f..2726947 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -1,6 +1,6 @@
 ;;; tab-line.el --- window-local tabs with window buffers -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Juri Linkov <juri@linkov.net>
 ;; Keywords: windows tabs
@@ -27,6 +27,7 @@
 
 ;;; Code:
 
+(require 'cl-lib)
 (require 'seq) ; tab-line.el is not pre-loaded so it's safe to use it here
 
 
@@ -35,6 +36,18 @@
   :group 'convenience
   :version "27.1")
 
+(defcustom tab-line-tab-face-functions '(tab-line-tab-face-special)
+  "Functions called to modify tab faces.
+Each function is called with five arguments: the tab, a list of
+all tabs, the face returned by the previously called modifier,
+whether the tab is a buffer, and whether the tab is selected."
+  :type '(repeat
+          (choice (function-item tab-line-tab-face-special)
+                  (function-item tab-line-tab-face-inactive-alternating)
+                  (function :tag "Custom function")))
+  :group 'tab-line
+  :version "28.1")
+
 (defgroup tab-line-faces '((tab-line custom-face)) ; tab-line is defined in 
faces.el
   "Faces used in the tab line."
   :group 'tab-line
@@ -63,6 +76,25 @@
   :version "27.1"
   :group 'tab-line-faces)
 
+(defface tab-line-tab-inactive-alternate
+  `((t (:inherit tab-line-tab-inactive :background "grey65")))
+  "Alternate face for inactive tab-line tabs.
+Applied to alternating tabs when option
+`tab-line-tab-face-functions' includes function
+`tab-line-tab-face-inactive-alternating'."
+  :version "28.1"
+  :group 'tab-line-faces)
+
+(defface tab-line-tab-special
+  '((default (:weight bold))
+    (((supports :slant italic))
+     (:slant italic :weight normal)))
+  "Face for special (i.e. non-file-backed) tabs.
+Applied when option `tab-line-tab-face-functions' includes
+function `tab-line-tab-face-special'."
+  :version "28.1"
+  :group 'tab-line-faces)
+
 (defface tab-line-tab-current
   '((default
       :inherit tab-line-tab)
@@ -412,7 +444,14 @@ variable `tab-line-tabs-function'."
                                   (cdr (assq 'selected tab))))
                     (name (if buffer-p
                               (funcall tab-line-tab-name-function tab tabs)
-                            (cdr (assq 'name tab)))))
+                            (cdr (assq 'name tab))))
+                    (face (if selected-p
+                              (if (eq (selected-window) (old-selected-window))
+                                  'tab-line-tab-current
+                                'tab-line-tab)
+                            'tab-line-tab-inactive)))
+               (dolist (fn tab-line-tab-face-functions)
+                 (setf face (funcall fn tab tabs face buffer-p selected-p)))
                (concat
                 separator
                 (apply 'propertize
@@ -425,11 +464,7 @@ variable `tab-line-tabs-function'."
                        `(
                          tab ,tab
                          ,@(if selected-p '(selected t))
-                         face ,(if selected-p
-                                   (if (eq (selected-window) 
(old-selected-window))
-                                       'tab-line-tab-current
-                                     'tab-line-tab)
-                                 'tab-line-tab-inactive)
+                         face ,face
                          mouse-face tab-line-highlight)))))
            tabs))
          (hscroll-data (tab-line-auto-hscroll strings hscroll)))
@@ -453,6 +488,24 @@ variable `tab-line-tabs-function'."
                 tab-line-new-button)
        (list tab-line-new-button)))))
 
+(defun tab-line-tab-face-inactive-alternating (tab tabs face _buffer-p 
selected-p)
+  "Return FACE for TAB in TABS with alternation.
+When TAB is an inactive buffer and is even-numbered, make FACE
+inherit from `tab-line-tab-inactive-alternate'.  For use in
+`tab-line-tab-face-functions'."
+  (when (and (not selected-p) (cl-evenp (cl-position tab tabs)))
+    (setf face `(:inherit (tab-line-tab-inactive-alternate ,face))))
+  face)
+
+(defun tab-line-tab-face-special (tab _tabs face buffer-p _selected-p)
+  "Return FACE for TAB according to whether it's special.
+When TAB is a non-file-backed buffer, make FACE inherit from
+`tab-line-tab-special'.  For use in
+`tab-line-tab-face-functions'."
+  (when (and buffer-p (not (buffer-file-name tab)))
+    (setf face `(:inherit (tab-line-tab-special ,face))))
+  face)
+
 (defvar tab-line-auto-hscroll)
 
 (defun tab-line-format ()
diff --git a/lisp/tabify.el b/lisp/tabify.el
index 7408fe1..f736031 100644
--- a/lisp/tabify.el
+++ b/lisp/tabify.el
@@ -1,6 +1,6 @@
 ;;; tabify.el --- tab conversion commands for Emacs  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985, 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Package: emacs
diff --git a/lisp/talk.el b/lisp/talk.el
index a18cf26..473f8ac 100644
--- a/lisp/talk.el
+++ b/lisp/talk.el
@@ -1,6 +1,6 @@
 ;;; talk.el --- allow several users to talk to each other through Emacs
 
-;; Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: comm, frames
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index d460c8a..cd53d7b 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -1,6 +1,6 @@
 ;;; tar-mode.el --- simple editing of tar files from GNU Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1990-1991, 1993-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1991, 1993-2021 Free Software Foundation, Inc.
 
 ;; Author: Jamie Zawinski <jwz@lucid.com>
 ;; Maintainer: emacs-devel@gnu.org
@@ -588,7 +588,7 @@ For instance, if mode is #o700, then it produces 
`rwx------'."
         (setq pos (tar-header-data-end descriptor))
         (progress-reporter-update progress-reporter pos)))
 
-    (set (make-local-variable 'tar-parse-info) (nreverse result))
+    (setq-local tar-parse-info (nreverse result))
     ;; A tar file should end with a block or two of nulls,
     ;; but let's not get a fatal error if it doesn't.
     (if (null descriptor)
@@ -718,21 +718,21 @@ See also: variables `tar-update-datestamp' and 
`tar-anal-blocksize'.
        (file-writable-p buffer-file-name)
        (setq buffer-read-only nil))    ; undo what `special-mode' did
   (make-local-variable 'tar-parse-info)
-  (set (make-local-variable 'require-final-newline) nil) ; binary data, dude...
-  (set (make-local-variable 'local-enable-local-variables) nil)
-  (set (make-local-variable 'next-line-add-newlines) nil)
-  (set (make-local-variable 'tar-file-name-coding-system)
-       (or file-name-coding-system
-          default-file-name-coding-system
-          locale-coding-system))
+  (setq-local require-final-newline nil) ; binary data, dude...
+  (setq-local local-enable-local-variables nil)
+  (setq-local next-line-add-newlines nil)
+  (setq-local tar-file-name-coding-system
+              (or file-name-coding-system
+                 default-file-name-coding-system
+                 locale-coding-system))
   ;; Prevent loss of data when saving the file.
-  (set (make-local-variable 'file-precious-flag) t)
+  (setq-local file-precious-flag t)
   (buffer-disable-undo)
   (widen)
   ;; Now move the Tar data into an auxiliary buffer, so we can use the main
   ;; buffer for the summary.
   (cl-assert (not (tar-data-swapped-p)))
-  (set (make-local-variable 'revert-buffer-function) #'tar-mode-revert)
+  (setq-local revert-buffer-function #'tar-mode-revert)
   ;; We started using write-contents-functions, but this hook is not
   ;; used during auto-save, so we now use
   ;; write-region-annotate-functions which hooks at a lower-level.
@@ -741,10 +741,10 @@ See also: variables `tar-update-datestamp' and 
`tar-anal-blocksize'.
   (add-hook 'change-major-mode-hook #'tar-change-major-mode-hook nil t)
   ;; Tar data is made of bytes, not chars.
   (set-buffer-multibyte nil)            ;Hopefully a no-op.
-  (set (make-local-variable 'tar-data-buffer)
-       (generate-new-buffer (format " *tar-data %s*"
-                                    (file-name-nondirectory
-                                     (or buffer-file-name (buffer-name))))))
+  (setq-local tar-data-buffer (generate-new-buffer
+                               (format " *tar-data %s*"
+                                       (file-name-nondirectory
+                                        (or buffer-file-name (buffer-name))))))
   (condition-case err
       (progn
         (tar-swap-data)
@@ -1004,8 +1004,8 @@ return nil.  Otherwise point is returned."
                 default-directory))
         (set-buffer-modified-p nil)
         (normal-mode)                   ; pick a mode.
-        (set (make-local-variable 'tar-superior-buffer) tar-buffer)
-        (set (make-local-variable 'tar-superior-descriptor) descriptor)
+        (setq-local tar-superior-buffer tar-buffer)
+        (setq-local tar-superior-descriptor descriptor)
         (setq buffer-read-only read-only-p)
         (tar-subfile-mode 1)))
     (cond
diff --git a/lisp/tempo.el b/lisp/tempo.el
index 9ee0eef..87e274a 100644
--- a/lisp/tempo.el
+++ b/lisp/tempo.el
@@ -1,6 +1,6 @@
 ;;; tempo.el --- Flexible template insertion -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1994-1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: David Kågedal <davidk@lysator.liu.se>
 ;; Created: 16 Feb 1994
diff --git a/lisp/term.el b/lisp/term.el
index 34dc287..8a560e8 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1,6 +1,6 @@
 ;;; term.el --- general command interpreter in a window stuff -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1988, 1990, 1992, 1994-1995, 2001-2020 Free Software
+;; Copyright (C) 1988, 1990, 1992, 1994-1995, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Per Bothner <per@bothner.com>
@@ -264,7 +264,7 @@
 ;; M-p     term-previous-input           Cycle backwards in input history
 ;; M-n     term-next-input               Cycle forwards
 ;; M-r     term-previous-matching-input  Previous input matching a regexp
-;; M-s     comint-next-matching-input    Next input that matches
+;; M-s     term-next-matching-input      Next input that matches
 ;; return  term-send-input
 ;; C-c C-a term-bol                      Beginning of line; skip prompt.
 ;; C-d     term-delchar-or-maybe-eof     Delete char unless at end of buff.
@@ -365,8 +365,8 @@ not allowed.")
 (defvar-local term-scroll-end nil
   "Bottom-most line (inclusive) of the scrolling region.
 `term-scroll-end' must be in the range [0,term-height).  In addition, its
-value has to be greater than `term-scroll-start', i.e. one line scroll regions 
are
-not allowed.")
+value has to be greater than `term-scroll-start', i.e. one line scroll regions
+are not allowed.")
 (defvar term-pager-count nil
   "Number of lines before we need to page; if nil, paging is disabled.")
 (defvar term-saved-cursor nil)
@@ -1005,12 +1005,12 @@ Entry to this mode runs the hooks on `term-mode-hook'."
   ;; we do not want indent to sneak in any tabs
   (setq indent-tabs-mode nil)
   (setq buffer-display-table term-display-table)
-  (set (make-local-variable 'term-home-marker) (copy-marker 0))
-  (set (make-local-variable 'term-height) (floor (window-screen-lines)))
-  (set (make-local-variable 'term-width) (window-max-chars-per-line))
-  (set (make-local-variable 'term-last-input-start) (make-marker))
-  (set (make-local-variable 'term-last-input-end) (make-marker))
-  (set (make-local-variable 'term-last-input-match) "")
+  (setq-local term-home-marker (copy-marker 0))
+  (setq-local term-height (floor (window-screen-lines)))
+  (setq-local term-width (window-max-chars-per-line))
+  (setq-local term-last-input-start (make-marker))
+  (setq-local term-last-input-end (make-marker))
+  (setq-local term-last-input-match "")
 
   ;; These local variables are set to their local values:
   (make-local-variable 'term-saved-home-marker)
@@ -1028,9 +1028,9 @@ Entry to this mode runs the hooks on `term-mode-hook'."
   ;; a properly configured ange-ftp, I've decided to be conservative
   ;; and put them in. -mm
 
-  (set (make-local-variable 'term-ansi-at-host) (system-name))
-  (set (make-local-variable 'term-ansi-at-dir) default-directory)
-  (set (make-local-variable 'term-ansi-at-message) nil)
+  (setq-local term-ansi-at-host (system-name))
+  (setq-local term-ansi-at-dir default-directory)
+  (setq-local term-ansi-at-message nil)
 
   ;; For user tracking purposes -mm
   (make-local-variable 'ange-ftp-default-user)
@@ -1073,15 +1073,15 @@ Entry to this mode runs the hooks on `term-mode-hook'."
   (make-local-variable 'term-scroll-to-bottom-on-output)
   (make-local-variable 'term-scroll-show-maximum-output)
   (make-local-variable 'term-ptyp)
-  (set (make-local-variable 'term-vertical-motion) 'vertical-motion)
-  (set (make-local-variable 'term-pending-delete-marker) (make-marker))
+  (setq-local term-vertical-motion 'vertical-motion)
+  (setq-local term-pending-delete-marker (make-marker))
   (make-local-variable 'term-current-face)
   (term-ansi-reset)
-  (set (make-local-variable 'term-pending-frame) nil)
+  (setq-local term-pending-frame nil)
   ;; Cua-mode's keybindings interfere with the term keybindings, disable it.
-  (set (make-local-variable 'cua-mode) nil)
+  (setq-local cua-mode nil)
 
-  (set (make-local-variable 'font-lock-defaults) '(nil t))
+  (setq-local font-lock-defaults '(nil t))
 
   (add-function :filter-return
                 (local 'filter-buffer-substring-function)
@@ -1423,8 +1423,7 @@ buffer.  The hook `term-exec-hook' is run after each 
exec."
       (when proc (delete-process proc)))
     ;; Crank up a new process
     (let ((proc (term-exec-1 name buffer command switches)))
-      (make-local-variable 'term-ptyp)
-      (setq term-ptyp process-connection-type) ; t if pty, nil if pipe.
+      (setq-local term-ptyp process-connection-type) ; t if pty, nil if pipe.
       ;; Jump to the end, and set the process mark.
       (goto-char (point-max))
       (set-marker (process-mark proc) (point))
@@ -3067,8 +3066,7 @@ See `term-prompt-regexp'."
                         (aset term-terminal-undecoded-bytes 0 ?\r))
                       (goto-char (point-max)))
                     ;; FIXME: Use (add-function :override (process-filter proc)
-                    (make-local-variable 'term-pager-old-filter)
-                    (setq term-pager-old-filter (process-filter proc))
+                    (setq-local term-pager-old-filter (process-filter proc))
                     ;; FIXME: Where is `term-pager-filter' set to a function?!
                     (set-process-filter proc term-pager-filter)
                     (setq i str-length))
@@ -3537,8 +3535,7 @@ The top-most line is line 0."
   ;;   (stop-process process))
   (setq term-pager-old-local-map (current-local-map))
   (use-local-map term-pager-break-map)
-  (make-local-variable 'term-old-mode-line-format)
-  (setq term-old-mode-line-format mode-line-format)
+  (setq-local term-old-mode-line-format mode-line-format)
   (setq mode-line-format
        (list "--  **MORE**  "
              mode-line-buffer-identification
diff --git a/lisp/term/AT386.el b/lisp/term/AT386.el
index 8ce7fbb..3bedde5 100644
--- a/lisp/term/AT386.el
+++ b/lisp/term/AT386.el
@@ -1,6 +1,6 @@
 ;;; AT386.el --- terminal support package for IBM AT keyboards  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1992, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
 ;; Keywords: terminals
diff --git a/lisp/term/README b/lisp/term/README
index 6276adc..9e986bd 100644
--- a/lisp/term/README
+++ b/lisp/term/README
@@ -1,4 +1,4 @@
-Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/lisp/term/common-win.el b/lisp/term/common-win.el
index 92f3f42..8d5cb19 100644
--- a/lisp/term/common-win.el
+++ b/lisp/term/common-win.el
@@ -1,6 +1,6 @@
 ;;; common-win.el --- common part of handling window systems
 
-;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: terminals
diff --git a/lisp/term/internal.el b/lisp/term/internal.el
index 9a6f4fa..fd75ded 100644
--- a/lisp/term/internal.el
+++ b/lisp/term/internal.el
@@ -1,6 +1,6 @@
 ;;; internal.el --- support for PC internal terminal  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1993-1994, 1998-1999, 2001-2020 Free Software
+;; Copyright (C) 1993-1994, 1998-1999, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Morten Welinder <terra@diku.dk>
diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el
index 7a92aa7..e5b94ea 100644
--- a/lisp/term/iris-ansi.el
+++ b/lisp/term/iris-ansi.el
@@ -1,6 +1,6 @@
 ;;; iris-ansi.el --- configure Emacs for SGI xwsh and winterm apps  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Dan Nicolaescu <dann@ics.uci.edu>
 
diff --git a/lisp/term/konsole.el b/lisp/term/konsole.el
index 4af818b..e38a5d3 100644
--- a/lisp/term/konsole.el
+++ b/lisp/term/konsole.el
@@ -1,5 +1,5 @@
 ;;; konsole.el --- terminal initialization for konsole  -*- lexical-binding:t 
-*-
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 (require 'term/xterm)
 
diff --git a/lisp/term/news.el b/lisp/term/news.el
index 33c7aa6..40aa58e 100644
--- a/lisp/term/news.el
+++ b/lisp/term/news.el
@@ -1,6 +1,6 @@
 ;;; news.el --- keypad and function key bindings for the Sony NEWS keyboard  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 1989, 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF
 ;; Keywords: terminals
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 99cead9..5f4dd9e 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -1,6 +1,6 @@
 ;;; ns-win.el --- lisp side of interface with NeXT/Open/GNUstep/macOS window 
system  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1993-1994, 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2005-2021 Free Software Foundation, Inc.
 
 ;; Authors: Carl Edman
 ;;     Christian Limpach
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el
index 76a48a8..8cff2ce 100644
--- a/lisp/term/pc-win.el
+++ b/lisp/term/pc-win.el
@@ -1,6 +1,6 @@
 ;;; pc-win.el --- setup support for `PC windows' (whatever that is)  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1994, 1996-1997, 1999, 2001-2020 Free Software
+;; Copyright (C) 1994, 1996-1997, 1999, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Morten Welinder <terra@diku.dk>
diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el
index 71ee908..9671e95 100644
--- a/lisp/term/rxvt.el
+++ b/lisp/term/rxvt.el
@@ -1,6 +1,6 @@
 ;;; rxvt.el --- define function key sequences and standard colors for rxvt  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Eli Zaretskii
 ;; Keywords: terminals
diff --git a/lisp/term/screen.el b/lisp/term/screen.el
index 0623aa7..04481e8 100644
--- a/lisp/term/screen.el
+++ b/lisp/term/screen.el
@@ -1,5 +1,5 @@
 ;;; screen.el --- terminal initialization for screen and tmux  -*- 
lexical-binding: t -*-
-;; Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 (require 'term/xterm)
 
diff --git a/lisp/term/st.el b/lisp/term/st.el
index 617664b..08432c4 100644
--- a/lisp/term/st.el
+++ b/lisp/term/st.el
@@ -1,6 +1,6 @@
 ;;; st.el --- terminal initialization for st  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;;; Commentary:
 
diff --git a/lisp/term/sun.el b/lisp/term/sun.el
index 7d1cd9f..3dfd4c6 100644
--- a/lisp/term/sun.el
+++ b/lisp/term/sun.el
@@ -1,6 +1,6 @@
 ;;; sun.el --- keybinding for standard default sunterm keys  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1987, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1987, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Jeff Peck <peck@sun.com>
 ;; Keywords: terminals
diff --git a/lisp/term/tmux.el b/lisp/term/tmux.el
index b67f935..aa0c983 100644
--- a/lisp/term/tmux.el
+++ b/lisp/term/tmux.el
@@ -1,5 +1,5 @@
 ;;; tmux.el --- terminal initialization for tmux  -*- lexical-binding: t -*-
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 (require 'term/xterm)
 
diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el
index dda7fcc..1aeaffb 100644
--- a/lisp/term/tty-colors.el
+++ b/lisp/term/tty-colors.el
@@ -1,6 +1,6 @@
 ;;; tty-colors.el --- color support for character terminals
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Eli Zaretskii
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el
index fc8ad80..4447657 100644
--- a/lisp/term/tvi970.el
+++ b/lisp/term/tvi970.el
@@ -1,6 +1,6 @@
 ;;; tvi970.el --- terminal support for the Televideo 970  -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 1992, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Jim Blandy <jimb@occs.cs.oberlin.edu>
 ;; Keywords: terminals
diff --git a/lisp/term/vt100.el b/lisp/term/vt100.el
index 2df1414..5e32e29 100644
--- a/lisp/term/vt100.el
+++ b/lisp/term/vt100.el
@@ -1,6 +1,6 @@
 ;;; vt100.el --- define VT100 function key sequences in function-key-map  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1989, 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF
 ;; Keywords: terminals
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 824848d..e845193 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -1,6 +1,6 @@
 ;;; w32-win.el --- parse switches controlling interface with W32 window system 
-*- lexical-binding: t -*-
 
-;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Kevin Gallo
 ;; Keywords: terminals
diff --git a/lisp/term/w32console.el b/lisp/term/w32console.el
index 36e9d89..8859f13 100644
--- a/lisp/term/w32console.el
+++ b/lisp/term/w32console.el
@@ -1,6 +1,6 @@
 ;;; w32console.el -- Setup w32 console keys and colors.
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF
 ;; Keywords: terminals
diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el
index f06563e..d3b0fda 100644
--- a/lisp/term/wyse50.el
+++ b/lisp/term/wyse50.el
@@ -1,6 +1,6 @@
 ;;; wyse50.el --- terminal support code for Wyse 50  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1989, 1993-1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1989, 1993-1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>,
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 6069272..e4521ff 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -1,6 +1,6 @@
 ;;; x-win.el --- parse relevant switches and set up for X  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF
 ;; Keywords: terminals, i18n
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 7094100..eeaf805 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -1,6 +1,6 @@
 ;;; xterm.el --- define function key sequences and standard colors for xterm  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF
 ;; Keywords: terminals
@@ -710,15 +710,18 @@ Return the pasted text as a string."
     (while (and (setq chr (xterm--read-event-for-query)) (not (equal chr ?c)))
       (setq str (concat str (string chr))))
     ;; Since xterm-280, the terminal type (NUMBER1) is now 41 instead of 0.
-    (when (string-match "\\([0-9]+\\);\\([0-9]+\\);0" str)
+    (when (string-match "\\([0-9]+\\);\\([0-9]+\\);[01]" str)
       (let ((version (string-to-number (match-string 2 str))))
-        (when (and (> version 2000) (equal (match-string 1 str) "1"))
+        (when (and (> version 2000)
+                   (or (equal (match-string 1 str) "1")
+                       (equal (match-string 1 str) "65")))
           ;; Hack attack!  bug#16988: gnome-terminal reports "1;NNNN;0"
           ;; with a large NNNN but is based on a rather old xterm code.
           ;; Gnome terminal 2.32.1 reports 1;2802;0
           ;; Gnome terminal 3.6.1 reports 1;3406;0
           ;; Gnome terminal 3.22.2 reports 1;4601;0 and *does* support
           ;; background color querying (Bug#29716).
+          ;; Gnome terminal 3.38.0 reports 65;6200;1.
           (when (> version 4000)
             (xterm--query "\e]11;?\e\\"
                           '(("\e]11;" .  xterm--report-background-handler))))
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index cc2eaf1..ce62082 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -1,6 +1,6 @@
 ;;; artist.el --- draw ascii graphics with your mouse -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author:       Tomas Abrahamsson <tab@lysator.liu.se>
 ;; Keywords:     mouse
diff --git a/lisp/textmodes/bib-mode.el b/lisp/textmodes/bib-mode.el
index 5b4fa34..1e22287 100644
--- a/lisp/textmodes/bib-mode.el
+++ b/lisp/textmodes/bib-mode.el
@@ -1,6 +1,6 @@
 ;;; bib-mode.el --- major mode for editing bib files
 
-;; Copyright (C) 1989, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Henry Kautz
 ;; (according to authors.el)
diff --git a/lisp/textmodes/bibtex-style.el b/lisp/textmodes/bibtex-style.el
index 952b816..66d245f 100644
--- a/lisp/textmodes/bibtex-style.el
+++ b/lisp/textmodes/bibtex-style.el
@@ -1,6 +1,6 @@
 ;;; bibtex-style.el --- Major mode for BibTeX Style files -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: tex
@@ -66,12 +66,12 @@
 ;;;###autoload
 (define-derived-mode bibtex-style-mode nil "BibStyle"
   "Major mode for editing BibTeX style files."
-  (set (make-local-variable 'comment-start) "%")
-  (set (make-local-variable 'outline-regexp) "^[a-z]")
-  (set (make-local-variable 'imenu-generic-expression)
-       '((nil "\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}" 2)))
-  (set (make-local-variable 'indent-line-function) 'bibtex-style-indent-line)
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  (setq-local comment-start "%")
+  (setq-local outline-regexp "^[a-z]")
+  (setq-local imenu-generic-expression
+              '((nil "\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}" 2)))
+  (setq-local indent-line-function 'bibtex-style-indent-line)
+  (setq-local parse-sexp-ignore-comments t)
   (setq font-lock-defaults
        '(bibtex-style-font-lock-keywords nil t
          ((?. . "w")))))
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 0a0a582..a22cd97 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -1,6 +1,6 @@
 ;;; bibtex.el --- BibTeX mode for GNU Emacs -*- lexical-binding: t -*-
 
-;; Copyright (C) 1992, 1994-1999, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1992, 1994-1999, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Stefan Schoef <schoef@offis.uni-oldenburg.de>
@@ -40,6 +40,8 @@
 
 ;;; Code:
 
+(require 'iso8601)
+
 
 ;; User Options:
 
@@ -202,20 +204,34 @@ narrowed to just the entry."
 (defcustom bibtex-maintain-sorted-entries nil
   "If non-nil, BibTeX mode maintains all entries in sorted order.
 Allowed non-nil values are:
-plain or t   All entries are sorted alphabetically.
-crossref     All entries are sorted alphabetically unless an entry has a
+plain or t   Sort entries alphabetically by keys.
+crossref     Sort entries alphabetically by keys unless an entry has a
              crossref field.  These crossrefed entries are placed in
              alphabetical order immediately preceding the main entry.
 entry-class  The entries are divided into classes according to their
              entry type, see `bibtex-sort-entry-class'.  Within each class
-             the entries are sorted alphabetically.
+             sort entries alphabetically by keys.
+(INDEX-FUN PREDICATE)
+(INDEX-FUN PREDICATE INIT-FUN)  Sort entries using INDEX-FUN and PREDICATE.
+             Function INDEX-FUN is called for each entry with point at the
+             end of the head of the entry.  Its return values are used to
+             sort the entries using PREDICATE.  Function PREDICATE takes two
+             arguments INDEX1 and INDEX2 as returned by INDEX-FUN.
+             It should return non-nil if INDEX1 should sort before INDEX2.
+             If INIT-FUN is non-nil, it should be a function that is called
+             with no arguments to initialize the sorting.
 See also `bibtex-sort-ignore-string-entries'."
   :group 'bibtex
+  :version "28.1"
   :type '(choice (const nil)
+                 (const t)
                  (const plain)
                  (const crossref)
                  (const entry-class)
-                 (const t))
+                 (group :tag "Custom scheme"
+                        (function :tag "Index-Fun")
+                        (function :tag "Predicate")
+                        (option (function :tag "Init-Fun"))))
   :safe (lambda (a) (memq a '(nil t plain crossref entry-class))))
 
 (defcustom bibtex-sort-entry-class
@@ -296,7 +312,9 @@ If parsing fails, try to set this variable to nil."
                                        (option (choice :tag "Comment" :value 
nil
                                                        (const nil) string))
                                        (option (choice :tag "Init" :value nil
-                                                       (const nil) string 
function)))))))
+                                                       (const nil) string 
function))
+                                       (option (choice :tag "Alternative" 
:value nil
+                                                       (const nil) 
integer)))))))
 
 (define-obsolete-variable-alias 'bibtex-entry-field-alist
   'bibtex-BibTeX-entry-alist "24.1")
@@ -461,280 +479,376 @@ COMMENT is the comment string that appears in the echo 
area.
 If COMMENT is nil use `bibtex-BibTeX-field-alist' if possible.
 INIT is either the initial content of the field or a function,
 which is called to determine the initial content of the field.
-ALTERNATIVE if non-nil is an integer that numbers sets of
-alternatives, starting from zero."
+ALTERNATIVE if non-nil is an integer N that numbers sets of
+alternatives.  A negative integer -N indicates an alias for the
+field +N.  Such aliases are ignored by `bibtex-entry' in the template
+for a new entry."
   :group 'bibtex
-  :version "26.1"                       ; add Conference
+  :version "28.1"                       ; extend alternatives
   :type 'bibtex-entry-alist
   :risky t)
 
 (defcustom bibtex-biblatex-entry-alist
   ;; Compare in biblatex documentation:
   ;; Sec. 2.1.1  Regular types (required and optional fields)
+  ;; Sec. 2.2.5  Field Aliases
   ;; Appendix A  Default Crossref setup
   '(("Article" "Article in Journal"
-     (("author") ("title") ("journaltitle")
-      ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title")
+      ("journaltitle" nil nil 3) ("journal" nil nil -3)
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("translator") ("annotator") ("commentator") ("subtitle") ("titleaddon")
       ("editor") ("editora") ("editorb") ("editorc") ("journalsubtitle")
       ("journaltitleaddon") ("issuetitle") ("issuesubtitle") 
("issuetitleaddon")
       ("language") ("origlanguage") ("series") ("volume") ("number") ("eid")
       ("issue") ("month") ("pages") ("version") ("note") ("issn")
-      ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass")
-      ("eprinttype") ("url") ("urldate")))
+      ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Book" "Single-Volume Book"
-     (("author") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title")
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("editor") ("editora") ("editorb") ("editorc")
       ("translator") ("annotator") ("commentator")
       ("introduction") ("foreword") ("afterword") ("subtitle") ("titleaddon")
       ("maintitle") ("mainsubtitle") ("maintitleaddon")
       ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes")
-      ("series") ("number") ("note") ("publisher") ("location") ("isbn") 
("eid")
+      ("series") ("number") ("note") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2) ("isbn") ("eid")
       ("chapter") ("pages") ("pagetotal") ("addendum") ("pubstate") ("doi")
-      ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("MVBook" "Multi-Volume Book"
-     (("author") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title")
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("editor") ("editora") ("editorb") ("editorc")
       ("translator") ("annotator") ("commentator")
       ("introduction") ("foreword") ("afterword") ("subtitle")
       ("titleaddon") ("language") ("origlanguage") ("edition") ("volumes")
       ("series") ("number") ("note") ("publisher")
-      ("location") ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi")
-      ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("location" nil nil 2) ("address" nil nil -2)
+      ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("InBook" "Chapter or Pages in a Book"
-     (("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("title") ("date" nil nil 1) ("year" nil nil -1))
      (("author") ("booktitle"))
      (("bookauthor") ("editor") ("editora") ("editorb") ("editorc")
       ("translator") ("annotator") ("commentator") ("introduction") 
("foreword")
       ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
       ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
       ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes")
-      ("series") ("number") ("note") ("publisher") ("location") ("isbn") 
("eid")
-      ("chapter") ("pages") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("series") ("number") ("note") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2) ("isbn") ("eid")
+      ("chapter") ("pages") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("BookInBook" "Book in Collection" ; same as @inbook
-     (("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("title") ("date" nil nil 1) ("year" nil nil -1))
      (("author") ("booktitle"))
      (("bookauthor") ("editor") ("editora") ("editorb") ("editorc")
       ("translator") ("annotator") ("commentator") ("introduction") 
("foreword")
       ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
       ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
       ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes")
-      ("series") ("number") ("note") ("publisher") ("location") ("isbn") 
("eid")
-      ("chapter") ("pages") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("series") ("number") ("note") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2) ("isbn") ("eid")
+      ("chapter") ("pages") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("SuppBook" "Supplemental Material in a Book" ; same as @inbook
-     (("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("title") ("date" nil nil 1) ("year" nil nil -1))
      (("author") ("booktitle"))
      (("bookauthor") ("editor") ("editora") ("editorb") ("editorc")
       ("translator") ("annotator") ("commentator") ("introduction") 
("foreword")
       ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
       ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
       ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes")
-      ("series") ("number") ("note") ("publisher") ("location") ("isbn") 
("eid")
-      ("chapter") ("pages") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("series") ("number") ("note") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2) ("isbn") ("eid")
+      ("chapter") ("pages") ("addendum") ("pubstate") ("doi")
+      ("eprint")("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Booklet" "Booklet (Bound, but no Publisher)"
      (("author" nil nil 0) ("editor" nil nil 0) ("title")
-      ("year" nil nil 1) ("date" nil nil 1))
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("subtitle") ("titleaddon") ("language") ("howpublished") ("type")
-      ("note") ("location") ("eid") ("chapter") ("pages") ("pagetotal")
-      ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass")
-      ("eprinttype") ("url") ("urldate")))
+      ("note") ("location" nil nil 2) ("address" nil nil -2)
+      ("eid") ("chapter") ("pages") ("pagetotal")
+      ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Collection" "Single-Volume Collection"
-     (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("editor") ("title")
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("editora") ("editorb") ("editorc") ("translator") ("annotator")
       ("commentator") ("introduction") ("foreword") ("afterword")
       ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
       ("maintitleaddon") ("language") ("origlanguage") ("volume")
       ("part") ("edition") ("volumes") ("series") ("number") ("note")
-      ("publisher") ("location") ("isbn") ("eid") ("chapter") ("pages")
-      ("pagetotal") ("addendum") ("pubstate") ("doi") ("eprint") 
("eprintclass")
-      ("eprinttype") ("url") ("urldate")))
+      ("publisher") ("location" nil nil 2) ("address" nil nil -2)
+      ("isbn") ("eid") ("chapter") ("pages")
+      ("pagetotal") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("MVCollection" "Multi-Volume Collection"
-     (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("editor") ("title")
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("editora") ("editorb") ("editorc") ("translator") ("annotator")
       ("commentator") ("introduction") ("foreword") ("afterword")
       ("subtitle") ("titleaddon") ("language") ("origlanguage") ("edition")
       ("volumes") ("series") ("number") ("note") ("publisher")
-      ("location") ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi")
-      ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("location" nil nil 2) ("address" nil nil -2)
+      ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("InCollection" "Article in a Collection"
-     (("author") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title")
+      ("date" nil nil 1) ("year" nil nil -1))
      (("booktitle"))
      (("editor") ("editora") ("editorb") ("editorc") ("translator")
       ("annotator") ("commentator") ("introduction") ("foreword") ("afterword")
       ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
       ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
       ("language") ("origlanguage") ("volume") ("part") ("edition")
-      ("volumes") ("series") ("number") ("note") ("publisher") ("location")
+      ("volumes") ("series") ("number") ("note") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2)
       ("isbn") ("eid") ("chapter") ("pages") ("addendum") ("pubstate") ("doi")
-      ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("SuppCollection" "Supplemental Material in a Collection" ; same as 
@incollection
-     (("author") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title")
+      ("date" nil nil 1) ("year" nil nil -1))
      (("booktitle"))
      (("editor") ("editora") ("editorb") ("editorc") ("translator")
       ("annotator") ("commentator") ("introduction") ("foreword") ("afterword")
       ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
       ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
       ("language") ("origlanguage") ("volume") ("part") ("edition")
-      ("volumes") ("series") ("number") ("note") ("publisher") ("location")
+      ("volumes") ("series") ("number") ("note") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2)
       ("isbn") ("eid") ("chapter") ("pages") ("addendum") ("pubstate") ("doi")
-      ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Dataset" "Data Set"
      (("author" nil nil 0) ("editor" nil nil 0) ("title")
-      ("year" nil nil 1) ("date" nil nil 1))
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("subtitle") ("titleaddon") ("language") ("edition") ("type") ("series")
       ("number") ("version") ("note") ("organization") ("publisher")
-      ("location") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass")
-      ("eprinttype") ("url") ("urldate")))
+      ("location" nil nil 2) ("address" nil nil -2)
+      ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Manual" "Technical Manual"
      (("author" nil nil 0) ("editor" nil nil 0) ("title")
-      ("year" nil nil 1) ("date" nil nil 1))
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("subtitle") ("titleaddon") ("language") ("edition")
       ("type") ("series") ("number") ("version") ("note")
-      ("organization") ("publisher") ("location") ("isbn") ("eid") ("chapter")
-      ("pages") ("pagetotal") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("organization") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2)
+      ("isbn") ("eid") ("chapter")
+      ("pages") ("pagetotal") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Misc" "Miscellaneous"
      (("author" nil nil 0) ("editor" nil nil 0) ("title")
-      ("year" nil nil 1) ("date" nil nil 1))
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("subtitle") ("titleaddon") ("language") ("howpublished") ("type")
-      ("version") ("note") ("organization") ("location")
-      ("month") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("version") ("note") ("organization")
+      ("location" nil nil 2) ("address" nil nil -2)
+      ("month") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Online" "Online Resource"
      (("author" nil nil 0) ("editor" nil nil 0) ("title")
-      ("year" nil nil 1) ("date" nil nil 1)
+      ("date" nil nil 1) ("year" nil nil -1)
       ("doi" nil nil 2) ("eprint" nil nil 2) ("url" nil nil 2))
      nil
      (("subtitle") ("titleaddon") ("language") ("version") ("note")
       ("organization") ("month") ("addendum")
-      ("pubstate") ("eprintclass") ("eprinttype") ("urldate")))
+      ("pubstate") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5) ("urldate")))
     ("Patent" "Patent"
-     (("author") ("title") ("number") ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title") ("number")
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
-     (("holder") ("subtitle") ("titleaddon") ("type") ("version") ("location")
-      ("note") ("month") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+     (("holder") ("subtitle") ("titleaddon") ("type") ("version")
+      ("location" nil nil 2) ("address" nil nil -2)
+      ("note") ("month") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Periodical" "Complete Issue of a Periodical"
-     (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("editor") ("title")
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("editora") ("editorb") ("editorc") ("subtitle") ("titleaddon")
       ("issuetitle") ("issuesubtitle") ("issuetitleaddon") ("language")
       ("series") ("volume") ("number") ("issue")
-      ("month") ("note") ("issn") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("month") ("note") ("issn") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("SuppPeriodical" "Supplemental Material in a Periodical" ; same as 
@article
-     (("author") ("title") ("journaltitle")
-      ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title")
+      ("journaltitle" nil nil 3) ("journal" nil nil -3)
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("translator") ("annotator") ("commentator") ("subtitle") ("titleaddon")
       ("editor") ("editora") ("editorb") ("editorc") ("journalsubtitle")
       ("journaltitleaddon") ("issuetitle") ("issuesubtitle") 
("issuetitleaddon")
       ("language") ("origlanguage") ("series") ("volume") ("number") ("eid")
       ("issue") ("month") ("pages") ("version") ("note") ("issn")
-      ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass")
-      ("eprinttype") ("url") ("urldate")))
+      ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Proceedings" "Single-Volume Conference Proceedings"
-     (("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("title") ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("editor") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
       ("maintitleaddon") ("eventtitle") ("eventtitleaddon") ("eventdate")
       ("venue") ("language") ("volume") ("part") ("volumes") ("series")
-      ("number") ("note") ("organization") ("publisher") ("location") ("month")
+      ("number") ("note") ("organization") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2) ("month")
       ("isbn") ("eid") ("chapter") ("pages") ("pagetotal") ("addendum")
-      ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url")
-      ("urldate")))
+      ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("MVProceedings" "Multi-Volume Conference Proceedings"
-     (("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("title") ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("editor") ("subtitle") ("titleaddon") ("eventtitle") ("eventtitleaddon")
       ("eventdate") ("venue") ("language") ("volumes") ("series") ("number")
-      ("note") ("organization") ("publisher") ("location") ("month")
-      ("isbn") ("pagetotal") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("note") ("organization") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2) ("month")
+      ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("InProceedings" "Article in Conference Proceedings"
-     (("author") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title")
+      ("date" nil nil 1) ("year" nil nil -1))
      (("booktitle"))
      (("editor") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
       ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
       ("eventtitle") ("eventtitleaddon") ("eventdate") ("venue") ("language")
       ("volume") ("part") ("volumes") ("series") ("number") ("note")
-      ("organization") ("publisher") ("location") ("month") ("isbn") ("eid")
-      ("chapter") ("pages") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("organization") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2) ("month") ("isbn") ("eid")
+      ("chapter") ("pages") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Reference" "Single-Volume Work of Reference" ; same as @collection
-     (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("editor") ("title") ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("editora") ("editorb") ("editorc") ("translator") ("annotator")
       ("commentator") ("introduction") ("foreword") ("afterword")
       ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
       ("maintitleaddon") ("language") ("origlanguage") ("volume")
       ("part") ("edition") ("volumes") ("series") ("number") ("note")
-      ("publisher") ("location") ("isbn") ("eid") ("chapter") ("pages")
-      ("pagetotal") ("addendum") ("pubstate") ("doi") ("eprint") 
("eprintclass")
-      ("eprinttype") ("url") ("urldate")))
+      ("publisher") ("location" nil nil 2) ("address" nil nil -2)
+      ("isbn") ("eid") ("chapter") ("pages")
+      ("pagetotal") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("MVReference" "Multi-Volume Work of Reference" ; same as @mvcollection
-     (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("editor") ("title") ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("editora") ("editorb") ("editorc") ("translator") ("annotator")
       ("commentator") ("introduction") ("foreword") ("afterword")
       ("subtitle") ("titleaddon") ("language") ("origlanguage") ("edition")
       ("volumes") ("series") ("number") ("note") ("publisher")
-      ("location") ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi")
-      ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("location" nil nil 2) ("address" nil nil -2)
+      ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("InReference" "Article in a Work of Reference" ; same as @incollection
-     (("author") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title") ("date" nil nil 1) ("year" nil nil -1))
      (("booktitle"))
      (("editor") ("editora") ("editorb") ("editorc") ("translator")
       ("annotator") ("commentator") ("introduction") ("foreword") ("afterword")
       ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
       ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
       ("language") ("origlanguage") ("volume") ("part") ("edition")
-      ("volumes") ("series") ("number") ("note") ("publisher") ("location")
+      ("volumes") ("series") ("number") ("note") ("publisher")
+      ("location" nil nil 2) ("address" nil nil -2)
       ("isbn") ("eid") ("chapter") ("pages") ("addendum") ("pubstate") ("doi")
-      ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Report" "Technical or Research Report"
-     (("author") ("title") ("type") ("institution")
-      ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title") ("type")
+      ("institution" nil nil 6) ("school" nil nil -6)
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("subtitle") ("titleaddon") ("language") ("number") ("version") ("note")
-      ("location") ("month") ("isrn") ("eid") ("chapter") ("pages")
-      ("pagetotal") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("location" nil nil 2) ("address" nil nil -2)
+      ("month") ("isrn") ("eid") ("chapter") ("pages")
+      ("pagetotal") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Software" "Computer Software" ; Same as @misc.
      (("author" nil nil 0) ("editor" nil nil 0) ("title")
-      ("year" nil nil 1) ("date" nil nil 1))
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("subtitle") ("titleaddon") ("language") ("howpublished") ("type")
-      ("version") ("note") ("organization") ("location")
-      ("month") ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("version") ("note") ("organization")
+      ("location" nil nil 2) ("address" nil nil -2)
+      ("month") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Thesis" "PhD or Master's Thesis"
-     (("author") ("title") ("type") ("institution")
-      ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title") ("type")
+      ("institution" nil nil 6) ("school" nil nil -6)
+      ("date" nil nil 1) ("year" nil nil -1))
      nil
-     (("subtitle") ("titleaddon") ("language") ("note") ("location")
+     (("subtitle") ("titleaddon") ("language") ("note")
+      ("location" nil nil 2) ("address" nil nil -2)
       ("month") ("isbn") ("eid") ("chapter") ("pages") ("pagetotal")
-      ("addendum") ("pubstate")
-      ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
+      ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate")))
     ("Unpublished" "Unpublished"
-     (("author") ("title") ("year" nil nil 0) ("date" nil nil 0))
+     (("author") ("title") ("date" nil nil 1) ("year" nil nil -1))
      nil
      (("subtitle") ("titleaddon") ("type") ("eventtitle") ("eventtitleaddon")
       ("eventdate") ("venue") ("language") ("howpublished") ("note")
-      ("location") ("isbn") ("month") ("addendum") ("pubstate") ("doi")
-      ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))))
+      ("location" nil nil 2) ("address" nil nil -2)
+      ("isbn") ("month") ("addendum") ("pubstate") ("doi")
+      ("eprint") ("eprintclass" nil nil 4) ("primaryclass" nil nil -4)
+      ("eprinttype" nil nil 5) ("archiveprefix" nil nil -5)
+      ("url") ("urldate"))))
   "Alist of biblatex entry types and their associated fields.
 It has the same format as `bibtex-BibTeX-entry-alist'."
   :group 'bibtex
@@ -2312,10 +2426,6 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
   "Add NEWELT to the list stored in VEC at index IDX."
   (aset vec idx (cons newelt (aref vec idx))))
 
-(defsubst bibtex-vec-incr (vec idx)
-  "Increment by 1 the counter which is stored in VEC at index IDX."
-  (aset vec idx (1+ (aref vec idx))))
-
 (defun bibtex-format-entry ()
   "Helper function for `bibtex-clean-entry'.
 Formats current entry according to variable `bibtex-entry-format'."
@@ -2336,7 +2446,8 @@ Formats current entry according to variable 
`bibtex-entry-format'."
                               strings sort-fields)
                   bibtex-entry-format))
         (left-delim-re (regexp-quote (bibtex-field-left-delimiter)))
-        bounds crossref-key req-field-list default-field-list field-list
+        bounds crossref-key req-field-list opt-field-list
+        default-field-list field-list
         num-alt alt-fields idx error-field-name)
     (unwind-protect
         ;; formatting (undone if error occurs)
@@ -2383,16 +2494,22 @@ Formats current entry according to variable 
`bibtex-entry-format'."
 
                 ;; list of required fields appropriate for an entry with
                 ;; or without crossref key.
-                (setq req-field-list (if crossref-key (nth 2 entry-list)
-                                       (append (nth 2 entry-list) (nth 3 
entry-list)))
+                (setq req-field-list (append (nth 2 entry-list)
+                                             (unless crossref-key
+                                               (nth 3 entry-list)))
+                      opt-field-list (append (if crossref-key
+                                               (nth 3 entry-list))
+                                             (nth 4 entry-list)
+                                             bibtex-user-optional-fields)
                       ;; default list of fields that may appear in this entry
-                      default-field-list (append (nth 2 entry-list) (nth 3 
entry-list)
-                                                 (nth 4 entry-list)
-                                                 bibtex-user-optional-fields)
-                      ;; number of ALT fields we expect to find
-                      num-alt (length (delq nil (delete-dups
-                                                 (mapcar (lambda (x) (nth 3 x))
-                                                         req-field-list))))
+                      default-field-list (append req-field-list opt-field-list)
+                      ;; number of ALT fields we may find
+                      num-alt (let ((n 0))
+                                (mapc (lambda (x)
+                                        (if (nth 3 x)
+                                            (setq n (max n (abs (nth 3 x))))))
+                                      default-field-list)
+                                (1+ n))
                       ;; ALT fields of respective groups
                       alt-fields (make-vector num-alt nil))
 
@@ -2431,8 +2548,9 @@ Formats current entry according to variable 
`bibtex-entry-format'."
                   (if opt-alt (setq field-name (substring field-name 3)))
 
                   ;; keep track of alternatives
-                  (if (setq idx (nth 3 (assoc-string field-name req-field-list 
t)))
-                      (bibtex-vec-push alt-fields idx field-name))
+                  (if (and (not empty-field)
+                           (setq idx (nth 3 (assoc-string field-name 
default-field-list t))))
+                      (bibtex-vec-push alt-fields (abs idx) field-name))
 
                   (if (memq 'opts-or-alts format)
                       ;; delete empty optional and alternative fields
@@ -2581,34 +2699,34 @@ Formats current entry according to variable 
`bibtex-entry-format'."
 
               ;; check whether all required fields are present
               (when (memq 'required-fields format)
-               (let ((alt-expect (make-vector num-alt nil))
-                     (alt-found (make-vector num-alt 0)))
+               (let ((alt-expect (make-vector num-alt nil)))
                  (dolist (fname req-field-list)
-                   (cond ((setq idx (nth 3 fname))
-                          ;; t if field has alternative flag
-                          (bibtex-vec-push alt-expect idx (car fname))
-                          (if (member-ignore-case (car fname) field-list)
-                              (bibtex-vec-incr alt-found idx)))
+                   (cond ((nth 3 fname)
+                           ;; t if required field has alternative flag
+                           (setq idx (abs (nth 3 fname)))
+                          (bibtex-vec-push alt-expect idx (car fname)))
                          ((not (member-ignore-case (car fname) field-list))
-                          ;; If we use the crossref field, a required field
-                          ;; can have the OPT prefix.  So if it was empty,
-                          ;; we have deleted by now.  Nonetheless we can
-                          ;; move point on this empty field.
-                          (setq error-field-name (car fname))
+                           (setq error-field-name (car fname))
                           (user-error "Mandatory field `%s' is missing"
                                        (car fname)))))
                  (dotimes (idx num-alt)
-                   (cond ((= 0 (aref alt-found idx))
+                   (cond ((and (aref alt-expect idx)
+                                (not (aref alt-fields idx)))
                           (setq error-field-name
                                  (car (last (aref alt-fields idx))))
-                          (user-error "Alternative mandatory field `%s' is 
missing"
-                                       (aref alt-expect idx)))
-                         ((< 1 (aref alt-found idx))
+                          (user-error "Alternative mandatory fields `%s' are 
missing"
+                                       (mapconcat 'identity
+                                                  (reverse
+                                                   (aref alt-expect idx))
+                                                  ", ")))
+                         ((nth 1 (aref alt-fields idx))
                           (setq error-field-name
                                  (car (last (aref alt-fields idx))))
-                          (user-error "Alternative fields `%s' are defined %s 
times"
-                                       (aref alt-expect idx)
-                                       (length (aref alt-fields idx))))))))
+                          (user-error "Fields `%s' are alternatives"
+                                       (mapconcat 'identity
+                                                  (reverse
+                                                   (aref alt-fields idx))
+                                                  ", ")))))))
 
               ;; update comma after last field
               (if (memq 'last-comma format)
@@ -2761,12 +2879,16 @@ and `bibtex-autokey-names-stretch'."
 
 (defun bibtex-autokey-get-year ()
   "Return year field contents as a string obeying 
`bibtex-autokey-year-length'."
-  (let ((yearfield (bibtex-autokey-get-field '("year" "date"))))
-    ;; biblatex date field has format yyyy-mm-dd
-    (if (< 4 (length yearfield))
-        (setq yearfield (substring yearfield 0 4)))
-    (substring yearfield (max 0 (- (length yearfield)
-                                   bibtex-autokey-year-length)))))
+  (let* ((str (bibtex-autokey-get-field '("date" "year"))) ; possibly ""
+         (year (or (and (iso8601-valid-p str)
+                        (let ((year (decoded-time-year (iso8601-parse str))))
+                          (and year (number-to-string year))))
+                   ;; BibTeX permits a year field "(about 1984)", where only
+                   ;; the last four nonpunctuation characters must be numerals.
+                   (and (string-match 
"\\([0-9][0-9][0-9][0-9]\\)[^[:alnum:]]*\\'" str)
+                        (match-string 1 str))
+                   (user-error "Year or date field `%s' invalid" str))))
+    (substring year (max 0 (- (length year) bibtex-autokey-year-length)))))
 
 (defun bibtex-autokey-get-title ()
   "Get title field contents up to a terminator.
@@ -2849,12 +2971,12 @@ The name part:
 
 The year part:
  1. Build the year part of the key by truncating the content of the year
-    field to the rightmost `bibtex-autokey-year-length' digits (useful
-    values are 2 and 4).
- 2. If the year field (or any other field required to generate the key)
-    is absent, but the entry has a valid crossref field and
-    `bibtex-autokey-use-crossref' is non-nil, use the field of the
-    crossreferenced entry instead.
+    component of the date or year field to the rightmost
+    `bibtex-autokey-year-length' digits (useful values are 2 and 4).
+ 2. If both the year and date fields are absent, but the entry has a
+    valid crossref field and `bibtex-autokey-use-crossref' is
+    non-nil, use the date or year field of the crossreferenced entry
+    instead.
 
 The title part
  1. Change the content of the title field according to
@@ -3633,8 +3755,7 @@ and `bibtex-user-optional-fields'."
       (setq required  (append (nth 2 e-list) (nth 3 e-list))
             optional (nth 4 e-list)))
     (if bibtex-include-OPTkey
-        (push (list "key"
-                    "Crossref key"
+        (push (list "key" "Used as label with certain BibTeX styles"
                     (if (or (stringp bibtex-include-OPTkey)
                             (functionp bibtex-include-OPTkey))
                         bibtex-include-OPTkey))
@@ -3643,7 +3764,41 @@ and `bibtex-user-optional-fields'."
         (push '("crossref" "Reference key of the cross-referenced entry")
               optional))
     (setq optional (append optional bibtex-user-optional-fields))
-    (cons required optional)))
+    (cons (bibtex--skip-field-aliases required)
+          (bibtex--skip-field-aliases optional))))
+
+(defun bibtex--skip-field-aliases (list)
+  "Skip fields in LIST that are aliases, return the shortened list.
+Aliases are fields for which the element ALTERNATIVE is a negative number,
+see `bibtex-BibTeX-entry-alist'.  The shortened field list is used
+for the templates of `bibtex-entry', whereas entry validation performed by
+`bibtex-format-entry' uses the full list of fields for an entry."
+  ;; FIXME: `bibtex-entry' and `bibtex-format-entry' handle aliases
+  ;; under the hood in a manner that is largely invisible to users.
+  ;; If instead one wanted to display the aliases as alternatives
+  ;; in the usual way, field names may get both the ALT and the OPT prefix.
+  ;; That gets rather clumsy.  Also, the code currently assumes that
+  ;; field names have either the ALT or the OPT prefix, but not both.
+  ;; Are there scenarios when it would be useful to display both?
+  (let (alt-list new-list)
+    (dolist (elt list) ; identify alternatives
+      (if (and (nth 3 elt)
+               (<= 0 (nth 3 elt)))
+          (push (nth 3 elt) alt-list)))
+    (setq alt-list (sort alt-list '<))
+    ;; Skip aliases.  If ELT is marked as "proper alternative", but all
+    ;; alternatives for field ELT are aliases, we do not label ELT
+    ;; as an alternative either.
+    (dolist (elt list)
+      (let ((alt (nth 3 elt)))
+        (if alt
+            (if (<= 0 alt)
+                (push (if (eq alt (cadr (memq alt alt-list)))
+                          elt ; ELT has proper alternatives
+                        (butlast elt)) ; alternatives of ELT are alias
+                      new-list))
+          (push elt new-list))))
+    (reverse new-list)))
 
 (defun bibtex-entry (entry-type)
   "Insert a template for a BibTeX entry of type ENTRY-TYPE.
@@ -3992,28 +4147,15 @@ If mark is active count entries in region, if not in 
whole buffer."
     (narrow-to-region (bibtex-beginning-of-entry)
                       (bibtex-end-of-entry))))
 
-(defun bibtex-entry-index ()
-  "Return index of BibTeX entry head at or past position of point.
-The index is a list (KEY CROSSREF-KEY ENTRY-TYPE) that is used for sorting
-the entries of the BibTeX buffer.  CROSSREF-KEY is nil unless the value
-of `bibtex-maintain-sorted-entries' is `crossref'.  Move point to the end
-of the head of the entry found.  Return nil if no entry found."
-  (let ((case-fold-search t))
-    (if (re-search-forward bibtex-entry-maybe-empty-head nil t)
-        (let ((key (bibtex-key-in-head))
-              ;; all entry types should be downcase (for ease of comparison)
-              (entry-type (downcase (bibtex-type-in-head))))
-          ;; Don't search CROSSREF-KEY if we don't need it.
-          (if (eq bibtex-maintain-sorted-entries 'crossref)
-              (let ((bounds (bibtex-search-forward-field
-                             "\\(OPT\\)?crossref" t)))
-                (list key
-                      (if bounds (bibtex-text-in-field-bounds bounds t))
-                      entry-type))
-            (list key nil entry-type))))))
-
-(defun bibtex-init-sort-entry-class-alist ()
-  "Initialize `bibtex-sort-entry-class-alist' (buffer-local)."
+(define-obsolete-function-alias 'bibtex-init-sort-entry-class-alist
+  #'bibtex-init-sort "28.1")
+(defun bibtex-init-sort (&optional parse)
+  "Initialize sorting of BibTeX entries.
+If PARSE is non-nil, also parse BibTeX keys."
+  (if (or parse
+          (and (eq bibtex-maintain-sorted-entries 'crossref)
+               (functionp bibtex-reference-keys)))
+      (bibtex-parse-keys))
   (unless (local-variable-p 'bibtex-sort-entry-class-alist)
     (setq-local bibtex-sort-entry-class-alist
                 (let ((i -1) alist)
@@ -4023,7 +4165,36 @@ of the head of the entry found.  Return nil if no entry 
found."
                       ;; All entry types should be downcase (for ease of 
comparison).
                       (push (cons (if (stringp entry) (downcase entry) entry) 
i)
                             alist)))
-                  alist))))
+                  alist)))
+  ;; Custom sorting scheme
+  (if (and (consp bibtex-maintain-sorted-entries)
+           (nth 2 bibtex-maintain-sorted-entries))
+      (funcall (nth 2 bibtex-maintain-sorted-entries))))
+
+(defun bibtex-entry-index ()
+  "Return index of BibTeX entry head at or past position of point.
+The index is a list (KEY CROSSREF-KEY ENTRY-TYPE) that is used for sorting
+the entries of the BibTeX buffer.  CROSSREF-KEY is nil unless the value of
+`bibtex-maintain-sorted-entries' is `crossref'.
+If `bibtex-maintain-sorted-entries' is (INDEX-FUN ...), the index is the return
+value of INDEX-FUN.  Return nil if no entry found.
+Move point to the end of the head of the entry found."
+  (let ((case-fold-search t))
+    (if (re-search-forward bibtex-entry-maybe-empty-head nil t)
+        (if (consp bibtex-maintain-sorted-entries)
+            ;; Custom sorting scheme
+            (funcall (car bibtex-maintain-sorted-entries))
+          (let ((key (bibtex-key-in-head))
+                ;; ENTRY-TYPE should be downcase (for ease of comparison)
+                (entry-type (downcase (bibtex-type-in-head)))
+                bounds)
+            (list key
+                  ;; Don't search CROSSREF-KEY if we don't need it.
+                  (and (eq bibtex-maintain-sorted-entries 'crossref)
+                       (setq bounds (bibtex-search-forward-field
+                                      "\\(OPT\\)?crossref" t))
+                       (bibtex-text-in-field-bounds bounds t))
+                  entry-type))))))
 
 (defun bibtex-lessp (index1 index2)
   "Predicate for sorting BibTeX entries with indices INDEX1 and INDEX2.
@@ -4032,6 +4203,8 @@ The predicate depends on the variable 
`bibtex-maintain-sorted-entries'.
 If its value is nil use plain sorting."
   (cond ((not index1) (not index2)) ; indices can be nil
         ((not index2) nil)
+        ((consp bibtex-maintain-sorted-entries)
+         (funcall (cadr bibtex-maintain-sorted-entries) index1 index2))
         ((eq bibtex-maintain-sorted-entries 'crossref)
          ;; CROSSREF-KEY may be nil or it can point to an entry
          ;; in another BibTeX file.  In both cases we ignore CROSSREF-KEY.
@@ -4068,10 +4241,7 @@ affected.  If `bibtex-sort-ignore-string-entries' is 
non-nil, @String entries
 are ignored."
   (interactive)
   (bibtex-beginning-of-first-entry)     ; Needed by `sort-subr'
-  (bibtex-init-sort-entry-class-alist)  ; Needed by `bibtex-lessp'.
-  (if (and (eq bibtex-maintain-sorted-entries 'crossref)
-           (functionp bibtex-reference-keys))
-      (bibtex-parse-keys))              ; Needed by `bibtex-lessp'.
+  (bibtex-init-sort)                    ; Needed by `bibtex-lessp'.
   (sort-subr nil
              'bibtex-skip-to-valid-entry   ; NEXTREC function
              'bibtex-end-of-entry          ; ENDREC function
@@ -4222,10 +4392,7 @@ If `bibtex-maintain-sorted-entries' is non-nil, perform 
a binary
 search to look for place for KEY.  This requires that buffer is sorted,
 see `bibtex-validate'.
 Return t if preparation was successful or nil if entry KEY already exists."
-  (bibtex-init-sort-entry-class-alist)  ; Needed by `bibtex-lessp'.
-  (if (and (eq bibtex-maintain-sorted-entries 'crossref)
-           (functionp bibtex-reference-keys))
-      (bibtex-parse-keys))              ; Needed by `bibtex-lessp'.
+  (bibtex-init-sort)  ; Needed by `bibtex-lessp'.
   (let ((key (nth 0 index))
         key-exist)
     (cond ((or (null key)
@@ -4316,9 +4483,7 @@ Return t if test was successful, nil otherwise."
             (setq syntax-error t)
 
           ;; Check for duplicate keys and correct sort order
-          (bibtex-init-sort-entry-class-alist)  ; Needed by `bibtex-lessp'.
-          (bibtex-parse-keys) ; Possibly needed by `bibtex-lessp'.
-                              ; Always needed by subsequent global key check.
+          (bibtex-init-sort t) ; Needed by `bibtex-lessp' and global key check.
           (let (previous current key-list)
             (bibtex-progress-message "Checking for duplicate keys")
             (bibtex-map-entries
@@ -4369,12 +4534,19 @@ Return t if test was successful, nil otherwise."
                         (entry-list (assoc-string (bibtex-type-in-head)
                                                   bibtex-entry-alist t))
                         (crossref (bibtex-search-forward-field "crossref" end))
-                        (req (if crossref (copy-sequence (nth 2 entry-list))
-                               (append (nth 2 entry-list)
+                        (req (append (nth 2 entry-list)
+                                     (unless crossref
                                        (copy-sequence (nth 3 entry-list)))))
-                        (num-alt (length (delq nil (delete-dups
-                                                    (mapcar (lambda (x) (nth 3 
x))
-                                                            req)))))
+                        (opt (append (if crossref (nth 3 entry-list))
+                                     (nth 4 entry-list)
+                                     bibtex-user-optional-fields))
+                        (default (append req opt))
+                        (num-alt (let ((n 0))
+                                   (mapc (lambda (x)
+                                           (if (nth 3 x)
+                                               (setq n (max n (abs (nth 3 
x))))))
+                                         default)
+                                   (1+ n)))
                         (alt-fields (make-vector num-alt nil))
                         bounds field idx)
                    (while (setq bounds (bibtex-parse-field))
@@ -4389,7 +4561,7 @@ Return t if test was successful, nil otherwise."
                            (push (cons (bibtex-current-line)
                                        "Questionable month field")
                                  error-list))
-                       (setq field (assoc-string field-name req t)
+                       (setq field (assoc-string field-name default t)
                              req (delete field req))
                        (if (setq idx (nth 3 field))
                            (if (aref alt-fields idx)
@@ -4408,12 +4580,13 @@ Return t if test was successful, nil otherwise."
                                      (car field)))
                                error-list)))
                      (dotimes (idx num-alt)
-                       (unless (aref alt-fields idx)
-                         (push (cons beg-line
-                                     (format-message
-                                     "Alternative fields `%s' missing"
-                                     (aref alt-expect idx)))
-                               error-list))))))))
+                       (if (and (aref alt-expect idx)
+                                (not (aref alt-fields idx)))
+                           (push (cons beg-line
+                                       (format-message
+                                        "Alternative fields `%s' missing"
+                                        (aref alt-expect idx)))
+                                 error-list))))))))
             (bibtex-progress-message 'done)))))
 
     (if error-list
diff --git a/lisp/textmodes/conf-mode.el b/lisp/textmodes/conf-mode.el
index 722fc0a..d88964a 100644
--- a/lisp/textmodes/conf-mode.el
+++ b/lisp/textmodes/conf-mode.el
@@ -1,6 +1,6 @@
 ;;; conf-mode.el --- Simple major mode for editing conf/ini/properties files  
-*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>
 ;; Keywords: conf ini windows java
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 747657b..9186e52 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -1,6 +1,6 @@
 ;;; css-mode.el --- Major mode to edit CSS files  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Maintainer: Simen Heggestøyl <simenheg@gmail.com>
diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el
index dd28cb8..23a6229 100644
--- a/lisp/textmodes/dns-mode.el
+++ b/lisp/textmodes/dns-mode.el
@@ -1,6 +1,6 @@
 ;;; dns-mode.el --- a mode for viewing/editing Domain Name System master files
 
-;; Copyright (C) 2000-2001, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2001, 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;; Keywords: DNS master zone file SOA comm
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
index 919e090..1aac964 100644
--- a/lisp/textmodes/enriched.el
+++ b/lisp/textmodes/enriched.el
@@ -1,6 +1,6 @@
 ;;; enriched.el --- read and save files in text/enriched format
 
-;; Copyright (C) 1994-1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Boris Goldowsky <boris@gnu.org>
 ;; Keywords: wp, faces
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 15b13af..e9bef6e 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -1,6 +1,6 @@
 ;;; fill.el --- fill commands for Emacs
 
-;; Copyright (C) 1985-1986, 1992, 1994-1997, 1999, 2001-2020 Free
+;; Copyright (C) 1985-1986, 1992, 1994-1997, 1999, 2001-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 2757074..d850316 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1,6 +1,6 @@
 ;;; flyspell.el --- On-the-fly spell checker  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Manuel Serrano <Manuel.Serrano@sophia.inria.fr>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index ba7f36d..8d49a7c 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1,6 +1,6 @@
 ;;; ispell.el --- interface to spell checkers  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1994-1995, 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Ken Stevens <k.stevens@ieee.org>
 
diff --git a/lisp/textmodes/less-css-mode.el b/lisp/textmodes/less-css-mode.el
index 30974b9..9cacc17 100644
--- a/lisp/textmodes/less-css-mode.el
+++ b/lisp/textmodes/less-css-mode.el
@@ -1,6 +1,6 @@
 ;;; less-css-mode.el --- Major mode for editing Less CSS files  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Steve Purcell <steve@sanityinc.com>
 ;; Maintainer: Simen Heggestøyl <simenheg@gmail.com>
diff --git a/lisp/textmodes/makeinfo.el b/lisp/textmodes/makeinfo.el
index f41ed87..e48649b 100644
--- a/lisp/textmodes/makeinfo.el
+++ b/lisp/textmodes/makeinfo.el
@@ -1,6 +1,6 @@
 ;;; makeinfo.el --- run makeinfo conveniently
 
-;; Copyright (C) 1991, 1993, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1993, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Robert J. Chassell
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/mhtml-mode.el b/lisp/textmodes/mhtml-mode.el
index 329f3e7..32542d0 100644
--- a/lisp/textmodes/mhtml-mode.el
+++ b/lisp/textmodes/mhtml-mode.el
@@ -1,6 +1,6 @@
 ;;; mhtml-mode.el --- HTML editing mode that handles CSS and JS -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Keywords: wp, hypermedia, comm, languages
 
diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el
index 2d7ab13..8965785 100644
--- a/lisp/textmodes/nroff-mode.el
+++ b/lisp/textmodes/nroff-mode.el
@@ -1,6 +1,6 @@
 ;;; nroff-mode.el --- GNU Emacs major mode for editing nroff source
 
-;; Copyright (C) 1985-1986, 1994-1995, 1997, 2001-2020 Free Software
+;; Copyright (C) 1985-1986, 1994-1995, 1997, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/page-ext.el b/lisp/textmodes/page-ext.el
index b357bbb..c3e1fb1 100644
--- a/lisp/textmodes/page-ext.el
+++ b/lisp/textmodes/page-ext.el
@@ -1,6 +1,6 @@
 ;;; page-ext.el --- extended page handling commands  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1990-1991, 1993-1994, 2001-2020 Free Software
+;; Copyright (C) 1990-1991, 1993-1994, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Robert J. Chassell <bob@gnu.org>
diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el
index 029ba96..e1d7fb7 100644
--- a/lisp/textmodes/page.el
+++ b/lisp/textmodes/page.el
@@ -1,6 +1,6 @@
 ;;; page.el --- page motion commands for Emacs  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: wp convenience
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index b097529..217ae10 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -1,6 +1,6 @@
 ;;; paragraphs.el --- paragraph and sentence parsing  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1985-1987, 1991, 1994-1997, 1999-2020 Free Software
+;; Copyright (C) 1985-1987, 1991, 1994-1997, 1999-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index 9cf61c6..3cb1043 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -1,6 +1,6 @@
 ;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model 
-*- lexical-binding: t -*-
 
-;; Copyright (C) 1985, 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: K. Shane Hartman
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/po.el b/lisp/textmodes/po.el
index 29c6d3f..1066e93 100644
--- a/lisp/textmodes/po.el
+++ b/lisp/textmodes/po.el
@@ -1,6 +1,6 @@
 ;;; po.el --- basic support of PO translation files  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1995-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Authors: François Pinard <pinard@iro.umontreal.ca>,
 ;;          Greg McGary <gkm@magilla.cichlid.com>,
diff --git a/lisp/textmodes/refbib.el b/lisp/textmodes/refbib.el
index a1df483..bff5712 100644
--- a/lisp/textmodes/refbib.el
+++ b/lisp/textmodes/refbib.el
@@ -1,6 +1,6 @@
 ;;; refbib.el --- convert refer-style references to ones usable by Latex bib
 
-;; Copyright (C) 1989, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Henry Kautz <kautz@research.att.com>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el
index 888c310..ae1f778 100644
--- a/lisp/textmodes/refer.el
+++ b/lisp/textmodes/refer.el
@@ -1,6 +1,6 @@
 ;;; refer.el --- look up references in bibliography files
 
-;; Copyright (C) 1992, 1996, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1996, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Ashwin Ram <ashwin@cc.gatech.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el
index 139221f..6edd9ae 100644
--- a/lisp/textmodes/refill.el
+++ b/lisp/textmodes/refill.el
@@ -1,6 +1,6 @@
 ;;; refill.el --- `auto-fill' by refilling paragraphs on changes
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Maintainer: Miles Bader <miles@gnu.org>
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el
index de6d533..ae3faec 100644
--- a/lisp/textmodes/reftex-auc.el
+++ b/lisp/textmodes/reftex-auc.el
@@ -1,6 +1,6 @@
 ;;; reftex-auc.el --- RefTeX's interface to AUCTeX
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 49e5b28..5579e40 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -1,6 +1,6 @@
 ;;; reftex-cite.el --- creating citations with RefTeX
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index 8b2569a..e517cea 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -1,6 +1,6 @@
 ;;; reftex-dcr.el --- viewing cross references and citations with RefTeX
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index a4e8c9f..4d02160 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -1,6 +1,6 @@
 ;;; reftex-global.el --- operations on entire documents with RefTeX
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index bebda48..5049ffb 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -1,6 +1,6 @@
 ;;; reftex-index.el --- index support with RefTeX
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 4f4afe9..98c61f5 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -1,6 +1,6 @@
 ;;; reftex-parse.el --- parser functions for RefTeX
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -1046,7 +1046,7 @@ When point is just after a { or [, limit string to 
matching parenthesis."
 
 ;;;###autoload
 (defun reftex-init-section-numbers (&optional toc-entry appendix)
-  "Initialize the section numbers with zeros or with what is found in the 
TOC-ENTRY."
+  "Initialize section numbers with zeros or with what is found in the 
TOC-ENTRY."
   (let* ((level  (or (nth 5 toc-entry) -1))
          (numbers (nreverse (split-string (or (nth 6 toc-entry) "") "\\.")))
          (depth (1- (length reftex-section-numbers)))
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index 4c780d8..439c02f 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -1,6 +1,6 @@
 ;;; reftex-ref.el --- code to create labels and references with RefTeX
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index 137a912..d2e9974 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -1,6 +1,6 @@
 ;;; reftex-sel.el --- the selection modes for RefTeX
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index eb6ed2f..3b9f970 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -1,6 +1,6 @@
 ;;; reftex-toc.el --- RefTeX's table of contents mode
 
-;; Copyright (C) 1997-2000, 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2000, 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -851,7 +851,8 @@ if these sets are sorted blocks in the alist."
   "Make sure all files of the document are being visited by buffers,
 and that the scanning info is absolutely up to date.
 We do this by rescanning with `reftex-keep-temporary-buffers' bound to t.
-The variable `reftex--pro-or-de' is assumed to be dynamically scoped into this 
function.
+The variable `reftex--pro-or-de' is assumed to be dynamically
+scoped into this function.
 When finished, we exit with an error message."
   (let ((reftex-keep-temporary-buffers t))
     (reftex-toc-Rescan)
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index c9fd19d..073059d 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -1,6 +1,6 @@
 ;;; reftex-vars.el --- configuration variables for RefTeX
 
-;; Copyright (C) 1997-1999, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1999, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -741,8 +741,8 @@ The function must take an argument BOUND.  If non-nil, 
BOUND is a
 boundary for backwards searches which should be observed.
 
 Here is an example.  The LaTeX package linguex.sty defines list macros
-`\\ex.', `\\a.', etc for lists which are terminated by `\\z.' or an empty
-line.
+`\\ex.', `\\a.', etc for lists which are terminated by `\\z.' or an
+empty line.
 
     \\ex.  \\label{ex:12} Some text in an exotic language ...
           \\a. \\label{ex:13} more stuff
@@ -766,10 +766,12 @@ And here is the setup for RefTeX:
        (save-excursion
          ;; Search for any of the linguex item macros at the beginning of a 
line
          (if (re-search-backward
-              \"^[ 
\\t]*\\\\(\\\\\\\\\\\\(ex\\\\|a\\\\|b\\\\|c\\\\|d\\\\|e\\\\|f\\\\)g?\\\\.\\\\)\"
 bound t)
+              (concat \"^[ \\t]*\\\\(\\\\\\\\\\\\(ex\\\\|a\\\\|\"
+                      \"b\\\\|c\\\\|d\\\\|e\\\\|f\\\\)g?\\\\.\\\\)\")
+              bound t)
              (progn
                (setq p1 (match-beginning 1))
-               ;; Make sure no empty line or \\z. is between us and the item 
macro
+               ;; Make sure no empty line or \\z. is between us and item macro
                (if (re-search-forward \"\\n[ \\t]*\\n\\\\|\\\\\\\\z\\\\.\" pos 
t)
                    ;; Return nil because list was already closed
                    nil
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index b1fa79a..be9b236 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1,5 +1,5 @@
 ;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX
-;; Copyright (C) 1997-2000, 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2000, 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el
index 7bc7dc1..98d3a38 100644
--- a/lisp/textmodes/remember.el
+++ b/lisp/textmodes/remember.el
@@ -1,6 +1,6 @@
 ;;; remember --- a mode for quickly jotting down things to remember
 
-;; Copyright (C) 1999-2001, 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2001, 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
@@ -638,9 +638,14 @@ to turn the *scratch* buffer into your notes buffer."
   (interactive "p")
   (let ((buf (or (find-buffer-visiting remember-data-file)
                  (with-current-buffer (find-file-noselect remember-data-file)
-                   (and remember-notes-buffer-name
-                        (not (get-buffer remember-notes-buffer-name))
-                        (rename-buffer remember-notes-buffer-name))
+                   (when remember-notes-buffer-name
+                     (when (and (get-buffer remember-notes-buffer-name)
+                                (equal remember-notes-buffer-name "*scratch*"))
+                       (kill-buffer remember-notes-buffer-name))
+                     ;; Rename the buffer to the requested name (if
+                     ;; it's not already in use).
+                     (unless (get-buffer remember-notes-buffer-name)
+                       (rename-buffer remember-notes-buffer-name)))
                    (funcall (or remember-notes-initial-major-mode
                                 initial-major-mode))
                    (remember-notes-mode 1)
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index 7a7ac47..1834171 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -1,6 +1,6 @@
 ;;; rst.el --- Mode for viewing and editing reStructuredText-documents  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: Stefan Merten <stefan at merten-home dot de>
 ;; Author: Stefan Merten <stefan at merten-home dot de>,
@@ -568,9 +568,7 @@ After interpretation of ARGS the results are concatenated 
as for
                (regexp-quote (char-to-string re)))
               ((listp re)
                (let ((nested
-                      (mapcar (lambda (elt)
-                                (rst-re elt))
-                              (cdr re))))
+                      (mapcar #'rst-re (cdr re))))
                  (cond
                   ((eq (car re) :seq)
                    (mapconcat #'identity nested ""))
@@ -1302,7 +1300,8 @@ This inherits from Text mode.")
     (modify-syntax-entry ?% "." st)
     (modify-syntax-entry ?& "." st)
     (modify-syntax-entry ?' "." st)
-    (modify-syntax-entry ?* "." st)
+    (modify-syntax-entry ?` "\"`  " st)
+    (modify-syntax-entry ?* "\"*  " st)
     (modify-syntax-entry ?+ "." st)
     (modify-syntax-entry ?- "." st)
     (modify-syntax-entry ?/ "." st)
@@ -1330,7 +1329,6 @@ The hook for `text-mode' is run before this one."
 ;; Pull in variable definitions silencing byte-compiler.
 (require 'newcomment)
 
-(defvar electric-pair-pairs)
 (defvar electric-indent-inhibit)
 
 ;; Use rst-mode for *.rst and *.rest files.  Many ReStructured-Text files
@@ -1387,8 +1385,6 @@ highlighting.
   (setq-local comment-region-function #'rst-comment-region)
   (setq-local uncomment-region-function #'rst-uncomment-region)
 
-  (setq-local electric-pair-pairs '((?\" . ?\") (?\* . ?\*) (?\` . ?\`)))
-
   ;; Imenu and which function.
   ;; FIXME: Check documentation of `which-function' for alternative ways to
   ;;        determine the current function name.
@@ -1400,7 +1396,8 @@ highlighting.
                t nil nil nil
                (font-lock-multiline . t)
                (font-lock-mark-block-function . mark-paragraph)))
-  (add-hook 'font-lock-extend-region-functions #'rst-font-lock-extend-region t)
+  (add-hook 'font-lock-extend-region-functions
+            #'rst-font-lock-extend-region nil t)
 
   ;; Text after a changed line may need new fontification.
   (setq-local jit-lock-contextually t)
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index f3d8695..8465e82 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -1,6 +1,6 @@
 ;;; sgml-mode.el --- SGML- and HTML-editing modes -*- lexical-binding:t -*-
 
-;; Copyright (C) 1992, 1995-1996, 1998, 2001-2020 Free Software
+;; Copyright (C) 1992, 1995-1996, 1998, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: James Clark <jjc@jclark.com>
@@ -2364,8 +2364,8 @@ have <h1>Very Major Headlines</h1> through <h6>Very Minor 
Headlines</h6>
 
 <p>Paragraphs only need an opening tag.  Line breaks and multiple spaces are
 ignored unless the text is <pre>preformatted.</pre>  Text can be marked as
-<strong>bold</strong>, <em>italic</em> or <u>underlined</u> using the normal 
M-o or
-Edit/Text Properties/Face commands.
+<strong>bold</strong>, <em>italic</em> or <u>underlined</u> using the normal 
M-o
+or Edit/Text Properties/Face commands.
 
 Pages can have <a name=\"SOMENAME\">named points</a> and can link other points
 to them with <a href=\"#SOMENAME\">see also somename</a>.  In the same way <a
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index 984cc08..071684d 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -1,6 +1,6 @@
 ;;; table.el --- create and edit WYSIWYG text based embedded tables  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Keywords: wp, convenience
 ;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com>
@@ -853,10 +853,12 @@ simply by any key input."
   "Timer id for deferred cell update.")
 (defvar table-inhibit-update nil
   "Non-nil inhibits implicit cell and cache updates.
-It inhibits `table-with-cache-buffer' to update data in both direction, cell 
to cache and cache to cell.")
+It inhibits `table-with-cache-buffer' to update data in both directions,
+cell to cache and cache to cell.")
 (defvar table-inhibit-auto-fill-paragraph nil
   "Non-nil inhibits auto fill paragraph when `table-with-cache-buffer' exits.
-This is always set to nil at the entry to `table-with-cache-buffer' before 
executing body forms.")
+This is always set to nil at the entry to `table-with-cache-buffer' before
+executing body forms.")
 (defvar table-mode-indicator nil
   "For mode line indicator")
 ;; This is not a real minor-mode but placed in the minor-mode-alist
@@ -957,7 +959,7 @@ This is always set to nil at the entry to 
`table-with-cache-buffer' before execu
     (describe-bindings . *table--cell-describe-bindings)
     (dabbrev-expand . *table--cell-dabbrev-expand)
     (dabbrev-completion . *table--cell-dabbrev-completion))
-  "List of cons cells consisting of (ORIGINAL-COMMAND . 
TABLE-VERSION-OF-THE-COMMAND).")
+  "List of the form (ORIGINAL-COMMAND . TABLE-VERSION-OF-THE-COMMAND).")
 
 (defvar table-command-list
   ;; Construct the real contents of the `table-command-list'.
@@ -2649,7 +2651,8 @@ Creates a cell above and a cell below the current point 
location."
 ;;;###autoload
 (defun table-split-cell-horizontally ()
   "Split current cell horizontally.
-Creates a cell on the left and a cell on the right of the current point 
location."
+Creates a cell on the left and a cell on the right of the current
+point location."
   (interactive "*")
   (table-recognize-cell 'force)
   (let* ((o-coordinate (table--get-coordinate))
@@ -4073,10 +4076,12 @@ cache buffer into the designated cell in the table 
buffer."
       (set-buffer table-cell-buffer)
       (let ((cache-buffer (get-buffer-create table-cache-buffer-name))
            (org-coord (table--get-coordinate))
+            (fixed table-fixed-width-mode)
            (in-cell (equal (table--cell-to-coord (table--probe-cell))
                            (cons table-cell-info-lu-coordinate 
table-cell-info-rb-coordinate)))
            rectangle)
        (set-buffer cache-buffer)
+        (setq-local table-fixed-width-mode fixed)
        (setq rectangle
              (extract-rectangle
               1
@@ -4193,21 +4198,21 @@ cache buffer into the designated cell in the table 
buffer."
     (1- (cdr (table--get-coordinate (car (table--vertical-cell-list t t))))))))
 
 (defun table-goto-top-right-corner ()
-  "Move point to top right corner of the current table and return the char 
position."
+  "Move point to top right corner of the current table and return char 
position."
   (table--goto-coordinate
    (cons
     (car (table--get-coordinate (cdr (table--horizontal-cell-list nil t))))
     (1- (cdr (table--get-coordinate (car (table--vertical-cell-list t t))))))))
 
 (defun table-goto-bottom-left-corner ()
-  "Move point to bottom left corner of the current table and return the char 
position."
+  "Move point to bottom left corner of the current table and return char 
position."
   (table--goto-coordinate
    (cons
     (1- (car (table--get-coordinate (car (table--horizontal-cell-list t t)))))
     (1+ (cdr (table--get-coordinate (cdr (table--vertical-cell-list nil 
t))))))))
 
 (defun table-goto-bottom-right-corner ()
-  "Move point to bottom right corner of the current table and return the char 
position."
+  "Move point to bottom right corner of the current table and return char 
position."
   (table--goto-coordinate
    (cons
     (car (table--get-coordinate (cdr (table--horizontal-cell-list nil t))))
@@ -4921,7 +4926,7 @@ When optional LOCATION is provided the test is performed 
at that location."
        t))
 
 (defun table--region-in-cell-p (beg end)
-  "Return t when location BEG and END are in a valid table cell in the current 
buffer."
+  "Return t when location BEG and END are in a valid table cell in current 
buffer."
   (and (table--at-cell-p (min beg end))
        (save-excursion
         (let ((cell-beg (progn (goto-char beg) (table--probe-cell))))
@@ -5241,7 +5246,7 @@ works better than the previous versions however not fully 
compatible.
     str))
 
 (defun table--remove-eol-spaces (beg end &optional bol force)
-  "Remove spaces at the end of each line in the BEG END region of the current 
buffer.
+  "Remove spaces at the end of each line in the BEG END region of current 
buffer.
 When optional BOL is non-nil spaces at the beginning of line are
 removed.  When optional FORCE is non-nil removal operation is enforced
 even when point is within the removal area."
@@ -5382,7 +5387,8 @@ point"
 
 (defun table--transcoord-table-to-cache (&optional coordinate)
   "Transpose COORDINATE from table coordinate system to cache coordinate 
system.
-When COORDINATE is omitted or nil the point in current buffer is assumed in 
place."
+When COORDINATE is omitted or nil the point in current buffer is
+assumed in place."
   (table--offset-coordinate
    (or coordinate (table--get-coordinate))
    table-cell-info-lu-coordinate
@@ -5390,7 +5396,8 @@ When COORDINATE is omitted or nil the point in current 
buffer is assumed in plac
 
 (defun table--transcoord-cache-to-table (&optional coordinate)
   "Transpose COORDINATE from cache coordinate system to table coordinate 
system.
-When COORDINATE is omitted or nil the point in current buffer is assumed in 
place."
+When COORDINATE is omitted or nil the point in current buffer is
+assumed in place."
   (table--offset-coordinate
    (or coordinate (table--get-coordinate))
    table-cell-info-lu-coordinate))
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 37ab11a..c4e4864 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1,6 +1,6 @@
 ;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1989, 1992, 1994-1999, 2001-2020 Free
+;; Copyright (C) 1985-1986, 1989, 1992, 1994-1999, 2001-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -2331,9 +2331,14 @@ FILE is typically the output DVI or PDF file."
   :version "23.1"
   :group 'tex-run)
 
+(defun tex--quote-spec (fspec)
+  (cl-loop for (char . file) in fspec
+           collect (cons char (shell-quote-argument file))))
+
 (defun tex-format-cmd (format fspec)
   "Like `format-spec' but adds user-specified args to the command.
 Only applies the FSPEC to the args part of FORMAT."
+  (setq fspec (tex--quote-spec fspec))
   (if (not (string-match "\\([^ /\\]+\\) " format))
       (format-spec format fspec)
     (let* ((prefix (substring format 0 (match-beginning 0)))
@@ -2430,8 +2435,8 @@ Only applies the FSPEC to the args part of FORMAT."
            (prog1 (file-name-directory (expand-file-name file))
              (setq file (file-name-nondirectory file))))
          (root (file-name-sans-extension file))
-         (fspec (list (cons ?r (shell-quote-argument root))
-                      (cons ?f (shell-quote-argument file))))
+         (fspec (list (cons ?r root)
+                      (cons ?f file)))
          (default (tex-compile-default fspec)))
      (list default-directory
           (completing-read
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el
index c38787d..ed0a367 100644
--- a/lisp/textmodes/texinfmt.el
+++ b/lisp/textmodes/texinfmt.el
@@ -1,6 +1,6 @@
 ;;; texinfmt.el --- format Texinfo files into Info files
 
-;; Copyright (C) 1985-1986, 1988, 1990-1998, 2000-2020 Free Software
+;; Copyright (C) 1985-1986, 1988, 1990-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index b3bc634..7799cdb 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -1,6 +1,6 @@
 ;;; texinfo.el --- major mode for editing Texinfo files
 
-;; Copyright (C) 1985, 1988-1993, 1996-1997, 2000-2020 Free Software
+;; Copyright (C) 1985, 1988-1993, 1996-1997, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Robert J. Chassell
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el
index 78f8b27..ea35641 100644
--- a/lisp/textmodes/texnfo-upd.el
+++ b/lisp/textmodes/texnfo-upd.el
@@ -1,6 +1,6 @@
 ;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files
 
-;; Copyright (C) 1989-1992, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1989-1992, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Robert J. Chassell
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index c0b3c35..1432ab6 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -1,6 +1,6 @@
 ;;; text-mode.el --- text mode, and its idiosyncratic commands  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1985, 1992, 1994, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1985, 1992, 1994, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el
index 398f7fd..33a976a 100644
--- a/lisp/textmodes/tildify.el
+++ b/lisp/textmodes/tildify.el
@@ -1,6 +1,6 @@
 ;;; tildify.el --- adding hard spaces into texts -*- lexical-binding: t -*-
 
-;; Copyright (C) 1997-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
 ;; Author:     Milan Zamazal <pdm@zamazal.org>
 ;;             Michal Nazarewicz <mina86@mina86.com>
diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el
index 227e2df..36aad84 100644
--- a/lisp/textmodes/two-column.el
+++ b/lisp/textmodes/two-column.el
@@ -1,6 +1,6 @@
 ;;; two-column.el --- minor mode for editing of two-column text
 
-;; Copyright (C) 1992-1995, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1995, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>
 ;; Adapted-By: ESR, Daniel Pfeiffer
diff --git a/lisp/textmodes/underline.el b/lisp/textmodes/underline.el
index cfd5150..3f4e63a 100644
--- a/lisp/textmodes/underline.el
+++ b/lisp/textmodes/underline.el
@@ -1,6 +1,6 @@
 ;;; underline.el --- insert/remove underlining (done by overstriking) in Emacs 
 -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: wp
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 558a3fd..d3ba941 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -1,6 +1,6 @@
 ;;; thingatpt.el --- get the `thing' at point  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1991-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991-1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Mike Williams <mikew@gopher.dosli.govt.nz>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/thread.el b/lisp/thread.el
index 00a0084..efb058c 100644
--- a/lisp/thread.el
+++ b/lisp/thread.el
@@ -1,6 +1,6 @@
 ;;; thread.el --- Thread support in Emacs Lisp -*- lexical-binding: t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Gemini Lasswell <gazally@runbox.com>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/thumbs.el b/lisp/thumbs.el
index 3aa7ff0..7d6558d 100644
--- a/lisp/thumbs.el
+++ b/lisp/thumbs.el
@@ -1,6 +1,6 @@
 ;;; thumbs.el --- Thumbnails previewer for images files
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Jean-Philippe Theberge <jphiltheberge@videotron.ca>
 ;; Maintainer: emacs-devel@gnu.org
@@ -347,8 +347,7 @@ If MARKED is non-nil, the image is marked."
                   :conversion ,(if marked 'disabled)
                   :margin ,thumbs-margin)))
     (insert-image i)
-    (set (make-local-variable 'thumbs-current-image-size)
-         (image-size i t))))
+    (setq-local thumbs-current-image-size (image-size i t))))
 
 (defun thumbs-insert-thumb (img &optional marked)
   "Insert the thumbnail for IMG at point.
@@ -387,7 +386,7 @@ If MARKED is non-nil, the image is marked."
     (if dir (setq default-directory dir))
     (thumbs-do-thumbs-insertion list)
     (goto-char (point-min))
-    (set (make-local-variable 'thumbs-current-dir) default-directory)))
+    (setq-local thumbs-current-dir default-directory)))
 
 ;;;###autoload
 (defun thumbs-show-from-dir (dir &optional reg same-window)
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el
index c50d68b..b9eab95 100644
--- a/lisp/time-stamp.el
+++ b/lisp/time-stamp.el
@@ -1,6 +1,6 @@
 ;;; time-stamp.el --- Maintain last change time stamps in files edited by 
Emacs  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1989, 1993-1995, 1997, 2000-2020 Free Software
+;; Copyright (C) 1989, 1993-1995, 1997, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
diff --git a/lisp/time.el b/lisp/time.el
index eca9a07..1403c4a 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -1,6 +1,6 @@
 ;;; time.el --- display time, load and mail indicator in mode line of Emacs  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1987, 1993-1994, 1996, 2000-2020 Free Software
+;; Copyright (C) 1985-1987, 1993-1994, 1996, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/timezone.el b/lisp/timezone.el
index 8ba70f1..2c96343 100644
--- a/lisp/timezone.el
+++ b/lisp/timezone.el
@@ -1,6 +1,6 @@
-;;; timezone.el --- time zone package for GNU Emacs  -- lexical-binding: t -*-
+;;; timezone.el --- time zone package for GNU Emacs  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1990-1993, 1996, 1999, 2001-2020 Free Software
+;; Copyright (C) 1990-1993, 1996, 1999, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Masanobu Umeda <umerin@mse.kyutech.ac.jp>
diff --git a/lisp/tmm.el b/lisp/tmm.el
index 4c28557..e49246a 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -1,6 +1,6 @@
 ;;; tmm.el --- text mode access to menu-bar  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1994-1996, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1996, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Ilya Zakharevich <ilya@math.mps.ohio-state.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 8456216..6da4011 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -1,6 +1,6 @@
 ;;; tool-bar.el --- setting up the tool bar  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: mouse frames
@@ -159,7 +159,8 @@ To define items in any other map, use 
`tool-bar-local-item'."
                       ((< (display-color-cells) 256)
                        ',(list xpm-lo-spec xpm-spec pbm-spec xbm-spec))
                       (t
-                       ',(list xpm-spec pbm-spec xbm-spec))))))
+                       ',(list xpm-spec pbm-spec xbm-spec)))
+                 t)))
 
 ;;;###autoload
 (defun tool-bar-local-item (icon def key map &rest props)
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index ffc3d49..8e00aa5 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -1,6 +1,6 @@
 ;;; tooltip.el --- show tooltip windows  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1997, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Gerd Moellmann <gerd@acm.org>
 ;; Keywords: help c mouse tools
diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el
index 45d3f28..44b29bf 100644
--- a/lisp/tree-widget.el
+++ b/lisp/tree-widget.el
@@ -1,6 +1,6 @@
 ;;; tree-widget.el --- Tree widget  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: 16 Feb 2001
@@ -260,10 +260,9 @@ Typically it should contain something like this:
      \\='(:ascent center :mask (heuristic t)))"
   (or name (setq name (or tree-widget-theme "default")))
   (unless (string-equal name (tree-widget-theme-name))
-    (set (make-local-variable 'tree-widget--theme)
-         (make-vector 4 nil))
-      (tree-widget-set-parent-theme name)
-      (tree-widget-set-parent-theme "default")))
+    (setq-local tree-widget--theme (make-vector 4 nil))
+    (tree-widget-set-parent-theme name)
+    (tree-widget-set-parent-theme "default")))
 
 (defun tree-widget--locate-sub-directory (name path)
   "Locate all occurrences of the sub-directory NAME in PATH.
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
index d07737e..6bda1ab 100644
--- a/lisp/tutorial.el
+++ b/lisp/tutorial.el
@@ -1,6 +1,6 @@
 ;;; tutorial.el --- tutorial for Emacs
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: help, internal
@@ -50,6 +50,9 @@
   "Tutorial language.")
 (make-variable-buffer-local 'tutorial--lang)
 
+(defvar tutorial--buffer nil
+  "The selected tutorial buffer.")
+
 (defun tutorial--describe-nonstandard-key (value)
   "Give more information about a changed key binding.
 This is used in `help-with-tutorial'.  The information includes
@@ -655,6 +658,15 @@ with some explanatory links."
         (unless (eq prop-val 'key-sequence)
          (delete-region prop-start prop-end))))))
 
+(defun tutorial--save-on-kill ()
+  "Query the user about saving the tutorial when killing Emacs."
+  (when (buffer-live-p tutorial--buffer)
+    (with-current-buffer tutorial--buffer
+      (if (y-or-n-p "Save your position in the tutorial? ")
+         (tutorial--save-tutorial-to (tutorial--saved-file))
+       (message "Tutorial position not saved"))))
+  t)
+
 (defun tutorial--save-tutorial ()
   "Save the tutorial buffer.
 This saves the part of the tutorial before and after the area
@@ -802,6 +814,7 @@ Run the Viper tutorial? "))
       ;; (Re)build the tutorial buffer if it is not ok
       (unless old-tut-is-ok
         (switch-to-buffer (get-buffer-create tut-buf-name))
+        (setq tutorial--buffer (current-buffer))
         ;; (unless old-tut-buf (text-mode))
         (unless lang (error "Variable lang is nil"))
         (setq tutorial--lang lang)
@@ -814,6 +827,7 @@ Run the Viper tutorial? "))
         ;; a hook to save it when the buffer is killed.
         (setq buffer-auto-save-file-name nil)
         (add-hook 'kill-buffer-hook 'tutorial--save-tutorial nil t)
+        (add-hook 'kill-emacs-query-functions 'tutorial--save-on-kill)
 
         ;; Insert the tutorial. First offer to resume last tutorial
         ;; editing session.
diff --git a/lisp/type-break.el b/lisp/type-break.el
index a9ec19b..84c240c 100644
--- a/lisp/type-break.el
+++ b/lisp/type-break.el
@@ -1,6 +1,6 @@
 ;;; type-break.el --- encourage rests from typing at appropriate intervals  
-*- lexical-binding: t -*-
 
-;; Copyright (C) 1994-1995, 1997, 2000-2020 Free Software Foundation,
+;; Copyright (C) 1994-1995, 1997, 2000-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Noah Friedman <friedman@splode.com>
diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index e6a1b35..c1ec90e 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -1,6 +1,6 @@
 ;;; uniquify.el --- unique buffer names dependent on file name -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1989, 1995-1997, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1989, 1995-1997, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Dick King <king@reasoning.com>
diff --git a/lisp/url/ChangeLog.1 b/lisp/url/ChangeLog.1
index 0309440..5a3bf3a 100644
--- a/lisp/url/ChangeLog.1
+++ b/lisp/url/ChangeLog.1
@@ -3068,7 +3068,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1999, 2001-2002, 2004-2020 Free Software Foundation,
+  Copyright (C) 1999, 2001-2002, 2004-2021 Free Software Foundation,
   Inc.
 
   This file is part of GNU Emacs.
diff --git a/lisp/url/url-about.el b/lisp/url/url-about.el
index 5fe817c..bff5570 100644
--- a/lisp/url/url-about.el
+++ b/lisp/url/url-about.el
@@ -1,6 +1,6 @@
 ;;; url-about.el --- Show internal URLs
 
-;; Copyright (C) 2001, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index bcb48aa..f291414 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -1,6 +1,6 @@
 ;;; url-auth.el --- Uniform Resource Locator authorization modules -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el
index ea14e60..acf88eb 100644
--- a/lisp/url/url-cache.el
+++ b/lisp/url/url-cache.el
@@ -1,6 +1,6 @@
 ;;; url-cache.el --- Uniform Resource Locator retrieval tool
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
diff --git a/lisp/url/url-cid.el b/lisp/url/url-cid.el
index ace9714..d465cab 100644
--- a/lisp/url/url-cid.el
+++ b/lisp/url/url-cid.el
@@ -1,6 +1,6 @@
 ;;; url-cid.el --- Content-ID URL loader
 
-;; Copyright (C) 1998-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes
 
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el
index e185a79..085159c 100644
--- a/lisp/url/url-cookie.el
+++ b/lisp/url/url-cookie.el
@@ -1,6 +1,6 @@
 ;;; url-cookie.el --- URL cookie support  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el
index 3cd34b5..12d5a68 100644
--- a/lisp/url/url-dav.el
+++ b/lisp/url/url-dav.el
@@ -1,6 +1,6 @@
 ;;; url-dav.el --- WebDAV support
 
-;; Copyright (C) 2001, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/url/url-dired.el b/lisp/url/url-dired.el
index fa75a0a..398113d 100644
--- a/lisp/url/url-dired.el
+++ b/lisp/url/url-dired.el
@@ -1,6 +1,6 @@
 ;;; url-dired.el --- URL Dired minor mode  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, files
 
diff --git a/lisp/url/url-domsuf.el b/lisp/url/url-domsuf.el
index c1cdf90..59d70cb 100644
--- a/lisp/url/url-domsuf.el
+++ b/lisp/url/url-domsuf.el
@@ -1,6 +1,6 @@
 ;;; url-domsuf.el --- Say what domain names can have cookies set.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 
diff --git a/lisp/url/url-expand.el b/lisp/url/url-expand.el
index 9f52f25..a42b4c7 100644
--- a/lisp/url/url-expand.el
+++ b/lisp/url/url-expand.el
@@ -1,6 +1,6 @@
 ;;; url-expand.el --- expand-file-name for URLs -*- lexical-binding: t -*-
 
-;; Copyright (C) 1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes
 
diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el
index eec7cdf..52a9588 100644
--- a/lisp/url/url-file.el
+++ b/lisp/url/url-file.el
@@ -1,6 +1,6 @@
 ;;; url-file.el --- File retrieval code  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes
 
diff --git a/lisp/url/url-ftp.el b/lisp/url/url-ftp.el
index 50b21bd..3cda29a 100644
--- a/lisp/url/url-ftp.el
+++ b/lisp/url/url-ftp.el
@@ -1,6 +1,6 @@
 ;;; url-ftp.el --- FTP wrapper  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes
 
diff --git a/lisp/url/url-future.el b/lisp/url/url-future.el
index e48ad3c..c573317 100644
--- a/lisp/url/url-future.el
+++ b/lisp/url/url-future.el
@@ -1,6 +1,6 @@
 ;;; url-future.el --- general futures facility for url.el -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Teodor Zlatanov <tzz@lifelogs.com>
 ;; Keywords: data
diff --git a/lisp/url/url-gw.el b/lisp/url/url-gw.el
index f16fc23..68df67f 100644
--- a/lisp/url/url-gw.el
+++ b/lisp/url/url-gw.el
@@ -1,6 +1,6 @@
 ;;; url-gw.el --- Gateway munging for URL loading
 
-;; Copyright (C) 1997-1998, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el
index 1c3607b..68556d6 100644
--- a/lisp/url/url-handlers.el
+++ b/lisp/url/url-handlers.el
@@ -1,6 +1,6 @@
 ;;; url-handlers.el --- file-name-handler stuff for URL loading  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
@@ -299,8 +299,8 @@ BUFFER should be a complete URL buffer as returned by 
`url-retrieve'.
 If the headers specify a coding-system (and current buffer is multibyte),
 it is applied to the body before it is inserted.
 Returns a list of the form (SIZE CHARSET), where SIZE is the size in bytes
-of the inserted text and CHARSET is the charset that was specified in the 
header,
-or nil if none was found.
+of the inserted text and CHARSET is the charset that was specified in the
+header, or nil if none was found.
 BEG and END can be used to only insert a subpart of the body.
 They count bytes from the beginning of the body."
   (let* ((handle (with-current-buffer buffer (mm-dissect-buffer t)))
diff --git a/lisp/url/url-history.el b/lisp/url/url-history.el
index 9942e6c..10238a4 100644
--- a/lisp/url/url-history.el
+++ b/lisp/url/url-history.el
@@ -1,6 +1,6 @@
 ;;; url-history.el --- Global history tracking for URL package  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 1271b9b..324cf99 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -1,6 +1,6 @@
 ;;; url-http.el --- HTTP retrieval routines  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999, 2001, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001, 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/url/url-imap.el b/lisp/url/url-imap.el
index 4ac22f5..05c3e73 100644
--- a/lisp/url/url-imap.el
+++ b/lisp/url/url-imap.el
@@ -1,6 +1,6 @@
 ;;; url-imap.el --- IMAP retrieval routines
 
-;; Copyright (C) 1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <jas@pdc.kth.se>
 ;; Keywords: comm, data, processes
diff --git a/lisp/url/url-irc.el b/lisp/url/url-irc.el
index 3ff6e64..c895144 100644
--- a/lisp/url/url-irc.el
+++ b/lisp/url/url-irc.el
@@ -1,6 +1,6 @@
 ;;; url-irc.el --- IRC URL interface  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes
 
diff --git a/lisp/url/url-ldap.el b/lisp/url/url-ldap.el
index a64515f..0fa9970 100644
--- a/lisp/url/url-ldap.el
+++ b/lisp/url/url-ldap.el
@@ -1,6 +1,6 @@
 ;;; url-ldap.el --- LDAP Uniform Resource Locator retrieval code
 
-;; Copyright (C) 1998-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes
 
diff --git a/lisp/url/url-mailto.el b/lisp/url/url-mailto.el
index 67707e9..688f102 100644
--- a/lisp/url/url-mailto.el
+++ b/lisp/url/url-mailto.el
@@ -1,6 +1,6 @@
 ;;; url-mail.el --- Mail Uniform Resource Locator retrieval code
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes
 
diff --git a/lisp/url/url-methods.el b/lisp/url/url-methods.el
index bcea050..7aad741 100644
--- a/lisp/url/url-methods.el
+++ b/lisp/url/url-methods.el
@@ -1,6 +1,6 @@
 ;;; url-methods.el --- Load URL schemes as needed
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
diff --git a/lisp/url/url-misc.el b/lisp/url/url-misc.el
index 587bde5..d3db31d 100644
--- a/lisp/url/url-misc.el
+++ b/lisp/url/url-misc.el
@@ -1,6 +1,6 @@
 ;;; url-misc.el --- Misc Uniform Resource Locator retrieval code
 
-;; Copyright (C) 1996-1999, 2002, 2004-2020 Free Software Foundation,
+;; Copyright (C) 1996-1999, 2002, 2004-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Keywords: comm, data, processes
diff --git a/lisp/url/url-news.el b/lisp/url/url-news.el
index 78a6aa9..d5f8483 100644
--- a/lisp/url/url-news.el
+++ b/lisp/url/url-news.el
@@ -1,6 +1,6 @@
 ;;; url-news.el --- News Uniform Resource Locator retrieval code
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes
 
diff --git a/lisp/url/url-nfs.el b/lisp/url/url-nfs.el
index f8efd12..3c80c80 100644
--- a/lisp/url/url-nfs.el
+++ b/lisp/url/url-nfs.el
@@ -1,6 +1,6 @@
 ;;; url-nfs.el --- NFS URL interface
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes
 
diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el
index b1588de..cd332f5 100644
--- a/lisp/url/url-parse.el
+++ b/lisp/url/url-parse.el
@@ -1,6 +1,6 @@
 ;;; url-parse.el --- Uniform Resource Locator parser -*- lexical-binding: t -*-
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes
 
diff --git a/lisp/url/url-privacy.el b/lisp/url/url-privacy.el
index 716e310..e3ca0f6 100644
--- a/lisp/url/url-privacy.el
+++ b/lisp/url/url-privacy.el
@@ -1,6 +1,6 @@
 ;;; url-privacy.el --- Global history tracking for URL package
 
-;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
diff --git a/lisp/url/url-proxy.el b/lisp/url/url-proxy.el
index 698a870..6bf6584 100644
--- a/lisp/url/url-proxy.el
+++ b/lisp/url/url-proxy.el
@@ -1,6 +1,6 @@
 ;;; url-proxy.el --- Proxy server support
 
-;; Copyright (C) 1999, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2004-2021 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
@@ -59,7 +59,7 @@
      ((string-match "^socks +" proxy)
       (concat "socks://" (substring proxy (match-end 0))))
      (t
-      (display-warning 'url (format "Unknown proxy directive: %s" proxy) 
'critical)
+      (display-warning 'url (format "Unknown proxy directive: %s" proxy) 
:error)
       nil))))
 
 (autoload 'url-http "url-http")
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index 46cdff0..0923731 100644
--- a/lisp/url/url-queue.el
+++ b/lisp/url/url-queue.el
@@ -1,6 +1,6 @@
 ;;; url-queue.el --- Fetching web pages in parallel   -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: comm
diff --git a/lisp/url/url-tramp.el b/lisp/url/url-tramp.el
index 3757a68..325d25c 100644
--- a/lisp/url/url-tramp.el
+++ b/lisp/url/url-tramp.el
@@ -1,6 +1,6 @@
 ;;; url-tramp.el --- file-name-handler magic invoking Tramp for some protocols
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, data, processes, hypermedia
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index bd9543b..7c913bc 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -1,6 +1,6 @@
 ;;; url-util.el --- Miscellaneous helper routines for URL library -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1996-1999, 2001, 2004-2020 Free Software Foundation,
+;; Copyright (C) 1996-1999, 2001, 2004-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el
index f9dce24..6493abf 100644
--- a/lisp/url/url-vars.el
+++ b/lisp/url/url-vars.el
@@ -1,6 +1,6 @@
 ;;; url-vars.el --- Variables for Uniform Resource Locator tool  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1996-1999, 2001, 2004-2020 Free Software Foundation,
+;; Copyright (C) 1996-1999, 2001, 2004-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
diff --git a/lisp/url/url.el b/lisp/url/url.el
index 5188007..172a3af 100644
--- a/lisp/url/url.el
+++ b/lisp/url/url.el
@@ -1,6 +1,6 @@
 ;;; url.el --- Uniform Resource Locator retrieval tool  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 1996-1999, 2001, 2004-2020 Free Software Foundation,
+;; Copyright (C) 1996-1999, 2001, 2004-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
diff --git a/lisp/userlock.el b/lisp/userlock.el
index ec76322..a340ff8 100644
--- a/lisp/userlock.el
+++ b/lisp/userlock.el
@@ -1,6 +1,6 @@
 ;;; userlock.el --- handle file access contention between multiple users
 
-;; Copyright (C) 1985-1986, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Richard King
 ;; (according to authors.el)
@@ -159,7 +159,7 @@ really edit the buffer? (y, n, r or C-h) "
        (message "%s" prompt)
        (error "Cannot resolve conflict in batch mode"))
       (while (null answer)
-       (setq answer (read-char-from-minibuffer prompt choices))
+       (setq answer (read-char-choice prompt choices))
        (cond ((memq answer '(?? ?\C-h))
               (ask-user-about-supersession-help)
               (setq answer nil))
diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el
index e177a5a..19765e0 100644
--- a/lisp/vc/add-log.el
+++ b/lisp/vc/add-log.el
@@ -1,6 +1,6 @@
 ;;; add-log.el --- change log maintenance commands for Emacs
 
-;; Copyright (C) 1985-1986, 1988, 1993-1994, 1997-1998, 2000-2020 Free
+;; Copyright (C) 1985-1986, 1988, 1993-1994, 1997-1998, 2000-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/vc/compare-w.el b/lisp/vc/compare-w.el
index c7da894..932dcd7 100644
--- a/lisp/vc/compare-w.el
+++ b/lisp/vc/compare-w.el
@@ -1,6 +1,6 @@
 ;;; compare-w.el --- compare text between windows for Emacs
 
-;; Copyright (C) 1986, 1989, 1993, 1997, 2001-2020 Free Software
+;; Copyright (C) 1986, 1989, 1993, 1997, 2001-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/vc/cvs-status.el b/lisp/vc/cvs-status.el
index 093c17b..ff3a294 100644
--- a/lisp/vc/cvs-status.el
+++ b/lisp/vc/cvs-status.el
@@ -1,6 +1,6 @@
 ;;; cvs-status.el --- major mode for browsing `cvs status' output -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs cvs status tree vc tools
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index bf83601..7a47420 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1,6 +1,6 @@
 ;;; diff-mode.el --- a mode for viewing/editing context diffs -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: convenience patch diff vc
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el
index e43801a..7c4931b 100644
--- a/lisp/vc/diff.el
+++ b/lisp/vc/diff.el
@@ -1,6 +1,6 @@
 ;;; diff.el --- run `diff'  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1992, 1994, 1996, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1992, 1994, 1996, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Frank Bresz
diff --git a/lisp/vc/ediff-diff.el b/lisp/vc/ediff-diff.el
index ccf5a78..e90eaa1 100644
--- a/lisp/vc/ediff-diff.el
+++ b/lisp/vc/ediff-diff.el
@@ -1,6 +1,6 @@
 ;;; ediff-diff.el --- diff-related utilities  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
@@ -149,7 +149,7 @@ This variable can be set either in .emacs or toggled 
interactively.
 Use `setq-default' if setting it in .emacs")
 
 (ediff-defvar-local ediff-ignore-similar-regions nil
-  "If t, skip over difference regions that differ only in the white space and 
line breaks.
+  "If t, skip difference regions that differ only in white space and line 
breaks.
 This variable can be set either in .emacs or toggled interactively.
 Use `setq-default' if setting it in .emacs")
 
diff --git a/lisp/vc/ediff-help.el b/lisp/vc/ediff-help.el
index 57cb001..84bf063 100644
--- a/lisp/vc/ediff-help.el
+++ b/lisp/vc/ediff-help.el
@@ -1,6 +1,6 @@
 ;;; ediff-help.el --- Code related to the contents of Ediff help buffers  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
diff --git a/lisp/vc/ediff-hook.el b/lisp/vc/ediff-hook.el
index ed29da1..ff48bb3 100644
--- a/lisp/vc/ediff-hook.el
+++ b/lisp/vc/ediff-hook.el
@@ -1,6 +1,6 @@
 ;;; ediff-hook.el --- setup for Ediff's menus and autoloads  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index 04926af..0865ac5 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -1,6 +1,6 @@
 ;;; ediff-init.el --- Macros, variables, and defsubsts used by Ediff  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
@@ -432,7 +432,7 @@ Can be used to move the frame where it is desired."
   :type 'hook
   :group 'ediff-hook)
 (defcustom ediff-startup-hook nil
-  "Hooks to run in the control buffer after Ediff has been set up and is ready 
for the job."
+  "Hooks to run in the control buffer after Ediff has been set up and is 
ready."
   :type 'hook
   :group 'ediff-hook)
 (defcustom ediff-select-hook nil
@@ -480,7 +480,7 @@ set local variables that determine how the display looks 
like."
   :type 'hook
   :group 'ediff-hook)
 (defcustom ediff-cleanup-hook nil
-  "Hooks to run on exiting Ediff but before killing the control and variant 
buffers."
+  "Hooks to run on exiting Ediff, before killing the control and variant 
buffers."
   :type 'hook
   :group 'ediff-hook)
 
@@ -554,19 +554,19 @@ See the documentation string of 
`ediff-focus-on-regexp-matches' for details.")
 
 ;; Highlighting
 (defcustom ediff-before-flag-bol "->>"
-  "Flag placed before a highlighted block of differences, if block starts at 
beginning of a line."
+  "Flag placed before highlighted block of differences at beginning of a line."
   :type 'string
   :tag  "Region before-flag at beginning of line"
   :group 'ediff)
 
 (defcustom ediff-after-flag-eol "<<-"
-  "Flag placed after a highlighted block of differences, if block ends at end 
of a line."
+  "Flag placed after highlighted block of differences that ends at end of 
line."
   :type 'string
   :tag  "Region after-flag at end of line"
   :group 'ediff)
 
 (defcustom ediff-before-flag-mol "->>"
-  "Flag placed before a highlighted block of differences, if block starts in 
mid-line."
+  "Flag placed before highlighted block of differences that starts mid-line."
   :type 'string
   :tag  "Region before-flag in the middle of line"
   :group 'ediff)
@@ -1268,7 +1268,7 @@ Instead, C-h would jump to previous difference."
 ;; Metacharacters that have to be protected from the shell when executing
 ;; a diff/diff3 command.
 (defcustom ediff-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]"
-  "Regexp that matches characters that must be quoted with `\\' in shell 
command line.
+  "Regexp matching characters that must be quoted with `\\' in shell command 
line.
 This default should work without changes."
   :type 'regexp
   :group 'ediff)
diff --git a/lisp/vc/ediff-merg.el b/lisp/vc/ediff-merg.el
index 2265676..826cad9 100644
--- a/lisp/vc/ediff-merg.el
+++ b/lisp/vc/ediff-merg.el
@@ -1,6 +1,6 @@
 ;;; ediff-merg.el --- merging utilities  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
@@ -70,7 +70,7 @@ STRING4
   :group 'ediff-merge)
 
 (defcustom ediff-show-clashes-only nil
-  "If t, show only those diff regions where both buffers disagree with the 
ancestor.
+  "If t, show only diff regions where both buffers disagree with the ancestor.
 This means that regions that have status prefer-A or prefer-B will be
 skipped over.  A value of nil means show all regions."
   :type 'boolean
diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el
index b483778..d32c18b 100644
--- a/lisp/vc/ediff-mult.el
+++ b/lisp/vc/ediff-mult.el
@@ -1,6 +1,6 @@
 ;;; ediff-mult.el --- support for multi-file/multi-buffer processing in Ediff  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 1995-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
@@ -181,7 +181,7 @@ directories.")
 (defvar ediff-filtering-regexp-history nil "")
 
 (defcustom ediff-default-filtering-regexp nil
-  "The default regular expression used as a filename filter in multifile 
comparisons.
+  "Default regular expression used as a filename filter in multifile 
comparisons.
 Should be a sexp.  For instance (car ediff-filtering-regexp-history) or nil."
   :type 'sexp                           ; yuck - why not just a regexp?
   :risky t)
diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el
index 08640fc..d52910e 100644
--- a/lisp/vc/ediff-ptch.el
+++ b/lisp/vc/ediff-ptch.el
@@ -1,6 +1,6 @@
 ;;; ediff-ptch.el --- Ediff's  patch support  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1996-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
@@ -465,6 +465,9 @@ are two possible targets for this %spatch.  However, these 
files do not exist."
                                     file1 file2 (if multi-patch-p "multi-" 
""))))
                    (princ "
 \nPlease enter an alternative patch target ...\n"))
+                  (when (and (string= file1 file2)
+                             (y-or-n-p (format "Create %s?" file1)))
+                    (write-region (point-min) (point-min) file1))
                  (let ((directory t)
                        target)
                    (while directory
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index 73c39b6..f955ba8 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -1,6 +1,6 @@
 ;;; ediff-util.el --- the core commands and utilities of ediff  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
@@ -3443,8 +3443,8 @@ Without an argument, it saves customized diff argument, 
if available
 
 (defun ediff-inferior-compare-regions ()
   "Compare regions in an active Ediff session.
-Like `ediff-regions-linewise' but is called from under an active Ediff session 
on
-the files that belong to that session.
+Like `ediff-regions-linewise' but is called from under an active Ediff session
+on the files that belong to that session.
 
 After quitting the session invoked via this function, type C-l to the parent
 Ediff Control Panel to restore highlighting."
diff --git a/lisp/vc/ediff-vers.el b/lisp/vc/ediff-vers.el
index 4ee7ee5..13a653b 100644
--- a/lisp/vc/ediff-vers.el
+++ b/lisp/vc/ediff-vers.el
@@ -1,6 +1,6 @@
 ;;; ediff-vers.el --- version control interface to Ediff  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1995-1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1997, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el
index c68dc71..72b3458 100644
--- a/lisp/vc/ediff-wind.el
+++ b/lisp/vc/ediff-wind.el
@@ -1,6 +1,6 @@
 ;;; ediff-wind.el --- window manipulation utilities  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1994-1997, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1997, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
@@ -182,7 +182,7 @@ Used internally---not a user option.")
 
 ;; not used for now
 (defvar ediff-mouse-pixel-threshold 30
-  "If the user moves mouse more than this many pixels, Ediff won't warp mouse 
into control window.")
+  "If mouse moved more than this many pixels, don't warp mouse into control 
window.")
 
 (defcustom ediff-grab-mouse t
   "If t, Ediff will always grab the mouse and put it in the control frame.
diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el
index ae2f8ad..e3612dd 100644
--- a/lisp/vc/ediff.el
+++ b/lisp/vc/ediff.el
@@ -1,6 +1,6 @@
 ;;; ediff.el --- a comprehensive visual interface to diff & patch  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1994-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Created: February 2, 1994
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index feafe5f..56b3166 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -1,6 +1,6 @@
 ;;; log-edit.el --- Major mode for editing CVS commit messages -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs cvs commit log vc
@@ -387,7 +387,8 @@ The first subexpression is the actual text of the field.")
          nil lax))
      ("^\n"
       (progn (goto-char (match-end 0)) (1+ (match-end 0))) nil
-      (0 '(:height 0.1 :inverse-video t :extend t))))
+      (0 '(face (:height 0.1 :inverse-video t :extend t)
+           display-line-numbers-disable t rear-nonsticky t))))
     (log-edit--match-first-line (0 'log-edit-summary))))
 
 (defvar log-edit-font-lock-gnu-style nil
@@ -490,6 +491,9 @@ commands (under C-x v for VC, for example).
 
 \\{log-edit-mode-map}"
   (setq-local font-lock-defaults '(log-edit-font-lock-keywords t))
+  (make-local-variable 'font-lock-extra-managed-props)
+  (cl-pushnew 'rear-nonsticky font-lock-extra-managed-props)
+  (cl-pushnew 'display-line-numbers-disable font-lock-extra-managed-props)
   (setq-local jit-lock-contextually t)  ;For the "first line is summary".
   (setq-local fill-paragraph-function #'log-edit-fill-entry)
   (make-local-variable 'log-edit-comment-ring-index)
@@ -983,16 +987,17 @@ where LOGBUFFER is the name of the ChangeLog buffer, and 
each
                (visiting-buffer (find-buffer-visiting file)))
            ;; If there is a buffer visiting FILE, and it has a local
            ;; value for `change-log-default-name', use that.
-           (if (and visiting-buffer
+           (or (and visiting-buffer
                     (local-variable-p 'change-log-default-name
-                                      visiting-buffer))
-               (with-current-buffer visiting-buffer
-                 change-log-default-name)
-             ;; `find-change-log' uses `change-log-default-name' if set
-             ;; and sets it before exiting, so we need to work around
-             ;; that memoizing which is undesired here.
-             (setq change-log-default-name nil)
-             (find-change-log)))))
+                                      visiting-buffer)
+                    (with-current-buffer visiting-buffer
+                      change-log-default-name))
+               ;; `find-change-log' uses `change-log-default-name' if set
+               ;; and sets it before exiting, so we need to work around
+               ;; that memoizing which is undesired here.
+               (progn
+                 (setq change-log-default-name nil)
+                 (find-change-log))))))
     (when (or (find-buffer-visiting changelog-file-name)
               (file-exists-p changelog-file-name)
               add-log-dont-create-changelog-file)
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index 87e662c..e893097 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -1,6 +1,6 @@
 ;;; log-view.el --- Major mode for browsing revision log histories -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: tools, vc
diff --git a/lisp/vc/pcvs-defs.el b/lisp/vc/pcvs-defs.el
index e558292..2ee3da7 100644
--- a/lisp/vc/pcvs-defs.el
+++ b/lisp/vc/pcvs-defs.el
@@ -1,6 +1,6 @@
 ;;; pcvs-defs.el --- variable definitions for PCL-CVS
 
-;; Copyright (C) 1991-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs
diff --git a/lisp/vc/pcvs-info.el b/lisp/vc/pcvs-info.el
index 9f8a168..e119717 100644
--- a/lisp/vc/pcvs-info.el
+++ b/lisp/vc/pcvs-info.el
@@ -1,6 +1,6 @@
 ;;; pcvs-info.el --- internal representation of a fileinfo entry
 
-;; Copyright (C) 1991-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs
diff --git a/lisp/vc/pcvs-parse.el b/lisp/vc/pcvs-parse.el
index dd56aec..4381650 100644
--- a/lisp/vc/pcvs-parse.el
+++ b/lisp/vc/pcvs-parse.el
@@ -1,6 +1,6 @@
 ;;; pcvs-parse.el --- the CVS output parser
 
-;; Copyright (C) 1991-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs
diff --git a/lisp/vc/pcvs-util.el b/lisp/vc/pcvs-util.el
index 4570398..57da7bf 100644
--- a/lisp/vc/pcvs-util.el
+++ b/lisp/vc/pcvs-util.el
@@ -1,6 +1,6 @@
 ;;; pcvs-util.el --- utility functions for PCL-CVS
 
-;; Copyright (C) 1991-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs
diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el
index 0fd5cee..1a42c67 100644
--- a/lisp/vc/pcvs.el
+++ b/lisp/vc/pcvs.el
@@ -1,6 +1,6 @@
 ;;; pcvs.el --- a front-end to CVS  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1991-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2021 Free Software Foundation, Inc.
 
 ;; Author: The PCL-CVS Trust <pcl-cvs@cyclic.com>
 ;;     Per Cederqvist <ceder@lysator.liu.se>
diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index 13f875b..3b09dfe 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -1,6 +1,6 @@
 ;;; smerge-mode.el --- Minor mode to resolve diff3 conflicts -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: vc, tools, revision control, merge, diff3, cvs, conflict
@@ -925,7 +925,7 @@ Its behavior has mainly two restrictions:
   This only matters if `smerge-refine-weight-hack' is nil.")
 
 (defvar smerge-refine-ignore-whitespace t
-  "If non-nil, indicate that `smerge-refine' should try to ignore change in 
whitespace.")
+  "If non-nil, `smerge-refine' should try to ignore change in whitespace.")
 
 (defvar smerge-refine-weight-hack t
   "If non-nil, pass to diff as many lines as there are chars in the region.
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index 43d43e9..b0435ab 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -1,6 +1,6 @@
 ;;; vc-annotate.el --- VC Annotate Support  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1997-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Martin Lorentzson <emwson@emw.ericsson.se>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 5eee7f6..e4eff48 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -1,6 +1,6 @@
 ;;; vc-bzr.el --- VC backend for the bzr revision control system  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;;        Riccardo Murri <riccardo.murri@gmail.com>
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el
index fdbf44e..a595cc9 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -1,6 +1,6 @@
 ;;; vc-cvs.el --- non-resident support for CVS version-control  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1995, 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF (see vc.el for full credits)
 ;; Package: vc
diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el
index d453cb4..88f46ef 100644
--- a/lisp/vc/vc-dav.el
+++ b/lisp/vc/vc-dav.el
@@ -1,6 +1,6 @@
 ;;; vc-dav.el --- vc.el support for WebDAV
 
-;; Copyright (C) 2001, 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
 ;; Keywords: url, vc
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index f576fcf..bbb7324 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1,6 +1,6 @@
 ;;; vc-dir.el --- Directory status display under VC  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Dan Nicolaescu <dann@ics.uci.edu>
 ;; Keywords: vc tools
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index 4cc6fdd..6b17f2a 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -1,6 +1,6 @@
 ;;; vc-dispatcher.el -- generic command-dispatcher facility.  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF (see below for full credits)
 ;; Keywords: vc tools
diff --git a/lisp/vc/vc-filewise.el b/lisp/vc/vc-filewise.el
index 67c696c..ee73aa6 100644
--- a/lisp/vc/vc-filewise.el
+++ b/lisp/vc/vc-filewise.el
@@ -1,6 +1,6 @@
 ;;; vc-filewise.el --- common functions for file-oriented back ends.
 
-;; Copyright (C) 1992-1996, 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1996, 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF (see vc.el for full credits)
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 84c964e..a9ee28e 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1,6 +1,6 @@
 ;;; vc-git.el --- VC backend for the git version control system -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Alexandre Julliard <julliard@winehq.org>
 ;; Keywords: vc tools
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index e7f67e9..c4b82ab 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -1,6 +1,6 @@
 ;;; vc-hg.el --- VC backend for the mercurial version control system  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; Author: Ivan Kanis
 ;; Maintainer: emacs-devel@gnu.org
@@ -276,13 +276,12 @@ If `ask', you will be prompted for a branch type."
         ((eq state ?C) 'up-to-date) ;; Older mercurial versions use this.
         (t 'up-to-date))))))
 
-(defun vc-hg-working-revision (file)
+(defun vc-hg-working-revision (_file)
   "Hg-specific version of `vc-working-revision'."
-  (or (ignore-errors
-        (with-output-to-string
-          (vc-hg-command standard-output 0 file
-                         "parent" "--template" "{rev}")))
-      "0"))
+  (ignore-errors
+    (with-output-to-string
+      (vc-hg-command standard-output 0 nil
+                     "log" "-r" "." "--template" "{rev}"))))
 
 (defcustom vc-hg-symbolic-revision-styles
   '(builtin-active-bookmark
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index 07bec8e..f910f9d 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -1,6 +1,6 @@
 ;;; vc-hooks.el --- resident support for version-control  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1992-1996, 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1996, 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF (see vc.el for full credits)
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index 7797d19..3b610a1 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -1,6 +1,6 @@
 ;;; vc-mtn.el --- VC backend for Monotone  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: vc
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index 23f088b..8d64ee5 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -1,6 +1,6 @@
 ;;; vc-rcs.el --- support for RCS version-control  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF (see vc.el for full credits)
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el
index ba50c36..3d3f404 100644
--- a/lisp/vc/vc-sccs.el
+++ b/lisp/vc/vc-sccs.el
@@ -1,6 +1,6 @@
 ;;; vc-sccs.el --- support for SCCS version-control  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF (see vc.el for full credits)
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el
index 4eb6389..201d69d 100644
--- a/lisp/vc/vc-src.el
+++ b/lisp/vc/vc-src.el
@@ -1,6 +1,6 @@
 ;;; vc-src.el --- support for SRC version-control  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1992-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF (see vc.el for full credits)
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 5ea2a41..da54711 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -1,6 +1,6 @@
 ;;; vc-svn.el --- non-resident support for Subversion version-control  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Stefan Monnier <monnier@gnu.org>
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index f268f91..6c96d8c 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1,6 +1,6 @@
 ;;; vc.el --- drive a version-control system from within Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1992-1998, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1998, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: FSF (see below for full credits)
 ;; Maintainer: emacs-devel@gnu.org
@@ -201,7 +201,7 @@
 ;;
 ;; STATE-CHANGING FUNCTIONS
 ;;
-;; * create-repo (backend)
+;; * create-repo ()
 ;;
 ;;   Create an empty repository in the current directory and initialize
 ;;   it so VC mode can add files to it.  For file-oriented systems, this
@@ -275,7 +275,7 @@
 ;;   If FILE is in the `added' state it should be returned to the
 ;;   `unregistered' state.
 ;;
-;; - merge-file (file rev1 rev2)
+;; - merge-file (file &optional rev1 rev2)
 ;;
 ;;   Merge the changes between REV1 and REV2 into the current working
 ;;   file (for non-distributed VCS).  It is expected that with an
@@ -333,19 +333,19 @@
 ;;   the case).  Not all backends support this.  At present, this is
 ;;   only ever used with LIMIT = 1 (by vc-annotate-show-log-revision-at-line).
 ;;
-;; * log-outgoing (backend remote-location)
+;; * log-outgoing (buffer remote-location)
 ;;
 ;;   Insert in BUFFER the revision log for the changes that will be
 ;;   sent when performing a push operation to REMOTE-LOCATION.
 ;;
-;; * log-incoming (backend remote-location)
+;; * log-incoming (buffer remote-location)
 ;;
 ;;   Insert in BUFFER the revision log for the changes that will be
 ;;   received when performing a pull operation from REMOTE-LOCATION.
 ;;
-;; - log-search (pattern)
+;; - log-search (buffer pattern)
 ;;
-;;   Search for PATTERN in the revision log.
+;;   Search for PATTERN in the revision log and output results into BUFFER.
 ;;
 ;; - log-view-mode ()
 ;;
@@ -478,7 +478,7 @@
 ;;
 ;;   Return the root of the VC controlled hierarchy for file.
 ;;
-;; - ignore (file &optional directory)
+;; - ignore (file &optional directory remove)
 ;;
 ;;   Ignore FILE under DIRECTORY (default is 'default-directory').
 ;;   FILE is a file wildcard relative to DIRECTORY.
@@ -487,7 +487,7 @@
 ;;   When called from Lisp code, if DIRECTORY is non-nil, the
 ;;   repository to use will be deduced by DIRECTORY.
 ;;
-;; - ignore-completion-table
+;; - ignore-completion-table (directory)
 ;;
 ;;   Return the completion table for files ignored by the current
 ;;   version control system, e.g., the entries in `.gitignore' and
@@ -2325,7 +2325,8 @@ checked out in that new branch."
          ;; to ask for a directory, branches are created at repository level.
          default-directory
        (read-directory-name "Directory: " default-directory default-directory 
t))
-      (read-string (if current-prefix-arg "New branch name: " "New tag name: 
"))
+      (read-string (if current-prefix-arg "New branch name: " "New tag name: ")
+                   nil 'vc-revision-history)
       current-prefix-arg)))
   (message "Making %s... " (if branchp "branch" "tag"))
   (when (file-directory-p dir) (setq dir (file-name-as-directory dir)))
@@ -2385,8 +2386,9 @@ This function runs the hook `vc-retrieve-tag-hook' when 
finished."
 ;; for the root directory.
 (defvar vc-log-short-style '(directory)
   "Whether or not to show a short log.
-If it contains `directory' then if the fileset contains a directory show a 
short log.
-If it contains `file' then show short logs for files.
+If it contains `directory', show a short log if the fileset
+contains a directory.
+If it contains `file', show short logs for files.
 Not all VC backends support short logs!")
 
 (defvar log-view-vc-fileset)
diff --git a/lisp/vcursor.el b/lisp/vcursor.el
index e5e9f06..e699df4 100644
--- a/lisp/vcursor.el
+++ b/lisp/vcursor.el
@@ -1,6 +1,6 @@
 ;;; vcursor.el --- manipulate an alternative ("virtual") cursor
 
-;; Copyright (C) 1994, 1996, 1998, 2001-2020 Free Software Foundation,
+;; Copyright (C) 1994, 1996, 1998, 2001-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Peter Stephenson <pws@ibmth.df.unipi.it>
diff --git a/lisp/version.el b/lisp/version.el
index b247232..fcfc2f8 100644
--- a/lisp/version.el
+++ b/lisp/version.el
@@ -1,6 +1,6 @@
 ;;; version.el --- record version number of Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985, 1992, 1994-1995, 1999-2020 Free Software
+;; Copyright (C) 1985, 1992, 1994-1995, 1999-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/view.el b/lisp/view.el
index 6f576f8..5a2f2fa 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -1,6 +1,6 @@
 ;;; view.el --- peruse file or buffer without editing
 
-;; Copyright (C) 1985, 1989, 1994-1995, 1997, 2000-2020 Free Software
+;; Copyright (C) 1985, 1989, 1994-1995, 1997, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: K. Shane Hartman
@@ -141,7 +141,8 @@ See RETURN-TO-ALIST argument of function `view-mode-exit' 
for the format of
 (put 'view-return-to-alist 'permanent-local t)
 
 (defvar view-exit-action nil
-  "If non-nil, a function with one argument (a buffer) called when finished 
viewing.
+  "If non-nil, a function called when finished viewing.
+The function should take one argument (a buffer).
 Commands like \\[view-file] and \\[view-file-other-window] may
 set this to bury or kill the viewed buffer.
 Observe that the buffer viewed might not appear in any window at
diff --git a/lisp/vt-control.el b/lisp/vt-control.el
index d4c1419..0bd5132 100644
--- a/lisp/vt-control.el
+++ b/lisp/vt-control.el
@@ -1,6 +1,6 @@
 ;;; vt-control.el --- Common VTxxx control functions  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Rob Riepel <riepel@networking.stanford.edu>
 ;; Keywords: terminals
diff --git a/lisp/vt100-led.el b/lisp/vt100-led.el
index 1e81dd2..117bef7 100644
--- a/lisp/vt100-led.el
+++ b/lisp/vt100-led.el
@@ -1,6 +1,6 @@
 ;;; vt100-led.el --- functions for LED control on VT-100 terminals & clones  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 1988, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Howard Gayle
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el
index e159d18..3da24c8 100644
--- a/lisp/w32-fns.el
+++ b/lisp/w32-fns.el
@@ -1,6 +1,6 @@
 ;;; w32-fns.el --- Lisp routines for 32-bit Windows
 
-;; Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Geoff Voelker <voelker@cs.washington.edu>
 ;; Keywords: internal
@@ -55,7 +55,7 @@
               w32-system-shells)))
 
 (defun w32-shell-dos-semantics ()
-  "Return non-nil if the interactive shell being used expects MS-DOS shell 
semantics."
+  "Return non-nil if current interactive shell expects MS-DOS shell semantics."
   (or (w32-system-shell-p (w32-shell-name))
       (and (member (downcase (file-name-nondirectory (w32-shell-name)))
                   '("cmdproxy" "cmdproxy.exe"))
diff --git a/lisp/w32-vars.el b/lisp/w32-vars.el
index 642a484..f00e474 100644
--- a/lisp/w32-vars.el
+++ b/lisp/w32-vars.el
@@ -1,6 +1,6 @@
 ;;; w32-vars.el --- MS-Windows specific user options  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Jason Rumney <jasonr@gnu.org>
 ;; Keywords: internal
diff --git a/lisp/wdired.el b/lisp/wdired.el
index ebe1961..f4a0b6d 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -1,6 +1,6 @@
 ;;; wdired.el --- Rename files editing their names in dired buffers -*- 
coding: utf-8; -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Filename: wdired.el
 ;; Author: Juan León Lahoz García <juanleon1@gmail.com>
@@ -242,12 +242,12 @@ See `wdired-mode'."
   (interactive)
   (unless (derived-mode-p 'dired-mode)
     (error "Not a Dired buffer"))
-  (set (make-local-variable 'wdired-old-content)
-       (buffer-substring (point-min) (point-max)))
-  (set (make-local-variable 'wdired-old-marks)
-       (dired-remember-marks (point-min) (point-max)))
-  (set (make-local-variable 'wdired-old-point) (point))
-  (set (make-local-variable 'query-replace-skip-read-only) t)
+  (setq-local wdired-old-content
+              (buffer-substring (point-min) (point-max)))
+  (setq-local wdired-old-marks
+              (dired-remember-marks (point-min) (point-max)))
+  (setq-local wdired-old-point (point))
+  (setq-local query-replace-skip-read-only t)
   (add-function :after-while (local 'isearch-filter-predicate)
                 #'wdired-isearch-filter-read-only)
   (use-local-map wdired-mode-map)
@@ -355,7 +355,10 @@ non-nil means return old filename."
                         dired-permission-flags-regexp nil t)
                        (goto-char (match-beginning 0))
                        (looking-at "l")
-                       (search-forward " -> " (line-end-position) t)))
+                       (if (and used-F
+                                dired-ls-F-marks-symlinks)
+                           (re-search-forward "@? -> " (line-end-position) t)
+                         (search-forward " -> " (line-end-position) t))))
             (goto-char (match-beginning 0))
             (setq end (point)))
           (when (and used-F
@@ -390,7 +393,7 @@ non-nil means return old filename."
   (dired-advertise)
   (remove-hook 'kill-buffer-hook 'wdired-check-kill-buffer t)
   (remove-hook 'after-change-functions 'wdired--restore-properties t)
-  (set (make-local-variable 'revert-buffer-function) 'dired-revert))
+  (setq-local revert-buffer-function 'dired-revert))
 
 
 (defun wdired-abort-changes ()
@@ -834,7 +837,7 @@ Like original function but it skips read-only words."
 ;; original name and permissions as a property
 (defun wdired-preprocess-perms ()
   (let ((inhibit-read-only t))
-    (set (make-local-variable 'wdired-col-perm) nil)
+    (setq-local wdired-col-perm nil)
     (save-excursion
       (goto-char (point-min))
       (while (not (eobp))
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 02ee7bc..7b8e5b7 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -1,6 +1,6 @@
 ;;; whitespace.el --- minor mode to visualize TAB, (HARD) SPACE, NEWLINE -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
 ;; Keywords: data, wp
@@ -1986,13 +1986,13 @@ resultant list will be returned."
   ;; prepare local hooks
   (add-hook 'write-file-functions 'whitespace-write-file-hook nil t)
   ;; create whitespace local buffer environment
-  (set (make-local-variable 'whitespace-font-lock-keywords) nil)
-  (set (make-local-variable 'whitespace-display-table) nil)
-  (set (make-local-variable 'whitespace-display-table-was-local) nil)
-  (set (make-local-variable 'whitespace-active-style)
-       (if (listp whitespace-style)
-          whitespace-style
-        (list whitespace-style)))
+  (setq-local whitespace-font-lock-keywords nil)
+  (setq-local whitespace-display-table nil)
+  (setq-local whitespace-display-table-was-local nil)
+  (setq-local whitespace-active-style
+              (if (listp whitespace-style)
+                 whitespace-style
+               (list whitespace-style)))
   ;; turn on whitespace
   (when whitespace-active-style
     (whitespace-color-on)
@@ -2034,19 +2034,14 @@ resultant list will be returned."
   "Turn on color visualization."
   (when (whitespace-style-face-p)
     ;; save current point and refontify when necessary
-    (set (make-local-variable 'whitespace-point)
-         (point))
+    (setq-local whitespace-point (point))
     (setq whitespace-point--used
           (let ((ol (make-overlay (point) (point) nil nil t)))
             (delete-overlay ol) ol))
-    (set (make-local-variable 'whitespace-font-lock-refontify)
-        0)
-    (set (make-local-variable 'whitespace-bob-marker)
-        (point-min-marker))
-    (set (make-local-variable 'whitespace-eob-marker)
-        (point-max-marker))
-    (set (make-local-variable 'whitespace-buffer-changed)
-        nil)
+    (setq-local whitespace-font-lock-refontify 0)
+    (setq-local whitespace-bob-marker (point-min-marker))
+    (setq-local whitespace-eob-marker (point-max-marker))
+    (setq-local whitespace-buffer-changed nil)
     (add-hook 'post-command-hook #'whitespace-post-command-hook nil t)
     (add-hook 'before-change-functions #'whitespace-buffer-changed nil t)
     ;; Add whitespace-mode color into font lock.
diff --git a/lisp/wid-browse.el b/lisp/wid-browse.el
index bc2e3c4..0864e1b 100644
--- a/lisp/wid-browse.el
+++ b/lisp/wid-browse.el
@@ -1,6 +1,6 @@
 ;;; wid-browse.el --- functions for browsing widgets
 ;;
-;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: extensions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 8250316..f920130 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -1,6 +1,6 @@
 ;;; wid-edit.el --- Functions for creating and using widgets -*- 
lexical-binding:t -*-
 ;;
-;; Copyright (C) 1996-1997, 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 1999-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: emacs-devel@gnu.org
@@ -338,7 +338,7 @@ in the key vector, as in the argument of `define-key'."
                                  '(display-buffer-in-direction
                                    (direction . bottom)
                                    (window-height . fit-window-to-buffer)))
-               (setq value (read-char-from-minibuffer
+               (setq value (read-char-choice
                             (format "%s: " title)
                             (mapcar #'car alist)))))
           (cdr (assoc value alist))))))
diff --git a/lisp/widget.el b/lisp/widget.el
index 8f1e090..de690ad 100644
--- a/lisp/widget.el
+++ b/lisp/widget.el
@@ -1,6 +1,6 @@
 ;;; widget.el --- a library of user interface components
 ;;
-;; Copyright (C) 1996-1997, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 2001-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, extensions, faces, hypermedia
diff --git a/lisp/windmove.el b/lisp/windmove.el
index 5db13cf..e4ea8e0 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -1,6 +1,6 @@
 ;;; windmove.el --- directional window-selection routines  -*- 
lexical-binding:t -*-
 ;;
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Hovav Shacham (hovav@cs.stanford.edu)
 ;; Created: 17 October 1998
diff --git a/lisp/window.el b/lisp/window.el
index daa5c67..cd13e66 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1,6 +1,6 @@
 ;;; window.el --- GNU Emacs window commands aside from those written in C  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1985, 1989, 1992-1994, 2000-2020 Free Software
+;; Copyright (C) 1985, 1989, 1992-1994, 2000-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -8390,9 +8390,9 @@ from the list of completions and default values."
           ;; here manually.
           (if (and (boundp 'icomplete-with-completion-tables)
                    (listp icomplete-with-completion-tables))
-              (set (make-local-variable 'icomplete-with-completion-tables)
-                   (cons rbts-completion-table
-                         icomplete-with-completion-tables))))
+              (setq-local icomplete-with-completion-tables
+                          (cons rbts-completion-table
+                                icomplete-with-completion-tables))))
       (read-buffer prompt (other-buffer (current-buffer))
                    (confirm-nonexistent-file-or-buffer)))))
 
diff --git a/lisp/winner.el b/lisp/winner.el
index 4313e76..9506ac5 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -1,6 +1,6 @@
 ;;; winner.el --- Restore old window configurations
 
-;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 
 ;; Author: Ivar Rummelhoff <ivarru@math.uio.no>
 ;; Created: 27 Feb 1997
diff --git a/lisp/woman.el b/lisp/woman.el
index 33a6a0d..0e4c1c1 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1,6 +1,6 @@
 ;;; woman.el --- browse UN*X manual pages `wo (without) man'
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Francis J. Wright <F.J.Wright@qmul.ac.uk>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 1d49f46..23e8001 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -1,6 +1,6 @@
 ;;; x-dnd.el --- drag and drop support for X  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 ;; Author: Jan Djärv <jan.h.d@swipnet.se>
 ;; Maintainer: emacs-devel@gnu.org
@@ -411,8 +411,10 @@ Coordinates are required to be absolute.
 FRAME is the frame and W is the window where the drop happened.
 If W is a window, return its absolute coordinates,
 otherwise return the frame coordinates."
-  (let* ((frame-left (frame-parameter frame 'left))
-        (frame-top (frame-parameter frame 'top)))
+  (let* ((frame-left (or (car-safe (cdr-safe (frame-parameter frame 'left)))
+                        (frame-parameter frame 'left)))
+        (frame-top (or (car-safe (cdr-safe (frame-parameter frame 'top)))
+                       (frame-parameter frame 'top))))
     (if (windowp w)
        (let ((edges (window-inside-pixel-edges w)))
          (cons
diff --git a/lisp/xdg.el b/lisp/xdg.el
index ae4a3f0..0f0df53 100644
--- a/lisp/xdg.el
+++ b/lisp/xdg.el
@@ -1,6 +1,6 @@
 ;;; xdg.el --- XDG specification and standard support -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Mark Oteiza <mvoteiza@udel.edu>
 ;; Created: 27 January 2017
diff --git a/lisp/xml.el b/lisp/xml.el
index c96ff80..4e2dd13 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -1,6 +1,6 @@
 ;;; xml.el --- XML parser -*- lexical-binding: t -*-
 
-;; Copyright (C) 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Emmanuel Briot <briot@gnat.com>
 ;; Maintainer: Mark A. Hershberger <mah@everybody.org>
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 9301476..72faff8 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -1,6 +1,6 @@
 ;;; xt-mouse.el --- support the mouse when emacs run in an xterm -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 1994, 2000-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2000-2021 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: mouse, terminals
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index caf57ae..b8df550 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -1,6 +1,6 @@
 ;;; xwidget.el --- api functions for xwidgets  -*- lexical-binding: t -*-
 ;;
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Joakim Verona (joakim@verona.se)
 ;;
@@ -451,7 +451,7 @@ function findactiveelement(doc){
 XW is the xwidget identifier, TEXT is retrieved from the webkit."
   (switch-to-buffer
    (generate-new-buffer "textarea"))
-  (set (make-local-variable 'xwidget-xwbl) xw)
+  (setq-local xwidget-xwbl xw)
   (insert text))
 
 (defun xwidget-webkit-end-edit-textarea ()
diff --git a/lwlib/ChangeLog.1 b/lwlib/ChangeLog.1
index 52ec945a..bf839cf 100644
--- a/lwlib/ChangeLog.1
+++ b/lwlib/ChangeLog.1
@@ -1964,7 +1964,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1995-1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1995-1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in
index 1077324..28c16ac 100644
--- a/lwlib/Makefile.in
+++ b/lwlib/Makefile.in
@@ -1,7 +1,7 @@
 ### @configure_input@
 
 # Copyright (C) 1992, 1993 Lucid, Inc.
-# Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 #
 # This file is part of the Lucid Widget Library.
 #
diff --git a/lwlib/deps.mk b/lwlib/deps.mk
index 105ea1b..66c464f 100644
--- a/lwlib/deps.mk
+++ b/lwlib/deps.mk
@@ -1,7 +1,7 @@
 ### deps.mk --- lwlib/Makefile fragment for GNU Emacs
 
 # Copyright (C) 1992, 1993 Lucid, Inc.
-# Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 #
 # This file is part of the Lucid Widget Library.
 #
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c
index 71ac98a..8806d3f 100644
--- a/lwlib/lwlib-Xaw.c
+++ b/lwlib/lwlib-Xaw.c
@@ -1,7 +1,7 @@
 /* The lwlib interface to Athena widgets.
 
 Copyright (C) 1993 Chuck Thompson <cthomp@cs.uiuc.edu>
-Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
diff --git a/lwlib/lwlib-Xlw.c b/lwlib/lwlib-Xlw.c
index 862bc8f..54dc06f 100644
--- a/lwlib/lwlib-Xlw.c
+++ b/lwlib/lwlib-Xlw.c
@@ -1,7 +1,7 @@
 /* The lwlib interface to "xlwmenu" menus.
 
 Copyright (C) 1992 Lucid, Inc.
-Copyright (C) 1994, 2000-2020 Free Software Foundation, Inc.
+Copyright (C) 1994, 2000-2021 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index c4ba411..525465f 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -1,6 +1,6 @@
 /* The lwlib interface to Motif widgets.
 
-Copyright (C) 1994-1997, 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1994-1997, 1999-2021 Free Software Foundation, Inc.
 Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
diff --git a/lwlib/lwlib-int.h b/lwlib/lwlib-int.h
index 885d951..ef76d67 100644
--- a/lwlib/lwlib-int.h
+++ b/lwlib/lwlib-int.h
@@ -1,6 +1,6 @@
 /*
 Copyright (C) 1992 Lucid, Inc.
-Copyright (C) 2000-2020 Free Software Foundation, Inc.
+Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
diff --git a/lwlib/lwlib-utils.c b/lwlib/lwlib-utils.c
index f15cb60..3c700e0 100644
--- a/lwlib/lwlib-utils.c
+++ b/lwlib/lwlib-utils.c
@@ -1,7 +1,7 @@
 /* Defines some widget utility functions.
 
 Copyright (C) 1992 Lucid, Inc.
-Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
@@ -148,6 +148,7 @@ XftFont *
 crxft_font_open_name (Display *dpy, int screen, const char *name)
 {
   XftFont *pub = NULL;
+  FcPattern *match = NULL;
   FcPattern *pattern = FcNameParse ((FcChar8 *) name);
   if (pattern)
     {
@@ -162,12 +163,18 @@ crxft_font_open_name (Display *dpy, int screen, const 
char *name)
          FcPatternAddDouble (pattern, FC_DPI, dpi);
        }
       FcDefaultSubstitute (pattern);
+      FcResult result;
+      match = FcFontMatch (NULL, pattern, &result);
+      FcPatternDestroy (pattern);
+    }
+  if (match)
+    {
       cairo_font_face_t *font_face
-       = cairo_ft_font_face_create_for_pattern (pattern);
+       = cairo_ft_font_face_create_for_pattern (match);
       if (font_face)
        {
          double pixel_size;
-         if ((FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &pixel_size)
+         if ((FcPatternGetDouble (match, FC_PIXEL_SIZE, 0, &pixel_size)
               != FcResultMatch)
              || pixel_size < 1)
            pixel_size = 10;
@@ -177,7 +184,7 @@ crxft_font_open_name (Display *dpy, int screen, const char 
*name)
          cairo_matrix_init_scale (&font_matrix, pixel_size, pixel_size);
          cairo_matrix_init_identity (&ctm);
          cairo_font_options_t *options = cairo_font_options_create ();
-         cairo_ft_font_options_substitute (options, pattern);
+         cairo_ft_font_options_substitute (options, match);
          pub->scaled_font = cairo_scaled_font_create (font_face, &font_matrix,
                                                       &ctm, options);
          cairo_font_face_destroy (font_face);
@@ -190,7 +197,7 @@ crxft_font_open_name (Display *dpy, int screen, const char 
*name)
          pub->height = lround (extents.height);
          pub->max_advance_width = lround (extents.max_x_advance);
        }
-      FcPatternDestroy (pattern);
+      FcPatternDestroy (match);
     }
   if (pub && pub->height <= 0)
     {
diff --git a/lwlib/lwlib-widget.h b/lwlib/lwlib-widget.h
index f132337..2fd84c0 100644
--- a/lwlib/lwlib-widget.h
+++ b/lwlib/lwlib-widget.h
@@ -1,6 +1,6 @@
 /*
 Copyright (C) 1992, 1993 Lucid, Inc.
-Copyright (C) 1994, 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1994, 1999-2021 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index 33c6ab1..820538f7 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -1,7 +1,7 @@
 /* A general interface to the widgets of different toolkits.
 
 Copyright (C) 1992, 1993 Lucid, Inc.
-Copyright (C) 1994-1996, 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1994-1996, 1999-2021 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
diff --git a/lwlib/lwlib.h b/lwlib/lwlib.h
index cd26974..ab48d85 100644
--- a/lwlib/lwlib.h
+++ b/lwlib/lwlib.h
@@ -1,6 +1,6 @@
 /*
 Copyright (C) 1992, 1993 Lucid, Inc.
-Copyright (C) 1994, 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1994, 1999-2021 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index dcef172..cc73d9a 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -1,7 +1,7 @@
 /* Implements a lightweight menubar widget.
 
 Copyright (C) 1992 Lucid, Inc.
-Copyright (C) 1994-1995, 1997, 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1994-1995, 1997, 1999-2021 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
diff --git a/lwlib/xlwmenu.h b/lwlib/xlwmenu.h
index 5215127..9143edb 100644
--- a/lwlib/xlwmenu.h
+++ b/lwlib/xlwmenu.h
@@ -1,6 +1,6 @@
 /* Interface of a lightweight menubar widget.
 
-Copyright (C) 2002-2020 Free Software Foundation, Inc.
+Copyright (C) 2002-2021 Free Software Foundation, Inc.
 Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
diff --git a/lwlib/xlwmenuP.h b/lwlib/xlwmenuP.h
index 614a4db..fc77ec4 100644
--- a/lwlib/xlwmenuP.h
+++ b/lwlib/xlwmenuP.h
@@ -1,6 +1,6 @@
 /* Internals of a lightweight menubar widget.
 
-Copyright (C) 2002-2020 Free Software Foundation, Inc.
+Copyright (C) 2002-2021 Free Software Foundation, Inc.
 Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4
index 14628c3..9ba1743 100644
--- a/m4/00gnulib.m4
+++ b/m4/00gnulib.m4
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 8
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/__inline.m4 b/m4/__inline.m4
index 520c8c4..b28cc6a 100644
--- a/m4/__inline.m4
+++ b/m4/__inline.m4
@@ -1,5 +1,5 @@
 # Test for __inline keyword
-dnl Copyright 2017-2020 Free Software Foundation, Inc.
+dnl Copyright 2017-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4
index c043233..52d80d0 100644
--- a/m4/absolute-header.m4
+++ b/m4/absolute-header.m4
@@ -1,5 +1,5 @@
 # absolute-header.m4 serial 17
-dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/acl.m4 b/m4/acl.m4
index a3dcf93..aaf231a 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,7 +1,7 @@
 # acl.m4 - check for access control list (ACL) primitives
 # serial 24
 
-# Copyright (C) 2002, 2004-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index d841489..ba2f679 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -1,5 +1,5 @@
-# alloca.m4 serial 18
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation,
+# alloca.m4 serial 20
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -104,5 +104,5 @@ AH_VERBATIM([STACK_DIRECTION],
         STACK_DIRECTION = 0 => direction of growth unknown */
 #undef STACK_DIRECTION])dnl
 AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
-])
+])# _AC_LIBOBJ_ALLOCA
 ])
diff --git a/m4/builtin-expect.m4 b/m4/builtin-expect.m4
index a6e8895..c584116 100644
--- a/m4/builtin-expect.m4
+++ b/m4/builtin-expect.m4
@@ -1,6 +1,6 @@
 dnl Check for __builtin_expect.
 
-dnl Copyright 2016-2020 Free Software Foundation, Inc.
+dnl Copyright 2016-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/byteswap.m4 b/m4/byteswap.m4
index 0f43994..1083b4c 100644
--- a/m4/byteswap.m4
+++ b/m4/byteswap.m4
@@ -1,5 +1,5 @@
 # byteswap.m4 serial 4
-dnl Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4
index 14ea3e1..475fa15 100644
--- a/m4/canonicalize.m4
+++ b/m4/canonicalize.m4
@@ -1,6 +1,6 @@
-# canonicalize.m4 serial 33
+# canonicalize.m4 serial 35
 
-dnl Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc.
 
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,8 @@ dnl with or without modifications, as long as this notice is 
preserved.
 AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
 [
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  AC_CHECK_FUNCS_ONCE([canonicalize_file_name])
+  AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+  AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
   AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
   AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
   if test $ac_cv_func_canonicalize_file_name = no; then
@@ -56,7 +57,8 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
 AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
 [
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  AC_CHECK_FUNCS_ONCE([canonicalize_file_name readlink])
+  AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+  AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
 
   dnl On native Windows, we use _getcwd(), regardless whether getcwd() is
   dnl available through the linker option '-loldnames'.
diff --git a/m4/clock_time.m4 b/m4/clock_time.m4
index f4f51fa..c3b9e7e 100644
--- a/m4/clock_time.m4
+++ b/m4/clock_time.m4
@@ -1,5 +1,5 @@
 # clock_time.m4 serial 10
-dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/close-stream.m4 b/m4/close-stream.m4
index f3cc7aa..feeb4ea 100644
--- a/m4/close-stream.m4
+++ b/m4/close-stream.m4
@@ -1,5 +1,5 @@
 #serial 4
-dnl Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/copy-file-range.m4 b/m4/copy-file-range.m4
index 5c5a274..82904e9 100644
--- a/m4/copy-file-range.m4
+++ b/m4/copy-file-range.m4
@@ -1,5 +1,5 @@
 # copy-file-range.m4
-dnl Copyright 2019-2020 Free Software Foundation, Inc.
+dnl Copyright 2019-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/d-type.m4 b/m4/d-type.m4
index d40220a..534a59e 100644
--- a/m4/d-type.m4
+++ b/m4/d-type.m4
@@ -5,7 +5,7 @@ dnl
 dnl Check whether struct dirent has a member named d_type.
 dnl
 
-# Copyright (C) 1997, 1999-2004, 2006, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999-2004, 2006, 2009-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4
index 8bef6a0..6d86142 100644
--- a/m4/dirent_h.m4
+++ b/m4/dirent_h.m4
@@ -1,5 +1,5 @@
 # dirent_h.m4 serial 16
-dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index d92445e..3c9ce5d 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -2,7 +2,7 @@
 
 dnl Find out how to get the file descriptor associated with an open DIR*.
 
-# Copyright (C) 2001-2006, 2008-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2006, 2008-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4
index c463ac4..c9bbcef 100644
--- a/m4/double-slash-root.m4
+++ b/m4/double-slash-root.m4
@@ -1,5 +1,5 @@
 # double-slash-root.m4 serial 4   -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/dup2.m4 b/m4/dup2.m4
index a82798d..0753a32 100644
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -1,5 +1,5 @@
 #serial 27
-dnl Copyright (C) 2002, 2005, 2007, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005, 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/eealloc.m4 b/m4/eealloc.m4
index 236f373..002f0c8 100644
--- a/m4/eealloc.m4
+++ b/m4/eealloc.m4
@@ -1,5 +1,5 @@
 # eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/environ.m4 b/m4/environ.m4
index bab85f1..d971770 100644
--- a/m4/environ.m4
+++ b/m4/environ.m4
@@ -1,5 +1,5 @@
 # environ.m4 serial 7
-dnl Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/errno_h.m4 b/m4/errno_h.m4
index dd4994f..51dfe92 100644
--- a/m4/errno_h.m4
+++ b/m4/errno_h.m4
@@ -1,5 +1,5 @@
 # errno_h.m4 serial 13
-dnl Copyright (C) 2004, 2006, 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/euidaccess.m4 b/m4/euidaccess.m4
index 39f28b3..4aeb90a 100644
--- a/m4/euidaccess.m4
+++ b/m4/euidaccess.m4
@@ -1,5 +1,5 @@
 # euidaccess.m4 serial 15
-dnl Copyright (C) 2002-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/execinfo.m4 b/m4/execinfo.m4
index 37ee8de..75ab44b 100644
--- a/m4/execinfo.m4
+++ b/m4/execinfo.m4
@@ -1,6 +1,6 @@
 # Check for GNU-style execinfo.h.
 
-dnl Copyright 2012-2020 Free Software Foundation, Inc.
+dnl Copyright 2012-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/explicit_bzero.m4 b/m4/explicit_bzero.m4
index a415e7b..d77ec5a 100644
--- a/m4/explicit_bzero.m4
+++ b/m4/explicit_bzero.m4
@@ -1,4 +1,4 @@
-dnl Copyright 2017-2020 Free Software Foundation, Inc.
+dnl Copyright 2017-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index d7c95ef..f7333ac 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -1,14 +1,19 @@
-# serial 18  -*- Autoconf -*-
+# serial 21  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2020 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that
+dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
+m4_ifndef([AC_CHECK_INCLUDES_DEFAULT],
+  [AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])])
+
 # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
 # Autoconf.  Perhaps we can remove this once we can assume Autoconf
-# 2.70 or later everywhere, but since Autoconf mutates rapidly
+# is recent-enough everywhere, but since Autoconf mutates rapidly
 # enough in this area it's likely we'll need to redefine
 # AC_USE_SYSTEM_EXTENSIONS for quite some time.
 
@@ -26,36 +31,27 @@
 #      its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
 #      invocation occurs in gl_EARLY, not in gl_INIT.
 
+m4_version_prereq([2.70.1], [], [
+
 # AC_USE_SYSTEM_EXTENSIONS
 # ------------------------
 # Enable extensions on systems that normally disable them,
 # typically due to standards-conformance issues.
-#
-# Remember that #undef in AH_VERBATIM gets replaced with #define by
-# AC_DEFINE.  The goal here is to define all known feature-enabling
-# macros, then, if reports of conflicts are made, disable macros that
-# cause problems on some platforms (such as __EXTENSIONS__).
+# We unconditionally define as many of the known feature-enabling
+# as possible, reserving conditional behavior for macros that are
+# known to cause problems on some platforms (such as __EXTENSIONS__).
 AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
-[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+[AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl
+AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_LINK_IFELSE])dnl
 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
-
-  AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
-  if test "$MINIX" = yes; then
-    AC_DEFINE([_POSIX_SOURCE], [1],
-      [Define to 1 if you need to in order for 'stat' and other
-       things to work.])
-    AC_DEFINE([_POSIX_1_SOURCE], [2],
-      [Define to 2 if the system does not provide POSIX.1 features
-       except with this defined.])
-    AC_DEFINE([_MINIX], [1],
-      [Define to 1 if on MINIX.])
-    AC_DEFINE([_NETBSD_SOURCE], [1],
-      [Define to 1 to make NetBSD features available.  MINIX 3 needs this.])
-  fi
-
+AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl
+dnl #undef in AH_VERBATIM gets replaced with #define by AC_DEFINE.
 dnl Use a different key than __EXTENSIONS__, as that name broke existing
 dnl configure.ac when using autoheader 2.62.
-  AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
+dnl The macros below are in alphabetical order ignoring leading _ or __
+dnl prefixes.
+AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
 [/* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
@@ -64,19 +60,44 @@ dnl configure.ac when using autoheader 2.62.
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
-/* Enable NetBSD extensions on NetBSD.  */
+/* Enable X/Open compliant socket functions that do not require linking
+   with -lxnet on HP-UX 11.11.  */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# undef _HPUX_ALT_XOPEN_SOCKET_API
+#endif
+/* Identify the host operating system as Minix.
+   This macro does not affect the system headers' behavior.
+   A future release of Autoconf may stop defining this macro.  */
+#ifndef _MINIX
+# undef _MINIX
+#endif
+/* Enable general extensions on NetBSD.
+   Enable NetBSD compatibility extensions on Minix.  */
 #ifndef _NETBSD_SOURCE
 # undef _NETBSD_SOURCE
 #endif
-/* Enable OpenBSD extensions on NetBSD.  */
+/* Enable OpenBSD compatibility extensions on NetBSD.
+   Oddly enough, this does nothing on OpenBSD.  */
 #ifndef _OPENBSD_SOURCE
 # undef _OPENBSD_SOURCE
 #endif
-/* Enable threading extensions on Solaris.  */
+/* Define to 1 if needed for POSIX-compatible behavior.  */
+#ifndef _POSIX_SOURCE
+# undef _POSIX_SOURCE
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior.  */
+#ifndef _POSIX_1_SOURCE
+# undef _POSIX_1_SOURCE
+#endif
+/* Enable POSIX-compatible threading on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
@@ -112,22 +133,19 @@ dnl configure.ac when using autoheader 2.62.
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
 #endif
-/* Enable X/Open extensions if necessary.  HP-UX 11.11 defines
-   mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
-   whether compiling with -Ae or -D_HPUX_SOURCE=1.  */
+/* Enable X/Open extensions.  Define to 500 only if necessary
+   to make mbstate_t available.  */
 #ifndef _XOPEN_SOURCE
 # undef _XOPEN_SOURCE
 #endif
-/* Enable X/Open compliant socket functions that do not require linking
-   with -lxnet on HP-UX 11.11.  */
-#ifndef _HPUX_ALT_XOPEN_SOCKET_API
-# undef _HPUX_ALT_XOPEN_SOCKET_API
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-])
+])dnl
+
+  AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl
+  _AC_CHECK_HEADER_ONCE([wchar.h])
+  _AC_CHECK_HEADER_ONCE([minix/config.h])
+
+dnl Defining __EXTENSIONS__ may break the system headers on some systems.
+dnl (FIXME: Which ones?)
   AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
     [ac_cv_safe_to_define___extensions__],
     [AC_COMPILE_IFELSE(
@@ -136,11 +154,33 @@ dnl configure.ac when using autoheader 2.62.
           ]AC_INCLUDES_DEFAULT])],
        [ac_cv_safe_to_define___extensions__=yes],
        [ac_cv_safe_to_define___extensions__=no])])
-  test $ac_cv_safe_to_define___extensions__ = yes &&
-    AC_DEFINE([__EXTENSIONS__])
+
+dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to
+dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1.
+dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms
+dnl not covered by turn-on-extensions macros (notably Dragonfly, Free,
+dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so
+dnl it should only be defined when necessary.
+  AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+    [ac_cv_should_define__xopen_source],
+    [ac_cv_should_define__xopen_source=no
+    AS_IF([test $ac_cv_header_wchar_h = yes],
+      [AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[
+          #include <wchar.h>
+          mbstate_t x;]])],
+        [],
+        [AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM([[
+            #define _XOPEN_SOURCE 500
+            #include <wchar.h>
+            mbstate_t x;]])],
+          [ac_cv_should_define__xopen_source=yes])])])])
+
   AC_DEFINE([_ALL_SOURCE])
   AC_DEFINE([_DARWIN_C_SOURCE])
   AC_DEFINE([_GNU_SOURCE])
+  AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])
   AC_DEFINE([_NETBSD_SOURCE])
   AC_DEFINE([_OPENBSD_SOURCE])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
@@ -152,24 +192,18 @@ dnl configure.ac when using autoheader 2.62.
   AC_DEFINE([__STDC_WANT_LIB_EXT2__])
   AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__])
   AC_DEFINE([_TANDEM_SOURCE])
-  AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
-    [ac_cv_should_define__xopen_source],
-    [ac_cv_should_define__xopen_source=no
-     AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM([[
-          #include <wchar.h>
-          mbstate_t x;]])],
-       [],
-       [AC_COMPILE_IFELSE(
-          [AC_LANG_PROGRAM([[
-             #define _XOPEN_SOURCE 500
-             #include <wchar.h>
-             mbstate_t x;]])],
-          [ac_cv_should_define__xopen_source=yes])])])
-  test $ac_cv_should_define__xopen_source = yes &&
-    AC_DEFINE([_XOPEN_SOURCE], [500])
-  AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])
+  AS_IF([test $ac_cv_header_minix_config_h = yes],
+    [MINIX=yes
+    AC_DEFINE([_MINIX])
+    AC_DEFINE([_POSIX_SOURCE])
+    AC_DEFINE([_POSIX_1_SOURCE], [2])],
+    [MINIX=])
+  AS_IF([test $ac_cv_safe_to_define___extensions__ = yes],
+    [AC_DEFINE([__EXTENSIONS__])])
+  AS_IF([test $ac_cv_should_define__xopen_source = yes],
+    [AC_DEFINE([_XOPEN_SOURCE], [500])])
 ])# AC_USE_SYSTEM_EXTENSIONS
+])
 
 # gl_USE_SYSTEM_EXTENSIONS
 # ------------------------
@@ -177,13 +211,5 @@ dnl configure.ac when using autoheader 2.62.
 # typically due to standards-conformance issues.
 AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
 [
-  dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
-  dnl gnulib does not need it. But if it gets required by third-party macros
-  dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
-  dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
-  dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
-  dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
-  AC_REQUIRE([AC_GNU_SOURCE])
-
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 ])
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 75c5008..a2acf12 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -1,6 +1,6 @@
 dnl 'extern inline' a la ISO C99.
 
-dnl Copyright 2012-2020 Free Software Foundation, Inc.
+dnl Copyright 2012-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/faccessat.m4 b/m4/faccessat.m4
index 7a8b979..9d6b363 100644
--- a/m4/faccessat.m4
+++ b/m4/faccessat.m4
@@ -1,7 +1,7 @@
-# serial 8
+# serial 10
 # See if we need to provide faccessat replacement.
 
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -20,7 +20,7 @@ AC_DEFUN([gl_FUNC_FACCESSAT],
   if test $ac_cv_func_faccessat = no; then
     HAVE_FACCESSAT=0
   else
-    case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+    case $gl_cv_func_lstat_dereferences_slashed_symlink in
       *yes) ;;
       *)    REPLACE_FACCESSAT=1 ;;
     esac
diff --git a/m4/fchmodat.m4 b/m4/fchmodat.m4
index cf5c879..0938032 100644
--- a/m4/fchmodat.m4
+++ b/m4/fchmodat.m4
@@ -1,5 +1,5 @@
 # fchmodat.m4 serial 5
-dnl Copyright (C) 2004-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/fcntl.m4 b/m4/fcntl.m4
index ea24f3d..f626434 100644
--- a/m4/fcntl.m4
+++ b/m4/fcntl.m4
@@ -1,5 +1,5 @@
-# fcntl.m4 serial 10
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+# fcntl.m4 serial 11
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -81,15 +81,29 @@ AC_DEFUN([gl_FUNC_FCNTL],
           behavior does not match POSIX]) ;;
     esac
 
-    dnl Many systems lack F_DUPFD_CLOEXEC
+    dnl Many systems lack F_DUPFD_CLOEXEC.
+    dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD.
     AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC],
       [gl_cv_func_fcntl_f_dupfd_cloexec],
-      [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <fcntl.h>
-#ifndef F_DUPFD_CLOEXEC
-choke me
-#endif
-         ]])],
+      [AC_RUN_IFELSE(
+         [AC_LANG_SOURCE(
+            [[#include <fcntl.h>
+              #include <unistd.h>
+              int main (int argc, char *argv[])
+              {
+                if (argc == 1)
+                  /* parent process */
+                  {
+                    if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
+                      return 1;
+                    return execl ("./conftest", "./conftest", "child", NULL);
+                  }
+                else
+                  /* child process */
+                  return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
+              }
+            ]])
+         ],
          [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #ifdef __linux__
 /* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
@@ -98,12 +112,22 @@ choke me
 #endif
            ]])],
            [gl_cv_func_fcntl_f_dupfd_cloexec=yes],
-           [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])],
-         [gl_cv_func_fcntl_f_dupfd_cloexec=no])])
-    if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
-      gl_REPLACE_FCNTL
-      dnl No witness macro needed for this bug.
-    fi
+           [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])
+         ],
+         [gl_cv_func_fcntl_f_dupfd_cloexec=no],
+         [case "$host_os" in
+                     # Guess no on NetBSD.
+            netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
+            *)       gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" 
;;
+          esac
+         ])
+      ])
+    case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
+      *yes) ;;
+      *)    gl_REPLACE_FCNTL
+            dnl No witness macro needed for this bug.
+            ;;
+    esac
   fi
   dnl Replace fcntl() for supporting the gnulib-defined fchdir() function,
   dnl to keep fchdir's bookkeeping up-to-date.
diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4
index 6b25393..e63a82f 100644
--- a/m4/fcntl_h.m4
+++ b/m4/fcntl_h.m4
@@ -1,6 +1,6 @@
-# serial 16
+# serial 17
 # Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -42,6 +42,9 @@ AC_DEFUN([gl_FCNTL_H_DEFAULTS],
   GNULIB_NONBLOCKING=0;  AC_SUBST([GNULIB_NONBLOCKING])
   GNULIB_OPEN=0;         AC_SUBST([GNULIB_OPEN])
   GNULIB_OPENAT=0;       AC_SUBST([GNULIB_OPENAT])
+  dnl Support Microsoft deprecated alias function names by default.
+  GNULIB_MDA_CREAT=1;    AC_SUBST([GNULIB_MDA_CREAT])
+  GNULIB_MDA_OPEN=1;     AC_SUBST([GNULIB_MDA_OPEN])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_FCNTL=1;          AC_SUBST([HAVE_FCNTL])
   HAVE_OPENAT=1;         AC_SUBST([HAVE_OPENAT])
diff --git a/m4/fdopendir.m4 b/m4/fdopendir.m4
index 9937a74..d428380 100644
--- a/m4/fdopendir.m4
+++ b/m4/fdopendir.m4
@@ -1,7 +1,7 @@
 # serial 14
 # See if we need to provide fdopendir.
 
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/filemode.m4 b/m4/filemode.m4
index 5aaaa1a..4dc24ef 100644
--- a/m4/filemode.m4
+++ b/m4/filemode.m4
@@ -1,11 +1,10 @@
-# filemode.m4 serial 8
-dnl Copyright (C) 2002, 2005-2006, 2009-2020 Free Software Foundation, Inc.
+# filemode.m4 serial 9
+dnl Copyright (C) 2002, 2005-2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FILEMODE],
 [
-  AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
   AC_CHECK_DECLS_ONCE([strmode])
 ])
diff --git a/m4/flexmember.m4 b/m4/flexmember.m4
index 90f3ddd..49b1c75 100644
--- a/m4/flexmember.m4
+++ b/m4/flexmember.m4
@@ -1,7 +1,7 @@
 # serial 5
 # Check for flexible array member support.
 
-# Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/fpending.m4 b/m4/fpending.m4
index edabcec..131356a 100644
--- a/m4/fpending.m4
+++ b/m4/fpending.m4
@@ -1,6 +1,6 @@
 # serial 23
 
-# Copyright (C) 2000-2001, 2004-2020 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2004-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/fpieee.m4 b/m4/fpieee.m4
index d5c9aef..3f16957 100644
--- a/m4/fpieee.m4
+++ b/m4/fpieee.m4
@@ -1,5 +1,5 @@
 # fpieee.m4 serial 2  -*- coding: utf-8 -*-
-dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/free.m4 b/m4/free.m4
new file mode 100644
index 0000000..d671376
--- /dev/null
+++ b/m4/free.m4
@@ -0,0 +1,49 @@
+# free.m4 serial 5
+# Copyright (C) 2003-2005, 2009-2021 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Paul Eggert and Bruno Haible.
+
+AC_DEFUN([gl_FUNC_FREE],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+  dnl In the next release of POSIX, free must preserve errno.
+  dnl https://www.austingroupbugs.net/view.php?id=385
+  dnl https://sourceware.org/bugzilla/show_bug.cgi?id=17924
+  dnl So far, we know of three platforms that do this:
+  dnl * glibc >= 2.33, thanks to the fix for this bug:
+  dnl   <https://sourceware.org/bugzilla/show_bug.cgi?id=17924>
+  dnl * OpenBSD >= 4.5, thanks to this commit:
+  dnl   
<https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/malloc.c.diff?r1=1.100&r2=1.101&f=h>
+  dnl * Solaris, because its malloc() implementation is based on brk(),
+  dnl   not mmap(); hence its free() implementation makes no system calls.
+  dnl For other platforms, you can only be sure if they state it in their
+  dnl documentation, or by code inspection of the free() implementation in 
libc.
+  AC_CACHE_CHECK([whether free is known to preserve errno],
+    [gl_cv_func_free_preserves_errno],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stdlib.h>
+          ]],
+          [[#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
+            #elif defined __OpenBSD__
+            #elif defined __sun
+            #else
+              #error "'free' is not known to preserve errno"
+            #endif
+          ]])],
+       [gl_cv_func_free_preserves_errno=yes],
+       [gl_cv_func_free_preserves_errno=no])
+    ])
+
+  case $gl_cv_func_free_preserves_errno in
+   *yes) ;;
+   *) REPLACE_FREE=1 ;;
+  esac
+])
+
+# Prerequisites of lib/free.c.
+AC_DEFUN([gl_PREREQ_FREE], [:])
diff --git a/m4/fstatat.m4 b/m4/fstatat.m4
index 19583ed..d730e46 100644
--- a/m4/fstatat.m4
+++ b/m4/fstatat.m4
@@ -1,5 +1,5 @@
 # fstatat.m4 serial 4
-dnl Copyright (C) 2004-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/fsusage.m4 b/m4/fsusage.m4
index 0bc6206..d005579 100644
--- a/m4/fsusage.m4
+++ b/m4/fsusage.m4
@@ -1,7 +1,7 @@
-# serial 34
+# serial 35
 # Obtaining file system usage information.
 
-# Copyright (C) 1997-1998, 2000-2001, 2003-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997-1998, 2000-2001, 2003-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -36,7 +36,6 @@ AC_DEFUN([gl_FILE_SYSTEM_USAGE],
   dnl Mac OS X >= 10.5 (32-bit mode).
   AC_REQUIRE([AC_SYS_LARGEFILE])
 
-  AC_MSG_CHECKING([how to get file system space usage])
   ac_fsusage_space=no
 
   # Perform only the link test since it seems there are no variants of the
diff --git a/m4/fsync.m4 b/m4/fsync.m4
index c86c0e6..6dc8cd1 100644
--- a/m4/fsync.m4
+++ b/m4/fsync.m4
@@ -1,5 +1,5 @@
 # fsync.m4 serial 2
-dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/futimens.m4 b/m4/futimens.m4
index 145b8ff..2e9f53e 100644
--- a/m4/futimens.m4
+++ b/m4/futimens.m4
@@ -1,7 +1,7 @@
 # serial 9
 # See if we need to provide futimens replacement.
 
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/getdtablesize.m4 b/m4/getdtablesize.m4
index af32864..8fbc941 100644
--- a/m4/getdtablesize.m4
+++ b/m4/getdtablesize.m4
@@ -1,5 +1,5 @@
 # getdtablesize.m4 serial 8
-dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/getgroups.m4 b/m4/getgroups.m4
index e344162..bd746cd 100644
--- a/m4/getgroups.m4
+++ b/m4/getgroups.m4
@@ -3,7 +3,7 @@
 dnl From Jim Meyering.
 dnl A wrapper around AC_FUNC_GETGROUPS.
 
-# Copyright (C) 1996-1997, 1999-2004, 2008-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-1997, 1999-2004, 2008-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4
index 9fe328e..bba2216 100644
--- a/m4/getloadavg.m4
+++ b/m4/getloadavg.m4
@@ -1,6 +1,6 @@
 # Check for getloadavg.
 
-# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2020 Free Software
+# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2021 Free Software
 # Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index 595483d..bb95c5e 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,5 +1,5 @@
 # getopt.m4 serial 47
-dnl Copyright (C) 2002-2006, 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/getrandom.m4 b/m4/getrandom.m4
index d6da71a..5f174dc 100644
--- a/m4/getrandom.m4
+++ b/m4/getrandom.m4
@@ -1,5 +1,5 @@
 # getrandom.m4 serial 8
-dnl Copyright 2020 Free Software Foundation, Inc.
+dnl Copyright 2020-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/gettime.m4 b/m4/gettime.m4
index e65455a..de7c330 100644
--- a/m4/gettime.m4
+++ b/m4/gettime.m4
@@ -1,5 +1,5 @@
 # gettime.m4 serial 9
-dnl Copyright (C) 2002, 2004-2006, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004-2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
index 578ed49..3c20081 100644
--- a/m4/gettimeofday.m4
+++ b/m4/gettimeofday.m4
@@ -1,6 +1,6 @@
 # serial 28
 
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
index ece484b..74a781a 100644
--- a/m4/glibc21.m4
+++ b/m4/glibc21.m4
@@ -1,6 +1,6 @@
 # glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2020 Free Software Foundation,
-dnl Inc.
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2021 Free Software
+dnl Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 33e56fa..535359b 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 57
-dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 63
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -483,23 +483,17 @@ AC_DEFUN([gl_FEATURES_H],
 # gl_PROG_CC_C99
 # Modifies the value of the shell variable CC in an attempt to make $CC
 # understand ISO C99 source code.
-# This is like AC_PROG_CC_C99, except that
-# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
-#   <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00367.html>,
-#   but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
-#   <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00441.html>.
-# Remaining problems:
-# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
-#   to CC twice
-#   <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00431.html>.
-# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
 AC_DEFUN([gl_PROG_CC_C99],
 [
-  dnl Change that version number to the minimum Autoconf version that supports
-  dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
-  m4_version_prereq([9.0],
-    [AC_REQUIRE([AC_PROG_CC_C99])],
-    [AC_REQUIRE([AC_PROG_CC_STDC])])
+  dnl Just use AC_PROG_CC_C99.
+  dnl When AC_PROG_CC_C99 and AC_PROG_CC_STDC are used together, the 
substituted
+  dnl value of CC will contain the C99 enabling options twice. But this is only
+  dnl a cosmetic problem.
+  dnl With Autoconf >= 2.70, use AC_PROG_CC since it implies AC_PROG_CC_C99;
+  dnl this avoids a "warning: The macro `AC_PROG_CC_C99' is obsolete."
+  m4_version_prereq([2.70],
+    [AC_REQUIRE([AC_PROG_CC])],
+    [AC_REQUIRE([AC_PROG_CC_C99])])
 ])
 
 # gl_PROG_AR_RANLIB
@@ -573,16 +567,16 @@ Amsterdam
 ])
 
 # AC_C_RESTRICT
-# This definition is copied from post-2.69 Autoconf and overrides the
-# AC_C_RESTRICT macro from autoconf 2.60..2.69.  It can be removed
-# once autoconf >= 2.70 can be assumed.  It's painful to check version
-# numbers, and in practice this macro is more up-to-date than Autoconf
-# is, so override Autoconf unconditionally.
+# This definition is copied from post-2.70 Autoconf and overrides the
+# AC_C_RESTRICT macro from autoconf 2.60..2.70.
+m4_version_prereq([2.70.1], [], [
 AC_DEFUN([AC_C_RESTRICT],
 [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
   [ac_cv_c_restrict=no
-   # The order here caters to the fact that C++ does not require restrict.
-   for ac_kw in __restrict __restrict__ _Restrict restrict; do
+   # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
+   # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
+   # Put 'restrict' last, because C++ lacks it.
+   for ac_kw in __restrict__ __restrict _Restrict restrict; do
      AC_COMPILE_IFELSE(
       [AC_LANG_PROGRAM(
          [[typedef int *int_ptr;
@@ -602,7 +596,7 @@ AC_DEFUN([AC_C_RESTRICT],
  AH_VERBATIM([restrict],
 [/* Define to the equivalent of the C99 'restrict' keyword, or to
    nothing if this is not supported.  Do not define if restrict is
-   supported directly.  */
+   supported only directly.  */
 #undef restrict
 /* Work around a bug in older versions of Sun C++, which did not
    #define __restrict__ or support _Restrict or __restrict__
@@ -620,6 +614,7 @@ AC_DEFUN([AC_C_RESTRICT],
    *)  AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
  esac
 ])# AC_C_RESTRICT
+])
 
 # gl_BIGENDIAN
 # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
@@ -630,13 +625,20 @@ AC_DEFUN([gl_BIGENDIAN],
   AC_C_BIGENDIAN
 ])
 
+# A temporary file descriptor.
+# Must be less than 10, because dash 0.5.8 does not support redirections
+# with multi-digit file descriptors.
+m4_define([GL_TMP_FD], 9)
+
 # gl_SILENT(command)
 # executes command, but without the normal configure output.
+# This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.)
+# inside another AC_CACHE_CHECK.
 AC_DEFUN([gl_SILENT],
 [
-  {
-    $1
-  } AS_MESSAGE_FD>/dev/null
+  exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
+  $1
+  exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&-
 ])
 
 # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
@@ -646,10 +648,9 @@ AC_DEFUN([gl_SILENT],
 # by an AC_MSG_CHECKING/AC_MSG_RESULT pair.
 AC_DEFUN([gl_CACHE_VAL_SILENT],
 [
-  saved_as_echo_n="$as_echo_n"
-  as_echo_n=':'
-  AC_CACHE_VAL([$1], [$2])
-  as_echo_n="$saved_as_echo_n"
+  gl_SILENT([
+    AC_CACHE_VAL([$1], [$2])
+  ])
 ])
 
 dnl Expands to some code for use in .c programs that, on native Windows, 
defines
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index d2fdbd8..ad10952 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -75,6 +75,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module dtoastr:
   # Code from module dtotimespec:
   # Code from module dup2:
+  # Code from module eloop-threshold:
   # Code from module environ:
   # Code from module errno:
   # Code from module euidaccess:
@@ -94,6 +95,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module fpending:
   # Code from module fpieee:
   AC_REQUIRE([gl_FP_IEEE])
+  # Code from module free-posix:
   # Code from module fstatat:
   # Code from module fsusage:
   # Code from module fsync:
@@ -109,6 +111,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module gettimeofday:
   # Code from module gitlog-to-changelog:
   # Code from module group-member:
+  # Code from module idx:
   # Code from module ieee754-h:
   # Code from module ignore-value:
   # Code from module include_next:
@@ -121,7 +124,6 @@ AC_DEFUN([gl_EARLY],
   # Code from module libgmp:
   # Code from module limits-h:
   # Code from module lstat:
-  # Code from module malloca:
   # Code from module manywarnings:
   # Code from module memmem-simple:
   # Code from module mempcpy:
@@ -140,10 +142,12 @@ AC_DEFUN([gl_EARLY],
   # Code from module pselect:
   # Code from module pthread_sigmask:
   # Code from module qcopy-acl:
+  # Code from module rawmemchr:
   # Code from module readlink:
   # Code from module readlinkat:
   # Code from module regex:
   # Code from module root-uid:
+  # Code from module scratch_buffer:
   # Code from module sig2str:
   # Code from module sigdescr_np:
   # Code from module signal-h:
@@ -288,6 +292,12 @@ AC_DEFUN([gl_INIT],
   if test $gl_cv_func___fpending = no; then
     AC_LIBOBJ([fpending])
   fi
+  gl_FUNC_FREE
+  if test $REPLACE_FREE = 1; then
+    AC_LIBOBJ([free])
+    gl_PREREQ_FREE
+  fi
+  gl_STDLIB_MODULE_INDICATOR([free-posix])
   gl_FUNC_FSTATAT
   if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
     AC_LIBOBJ([fstatat])
@@ -507,17 +517,20 @@ AC_DEFUN([gl_INIT],
   gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false
   gl_gnulib_enabled_cloexec=false
   gl_gnulib_enabled_dirfd=false
+  gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c=false
   gl_gnulib_enabled_euidaccess=false
   gl_gnulib_enabled_getdtablesize=false
   gl_gnulib_enabled_getgroups=false
   gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
   gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false
+  gl_gnulib_enabled_idx=false
   gl_gnulib_enabled_lchmod=false
-  gl_gnulib_enabled_malloca=false
   gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false
   gl_gnulib_enabled_open=false
   gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false
+  gl_gnulib_enabled_rawmemchr=false
   gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
+  gl_gnulib_enabled_scratch_buffer=false
   gl_gnulib_enabled_strtoll=false
   gl_gnulib_enabled_utimens=false
   gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false
@@ -551,6 +564,12 @@ AC_DEFUN([gl_INIT],
       gl_gnulib_enabled_dirfd=true
     fi
   }
+  func_gl_gnulib_m4code_925677f0343de64b89a9f0c790b4104c ()
+  {
+    if ! $gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c; then
+      gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c=true
+    fi
+  }
   func_gl_gnulib_m4code_euidaccess ()
   {
     if ! $gl_gnulib_enabled_euidaccess; then
@@ -616,6 +635,12 @@ AC_DEFUN([gl_INIT],
       fi
     fi
   }
+  func_gl_gnulib_m4code_idx ()
+  {
+    if ! $gl_gnulib_enabled_idx; then
+      gl_gnulib_enabled_idx=true
+    fi
+  }
   func_gl_gnulib_m4code_lchmod ()
   {
     if ! $gl_gnulib_enabled_lchmod; then
@@ -628,14 +653,6 @@ AC_DEFUN([gl_INIT],
       gl_gnulib_enabled_lchmod=true
     fi
   }
-  func_gl_gnulib_m4code_malloca ()
-  {
-    if ! $gl_gnulib_enabled_malloca; then
-      gl_MALLOCA
-      gl_gnulib_enabled_malloca=true
-      func_gl_gnulib_m4code_682e609604ccaac6be382e4ee3a4eaec
-    fi
-  }
   func_gl_gnulib_m4code_5264294aa0a5557541b53c8c741f7f31 ()
   {
     if ! $gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31; then
@@ -668,12 +685,30 @@ AC_DEFUN([gl_INIT],
       gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=true
     fi
   }
+  func_gl_gnulib_m4code_rawmemchr ()
+  {
+    if ! $gl_gnulib_enabled_rawmemchr; then
+      gl_FUNC_RAWMEMCHR
+      if test $HAVE_RAWMEMCHR = 0; then
+        AC_LIBOBJ([rawmemchr])
+        gl_PREREQ_RAWMEMCHR
+      fi
+      gl_STRING_MODULE_INDICATOR([rawmemchr])
+      gl_gnulib_enabled_rawmemchr=true
+    fi
+  }
   func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c ()
   {
     if ! $gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c; then
       gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=true
     fi
   }
+  func_gl_gnulib_m4code_scratch_buffer ()
+  {
+    if ! $gl_gnulib_enabled_scratch_buffer; then
+      gl_gnulib_enabled_scratch_buffer=true
+    fi
+  }
   func_gl_gnulib_m4code_strtoll ()
   {
     if ! $gl_gnulib_enabled_strtoll; then
@@ -700,7 +735,16 @@ AC_DEFUN([gl_INIT],
     fi
   }
   if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test 
$REPLACE_CANONICALIZE_FILE_NAME = 1; then
-    func_gl_gnulib_m4code_malloca
+    func_gl_gnulib_m4code_925677f0343de64b89a9f0c790b4104c
+  fi
+  if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test 
$REPLACE_CANONICALIZE_FILE_NAME = 1; then
+    func_gl_gnulib_m4code_idx
+  fi
+  if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test 
$REPLACE_CANONICALIZE_FILE_NAME = 1; then
+    func_gl_gnulib_m4code_rawmemchr
+  fi
+  if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test 
$REPLACE_CANONICALIZE_FILE_NAME = 1; then
+    func_gl_gnulib_m4code_scratch_buffer
   fi
   if test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1; then
     func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
@@ -747,15 +791,18 @@ AC_DEFUN([gl_INIT],
   if case $host_os in mingw*) false;; *) test $HAVE_GETRANDOM = 0 || test 
$REPLACE_GETRANDOM = 1;; esac; then
     func_gl_gnulib_m4code_open
   fi
-  if test $HAVE_READLINKAT = 0; then
+  if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then
     func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
   fi
-  if test $HAVE_READLINKAT = 0; then
+  if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then
     func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
   fi
   if { test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test 
$ac_cv_type_long_long_int = yes; then
     func_gl_gnulib_m4code_strtoll
   fi
+  if test $HAVE_TIMEZONE_T = 0; then
+    func_gl_gnulib_m4code_idx
+  fi
   if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then
     func_gl_gnulib_m4code_5264294aa0a5557541b53c8c741f7f31
   fi
@@ -772,17 +819,20 @@ AC_DEFUN([gl_INIT],
   AM_CONDITIONAL([gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b], 
[$gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_cloexec], [$gl_gnulib_enabled_cloexec])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_dirfd], [$gl_gnulib_enabled_dirfd])
+  AM_CONDITIONAL([gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c], 
[$gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_euidaccess], 
[$gl_gnulib_enabled_euidaccess])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_getdtablesize], 
[$gl_gnulib_enabled_getdtablesize])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], 
[$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], 
[$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1])
+  AM_CONDITIONAL([gl_GNULIB_ENABLED_idx], [$gl_gnulib_enabled_idx])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_lchmod], [$gl_gnulib_enabled_lchmod])
-  AM_CONDITIONAL([gl_GNULIB_ENABLED_malloca], [$gl_gnulib_enabled_malloca])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], 
[$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_open], [$gl_gnulib_enabled_open])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], 
[$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7])
+  AM_CONDITIONAL([gl_GNULIB_ENABLED_rawmemchr], [$gl_gnulib_enabled_rawmemchr])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], 
[$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c])
+  AM_CONDITIONAL([gl_GNULIB_ENABLED_scratch_buffer], 
[$gl_gnulib_enabled_scratch_buffer])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_utimens], [$gl_gnulib_enabled_utimens])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec], 
[$gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec])
@@ -971,6 +1021,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/dtoastr.c
   lib/dtotimespec.c
   lib/dup2.c
+  lib/eloop-threshold.h
   lib/errno.in.h
   lib/euidaccess.c
   lib/execinfo.c
@@ -989,6 +1040,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/flexmember.h
   lib/fpending.c
   lib/fpending.h
+  lib/free.c
   lib/fstatat.c
   lib/fsusage.c
   lib/fsusage.h
@@ -1015,6 +1067,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/gettimeofday.c
   lib/gl_openssl.h
   lib/group-member.c
+  lib/idx.h
   lib/ieee754.in.h
   lib/ignore-value.h
   lib/intprops.h
@@ -1023,8 +1076,11 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/libc-config.h
   lib/limits.in.h
   lib/lstat.c
-  lib/malloca.c
-  lib/malloca.h
+  lib/malloc/scratch_buffer.h
+  lib/malloc/scratch_buffer_dupfree.c
+  lib/malloc/scratch_buffer_grow.c
+  lib/malloc/scratch_buffer_grow_preserve.c
+  lib/malloc/scratch_buffer_set_array_size.c
   lib/md5.c
   lib/md5.h
   lib/memmem.c
@@ -1047,6 +1103,8 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/pselect.c
   lib/pthread_sigmask.c
   lib/qcopy-acl.c
+  lib/rawmemchr.c
+  lib/rawmemchr.valgrind
   lib/readlink.c
   lib/readlinkat.c
   lib/regcomp.c
@@ -1056,6 +1114,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/regex_internal.h
   lib/regexec.c
   lib/root-uid.h
+  lib/scratch_buffer.h
   lib/set-permissions.c
   lib/sha1.c
   lib/sha1.h
@@ -1145,6 +1204,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/flexmember.m4
   m4/fpending.m4
   m4/fpieee.m4
+  m4/free.m4
   m4/fstatat.m4
   m4/fsusage.m4
   m4/fsync.m4
@@ -1157,7 +1217,6 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/gettime.m4
   m4/gettimeofday.m4
   m4/gl-openssl.m4
-  m4/glibc21.m4
   m4/gnulib-common.m4
   m4/group-member.m4
   m4/ieee754-h.m4
@@ -1168,7 +1227,6 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/libgmp.m4
   m4/limits-h.m4
   m4/lstat.m4
-  m4/malloca.m4
   m4/manywarnings-c++.m4
   m4/manywarnings.m4
   m4/mbstate_t.m4
@@ -1192,6 +1250,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/pipe2.m4
   m4/pselect.m4
   m4/pthread_sigmask.m4
+  m4/rawmemchr.m4
   m4/readlink.m4
   m4/readlinkat.m4
   m4/regex.m4
@@ -1203,7 +1262,6 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/signal_h.m4
   m4/socklen.m4
   m4/ssize_t.m4
-  m4/st_dm_mode.m4
   m4/stat-time.m4
   m4/std-gnu11.m4
   m4/stdalign.m4
diff --git a/m4/group-member.m4 b/m4/group-member.m4
index ad7368c..7a7bb40 100644
--- a/m4/group-member.m4
+++ b/m4/group-member.m4
@@ -1,6 +1,6 @@
 # serial 14
 
-# Copyright (C) 1999-2001, 2003-2007, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/ieee754-h.m4 b/m4/ieee754-h.m4
index 8ec4583..68af3bd 100644
--- a/m4/ieee754-h.m4
+++ b/m4/ieee754-h.m4
@@ -1,6 +1,6 @@
 # Configure ieee754-h module
 
-dnl Copyright 2018-2020 Free Software Foundation, Inc.
+dnl Copyright 2018-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/include_next.m4 b/m4/include_next.m4
index 9221d9f..bdd542b 100644
--- a/m4/include_next.m4
+++ b/m4/include_next.m4
@@ -1,5 +1,5 @@
 # include_next.m4 serial 26
-dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
index 84b1654..f56e94a 100644
--- a/m4/inttypes.m4
+++ b/m4/inttypes.m4
@@ -1,5 +1,5 @@
 # inttypes.m4 serial 32
-dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index f4c5d3a..cadb16d 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -1,7 +1,7 @@
 # Enable large files on systems where this is not the default.
 # Enable support for files on Linux file systems with 64-bit inode numbers.
 
-# Copyright 1992-1996, 1998-2020 Free Software Foundation, Inc.
+# Copyright 1992-1996, 1998-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -25,7 +25,7 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
 # The following implementation works around a problem in autoconf <= 2.69;
 # AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
 # or configures them incorrectly in some cases.
-m4_version_prereq([2.70], [] ,[
+m4_version_prereq([2.70], [], [
 
 # _AC_SYS_LARGEFILE_TEST_INCLUDES
 # -------------------------------
diff --git a/m4/lchmod.m4 b/m4/lchmod.m4
index a86a304..3d181be 100644
--- a/m4/lchmod.m4
+++ b/m4/lchmod.m4
@@ -1,6 +1,6 @@
 #serial 8
 
-dnl Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/libgmp.m4 b/m4/libgmp.m4
index 1025f06..c630a19 100644
--- a/m4/libgmp.m4
+++ b/m4/libgmp.m4
@@ -1,6 +1,6 @@
 # libgmp.m4 serial 5
 # Configure the GMP library or a replacement.
-dnl Copyright 2020 Free Software Foundation, Inc.
+dnl Copyright 2020-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/limits-h.m4 b/m4/limits-h.m4
index 0b4f092..70dbb7d 100644
--- a/m4/limits-h.m4
+++ b/m4/limits-h.m4
@@ -1,6 +1,6 @@
 dnl Check whether limits.h has needed features.
 
-dnl Copyright 2016-2020 Free Software Foundation, Inc.
+dnl Copyright 2016-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index 3c2b214..62e9db2 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,6 +1,6 @@
 # serial 33
 
-# Copyright (C) 1997-2001, 2003-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/malloca.m4 b/m4/malloca.m4
index 930199d..7ee3377 100644
--- a/m4/malloca.m4
+++ b/m4/malloca.m4
@@ -1,6 +1,6 @@
 # malloca.m4 serial 2
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2020 Free Software Foundation,
-dnl Inc.
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 Free Software
+dnl Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index a37cd15..53ab153 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -1,5 +1,5 @@
 # manywarnings.m4 serial 21
-dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4
index 057ce12..e7fe358 100644
--- a/m4/mbstate_t.m4
+++ b/m4/mbstate_t.m4
@@ -1,5 +1,5 @@
-# mbstate_t.m4 serial 13
-dnl Copyright (C) 2000-2002, 2008-2020 Free Software Foundation, Inc.
+# mbstate_t.m4 serial 14
+dnl Copyright (C) 2000-2002, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -20,14 +20,7 @@ AC_DEFUN([AC_TYPE_MBSTATE_T],
      [AC_COMPILE_IFELSE(
         [AC_LANG_PROGRAM(
            [AC_INCLUDES_DEFAULT[
-/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
-   <wchar.h>.
-   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-   included before <wchar.h>.  */
-#include <stddef.h>
-#include <stdio.h>
-#include <time.h>
-#include <wchar.h>]],
+             #include <wchar.h>]],
            [[mbstate_t x; return sizeof x;]])],
         [ac_cv_type_mbstate_t=yes],
         [ac_cv_type_mbstate_t=no])])
diff --git a/m4/md5.m4 b/m4/md5.m4
index ca213ed..021b352 100644
--- a/m4/md5.m4
+++ b/m4/md5.m4
@@ -1,5 +1,5 @@
 # md5.m4 serial 14
-dnl Copyright (C) 2002-2006, 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/memmem.m4 b/m4/memmem.m4
index 35a5bb1..e2a785f 100644
--- a/m4/memmem.m4
+++ b/m4/memmem.m4
@@ -1,5 +1,5 @@
 # memmem.m4 serial 27
-dnl Copyright (C) 2002-2004, 2007-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mempcpy.m4 b/m4/mempcpy.m4
index 899f12a..c5ee2af 100644
--- a/m4/mempcpy.m4
+++ b/m4/mempcpy.m4
@@ -1,5 +1,5 @@
 # mempcpy.m4 serial 11
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2020 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/memrchr.m4 b/m4/memrchr.m4
index 95990ed..d0c0589 100644
--- a/m4/memrchr.m4
+++ b/m4/memrchr.m4
@@ -1,5 +1,5 @@
 # memrchr.m4 serial 10
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/minmax.m4 b/m4/minmax.m4
index e5b28b0..e21a687 100644
--- a/m4/minmax.m4
+++ b/m4/minmax.m4
@@ -1,5 +1,5 @@
 # minmax.m4 serial 4
-dnl Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mkostemp.m4 b/m4/mkostemp.m4
index 3e5b555..46534d4 100644
--- a/m4/mkostemp.m4
+++ b/m4/mkostemp.m4
@@ -1,5 +1,5 @@
 # mkostemp.m4 serial 2
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index 4e7e423..245649e 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,5 +1,5 @@
 # serial 35
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/mode_t.m4 b/m4/mode_t.m4
index f190951..3bd4b89 100644
--- a/m4/mode_t.m4
+++ b/m4/mode_t.m4
@@ -1,5 +1,5 @@
 # mode_t.m4 serial 2
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/multiarch.m4 b/m4/multiarch.m4
index 2c61afb..f1678d9 100644
--- a/m4/multiarch.m4
+++ b/m4/multiarch.m4
@@ -1,5 +1,5 @@
 # multiarch.m4 serial 9
-dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/nocrash.m4 b/m4/nocrash.m4
index 637a0ea..27412cd 100644
--- a/m4/nocrash.m4
+++ b/m4/nocrash.m4
@@ -1,5 +1,5 @@
 # nocrash.m4 serial 5
-dnl Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/nstrftime.m4 b/m4/nstrftime.m4
index e4eb87d..4674442 100644
--- a/m4/nstrftime.m4
+++ b/m4/nstrftime.m4
@@ -1,6 +1,6 @@
 # serial 36
 
-# Copyright (C) 1996-1997, 1999-2007, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-1997, 1999-2007, 2009-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/off_t.m4 b/m4/off_t.m4
index 6e19af8..bdec43c 100644
--- a/m4/off_t.m4
+++ b/m4/off_t.m4
@@ -1,5 +1,5 @@
 # off_t.m4 serial 1
-dnl Copyright (C) 2012-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/open-cloexec.m4 b/m4/open-cloexec.m4
index 11652d5..542a90f 100644
--- a/m4/open-cloexec.m4
+++ b/m4/open-cloexec.m4
@@ -1,6 +1,6 @@
 # Test whether O_CLOEXEC is defined.
 
-dnl Copyright 2017-2020 Free Software Foundation, Inc.
+dnl Copyright 2017-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/open-slash.m4 b/m4/open-slash.m4
index 5d84f2b..e619039 100644
--- a/m4/open-slash.m4
+++ b/m4/open-slash.m4
@@ -1,5 +1,5 @@
 # open-slash.m4 serial 2
-dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/open.m4 b/m4/open.m4
index 552eedf..c634386 100644
--- a/m4/open.m4
+++ b/m4/open.m4
@@ -1,5 +1,5 @@
 # open.m4 serial 15
-dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/pathmax.m4 b/m4/pathmax.m4
index bb4fdeb..e67c656 100644
--- a/m4/pathmax.m4
+++ b/m4/pathmax.m4
@@ -1,5 +1,5 @@
 # pathmax.m4 serial 11
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2020 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/pid_t.m4 b/m4/pid_t.m4
new file mode 100644
index 0000000..b7650a1
--- /dev/null
+++ b/m4/pid_t.m4
@@ -0,0 +1,38 @@
+# pid_t.m4 serial 4
+dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# The following implementation works around a problem in autoconf <= 2.69.
+m4_version_prereq([2.70], [], [
+
+dnl Define pid_t if the headers don't define it.
+AC_DEFUN([AC_TYPE_PID_T],
+[
+  AC_CHECK_TYPE([pid_t],
+    [],
+    [dnl On 64-bit native Windows, define it to the equivalent of 'intptr_t'
+     dnl (= 'long long' = '__int64'), because that is the return type
+     dnl of the _spawnv* functions
+     dnl 
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnvp-wspawnvp>
+     dnl and the argument type of the _cwait function
+     dnl 
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/cwait>.
+     dnl Otherwise (on 32-bit Windows and on old Unix platforms), define it
+     dnl to 'int'.
+     AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[
+          #if defined _WIN64 && !defined __CYGWIN__
+          LLP64
+          #endif
+          ]])
+       ],
+       [gl_pid_type='int'],
+       [gl_pid_type='__int64'])
+     AC_DEFINE_UNQUOTED([pid_t], [$gl_pid_type],
+       [Define as a signed integer type capable of holding a process 
identifier.])
+    ],
+    [AC_INCLUDES_DEFAULT])
+])
+
+])# m4_version_prereq 2.70
diff --git a/m4/pipe2.m4 b/m4/pipe2.m4
index d36821e..43d547c 100644
--- a/m4/pipe2.m4
+++ b/m4/pipe2.m4
@@ -1,5 +1,5 @@
 # pipe2.m4 serial 2
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/pselect.m4 b/m4/pselect.m4
index 08a5823..538fe7d 100644
--- a/m4/pselect.m4
+++ b/m4/pselect.m4
@@ -1,5 +1,5 @@
 # pselect.m4 serial 9
-dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4
index 030862d..eb4c784 100644
--- a/m4/pthread_sigmask.m4
+++ b/m4/pthread_sigmask.m4
@@ -1,5 +1,5 @@
 # pthread_sigmask.m4 serial 19
-dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/rawmemchr.m4 b/m4/rawmemchr.m4
new file mode 100644
index 0000000..f928465
--- /dev/null
+++ b/m4/rawmemchr.m4
@@ -0,0 +1,20 @@
+# rawmemchr.m4 serial 2
+dnl Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_RAWMEMCHR],
+[
+  dnl Persuade glibc <string.h> to declare rawmemchr().
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_CHECK_FUNCS([rawmemchr])
+  if test $ac_cv_func_rawmemchr = no; then
+    HAVE_RAWMEMCHR=0
+  fi
+])
+
+# Prerequisites of lib/strchrnul.c.
+AC_DEFUN([gl_PREREQ_RAWMEMCHR], [:])
diff --git a/m4/readlink.m4 b/m4/readlink.m4
index 9aa9e46..352788c 100644
--- a/m4/readlink.m4
+++ b/m4/readlink.m4
@@ -1,5 +1,5 @@
-# readlink.m4 serial 15
-dnl Copyright (C) 2003, 2007, 2009-2020 Free Software Foundation, Inc.
+# readlink.m4 serial 16
+dnl Copyright (C) 2003, 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -23,7 +23,7 @@ AC_DEFUN([gl_FUNC_READLINK],
     dnl Solaris 9 ignores trailing slash.
     dnl FreeBSD 7.2 dereferences only one level of links with trailing slash.
     AC_CACHE_CHECK([whether readlink handles trailing slash correctly],
-      [gl_cv_func_readlink_works],
+      [gl_cv_func_readlink_trailing_slash],
       [# We have readlink, so assume ln -s works.
        ln -s conftest.no-such conftest.link
        ln -s conftest.link conftest.lnk2
@@ -32,18 +32,22 @@ AC_DEFUN([gl_FUNC_READLINK],
            [[#include <unistd.h>
 ]], [[char buf[20];
       return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])],
-         [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no],
+         [gl_cv_func_readlink_trailing_slash=yes],
+         [gl_cv_func_readlink_trailing_slash=no],
          [case "$host_os" in
-                             # Guess yes on Linux systems.
-            linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;;
-                             # Guess yes on glibc systems.
-            *-gnu* | gnu*)   gl_cv_func_readlink_works="guessing yes" ;;
-                             # If we don't know, obey --enable-cross-guesses.
-            *)               
gl_cv_func_readlink_works="$gl_cross_guess_normal" ;;
+            # Guess yes on Linux or glibc systems.
+            linux-* | linux | *-gnu* | gnu*)
+              gl_cv_func_readlink_trailing_slash="guessing yes" ;;
+            # Guess no on AIX or HP-UX.
+            aix* | hpux*)
+              gl_cv_func_readlink_trailing_slash="guessing no" ;;
+            # If we don't know, obey --enable-cross-guesses.
+            *)
+              gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;;
           esac
          ])
       rm -f conftest.link conftest.lnk2])
-    case "$gl_cv_func_readlink_works" in
+    case "$gl_cv_func_readlink_trailing_slash" in
       *yes)
         if test "$gl_cv_decl_readlink_works" != yes; then
           REPLACE_READLINK=1
@@ -55,6 +59,43 @@ AC_DEFUN([gl_FUNC_READLINK],
         REPLACE_READLINK=1
         ;;
     esac
+
+    AC_CACHE_CHECK([whether readlink truncates results correctly],
+      [gl_cv_func_readlink_truncate],
+      [# We have readlink, so assume ln -s works.
+       ln -s ab conftest.link
+       AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(
+           [[#include <unistd.h>
+]], [[char c;
+      return readlink ("conftest.link", &c, 1) != 1;]])],
+         [gl_cv_func_readlink_truncate=yes],
+         [gl_cv_func_readlink_truncate=no],
+         [case "$host_os" in
+            # Guess yes on Linux or glibc systems.
+            linux-* | linux | *-gnu* | gnu*)
+              gl_cv_func_readlink_truncate="guessing yes" ;;
+            # Guess no on AIX or HP-UX.
+            aix* | hpux*)
+              gl_cv_func_readlink_truncate="guessing no" ;;
+            # If we don't know, obey --enable-cross-guesses.
+            *)
+              gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;;
+          esac
+         ])
+      rm -f conftest.link conftest.lnk2])
+    case $gl_cv_func_readlink_truncate in
+      *yes)
+        if test "$gl_cv_decl_readlink_works" != yes; then
+          REPLACE_READLINK=1
+        fi
+        ;;
+      *)
+        AC_DEFINE([READLINK_TRUNCATE_BUG], [1], [Define to 1 if readlink
+          sets errno instead of truncating a too-long link.])
+        REPLACE_READLINK=1
+        ;;
+    esac
   fi
 ])
 
diff --git a/m4/readlinkat.m4 b/m4/readlinkat.m4
index 6ef1f59..1ced672 100644
--- a/m4/readlinkat.m4
+++ b/m4/readlinkat.m4
@@ -1,7 +1,7 @@
-# serial 5
+# serial 6
 # See if we need to provide readlinkat replacement.
 
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -26,13 +26,10 @@ AC_DEFUN([gl_FUNC_READLINKAT],
              ssize_t readlinkat (int, char const *, char *, size_t);]])],
          [gl_cv_decl_readlinkat_works=yes],
          [gl_cv_decl_readlinkat_works=no])])
-    # Assume readinkat has the same trailing slash bug as readlink,
-    # as is the case on Mac Os X 10.10
-    case "$gl_cv_func_readlink_works" in
-      *yes)
-        if test "$gl_cv_decl_readlinkat_works" != yes; then
-          REPLACE_READLINKAT=1
-        fi
+    # Assume readlinkat has the same bugs as readlink,
+    # as is the case on OS X 10.10 with trailing slashes.
+    case 
$gl_cv_decl_readlinkat_works,$gl_cv_func_readlink_trailing_slash,$gl_cv_func_readlink_truncate
 in
+      *yes,*yes,*yes)
         ;;
       *)
         REPLACE_READLINKAT=1
diff --git a/m4/regex.m4 b/m4/regex.m4
index e723f59..850c572 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,6 +1,6 @@
-# serial 70
+# serial 71
 
-# Copyright (C) 1996-2001, 2003-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -354,7 +354,6 @@ AC_DEFUN([gl_PREREQ_REGEX],
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   AC_REQUIRE([gl_EEMALLOC])
-  AC_REQUIRE([gl_GLIBC21])
   AC_CHECK_HEADERS([libintl.h])
   AC_CHECK_FUNCS_ONCE([isblank iswctype])
   AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
diff --git a/m4/sha1.m4 b/m4/sha1.m4
index 35e3f75..fdba7a6 100644
--- a/m4/sha1.m4
+++ b/m4/sha1.m4
@@ -1,5 +1,5 @@
 # sha1.m4 serial 12
-dnl Copyright (C) 2002-2006, 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sha256.m4 b/m4/sha256.m4
index 85ff1d5..f49899c 100644
--- a/m4/sha256.m4
+++ b/m4/sha256.m4
@@ -1,5 +1,5 @@
 # sha256.m4 serial 8
-dnl Copyright (C) 2005, 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sha512.m4 b/m4/sha512.m4
index fe1592a..b45fdf5 100644
--- a/m4/sha512.m4
+++ b/m4/sha512.m4
@@ -1,5 +1,5 @@
 # sha512.m4 serial 9
-dnl Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sig2str.m4 b/m4/sig2str.m4
index 415290c..8951bbd 100644
--- a/m4/sig2str.m4
+++ b/m4/sig2str.m4
@@ -1,5 +1,5 @@
 # serial 7
-dnl Copyright (C) 2002, 2005-2006, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sigdescr_np.m4 b/m4/sigdescr_np.m4
index f0f3f97..f6fa631 100644
--- a/m4/sigdescr_np.m4
+++ b/m4/sigdescr_np.m4
@@ -1,5 +1,5 @@
 # sigdescr_np.m4 serial 1
-dnl Copyright (C) 2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/signal_h.m4 b/m4/signal_h.m4
index b262980..ff9f025 100644
--- a/m4/signal_h.m4
+++ b/m4/signal_h.m4
@@ -1,5 +1,5 @@
 # signal_h.m4 serial 19
-dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/socklen.m4 b/m4/socklen.m4
index 251960b..eca1d1b 100644
--- a/m4/socklen.m4
+++ b/m4/socklen.m4
@@ -1,5 +1,5 @@
 # socklen.m4 serial 11
-dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4
index 6c0a588..f0ed509 100644
--- a/m4/ssize_t.m4
+++ b/m4/ssize_t.m4
@@ -1,5 +1,5 @@
 # ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/st_dm_mode.m4 b/m4/st_dm_mode.m4
index 5dad161..b39c3ee 100644
--- a/m4/st_dm_mode.m4
+++ b/m4/st_dm_mode.m4
@@ -1,6 +1,7 @@
 # serial 6
 
-# Copyright (C) 1998-1999, 2001, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 1998-1999, 2001, 2009-2021 Free Software Foundation,
+# Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/stat-time.m4 b/m4/stat-time.m4
index 0ac3f72..df1c2a7 100644
--- a/m4/stat-time.m4
+++ b/m4/stat-time.m4
@@ -1,6 +1,6 @@
 # Checks for stat-related time functions.
 
-# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2020 Free Software
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2021 Free Software
 # Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
diff --git a/m4/std-gnu11.m4 b/m4/std-gnu11.m4
index db833d8..7b1a042 100644
--- a/m4/std-gnu11.m4
+++ b/m4/std-gnu11.m4
@@ -6,8 +6,10 @@
 # This implementation will be obsolete once we can assume Autoconf 2.70
 # or later is installed everywhere a Gnulib program might be developed.
 
+m4_version_prereq([2.70], [], [
 
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -822,3 +824,6 @@ dnl Tru64   N/A (no support)
 dnl with extended modes being tried first.
 [[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], 
[$1], [$2])[]dnl
 ])# _AC_PROG_CXX_CXX11
+
+
+])# m4_version_prereq
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index dcf778e..8dcb634 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -1,6 +1,6 @@
 # Check for stdalign.h that conforms to C11.
 
-dnl Copyright 2011-2020 Free Software Foundation, Inc.
+dnl Copyright 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index d8bc8ff..18e872f 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,6 +1,6 @@
 dnl A placeholder for <stddef.h>, for platforms that have issues.
 # stddef_h.m4 serial 7
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index d5f5d61..a785b44 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,5 +1,5 @@
-# stdint.m4 serial 56
-dnl Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# stdint.m4 serial 58
+dnl Copyright (C) 2001-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -34,7 +34,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
   AC_SUBST([HAVE_WCHAR_H])
 
   dnl Check for <inttypes.h>.
-  dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
+  AC_CHECK_HEADERS_ONCE([inttypes.h])
   if test $ac_cv_header_inttypes_h = yes; then
     HAVE_INTTYPES_H=1
   else
@@ -43,7 +43,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
   AC_SUBST([HAVE_INTTYPES_H])
 
   dnl Check for <sys/types.h>.
-  dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h.
+  AC_CHECK_HEADERS_ONCE([sys/types.h])
   if test $ac_cv_header_sys_types_h = yes; then
     HAVE_SYS_TYPES_H=1
   else
@@ -493,13 +493,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
 dnl gl_STDINT_INCLUDES
 AC_DEFUN([gl_STDINT_INCLUDES],
 [[
-  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-     included before <wchar.h>.  */
   #include <stddef.h>
   #include <signal.h>
   #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
   # include <wchar.h>
   #endif
 ]])
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 5f968bc..4c3f24a 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 50
-dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
+# stdio_h.m4 serial 52
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -109,6 +109,11 @@ AC_DEFUN([gl_STDIO_H],
     renameat snprintf tmpfile vdprintf vsnprintf])
 
   AC_REQUIRE([AC_C_RESTRICT])
+
+  AC_CHECK_DECLS_ONCE([fcloseall])
+  if test $ac_cv_have_decl_fcloseall = no; then
+    HAVE_DECL_FCLOSEALL=0
+  fi
 ])
 
 AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
@@ -175,7 +180,15 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
   GNULIB_VPRINTF_POSIX=0;        AC_SUBST([GNULIB_VPRINTF_POSIX])
   GNULIB_VSNPRINTF=0;            AC_SUBST([GNULIB_VSNPRINTF])
   GNULIB_VSPRINTF_POSIX=0;       AC_SUBST([GNULIB_VSPRINTF_POSIX])
+  dnl Support Microsoft deprecated alias function names by default.
+  GNULIB_MDA_FCLOSEALL=1;        AC_SUBST([GNULIB_MDA_FCLOSEALL])
+  GNULIB_MDA_FDOPEN=1;           AC_SUBST([GNULIB_MDA_FDOPEN])
+  GNULIB_MDA_FILENO=1;           AC_SUBST([GNULIB_MDA_FILENO])
+  GNULIB_MDA_GETW=1;             AC_SUBST([GNULIB_MDA_GETW])
+  GNULIB_MDA_PUTW=1;             AC_SUBST([GNULIB_MDA_PUTW])
+  GNULIB_MDA_TEMPNAM=1;          AC_SUBST([GNULIB_MDA_TEMPNAM])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_DECL_FCLOSEALL=1;         AC_SUBST([HAVE_DECL_FCLOSEALL])
   HAVE_DECL_FPURGE=1;            AC_SUBST([HAVE_DECL_FPURGE])
   HAVE_DECL_FSEEKO=1;            AC_SUBST([HAVE_DECL_FSEEKO])
   HAVE_DECL_FTELLO=1;            AC_SUBST([HAVE_DECL_FTELLO])
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4
index 743066a..5a02972 100644
--- a/m4/stdlib_h.m4
+++ b/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 49
-dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 55
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -22,13 +22,28 @@ AC_DEFUN([gl_STDLIB_H],
 #if HAVE_RANDOM_H
 # include <random.h>
 #endif
-    ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
+    ]], [_Exit aligned_alloc atoll canonicalize_file_name free
+    getloadavg getsubopt grantpt
     initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps
-    posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray
-    realpath rpmatch secure_getenv setenv setstate setstate_r srandom
-    srandom_r strtod strtold strtoll strtoull unlockpt unsetenv])
+    posix_memalign posix_openpt ptsname ptsname_r qsort_r
+    random random_r reallocarray realpath rpmatch secure_getenv setenv
+    setstate setstate_r srandom srandom_r
+    strtod strtold strtoll strtoull unlockpt unsetenv])
 
   AC_REQUIRE([AC_C_RESTRICT])
+
+  AC_CHECK_DECLS_ONCE([ecvt])
+  if test $ac_cv_have_decl_ecvt = no; then
+    HAVE_DECL_ECVT=0
+  fi
+  AC_CHECK_DECLS_ONCE([fcvt])
+  if test $ac_cv_have_decl_fcvt = no; then
+    HAVE_DECL_FCVT=0
+  fi
+  AC_CHECK_DECLS_ONCE([gcvt])
+  if test $ac_cv_have_decl_gcvt = no; then
+    HAVE_DECL_GCVT=0
+  fi
 ])
 
 AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
@@ -43,9 +58,11 @@ AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
 AC_DEFUN([gl_STDLIB_H_DEFAULTS],
 [
   GNULIB__EXIT=0;         AC_SUBST([GNULIB__EXIT])
+  GNULIB_ALIGNED_ALLOC=0; AC_SUBST([GNULIB_ALIGNED_ALLOC])
   GNULIB_ATOLL=0;         AC_SUBST([GNULIB_ATOLL])
   GNULIB_CALLOC_POSIX=0;  AC_SUBST([GNULIB_CALLOC_POSIX])
   GNULIB_CANONICALIZE_FILE_NAME=0;  AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME])
+  GNULIB_FREE_POSIX=0;    AC_SUBST([GNULIB_FREE_POSIX])
   GNULIB_GETLOADAVG=0;    AC_SUBST([GNULIB_GETLOADAVG])
   GNULIB_GETSUBOPT=0;     AC_SUBST([GNULIB_GETSUBOPT])
   GNULIB_GRANTPT=0;       AC_SUBST([GNULIB_GRANTPT])
@@ -56,6 +73,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   GNULIB_MKOSTEMPS=0;     AC_SUBST([GNULIB_MKOSTEMPS])
   GNULIB_MKSTEMP=0;       AC_SUBST([GNULIB_MKSTEMP])
   GNULIB_MKSTEMPS=0;      AC_SUBST([GNULIB_MKSTEMPS])
+  GNULIB_POSIX_MEMALIGN=0;AC_SUBST([GNULIB_POSIX_MEMALIGN])
   GNULIB_POSIX_OPENPT=0;  AC_SUBST([GNULIB_POSIX_OPENPT])
   GNULIB_PTSNAME=0;       AC_SUBST([GNULIB_PTSNAME])
   GNULIB_PTSNAME_R=0;     AC_SUBST([GNULIB_PTSNAME_R])
@@ -77,10 +95,20 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   GNULIB_UNLOCKPT=0;      AC_SUBST([GNULIB_UNLOCKPT])
   GNULIB_UNSETENV=0;      AC_SUBST([GNULIB_UNSETENV])
   GNULIB_WCTOMB=0;        AC_SUBST([GNULIB_WCTOMB])
+  dnl Support Microsoft deprecated alias function names by default.
+  GNULIB_MDA_ECVT=1;      AC_SUBST([GNULIB_MDA_ECVT])
+  GNULIB_MDA_FCVT=1;      AC_SUBST([GNULIB_MDA_FCVT])
+  GNULIB_MDA_GCVT=1;      AC_SUBST([GNULIB_MDA_GCVT])
+  GNULIB_MDA_MKTEMP=1;    AC_SUBST([GNULIB_MDA_MKTEMP])
+  GNULIB_MDA_PUTENV=1;    AC_SUBST([GNULIB_MDA_PUTENV])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE__EXIT=1;              AC_SUBST([HAVE__EXIT])
+  HAVE_ALIGNED_ALLOC=1;      AC_SUBST([HAVE_ALIGNED_ALLOC])
   HAVE_ATOLL=1;              AC_SUBST([HAVE_ATOLL])
   HAVE_CANONICALIZE_FILE_NAME=1;  AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
+  HAVE_DECL_ECVT=1;          AC_SUBST([HAVE_DECL_ECVT])
+  HAVE_DECL_FCVT=1;          AC_SUBST([HAVE_DECL_FCVT])
+  HAVE_DECL_GCVT=1;          AC_SUBST([HAVE_DECL_GCVT])
   HAVE_DECL_GETLOADAVG=1;    AC_SUBST([HAVE_DECL_GETLOADAVG])
   HAVE_GETSUBOPT=1;          AC_SUBST([HAVE_GETSUBOPT])
   HAVE_GRANTPT=1;            AC_SUBST([HAVE_GRANTPT])
@@ -92,6 +120,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   HAVE_MKOSTEMPS=1;          AC_SUBST([HAVE_MKOSTEMPS])
   HAVE_MKSTEMP=1;            AC_SUBST([HAVE_MKSTEMP])
   HAVE_MKSTEMPS=1;           AC_SUBST([HAVE_MKSTEMPS])
+  HAVE_POSIX_MEMALIGN=1;     AC_SUBST([HAVE_POSIX_MEMALIGN])
   HAVE_POSIX_OPENPT=1;       AC_SUBST([HAVE_POSIX_OPENPT])
   HAVE_PTSNAME=1;            AC_SUBST([HAVE_PTSNAME])
   HAVE_PTSNAME_R=1;          AC_SUBST([HAVE_PTSNAME_R])
@@ -115,12 +144,15 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   HAVE_SYS_LOADAVG_H=0;      AC_SUBST([HAVE_SYS_LOADAVG_H])
   HAVE_UNLOCKPT=1;           AC_SUBST([HAVE_UNLOCKPT])
   HAVE_DECL_UNSETENV=1;      AC_SUBST([HAVE_DECL_UNSETENV])
+  REPLACE_ALIGNED_ALLOC=0;   AC_SUBST([REPLACE_ALIGNED_ALLOC])
   REPLACE_CALLOC=0;          AC_SUBST([REPLACE_CALLOC])
   REPLACE_CANONICALIZE_FILE_NAME=0;  AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
+  REPLACE_FREE=0;            AC_SUBST([REPLACE_FREE])
   REPLACE_INITSTATE=0;       AC_SUBST([REPLACE_INITSTATE])
   REPLACE_MALLOC=0;          AC_SUBST([REPLACE_MALLOC])
   REPLACE_MBTOWC=0;          AC_SUBST([REPLACE_MBTOWC])
   REPLACE_MKSTEMP=0;         AC_SUBST([REPLACE_MKSTEMP])
+  REPLACE_POSIX_MEMALIGN=0;  AC_SUBST([REPLACE_POSIX_MEMALIGN])
   REPLACE_PTSNAME=0;         AC_SUBST([REPLACE_PTSNAME])
   REPLACE_PTSNAME_R=0;       AC_SUBST([REPLACE_PTSNAME_R])
   REPLACE_PUTENV=0;          AC_SUBST([REPLACE_PUTENV])
diff --git a/m4/stpcpy.m4 b/m4/stpcpy.m4
index 0f0fa9e..28db4f4 100644
--- a/m4/stpcpy.m4
+++ b/m4/stpcpy.m4
@@ -1,5 +1,5 @@
 # stpcpy.m4 serial 8
-dnl Copyright (C) 2002, 2007, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index 29796b8..3e65355 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -1,11 +1,11 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2020 Free Software Foundation, Inc.
+# Copyright (C) 2007-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 27
+# serial 28
 
 # Written by Paul Eggert.
 
@@ -86,6 +86,9 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   GNULIB_STRSIGNAL=0;        AC_SUBST([GNULIB_STRSIGNAL])
   GNULIB_STRVERSCMP=0;       AC_SUBST([GNULIB_STRVERSCMP])
   HAVE_MBSLEN=0;             AC_SUBST([HAVE_MBSLEN])
+  dnl Support Microsoft deprecated alias function names by default.
+  GNULIB_MDA_MEMCCPY=1;      AC_SUBST([GNULIB_MDA_MEMCCPY])
+  GNULIB_MDA_STRDUP=1;       AC_SUBST([GNULIB_MDA_STRDUP])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_EXPLICIT_BZERO=1;        AC_SUBST([HAVE_EXPLICIT_BZERO])
   HAVE_FFSL=1;                  AC_SUBST([HAVE_FFSL])
diff --git a/m4/strnlen.m4 b/m4/strnlen.m4
index 71b8e1b..bb9a680 100644
--- a/m4/strnlen.m4
+++ b/m4/strnlen.m4
@@ -1,5 +1,5 @@
 # strnlen.m4 serial 13
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4
index 4958e3d..d767d57 100644
--- a/m4/strtoimax.m4
+++ b/m4/strtoimax.m4
@@ -1,5 +1,5 @@
 # strtoimax.m4 serial 16
-dnl Copyright (C) 2002-2004, 2006, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/strtoll.m4 b/m4/strtoll.m4
index edcde3b..d2c9e53 100644
--- a/m4/strtoll.m4
+++ b/m4/strtoll.m4
@@ -1,5 +1,5 @@
 # strtoll.m4 serial 8
-dnl Copyright (C) 2002, 2004, 2006, 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004, 2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/symlink.m4 b/m4/symlink.m4
index 9cfdf93..209dece 100644
--- a/m4/symlink.m4
+++ b/m4/symlink.m4
@@ -1,7 +1,7 @@
 # serial 9
 # See if we need to provide symlink replacement.
 
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_random_h.m4 b/m4/sys_random_h.m4
index 8c5d537..45e0469 100644
--- a/m4/sys_random_h.m4
+++ b/m4/sys_random_h.m4
@@ -1,5 +1,5 @@
 # sys_random_h.m4 serial 5
-dnl Copyright (C) 2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_select_h.m4 b/m4/sys_select_h.m4
index fa19bb6..4b33d31 100644
--- a/m4/sys_select_h.m4
+++ b/m4/sys_select_h.m4
@@ -1,5 +1,5 @@
 # sys_select_h.m4 serial 20
-dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
index bf902f0..503cb96 100644
--- a/m4/sys_socket_h.m4
+++ b/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
 # sys_socket_h.m4 serial 25
-dnl Copyright (C) 2005-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4
index 929144d..e8eac71 100644
--- a/m4/sys_stat_h.m4
+++ b/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 34   -*- Autoconf -*-
-dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 36   -*- Autoconf -*-
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -71,6 +71,7 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
   GNULIB_GETUMASK=0;    AC_SUBST([GNULIB_GETUMASK])
   GNULIB_LCHMOD=0;      AC_SUBST([GNULIB_LCHMOD])
   GNULIB_LSTAT=0;       AC_SUBST([GNULIB_LSTAT])
+  GNULIB_MKDIR=0;       AC_SUBST([GNULIB_MKDIR])
   GNULIB_MKDIRAT=0;     AC_SUBST([GNULIB_MKDIRAT])
   GNULIB_MKFIFO=0;      AC_SUBST([GNULIB_MKFIFO])
   GNULIB_MKFIFOAT=0;    AC_SUBST([GNULIB_MKFIFOAT])
@@ -79,6 +80,10 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
   GNULIB_STAT=0;        AC_SUBST([GNULIB_STAT])
   GNULIB_UTIMENSAT=0;   AC_SUBST([GNULIB_UTIMENSAT])
   GNULIB_OVERRIDES_STRUCT_STAT=0; AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT])
+  dnl Support Microsoft deprecated alias function names by default.
+  GNULIB_MDA_CHMOD=1;   AC_SUBST([GNULIB_MDA_CHMOD])
+  GNULIB_MDA_MKDIR=1;   AC_SUBST([GNULIB_MDA_MKDIR])
+  GNULIB_MDA_UMASK=1;   AC_SUBST([GNULIB_MDA_UMASK])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_FCHMODAT=1;      AC_SUBST([HAVE_FCHMODAT])
   HAVE_FSTATAT=1;       AC_SUBST([HAVE_FSTATAT])
diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4
index 8fc8599..64f133d 100644
--- a/m4/sys_time_h.m4
+++ b/m4/sys_time_h.m4
@@ -1,7 +1,7 @@
 # Configure a replacement for <sys/time.h>.
 # serial 9
 
-# Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
index be918dc..2172c83 100644
--- a/m4/sys_types_h.m4
+++ b/m4/sys_types_h.m4
@@ -1,5 +1,5 @@
-# sys_types_h.m4 serial 9
-dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
+# sys_types_h.m4 serial 11
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -36,25 +36,23 @@ AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
 
 # This works around a buggy version in autoconf <= 2.69.
 # See <https://lists.gnu.org/r/autoconf/2016-08/msg00014.html>
+# The 2.70 version isn't quoted properly, so override it too.
 
-m4_version_prereq([2.70], [], [
-
-# This is taken from the following Autoconf patch:
-# 
https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=e17a30e987d7ee695fb4294a82d987ec3dc9b974
+m4_version_prereq([2.70.1], [], [
 
 m4_undefine([AC_HEADER_MAJOR])
 AC_DEFUN([AC_HEADER_MAJOR],
 [AC_CHECK_HEADERS_ONCE([sys/types.h])
 AC_CHECK_HEADER([sys/mkdev.h],
-  [AC_DEFINE([MAJOR_IN_MKDEV], [1],
-    [Define to 1 if `major', `minor', and `makedev' are declared in
-     <mkdev.h>.])])
+                [AC_DEFINE([MAJOR_IN_MKDEV], [1],
+                           [Define to 1 if `major', `minor', and `makedev' are
+                            declared in <mkdev.h>.])])
 if test $ac_cv_header_sys_mkdev_h = no; then
   AC_CHECK_HEADER([sys/sysmacros.h],
-    [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
-      [Define to 1 if `major', `minor', and `makedev' are declared in
-       <sysmacros.h>.])])
+                  [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
+                             [Define to 1 if `major', `minor', and `makedev'
+                              are declared in <sysmacros.h>.])])
 fi
-])
+])# AC_HEADER_MAJOR
 
 ])
diff --git a/m4/tempname.m4 b/m4/tempname.m4
index da439f0..14c796d 100644
--- a/m4/tempname.m4
+++ b/m4/tempname.m4
@@ -1,6 +1,6 @@
 #serial 5
 
-# Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index a15c09d..07e6967 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -1,8 +1,8 @@
 # Configure a more-standard replacement for <time.h>.
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc.
 
-# serial 12
+# serial 13
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -116,6 +116,8 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
   GNULIB_TIME_R=0;                       AC_SUBST([GNULIB_TIME_R])
   GNULIB_TIME_RZ=0;                      AC_SUBST([GNULIB_TIME_RZ])
   GNULIB_TZSET=0;                        AC_SUBST([GNULIB_TZSET])
+  dnl Support Microsoft deprecated alias function names by default.
+  GNULIB_MDA_TZSET=1;                    AC_SUBST([GNULIB_MDA_TZSET])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_LOCALTIME_R=1;               AC_SUBST([HAVE_DECL_LOCALTIME_R])
   HAVE_NANOSLEEP=1;                      AC_SUBST([HAVE_NANOSLEEP])
diff --git a/m4/time_r.m4 b/m4/time_r.m4
index 0e86d44..713e93a 100644
--- a/m4/time_r.m4
+++ b/m4/time_r.m4
@@ -1,6 +1,6 @@
 dnl Reentrant time functions: localtime_r, gmtime_r.
 
-dnl Copyright (C) 2003, 2006-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/time_rz.m4 b/m4/time_rz.m4
index 30161c0..34ef0ba 100644
--- a/m4/time_rz.m4
+++ b/m4/time_rz.m4
@@ -1,6 +1,6 @@
 dnl Time zone functions: tzalloc, localtime_rz, etc.
 
-dnl Copyright (C) 2015-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2015-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/timegm.m4 b/m4/timegm.m4
index 67c0c3b..098c857 100644
--- a/m4/timegm.m4
+++ b/m4/timegm.m4
@@ -1,5 +1,5 @@
 # timegm.m4 serial 12
-dnl Copyright (C) 2003, 2007, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/timer_time.m4 b/m4/timer_time.m4
index fdb288d..f0e5785 100644
--- a/m4/timer_time.m4
+++ b/m4/timer_time.m4
@@ -1,5 +1,5 @@
 # timer_time.m4 serial 4
-dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/timespec.m4 b/m4/timespec.m4
index e71628d..40307d4 100644
--- a/m4/timespec.m4
+++ b/m4/timespec.m4
@@ -1,6 +1,6 @@
 #serial 15
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/tm_gmtoff.m4 b/m4/tm_gmtoff.m4
index 41517d8..2743999 100644
--- a/m4/tm_gmtoff.m4
+++ b/m4/tm_gmtoff.m4
@@ -1,5 +1,5 @@
 # tm_gmtoff.m4 serial 3
-dnl Copyright (C) 2002, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index b4734da..0f26fb9 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 81
-dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
+# unistd_h.m4 serial 85
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -41,7 +41,9 @@ AC_DEFUN([gl_UNISTD_H],
 #  include <io.h>
 # endif
 #endif
-    ]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir
+    ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess
+    execl execle execlp execv execve execvp execvpe
+    faccessat fchdir
     fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
     getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
     getusershell setusershell endusershell
@@ -50,6 +52,11 @@ AC_DEFUN([gl_UNISTD_H],
     truncate ttyname_r unlink unlinkat usleep])
 
   AC_REQUIRE([AC_C_RESTRICT])
+
+  AC_CHECK_DECLS_ONCE([execvpe])
+  if test $ac_cv_have_decl_execvpe = no; then
+    HAVE_DECL_EXECVPE=0
+  fi
 ])
 
 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -73,6 +80,13 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_DUP3=0;                 AC_SUBST([GNULIB_DUP3])
   GNULIB_ENVIRON=0;              AC_SUBST([GNULIB_ENVIRON])
   GNULIB_EUIDACCESS=0;           AC_SUBST([GNULIB_EUIDACCESS])
+  GNULIB_EXECL=0;                AC_SUBST([GNULIB_EXECL])
+  GNULIB_EXECLE=0;               AC_SUBST([GNULIB_EXECLE])
+  GNULIB_EXECLP=0;               AC_SUBST([GNULIB_EXECLP])
+  GNULIB_EXECV=0;                AC_SUBST([GNULIB_EXECV])
+  GNULIB_EXECVE=0;               AC_SUBST([GNULIB_EXECVE])
+  GNULIB_EXECVP=0;               AC_SUBST([GNULIB_EXECVP])
+  GNULIB_EXECVPE=0;              AC_SUBST([GNULIB_EXECVPE])
   GNULIB_FACCESSAT=0;            AC_SUBST([GNULIB_FACCESSAT])
   GNULIB_FCHDIR=0;               AC_SUBST([GNULIB_FCHDIR])
   GNULIB_FCHOWNAT=0;             AC_SUBST([GNULIB_FCHOWNAT])
@@ -117,11 +131,34 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_UNLINKAT=0;             AC_SUBST([GNULIB_UNLINKAT])
   GNULIB_USLEEP=0;               AC_SUBST([GNULIB_USLEEP])
   GNULIB_WRITE=0;                AC_SUBST([GNULIB_WRITE])
+  dnl Support Microsoft deprecated alias function names by default.
+  GNULIB_MDA_ACCESS=1;           AC_SUBST([GNULIB_MDA_ACCESS])
+  GNULIB_MDA_CHDIR=1;            AC_SUBST([GNULIB_MDA_CHDIR])
+  GNULIB_MDA_CLOSE=1;            AC_SUBST([GNULIB_MDA_CLOSE])
+  GNULIB_MDA_DUP=1;              AC_SUBST([GNULIB_MDA_DUP])
+  GNULIB_MDA_DUP2=1;             AC_SUBST([GNULIB_MDA_DUP2])
+  GNULIB_MDA_EXECL=1;            AC_SUBST([GNULIB_MDA_EXECL])
+  GNULIB_MDA_EXECLE=1;           AC_SUBST([GNULIB_MDA_EXECLE])
+  GNULIB_MDA_EXECLP=1;           AC_SUBST([GNULIB_MDA_EXECLP])
+  GNULIB_MDA_EXECV=1;            AC_SUBST([GNULIB_MDA_EXECV])
+  GNULIB_MDA_EXECVE=1;           AC_SUBST([GNULIB_MDA_EXECVE])
+  GNULIB_MDA_EXECVP=1;           AC_SUBST([GNULIB_MDA_EXECVP])
+  GNULIB_MDA_EXECVPE=1;          AC_SUBST([GNULIB_MDA_EXECVPE])
+  GNULIB_MDA_GETCWD=1;           AC_SUBST([GNULIB_MDA_GETCWD])
+  GNULIB_MDA_GETPID=1;           AC_SUBST([GNULIB_MDA_GETPID])
+  GNULIB_MDA_ISATTY=1;           AC_SUBST([GNULIB_MDA_ISATTY])
+  GNULIB_MDA_LSEEK=1;            AC_SUBST([GNULIB_MDA_LSEEK])
+  GNULIB_MDA_READ=1;             AC_SUBST([GNULIB_MDA_READ])
+  GNULIB_MDA_RMDIR=1;            AC_SUBST([GNULIB_MDA_RMDIR])
+  GNULIB_MDA_SWAB=1;             AC_SUBST([GNULIB_MDA_SWAB])
+  GNULIB_MDA_UNLINK=1;           AC_SUBST([GNULIB_MDA_UNLINK])
+  GNULIB_MDA_WRITE=1;            AC_SUBST([GNULIB_MDA_WRITE])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_CHOWN=1;           AC_SUBST([HAVE_CHOWN])
   HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE])
   HAVE_DUP3=1;            AC_SUBST([HAVE_DUP3])
   HAVE_EUIDACCESS=1;      AC_SUBST([HAVE_EUIDACCESS])
+  HAVE_EXECVPE=1;         AC_SUBST([HAVE_EXECVPE])
   HAVE_FACCESSAT=1;       AC_SUBST([HAVE_FACCESSAT])
   HAVE_FCHDIR=1;          AC_SUBST([HAVE_FCHDIR])
   HAVE_FCHOWNAT=1;        AC_SUBST([HAVE_FCHOWNAT])
@@ -152,6 +189,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_UNLINKAT=1;        AC_SUBST([HAVE_UNLINKAT])
   HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
   HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
+  HAVE_DECL_EXECVPE=1;    AC_SUBST([HAVE_DECL_EXECVPE])
   HAVE_DECL_FCHDIR=1;     AC_SUBST([HAVE_DECL_FCHDIR])
   HAVE_DECL_FDATASYNC=1;  AC_SUBST([HAVE_DECL_FDATASYNC])
   HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
@@ -169,6 +207,13 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_CLOSE=0;        AC_SUBST([REPLACE_CLOSE])
   REPLACE_DUP=0;          AC_SUBST([REPLACE_DUP])
   REPLACE_DUP2=0;         AC_SUBST([REPLACE_DUP2])
+  REPLACE_EXECL=0;        AC_SUBST([REPLACE_EXECL])
+  REPLACE_EXECLE=0;       AC_SUBST([REPLACE_EXECLE])
+  REPLACE_EXECLP=0;       AC_SUBST([REPLACE_EXECLP])
+  REPLACE_EXECV=0;        AC_SUBST([REPLACE_EXECV])
+  REPLACE_EXECVE=0;       AC_SUBST([REPLACE_EXECVE])
+  REPLACE_EXECVP=0;       AC_SUBST([REPLACE_EXECVP])
+  REPLACE_EXECVPE=0;      AC_SUBST([REPLACE_EXECVPE])
   REPLACE_FACCESSAT=0;    AC_SUBST([REPLACE_FACCESSAT])
   REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
   REPLACE_FTRUNCATE=0;    AC_SUBST([REPLACE_FTRUNCATE])
diff --git a/m4/unlocked-io.m4 b/m4/unlocked-io.m4
index 38658e6..a2dc8a1 100644
--- a/m4/unlocked-io.m4
+++ b/m4/unlocked-io.m4
@@ -1,6 +1,6 @@
 # unlocked-io.m4 serial 15
 
-# Copyright (C) 1998-2006, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 1998-2006, 2009-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/utimens.m4 b/m4/utimens.m4
index 3d31085..2ee4ef9 100644
--- a/m4/utimens.m4
+++ b/m4/utimens.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2003-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/utimensat.m4 b/m4/utimensat.m4
index e9e4f26..bdabe24 100644
--- a/m4/utimensat.m4
+++ b/m4/utimensat.m4
@@ -1,7 +1,7 @@
 # serial 7
 # See if we need to provide utimensat replacement.
 
-dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/utimes.m4 b/m4/utimes.m4
index 877bfd2..0440e78 100644
--- a/m4/utimes.m4
+++ b/m4/utimes.m4
@@ -1,7 +1,7 @@
 # Detect some bugs in glibc's implementation of utimes.
 # serial 8
 
-dnl Copyright (C) 2003-2005, 2009-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2005, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/vararrays.m4 b/m4/vararrays.m4
index 49ded2e..36946ac 100644
--- a/m4/vararrays.m4
+++ b/m4/vararrays.m4
@@ -1,17 +1,19 @@
 # Check for variable-length arrays.
 
-# serial 5
+# serial 6
 
 # From Paul Eggert
 
-# Copyright (C) 2001, 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# This is a copy of AC_C_VARARRAYS from a recent development version
-# of Autoconf.  It replaces Autoconf's version, or for pre-2.61 autoconf
-# it defines the macro that Autoconf lacks.
+m4_version_prereq([2.70], [], [
+
+# AC_C_VARARRAYS
+# --------------
+# Check whether the C compiler supports variable-length arrays.
 AC_DEFUN([AC_C_VARARRAYS],
 [
   AC_CACHE_CHECK([for variable-length arrays],
@@ -27,7 +29,7 @@ AC_DEFUN([AC_C_VARARRAYS],
              [[/* Test for VLA support.  This test is partly inspired
                   from examples in the C standard.  Use at least two VLA
                   functions to detect the GCC 3.4.3 bug described in:
-                  https://lists.gnu.org/r/bug-gnulib/2014-08/msg00014.html
+                  
https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html
                   */
                #ifdef __STDC_NO_VLA__
                 syntax error;
@@ -66,3 +68,5 @@ AC_DEFUN([AC_C_VARARRAYS],
        if the compiler does not already define this.])
   fi
 ])
+
+])
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index d4e4b07..9e24d89 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,5 +1,5 @@
 # warnings.m4 serial 16
-dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
index e48d464..34db10e 100644
--- a/m4/wchar_t.m4
+++ b/m4/wchar_t.m4
@@ -1,5 +1,5 @@
 # wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/zzgnulib.m4 b/m4/zzgnulib.m4
index 98fa68f..b953384 100644
--- a/m4/zzgnulib.m4
+++ b/m4/zzgnulib.m4
@@ -1,5 +1,5 @@
 # zzgnulib.m4 serial 1
-dnl Copyright (C) 2020 Free Software Foundation, Inc.
+dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/make-dist b/make-dist
index de4f343..606fdd9 100755
--- a/make-dist
+++ b/make-dist
@@ -1,7 +1,7 @@
 #!/bin/sh
 ### make-dist: create an Emacs distribution tar file from current srcdir
 
-## Copyright (C) 1995, 1997-1998, 2000-2020 Free Software Foundation,
+## Copyright (C) 1995, 1997-1998, 2000-2021 Free Software Foundation,
 ## Inc.
 
 ## This file is part of GNU Emacs.
@@ -190,7 +190,7 @@ if [ ! "${version}" ]; then
   exit 1
 fi
 
-echo Version number is $version
+echo Version number is "$version"
 
 if [ $update = yes ]; then
   if ! grep -q "tree holds version  *${version}" README; then
@@ -257,8 +257,8 @@ if [ $check = yes ]; then
   bogosities=
   while read elc; do
       el=`echo $elc | sed 's/c$//'`
-      [ -r $el ] || continue
-      [ $elc -nt $el ] || bogosities="$bogosities $elc"
+      [ -r "$el" ] || continue
+      [ "$elc" -nt "$el" ] || bogosities="$bogosities $elc"
   done < $temp_elc
 
   if [ x"${bogosities}" != x"" ]; then
@@ -271,7 +271,7 @@ if [ $check = yes ]; then
 
   bogosities=
   for file in $losers; do
-    grep -q "^;.*no-byte-compile: t" $file && continue
+    grep -q "^;.*no-byte-compile: t" "$file" && continue
     case $file in
       site-init.el | site-load.el | site-start.el | default.el) continue ;;
     esac
@@ -295,8 +295,8 @@ if [ $check = yes ]; then
       info=`sed -n 's/^@setfilename //p' $texi | sed 's|.*info/||'`
       [ x"${info}" != x"" ] || continue
       info=info/$info
-      [ -r $info ] || continue
-      [ $info -nt $texi ] || bogosities="$bogosities $info"
+      [ -r "$info" ] || continue
+      [ "$info" -nt "$texi" ] || bogosities="$bogosities $info"
   done < $temp_el
 
   rm -f $temp_el
@@ -424,7 +424,7 @@ if [ $verbose = yes ] && (mkdir --verbose ${tempdir}) 
>/dev/null 2>&1; then
   mkdir_verbose='mkdir --verbose'
 else
   mkdir $tempdir || exit
-  mkdir_verbose=mkdir
+  mkdir_verbose="mkdir"
 fi
 
 # file_to_skip is normally empty to link every file,
@@ -467,7 +467,7 @@ while read file; do
   case $file in
     MANIFEST) ln $manifest $tempdir/MANIFEST || exit ;;
     $file_to_skip) continue ;;
-    *) ln $file $tempdir/$file || exit ;;
+    *) ln "$file" $tempdir/"$file" || exit ;;
   esac
 done <$manifest
 
@@ -476,7 +476,7 @@ if [ "${newer}" ]; then
   ## We remove .elc files unconditionally, on the theory that anyone picking
   ## up an incremental distribution already has a running Emacs to byte-compile
   ## them with.
-  find ${tempdir} \( -name '*.elc' -o ! -newer ${newer} \) \
+  find ${tempdir} \( -name '*.elc' -o ! -newer "${newer}" \) \
     -exec rm -f {} \; || exit
 fi
 
@@ -487,12 +487,12 @@ if [ "${make_tar}" = yes ]; then
     sed -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' -e 's/:/ /g'
   `
   for dir in ${temppath}; do
-    [ -x ${dir}/$default_gzip ] || continue
+    [ -x "${dir}"/$default_gzip ] || continue
     found=1; break
   done
   if [ "$found" = "0" ]; then
     echo "WARNING: '$default_gzip' not found, will not compress" >&2
-    default_gzip=cat
+    default_gzip="cat"
   fi
   case "${default_gzip}" in
     bzip2) gzip_extension=.bz2 ;;
@@ -518,7 +518,7 @@ if [ "${make_tar}" = yes ]; then
          $default_gzip <$emacsname.tar
         fi;;
    esac
-  ) >$emacsname.tar$gzip_extension || exit
+  ) >$emacsname.tar"$gzip_extension" || exit
 fi
 
 ## Why are we deleting the staging directory if clean_up is no?
diff --git a/modules/modhelp.py b/modules/modhelp.py
index 13fd3b0..07dfdf3 100755
--- a/modules/modhelp.py
+++ b/modules/modhelp.py
@@ -2,7 +2,7 @@
 
 # Module helper script.
 
-# Copyright 2015-2020 Free Software Foundation, Inc.
+# Copyright 2015-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/msdos/ChangeLog.1 b/msdos/ChangeLog.1
index 210cecd..ce94d41 100644
--- a/msdos/ChangeLog.1
+++ b/msdos/ChangeLog.1
@@ -1550,7 +1550,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1994-1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1994-1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/msdos/INSTALL b/msdos/INSTALL
index a67c4d5..6bb7143 100644
--- a/msdos/INSTALL
+++ b/msdos/INSTALL
@@ -1,6 +1,6 @@
 GNU Emacs Installation Guide for the DJGPP (a.k.a. MS-DOS) port
 
-Copyright (C) 1992, 1994, 1996-1997, 2000-2020 Free Software Foundation,
+Copyright (C) 1992, 1994, 1996-1997, 2000-2021 Free Software Foundation,
 Inc.
 See the end of the file for license conditions.
 
diff --git a/msdos/README b/msdos/README
index d107374..9feaed8 100644
--- a/msdos/README
+++ b/msdos/README
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
@@ -10,7 +10,7 @@ The files emacs.ico and emacs.pif are for using the DJGPP 
version on
 Windows 3.X.  Since these are binary files, their copyright notice is
 reproduced here:
 
-# Copyright (C) 1993, 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 1993, 2002-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/autogen/Makefile.in b/msdos/autogen/Makefile.in
index 42a4656..0bdc408 100644
--- a/msdos/autogen/Makefile.in
+++ b/msdos/autogen/Makefile.in
@@ -1,7 +1,7 @@
 # Makefile.in generated by automake 1.11.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2009, 2013-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2009, 2013-2021 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -13,7 +13,7 @@
 
 @SET_MAKE@
 
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
 # Generated by gnulib-tool.
 # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib 
--m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux 
--avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix 
--avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die 
--avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select 
--avoid=sigprocmask --avoid=sys_types --avoid=threadlib 
--makefile-name=gnulib.mk --conditional-dependencies --no-libtool 
--macro-prefix=gl [...]
 
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/msdos/autogen/config.in b/msdos/autogen/config.in
index 6475d99..263cba1 100644
--- a/msdos/autogen/config.in
+++ b/msdos/autogen/config.in
@@ -2,7 +2,7 @@
 
 /* GNU Emacs site configuration template file.
 
-Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2020 Free Software
+Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/msdos/depfiles.bat b/msdos/depfiles.bat
index f3c4b33..131f2fc 100644
--- a/msdos/depfiles.bat
+++ b/msdos/depfiles.bat
@@ -1,7 +1,7 @@
 @echo off
 rem   ----------------------------------------------------------------------
 rem   Auxiliary script for MSDOS, run by ../config.bat
-rem   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+rem   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 rem   This file is part of GNU Emacs.
 
diff --git a/msdos/inttypes.h b/msdos/inttypes.h
index 88ffae7..28633ca 100644
--- a/msdos/inttypes.h
+++ b/msdos/inttypes.h
@@ -1,6 +1,6 @@
 /* Replacement inttypes.h file for building GNU Emacs on MS-DOS with DJGPP.
 
-Copyright (C) 2011-2020 Free Software Foundation, Inc.
+Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/msdos/mainmake.v2 b/msdos/mainmake.v2
index 57c4479..f22ebea 100644
--- a/msdos/mainmake.v2
+++ b/msdos/mainmake.v2
@@ -1,6 +1,6 @@
 # Top-level Makefile for Emacs under MS-DOS/DJGPP v2.0 or higher. 
-*-makefile-*-
 
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp
index 8e18122..5d82af6 100644
--- a/msdos/sed1v2.inp
+++ b/msdos/sed1v2.inp
@@ -2,7 +2,7 @@
 # Configuration script for src/Makefile under DJGPP v2.x
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1996-1997, 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-1997, 1999-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sed1x.inp b/msdos/sed1x.inp
index 8d10375..30c242d 100644
--- a/msdos/sed1x.inp
+++ b/msdos/sed1x.inp
@@ -2,7 +2,7 @@
 # Extra configuration script for src/makefile for DesqView/X
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1994-1997, 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-1997, 1999-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp
index e79dc46..ce45a7c 100644
--- a/msdos/sed2v2.inp
+++ b/msdos/sed2v2.inp
@@ -2,7 +2,7 @@
 # Configuration script for src/config.h under DJGPP v2.x
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1993-1997, 1999-2000, 2002-2020 Free Software
+# Copyright (C) 1993-1997, 1999-2000, 2002-2021 Free Software
 # Foundation, Inc.
 #
 # This file is part of GNU Emacs.
@@ -27,7 +27,7 @@
 #ifndef MSDOS\
 #define MSDOS\
 #endif
-/^#undef COPYRIGHT *$/s/^.*$/#define COPYRIGHT "Copyright (C) 2020 Free 
Software Foundation, Inc."/
+/^#undef COPYRIGHT *$/s/^.*$/#define COPYRIGHT "Copyright (C) 2021 Free 
Software Foundation, Inc."/
 /^#undef DIRECTORY_SEP *$/s!^.*$!#define DIRECTORY_SEP '/'!
 /^#undef DOS_NT *$/s/^.*$/#define DOS_NT/
 /^#undef FLOAT_CHECK_DOMAIN *$/s/^.*$/#define FLOAT_CHECK_DOMAIN/
diff --git a/msdos/sed2x.inp b/msdos/sed2x.inp
index 054cd91..00b5f07 100644
--- a/msdos/sed2x.inp
+++ b/msdos/sed2x.inp
@@ -2,7 +2,7 @@
 # Extra configuration script for src/config.h for DesqView/X
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sed3v2.inp b/msdos/sed3v2.inp
index 37ad23a..8b9bb06 100644
--- a/msdos/sed3v2.inp
+++ b/msdos/sed3v2.inp
@@ -2,7 +2,7 @@
 # Configuration script for lib-src/makefile under DJGPP v2
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1996, 1998, 2000-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1998, 2000-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sed4.inp b/msdos/sed4.inp
index 6997a57..09d3523 100644
--- a/msdos/sed4.inp
+++ b/msdos/sed4.inp
@@ -2,7 +2,7 @@
 # Configuration script for src/paths.h
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sed5x.inp b/msdos/sed5x.inp
index 3f593f1..3639a07 100644
--- a/msdos/sed5x.inp
+++ b/msdos/sed5x.inp
@@ -2,7 +2,7 @@
 # Configuration script for oldxmenu/makefile for DesqView/X
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sed6.inp b/msdos/sed6.inp
index cb2a303..a0ab945 100644
--- a/msdos/sed6.inp
+++ b/msdos/sed6.inp
@@ -3,7 +3,7 @@
 # doc/lispintro/Makefile, and doc/misc/Makefile under DJGPP v2.x
 # ---------------------------------------------------------------------------
 #
-# Copyright (C) 1997, 2000-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2000-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sedadmin.inp b/msdos/sedadmin.inp
index ac9f38f..9f6daca 100644
--- a/msdos/sedadmin.inp
+++ b/msdos/sedadmin.inp
@@ -2,7 +2,7 @@
 # Configuration script for admin/unidata/Makefile under DJGPP v2.x
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 2014-2020 Free Software Foundation, Inc.
+# Copyright (C) 2014-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sedalloc.inp b/msdos/sedalloc.inp
index e2d6a56..90377dd 100644
--- a/msdos/sedalloc.inp
+++ b/msdos/sedalloc.inp
@@ -2,7 +2,7 @@
 # Configuration script for SYSTEM_MALLOC/REL_ALLOC in src/config.h
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 2008-2020 Free Software Foundation, Inc.
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sedleim.inp b/msdos/sedleim.inp
index c4e6e75..1d5ee7a 100644
--- a/msdos/sedleim.inp
+++ b/msdos/sedleim.inp
@@ -2,7 +2,7 @@
 # Configuration script for leim/Makefile under DJGPP v2.x
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sedlibcf.inp b/msdos/sedlibcf.inp
index a071e16..38c54e6 100644
--- a/msdos/sedlibcf.inp
+++ b/msdos/sedlibcf.inp
@@ -5,7 +5,7 @@
 # files whose names are invalid on DOS 8+3 filesystems.
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 2011-2020 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp
index 519d5ba..825be84 100644
--- a/msdos/sedlibmk.inp
+++ b/msdos/sedlibmk.inp
@@ -2,7 +2,7 @@
 # Configuration script for lib/Makefile under DJGPP v2.x
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 2011-2020 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/msdos/sedlisp.inp b/msdos/sedlisp.inp
index d62c0f9..5b3dc26 100644
--- a/msdos/sedlisp.inp
+++ b/msdos/sedlisp.inp
@@ -2,7 +2,7 @@
 # Configuration script for lisp/Makefile under DJGPP v2.x
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 2000-2020 Free Software Foundation, Inc.
+# Copyright (C) 2000-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/nextstep/ChangeLog.1 b/nextstep/ChangeLog.1
index 5d866e6..8e7e278 100644
--- a/nextstep/ChangeLog.1
+++ b/nextstep/ChangeLog.1
@@ -312,7 +312,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2008-2020 Free Software Foundation, Inc.
+  Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/nextstep/INSTALL b/nextstep/INSTALL
index ac34419..148be2d 100644
--- a/nextstep/INSTALL
+++ b/nextstep/INSTALL
@@ -1,4 +1,4 @@
-Copyright (C) 2008-2020 Free Software Foundation, Inc.
+Copyright (C) 2008-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/nextstep/Makefile.in b/nextstep/Makefile.in
index 15e8bd9..3168fee 100644
--- a/nextstep/Makefile.in
+++ b/nextstep/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-## Copyright (C) 2012-2020 Free Software Foundation, Inc.
+## Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ## This file is part of GNU Emacs.
 
diff --git a/nextstep/README b/nextstep/README
index 3ad226b..141a5b2 100644
--- a/nextstep/README
+++ b/nextstep/README
@@ -105,7 +105,7 @@ future development.
 
 
 ----------------------------------------------------------------------
-Copyright 2008-2020 Free Software Foundation, Inc.
+Copyright 2008-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nextstep/templates/Info.plist.in b/nextstep/templates/Info.plist.in
index 1f074b0..66cde9f 100644
--- a/nextstep/templates/Info.plist.in
+++ b/nextstep/templates/Info.plist.in
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-Copyright (C) 2008-2020 Free Software Foundation, Inc.
+Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/ChangeLog.1 b/nt/ChangeLog.1
index 187a59c..247f10a 100644
--- a/nt/ChangeLog.1
+++ b/nt/ChangeLog.1
@@ -3548,7 +3548,7 @@
 ;; add-log-time-zone-rule: t
 ;; End:
 
-  Copyright (C) 1995-1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1995-1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/nt/INSTALL b/nt/INSTALL
index 27fb5f0..9f54315 100644
--- a/nt/INSTALL
+++ b/nt/INSTALL
@@ -1,7 +1,7 @@
                    Building and Installing Emacs on MS-Windows
                           using the MSYS and MinGW tools
 
-  Copyright (C) 2013-2020 Free Software Foundation, Inc.
+  Copyright (C) 2013-2021 Free Software Foundation, Inc.
   See the end of the file for license conditions.
 
 The MSYS/MinGW build described here is supported on versions of
diff --git a/nt/INSTALL.W64 b/nt/INSTALL.W64
index 4724116..8f0d0c9 100644
--- a/nt/INSTALL.W64
+++ b/nt/INSTALL.W64
@@ -1,7 +1,7 @@
          Building and Installing Emacs on 64-bit MS-Windows
                      using MSYS2 and MinGW-w64
 
-  Copyright (c) 2015-2020 Free Software Foundation, Inc.
+  Copyright (c) 2015-2021 Free Software Foundation, Inc.
   See the end of the file for license conditions.
 
 This document describes how to compile a 64-bit GNU Emacs using MSYS2
diff --git a/nt/Makefile.in b/nt/Makefile.in
index 6bdf824..aa3a762 100644
--- a/nt/Makefile.in
+++ b/nt/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 2013-2020 Free Software Foundation, Inc.
+# Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/nt/README b/nt/README
index bc028c8..3da31d0 100644
--- a/nt/README
+++ b/nt/README
@@ -1,6 +1,6 @@
             Emacs for Windows NT/2000 and Windows 95/98/ME
 
-  Copyright (C) 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 2001-2021 Free Software Foundation, Inc.
   See the end of the file for license conditions.
 
   This directory contains support for compiling and running GNU Emacs on
diff --git a/nt/README.W32 b/nt/README.W32
index 9c8d204..ed56733 100644
--- a/nt/README.W32
+++ b/nt/README.W32
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
                Emacs version 28.0.50 for MS-Windows
diff --git a/nt/addpm.c b/nt/addpm.c
index 19a4022..f54a6ea 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -1,5 +1,5 @@
 /* Add entries to the GNU Emacs Program Manager folder.
-   Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c
index 5139001..224f68b 100644
--- a/nt/cmdproxy.c
+++ b/nt/cmdproxy.c
@@ -1,5 +1,5 @@
 /* Proxy shell designed for use with Emacs on Windows 95 and NT.
-   Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
    Accepts subset of Unix sh(1) command-line options, for compatibility
    with elisp code written for Unix.  When possible, executes external
diff --git a/nt/configure.bat b/nt/configure.bat
index 8d43669..0cb1a63 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -1,7 +1,7 @@
 @echo off
 rem   ----------------------------------------------------------------------
 rem   This was the old configuration script for MS Windows operating systems
-rem   Copyright (C) 1999-2020 Free Software Foundation, Inc.
+rem   Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 rem   This file is part of GNU Emacs.
 
diff --git a/nt/ddeclient.c b/nt/ddeclient.c
index a1a1999..c577bfc 100644
--- a/nt/ddeclient.c
+++ b/nt/ddeclient.c
@@ -1,5 +1,5 @@
 /* Simple client interface to DDE servers.
-   Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/emacs.rc.in b/nt/emacs.rc.in
index b551e58..ed21788 100644
--- a/nt/emacs.rc.in
+++ b/nt/emacs.rc.in
@@ -31,7 +31,7 @@ BEGIN
            VALUE "FileDescription", "GNU Emacs: The extensible 
self-documenting text editor\0"
            VALUE "FileVersion", "@comma_space_version@\0"
            VALUE "InternalName", "Emacs\0"
-           VALUE "LegalCopyright", "Copyright (C) 2001-2020\0"
+           VALUE "LegalCopyright", "Copyright (C) 2001-2021\0"
            VALUE "OriginalFilename", "emacs.exe"
            VALUE "ProductName", "Emacs\0"
            VALUE "ProductVersion", "@comma_space_version@\0"
diff --git a/nt/emacsclient.rc.in b/nt/emacsclient.rc.in
index ebb117f..c061f06 100644
--- a/nt/emacsclient.rc.in
+++ b/nt/emacsclient.rc.in
@@ -25,7 +25,7 @@ BEGIN
            VALUE "FileDescription", "GNU EmacsClient: Client for the 
extensible self-documenting text editor\0"
            VALUE "FileVersion", "@comma_space_version@\0"
            VALUE "InternalName", "EmacsClient\0"
-           VALUE "LegalCopyright", "Copyright (C) 2001-2020\0"
+           VALUE "LegalCopyright", "Copyright (C) 2001-2021\0"
            VALUE "OriginalFilename", "emacsclientw.exe"
            VALUE "ProductName", "EmacsClient\0"
            VALUE "ProductVersion", "@comma_space_version@\0"
diff --git a/nt/epaths.nt b/nt/epaths.nt
index 62e7749..ad60f6c 100644
--- a/nt/epaths.nt
+++ b/nt/epaths.nt
@@ -12,7 +12,7 @@
    the host system (e.g., i686-pc-mingw32), and @SRC@ by the root of
    the Emacs source tree used to build Emacs.  */
 /*
-Copyright (C) 1993, 1995, 1997, 1999, 2001-2020 Free Software
+Copyright (C) 1993, 1995, 1997, 1999, 2001-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/nt/gnulib-cfg.mk b/nt/gnulib-cfg.mk
index b84626d..5cdbde6 100644
--- a/nt/gnulib-cfg.mk
+++ b/nt/gnulib-cfg.mk
@@ -1,6 +1,6 @@
 # Configurations for ../lib/gnulib.mk.
 #
-# Copyright 2017-2020 Free Software Foundation, Inc.
+# Copyright 2017-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/nt/icons/README b/nt/icons/README
index 9502e17..a8849b2 100644
--- a/nt/icons/README
+++ b/nt/icons/README
@@ -2,13 +2,13 @@ COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES
 
 File: emacs.ico
 Author: Kentaro Ohkouchi <nanasess@fsm.ne.jp>
-Copyright (C) 2008-2020 Free Software Foundation, Inc.
+Copyright (C) 2008-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later
 
 
 File: emacs22.ico
 Author: Andrew Zhilin
-Copyright (C) 2005-2020 Free Software Foundation, Inc.
+Copyright (C) 2005-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
 
 
@@ -17,7 +17,7 @@ Files: gnu2a32.ico gnu2a32t.ico gnu2b48.ico gnu2b48t.ico
        gnu5w32.ico gnu5w32t.ico gnu6w48.ico gnu6w48t.ico
        gnu7.ico    gnu8.ico     gnu9.ico
 Author: Rob Davenport <rgd at bigfoot.com>
-Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1999, 2001-2021 Free Software Foundation, Inc.
 License: GNU General Public License version 3 or later (see COPYING)
 
   <http://users.adelphia.net/~rob.davenport/gnuicons.html>
diff --git a/nt/inc/grp.h b/nt/inc/grp.h
index 342dfba..4151147 100644
--- a/nt/inc/grp.h
+++ b/nt/inc/grp.h
@@ -1,6 +1,6 @@
 /* Replacement grp.h file for building GNU Emacs on Windows.
 
-Copyright (C) 2003-2020 Free Software Foundation, Inc.
+Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/inc/inttypes.h b/nt/inc/inttypes.h
index 3ac73a7..89c0002 100644
--- a/nt/inc/inttypes.h
+++ b/nt/inc/inttypes.h
@@ -1,6 +1,6 @@
 /* Replacement inttypes.h file for building GNU Emacs on Windows with MSVC.
 
-Copyright (C) 2011-2020 Free Software Foundation, Inc.
+Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/inc/langinfo.h b/nt/inc/langinfo.h
index 243a6a5..86f4ce5 100644
--- a/nt/inc/langinfo.h
+++ b/nt/inc/langinfo.h
@@ -1,6 +1,6 @@
 /* Replacement langinfo.h file for building GNU Emacs on Windows.
 
-Copyright (C) 2006-2020 Free Software Foundation, Inc.
+Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 2c754f9..aad51b5 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -1,6 +1,6 @@
 /* System description file for Windows NT.
 
-Copyright (C) 1993-1995, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1993-1995, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/inc/nl_types.h b/nt/inc/nl_types.h
index 28ec639..8926f75 100644
--- a/nt/inc/nl_types.h
+++ b/nt/inc/nl_types.h
@@ -1,6 +1,6 @@
 /* Replacement nl_types.h file for building GNU Emacs on Windows.
 
-Copyright (C) 2006-2020 Free Software Foundation, Inc.
+Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/inc/stdint.h b/nt/inc/stdint.h
index c06c97e..0ee3d4a 100644
--- a/nt/inc/stdint.h
+++ b/nt/inc/stdint.h
@@ -1,6 +1,6 @@
 /* Replacement stdint.h file for building GNU Emacs on Windows.
 
-Copyright (C) 2011-2020 Free Software Foundation, Inc.
+Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/inc/sys/resource.h b/nt/inc/sys/resource.h
index e03c224..d35f89b 100644
--- a/nt/inc/sys/resource.h
+++ b/nt/inc/sys/resource.h
@@ -1,6 +1,6 @@
 /* A limited emulation of sys/resource.h.
 
-Copyright (C) 2016-2020 Free Software Foundation, Inc.
+Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h
index 94ed2aa..48b2462 100644
--- a/nt/inc/sys/socket.h
+++ b/nt/inc/sys/socket.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h
index f58d5ab..aa93bd4 100644
--- a/nt/inc/sys/stat.h
+++ b/nt/inc/sys/stat.h
@@ -1,7 +1,7 @@
 /* sys/stat.h supplied with MSVCRT uses too narrow data types for
    inode and user/group id, so we replace them with our own.
 
-Copyright (C) 2008-2020 Free Software Foundation, Inc.
+Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/inc/sys/wait.h b/nt/inc/sys/wait.h
index 0dff520..481ad9c 100644
--- a/nt/inc/sys/wait.h
+++ b/nt/inc/sys/wait.h
@@ -1,6 +1,6 @@
 /* A limited emulation of sys/wait.h on Posix systems.
 
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
+Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/mingw-cfg.site b/nt/mingw-cfg.site
index 4a77cc2..9630077 100644
--- a/nt/mingw-cfg.site
+++ b/nt/mingw-cfg.site
@@ -83,6 +83,8 @@ ac_cv_func_readlink=yes
 ac_cv_func_symlink=yes
 # Avoid run-time tests of readlink and symlink, which will fail
 gl_cv_func_readlink_works=yes
+gl_cv_func_readlink_trailing_slash=yes
+gl_cv_func_readlink_truncate=yes
 gl_cv_func_symlink_works=yes
 ac_cv_func_readlinkat=yes
 ac_cv_func_faccessat=yes
@@ -156,3 +158,7 @@ gl_cv_func_copy_file_range=yes
 # We don't want to build Emacs so it depends on bcrypt.dll, since then
 # it will refuse to start on systems where that DLL is absent.
 gl_cv_lib_assume_bcrypt=no
+# Don't build the Gnulib free.c: it is not needed, since the w32
+# implementation of 'free' doesn't touch errno, and it emits a
+# compilation warning.
+gl_cv_func_free_preserves_errno=yes
diff --git a/nt/preprep.c b/nt/preprep.c
index 21eda0e..78ed1c3 100644
--- a/nt/preprep.c
+++ b/nt/preprep.c
@@ -1,5 +1,5 @@
 /* Pre-process emacs.exe for profiling by MSVC.
-   Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/nt/runemacs.c b/nt/runemacs.c
index 32fdc2b..308e856 100644
--- a/nt/runemacs.c
+++ b/nt/runemacs.c
@@ -1,6 +1,6 @@
 /* runemacs --- Simple program to start Emacs with its console window hidden.
 
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c
index c919d65..91439ea 100644
--- a/oldXMenu/Activate.c
+++ b/oldXMenu/Activate.c
@@ -3,7 +3,7 @@
 #include "copyright.h"
 
 /*
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/oldXMenu/ChangeLog.1 b/oldXMenu/ChangeLog.1
index bae205a..c237774 100644
--- a/oldXMenu/ChangeLog.1
+++ b/oldXMenu/ChangeLog.1
@@ -712,7 +712,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1993-1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1993-1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/oldXMenu/Create.c b/oldXMenu/Create.c
index 3d1a3bf..7eb17c5 100644
--- a/oldXMenu/Create.c
+++ b/oldXMenu/Create.c
@@ -3,7 +3,7 @@
 #include "copyright.h"
 
 /*
-Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/oldXMenu/FindSel.c b/oldXMenu/FindSel.c
index 58c27c5..e2a5dbb 100644
--- a/oldXMenu/FindSel.c
+++ b/oldXMenu/FindSel.c
@@ -3,7 +3,7 @@
 #include "copyright.h"
 
 /*
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/oldXMenu/Internal.c b/oldXMenu/Internal.c
index c81db98..f489e27 100644
--- a/oldXMenu/Internal.c
+++ b/oldXMenu/Internal.c
@@ -3,7 +3,7 @@
 #include "copyright.h"
 
 /*
-Copyright (C) 1993, 1996, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1993, 1996, 2001-2021 Free Software Foundation, Inc.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/oldXMenu/Makefile.in b/oldXMenu/Makefile.in
index 9c814fd..7ae355b 100644
--- a/oldXMenu/Makefile.in
+++ b/oldXMenu/Makefile.in
@@ -15,7 +15,7 @@
 ## without express or implied warranty.
 
 
-## Copyright (C) 2001-2020 Free Software Foundation, Inc.
+## Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
diff --git a/oldXMenu/deps.mk b/oldXMenu/deps.mk
index 9744c48..f1876bf 100644
--- a/oldXMenu/deps.mk
+++ b/oldXMenu/deps.mk
@@ -15,7 +15,7 @@
 ## without express or implied warranty.
 
 
-## Copyright (C) 2001-2020 Free Software Foundation, Inc.
+## Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
diff --git a/oldXMenu/insque.c b/oldXMenu/insque.c
index 72a0cc8..c09d129 100644
--- a/oldXMenu/insque.c
+++ b/oldXMenu/insque.c
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 1993-1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1993-1998, 2001-2021 Free Software Foundation, Inc.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/src/.gdbinit b/src/.gdbinit
index 78536fc..f74e295 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-1998, 2000-2020 Free Software Foundation, Inc.
+# Copyright (C) 1992-1998, 2000-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/src/ChangeLog.1 b/src/ChangeLog.1
index 4ca7f90..3429aa4 100644
--- a/src/ChangeLog.1
+++ b/src/ChangeLog.1
@@ -3521,7 +3521,7 @@
        * minibuf.c: Don't allow entry to minibuffer
        while minibuffer is selected.
 
-    Copyright (C) 1985-1986, 2001-2020 Free Software Foundation, Inc.
+    Copyright (C) 1985-1986, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index fbbd360..bba161d 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -27912,7 +27912,7 @@ See ChangeLog.9 for earlier changes.
 ;; add-log-time-zone-rule: t
 ;; End:
 
-    Copyright (C) 2001-2020 Free Software Foundation, Inc.
+    Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.11 b/src/ChangeLog.11
index cf9e87a..41c35ba 100644
--- a/src/ChangeLog.11
+++ b/src/ChangeLog.11
@@ -31385,7 +31385,7 @@ See ChangeLog.10 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2007-2020 Free Software Foundation, Inc.
+  Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.12 b/src/ChangeLog.12
index 04983fe..77540ee 100644
--- a/src/ChangeLog.12
+++ b/src/ChangeLog.12
@@ -22936,7 +22936,7 @@ See ChangeLog.11 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2011-2020 Free Software Foundation, Inc.
+  Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.13 b/src/ChangeLog.13
index 87055d7..3fb23ce 100644
--- a/src/ChangeLog.13
+++ b/src/ChangeLog.13
@@ -17905,7 +17905,7 @@ See ChangeLog.12 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2011-2020 Free Software Foundation, Inc.
+  Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.2 b/src/ChangeLog.2
index a499350..44c575c 100644
--- a/src/ChangeLog.2
+++ b/src/ChangeLog.2
@@ -4771,7 +4771,7 @@
 
 See ChangeLog.1 for earlier changes.
 
-    Copyright (C) 1986-1988, 2001-2020 Free Software Foundation, Inc.
+    Copyright (C) 1986-1988, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.3 b/src/ChangeLog.3
index 4e40305..1cae9bf 100644
--- a/src/ChangeLog.3
+++ b/src/ChangeLog.3
@@ -16503,7 +16503,7 @@ See ChangeLog.2 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.4 b/src/ChangeLog.4
index cc8d22c..f34e4cb 100644
--- a/src/ChangeLog.4
+++ b/src/ChangeLog.4
@@ -6906,7 +6906,7 @@ See ChangeLog.3 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.5 b/src/ChangeLog.5
index 56bfb9f..af0f6b9 100644
--- a/src/ChangeLog.5
+++ b/src/ChangeLog.5
@@ -7148,7 +7148,7 @@ See ChangeLog.4 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1994-1995, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.6 b/src/ChangeLog.6
index 391d5fb..7091485 100644
--- a/src/ChangeLog.6
+++ b/src/ChangeLog.6
@@ -5358,7 +5358,7 @@ See ChangeLog.5 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1995-1996, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1995-1996, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.7 b/src/ChangeLog.7
index bb3e199..7e9a085 100644
--- a/src/ChangeLog.7
+++ b/src/ChangeLog.7
@@ -11091,7 +11091,7 @@ See ChangeLog.6 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1997-1998, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.8 b/src/ChangeLog.8
index c7b99a4..8587a14 100644
--- a/src/ChangeLog.8
+++ b/src/ChangeLog.8
@@ -13979,7 +13979,7 @@
 
 See ChangeLog.7 for earlier changes.
 
-  Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 1999, 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/ChangeLog.9 b/src/ChangeLog.9
index 0c1f72a..25a17e7 100644
--- a/src/ChangeLog.9
+++ b/src/ChangeLog.9
@@ -13294,7 +13294,7 @@ See ChangeLog.8 for earlier changes.
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2001-2020 Free Software Foundation, Inc.
+  Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/src/Makefile.in b/src/Makefile.in
index 39c0f12..4100edf 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2020 Free Software
+# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2021 Free Software
 # Foundation, Inc.
 
 # This file is part of GNU Emacs.
diff --git a/src/README b/src/README
index fbebf6b..1f42449 100644
--- a/src/README
+++ b/src/README
@@ -1,4 +1,4 @@
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
diff --git a/src/alloc.c b/src/alloc.c
index 5d2d5bc..c0a55e6 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1,6 +1,6 @@
 /* Storage allocation and gc for GNU Emacs Lisp interpreter.
 
-Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2020 Free Software
+Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -664,7 +664,7 @@ display_malloc_warning (void)
   call3 (intern ("display-warning"),
         intern ("alloc"),
         build_string (pending_malloc_warning),
-        intern ("emergency"));
+        intern (":emergency"));
   pending_malloc_warning = 0;
 }
 
@@ -732,7 +732,11 @@ static void
 malloc_unblock_input (void)
 {
   if (block_input_in_memory_allocators)
-    unblock_input ();
+    {
+      int err = errno;
+      unblock_input ();
+      errno = err;
+    }
 }
 # define MALLOC_BLOCK_INPUT malloc_block_input ()
 # define MALLOC_UNBLOCK_INPUT malloc_unblock_input ()
diff --git a/src/atimer.c b/src/atimer.c
index a7daf9d..9b19867 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -1,5 +1,5 @@
 /* Asynchronous timers.
-   Copyright (C) 2000-2020 Free Software Foundation, Inc.
+   Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/atimer.h b/src/atimer.h
index 660d77c..e3e283a 100644
--- a/src/atimer.h
+++ b/src/atimer.h
@@ -1,5 +1,5 @@
 /* Asynchronous timers.
-   Copyright (C) 2000-2020 Free Software Foundation, Inc.
+   Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/bidi.c b/src/bidi.c
index ef062ad..1413ba6 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1,6 +1,6 @@
 /* Low-level bidirectional buffer/string-scanning functions for GNU Emacs.
 
-Copyright (C) 2000-2001, 2004-2005, 2009-2020 Free Software Foundation,
+Copyright (C) 2000-2001, 2004-2005, 2009-2021 Free Software Foundation,
 Inc.
 
 Author: Eli Zaretskii <eliz@gnu.org>
diff --git a/src/bignum.c b/src/bignum.c
index dce5908..1ac75c1 100644
--- a/src/bignum.c
+++ b/src/bignum.c
@@ -1,6 +1,6 @@
 /* Big numbers for Emacs.
 
-Copyright 2018-2020 Free Software Foundation, Inc.
+Copyright 2018-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/bignum.h b/src/bignum.h
index 251a19e..33a540e 100644
--- a/src/bignum.h
+++ b/src/bignum.h
@@ -1,6 +1,6 @@
 /* Big numbers for Emacs.
 
-Copyright 2018-2020 Free Software Foundation, Inc.
+Copyright 2018-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/blockinput.h b/src/blockinput.h
index f94e62d..8e4657b 100644
--- a/src/blockinput.h
+++ b/src/blockinput.h
@@ -1,5 +1,5 @@
 /* blockinput.h - interface to blocking complicated interrupt-driven input.
-   Copyright (C) 1989, 1993, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1989, 1993, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/buffer.c b/src/buffer.c
index 4215acb..81f7d92 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1,6 +1,6 @@
 /* Buffer manipulation primitives for GNU Emacs.
 
-Copyright (C) 1985-1989, 1993-1995, 1997-2020 Free Software Foundation,
+Copyright (C) 1985-1989, 1993-1995, 1997-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -37,7 +37,6 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include "window.h"
 #include "commands.h"
 #include "character.h"
-#include "coding.h"
 #include "buffer.h"
 #include "region-cache.h"
 #include "indent.h"
@@ -514,16 +513,33 @@ get_truename_buffer (register Lisp_Object filename)
   return Qnil;
 }
 
-DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0,
+/* Run buffer-list-update-hook if Vrun_hooks is non-nil, and BUF is NULL
+   or does not have buffer hooks inhibited.  BUF is NULL when called by
+   make-indirect-buffer, since it does not inhibit buffer hooks.  */
+
+static void
+run_buffer_list_update_hook (struct buffer *buf)
+{
+  if (! (NILP (Vrun_hooks) || (buf && buf->inhibit_buffer_hooks)))
+    call1 (Vrun_hooks, Qbuffer_list_update_hook);
+}
+
+DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 2, 0,
        doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new 
one if needed.
 If BUFFER-OR-NAME is a string and a live buffer with that name exists,
 return that buffer.  If no such buffer exists, create a new buffer with
-that name and return it.  If BUFFER-OR-NAME starts with a space, the new
-buffer does not keep undo information.
+that name and return it.
+
+If BUFFER-OR-NAME starts with a space, the new buffer does not keep undo
+information.  If optional argument INHIBIT-BUFFER-HOOKS is non-nil, the
+new buffer does not run the hooks `kill-buffer-hook',
+`kill-buffer-query-functions', and `buffer-list-update-hook'.  This
+avoids slowing down internal or temporary buffers that are never
+presented to users or passed on to other applications.
 
 If BUFFER-OR-NAME is a buffer instead of a string, return it as given,
 even if it is dead.  The return value is never nil.  */)
-  (register Lisp_Object buffer_or_name)
+  (register Lisp_Object buffer_or_name, Lisp_Object inhibit_buffer_hooks)
 {
   register Lisp_Object buffer, name;
   register struct buffer *b;
@@ -598,11 +614,7 @@ even if it is dead.  The return value is never nil.  */)
   set_string_intervals (name, NULL);
   bset_name (b, name);
 
-  b->inhibit_buffer_hooks
-    = (STRINGP (Vcode_conversion_workbuf_name)
-       && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name),
-                  SBYTES (Vcode_conversion_workbuf_name)) == 0);
-
+  b->inhibit_buffer_hooks = !NILP (inhibit_buffer_hooks);
   bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt);
 
   reset_buffer (b);
@@ -614,9 +626,8 @@ even if it is dead.  The return value is never nil.  */)
   /* Put this in the alist of all live buffers.  */
   XSETBUFFER (buffer, b);
   Vbuffer_alist = nconc2 (Vbuffer_alist, list1 (Fcons (name, buffer)));
-  /* And run buffer-list-update-hook.  */
-  if (!NILP (Vrun_hooks) && !b->inhibit_buffer_hooks)
-    call1 (Vrun_hooks, Qbuffer_list_update_hook);
+
+  run_buffer_list_update_hook (b);
 
   return buffer;
 }
@@ -890,9 +901,7 @@ CLONE nil means the indirect buffer's state is reset to 
default values.  */)
       set_buffer_internal_1 (old_b);
     }
 
-  /* Run buffer-list-update-hook.  */
-  if (!NILP (Vrun_hooks))
-    call1 (Vrun_hooks, Qbuffer_list_update_hook);
+  run_buffer_list_update_hook (NULL);
 
   return buf;
 }
@@ -1536,9 +1545,7 @@ This does not change the name of the visited file (if 
any).  */)
       && !NILP (BVAR (current_buffer, auto_save_file_name)))
     call0 (intern ("rename-auto-save-file"));
 
-  /* Run buffer-list-update-hook.  */
-  if (!NILP (Vrun_hooks) && !current_buffer->inhibit_buffer_hooks)
-    call1 (Vrun_hooks, Qbuffer_list_update_hook);
+  run_buffer_list_update_hook (current_buffer);
 
   /* Refetch since that last call may have done GC.  */
   return BVAR (current_buffer, name);
@@ -1612,7 +1619,7 @@ exists, return the buffer `*scratch*' (creating it if 
necessary).  */)
       buf = Fget_buffer (scratch);
       if (NILP (buf))
        {
-         buf = Fget_buffer_create (scratch);
+         buf = Fget_buffer_create (scratch, Qnil);
          Fset_buffer_major_mode (buf);
        }
       return buf;
@@ -1636,7 +1643,7 @@ other_buffer_safely (Lisp_Object buffer)
   buf = Fget_buffer (scratch);
   if (NILP (buf))
     {
-      buf = Fget_buffer_create (scratch);
+      buf = Fget_buffer_create (scratch, Qnil);
       Fset_buffer_major_mode (buf);
     }
 
@@ -1713,7 +1720,9 @@ buffer to be killed as the current buffer.  If any of 
them returns nil,
 the buffer is not killed.  The hook `kill-buffer-hook' is run before the
 buffer is actually killed.  The buffer being killed will be current
 while the hook is running.  Functions called by any of these hooks are
-supposed to not change the current buffer.
+supposed to not change the current buffer.  Neither hook is run for
+internal or temporary buffers created by `get-buffer-create' or
+`generate-new-buffer' with argument INHIBIT-BUFFER-HOOKS non-nil.
 
 Any processes that have this buffer as the `process-buffer' are killed
 with SIGHUP.  This function calls `replace-buffer-in-windows' for
@@ -1973,9 +1982,7 @@ cleaning up all windows currently displaying the buffer 
to be killed. */)
   bset_width_table (b, Qnil);
   unblock_input ();
 
-  /* Run buffer-list-update-hook.  */
-  if (!NILP (Vrun_hooks) && !b->inhibit_buffer_hooks)
-    call1 (Vrun_hooks, Qbuffer_list_update_hook);
+  run_buffer_list_update_hook (b);
 
   return Qt;
 }
@@ -2015,9 +2022,7 @@ record_buffer (Lisp_Object buffer)
   fset_buffer_list (f, Fcons (buffer, Fdelq (buffer, f->buffer_list)));
   fset_buried_buffer_list (f, Fdelq (buffer, f->buried_buffer_list));
 
-  /* Run buffer-list-update-hook.  */
-  if (!NILP (Vrun_hooks) && !XBUFFER (buffer)->inhibit_buffer_hooks)
-    call1 (Vrun_hooks, Qbuffer_list_update_hook);
+  run_buffer_list_update_hook (XBUFFER (buffer));
 }
 
 
@@ -2054,9 +2059,7 @@ DEFUN ("bury-buffer-internal", Fbury_buffer_internal, 
Sbury_buffer_internal,
   fset_buried_buffer_list
     (f, Fcons (buffer, Fdelq (buffer, f->buried_buffer_list)));
 
-  /* Run buffer-list-update-hook.  */
-  if (!NILP (Vrun_hooks) && !XBUFFER (buffer)->inhibit_buffer_hooks)
-    call1 (Vrun_hooks, Qbuffer_list_update_hook);
+  run_buffer_list_update_hook (XBUFFER (buffer));
 
   return Qnil;
 }
@@ -2814,7 +2817,7 @@ the normal hook `change-major-mode-hook'.  */)
 
   /* Force mode-line redisplay.  Useful here because all major mode
      commands call this function.  */
-  update_mode_lines = 12;
+  bset_update_mode_line (current_buffer);
 
   return Qnil;
 }
@@ -5349,10 +5352,11 @@ init_buffer_once (void)
   Fput (Qkill_buffer_hook, Qpermanent_local, Qt);
 
   /* Super-magic invisible buffer.  */
-  Vprin1_to_string_buffer = Fget_buffer_create (build_pure_c_string (" 
prin1"));
+  Vprin1_to_string_buffer =
+    Fget_buffer_create (build_pure_c_string (" prin1"), Qt);
   Vbuffer_alist = Qnil;
 
-  Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*")));
+  Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*"), Qnil));
 
   inhibit_modification_hooks = 0;
 }
@@ -5397,7 +5401,7 @@ init_buffer (void)
 #endif /* USE_MMAP_FOR_BUFFERS */
 
   AUTO_STRING (scratch, "*scratch*");
-  Fset_buffer (Fget_buffer_create (scratch));
+  Fset_buffer (Fget_buffer_create (scratch, Qnil));
   if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
     Fset_buffer_multibyte (Qnil);
 
@@ -6300,9 +6304,14 @@ Use Custom to set this variable and update the display.  
*/);
   DEFVAR_LISP ("kill-buffer-query-functions", Vkill_buffer_query_functions,
               doc: /* List of functions called with no args to query before 
killing a buffer.
 The buffer being killed will be current while the functions are running.
+See `kill-buffer'.
 
 If any of them returns nil, the buffer is not killed.  Functions run by
-this hook are supposed to not change the current buffer.  */);
+this hook are supposed to not change the current buffer.
+
+This hook is not run for internal or temporary buffers created by
+`get-buffer-create' or `generate-new-buffer' with argument
+INHIBIT-BUFFER-HOOKS non-nil.  */);
   Vkill_buffer_query_functions = Qnil;
 
   DEFVAR_LISP ("change-major-mode-hook", Vchange_major_mode_hook,
@@ -6315,9 +6324,12 @@ The function `kill-all-local-variables' runs this before 
doing anything else.  *
               doc: /* Hook run when the buffer list changes.
 Functions (implicitly) running this hook are `get-buffer-create',
 `make-indirect-buffer', `rename-buffer', `kill-buffer', `bury-buffer'
-and `select-window'.  Functions run by this hook should avoid calling
-`select-window' with a nil NORECORD argument or `with-temp-buffer'
-since either may lead to infinite recursion.  */);
+and `select-window'.  This hook is not run for internal or temporary
+buffers created by `get-buffer-create' or `generate-new-buffer' with
+argument INHIBIT-BUFFER-HOOKS non-nil.
+
+Functions run by this hook should avoid calling `select-window' with a
+nil NORECORD argument since it may lead to infinite recursion.  */);
   Vbuffer_list_update_hook = Qnil;
   DEFSYM (Qbuffer_list_update_hook, "buffer-list-update-hook");
 
diff --git a/src/buffer.h b/src/buffer.h
index fe549c5..790291f 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1,6 +1,6 @@
 /* Header file for the buffer manipulation primitives.
 
-Copyright (C) 1985-1986, 1993-1995, 1997-2020 Free Software Foundation,
+Copyright (C) 1985-1986, 1993-1995, 1997-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -663,11 +663,11 @@ struct buffer
   /* Non-zero whenever the narrowing is changed in this buffer.  */
   bool_bf clip_changed : 1;
 
-  /* Non-zero for internally used temporary buffers that don't need to
-     run hooks kill-buffer-hook, buffer-list-update-hook, and
-     kill-buffer-query-functions.  This is used in coding.c to avoid
-     slowing down en/decoding when there are a lot of these hooks
-     defined.  */
+  /* Non-zero for internal or temporary buffers that don't need to
+     run hooks kill-buffer-hook, kill-buffer-query-functions, and
+     buffer-list-update-hook.  This is used in coding.c to avoid
+     slowing down en/decoding when a lot of these hooks are
+     defined, as well as by with-temp-buffer, for example.  */
   bool_bf inhibit_buffer_hooks : 1;
 
   /* List of overlays that end at or before the current center,
diff --git a/src/bytecode.c b/src/bytecode.c
index 1c3b6ea..4fd41ac 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1,5 +1,5 @@
 /* Execution of byte code produced by bytecomp.el.
-   Copyright (C) 1985-1988, 1993, 2000-2020 Free Software Foundation,
+   Copyright (C) 1985-1988, 1993, 2000-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/callint.c b/src/callint.c
index f80436f..d3f49bc 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -1,5 +1,5 @@
 /* Call a Lisp function interactively.
-   Copyright (C) 1985-1986, 1993-1995, 1997, 2000-2020 Free Software
+   Copyright (C) 1985-1986, 1993-1995, 1997, 2000-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -283,6 +283,11 @@ invoke it (via an `interactive' spec that contains, for 
instance, an
   Lisp_Object save_real_this_command = Vreal_this_command;
   Lisp_Object save_last_command = KVAR (current_kboard, Vlast_command);
 
+  /* Bound recursively so that code can check the current command from
+     code running from minibuffer hooks (and the like), without being
+     overwritten by subsequent minibuffer calls.  */
+  specbind (Qcurrent_minibuffer_command, Vthis_command);
+
   if (NILP (keys))
     keys = this_command_keys, key_count = this_command_key_count;
   else
diff --git a/src/callproc.c b/src/callproc.c
index e3346e2..8d2a561 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1,6 +1,6 @@
 /* Synchronous subprocess invocation for GNU Emacs.
 
-Copyright (C) 1985-1988, 1993-1995, 1999-2020 Free Software Foundation,
+Copyright (C) 1985-1988, 1993-1995, 1999-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -30,6 +30,11 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 
 #include "lisp.h"
 
+#ifdef SETUP_SLAVE_PTY
+# include <sys/stream.h>
+# include <sys/stropts.h>
+#endif
+
 #ifdef WINDOWSNT
 #include <sys/socket.h>        /* for fcntl */
 #include <windows.h>
@@ -100,6 +105,15 @@ enum
   };
 
 static Lisp_Object call_process (ptrdiff_t, Lisp_Object *, int, ptrdiff_t);
+
+#ifdef DOS_NT
+# define CHILD_SETUP_TYPE int
+#else
+# define CHILD_SETUP_TYPE _Noreturn void
+#endif
+
+static CHILD_SETUP_TYPE child_setup (int, int, int, char **, char **,
+                                    const char *);
 
 /* Return the current buffer's working directory, or the home
    directory if it's unreachable, as a string suitable for a system call.
@@ -300,8 +314,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int 
filefd,
 #ifdef MSDOS   /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
   char *tempfile = NULL;
 #else
-  sigset_t oldset;
-  pid_t pid;
+  pid_t pid = -1;
 #endif
   int child_errno;
   int fd_output, fd_error;
@@ -405,9 +418,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int 
filefd,
 
       if (! (NILP (buffer) || EQ (buffer, Qt) || FIXNUMP (buffer)))
        {
-         Lisp_Object spec_buffer;
-         spec_buffer = buffer;
-         buffer = Fget_buffer_create (buffer);
+         Lisp_Object spec_buffer = buffer;
+         buffer = Fget_buffer_create (buffer, Qnil);
          /* Mention the buffer name for a better error message.  */
          if (NILP (buffer))
            CHECK_BUFFER (spec_buffer);
@@ -542,8 +554,11 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int 
filefd,
       callproc_fd[CALLPROC_STDERR] = fd_error;
     }
 
+  char **env = make_environment_block (current_dir);
+
 #ifdef MSDOS /* MW, July 1993 */
-  status = child_setup (filefd, fd_output, fd_error, new_argv, 0, current_dir);
+  status = child_setup (filefd, fd_output, fd_error, new_argv, env,
+                        SSDATA (current_dir));
 
   if (status < 0)
     {
@@ -586,73 +601,10 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int 
filefd,
 
 #ifndef MSDOS
 
-  block_input ();
-  block_child_signal (&oldset);
-
-#ifdef WINDOWSNT
-  pid = child_setup (filefd, fd_output, fd_error, new_argv, 0, current_dir);
-#else  /* not WINDOWSNT */
-
-  /* vfork, and prevent local vars from being clobbered by the vfork.  */
-  {
-    Lisp_Object volatile buffer_volatile = buffer;
-    Lisp_Object volatile coding_systems_volatile = coding_systems;
-    Lisp_Object volatile current_dir_volatile = current_dir;
-    bool volatile display_p_volatile = display_p;
-    int volatile fd_error_volatile = fd_error;
-    int volatile filefd_volatile = filefd;
-    ptrdiff_t volatile count_volatile = count;
-    ptrdiff_t volatile sa_avail_volatile = sa_avail;
-    ptrdiff_t volatile sa_count_volatile = sa_count;
-    char **volatile new_argv_volatile = new_argv;
-    int volatile callproc_fd_volatile[CALLPROC_FDS];
-    for (i = 0; i < CALLPROC_FDS; i++)
-      callproc_fd_volatile[i] = callproc_fd[i];
-
-    pid = vfork ();
-
-    buffer = buffer_volatile;
-    coding_systems = coding_systems_volatile;
-    current_dir = current_dir_volatile;
-    display_p = display_p_volatile;
-    fd_error = fd_error_volatile;
-    filefd = filefd_volatile;
-    count = count_volatile;
-    sa_avail = sa_avail_volatile;
-    sa_count = sa_count_volatile;
-    new_argv = new_argv_volatile;
-
-    for (i = 0; i < CALLPROC_FDS; i++)
-      callproc_fd[i] = callproc_fd_volatile[i];
-    fd_output = callproc_fd[CALLPROC_STDOUT];
-  }
-
-  if (pid == 0)
-    {
-#ifdef DARWIN_OS
-      /* Work around a macOS bug, where SIGCHLD is apparently
-        delivered to a vforked child instead of to its parent.  See:
-        https://lists.gnu.org/r/emacs-devel/2017-05/msg00342.html
-      */
-      signal (SIGCHLD, SIG_DFL);
-#endif
-
-      unblock_child_signal (&oldset);
-      dissociate_controlling_tty ();
-
-      /* Emacs ignores SIGPIPE, but the child should not.  */
-      signal (SIGPIPE, SIG_DFL);
-      /* Likewise for SIGPROF.  */
-#ifdef SIGPROF
-      signal (SIGPROF, SIG_DFL);
-#endif
-
-      child_setup (filefd, fd_output, fd_error, new_argv, 0, current_dir);
-    }
-
-#endif /* not WINDOWSNT */
-
-  child_errno = errno;
+  child_errno
+    = emacs_spawn (&pid, filefd, fd_output, fd_error, new_argv, env,
+                   SSDATA (current_dir), NULL);
+  eassert ((child_errno == 0) == (0 < pid));
 
   if (pid > 0)
     {
@@ -672,9 +624,6 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int 
filefd,
        }
     }
 
-  unblock_child_signal (&oldset);
-  unblock_input ();
-
   if (pid < 0)
     report_file_errno (CHILD_SETUP_ERROR_DESC, Qnil, child_errno);
 
@@ -1188,16 +1137,6 @@ exec_failed (char const *name, int err)
   _exit (err == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE);
 }
 
-#else
-
-/* Do nothing.  There is no need to fail, as DOS_NT platforms do not
-   fork and exec, and handle alloca exhaustion in a different way.  */
-
-static void
-exec_failed (char const *name, int err)
-{
-}
-
 #endif
 
 /* This is the last thing run in a newly forked inferior
@@ -1206,8 +1145,6 @@ exec_failed (char const *name, int err)
    Initialize inferior's priority, pgrp, connected dir and environment.
    then exec another program based on new_argv.
 
-   If SET_PGRP, put the subprocess into a separate process group.
-
    CURRENT_DIR is an elisp string giving the path of the current
    directory the subprocess should have.  Since we can't really signal
    a decent error from within the child, this should be verified as an
@@ -1217,12 +1154,10 @@ exec_failed (char const *name, int err)
    On MS-Windows, either return a pid or return -1 and set errno.
    On MS-DOS, either return an exit status or signal an error.  */
 
-CHILD_SETUP_TYPE
-child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
-            Lisp_Object current_dir)
+static CHILD_SETUP_TYPE
+child_setup (int in, int out, int err, char **new_argv, char **env,
+            const char *current_dir)
 {
-  char **env;
-  char *pwd_var;
 #ifdef WINDOWSNT
   int cpid;
   HANDLE handles[3];
@@ -1236,24 +1171,6 @@ child_setup (int in, int out, int err, char **new_argv, 
bool set_pgrp,
      src/alloca.c) it is safe because that changes the superior's
      static variables as if the superior had done alloca and will be
      cleaned up in the usual way. */
-  {
-    char *temp;
-    ptrdiff_t i;
-
-    i = SBYTES (current_dir);
-#ifdef MSDOS
-    /* MSDOS must have all environment variables malloc'ed, because
-       low-level libc functions that launch subsidiary processes rely
-       on that.  */
-    pwd_var = xmalloc (i + 5);
-#else
-    if (MAX_ALLOCA - 5 < i)
-      exec_failed (new_argv[0], ENOMEM);
-    pwd_var = alloca (i + 5);
-#endif
-    temp = pwd_var + 4;
-    memcpy (pwd_var, "PWD=", 4);
-    lispstpcpy (temp, current_dir);
 
 #ifndef DOS_NT
     /* We can't signal an Elisp error here; we're in a vfork.  Since
@@ -1261,101 +1178,13 @@ child_setup (int in, int out, int err, char 
**new_argv, bool set_pgrp,
        should only return an error if the directory's permissions
        are changed between the check and this chdir, but we should
        at least check.  */
-    if (chdir (temp) < 0)
+    if (chdir (current_dir) < 0)
       _exit (EXIT_CANCELED);
-#else /* DOS_NT */
-    /* Get past the drive letter, so that d:/ is left alone.  */
-    if (i > 2 && IS_DEVICE_SEP (temp[1]) && IS_DIRECTORY_SEP (temp[2]))
-      {
-       temp += 2;
-       i -= 2;
-      }
-#endif /* DOS_NT */
-
-    /* Strip trailing slashes for PWD, but leave "/" and "//" alone.  */
-    while (i > 2 && IS_DIRECTORY_SEP (temp[i - 1]))
-      temp[--i] = 0;
-  }
-
-  /* Set `env' to a vector of the strings in the environment.  */
-  {
-    register Lisp_Object tem;
-    register char **new_env;
-    char **p, **q;
-    register int new_length;
-    Lisp_Object display = Qnil;
-
-    new_length = 0;
-
-    for (tem = Vprocess_environment;
-        CONSP (tem) && STRINGP (XCAR (tem));
-        tem = XCDR (tem))
-      {
-       if (strncmp (SSDATA (XCAR (tem)), "DISPLAY", 7) == 0
-           && (SDATA (XCAR (tem)) [7] == '\0'
-               || SDATA (XCAR (tem)) [7] == '='))
-         /* DISPLAY is specified in process-environment.  */
-         display = Qt;
-       new_length++;
-      }
-
-    /* If not provided yet, use the frame's DISPLAY.  */
-    if (NILP (display))
-      {
-       Lisp_Object tmp = Fframe_parameter (selected_frame, Qdisplay);
-       if (!STRINGP (tmp) && CONSP (Vinitial_environment))
-         /* If still not found, Look for DISPLAY in Vinitial_environment.  */
-         tmp = Fgetenv_internal (build_string ("DISPLAY"),
-                                 Vinitial_environment);
-       if (STRINGP (tmp))
-         {
-           display = tmp;
-           new_length++;
-         }
-      }
-
-    /* new_length + 2 to include PWD and terminating 0.  */
-    if (MAX_ALLOCA / sizeof *env - 2 < new_length)
-      exec_failed (new_argv[0], ENOMEM);
-    env = new_env = alloca ((new_length + 2) * sizeof *env);
-    /* If we have a PWD envvar, pass one down,
-       but with corrected value.  */
-    if (egetenv ("PWD"))
-      *new_env++ = pwd_var;
-
-    if (STRINGP (display))
-      {
-       if (MAX_ALLOCA - sizeof "DISPLAY=" < SBYTES (display))
-         exec_failed (new_argv[0], ENOMEM);
-       char *vdata = alloca (sizeof "DISPLAY=" + SBYTES (display));
-       lispstpcpy (stpcpy (vdata, "DISPLAY="), display);
-       new_env = add_env (env, new_env, vdata);
-      }
-
-    /* Overrides.  */
-    for (tem = Vprocess_environment;
-        CONSP (tem) && STRINGP (XCAR (tem));
-        tem = XCDR (tem))
-      new_env = add_env (env, new_env, SSDATA (XCAR (tem)));
-
-    *new_env = 0;
-
-    /* Remove variable names without values.  */
-    p = q = env;
-    while (*p != 0)
-      {
-       while (*q != 0 && strchr (*q, '=') == NULL)
-         q++;
-       *p = *q++;
-       if (*p != 0)
-         p++;
-      }
-  }
-
+#endif
 
 #ifdef WINDOWSNT
   prepare_standard_handles (in, out, err, handles);
-  set_process_dir (SSDATA (current_dir));
+  set_process_dir (current_dir);
   /* Spawn the child.  (See w32proc.c:sys_spawnve).  */
   cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env);
   reset_standard_handles (in, out, err, handles);
@@ -1391,6 +1220,183 @@ child_setup (int in, int out, int err, char **new_argv, 
bool set_pgrp,
 #endif  /* not WINDOWSNT */
 }
 
+/* Start a new asynchronous subprocess.  If successful, return zero
+   and store the process identifier of the new process in *NEWPID.
+   Use STDIN, STDOUT, and STDERR as standard streams for the new
+   process.  Use ARGV as argument vector for the new process; use
+   process image file ARGV[0].  Use ENVP for the environment block for
+   the new process.  Use CWD as working directory for the new process.
+   If PTY is not NULL, it must be a pseudoterminal device.  If PTY is
+   NULL, don't perform any terminal setup.  */
+
+int
+emacs_spawn (pid_t *newpid, int std_in, int std_out, int std_err,
+             char **argv, char **envp, const char *cwd, const char *pty)
+{
+  sigset_t oldset;
+  int pid;
+
+  block_input ();
+  block_child_signal (&oldset);
+
+#ifndef WINDOWSNT
+  /* vfork, and prevent local vars from being clobbered by the vfork.  */
+  pid_t *volatile newpid_volatile = newpid;
+  const char *volatile cwd_volatile = cwd;
+  const char *volatile pty_volatile = pty;
+  char **volatile argv_volatile = argv;
+  int volatile stdin_volatile = std_in;
+  int volatile stdout_volatile = std_out;
+  int volatile stderr_volatile = std_err;
+  char **volatile envp_volatile = envp;
+
+#ifdef DARWIN_OS
+  /* Darwin doesn't let us run setsid after a vfork, so use fork when
+     necessary.  Below, we reset SIGCHLD handling after a vfork, as
+     apparently macOS can mistakenly deliver SIGCHLD to the child.  */
+  if (pty != NULL)
+    pid = fork ();
+  else
+    pid = vfork ();
+#else
+  pid = vfork ();
+#endif
+
+  newpid = newpid_volatile;
+  cwd = cwd_volatile;
+  pty = pty_volatile;
+  argv = argv_volatile;
+  std_in = stdin_volatile;
+  std_out = stdout_volatile;
+  std_err = stderr_volatile;
+  envp = envp_volatile;
+
+  if (pid == 0)
+#endif /* not WINDOWSNT */
+    {
+      bool pty_flag = pty != NULL;
+      /* Make the pty be the controlling terminal of the process.  */
+#ifdef HAVE_PTYS
+      dissociate_controlling_tty ();
+
+      /* Make the pty's terminal the controlling terminal.  */
+      if (pty_flag && std_in >= 0)
+       {
+#ifdef TIOCSCTTY
+         /* We ignore the return value
+            because faith@cs.unc.edu says that is necessary on Linux.  */
+         ioctl (std_in, TIOCSCTTY, 0);
+#endif
+       }
+#if defined (LDISC1)
+      if (pty_flag && std_in >= 0)
+       {
+         struct termios t;
+         tcgetattr (std_in, &t);
+         t.c_lflag = LDISC1;
+         if (tcsetattr (std_in, TCSANOW, &t) < 0)
+           emacs_perror ("create_process/tcsetattr LDISC1");
+       }
+#else
+#if defined (NTTYDISC) && defined (TIOCSETD)
+      if (pty_flag && std_in >= 0)
+       {
+         /* Use new line discipline.  */
+         int ldisc = NTTYDISC;
+         ioctl (std_in, TIOCSETD, &ldisc);
+       }
+#endif
+#endif
+
+#if !defined (DONT_REOPEN_PTY)
+/*** There is a suggestion that this ought to be a
+     conditional on TIOCSPGRP, or !defined TIOCSCTTY.
+     Trying the latter gave the wrong results on Debian GNU/Linux 1.1;
+     that system does seem to need this code, even though
+     both TIOCSCTTY is defined.  */
+       /* Now close the pty (if we had it open) and reopen it.
+          This makes the pty the controlling terminal of the subprocess.  */
+      if (pty_flag)
+       {
+
+         /* I wonder if emacs_close (emacs_open (pty, ...))
+            would work?  */
+         if (std_in >= 0)
+           emacs_close (std_in);
+         std_out = std_in = emacs_open (pty, O_RDWR, 0);
+
+         if (std_in < 0)
+           {
+             emacs_perror (pty);
+             _exit (EXIT_CANCELED);
+           }
+
+       }
+#endif /* not DONT_REOPEN_PTY */
+
+#ifdef SETUP_SLAVE_PTY
+      if (pty_flag)
+       {
+         SETUP_SLAVE_PTY;
+       }
+#endif /* SETUP_SLAVE_PTY */
+#endif /* HAVE_PTYS */
+
+#ifdef DARWIN_OS
+      /* Work around a macOS bug, where SIGCHLD is apparently
+        delivered to a vforked child instead of to its parent.  See:
+        https://lists.gnu.org/r/emacs-devel/2017-05/msg00342.html
+      */
+      signal (SIGCHLD, SIG_DFL);
+#endif
+
+      signal (SIGINT, SIG_DFL);
+      signal (SIGQUIT, SIG_DFL);
+#ifdef SIGPROF
+      signal (SIGPROF, SIG_DFL);
+#endif
+
+      /* Emacs ignores SIGPIPE, but the child should not.  */
+      signal (SIGPIPE, SIG_DFL);
+      /* Likewise for SIGPROF.  */
+#ifdef SIGPROF
+      signal (SIGPROF, SIG_DFL);
+#endif
+
+      /* Stop blocking SIGCHLD in the child.  */
+      unblock_child_signal (&oldset);
+
+      if (pty_flag)
+       child_setup_tty (std_out);
+
+      if (std_err < 0)
+       std_err = std_out;
+#ifdef WINDOWSNT
+      pid = child_setup (std_in, std_out, std_err, argv, envp, cwd);
+#else  /* not WINDOWSNT */
+      child_setup (std_in, std_out, std_err, argv, envp, cwd);
+#endif /* not WINDOWSNT */
+    }
+
+  /* Back in the parent process.  */
+
+  int vfork_error = pid < 0 ? errno : 0;
+
+  /* Stop blocking in the parent.  */
+  unblock_child_signal (&oldset);
+  unblock_input ();
+
+  if (pid < 0)
+    {
+      eassert (0 < vfork_error);
+      return vfork_error;
+    }
+
+  eassert (0 < pid);
+  *newpid = pid;
+  return 0;
+}
+
 static bool
 getenv_internal_1 (const char *var, ptrdiff_t varlen, char **value,
                   ptrdiff_t *valuelen, Lisp_Object env)
@@ -1514,6 +1520,119 @@ egetenv_internal (const char *var, ptrdiff_t len)
     return 0;
 }
 
+/* Create a new environment block.  You can pass the returned pointer
+   to `execve'.  Add unwind protections for all newly-allocated
+   objects.  Don't call any Lisp code or the garbage collector while
+   the block is active.  */
+
+char **
+make_environment_block (Lisp_Object current_dir)
+{
+  char **env;
+  char *pwd_var;
+
+  {
+    char *temp;
+    ptrdiff_t i;
+
+    i = SBYTES (current_dir);
+    pwd_var = xmalloc (i + 5);
+    record_unwind_protect_ptr (xfree, pwd_var);
+    temp = pwd_var + 4;
+    memcpy (pwd_var, "PWD=", 4);
+    lispstpcpy (temp, current_dir);
+
+#ifdef DOS_NT
+    /* Get past the drive letter, so that d:/ is left alone.  */
+    if (i > 2 && IS_DEVICE_SEP (temp[1]) && IS_DIRECTORY_SEP (temp[2]))
+      {
+       temp += 2;
+       i -= 2;
+      }
+#endif /* DOS_NT */
+
+    /* Strip trailing slashes for PWD, but leave "/" and "//" alone.  */
+    while (i > 2 && IS_DIRECTORY_SEP (temp[i - 1]))
+      temp[--i] = 0;
+  }
+
+  /* Set `env' to a vector of the strings in the environment.  */
+
+  {
+    register Lisp_Object tem;
+    register char **new_env;
+    char **p, **q;
+    register int new_length;
+    Lisp_Object display = Qnil;
+
+    new_length = 0;
+
+    for (tem = Vprocess_environment;
+        CONSP (tem) && STRINGP (XCAR (tem));
+        tem = XCDR (tem))
+      {
+       if (strncmp (SSDATA (XCAR (tem)), "DISPLAY", 7) == 0
+           && (SDATA (XCAR (tem)) [7] == '\0'
+               || SDATA (XCAR (tem)) [7] == '='))
+         /* DISPLAY is specified in process-environment.  */
+         display = Qt;
+       new_length++;
+      }
+
+    /* If not provided yet, use the frame's DISPLAY.  */
+    if (NILP (display))
+      {
+       Lisp_Object tmp = Fframe_parameter (selected_frame, Qdisplay);
+       if (!STRINGP (tmp) && CONSP (Vinitial_environment))
+         /* If still not found, Look for DISPLAY in Vinitial_environment.  */
+         tmp = Fgetenv_internal (build_string ("DISPLAY"),
+                                 Vinitial_environment);
+       if (STRINGP (tmp))
+         {
+           display = tmp;
+           new_length++;
+         }
+      }
+
+    /* new_length + 2 to include PWD and terminating 0.  */
+    env = new_env = xnmalloc (new_length + 2, sizeof *env);
+    record_unwind_protect_ptr (xfree, env);
+    /* If we have a PWD envvar, pass one down,
+       but with corrected value.  */
+    if (egetenv ("PWD"))
+      *new_env++ = pwd_var;
+
+    if (STRINGP (display))
+      {
+       char *vdata = xmalloc (sizeof "DISPLAY=" + SBYTES (display));
+       record_unwind_protect_ptr (xfree, vdata);
+       lispstpcpy (stpcpy (vdata, "DISPLAY="), display);
+       new_env = add_env (env, new_env, vdata);
+      }
+
+    /* Overrides.  */
+    for (tem = Vprocess_environment;
+        CONSP (tem) && STRINGP (XCAR (tem));
+        tem = XCDR (tem))
+      new_env = add_env (env, new_env, SSDATA (XCAR (tem)));
+
+    *new_env = 0;
+
+    /* Remove variable names without values.  */
+    p = q = env;
+    while (*p != 0)
+      {
+       while (*q != 0 && strchr (*q, '=') == NULL)
+         q++;
+       *p = *q++;
+       if (*p != 0)
+         p++;
+      }
+  }
+
+  return env;
+}
+
 
 /* This is run before init_cmdargs.  */
 
diff --git a/src/casefiddle.c b/src/casefiddle.c
index debd241..a948bb3 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -1,7 +1,7 @@
 /* -*- coding: utf-8 -*- */
 /* GNU Emacs case conversion functions.
 
-Copyright (C) 1985, 1994, 1997-1999, 2001-2020 Free Software Foundation,
+Copyright (C) 1985, 1994, 1997-1999, 2001-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/casetab.c b/src/casetab.c
index 07cda36..4699857 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -1,5 +1,5 @@
 /* GNU Emacs routines to deal with case tables.
-   Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 Author: Howard Gayle
 
diff --git a/src/category.c b/src/category.c
index c80571e..ec8f61f 100644
--- a/src/category.c
+++ b/src/category.c
@@ -1,6 +1,6 @@
 /* GNU Emacs routines to deal with category tables.
 
-Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
   2005, 2006, 2007, 2008, 2009, 2010, 2011
   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/ccl.c b/src/ccl.c
index 796698e..7c033af 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1,5 +1,5 @@
 /* CCL (Code Conversion Language) interpreter.
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
      2005, 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
@@ -1151,7 +1151,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int 
*destination, int src_size
              if (!INT_DIVIDE_OVERFLOW (reg[rrr], i))
                reg[rrr] /= i;
              break;
-           case CCL_MOD: reg[rrr] %= i; break;
+           case CCL_MOD:
              if (!i)
                CCL_INVALID_CMD;
              reg[rrr] = i == -1 ? 0 : reg[rrr] % i;
diff --git a/src/character.c b/src/character.c
index 00b7329..a599a03 100644
--- a/src/character.c
+++ b/src/character.c
@@ -1,6 +1,6 @@
 /* Basic character support.
 
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 Copyright (C) 1995, 1997, 1998, 2001 Electrotechnical Laboratory, JAPAN.
   Licensed to the Free Software Foundation.
 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
diff --git a/src/charset.c b/src/charset.c
index 520dd3a..eb388d1 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1,6 +1,6 @@
 /* Basic character set support.
 
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
   2005, 2006, 2007, 2008, 2009, 2010, 2011
@@ -800,7 +800,9 @@ RANGE is a cons (FROM .  TO), where FROM and TO indicate a 
range of
 characters contained in CHARSET.
 
 The optional 4th and 5th arguments FROM-CODE and TO-CODE specify the
-range of code points (in CHARSET) of target characters.  */)
+range of code points (in CHARSET) of target characters.  Note that
+these are not character codes, but code points in CHARSET; for the
+difference see `decode-char' and `list-charset-chars'.  */)
   (Lisp_Object function, Lisp_Object charset, Lisp_Object arg, Lisp_Object 
from_code, Lisp_Object to_code)
 {
   struct charset *cs;
diff --git a/src/charset.h b/src/charset.h
index 62b28e6..97122d8 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,5 +1,5 @@
 /* Header for charset handler.
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
      2005, 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/chartab.c b/src/chartab.c
index cb2ced5..331e859 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -1000,10 +1000,10 @@ map_sub_char_table_for_charset (void (*c_function) 
(Lisp_Object, Lisp_Object),
    "mapping table" or a "deunifier table" of a certain charset.
 
    If CHARSET is not NULL (this is the case that `map-charset-chars'
-   is called with non-nil FROM-CODE and TO-CODE), it is a charset who
-   owns TABLE, and the function is called only on a character in the
+   is called with non-nil FROM-CODE and TO-CODE), it is a charset that
+   owns TABLE, and the function is called only for characters in the
    range FROM and TO.  FROM and TO are not character codes, but code
-   points of a character in CHARSET.
+   points of characters in CHARSET (see 'decode-char').
 
    This function is called in these two cases:
 
diff --git a/src/cm.c b/src/cm.c
index dc5a5a3..fe81ca8 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -1,5 +1,5 @@
 /* Cursor motion subroutines for GNU Emacs.
-   Copyright (C) 1985, 1995, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1995, 2001-2021 Free Software Foundation, Inc.
     based primarily on public domain code written by Chris Torek
 
 This file is part of GNU Emacs.
diff --git a/src/cm.h b/src/cm.h
index 11d0b2b..9bea332 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -1,5 +1,5 @@
 /* Cursor motion calculation definitions for GNU Emacs
-   Copyright (C) 1985, 1989, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1989, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/cmds.c b/src/cmds.c
index c29cf00..798fd68 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -1,6 +1,6 @@
 /* Simple built-in editing commands.
 
-Copyright (C) 1985, 1993-1998, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1993-1998, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/coding.c b/src/coding.c
index 2142e7f..739dd6a 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1,5 +1,5 @@
 /* Coding system handler (conversion, detection, etc).
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
      2005, 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
@@ -7821,7 +7821,7 @@ encode_coding (struct coding_system *coding)
 
 /* A string that serves as name of the reusable work buffer, and as base
    name of temporary work buffers used for code-conversion operations.  */
-Lisp_Object Vcode_conversion_workbuf_name;
+static Lisp_Object Vcode_conversion_workbuf_name;
 
 /* The reusable working buffer, created once and never killed.  */
 static Lisp_Object Vcode_conversion_reused_workbuf;
@@ -7839,7 +7839,7 @@ code_conversion_restore (Lisp_Object arg)
   if (! NILP (workbuf))
     {
       if (EQ (workbuf, Vcode_conversion_reused_workbuf))
-       reused_workbuf_in_use = 0;
+       reused_workbuf_in_use = false;
       else
        Fkill_buffer (workbuf);
     }
@@ -7857,13 +7857,13 @@ code_conversion_save (bool with_work_buf, bool 
multibyte)
        {
          Lisp_Object name
            = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil);
-         workbuf = Fget_buffer_create (name);
+         workbuf = Fget_buffer_create (name, Qt);
        }
       else
        {
          if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf)))
            Vcode_conversion_reused_workbuf
-             = Fget_buffer_create (Vcode_conversion_workbuf_name);
+             = Fget_buffer_create (Vcode_conversion_workbuf_name, Qt);
          workbuf = Vcode_conversion_reused_workbuf;
        }
     }
@@ -7881,7 +7881,7 @@ code_conversion_save (bool with_work_buf, bool multibyte)
       bset_undo_list (current_buffer, Qt);
       bset_enable_multibyte_characters (current_buffer, multibyte ? Qt : Qnil);
       if (EQ (workbuf, Vcode_conversion_reused_workbuf))
-       reused_workbuf_in_use = 1;
+       reused_workbuf_in_use = true;
       set_buffer_internal (current);
     }
 
@@ -10354,8 +10354,8 @@ decode_file_name (Lisp_Object fname)
 #endif
 }
 
-Lisp_Object
-encode_file_name (Lisp_Object fname)
+static Lisp_Object
+encode_file_name_1 (Lisp_Object fname)
 {
   /* This is especially important during bootstrap and dumping, when
      file-name encoding is not yet known, and therefore any non-ASCII
@@ -10380,6 +10380,19 @@ encode_file_name (Lisp_Object fname)
 #endif
 }
 
+Lisp_Object
+encode_file_name (Lisp_Object fname)
+{
+  Lisp_Object encoded = encode_file_name_1 (fname);
+  /* No system accepts NUL bytes in filenames.  Allowing them can
+     cause subtle bugs because the system would silently use a
+     different filename than expected.  Perform this check after
+     encoding to not miss NUL bytes introduced through encoding.  */
+  CHECK_TYPE (memchr (SSDATA (encoded), '\0', SBYTES (encoded)) == NULL,
+              Qfilenamep, fname);
+  return encoded;
+}
+
 DEFUN ("decode-coding-string", Fdecode_coding_string, Sdecode_coding_string,
        2, 4, 0,
        doc: /* Decode STRING which is encoded in CODING-SYSTEM, and return the 
result.
@@ -11639,7 +11652,7 @@ syms_of_coding (void)
   staticpro (&Vcode_conversion_workbuf_name);
   Vcode_conversion_workbuf_name = build_pure_c_string (" 
*code-conversion-work*");
 
-  reused_workbuf_in_use = 0;
+  reused_workbuf_in_use = false;
   PDUMPER_REMEMBER_SCALAR (reused_workbuf_in_use);
 
   DEFSYM (Qcharset, "charset");
@@ -11780,6 +11793,7 @@ syms_of_coding (void)
   DEFSYM (Qignored, "ignored");
 
   DEFSYM (Qutf_8_string_p, "utf-8-string-p");
+  DEFSYM (Qfilenamep, "filenamep");
 
   defsubr (&Scoding_system_p);
   defsubr (&Sread_coding_system);
diff --git a/src/coding.h b/src/coding.h
index 4973cf8..d06bed3 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -1,5 +1,5 @@
 /* Header for coding system handler.
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
      2005, 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
@@ -97,9 +97,6 @@ enum define_coding_undecided_arg_index
 
 extern Lisp_Object Vcoding_system_hash_table;
 
-/* Name (or base name) of work buffer for code conversion.  */
-extern Lisp_Object Vcode_conversion_workbuf_name;
-
 /* Enumeration of index to an attribute vector of a coding system.  */
 
 enum coding_attr_index
diff --git a/src/commands.h b/src/commands.h
index 81e9b7e..a09858d 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -1,5 +1,5 @@
 /* Definitions needed by most editing commands.
-   Copyright (C) 1985, 1994, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1994, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/composite.c b/src/composite.c
index 66c1e86..f1c0112 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1,5 +1,5 @@
 /* Composite sequence support.
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 
2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H14PRO021
diff --git a/src/composite.h b/src/composite.h
index bdf63fe..c5d3c0f 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -1,5 +1,5 @@
 /* Header for composite sequence handler.
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 
2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H14PRO021
diff --git a/src/conf_post.h b/src/conf_post.h
index 1ef4ff3..bd56f29 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -1,6 +1,6 @@
 /* conf_post.h --- configure.ac includes this via AH_BOTTOM
 
-Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2020 Free Software
+Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/cygw32.c b/src/cygw32.c
index d402669..b11d94d 100644
--- a/src/cygw32.c
+++ b/src/cygw32.c
@@ -1,5 +1,5 @@
 /* Cygwin support routines.
-   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/cygw32.h b/src/cygw32.h
index 647211b..19cb775 100644
--- a/src/cygw32.h
+++ b/src/cygw32.h
@@ -1,5 +1,5 @@
 /* Header for Cygwin support routines.
-   Copyright (C) 2011-2020 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/data.c b/src/data.c
index 384c259..d420bf5 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1,5 +1,5 @@
 /* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
-   Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2020 Free Software
+   Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -1639,8 +1639,9 @@ default_value (Lisp_Object symbol)
 
 DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0,
        doc: /* Return t if SYMBOL has a non-void default value.
-This is the value that is seen in buffers that do not have their own values
-for this variable.  */)
+A variable may have a buffer-local or a `let'-bound local value.  This
+function says whether the variable has a non-void value outside of the
+current context.  Also see `default-value'.  */)
   (Lisp_Object symbol)
 {
   register Lisp_Object value;
diff --git a/src/dbusbind.c b/src/dbusbind.c
index dc4db5c..c005474 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -1,5 +1,5 @@
 /* Elisp bindings for D-Bus.
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -132,23 +132,36 @@ static bool xd_in_read_queued_messages = 0;
 #define XD_BASIC_DBUS_TYPE(type)                                       \
   (dbus_type_is_valid (type) && dbus_type_is_basic (type))
 #else
-#define XD_BASIC_DBUS_TYPE(type)                                       \
-  ((type == DBUS_TYPE_BYTE)                                            \
-   || (type == DBUS_TYPE_BOOLEAN)                                      \
-   || (type == DBUS_TYPE_INT16)                                                
\
-   || (type == DBUS_TYPE_UINT16)                                       \
-   || (type == DBUS_TYPE_INT32)                                                
\
-   || (type == DBUS_TYPE_UINT32)                                       \
-   || (type == DBUS_TYPE_INT64)                                                
\
-   || (type == DBUS_TYPE_UINT64)                                       \
-   || (type == DBUS_TYPE_DOUBLE)                                       \
-   || (type == DBUS_TYPE_STRING)                                       \
-   || (type == DBUS_TYPE_OBJECT_PATH)                                  \
-   || (type == DBUS_TYPE_SIGNATURE)                                    \
 #ifdef DBUS_TYPE_UNIX_FD
-   || (type == DBUS_TYPE_UNIX_FD)                                      \
+#define XD_BASIC_DBUS_TYPE(type)                                       \
+  ((type ==  DBUS_TYPE_BYTE)                                           \
+   || (type ==  DBUS_TYPE_BOOLEAN)                                     \
+   || (type ==  DBUS_TYPE_INT16)                                       \
+   || (type ==  DBUS_TYPE_UINT16)                                      \
+   || (type ==  DBUS_TYPE_INT32)                                       \
+   || (type ==  DBUS_TYPE_UINT32)                                      \
+   || (type ==  DBUS_TYPE_INT64)                                       \
+   || (type ==  DBUS_TYPE_UINT64)                                      \
+   || (type ==  DBUS_TYPE_DOUBLE)                                      \
+   || (type ==  DBUS_TYPE_STRING)                                      \
+   || (type ==  DBUS_TYPE_OBJECT_PATH)                                 \
+   || (type ==  DBUS_TYPE_SIGNATURE)                                   \
+   || (type ==  DBUS_TYPE_UNIX_FD))
+#else
+#define XD_BASIC_DBUS_TYPE(type)                                       \
+  ((type ==  DBUS_TYPE_BYTE)                                           \
+   || (type ==  DBUS_TYPE_BOOLEAN)                                     \
+   || (type ==  DBUS_TYPE_INT16)                                       \
+   || (type ==  DBUS_TYPE_UINT16)                                      \
+   || (type ==  DBUS_TYPE_INT32)                                       \
+   || (type ==  DBUS_TYPE_UINT32)                                      \
+   || (type ==  DBUS_TYPE_INT64)                                       \
+   || (type ==  DBUS_TYPE_UINT64)                                      \
+   || (type ==  DBUS_TYPE_DOUBLE)                                      \
+   || (type ==  DBUS_TYPE_STRING)                                      \
+   || (type ==  DBUS_TYPE_OBJECT_PATH)                                 \
+   || (type ==  DBUS_TYPE_SIGNATURE))
 #endif
-   )
 #endif
 
 /* This was a macro.  On Solaris 2.11 it was said to compile for
diff --git a/src/decompress.c b/src/decompress.c
index 8e8f244..4839249 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -1,5 +1,5 @@
 /* Interface to zlib.
-   Copyright (C) 2013-2020 Free Software Foundation, Inc.
+   Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/deps.mk b/src/deps.mk
index 4d162ee..eda2ed6 100644
--- a/src/deps.mk
+++ b/src/deps.mk
@@ -1,6 +1,6 @@
 ### deps.mk --- src/Makefile fragment for GNU Emacs
 
-## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2020 Free Software
+## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2021 Free Software
 ## Foundation, Inc.
 
 ## This file is part of GNU Emacs.
diff --git a/src/dired.c b/src/dired.c
index feb5f05..ebcf77b 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -1,5 +1,5 @@
 /* Lisp functions for making directory listings.
-   Copyright (C) 1985-1986, 1993-1994, 1999-2020 Free Software
+   Copyright (C) 1985-1986, 1993-1994, 1999-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/dispextern.h b/src/dispextern.h
index da51772..3ad98b8 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1,6 +1,6 @@
 /* Interface definitions for display code.
 
-Copyright (C) 1985, 1993-1994, 1997-2020 Free Software Foundation, Inc.
+Copyright (C) 1985, 1993-1994, 1997-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -3040,6 +3040,10 @@ struct image
 # if !defined USE_CAIRO && defined HAVE_XRENDER
   /* Picture versions of pixmap and mask for compositing.  */
   Picture picture, mask_picture;
+
+  /* We need to store the original image dimensions in case we have to
+     call XGetImage.  */
+  int original_width, original_height;
 # endif
 #endif /* HAVE_X_WINDOWS */
 #ifdef HAVE_NTGUI
diff --git a/src/dispnew.c b/src/dispnew.c
index 89dd32a..36a6dd8 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1,6 +1,6 @@
 /* Updating of data structures for redisplay.
 
-Copyright (C) 1985-1988, 1993-1995, 1997-2020 Free Software Foundation,
+Copyright (C) 1985-1988, 1993-1995, 1997-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -6057,6 +6057,8 @@ sit_for (Lisp_Object timeout, bool reading, int 
display_option)
   intmax_t sec;
   int nsec;
   bool do_display = display_option > 0;
+  bool curbuf_eq_winbuf
+    = (current_buffer == XBUFFER (XWINDOW (selected_window)->contents));
 
   swallow_events (do_display);
 
@@ -6111,6 +6113,13 @@ sit_for (Lisp_Object timeout, bool reading, int 
display_option)
   wait_reading_process_output (sec, nsec, reading ? -1 : 1, do_display,
                               Qnil, NULL, 0);
 
+  if (reading && curbuf_eq_winbuf)
+    /* Timers and process filters/sentinels may have changed the selected
+       window (e.g. in response to a connection from emacsclient), in which
+       case we should follow it (unless we weren't in the selected-window's
+       buffer to start with).  */
+    set_buffer_internal (XBUFFER (XWINDOW (selected_window)->contents));
+
   return detect_input_pending () ? Qnil : Qt;
 }
 
diff --git a/src/disptab.h b/src/disptab.h
index d545347..adf411b 100644
--- a/src/disptab.h
+++ b/src/disptab.h
@@ -1,5 +1,5 @@
 /* Things for GLYPHS and glyph tables.
-   Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/dmpstruct.awk b/src/dmpstruct.awk
index a25bcf6..c7b93da 100644
--- a/src/dmpstruct.awk
+++ b/src/dmpstruct.awk
@@ -1,4 +1,4 @@
-# Copyright (C) 2018-2020 Free Software Foundation, Inc.
+# Copyright (C) 2018-2021 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
diff --git a/src/doc.c b/src/doc.c
index 5f23e3d..1307aa5 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -1,6 +1,6 @@
 /* Record indices of function doc strings stored in a file. -*- coding: utf-8 
-*-
 
-Copyright (C) 1985-1986, 1993-1995, 1997-2020 Free Software Foundation,
+Copyright (C) 1985-1986, 1993-1995, 1997-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -82,10 +82,7 @@ Lisp_Object
 get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
 {
   char *from, *to, *name, *p, *p1;
-  int fd;
-  int offset;
-  EMACS_INT position;
-  Lisp_Object file, tem, pos;
+  Lisp_Object file, pos;
   ptrdiff_t count = SPECPDL_INDEX ();
   USE_SAFE_ALLOCA;
 
@@ -102,7 +99,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool 
definition)
   else
     return Qnil;
 
-  position = eabs (XFIXNUM (pos));
+  EMACS_INT position = eabs (XFIXNUM (pos));
 
   if (!STRINGP (Vdoc_directory))
     return Qnil;
@@ -113,7 +110,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool 
definition)
   /* Put the file name in NAME as a C string.
      If it is relative, combine it with Vdoc_directory.  */
 
-  tem = Ffile_name_absolute_p (file);
+  Lisp_Object tem = Ffile_name_absolute_p (file);
   file = ENCODE_FILE (file);
   Lisp_Object docdir
     = NILP (tem) ? ENCODE_FILE (Vdoc_directory) : empty_unibyte_string;
@@ -123,7 +120,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool 
definition)
   name = SAFE_ALLOCA (docdir_sizemax + SBYTES (file));
   lispstpcpy (lispstpcpy (name, docdir), file);
 
-  fd = emacs_open (name, O_RDONLY, 0);
+  int fd = emacs_open (name, O_RDONLY, 0);
   if (fd < 0)
     {
       if (will_dump_p ())
@@ -150,7 +147,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool 
definition)
   /* Seek only to beginning of disk block.  */
   /* Make sure we read at least 1024 bytes before `position'
      so we can check the leading text for consistency.  */
-  offset = min (position, max (1024, position % (8 * 1024)));
+  int offset = min (position, max (1024, position % (8 * 1024)));
   if (TYPE_MAXIMUM (off_t) < position
       || lseek (fd, position - offset, 0) < 0)
     error ("Position %"pI"d out of range in doc string file \"%s\"",
@@ -164,7 +161,6 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool 
definition)
     {
       ptrdiff_t space_left = (get_doc_string_buffer_size - 1
                              - (p - get_doc_string_buffer));
-      int nread;
 
       /* Allocate or grow the buffer if we need to.  */
       if (space_left <= 0)
@@ -182,7 +178,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool 
definition)
          If we read the same block last time, maybe skip this?  */
       if (space_left > 1024 * 8)
        space_left = 1024 * 8;
-      nread = emacs_read_quit (fd, p, space_left);
+      int nread = emacs_read_quit (fd, p, space_left);
       if (nread < 0)
        report_file_error ("Read error on documentation file", file);
       p[nread] = 0;
@@ -240,10 +236,8 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool 
definition)
     {
       if (*from == 1)
        {
-         int c;
-
          from++;
-         c = *from++;
+         int c = *from++;
          if (c == 1)
            *to++ = c;
          else if (c == '0')
@@ -313,10 +307,8 @@ Unless a non-nil second argument RAW is given, the
 string is passed through `substitute-command-keys'.  */)
   (Lisp_Object function, Lisp_Object raw)
 {
-  Lisp_Object fun;
-  Lisp_Object funcar;
   Lisp_Object doc;
-  bool try_reload = 1;
+  bool try_reload = true;
 
  documentation:
 
@@ -330,7 +322,7 @@ string is passed through `substitute-command-keys'.  */)
                                        raw);
     }
 
-  fun = Findirect_function (function, Qnil);
+  Lisp_Object fun = Findirect_function (function, Qnil);
   if (NILP (fun))
     xsignal1 (Qvoid_function, function);
   if (CONSP (fun) && EQ (XCAR (fun), Qmacro))
@@ -362,7 +354,7 @@ string is passed through `substitute-command-keys'.  */)
     }
   else if (CONSP (fun))
     {
-      funcar = XCAR (fun);
+      Lisp_Object funcar = XCAR (fun);
       if (!SYMBOLP (funcar))
        xsignal1 (Qinvalid_function, fun);
       else if (EQ (funcar, Qkeymap))
@@ -406,7 +398,7 @@ string is passed through `substitute-command-keys'.  */)
          try_reload = reread_doc_file (Fcar_safe (doc));
          if (try_reload)
            {
-             try_reload = 0;
+             try_reload = false;
              goto documentation;
            }
        }
@@ -430,7 +422,7 @@ This differs from `get' in that it can refer to strings 
stored in the
 aren't strings.  */)
   (Lisp_Object symbol, Lisp_Object prop, Lisp_Object raw)
 {
-  bool try_reload = 1;
+  bool try_reload = true;
   Lisp_Object tem;
 
  documentation_property:
@@ -462,7 +454,7 @@ aren't strings.  */)
          try_reload = reread_doc_file (Fcar_safe (doc));
          if (try_reload)
            {
-             try_reload = 0;
+             try_reload = false;
              goto documentation_property;
            }
        }
@@ -492,9 +484,7 @@ store_function_docstring (Lisp_Object obj, EMACS_INT offset)
     fun = XCDR (fun);
   if (CONSP (fun))
     {
-      Lisp_Object tem;
-
-      tem = XCAR (fun);
+      Lisp_Object tem = XCAR (fun);
       if (EQ (tem, Qlambda) || EQ (tem, Qautoload)
          || (EQ (tem, Qclosure) && (fun = XCDR (fun), 1)))
        {
diff --git a/src/doprnt.c b/src/doprnt.c
index 7b742ad..b6b5978 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -1,7 +1,7 @@
 /* Output like sprintf to a buffer of specified size.    -*- coding: utf-8 -*-
    Also takes args differently: pass one pointer to the end
    of the format string in addition to the format string itself.
-   Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/dosfns.c b/src/dosfns.c
index 7a6605d..10023c8 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -1,6 +1,6 @@
 /* MS-DOS specific Lisp utilities.  Coded by Manabu Higashida, 1991.
    Major changes May-July 1993 Morten Welinder (only 10% original code left)
-   Copyright (C) 1991, 1993, 1996-1998, 2001-2020 Free Software
+   Copyright (C) 1991, 1993, 1996-1998, 2001-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/dosfns.h b/src/dosfns.h
index bae199b..6ad2a03 100644
--- a/src/dosfns.h
+++ b/src/dosfns.h
@@ -2,7 +2,7 @@
    Coded by Manabu Higashida, 1991.
    Modified by Morten Welinder, 1993-1994.
 
-Copyright (C) 1991, 1994-1995, 1997, 1999, 2001-2020 Free Software
+Copyright (C) 1991, 1994-1995, 1997, 1999, 2001-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/dynlib.c b/src/dynlib.c
index 4919d5c..86f8b7e 100644
--- a/src/dynlib.c
+++ b/src/dynlib.c
@@ -1,6 +1,6 @@
 /* Portable API for dynamic loading.
 
-Copyright 2015-2020 Free Software Foundation, Inc.
+Copyright 2015-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/dynlib.h b/src/dynlib.h
index cb3454b..e20d889 100644
--- a/src/dynlib.h
+++ b/src/dynlib.h
@@ -1,6 +1,6 @@
 /* Portable API for dynamic loading.
 
-Copyright 2015-2020 Free Software Foundation, Inc.
+Copyright 2015-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/editfns.c b/src/editfns.c
index 4104edd..6f04c99 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1,6 +1,6 @@
 /* Lisp functions pertaining to editing.                 -*- coding: utf-8 -*-
 
-Copyright (C) 1985-1987, 1989, 1993-2020 Free Software Foundation, Inc.
+Copyright (C) 1985-1987, 1989, 1993-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -188,11 +188,16 @@ DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 
0, 0,
   return build_marker (current_buffer, PT, PT_BYTE);
 }
 
-DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ",
+DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1,
+         "(goto-char--read-natnum-interactive \"Go to char: \")",
        doc: /* Set point to POSITION, a number or marker.
 Beginning of buffer is position (point-min), end is (point-max).
 
-The return value is POSITION.  */)
+The return value is POSITION.
+
+If called interactively, a numeric prefix argument specifies
+POSITION; without a numeric prefix argument, read POSITION from the
+minibuffer.  The default value is the number at point (if any).  */)
   (register Lisp_Object position)
 {
   if (MARKERP (position))
diff --git a/src/emacs-icon.h b/src/emacs-icon.h
index c3fd7f3..87790bb 100644
--- a/src/emacs-icon.h
+++ b/src/emacs-icon.h
@@ -1,7 +1,7 @@
 /* XPM */
 /* Emacs icon
 
-Copyright (C) 2008-2020 Free Software Foundation, Inc.
+Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 Author: Kentaro Ohkouchi <nanasess@fsm.ne.jp>
         Nicolas Petton <nicolas@petton.fr>
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 0f3ef59..894dffc 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -1,6 +1,6 @@
 /* emacs-module.c - Module loading and runtime implementation
 
-Copyright (C) 2015-2020 Free Software Foundation, Inc.
+Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -784,7 +784,8 @@ module_make_string (emacs_env *env, const char *str, 
ptrdiff_t len)
   MODULE_FUNCTION_BEGIN (NULL);
   if (! (0 <= len && len <= STRING_BYTES_BOUND))
     overflow_error ();
-  Lisp_Object lstr = module_decode_utf_8 (str, len);
+  Lisp_Object lstr
+    = len == 0 ? empty_multibyte_string : module_decode_utf_8 (str, len);
   return lisp_to_value (env, lstr);
 }
 
@@ -794,9 +795,8 @@ module_make_unibyte_string (emacs_env *env, const char 
*str, ptrdiff_t length)
   MODULE_FUNCTION_BEGIN (NULL);
   if (! (0 <= length && length <= STRING_BYTES_BOUND))
     overflow_error ();
-  Lisp_Object lstr = make_uninit_string (length);
-  memcpy (SDATA (lstr), str, length);
-  SDATA (lstr)[length] = 0;
+  Lisp_Object lstr
+    = length == 0 ? empty_unibyte_string : make_unibyte_string (str, length);
   return lisp_to_value (env, lstr);
 }
 
diff --git a/src/emacs-module.h.in b/src/emacs-module.h.in
index 6a39d50..2989b43 100644
--- a/src/emacs-module.h.in
+++ b/src/emacs-module.h.in
@@ -1,6 +1,6 @@
 /* emacs-module.h - GNU Emacs module API.
 
-Copyright (C) 2015-2020 Free Software Foundation, Inc.
+Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/emacs.c b/src/emacs.c
index d1b010e..fe8dcb1 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1,6 +1,6 @@
 /* Fully extensible Emacs, running on Unix, intended for GNU.
 
-Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2020 Free Software
+Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -2365,10 +2365,13 @@ all of which are called before Emacs is actually 
killed.  */
   /* Fsignal calls emacs_abort () if it sees that waiting_for_input is
      set.  */
   waiting_for_input = 0;
-  if (noninteractive)
-    safe_run_hooks (Qkill_emacs_hook);
-  else
-    run_hook (Qkill_emacs_hook);
+  if (!NILP (find_symbol_value (Qkill_emacs_hook)))
+    {
+      if (noninteractive)
+       safe_run_hooks (Qkill_emacs_hook);
+      else
+       call1 (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook);
+    }
 
 #ifdef HAVE_X_WINDOWS
   /* Transfer any clipboards we own to the clipboard manager.  */
@@ -2890,6 +2893,8 @@ syms_of_emacs (void)
   DEFSYM (Qrisky_local_variable, "risky-local-variable");
   DEFSYM (Qkill_emacs, "kill-emacs");
   DEFSYM (Qkill_emacs_hook, "kill-emacs-hook");
+  DEFSYM (Qrun_hook_query_error_with_timeout,
+         "run-hook-query-error-with-timeout");
 
 #ifdef HAVE_UNEXEC
   defsubr (&Sdump_emacs);
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index ea9465d..996ded2 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -1,7 +1,7 @@
 /* A Gtk Widget that inherits GtkFixed, but can be shrunk.
 This file is only use when compiling with Gtk+ 3.
 
-Copyright (C) 2011-2020 Free Software Foundation, Inc.
+Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/emacsgtkfixed.h b/src/emacsgtkfixed.h
index b230a4d..7887976 100644
--- a/src/emacsgtkfixed.h
+++ b/src/emacsgtkfixed.h
@@ -1,7 +1,7 @@
 /* A Gtk Widget that inherits GtkFixed, but can be shrunk.
 This file is only use when compiling with Gtk+ 3.
 
-Copyright (C) 2011-2020 Free Software Foundation, Inc.
+Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/epaths.in b/src/epaths.in
index 3cadd16..1de1e05 100644
--- a/src/epaths.in
+++ b/src/epaths.in
@@ -1,6 +1,6 @@
 /* Hey Emacs, this is -*- C -*- code!  */
 /*
-Copyright (C) 1993, 1995, 1997, 1999, 2001-2020 Free Software
+Copyright (C) 1993, 1995, 1997, 1999, 2001-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/eval.c b/src/eval.c
index 18df484..706aafd 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1,6 +1,6 @@
 /* Evaluator for GNU Emacs Lisp interpreter.
 
-Copyright (C) 1985-1987, 1993-1995, 1999-2020 Free Software Foundation,
+Copyright (C) 1985-1987, 1993-1995, 1999-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -1731,11 +1731,16 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object 
data, bool keyboard_quit)
        return Qnil;
     }
 
-  /* If we're in batch mode, print a backtrace unconditionally to help with
-     debugging.  Make sure to use `debug' unconditionally to not interfere with
-     ERT or other packages that install custom debuggers.  */
+  /* If we're in batch mode, print a backtrace unconditionally to help
+     with debugging.  Make sure to use `debug' unconditionally to not
+     interfere with ERT or other packages that install custom
+     debuggers.  Don't try to call the debugger while dumping or
+     bootstrapping, it wouldn't work anyway.  */
   if (!debugger_called && !NILP (error_symbol)
-      && (NILP (clause) || EQ (h->tag_or_ch, Qerror)) && noninteractive)
+      && (NILP (clause) || EQ (h->tag_or_ch, Qerror))
+      && noninteractive && backtrace_on_error_noninteractive
+      && !will_dump_p () && !will_bootstrap_p ()
+      && NILP (Vinhibit_debugger))
     {
       ptrdiff_t count = SPECPDL_INDEX ();
       specbind (Vdebugger, Qdebug);
@@ -4264,6 +4269,14 @@ Note that `debug-on-error', `debug-on-quit' and friends
 still determine whether to handle the particular condition.  */);
   Vdebug_on_signal = Qnil;
 
+  DEFVAR_BOOL ("backtrace-on-error-noninteractive",
+               backtrace_on_error_noninteractive,
+               doc: /* Non-nil means print backtrace on error in batch mode.
+If this is nil, errors in batch mode will just print the error
+message upon encountering an unhandled error, without showing
+the Lisp backtrace.  */);
+  backtrace_on_error_noninteractive = true;
+
   /* The value of num_nonmacro_input_events as of the last time we
    started to enter the debugger.  If we decide to enter the debugger
    again when this is still equal to num_nonmacro_input_events, then we
diff --git a/src/fileio.c b/src/fileio.c
index 283813f..741e297 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1,6 +1,6 @@
 /* File IO for GNU Emacs.
 
-Copyright (C) 1985-1988, 1993-2020 Free Software Foundation, Inc.
+Copyright (C) 1985-1988, 1993-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -3050,7 +3050,6 @@ file_accessible_directory_p (Lisp_Object file)
   ptrdiff_t len = SBYTES (file);
   char const *dir;
   bool ok;
-  int saved_errno;
   USE_SAFE_ALLOCA;
 
   /* Normally a file "FOO" is an accessible directory if "FOO/." exists.
@@ -3075,9 +3074,7 @@ file_accessible_directory_p (Lisp_Object file)
     }
 
   ok = file_access_p (dir, F_OK);
-  saved_errno = errno;
   SAFE_FREE ();
-  errno = saved_errno;
   return ok;
 #endif /* !DOS_NT */
 }
@@ -3757,9 +3754,10 @@ characters in the buffer.  If VISIT is non-nil, BEG and 
END must be nil.
 If optional fifth argument REPLACE is non-nil, replace the current
 buffer contents (in the accessible portion) with the file contents.
 This is better than simply deleting and inserting the whole thing
-because (1) it preserves some marker positions and (2) it puts less data
-in the undo list.  When REPLACE is non-nil, the second return value is
-the number of characters that replace previous buffer contents.
+because (1) it preserves some marker positions (in unchanged portions
+at the start and end of the buffer) and (2) it puts less data in the
+undo list.  When REPLACE is non-nil, the second return value is the
+number of characters that replace previous buffer contents.
 
 This function does code conversion according to the value of
 `coding-system-for-read' or `file-coding-system-alist', and sets the
@@ -4003,7 +4001,7 @@ by calling `format-decode', which see.  */)
 
                  record_unwind_current_buffer ();
 
-                 workbuf = Fget_buffer_create (name);
+                 workbuf = Fget_buffer_create (name, Qt);
                  buf = XBUFFER (workbuf);
 
                  delete_all_overlays (buf);
@@ -5751,7 +5749,7 @@ auto_save_error (Lisp_Object error_val)
   Lisp_Object msg = CALLN (Fformat, format, BVAR (current_buffer, name),
                           Ferror_message_string (error_val));
   call3 (intern ("display-warning"),
-         intern ("auto-save"), msg, intern ("error"));
+         intern ("auto-save"), msg, intern (":error"));
 
   return Qnil;
 }
@@ -6258,6 +6256,7 @@ syms_of_fileio (void)
   DEFSYM (Qfile_date_error, "file-date-error");
   DEFSYM (Qfile_missing, "file-missing");
   DEFSYM (Qfile_notify_error, "file-notify-error");
+  DEFSYM (Qremote_file_error, "remote-file-error");
   DEFSYM (Qexcl, "excl");
 
   DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system,
@@ -6319,6 +6318,11 @@ behaves as if file names were encoded in `utf-8'.  */);
   Fput (Qfile_notify_error, Qerror_message,
        build_pure_c_string ("File notification error"));
 
+  Fput (Qremote_file_error, Qerror_conditions,
+       Fpurecopy (list3 (Qremote_file_error, Qfile_error, Qerror)));
+  Fput (Qremote_file_error, Qerror_message,
+       build_pure_c_string ("Remote file error"));
+
   DEFVAR_LISP ("file-name-handler-alist", Vfile_name_handler_alist,
               doc: /* Alist of elements (REGEXP . HANDLER) for file names 
handled specially.
 If a file name matches REGEXP, all I/O on that file is done by calling
diff --git a/src/filelock.c b/src/filelock.c
index 39febd3..35baa0c 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -1,6 +1,6 @@
 /* Lock files for editing.
 
-Copyright (C) 1985-1987, 1993-1994, 1996, 1998-2020 Free Software
+Copyright (C) 1985-1987, 1993-1994, 1996, 1998-2021 Free Software
 Foundation, Inc.
 
 Author: Richard King
diff --git a/src/firstfile.c b/src/firstfile.c
index 9dc70df..2733e1b 100644
--- a/src/firstfile.c
+++ b/src/firstfile.c
@@ -1,5 +1,5 @@
 /* Mark beginning of data space to dump as pure, for GNU Emacs.
-   Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/floatfns.c b/src/floatfns.c
index 235e3b4..aadae4f 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -1,6 +1,6 @@
 /* Primitive operations on floating point for GNU Emacs Lisp interpreter.
 
-Copyright (C) 1988, 1993-1994, 1999, 2001-2020 Free Software Foundation,
+Copyright (C) 1988, 1993-1994, 1999, 2001-2021 Free Software Foundation,
 Inc.
 
 Author: Wolfgang Rupprecht (according to ack.texi)
diff --git a/src/fns.c b/src/fns.c
index e4c9acc..5fcc54f 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1,6 +1,6 @@
 /* Random utility Lisp functions.
 
-Copyright (C) 1985-1987, 1993-1995, 1997-2020 Free Software Foundation,
+Copyright (C) 1985-1987, 1993-1995, 1997-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -105,9 +105,14 @@ list_length (Lisp_Object list)
 DEFUN ("length", Flength, Slength, 1, 1, 0,
        doc: /* Return the length of vector, list or string SEQUENCE.
 A byte-code function object is also allowed.
+
 If the string contains multibyte characters, this is not necessarily
 the number of bytes in the string; it is the number of characters.
-To get the number of bytes, use `string-bytes'.  */)
+To get the number of bytes, use `string-bytes'.
+
+If the length of a list is being computed to compare to a (small)
+number, the `length<', `length>' and `length=' functions may be more
+efficient.  */)
   (Lisp_Object sequence)
 {
   EMACS_INT val;
@@ -145,6 +150,75 @@ least the number of distinct elements.  */)
   return make_fixnum (len);
 }
 
+static inline
+EMACS_INT length_internal (Lisp_Object sequence, int len)
+{
+  /* If LENGTH is short (arbitrarily chosen cut-off point), use a
+     fast loop that doesn't care about whether SEQUENCE is
+     circular or not. */
+  if (len < 0xffff)
+    while (CONSP (sequence))
+      {
+       if (--len <= 0)
+         return -1;
+       sequence = XCDR (sequence);
+      }
+  /* Signal an error on circular lists. */
+  else
+    FOR_EACH_TAIL (sequence)
+      if (--len <= 0)
+       return -1;
+  return len;
+}
+
+DEFUN ("length<", Flength_less, Slength_less, 2, 2, 0,
+       doc: /* Return non-nil if SEQUENCE is shorter than LENGTH.
+See `length' for allowed values of SEQUENCE and how elements are
+counted.  */)
+  (Lisp_Object sequence, Lisp_Object length)
+{
+  CHECK_FIXNUM (length);
+  EMACS_INT len = XFIXNUM (length);
+
+  if (CONSP (sequence))
+    return length_internal (sequence, len) == -1? Qnil: Qt;
+  else
+    return XFIXNUM (Flength (sequence)) < len? Qt: Qnil;
+}
+
+DEFUN ("length>", Flength_greater, Slength_greater, 2, 2, 0,
+       doc: /* Return non-nil if SEQUENCE is longer than LENGTH.
+See `length' for allowed values of SEQUENCE and how elements are
+counted.  */)
+  (Lisp_Object sequence, Lisp_Object length)
+{
+  CHECK_FIXNUM (length);
+  EMACS_INT len = XFIXNUM (length);
+
+  if (CONSP (sequence))
+    return length_internal (sequence, len + 1) == -1? Qt: Qnil;
+  else
+    return XFIXNUM (Flength (sequence)) > len? Qt: Qnil;
+}
+
+DEFUN ("length=", Flength_equal, Slength_equal, 2, 2, 0,
+       doc: /* Return non-nil if SEQUENCE has length equal to LENGTH.
+See `length' for allowed values of SEQUENCE and how elements are
+counted.  */)
+  (Lisp_Object sequence, Lisp_Object length)
+{
+  CHECK_FIXNUM (length);
+  EMACS_INT len = XFIXNUM (length);
+
+  if (len < 0)
+    return Qnil;
+
+  if (CONSP (sequence))
+    return length_internal (sequence, len + 1) == 1? Qt: Qnil;
+  else
+    return XFIXNUM (Flength (sequence)) == len? Qt: Qnil;
+}
+
 DEFUN ("proper-list-p", Fproper_list_p, Sproper_list_p, 1, 1, 0,
        doc: /* Return OBJECT's length if it is a proper list, nil otherwise.
 A proper list is neither circular nor dotted (i.e., its last cdr is nil).  */
@@ -4525,16 +4599,34 @@ sweep_weak_table (struct Lisp_Hash_Table *h, bool 
remove_entries_p)
 EMACS_UINT
 hash_string (char const *ptr, ptrdiff_t len)
 {
-  char const *p = ptr;
-  char const *end = p + len;
-  unsigned char c;
-  EMACS_UINT hash = 0;
+  EMACS_UINT const *p   = (EMACS_UINT const *) ptr;
+  EMACS_UINT const *end = (EMACS_UINT const *) (ptr + len);
+  EMACS_UINT hash = len;
+  /* At most 8 steps.  We could reuse SXHASH_MAX_LEN, of course,
+   * but dividing by 8 is cheaper.  */
+  ptrdiff_t step = 1 + ((end - p) >> 3);
 
-  while (p != end)
+  /* Beware: `end` might be unaligned, so `p < end` is not always the same
+   * as `p <= end - 1`.  */
+  while (p <= end - 1)
     {
-      c = *p++;
+      EMACS_UINT c = *p;
+      p += step;
       hash = sxhash_combine (hash, c);
     }
+  if (p < end)
+    { /* A few last bytes remain (smaller than an EMACS_UINT).  */
+      /* FIXME: We could do this without a loop, but it'd require
+         endian-dependent code :-(  */
+      char const *p1 = (char const *)p;
+      char const *end1 = (char const *)end;
+      do
+        {
+          unsigned char c = *p1++;
+          hash = sxhash_combine (hash, c);
+        }
+      while (p1 < end1);
+    }
 
   return hash;
 }
@@ -5418,7 +5510,8 @@ disregarding any coding systems.  If nil, use the current 
buffer.
 
 This function is useful for comparing two buffers running in the same
 Emacs, but is not guaranteed to return the same hash between different
-Emacs versions.
+Emacs versions.  It should be somewhat more efficient on larger
+buffers than `secure-hash' is, and should not allocate more memory.
 
 It should not be used for anything security-related.  See
 `secure-hash' for these applications.  */ )
@@ -5551,6 +5644,40 @@ Case is always significant and text properties are 
ignored. */)
 
   return make_int (string_byte_to_char (haystack, res - SSDATA (haystack)));
 }
+
+static void
+collect_interval (INTERVAL interval, Lisp_Object collector)
+{
+  nconc2 (collector,
+         list1(list3 (make_fixnum (interval->position),
+                      make_fixnum (interval->position + LENGTH (interval)),
+                      interval->plist)));
+}
+
+DEFUN ("object-intervals", Fobject_intervals, Sobject_intervals, 1, 1, 0,
+       doc: /* Return a copy of the text properties of OBJECT.
+OBJECT must be a buffer or a string.
+
+Altering this copy does not change the layout of the text properties
+in OBJECT.  */)
+  (register Lisp_Object object)
+{
+  Lisp_Object collector = Fcons (Qnil, Qnil);
+  INTERVAL intervals;
+
+  if (STRINGP (object))
+    intervals = string_intervals (object);
+  else if (BUFFERP (object))
+    intervals = buffer_intervals (XBUFFER (object));
+  else
+    wrong_type_argument (Qbuffer_or_string_p, object);
+
+  if (! intervals)
+    return Qnil;
+
+  traverse_intervals (intervals, 0, collect_interval, collector);
+  return CDR (collector);
+}
 
 
 void
@@ -5592,6 +5719,7 @@ syms_of_fns (void)
   defsubr (&Smaphash);
   defsubr (&Sdefine_hash_table_test);
   defsubr (&Sstring_search);
+  defsubr (&Sobject_intervals);
 
   /* Crypto and hashing stuff.  */
   DEFSYM (Qiv_auto, "iv-auto");
@@ -5667,6 +5795,9 @@ this variable.  */);
   defsubr (&Srandom);
   defsubr (&Slength);
   defsubr (&Ssafe_length);
+  defsubr (&Slength_less);
+  defsubr (&Slength_greater);
+  defsubr (&Slength_equal);
   defsubr (&Sproper_list_p);
   defsubr (&Sstring_bytes);
   defsubr (&Sstring_distance);
diff --git a/src/font.c b/src/font.c
index 5f9db2e..a59ebe2 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1,6 +1,6 @@
 /* font.c -- "Font" primitives.
 
-Copyright (C) 2006-2020 Free Software Foundation, Inc.
+Copyright (C) 2006-2021 Free Software Foundation, Inc.
 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
   National Institute of Advanced Industrial Science and Technology (AIST)
   Registration Number H13PRO009
diff --git a/src/font.h b/src/font.h
index 8614e7f..d3e1530 100644
--- a/src/font.h
+++ b/src/font.h
@@ -1,5 +1,5 @@
 /* font.h -- Interface definition for font handling.
-   Copyright (C) 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H13PRO009
diff --git a/src/fontset.c b/src/fontset.c
index 8c86075..332be6c 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1,6 +1,6 @@
 /* Fontset handler.
 
-Copyright (C) 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 2001-2021 Free Software Foundation, Inc.
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
   2005, 2006, 2007, 2008, 2009, 2010, 2011
   National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/fontset.h b/src/fontset.h
index f8a6b1d..42cca50 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -1,5 +1,5 @@
 /* Header for fontset handler.
-   Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
      2005, 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/src/frame.c b/src/frame.c
index 17ec455..45ee96e 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,6 +1,6 @@
 /* Generic frame functions.
 
-Copyright (C) 1993-1995, 1997, 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1993-1995, 1997, 1999-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -3577,7 +3577,9 @@ window managers may refuse to honor a HEIGHT that is not 
an integer
 multiple of the default frame font height.
 
 When called interactively, HEIGHT is the numeric prefix and the
-currently selected frame will be set to this height.  */)
+currently selected frame will be set to this height.
+
+If FRAME is nil, it defaults to the selected frame.  */)
   (Lisp_Object frame, Lisp_Object height, Lisp_Object pretend, Lisp_Object 
pixelwise)
 {
   struct frame *f = decode_live_frame (frame);
@@ -3600,7 +3602,9 @@ window managers may refuse to honor a WIDTH that is not 
an integer
 multiple of the default frame font width.
 
 When called interactively, WIDTH is the numeric prefix and the
-currently selected frame will be set to this width.    */)
+currently selected frame will be set to this width.
+
+If FRAME is nil, it defaults to the selected frame.  */)
   (Lisp_Object frame, Lisp_Object width, Lisp_Object pretend, Lisp_Object 
pixelwise)
 {
   struct frame *f = decode_live_frame (frame);
@@ -3616,7 +3620,9 @@ Optional argument PIXELWISE non-nil means to measure in 
pixels.  Note:
 When `frame-resize-pixelwise' is nil, some window managers may refuse to
 honor a WIDTH that is not an integer multiple of the default frame font
 width or a HEIGHT that is not an integer multiple of the default frame
-font height.  */)
+font height.
+
+If FRAME is nil, it defaults to the selected frame.  */)
   (Lisp_Object frame, Lisp_Object width, Lisp_Object height, Lisp_Object 
pixelwise)
 {
   struct frame *f = decode_live_frame (frame);
diff --git a/src/frame.h b/src/frame.h
index 16ecfd3..8cf41dc 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1,5 +1,5 @@
 /* Define frame-object for GNU Emacs.
-   Copyright (C) 1993-1994, 1999-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 1999-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/fringe.c b/src/fringe.c
index 7549669..65c9a84 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1,5 +1,5 @@
 /* Fringe handling (split from xdisp.c).
-   Copyright (C) 1985-1988, 1993-1995, 1997-2020 Free Software
+   Copyright (C) 1985-1988, 1993-1995, 1997-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/ftcrfont.c b/src/ftcrfont.c
index b895107..db417b3 100644
--- a/src/ftcrfont.c
+++ b/src/ftcrfont.c
@@ -1,5 +1,5 @@
 /* ftcrfont.c -- FreeType font driver on cairo.
-   Copyright (C) 2015-2020 Free Software Foundation, Inc.
+   Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/ftfont.c b/src/ftfont.c
index 6fca9c8..0603dd9 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -1,5 +1,5 @@
 /* ftfont.c -- FreeType font driver.
-   Copyright (C) 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H13PRO009
diff --git a/src/getpagesize.h b/src/getpagesize.h
index f033d97..ec497d0 100644
--- a/src/getpagesize.h
+++ b/src/getpagesize.h
@@ -1,5 +1,5 @@
 /* Emulate getpagesize on systems that lack it.
-   Copyright (C) 1986, 1992, 1995, 2001-2020 Free Software Foundation,
+   Copyright (C) 1986, 1992, 1995, 2001-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/gfilenotify.c b/src/gfilenotify.c
index d083afc..4da6156 100644
--- a/src/gfilenotify.c
+++ b/src/gfilenotify.c
@@ -1,5 +1,5 @@
 /* Filesystem notifications support with glib API.
-   Copyright (C) 2013-2020 Free Software Foundation, Inc.
+   Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 3560c74..66008ea 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -1,5 +1,5 @@
 /* Declarations for `malloc' and friends.
-   Copyright (C) 1990-1993, 1995-1996, 1999, 2002-2007, 2013-2020 Free
+   Copyright (C) 1990-1993, 1995-1996, 1999, 2002-2007, 2013-2021 Free
    Software Foundation, Inc.
                  Written May 1989 by Mike Haertel.
 
diff --git a/src/gnutls.c b/src/gnutls.c
index 0010553..aa245ee 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1,5 +1,5 @@
 /* GnuTLS glue for GNU Emacs.
-   Copyright (C) 2010-2020 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -2766,7 +2766,7 @@ GnuTLS MACs             : the list will contain `macs'.
 GnuTLS digests          : the list will contain `digests'.
 GnuTLS symmetric ciphers: the list will contain `ciphers'.
 GnuTLS AEAD ciphers     : the list will contain `AEAD-ciphers'.
-%DUMBFW                 : the list will contain `ClientHello\ Padding'.
+%DUMBFW                 : the list will contain `ClientHello\\ Padding'.
 Any GnuTLS extension with ID up to 100
                         : the list will contain its name.  */)
   (void)
diff --git a/src/gnutls.h b/src/gnutls.h
index 5f4ad60..5fa08f8 100644
--- a/src/gnutls.h
+++ b/src/gnutls.h
@@ -1,5 +1,5 @@
 /* GnuTLS glue for GNU Emacs.
-   Copyright (C) 2010-2020 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/gtkutil.c b/src/gtkutil.c
index fafd94c..11e59b9 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1,6 +1,6 @@
 /* Functions for creating and updating GTK widgets.
 
-Copyright (C) 2003-2020 Free Software Foundation, Inc.
+Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -2944,14 +2944,11 @@ xg_get_menu_item_label (GtkMenuItem *witem)
 static bool
 xg_item_label_same_p (GtkMenuItem *witem, const char *label)
 {
-  bool is_same = 0;
   char *utf8_label = get_utf8_string (label);
   const char *old_label = witem ? xg_get_menu_item_label (witem) : 0;
 
-  if (! old_label && ! utf8_label)
-    is_same = 1;
-  else if (old_label && utf8_label)
-    is_same = strcmp (utf8_label, old_label) == 0;
+  bool is_same = (!old_label == !utf8_label
+                 && (!old_label || strcmp (utf8_label, old_label) == 0));
 
   if (utf8_label) g_free (utf8_label);
 
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 5419167..31a12cd 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -1,6 +1,6 @@
 /* Definitions and headers for GTK widgets.
 
-Copyright (C) 2003-2020 Free Software Foundation, Inc.
+Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/hbfont.c b/src/hbfont.c
index 82b115e..e9f4085 100644
--- a/src/hbfont.c
+++ b/src/hbfont.c
@@ -1,5 +1,5 @@
 /* hbfont.c -- Platform-independent support for HarfBuzz font driver.
-   Copyright (C) 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/image.c b/src/image.c
index 5eb4132..a124cf9 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1,6 +1,6 @@
 /* Functions for image support on window system.
 
-Copyright (C) 1989, 1992-2020 Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -1592,17 +1592,6 @@ make_image_cache (void)
   return c;
 }
 
-/* Compare two lists (one of which must be proper), comparing each
-   element with `eq'.  */
-static bool
-equal_lists (Lisp_Object a, Lisp_Object b)
-{
-  while (CONSP (a) && CONSP (b) && EQ (XCAR (a), XCAR (b)))
-    a = XCDR (a), b = XCDR (b);
-
-  return EQ (a, b);
-}
-
 /* Find an image matching SPEC in the cache, and return it.  If no
    image is found, return NULL.  */
 static struct image *
@@ -1630,7 +1619,7 @@ search_image_cache (struct frame *f, Lisp_Object spec, 
EMACS_UINT hash,
 
   for (img = c->buckets[i]; img; img = img->next)
     if (img->hash == hash
-       && equal_lists (img->spec, spec)
+       && !NILP (Fequal (img->spec, spec))
        && (ignore_colors || (img->face_foreground == foreground
                               && img->face_background == background)))
       break;
@@ -1644,12 +1633,13 @@ static void
 uncache_image (struct frame *f, Lisp_Object spec)
 {
   struct image *img;
+  EMACS_UINT hash = sxhash (spec);
 
   /* Because the background colors are based on the current face, we
      can have multiple copies of an image with the same spec. We want
      to remove them all to ensure the user doesn't see an old version
      of the image when the face changes.  */
-  while ((img = search_image_cache (f, spec, sxhash (spec), 0, 0, true)))
+  while ((img = search_image_cache (f, spec, hash, 0, 0, true)))
     {
       free_image (f, img);
       /* As display glyphs may still be referring to the image ID, we
@@ -1802,6 +1792,79 @@ which is then usually a filename.  */)
   return Qnil;
 }
 
+static size_t
+image_size_in_bytes (struct image *img)
+{
+  size_t size = 0;
+
+#if defined USE_CAIRO
+  Emacs_Pixmap pm = img->pixmap;
+  if (pm)
+    size += pm->height * pm->bytes_per_line;
+  Emacs_Pixmap msk = img->mask;
+  if (msk)
+    size += msk->height * msk->bytes_per_line;
+
+#elif defined HAVE_X_WINDOWS
+  /* Use a nominal depth of 24 bpp for pixmap and 1 bpp for mask,
+     to avoid having to query the server. */
+  if (img->pixmap != NO_PIXMAP)
+    size += img->width * img->height * 3;
+  if (img->mask != NO_PIXMAP)
+    size += img->width * img->height / 8;
+
+  if (img->ximg && img->ximg->data)
+    size += img->ximg->bytes_per_line * img->ximg->height;
+  if (img->mask_img && img->mask_img->data)
+    size += img->mask_img->bytes_per_line * img->mask_img->height;
+
+#elif defined HAVE_NS
+  if (img->pixmap)
+    size += ns_image_size_in_bytes (img->pixmap);
+  if (img->mask)
+    size += ns_image_size_in_bytes (img->mask);
+
+#elif defined HAVE_NTGUI
+  if (img->pixmap)
+    size += w32_image_size (img->pixmap);
+  if (img->mask)
+    size += w32_image_size (img->mask);
+
+#endif
+
+  return size;
+}
+
+static size_t
+image_frame_cache_size (struct frame *f)
+{
+  struct image_cache *c = FRAME_IMAGE_CACHE (f);
+  if (!c)
+    return 0;
+
+  size_t total = 0;
+  for (ptrdiff_t i = 0; i < c->used; ++i)
+    {
+      struct image *img = c->images[i];
+      total += img ? image_size_in_bytes (img) : 0;
+    }
+  return total;
+}
+
+DEFUN ("image-cache-size", Fimage_cache_size, Simage_cache_size, 0, 0, 0,
+       doc: /* Return the size of the image cache.  */)
+  (void)
+{
+  Lisp_Object tail, frame;
+  size_t total = 0;
+
+  FOR_EACH_FRAME (tail, frame)
+    if (FRAME_WINDOW_P (XFRAME (frame)))
+      total += image_frame_cache_size (XFRAME (frame));
+
+  return make_int (total);
+}
+
 
 DEFUN ("image-flush", Fimage_flush, Simage_flush,
        1, 2, 0,
@@ -2131,6 +2194,10 @@ image_set_transform (struct frame *f, struct image *img)
 # if !defined USE_CAIRO && defined HAVE_XRENDER
   if (!img->picture)
     return;
+
+  /* Store the original dimensions as we'll overwrite them later.  */
+  img->original_width = img->width;
+  img->original_height = img->height;
 # endif
 
   /* Determine size.  */
@@ -2347,7 +2414,7 @@ lookup_image (struct frame *f, Lisp_Object spec, int 
face_id)
 
   /* Look up SPEC in the hash table of the image cache.  */
   hash = sxhash (spec);
-  img = search_image_cache (f, spec, hash, foreground, background, true);
+  img = search_image_cache (f, spec, hash, foreground, background, false);
   if (img && img->load_failed_p)
     {
       free_image (f, img);
@@ -2990,6 +3057,11 @@ image_get_x_image (struct frame *f, struct image *img, 
bool mask_p)
 
   if (ximg_in_img)
     return ximg_in_img;
+#ifdef HAVE_XRENDER
+  else if (img->picture)
+    return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
+                     0, 0, img->original_width, img->original_height, ~0, 
ZPixmap);
+#endif
   else
     return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
                      0, 0, img->width, img->height, ~0, ZPixmap);
@@ -9453,6 +9525,7 @@ enum svg_keyword_index
   SVG_TYPE,
   SVG_DATA,
   SVG_FILE,
+  SVG_BASE_URI,
   SVG_ASCENT,
   SVG_MARGIN,
   SVG_RELIEF,
@@ -9472,6 +9545,7 @@ static const struct image_keyword svg_format[SVG_LAST] =
   {":type",            IMAGE_SYMBOL_VALUE,                     1},
   {":data",            IMAGE_STRING_VALUE,                     0},
   {":file",            IMAGE_STRING_VALUE,                     0},
+  {":base-uri",                IMAGE_STRING_VALUE,                     0},
   {":ascent",          IMAGE_ASCENT_VALUE,                     0},
   {":margin",          IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR, 0},
   {":relief",          IMAGE_INTEGER_VALUE,                    0},
@@ -9544,6 +9618,9 @@ DEF_DLL_FN (gboolean, rsvg_handle_write,
 DEF_DLL_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **));
 #  endif
 
+DEF_DLL_FN (void, rsvg_handle_set_dpi_x_y,
+           (RsvgHandle * handle, double dpi_x, double dpi_y));
+
 #  if LIBRSVG_CHECK_VERSION (2, 46, 0)
 DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions,
             (RsvgHandle *, gboolean *, RsvgLength *, gboolean *,
@@ -9600,6 +9677,7 @@ init_svg_functions (void)
   LOAD_DLL_FN (library, rsvg_handle_write);
   LOAD_DLL_FN (library, rsvg_handle_close);
 #endif
+  LOAD_DLL_FN (library, rsvg_handle_set_dpi_x_y);
 #if LIBRSVG_CHECK_VERSION (2, 46, 0)
   LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions);
   LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer);
@@ -9655,6 +9733,7 @@ init_svg_functions (void)
 #   undef rsvg_handle_set_base_uri
 #   undef rsvg_handle_write
 #  endif
+#  undef rsvg_handle_set_dpi_x_y
 
 #  define gdk_pixbuf_get_bits_per_sample fn_gdk_pixbuf_get_bits_per_sample
 #  define gdk_pixbuf_get_colorspace fn_gdk_pixbuf_get_colorspace
@@ -9688,6 +9767,7 @@ init_svg_functions (void)
 #   define rsvg_handle_set_base_uri fn_rsvg_handle_set_base_uri
 #   define rsvg_handle_write fn_rsvg_handle_write
 #  endif
+#  define rsvg_handle_set_dpi_x_y fn_rsvg_handle_set_dpi_x_y
 
 # endif /* !WINDOWSNT  */
 
@@ -9698,10 +9778,11 @@ static bool
 svg_load (struct frame *f, struct image *img)
 {
   bool success_p = 0;
-  Lisp_Object file_name;
+  Lisp_Object file_name, base_uri;
 
   /* If IMG->spec specifies a file name, create a non-file spec from it.  */
   file_name = image_spec_value (img->spec, QCfile, NULL);
+  base_uri = image_spec_value (img->spec, QCbase_uri, NULL);
   if (STRINGP (file_name))
     {
       int fd;
@@ -9721,15 +9802,17 @@ svg_load (struct frame *f, struct image *img)
          return 0;
        }
       /* If the file was slurped into memory properly, parse it.  */
+      if (!STRINGP (base_uri))
+        base_uri = file;
       success_p = svg_load_image (f, img, contents, size,
-                                 SSDATA (ENCODE_FILE (file)));
+                                  SSDATA (ENCODE_FILE (base_uri)));
       xfree (contents);
     }
   /* Else it's not a file, it's a Lisp object.  Load the image from a
      Lisp object rather than a file.  */
   else
     {
-      Lisp_Object data, original_filename;
+      Lisp_Object data;
 
       data = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (data))
@@ -9737,10 +9820,11 @@ svg_load (struct frame *f, struct image *img)
          image_error ("Invalid image data `%s'", data);
          return 0;
        }
-      original_filename = BVAR (current_buffer, filename);
+      if (!STRINGP (base_uri))
+        base_uri = BVAR (current_buffer, filename);
       success_p = svg_load_image (f, img, SSDATA (data), SBYTES (data),
-                                  (NILP (original_filename) ? NULL
-                                  : SSDATA (original_filename)));
+                                  (STRINGP (base_uri) ?
+                                   SSDATA (ENCODE_FILE (base_uri)) : NULL));
     }
 
   return success_p;
@@ -9748,11 +9832,8 @@ svg_load (struct frame *f, struct image *img)
 
 #if LIBRSVG_CHECK_VERSION (2, 46, 0)
 static double
-svg_css_length_to_pixels (RsvgLength length)
+svg_css_length_to_pixels (RsvgLength length, double dpi)
 {
-  /* FIXME: 96 appears to be a pretty standard DPI but we should
-     probably use the real DPI if we can get it.  */
-  double dpi = 96;
   double value = length.length;
 
   switch (length.unit)
@@ -9826,18 +9907,26 @@ svg_load_image (struct frame *f, struct image *img, 
char *contents,
   rsvg_handle = rsvg_handle_new_from_stream_sync (input_stream, base_file,
                                                  RSVG_HANDLE_FLAGS_NONE,
                                                  NULL, &err);
+
   if (base_file)
     g_object_unref (base_file);
   g_object_unref (input_stream);
 
   /* Check rsvg_handle too, to avoid librsvg 2.40.13 bug (Bug#36773#26).  */
   if (!rsvg_handle || err) goto rsvg_error;
+
+  rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
+                           FRAME_DISPLAY_INFO (f)->resy);
 #else
   /* Make a handle to a new rsvg object.  */
   rsvg_handle = rsvg_handle_new ();
   eassume (rsvg_handle);
 
+  rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
+                           FRAME_DISPLAY_INFO (f)->resy);
+
   /* Set base_uri for properly handling referenced images (via 'href').
+     Can be explicitly specified using `:base_uri' image property.
      See rsvg bug 596114 - "image refs are relative to curdir, not .svg file"
      <https://gitlab.gnome.org/GNOME/librsvg/issues/33>. */
   if (filename)
@@ -9860,6 +9949,7 @@ svg_load_image (struct frame *f, struct image *img, char 
*contents,
   /* Try the instrinsic dimensions first.  */
   gboolean has_width, has_height, has_viewbox;
   RsvgLength iwidth, iheight;
+  double dpi = FRAME_DISPLAY_INFO (f)->resx;
 
   rsvg_handle_get_intrinsic_dimensions (rsvg_handle,
                                         &has_width, &iwidth,
@@ -9869,19 +9959,19 @@ svg_load_image (struct frame *f, struct image *img, 
char *contents,
   if (has_width && has_height)
     {
       /* Success!  We can use these values directly.  */
-      viewbox_width = svg_css_length_to_pixels (iwidth);
-      viewbox_height = svg_css_length_to_pixels (iheight);
+      viewbox_width = svg_css_length_to_pixels (iwidth, dpi);
+      viewbox_height = svg_css_length_to_pixels (iheight, dpi);
     }
   else if (has_width && has_viewbox)
     {
-      viewbox_width = svg_css_length_to_pixels (iwidth);
-      viewbox_height = svg_css_length_to_pixels (iwidth)
+      viewbox_width = svg_css_length_to_pixels (iwidth, dpi);
+      viewbox_height = svg_css_length_to_pixels (iwidth, dpi)
         * viewbox.width / viewbox.height;
     }
   else if (has_height && has_viewbox)
     {
-      viewbox_height = svg_css_length_to_pixels (iheight);
-      viewbox_width = svg_css_length_to_pixels (iheight)
+      viewbox_height = svg_css_length_to_pixels (iheight, dpi);
+      viewbox_width = svg_css_length_to_pixels (iheight, dpi)
         * viewbox.height / viewbox.width;
     }
   else if (has_viewbox)
@@ -9990,18 +10080,26 @@ svg_load_image (struct frame *f, struct image *img, 
char *contents,
   rsvg_handle = rsvg_handle_new_from_stream_sync (input_stream, base_file,
                                                  RSVG_HANDLE_FLAGS_NONE,
                                                  NULL, &err);
+
   if (base_file)
     g_object_unref (base_file);
   g_object_unref (input_stream);
 
   /* Check rsvg_handle too, to avoid librsvg 2.40.13 bug (Bug#36773#26).  */
   if (!rsvg_handle || err) goto rsvg_error;
+
+  rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
+                           FRAME_DISPLAY_INFO (f)->resy);
 #else
   /* Make a handle to a new rsvg object.  */
   rsvg_handle = rsvg_handle_new ();
   eassume (rsvg_handle);
 
+  rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
+                           FRAME_DISPLAY_INFO (f)->resy);
+
   /* Set base_uri for properly handling referenced images (via 'href').
+     Can be explicitly specified using `:base_uri' image property.
      See rsvg bug 596114 - "image refs are relative to curdir, not .svg file"
      <https://gitlab.gnome.org/GNOME/librsvg/issues/33>. */
   if (filename)
@@ -10684,6 +10782,7 @@ non-numeric, there is no explicit limit on the size of 
images.  */);
 
 #if defined (HAVE_RSVG)
   DEFSYM (Qsvg, "svg");
+  DEFSYM (QCbase_uri, ":base-uri");
   add_image_type (Qsvg);
 #ifdef HAVE_NTGUI
   /* Other libraries used directly by svg code.  */
@@ -10713,6 +10812,7 @@ non-numeric, there is no explicit limit on the size of 
images.  */);
   defsubr (&Simage_size);
   defsubr (&Simage_mask_p);
   defsubr (&Simage_metadata);
+  defsubr (&Simage_cache_size);
 
 #ifdef GLYPH_DEBUG
   defsubr (&Simagep);
diff --git a/src/indent.c b/src/indent.c
index 4ecf02b..0a6b460 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1,5 +1,5 @@
 /* Indentation functions.
-   Copyright (C) 1985-1988, 1993-1995, 1998, 2000-2020 Free Software
+   Copyright (C) 1985-1988, 1993-1995, 1998, 2000-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/indent.h b/src/indent.h
index 6058429..776fe7b 100644
--- a/src/indent.h
+++ b/src/indent.h
@@ -1,5 +1,5 @@
 /* Definitions for interface to indent.c
-   Copyright (C) 1985-1986, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985-1986, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/inotify.c b/src/inotify.c
index 549a82b..df6145d 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -1,6 +1,6 @@
 /* Inotify support for Emacs
 
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
+Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/insdel.c b/src/insdel.c
index 6e24597..e38b091 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1,5 +1,5 @@
 /* Buffer insertion/deletion and gap motion for GNU Emacs. -*- coding: utf-8 
-*-
-   Copyright (C) 1985-1986, 1993-1995, 1997-2020 Free Software
+   Copyright (C) 1985-1986, 1993-1995, 1997-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/intervals.c b/src/intervals.c
index 0257591..f88a41f 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1,5 +1,5 @@
 /* Code for doing intervals.
-   Copyright (C) 1993-1995, 1997-1998, 2001-2020 Free Software
+   Copyright (C) 1993-1995, 1997-1998, 2001-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/intervals.h b/src/intervals.h
index 9a7ba91..c1b1934 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -1,5 +1,5 @@
 /* Definitions and global variables for intervals.
-   Copyright (C) 1993-1994, 2000-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 2000-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/json.c b/src/json.c
index 744c40a..2901a20 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1,6 +1,6 @@
 /* JSON parsing and serialization.
 
-Copyright (C) 2017-2020 Free Software Foundation, Inc.
+Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/keyboard.c b/src/keyboard.c
index 49261fc..d2f0cb4 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1,6 +1,6 @@
 /* Keyboard and mouse input; editor command loop.
 
-Copyright (C) 1985-1989, 1993-1997, 1999-2020 Free Software Foundation,
+Copyright (C) 1985-1989, 1993-1997, 1999-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -384,11 +384,13 @@ next_kbd_event (union buffered_input_event *ptr)
   return ptr == kbd_buffer + KBD_BUFFER_SIZE - 1 ? kbd_buffer : ptr + 1;
 }
 
+#ifdef HAVE_X11
 static union buffered_input_event *
 prev_kbd_event (union buffered_input_event *ptr)
 {
   return ptr == kbd_buffer ? kbd_buffer + KBD_BUFFER_SIZE - 1 : ptr - 1;
 }
+#endif
 
 /* Like EVENT_START, but assume EVENT is an event.
    This pacifies gcc -Wnull-dereference, which might otherwise
@@ -741,9 +743,6 @@ void
 force_auto_save_soon (void)
 {
   last_auto_save = - auto_save_interval - 1;
-  /* FIXME: What's the relationship between forcing auto-save and adding
-     a buffer-switch event?  */
-  record_asynch_buffer_change ();
 }
 #endif
 
@@ -3431,8 +3430,7 @@ readable_events (int flags)
                       && event->ie.part == scroll_bar_handle
                       && event->ie.modifiers == 0)
 #endif
-                 && !((flags & READABLE_EVENTS_FILTER_EVENTS)
-                      && event->kind == BUFFER_SWITCH_EVENT))
+                )
                return 1;
              event = next_kbd_event (event);
            }
@@ -3583,12 +3581,6 @@ kbd_buffer_store_buffered_event (union 
buffered_input_event *event,
          return;
        }
     }
-  /* Don't insert two BUFFER_SWITCH_EVENT's in a row.
-     Just ignore the second one.  */
-  else if (event->kind == BUFFER_SWITCH_EVENT
-          && kbd_fetch_ptr != kbd_store_ptr
-          && prev_kbd_event (kbd_store_ptr)->kind == BUFFER_SWITCH_EVENT)
-    return;
 
   /* Don't let the very last slot in the buffer become full,
      since that would make the two pointers equal,
@@ -3622,7 +3614,6 @@ kbd_buffer_store_buffered_event (union 
buffered_input_event *event,
     case ICONIFY_EVENT: ignore_event = Qiconify_frame; break;
     case DEICONIFY_EVENT: ignore_event = Qmake_frame_visible; break;
     case SELECTION_REQUEST_EVENT: ignore_event = Qselection_request; break;
-    case BUFFER_SWITCH_EVENT: ignore_event = Qbuffer_switch; break;
     default: ignore_event = Qnil; break;
     }
 
@@ -3656,7 +3647,8 @@ kbd_buffer_unget_event (struct selection_input_event 
*event)
 #define INPUT_EVENT_POS_MAX \
   ((ptrdiff_t) min (PTRDIFF_MAX, min (TYPE_MAXIMUM (Time) / 2, \
                                      MOST_POSITIVE_FIXNUM)))
-#define INPUT_EVENT_POS_MIN (-1 - INPUT_EVENT_POS_MAX)
+#define INPUT_EVENT_POS_MIN (PTRDIFF_MIN < -INPUT_EVENT_POS_MAX \
+                            ? -1 - INPUT_EVENT_POS_MAX : PTRDIFF_MIN)
 
 /* Return a Time that encodes position POS.  POS must be in range.  */
 
@@ -3961,7 +3953,6 @@ kbd_buffer_get_event (KBOARD **kbp,
 #ifdef HAVE_XWIDGETS
       case XWIDGET_EVENT:
 #endif
-      case BUFFER_SWITCH_EVENT:
       case SAVE_SESSION_EVENT:
       case NO_EVENT:
       case HELP_EVENT:
@@ -5341,14 +5332,6 @@ make_lispy_event (struct input_event *event)
       return list2 (Qmove_frame, list1 (event->frame_or_window));
 #endif
 
-    case BUFFER_SWITCH_EVENT:
-      {
-       /* The value doesn't matter here; only the type is tested.  */
-       Lisp_Object obj;
-        XSETBUFFER (obj, current_buffer);
-        return obj;
-      }
-
     /* Just discard these, by returning nil.
        With MULTI_KBOARD, these events are used as placeholders
        when we need to randomly delete events from the queue.
@@ -6805,41 +6788,6 @@ get_input_pending (int flags)
   return input_pending;
 }
 
-/* Put a BUFFER_SWITCH_EVENT in the buffer
-   so that read_key_sequence will notice the new current buffer.  */
-
-void
-record_asynch_buffer_change (void)
-{
-  /* We don't need a buffer-switch event unless Emacs is waiting for input.
-     The purpose of the event is to make read_key_sequence look up the
-     keymaps again.  If we aren't in read_key_sequence, we don't need one,
-     and the event could cause trouble by messing up (input-pending-p).
-     Note: Fwaiting_for_user_input_p always returns nil when async
-     subprocesses aren't supported.  */
-  if (!NILP (Fwaiting_for_user_input_p ()))
-    {
-      struct input_event event;
-
-      EVENT_INIT (event);
-      event.kind = BUFFER_SWITCH_EVENT;
-      event.frame_or_window = Qnil;
-      event.arg = Qnil;
-
-      /* Make sure no interrupt happens while storing the event.  */
-#ifdef USABLE_SIGIO
-      if (interrupt_input)
-       kbd_buffer_store_event (&event);
-      else
-#endif
-       {
-         stop_polling ();
-         kbd_buffer_store_event (&event);
-         start_polling ();
-       }
-    }
-}
-
 /* Read any terminal input already buffered up by the system
    into the kbd_buffer, but do not wait.
 
@@ -11573,8 +11521,6 @@ syms_of_keyboard (void)
   /* Menu and tool bar item parts.  */
   DEFSYM (Qmenu_enable, "menu-enable");
 
-  DEFSYM (Qbuffer_switch, "buffer-switch");
-
 #ifdef HAVE_NTGUI
   DEFSYM (Qlanguage_change, "language-change");
   DEFSYM (Qend_session, "end-session");
@@ -11885,6 +11831,13 @@ will be in `last-command' during the following 
command.  */);
               doc: /* This is like `this-command', except that commands should 
never modify it.  */);
   Vreal_this_command = Qnil;
 
+  DEFSYM (Qcurrent_minibuffer_command, "current-minibuffer-command");
+  DEFVAR_LISP ("current-minibuffer-command", Vcurrent_minibuffer_command,
+              doc: /* This is like `this-command', but bound recursively.
+Code running from (for instance) a minibuffer hook can check this variable
+to see what command invoked the current minibuffer.  */);
+  Vcurrent_minibuffer_command = Qnil;
+
   DEFVAR_LISP ("this-command-keys-shift-translated",
               Vthis_command_keys_shift_translated,
               doc: /* Non-nil if the key sequence activating this command was 
shift-translated.
diff --git a/src/keyboard.h b/src/keyboard.h
index 41da3a6..91c6f46 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -1,5 +1,5 @@
 /* Declarations useful when processing input.
-   Copyright (C) 1985-1987, 1993, 2001-2020 Free Software Foundation,
+   Copyright (C) 1985-1987, 1993, 2001-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
@@ -446,7 +446,6 @@ extern void push_kboard (struct kboard *);
 extern void push_frame_kboard (struct frame *);
 extern void pop_kboard (void);
 extern void temporarily_switch_to_single_kboard (struct frame *);
-extern void record_asynch_buffer_change (void);
 extern void input_poll_signal (int);
 extern void start_polling (void);
 extern void stop_polling (void);
diff --git a/src/keymap.c b/src/keymap.c
index e22eb41..1eeea81 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1,5 +1,5 @@
 /* Manipulation of keymaps
-   Copyright (C) 1985-1988, 1993-1995, 1998-2020 Free Software
+   Copyright (C) 1985-1988, 1993-1995, 1998-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -218,15 +218,13 @@ when reading a key-sequence to be looked-up in this 
keymap.  */)
 Lisp_Object
 get_keymap (Lisp_Object object, bool error_if_not_keymap, bool autoload)
 {
-  Lisp_Object tem;
-
  autoload_retry:
   if (NILP (object))
     goto end;
   if (CONSP (object) && EQ (XCAR (object), Qkeymap))
     return object;
 
-  tem = indirect_function (object);
+  Lisp_Object tem = indirect_function (object);
   if (CONSP (tem))
     {
       if (EQ (XCAR (tem), Qkeymap))
@@ -265,12 +263,10 @@ get_keymap (Lisp_Object object, bool error_if_not_keymap, 
bool autoload)
 static Lisp_Object
 keymap_parent (Lisp_Object keymap, bool autoload)
 {
-  Lisp_Object list;
-
   keymap = get_keymap (keymap, 1, autoload);
 
   /* Skip past the initial element `keymap'.  */
-  list = XCDR (keymap);
+  Lisp_Object list = XCDR (keymap);
   for (; CONSP (list); list = XCDR (list))
     {
       /* See if there is another `keymap'.  */
@@ -306,8 +302,6 @@ DEFUN ("set-keymap-parent", Fset_keymap_parent, 
Sset_keymap_parent, 2, 2, 0,
 Return PARENT.  PARENT should be nil or another keymap.  */)
   (Lisp_Object keymap, Lisp_Object parent)
 {
-  Lisp_Object list, prev;
-
   /* Flush any reverse-map cache.  */
   where_is_cache = Qnil; where_is_cache_keymaps = Qt;
 
@@ -323,10 +317,10 @@ Return PARENT.  PARENT should be nil or another keymap.  
*/)
     }
 
   /* Skip past the initial element `keymap'.  */
-  prev = keymap;
+  Lisp_Object prev = keymap;
   while (1)
     {
-      list = XCDR (prev);
+      Lisp_Object list = XCDR (prev);
       /* If there is a parent keymap here, replace it.
         If we came to the end, add the parent in PREV.  */
       if (!CONSP (list) || KEYMAPP (list))
@@ -805,14 +799,10 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object 
idx, Lisp_Object def)
        towards the front of the alist and character lookups in dense
        keymaps will remain fast.  Otherwise, this just points at the
        front of the keymap.  */
-    Lisp_Object insertion_point;
-
-    insertion_point = keymap;
+    Lisp_Object insertion_point = keymap;
     for (tail = XCDR (keymap); CONSP (tail); tail = XCDR (tail))
       {
-       Lisp_Object elt;
-
-       elt = XCAR (tail);
+       Lisp_Object elt = XCAR (tail);
        if (VECTORP (elt))
          {
            if (FIXNATP (idx) && XFIXNAT (idx) < ASIZE (elt))
@@ -1018,9 +1008,8 @@ copy_keymap_1 (Lisp_Object keymap, int depth)
        }
       else if (VECTORP (elt))
        {
-         int i;
          elt = Fcopy_sequence (elt);
-         for (i = 0; i < ASIZE (elt); i++)
+         for (int i = 0; i < ASIZE (elt); i++)
            ASET (elt, i, copy_keymap_item (AREF (elt, i), depth + 1));
        }
       else if (CONSP (elt))
@@ -1097,24 +1086,19 @@ binding is altered.  If there is no binding for KEY, 
the new pair
 binding KEY to DEF is added at the front of KEYMAP.  */)
   (Lisp_Object keymap, Lisp_Object key, Lisp_Object def)
 {
-  ptrdiff_t idx;
-  Lisp_Object c;
-  Lisp_Object cmd;
-  bool metized = 0;
-  int meta_bit;
-  ptrdiff_t length;
+  bool metized = false;
 
   keymap = get_keymap (keymap, 1, 1);
 
-  length = CHECK_VECTOR_OR_STRING (key);
+  ptrdiff_t length = CHECK_VECTOR_OR_STRING (key);
   if (length == 0)
     return Qnil;
 
   if (SYMBOLP (def) && !EQ (Vdefine_key_rebound_commands, Qt))
     Vdefine_key_rebound_commands = Fcons (def, Vdefine_key_rebound_commands);
 
-  meta_bit = (VECTORP (key) || (STRINGP (key) && STRING_MULTIBYTE (key))
-             ? meta_modifier : 0x80);
+  int meta_bit = (VECTORP (key) || (STRINGP (key) && STRING_MULTIBYTE (key))
+                 ? meta_modifier : 0x80);
 
   if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, 0)))
     { /* DEF is apparently an XEmacs-style keyboard macro.  */
@@ -1130,10 +1114,10 @@ binding KEY to DEF is added at the front of KEYMAP.  */)
       def = tmp;
     }
 
-  idx = 0;
+  ptrdiff_t idx = 0;
   while (1)
     {
-      c = Faref (key, make_fixnum (idx));
+      Lisp_Object c = Faref (key, make_fixnum (idx));
 
       if (CONSP (c))
        {
@@ -1153,14 +1137,14 @@ binding KEY to DEF is added at the front of KEYMAP.  */)
          && !metized)
        {
          c = meta_prefix_char;
-         metized = 1;
+         metized = true;
        }
       else
        {
          if (FIXNUMP (c))
            XSETINT (c, XFIXNUM (c) & ~meta_bit);
 
-         metized = 0;
+         metized = false;
          idx++;
        }
 
@@ -1173,7 +1157,7 @@ binding KEY to DEF is added at the front of KEYMAP.  */)
       if (idx == length)
        return store_in_keymap (keymap, c, def);
 
-      cmd = access_keymap (keymap, c, 0, 1, 1);
+      Lisp_Object cmd = access_keymap (keymap, c, 0, 1, 1);
 
       /* If this key is undefined, make it a prefix.  */
       if (NILP (cmd))
@@ -1250,23 +1234,19 @@ third optional argument ACCEPT-DEFAULT is non-nil, 
`lookup-key' will
 recognize the default bindings, just as `read-key-sequence' does.  */)
   (Lisp_Object keymap, Lisp_Object key, Lisp_Object accept_default)
 {
-  ptrdiff_t idx;
-  Lisp_Object cmd;
-  Lisp_Object c;
-  ptrdiff_t length;
   bool t_ok = !NILP (accept_default);
 
   if (!CONSP (keymap) && !NILP (keymap))
     keymap = get_keymap (keymap, true, true);
 
-  length = CHECK_VECTOR_OR_STRING (key);
+  ptrdiff_t length = CHECK_VECTOR_OR_STRING (key);
   if (length == 0)
     return keymap;
 
-  idx = 0;
+  ptrdiff_t idx = 0;
   while (1)
     {
-      c = Faref (key, make_fixnum (idx++));
+      Lisp_Object c = Faref (key, make_fixnum (idx++));
 
       if (CONSP (c) && lucid_event_type_list_p (c))
        c = Fevent_convert_list (c);
@@ -1280,7 +1260,7 @@ recognize the default bindings, just as 
`read-key-sequence' does.  */)
       if (!FIXNUMP (c) && !SYMBOLP (c) && !CONSP (c) && !STRINGP (c))
        message_with_string ("Key sequence contains invalid event %s", c, 1);
 
-      cmd = access_keymap (keymap, c, t_ok, 0, 1);
+      Lisp_Object cmd = access_keymap (keymap, c, t_ok, 0, 1);
       if (idx == length)
        return cmd;
 
@@ -1299,9 +1279,7 @@ recognize the default bindings, just as 
`read-key-sequence' does.  */)
 static Lisp_Object
 define_as_prefix (Lisp_Object keymap, Lisp_Object c)
 {
-  Lisp_Object cmd;
-
-  cmd = Fmake_sparse_keymap (Qnil);
+  Lisp_Object cmd = Fmake_sparse_keymap (Qnil);
   store_in_keymap (keymap, c, cmd);
 
   return cmd;
@@ -1322,15 +1300,12 @@ append_key (Lisp_Object key_sequence, Lisp_Object key)
 static void
 silly_event_symbol_error (Lisp_Object c)
 {
-  Lisp_Object parsed, base, name, assoc;
-  int modifiers;
-
-  parsed = parse_modifiers (c);
-  modifiers = XFIXNAT (XCAR (XCDR (parsed)));
-  base = XCAR (parsed);
-  name = Fsymbol_name (base);
+  Lisp_Object parsed = parse_modifiers (c);
+  int modifiers = XFIXNAT (XCAR (XCDR (parsed)));
+  Lisp_Object base = XCAR (parsed);
+  Lisp_Object name = Fsymbol_name (base);
   /* This alist includes elements such as ("RET" . "\\r").  */
-  assoc = Fassoc (name, exclude_keys, Qnil);
+  Lisp_Object assoc = Fassoc (name, exclude_keys, Qnil);
 
   if (! NILP (assoc))
     {
@@ -1391,16 +1366,14 @@ ptrdiff_t
 current_minor_maps (Lisp_Object **modeptr, Lisp_Object **mapptr)
 {
   ptrdiff_t i = 0;
-  int list_number = 0;
   Lisp_Object alist, assoc, var, val;
-  Lisp_Object emulation_alists;
+  Lisp_Object emulation_alists = Vemulation_mode_map_alists;
   Lisp_Object lists[2];
 
-  emulation_alists = Vemulation_mode_map_alists;
   lists[0] = Vminor_mode_overriding_map_alist;
   lists[1] = Vminor_mode_map_alist;
 
-  for (list_number = 0; list_number < 2; list_number++)
+  for (int list_number = 0; list_number < 2; list_number++)
     {
       if (CONSP (emulation_alists))
        {
@@ -1526,9 +1499,7 @@ like in the respective argument of `key-binding'.  */)
 
   if (CONSP (position))
     {
-      Lisp_Object window;
-
-      window = POSN_WINDOW (position);
+      Lisp_Object window = POSN_WINDOW (position);
 
       if (WINDOWP (window)
          && BUFFERP (XWINDOW (window)->contents)
@@ -1557,7 +1528,7 @@ like in the respective argument of `key-binding'.  */)
   if (NILP (XCDR (keymaps)))
     {
       Lisp_Object *maps;
-      int nmaps, i;
+      int nmaps;
       ptrdiff_t pt = click_position (position);
       /* This usually returns the buffer's local map,
         but that can be overridden by a `local-map' property.  */
@@ -1575,9 +1546,7 @@ like in the respective argument of `key-binding'.  */)
 
          if (POSN_INBUFFER_P (position))
            {
-             Lisp_Object pos;
-
-             pos = POSN_BUFFER_POSN (position);
+             Lisp_Object pos = POSN_BUFFER_POSN (position);
              if (FIXNUMP (pos)
                  && XFIXNUM (pos) >= BEG && XFIXNUM (pos) <= Z)
                {
@@ -1597,15 +1566,13 @@ like in the respective argument of `key-binding'.  */)
 
          if (CONSP (string) && STRINGP (XCAR (string)))
            {
-             Lisp_Object pos, map;
-
-             pos = XCDR (string);
+             Lisp_Object pos = XCDR (string);
              string = XCAR (string);
              if (FIXNUMP (pos)
                  && XFIXNUM (pos) >= 0
                  && XFIXNUM (pos) < SCHARS (string))
                {
-                 map = Fget_text_property (pos, Qlocal_map, string);
+                 Lisp_Object map = Fget_text_property (pos, Qlocal_map, 
string);
                  if (!NILP (map))
                    local_map = map;
 
@@ -1623,7 +1590,7 @@ like in the respective argument of `key-binding'.  */)
       /* Now put all the minor mode keymaps on the list.  */
       nmaps = current_minor_maps (0, &maps);
 
-      for (i = --nmaps; i >= 0; i--)
+      for (int i = --nmaps; i >= 0; i--)
        if (!NILP (maps[i]))
          keymaps = Fcons (maps[i], keymaps);
 
@@ -1667,18 +1634,15 @@ specified buffer position instead of point are used.
   */)
   (Lisp_Object key, Lisp_Object accept_default, Lisp_Object no_remap, 
Lisp_Object position)
 {
-  Lisp_Object value;
-
   if (NILP (position) && VECTORP (key))
     {
-      Lisp_Object event;
-
       if (ASIZE (key) == 0)
        return Qnil;
 
       /* mouse events may have a symbolic prefix indicating the
         scrollbar or mode line */
-      event = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0);
+      Lisp_Object event
+       = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0);
 
       /* We are not interested in locations without event data */
 
@@ -1690,8 +1654,8 @@ specified buffer position instead of point are used.
        }
     }
 
-  value = Flookup_key (Fcurrent_active_maps (Qt, position),
-                      key, accept_default);
+  Lisp_Object value = Flookup_key (Fcurrent_active_maps (Qt, position),
+                                  key, accept_default);
 
   if (NILP (value) || FIXNUMP (value))
     return Qnil;
@@ -1720,8 +1684,7 @@ If optional argument ACCEPT-DEFAULT is non-nil, recognize 
default
 bindings; see the description of `lookup-key' for more details about this.  */)
   (Lisp_Object keys, Lisp_Object accept_default)
 {
-  register Lisp_Object map;
-  map = BVAR (current_buffer, keymap);
+  register Lisp_Object map = BVAR (current_buffer, keymap);
   if (NILP (map))
     return Qnil;
   return Flookup_key (map, keys, accept_default);
@@ -1760,15 +1723,11 @@ bindings; see the description of `lookup-key' for more 
details about this.  */)
   (Lisp_Object key, Lisp_Object accept_default)
 {
   Lisp_Object *modes, *maps;
-  int nmaps;
-  Lisp_Object binding;
-  int i, j;
-
-  nmaps = current_minor_maps (&modes, &maps);
-
-  binding = Qnil;
+  int nmaps = current_minor_maps (&modes, &maps);
+  Lisp_Object binding = Qnil;
 
-  for (i = j = 0; i < nmaps; i++)
+  int j;
+  for (int i = j = 0; i < nmaps; i++)
     if (!NILP (maps[i])
        && !NILP (binding = Flookup_key (maps[i], key, accept_default))
        && !FIXNUMP (binding))
@@ -1795,8 +1754,7 @@ string for the map.  This is required to use the keymap 
as a menu.
 This function returns COMMAND.  */)
   (Lisp_Object command, Lisp_Object mapvar, Lisp_Object name)
 {
-  Lisp_Object map;
-  map = Fmake_sparse_keymap (name);
+  Lisp_Object map = Fmake_sparse_keymap (name);
   Ffset (command, map);
   if (!NILP (mapvar))
     Fset (mapvar, map);
@@ -1942,8 +1900,7 @@ then the value includes only maps for prefixes that start 
with PREFIX.  */)
     {
       /* If a prefix was specified, start with the keymap (if any) for
         that prefix, so we don't waste time considering other prefixes.  */
-      Lisp_Object tem;
-      tem = Flookup_key (keymap, prefix, Qt);
+      Lisp_Object tem = Flookup_key (keymap, prefix, Qt);
       /* Flookup_key may give us nil, or a number,
         if the prefix is not defined in this particular map.
         It might even give us a list that isn't a keymap.  */
@@ -2011,7 +1968,7 @@ then the value includes only maps for prefixes that start 
with PREFIX.  */)
 DEFUN ("key-description", Fkey_description, Skey_description, 1, 2, 0,
        doc: /* Return a pretty description of key-sequence KEYS.
 Optional arg PREFIX is the sequence of keys leading up to KEYS.
-For example, [?\C-x ?l] is converted into the string \"C-x l\".
+For example, [?\\C-x ?l] is converted into the string \"C-x l\".
 
 For an approximate inverse of this, see `kbd'.  */)
   (Lisp_Object keys, Lisp_Object prefix)
@@ -2406,7 +2363,6 @@ where_is_internal (Lisp_Object definition, Lisp_Object 
keymaps,
                   bool noindirect, bool nomenus)
 {
   Lisp_Object maps = Qnil;
-  Lisp_Object found;
   struct where_is_internal_data data;
 
   /* Only important use of caching is for the menubar
@@ -2432,7 +2388,7 @@ where_is_internal (Lisp_Object definition, Lisp_Object 
keymaps,
        we're filling it up.  */
     where_is_cache = Qnil;
 
-  found = keymaps;
+  Lisp_Object found = keymaps;
   while (CONSP (found))
     {
       maps =
@@ -2541,8 +2497,7 @@ The optional 5th arg NO-REMAP alters how command 
remapping is handled:
   /* Whether or not we're handling remapped sequences.  This is needed
      because remapping is not done recursively by Fcommand_remapping: you
      can't remap a remapped command.  */
-  bool remapped = 0;
-  Lisp_Object tem = Qnil;
+  bool remapped = false;
 
   /* Refresh the C version of the modifier preference.  */
   where_is_preferred_modifier
@@ -2556,7 +2511,7 @@ The optional 5th arg NO-REMAP alters how command 
remapping is handled:
   else
     keymaps = Fcurrent_active_maps (Qnil, Qnil);
 
-  tem = Fcommand_remapping (definition, Qnil, keymaps);
+  Lisp_Object tem = Fcommand_remapping (definition, Qnil, keymaps);
   /* If `definition' is remapped to `tem', then OT1H no key will run
      that command (since they will run `tem' instead), so we should
      return nil; but OTOH all keys bound to `definition' (or to `tem')
@@ -2598,7 +2553,7 @@ The optional 5th arg NO-REMAP alters how command 
remapping is handled:
            considered remapped sequences yet, copy them over and
            process them.  */
         || (!remapped && (sequences = remapped_sequences,
-                          remapped = 1,
+                          remapped = true,
                           CONSP (sequences))))
     {
       Lisp_Object sequence, function;
@@ -2744,9 +2699,7 @@ The optional argument MENUS, if non-nil, says to mention 
menu bindings.
 \(Ordinarily these are omitted from the output.)  */)
   (Lisp_Object buffer, Lisp_Object prefix, Lisp_Object menus)
 {
-  Lisp_Object outbuf, shadow;
   Lisp_Object nomenu = NILP (menus) ? Qt : Qnil;
-  Lisp_Object start1;
 
   const char *alternate_heading
     = "\
@@ -2756,17 +2709,16 @@ You type        Translation\n\
 
   CHECK_BUFFER (buffer);
 
-  shadow = Qnil;
-  outbuf = Fcurrent_buffer ();
+  Lisp_Object shadow = Qnil;
+  Lisp_Object outbuf = Fcurrent_buffer ();
 
   /* Report on alternates for keys.  */
   if (STRINGP (KVAR (current_kboard, Vkeyboard_translate_table)) && !NILP 
(prefix))
     {
-      int c;
       const unsigned char *translate = SDATA (KVAR (current_kboard, 
Vkeyboard_translate_table));
       int translate_len = SCHARS (KVAR (current_kboard, 
Vkeyboard_translate_table));
 
-      for (c = 0; c < translate_len; c++)
+      for (int c = 0; c < translate_len; c++)
        if (translate[c] != c)
          {
            char buf[KEY_DESCRIPTION_SIZE];
@@ -2803,7 +2755,7 @@ You type        Translation\n\
     }
 
   /* Print the (major mode) local map.  */
-  start1 = Qnil;
+  Lisp_Object start1 = Qnil;
   if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
     start1 = KVAR (current_kboard, Voverriding_terminal_local_map);
 
@@ -2832,14 +2784,13 @@ You type        Translation\n\
   else
     {
       /* Print the minor mode and major mode keymaps.  */
-      int i, nmaps;
       Lisp_Object *modes, *maps;
 
       /* Temporarily switch to `buffer', so that we can get that buffer's
         minor modes correctly.  */
       Fset_buffer (buffer);
 
-      nmaps = current_minor_maps (&modes, &maps);
+      int nmaps = current_minor_maps (&modes, &maps);
       Fset_buffer (outbuf);
 
       start1 = get_local_map (BUF_PT (XBUFFER (buffer)),
@@ -2855,7 +2806,7 @@ You type        Translation\n\
        }
 
       /* Print the minor mode maps.  */
-      for (i = 0; i < nmaps; i++)
+      for (int i = 0; i < nmaps; i++)
        {
          /* The title for a minor mode keymap
             is constructed at run time.
@@ -3042,21 +2993,11 @@ describe_vector (Lisp_Object vector, Lisp_Object 
prefix, Lisp_Object args,
                 bool partial, Lisp_Object shadow, Lisp_Object entire_map,
                 bool keymap_p, bool mention_shadow)
 {
-  Lisp_Object definition;
-  Lisp_Object tem2;
   Lisp_Object elt_prefix = Qnil;
-  int i;
-  Lisp_Object suppress;
-  Lisp_Object kludge;
-  bool first = 1;
+  Lisp_Object suppress = Qnil;
+  bool first = true;
   /* Range of elements to be handled.  */
   int from, to, stop;
-  Lisp_Object character;
-  int starting_i;
-
-  suppress = Qnil;
-
-  definition = Qnil;
 
   if (!keymap_p)
     {
@@ -3071,7 +3012,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, 
Lisp_Object args,
   /* This vector gets used to present single keys to Flookup_key.  Since
      that is done once per vector element, we don't want to cons up a
      fresh vector every time.  */
-  kludge = make_nil_vector (1);
+  Lisp_Object kludge = make_nil_vector (1);
 
   if (partial)
     suppress = intern ("suppress-keymap");
@@ -3082,12 +3023,12 @@ describe_vector (Lisp_Object vector, Lisp_Object 
prefix, Lisp_Object args,
   else
     stop = to = ASIZE (vector);
 
-  for (i = from; ; i++)
+  for (int i = from; ; i++)
     {
-      bool this_shadowed = 0;
+      bool this_shadowed = false;
       Lisp_Object shadowed_by = Qnil;
       int range_beg, range_end;
-      Lisp_Object val;
+      Lisp_Object val, tem2;
 
       maybe_quit ();
 
@@ -3098,7 +3039,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, 
Lisp_Object args,
          stop = to;
        }
 
-      starting_i = i;
+      int starting_i = i;
 
       if (CHAR_TABLE_P (vector))
        {
@@ -3108,21 +3049,19 @@ describe_vector (Lisp_Object vector, Lisp_Object 
prefix, Lisp_Object args,
        }
       else
        val = AREF (vector, i);
-      definition = get_keyelt (val, 0);
+      Lisp_Object definition = get_keyelt (val, 0);
 
       if (NILP (definition)) continue;
 
       /* Don't mention suppressed commands.  */
       if (SYMBOLP (definition) && partial)
        {
-         Lisp_Object tem;
-
-         tem = Fget (definition, suppress);
+         Lisp_Object tem = Fget (definition, suppress);
 
          if (!NILP (tem)) continue;
        }
 
-      character = make_fixnum (starting_i);
+      Lisp_Object character = make_fixnum (starting_i);
       ASET (kludge, 0, character);
 
       /* If this binding is shadowed by some other map, ignore it.  */
@@ -3133,7 +3072,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, 
Lisp_Object args,
          if (!NILP (shadowed_by) && !EQ (shadowed_by, definition))
            {
              if (mention_shadow)
-               this_shadowed = 1;
+               this_shadowed = true;
              else
                continue;
            }
@@ -3143,9 +3082,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, 
Lisp_Object args,
         one in the same keymap.  */
       if (!NILP (entire_map))
        {
-         Lisp_Object tem;
-
-         tem = Flookup_key (entire_map, kludge, Qt);
+         Lisp_Object tem = Flookup_key (entire_map, kludge, Qt);
 
          if (!EQ (tem, definition))
            continue;
@@ -3154,7 +3091,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, 
Lisp_Object args,
       if (first)
        {
          insert ("\n", 1);
-         first = 0;
+         first = false;
        }
 
       /* Output the prefix that applies to every entry in this map.  */
@@ -3164,9 +3101,9 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, 
Lisp_Object args,
       insert1 (Fkey_description (kludge, prefix));
 
       /* Find all consecutive characters or rows that have the same
-         definition.  But, VECTOR is a char-table, we had better put a
-         boundary between normal characters (-#x3FFF7F) and 8-bit
-         characters (#x3FFF80-).  */
+        definition.  But, if VECTOR is a char-table, we had better
+        put a boundary between normal characters (-#x3FFF7F) and
+        8-bit characters (#x3FFF80-).  */
       if (CHAR_TABLE_P (vector))
        {
          while (i + 1 < stop
@@ -3189,12 +3126,11 @@ describe_vector (Lisp_Object vector, Lisp_Object 
prefix, Lisp_Object args,
         if they are, that they are shadowed by the same command.  */
       if (CHAR_TABLE_P (vector) && i != starting_i)
        {
-         Lisp_Object tem;
          Lisp_Object key = make_nil_vector (1);
          for (int j = starting_i + 1; j <= i; j++)
            {
              ASET (key, 0, make_fixnum (j));
-             tem = shadow_lookup (shadow, key, Qt, 0);
+             Lisp_Object tem = shadow_lookup (shadow, key, Qt, 0);
              if (NILP (Fequal (tem, shadowed_by)))
                i = j - 1;
            }
@@ -3243,49 +3179,11 @@ describe_vector (Lisp_Object vector, Lisp_Object 
prefix, Lisp_Object args,
     }
 }
 
-/* Apropos - finding all symbols whose names match a regexp.           */
-static Lisp_Object apropos_predicate;
-static Lisp_Object apropos_accumulate;
-
-static void
-apropos_accum (Lisp_Object symbol, Lisp_Object string)
-{
-  register Lisp_Object tem;
-
-  tem = Fstring_match (string, Fsymbol_name (symbol), Qnil);
-  if (!NILP (tem) && !NILP (apropos_predicate))
-    tem = call1 (apropos_predicate, symbol);
-  if (!NILP (tem))
-    apropos_accumulate = Fcons (symbol, apropos_accumulate);
-}
-
-DEFUN ("apropos-internal", Fapropos_internal, Sapropos_internal, 1, 2, 0,
-       doc: /* Show all symbols whose names contain match for REGEXP.
-If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done
-for each symbol and a symbol is mentioned only if that returns non-nil.
-Return list of symbols found.  */)
-  (Lisp_Object regexp, Lisp_Object predicate)
-{
-  Lisp_Object tem;
-  CHECK_STRING (regexp);
-  apropos_predicate = predicate;
-  apropos_accumulate = Qnil;
-  map_obarray (Vobarray, apropos_accum, regexp);
-  tem = Fsort (apropos_accumulate, Qstring_lessp);
-  apropos_accumulate = Qnil;
-  apropos_predicate = Qnil;
-  return tem;
-}
-
 void
 syms_of_keymap (void)
 {
   DEFSYM (Qkeymap, "keymap");
   DEFSYM (Qdescribe_map_tree, "describe-map-tree");
-  staticpro (&apropos_predicate);
-  staticpro (&apropos_accumulate);
-  apropos_predicate = Qnil;
-  apropos_accumulate = Qnil;
 
   DEFSYM (Qkeymap_canonicalize, "keymap-canonicalize");
 
@@ -3429,7 +3327,6 @@ be preferred.  */);
   defsubr (&Stext_char_description);
   defsubr (&Swhere_is_internal);
   defsubr (&Sdescribe_buffer_bindings);
-  defsubr (&Sapropos_internal);
 }
 
 void
diff --git a/src/keymap.h b/src/keymap.h
index 2f7df2b..072c093 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -1,5 +1,5 @@
 /* Functions to manipulate keymaps.
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/kqueue.c b/src/kqueue.c
index 590b747..0a0650d 100644
--- a/src/kqueue.c
+++ b/src/kqueue.c
@@ -1,6 +1,6 @@
 /* Filesystem notifications support with kqueue API.
 
-Copyright (C) 2015-2020 Free Software Foundation, Inc.
+Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/lastfile.c b/src/lastfile.c
index 7ddfe23..7df6cf1 100644
--- a/src/lastfile.c
+++ b/src/lastfile.c
@@ -1,5 +1,5 @@
 /* Mark end of data space to dump as pure, for GNU Emacs.
-   Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/lcms.c b/src/lcms.c
index 924bdd2..b998c8c 100644
--- a/src/lcms.c
+++ b/src/lcms.c
@@ -1,5 +1,5 @@
 /* Interface to Little CMS
-   Copyright (C) 2017-2020 Free Software Foundation, Inc.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/lisp.h b/src/lisp.h
index 416c9b0..0ad788c 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1,6 +1,6 @@
 /* Fundamental definitions for GNU Emacs Lisp interpreter. -*- coding: utf-8 
-*-
 
-Copyright (C) 1985-1987, 1993-1995, 1997-2020 Free Software Foundation,
+Copyright (C) 1985-1987, 1993-1995, 1997-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -1897,16 +1897,17 @@ ASCII_CHAR_P (intmax_t c)
   return 0 <= c && c < 0x80;
 }
 
-/* A char-table is a kind of vectorlike, with contents are like a
-   vector but with a few other slots.  For some purposes, it makes
-   sense to handle a char-table with type struct Lisp_Vector.  An
-   element of a char table can be any Lisp objects, but if it is a sub
-   char-table, we treat it a table that contains information of a
-   specific range of characters.  A sub char-table is like a vector but
-   with two integer fields between the header and Lisp data, which means
+/* A char-table is a kind of vectorlike, with contents like a vector,
+   but with a few additional slots.  For some purposes, it makes sense
+   to handle a char-table as type 'struct Lisp_Vector'.  An element of
+   a char-table can be any Lisp object, but if it is a sub-char-table,
+   we treat it as a table that contains information of a specific
+   range of characters.  A sub-char-table is like a vector, but with
+   two integer fields between the header and Lisp data, which means
    that it has to be marked with some precautions (see mark_char_table
-   in alloc.c).  A sub char-table appears only in an element of a char-table,
-   and there's no way to access it directly from Emacs Lisp program.  */
+   in alloc.c).  A sub-char-table appears only in an element of a
+   char-table, and there's no way to access it directly from a Lisp
+   program.  */
 
 enum CHARTAB_SIZE_BITS
   {
@@ -1926,11 +1927,11 @@ struct Lisp_Char_Table
        contents, and extras slots.  */
     union vectorlike_header header;
 
-    /* This holds a default value,
-       which is used whenever the value for a specific character is nil.  */
+    /* This holds the default value, which is used whenever the value
+       for a specific character is nil.  */
     Lisp_Object defalt;
 
-    /* This points to another char table, which we inherit from when the
+    /* This points to another char table, from which we inherit when the
        value for a specific character is nil.  The `defalt' slot takes
        precedence over this.  */
     Lisp_Object parent;
@@ -1939,8 +1940,8 @@ struct Lisp_Char_Table
        meant for.  */
     Lisp_Object purpose;
 
-    /* The bottom sub char-table for characters of the range 0..127.  It
-       is nil if none of ASCII character has a specific value.  */
+    /* The bottom sub char-table for characters in the range 0..127.  It
+       is nil if no ASCII character has a specific value.  */
     Lisp_Object ascii;
 
     Lisp_Object contents[(1 << CHARTAB_SIZE_BITS_0)];
@@ -2015,7 +2016,7 @@ CHAR_TABLE_REF_ASCII (Lisp_Object ct, ptrdiff_t idx)
 }
 
 /* Almost equivalent to Faref (CT, IDX) with optimization for ASCII
-   characters.  Do not check validity of CT.  */
+   characters.  Does not check validity of CT.  */
 INLINE Lisp_Object
 CHAR_TABLE_REF (Lisp_Object ct, int idx)
 {
@@ -2025,7 +2026,7 @@ CHAR_TABLE_REF (Lisp_Object ct, int idx)
 }
 
 /* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and
-   8-bit European characters.  Do not check validity of CT.  */
+   8-bit European characters.  Does not check validity of CT.  */
 INLINE void
 CHAR_TABLE_SET (Lisp_Object ct, int idx, Lisp_Object val)
 {
@@ -4492,14 +4493,14 @@ extern void setup_process_coding_systems (Lisp_Object);
 
 /* Defined in callproc.c.  */
 #ifdef DOS_NT
-# define CHILD_SETUP_TYPE int
 # define CHILD_SETUP_ERROR_DESC "Spawning child process"
 #else
-# define CHILD_SETUP_TYPE _Noreturn void
 # define CHILD_SETUP_ERROR_DESC "Doing vfork"
 #endif
 
-extern CHILD_SETUP_TYPE child_setup (int, int, int, char **, bool, 
Lisp_Object);
+extern int emacs_spawn (pid_t *, int, int, int, char **, char **, const char *,
+                       const char *);
+extern char **make_environment_block (Lisp_Object);
 extern void init_callproc_1 (void);
 extern void init_callproc (void);
 extern void set_initial_environment (void);
diff --git a/src/lread.c b/src/lread.c
index a3d5fd7..1ff0828 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1,6 +1,6 @@
 /* Lisp parsing and input streams.
 
-Copyright (C) 1985-1989, 1993-1995, 1997-2020 Free Software Foundation,
+Copyright (C) 1985-1989, 1993-1995, 1997-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -3438,7 +3438,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool 
first_in_list)
 
                /* Any modifiers remaining are invalid.  */
                if (modifiers)
-                 error ("Invalid modifier in string");
+                 invalid_syntax ("Invalid modifier in string");
                p += CHAR_STRING (ch, (unsigned char *) p);
              }
            else
diff --git a/src/macfont.h b/src/macfont.h
index 1341030..0ec11f5 100644
--- a/src/macfont.h
+++ b/src/macfont.h
@@ -1,5 +1,5 @@
 /* Interface definition for macOS Core text font backend.
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/macfont.m b/src/macfont.m
index 9048146..d86f09f 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -1,5 +1,5 @@
 /* Font driver on macOS Core text.
-   Copyright (C) 2009-2020 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/macros.c b/src/macros.c
index 6006c86..c8ce94e 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -1,6 +1,6 @@
 /* Keyboard macros.
 
-Copyright (C) 1985-1986, 1993, 2000-2020 Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993, 2000-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/macros.h b/src/macros.h
index d1d516b..23167a0 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -1,5 +1,5 @@
 /* Definitions for keyboard macro interpretation in GNU Emacs.
-   Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/marker.c b/src/marker.c
index 64f210d..5979151 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -1,5 +1,5 @@
 /* Markers: examining, setting and deleting.
-   Copyright (C) 1985, 1997-1998, 2001-2020 Free Software Foundation,
+   Copyright (C) 1985, 1997-1998, 2001-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/menu.c b/src/menu.c
index e4fda57..3b1d740 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1,6 +1,6 @@
 /* Platform-independent code for terminal communications.
 
-Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2020 Free Software
+Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/menu.h b/src/menu.h
index 44749ad..6c67ab2 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -1,5 +1,5 @@
 /* Functions to manipulate menus.
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/minibuf.c b/src/minibuf.c
index fc3fd92..8b23569 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1,6 +1,6 @@
 /* Minibuffer input and completion.
 
-Copyright (C) 1985-1986, 1993-2020 Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -809,7 +809,7 @@ get_minibuffer (EMACS_INT depth)
       static char const name_fmt[] = " *Minibuf-%"pI"d*";
       char name[sizeof name_fmt + INT_STRLEN_BOUND (EMACS_INT)];
       AUTO_STRING_WITH_LEN (lname, name, sprintf (name, name_fmt, depth));
-      buf = Fget_buffer_create (lname);
+      buf = Fget_buffer_create (lname, Qnil);
 
       /* Although the buffer's name starts with a space, undo should be
         enabled in it.  */
diff --git a/src/msdos.c b/src/msdos.c
index b5f06c9..5da01c9 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1,6 +1,6 @@
 /* MS-DOS specific C utilities.          -*- coding: cp850 -*-
 
-Copyright (C) 1993-1997, 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1993-1997, 1999-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/msdos.h b/src/msdos.h
index e08195c..f7d3b0d 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -1,5 +1,5 @@
 /* MS-DOS specific C utilities, interface.
-   Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/nsfns.m b/src/nsfns.m
index c795649..ee2daea 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1,6 +1,6 @@
 /* Functions for the NeXT/Open/GNUstep and macOS window system.
 
-Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2020 Free Software
+Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -456,7 +456,7 @@ ns_set_name (struct frame *f, Lisp_Object name, int 
explicit)
 static void
 ns_set_represented_filename (struct frame *f)
 {
-  Lisp_Object filename, encoded_filename;
+  Lisp_Object filename;
   Lisp_Object buf = XWINDOW (f->selected_window)->contents;
   NSAutoreleasePool *pool;
   NSString *fstr;
@@ -473,9 +473,7 @@ ns_set_represented_filename (struct frame *f)
 
   if (! NILP (filename))
     {
-      encoded_filename = ENCODE_UTF_8 (filename);
-
-      fstr = [NSString stringWithLispString:encoded_filename];
+      fstr = [NSString stringWithLispString:filename];
       if (fstr == nil) fstr = @"";
     }
   else
@@ -3012,7 +3010,7 @@ DEFUN ("ns-show-character-palette",
 #endif
 
 
-/* Whether N bytes at STR are in the [0,127] range.  */
+/* Whether N bytes at STR are in the [1,127] range.  */
 static bool
 all_nonzero_ascii (unsigned char *str, ptrdiff_t n)
 {
diff --git a/src/nsfont.m b/src/nsfont.m
index 378a640..f4f0d28 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -1,6 +1,6 @@
 /* Font back-end driver for the NeXT/Open/GNUstep and macOS window system.
    See font.h
-   Copyright (C) 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -329,7 +329,7 @@ static NSString
 {
     Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist);
     return CONSP (script)
-       ? [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (XCDR 
((script))))]
+       ? [NSString stringWithLispString: SYMBOL_NAME (XCDR ((script)))]
        : @"";
 }
 
@@ -345,7 +345,7 @@ static NSString
         if (!strncmp (SSDATA (r), reg, SBYTES (r)))
           {
             script = XCDR (XCAR (rts));
-            return [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME 
(script))];
+            return [NSString stringWithLispString: SYMBOL_NAME (script)];
           }
         rts = XCDR (rts);
       }
@@ -370,8 +370,7 @@ static NSString
          {
            Lisp_Object key = XCAR (tmp), val = XCDR (tmp);
            if (EQ (key, QCscript) && SYMBOLP (val))
-               return [NSString stringWithUTF8String:
-                           SSDATA (SYMBOL_NAME (val))];
+               return [NSString stringWithLispString: SYMBOL_NAME (val)];
            if (EQ (key, QClang) && SYMBOLP (val))
                return ns_lang_to_script (val);
            if (EQ (key, QCotf) && CONSP (val) && SYMBOLP (XCAR (val)))
diff --git a/src/nsgui.h b/src/nsgui.h
index 0536ef0..e4038d3 100644
--- a/src/nsgui.h
+++ b/src/nsgui.h
@@ -1,5 +1,5 @@
 /* Definitions and headers for communication on the NeXT/Open/GNUstep API.
-   Copyright (C) 1995, 2005, 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2005, 2008-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/nsimage.m b/src/nsimage.m
index da6f01c..fa81a41 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -1,5 +1,5 @@
 /* Image support for the NeXT/Open/GNUstep and macOS window system.
-   Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2020 Free Software
+   Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -235,6 +235,11 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)
   [(EmacsImage *)img setAlphaAtX: x Y: y to: a];
 }
 
+size_t
+ns_image_size_in_bytes (void *img)
+{
+  return [(EmacsImage *)img sizeInBytes];
+}
 
 /* ==========================================================================
 
@@ -257,7 +262,7 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)
   found = ENCODE_FILE (found);
 
   image = [[EmacsImage alloc] initByReferencingFile:
-                     [NSString stringWithUTF8String: SSDATA (found)]];
+                     [NSString stringWithLispString: found]];
 
   image->bmRep = nil;
 #ifdef NS_IMPL_COCOA
@@ -273,7 +278,7 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)
 
   [image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])];
 
-  [image setName: [NSString stringWithUTF8String: SSDATA (file)]];
+  [image setName: [NSString stringWithLispString: file]];
 
   return image;
 }
@@ -288,6 +293,18 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)
 }
 
 
+- (id)copyWithZone:(NSZone *)zone
+{
+  EmacsImage *copy = [super copyWithZone:zone];
+
+  copy->stippleMask = [stippleMask copyWithZone:zone];
+  copy->bmRep = [bmRep copyWithZone:zone];
+  copy->transform = [transform copyWithZone:zone];
+
+  return copy;
+}
+
+
 /* Create image from monochrome bitmap. If both FG and BG are 0
    (black), set the background to white and make it transparent.  */
 - (instancetype)initFromXBM: (unsigned char *)bits width: (int)w height: (int)h
@@ -610,5 +627,22 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)
   smoothing = s;
 }
 
+/* Approximate allocated size of image in bytes.  */
+- (size_t) sizeInBytes
+{
+  size_t bytes = 0;
+  NSImageRep *rep;
+  NSEnumerator *reps = [[self representations] objectEnumerator];
+  while ((rep = (NSImageRep *) [reps nextObject]))
+    {
+      if ([rep respondsToSelector: @selector (bytesPerRow)])
+        {
+          NSBitmapImageRep *bmr = (NSBitmapImageRep *) rep;
+          bytes += [bmr bytesPerRow] * [bmr numberOfPlanes] * [bmr pixelsHigh];
+        }
+    }
+  return bytes;
+}
+
 
 @end
diff --git a/src/nsmenu.m b/src/nsmenu.m
index a286a80..9b56958 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1,5 +1,5 @@
 /* NeXT/Open/GNUstep and macOS Cocoa menu and toolbar module.
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -47,21 +47,11 @@ Carbon version by Yamamoto Mitsuharu. */
 #endif
 
 
-#if 0
-/* Include lisp -> C common menu parsing code.  */
-#define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str)
-#include "nsmenu_common.c"
-#endif
-
 extern long context_menu_value;
 EmacsMenu *svcsMenu;
 /* Nonzero means a menu is currently active.  */
 static int popup_activated_flag;
 
-/* Nonzero means we are tracking and updating menus.  */
-static int trackingMenu;
-
-
 /* NOTE: toolbar implementation is at end,
    following complete menu implementation.  */
 
@@ -75,11 +65,22 @@ static int trackingMenu;
 
 /* Supposed to discard menubar and free storage.  Since we share the
    menubar among frames and update its context for the focused window,
-   there is nothing to do here.  */
+   we do not discard the menu.  We do, however, want to remove any
+   existing menu items.  */
 void
 free_frame_menubar (struct frame *f)
 {
-  return;
+  id menu = [NSApp mainMenu];
+  for (int i = [menu numberOfItems] - 1 ; i >= 0; i--)
+    {
+      NSMenuItem *item = [menu itemAtIndex:i];
+      NSString *title = [item title];
+
+      if ([ns_app_name isEqualToString:title])
+        continue;
+
+      [menu removeItemAtIndex:i];
+    }
 }
 
 
@@ -98,16 +99,19 @@ popup_activated (void)
     3) deep_p, submenu = non-nil: Update contents of a single submenu.
    -------------------------------------------------------------------------- 
*/
 static void
-ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
+ns_update_menubar (struct frame *f, bool deep_p)
 {
   NSAutoreleasePool *pool;
-  id menu = [NSApp mainMenu];
-  static EmacsMenu *last_submenu = nil;
   BOOL needsSet = NO;
+  id menu = [NSApp mainMenu];
   bool owfi;
+
   Lisp_Object items;
   widget_value *wv, *first_wv, *prev_wv = 0;
   int i;
+  int *submenu_start, *submenu_end;
+  bool *submenu_top_level_items;
+  int *submenu_n_panes;
 
 #if NSMENUPROFILE
   struct timeb tb;
@@ -116,7 +120,7 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu 
*submenu)
 
   NSTRACE ("ns_update_menubar");
 
-  if (f != SELECTED_FRAME ())
+  if (f != SELECTED_FRAME () || FRAME_EXTERNAL_MENU_BAR (f) == 0)
       return;
   XSETFRAME (Vmenu_updating_frame, f);
 /*fprintf (stderr, "ns_update_menubar: frame: %p\tdeep: %d\tsub: %p\n", f, 
deep_p, submenu); */
@@ -141,115 +145,102 @@ ns_update_menubar (struct frame *f, bool deep_p, 
EmacsMenu *submenu)
   t = -(1000*tb.time+tb.millitm);
 #endif
 
-#ifdef NS_IMPL_GNUSTEP
-  deep_p = 1; /* until GNUstep NSMenu implements the Panther delegation model 
*/
-#endif
-
   if (deep_p)
     {
-      /* Fully parse one or more of the submenus.  */
-      int n = 0;
-      int *submenu_start, *submenu_end;
-      bool *submenu_top_level_items;
-      int *submenu_n_panes;
+      /* Make a widget-value tree representing the entire menu trees.  */
+
       struct buffer *prev = current_buffer;
       Lisp_Object buffer;
       ptrdiff_t specpdl_count = SPECPDL_INDEX ();
       int previous_menu_items_used = f->menu_bar_items_used;
       Lisp_Object *previous_items
        = alloca (previous_menu_items_used * sizeof *previous_items);
+      int subitems;
 
-      /* lisp preliminaries */
       buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->contents;
       specbind (Qinhibit_quit, Qt);
+      /* Don't let the debugger step into this code
+        because it is not reentrant.  */
       specbind (Qdebug_on_next_call, Qnil);
+
       record_unwind_save_match_data ();
       if (NILP (Voverriding_local_map_menu_flag))
        {
          specbind (Qoverriding_terminal_local_map, Qnil);
          specbind (Qoverriding_local_map, Qnil);
        }
+
       set_buffer_internal_1 (XBUFFER (buffer));
 
-      /* TODO: for some reason this is not needed in other terms,
-        but some menu updates call Info-extract-pointer which causes
-        abort-on-error if waiting-for-input.  Needs further investigation.  */
+      /* TODO: for some reason this is not needed in other terms, but
+        some menu updates call Info-extract-pointer which causes
+        abort-on-error if waiting-for-input.  Needs further
+        investigation.  */
       owfi = waiting_for_input;
       waiting_for_input = 0;
 
-      /* lucid hook and possible reset */
+      /* Run the Lucid hook.  */
       safe_run_hooks (Qactivate_menubar_hook);
+
+      /* If it has changed current-menubar from previous value,
+        really recompute the menubar from the value.  */
       if (! NILP (Vlucid_menu_bar_dirty_flag))
        call0 (Qrecompute_lucid_menubar);
       safe_run_hooks (Qmenu_bar_update_hook);
       fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
 
-      /* Now ready to go */
       items = FRAME_MENU_BAR_ITEMS (f);
 
-      /* Save the frame's previous menu bar contents data */
+      /* Save the frame's previous menu bar contents data.  */
       if (previous_menu_items_used)
-       memcpy (previous_items, aref_addr (f->menu_bar_vector, 0),
-               previous_menu_items_used * sizeof (Lisp_Object));
+       memcpy (previous_items, xvector_contents (f->menu_bar_vector),
+               previous_menu_items_used * word_size);
 
-      /* parse stage 1: extract from lisp */
+      /* Fill in menu_items with the current menu bar contents.
+        This can evaluate Lisp code.  */
       save_menu_items ();
 
       menu_items = f->menu_bar_vector;
       menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
-      submenu_start = alloca (ASIZE (items) * sizeof *submenu_start);
-      submenu_end = alloca (ASIZE (items) * sizeof *submenu_end);
-      submenu_n_panes = alloca (ASIZE (items) * sizeof *submenu_n_panes);
-      submenu_top_level_items = alloca (ASIZE (items)
+      subitems = ASIZE (items) / 4;
+      submenu_start = alloca ((subitems + 1) * sizeof *submenu_start);
+      submenu_end = alloca (subitems * sizeof *submenu_end);
+      submenu_n_panes = alloca (subitems * sizeof *submenu_n_panes);
+      submenu_top_level_items = alloca (subitems
                                        * sizeof *submenu_top_level_items);
       init_menu_items ();
-      for (i = 0; i < ASIZE (items); i += 4)
+      for (i = 0; i < subitems; i++)
        {
          Lisp_Object key, string, maps;
 
-         key = AREF (items, i);
-         string = AREF (items, i + 1);
-         maps = AREF (items, i + 2);
+         key = AREF (items, 4 * i);
+         string = AREF (items, 4 * i + 1);
+         maps = AREF (items, 4 * i + 2);
          if (NILP (string))
            break;
 
-          /* FIXME: we'd like to only parse the needed submenu, but this
-            was causing crashes in the _common parsing code: need to make
-            sure proper initialization done.  */
-         /* if (submenu && strcmp ([[submenu title] UTF8String], SSDATA 
(string)))
-               continue; */
-
          submenu_start[i] = menu_items_used;
 
          menu_items_n_panes = 0;
-         submenu_top_level_items[i] = parse_single_submenu (key, string, maps);
+         submenu_top_level_items[i]
+           = parse_single_submenu (key, string, maps);
          submenu_n_panes[i] = menu_items_n_panes;
+
          submenu_end[i] = menu_items_used;
-          n++;
        }
 
+      submenu_start[i] = -1;
       finish_menu_items ();
       waiting_for_input = owfi;
 
+      /* Convert menu_items into widget_value trees
+        to display the menu.  This cannot evaluate Lisp code.  */
 
-      if (submenu && n == 0)
-        {
-          /* should have found a menu for this one but didn't */
-          fprintf (stderr, "ERROR: did not find lisp menu for submenu '%s'.\n",
-                  [[submenu title] UTF8String]);
-         discard_menu_items ();
-         unbind_to (specpdl_count, Qnil);
-          unblock_input ();
-         return;
-        }
-
-      /* parse stage 2: insert into lucid 'widget_value' structures
-         [comments in other terms say not to evaluate lisp code here] */
       wv = make_widget_value ("menubar", NULL, true, Qnil);
       wv->button_type = BUTTON_TYPE_NONE;
       first_wv = wv;
 
-      for (i = 0; i < 4*n; i += 4)
+      for (i = 0; submenu_start[i] >= 0; i++)
        {
          menu_items_n_panes = submenu_n_panes[i];
          wv = digest_single_submenu (submenu_start[i], submenu_end[i],
@@ -259,169 +250,79 @@ ns_update_menubar (struct frame *f, bool deep_p, 
EmacsMenu *submenu)
          else
            first_wv->contents = wv;
          /* Don't set wv->name here; GC during the loop might relocate it.  */
-         wv->enabled = 1;
+         wv->enabled = true;
          wv->button_type = BUTTON_TYPE_NONE;
          prev_wv = wv;
        }
 
       set_buffer_internal_1 (prev);
 
-      /* Compare the new menu items with previous, and leave off if no change. 
 */
-      /* FIXME: following other terms here, but seems like this should be
-        done before parse stage 2 above, since its results aren't used.  */
-      if (previous_menu_items_used
-          && (!submenu || (submenu && submenu == last_submenu))
-          && menu_items_used == previous_menu_items_used)
-        {
-          for (i = 0; i < previous_menu_items_used; i++)
-            /* FIXME: this ALWAYS fails on Buffers menu items.. something
-              about their strings causes them to change every time, so we
-              double-check failures.  */
-            if (!EQ (previous_items[i], AREF (menu_items, i)))
-              if (!(STRINGP (previous_items[i])
-                    && STRINGP (AREF (menu_items, i))
-                    && !strcmp (SSDATA (previous_items[i]),
-                               SSDATA (AREF (menu_items, i)))))
-                  break;
-          if (i == previous_menu_items_used)
-            {
-              /* No change.  */
+      /* If there has been no change in the Lisp-level contents
+        of the menu bar, skip redisplaying it.  Just exit.  */
 
-#if NSMENUPROFILE
-              ftime (&tb);
-              t += 1000*tb.time+tb.millitm;
-              fprintf (stderr, "NO CHANGE!  CUTTING OUT after %ld msec.\n", t);
-#endif
+      /* Compare the new menu items with the ones computed last time.  */
+      for (i = 0; i < previous_menu_items_used; i++)
+       if (menu_items_used == i
+           || (!EQ (previous_items[i], AREF (menu_items, i))))
+         break;
+      if (i == menu_items_used && i == previous_menu_items_used && i != 0)
+       {
+         /* The menu items have not changed.  Don't bother updating
+            the menus in any form, since it would be a no-op.  */
+         free_menubar_widget_value_tree (first_wv);
+         discard_menu_items ();
+         unbind_to (specpdl_count, Qnil);
+         return;
+       }
 
-              free_menubar_widget_value_tree (first_wv);
-              discard_menu_items ();
-              unbind_to (specpdl_count, Qnil);
-              unblock_input ();
-              return;
-            }
-        }
       /* The menu items are different, so store them in the frame.  */
-      /* FIXME: this is not correct for single-submenu case.  */
       fset_menu_bar_vector (f, menu_items);
       f->menu_bar_items_used = menu_items_used;
 
-      /* Calls restore_menu_items, etc., as they were outside.  */
+      /* This undoes save_menu_items.  */
       unbind_to (specpdl_count, Qnil);
 
-      /* Parse stage 2a: now GC cannot happen during the lifetime of the
-         widget_value, so it's safe to store data from a Lisp_String.  */
+      /* Now GC cannot happen during the lifetime of the widget_value,
+        so it's safe to store data from a Lisp_String.  */
       wv = first_wv->contents;
       for (i = 0; i < ASIZE (items); i += 4)
        {
          Lisp_Object string;
          string = AREF (items, i + 1);
          if (NILP (string))
-           break;
-
-         wv->name = SSDATA (string);
+            break;
+          wv->name = SSDATA (string);
           update_submenu_strings (wv->contents);
-         wv = wv->next;
+          wv = wv->next;
        }
 
-      /* Now, update the NS menu; if we have a submenu, use that, otherwise
-         create a new menu for each sub and fill it.  */
-      if (submenu)
-        {
-          const char *submenuTitle = [[submenu title] UTF8String];
-          for (wv = first_wv->contents; wv; wv = wv->next)
-            {
-              if (!strcmp (submenuTitle, wv->name))
-                {
-                  [submenu fillWithWidgetValue: wv->contents];
-                  last_submenu = submenu;
-                  break;
-                }
-            }
-        }
-      else
-        {
-          [menu fillWithWidgetValue: first_wv->contents frame: f];
-        }
-
     }
   else
     {
-      static int n_previous_strings = 0;
-      static char previous_strings[100][10];
-      static struct frame *last_f = NULL;
-      int n;
-      Lisp_Object string;
+      /* Make a widget-value tree containing
+        just the top level menu bar strings.  */
 
       wv = make_widget_value ("menubar", NULL, true, Qnil);
       wv->button_type = BUTTON_TYPE_NONE;
       first_wv = wv;
 
-      /* Make widget-value tree with just the top level menu bar strings.  */
       items = FRAME_MENU_BAR_ITEMS (f);
-      if (NILP (items))
-        {
-          free_menubar_widget_value_tree (first_wv);
-          unblock_input ();
-          return;
-        }
-
-
-      /* Check if no change: this mechanism is a bit rough, but ready.  */
-      n = ASIZE (items) / 4;
-      if (f == last_f && n_previous_strings == n)
-        {
-          for (i = 0; i<n; i++)
-            {
-             string = AREF (items, 4*i+1);
-
-              if (EQ (string, make_fixnum (0))) // FIXME: Why???  --Stef
-                continue;
-              if (NILP (string))
-                {
-                  if (previous_strings[i][0])
-                    break;
-                  else
-                    continue;
-                }
-              else if (memcmp (previous_strings[i], SDATA (string),
-                         min (10, SBYTES (string) + 1)))
-                break;
-            }
-
-          if (i == n)
-            {
-              free_menubar_widget_value_tree (first_wv);
-              unblock_input ();
-              return;
-            }
-        }
-
-      [menu clear];
       for (i = 0; i < ASIZE (items); i += 4)
        {
+         Lisp_Object string;
+
          string = AREF (items, i + 1);
          if (NILP (string))
            break;
 
-          if (n < 100)
-           memcpy (previous_strings[i/4], SDATA (string),
-                    min (10, SBYTES (string) + 1));
-
          wv = make_widget_value (SSDATA (string), NULL, true, Qnil);
          wv->button_type = BUTTON_TYPE_NONE;
+         /* This prevents lwlib from assuming this
+            menu item is really supposed to be empty.  */
+         /* The intptr_t cast avoids a warning.
+            This value just has to be different from small integers.  */
          wv->call_data = (void *) (intptr_t) (-1);
 
-#ifdef NS_IMPL_COCOA
-          /* We'll update the real copy under app menu when time comes.  */
-          if (!strcmp ("Services", wv->name))
-            {
-              /* But we need to make sure it will update on demand.  */
-              [svcsMenu setFrame: f];
-            }
-          else
-#endif
-          [menu addSubmenuWithTitle: wv->name forFrame: f];
-
          if (prev_wv)
            prev_wv->next = wv;
          else
@@ -429,15 +330,58 @@ ns_update_menubar (struct frame *f, bool deep_p, 
EmacsMenu *submenu)
          prev_wv = wv;
        }
 
-      last_f = f;
-      if (n < 100)
-        n_previous_strings = n;
+      /* Forget what we thought we knew about what is in the
+        detailed contents of the menu bar menus.
+        Changing the top level always destroys the contents.  */
+      f->menu_bar_items_used = 0;
+    }
+
+  /* Now, update the NS menu.  */
+  i = 0;
+
+  /* Make sure we skip the "application" menu, which is always the
+     first entry in our top-level menu.  */
+  if (i < [menu numberOfItems])
+    {
+      NSString *title = [[menu itemAtIndex:i] title];
+      if ([ns_app_name isEqualToString:title])
+        i += 1;
+    }
+
+  for (wv = first_wv->contents; wv; wv = wv->next)
+    {
+      EmacsMenu *submenu;
+
+      if (i < [menu numberOfItems])
+        {
+          NSString *titleStr = [NSString stringWithUTF8String: wv->name];
+          NSMenuItem *item = [menu itemAtIndex:i];
+          submenu = (EmacsMenu*)[item submenu];
+
+          [item setTitle:titleStr];
+          [submenu setTitle:titleStr];
+          [submenu removeAllItems];
+        }
       else
-        n_previous_strings = 0;
+        submenu = [menu addSubmenuWithTitle: wv->name];
+
+      if ([[submenu title] isEqualToString:@"Help"])
+        [NSApp setHelpMenu:submenu];
+
+      if (deep_p)
+        [submenu fillWithWidgetValue: wv->contents];
 
+      i += 1;
     }
-  free_menubar_widget_value_tree (first_wv);
 
+  while (i < [menu numberOfItems])
+    {
+      /* Remove any extra items.  */
+      [menu removeItemAtIndex:i];
+    }
+
+
+  free_menubar_widget_value_tree (first_wv);
 
 #if NSMENUPROFILE
   ftime (&tb);
@@ -460,21 +404,10 @@ ns_update_menubar (struct frame *f, bool deep_p, 
EmacsMenu *submenu)
 void
 set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
 {
-  ns_update_menubar (f, deep_p, nil);
-}
-
-void
-ns_activate_menubar (struct frame *f)
-{
-#ifdef NS_IMPL_COCOA
-  ns_update_menubar (f, true, nil);
-  ns_check_pending_open_menu ();
-#endif
+  ns_update_menubar (f, deep_p);
 }
 
 
-
-
 /* ==========================================================================
 
     Menu: class implementation
@@ -490,97 +423,31 @@ ns_activate_menubar (struct frame *f)
 /* override designated initializer */
 - (instancetype)initWithTitle: (NSString *)title
 {
-  frame = 0;
   if ((self = [super initWithTitle: title]))
     [self setAutoenablesItems: NO];
-  return self;
-}
-
-
-/* used for top-level */
-- (instancetype)initWithTitle: (NSString *)title frame: (struct frame *)f
-{
-  [self initWithTitle: title];
-  frame = f;
-#ifdef NS_IMPL_COCOA
   [self setDelegate: self];
-#endif
-  return self;
-}
-
-
-- (void)setFrame: (struct frame *)f
-{
-  frame = f;
-}
-
-#ifdef NS_IMPL_COCOA
--(void)trackingNotification:(NSNotification *)notification
-{
-  /* Update menu in menuNeedsUpdate only while tracking menus.  */
-  trackingMenu = ([notification name] == NSMenuDidBeginTrackingNotification
-                  ? 1 : 0);
-  if (! trackingMenu) ns_check_menu_open (nil);
-}
-
-- (void)menuWillOpen:(NSMenu *)menu
-{
-  ++trackingMenu;
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
-  // On 10.6 we get repeated calls, only the one for NSSystemDefined is "real".
-  if (
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
-      NSAppKitVersionNumber < NSAppKitVersionNumber10_7 &&
-#endif
-      [[NSApp currentEvent] type] != NSEventTypeSystemDefined)
-    return;
-#endif
+  needsUpdate = YES;
 
-  /* When dragging from one menu to another, we get willOpen followed by 
didClose,
-     i.e. trackingMenu == 3 in willOpen and then 2 after didClose.
-     We have updated all menus, so avoid doing it when trackingMenu == 3.  */
-  if (trackingMenu == 2)
-    ns_check_menu_open (menu);
-}
-
-- (void)menuDidClose:(NSMenu *)menu
-{
-  --trackingMenu;
+  return self;
 }
 
-#endif /* NS_IMPL_COCOA */
 
 /* Delegate method called when a submenu is being opened: run a 'deep' call
    to set_frame_menubar.  */
+
+/* TODO: GNUstep calls this method when the menu is still being built
+   which throws it into an infinite loop.  One possible solution is to
+   use menuWillOpen instead, but the Apple docs explicitly warn
+   against changing the contents of the menu in it.  I don't know what
+   the right thing to do for GNUstep is.  */
 - (void)menuNeedsUpdate: (NSMenu *)menu
 {
-  if (!FRAME_LIVE_P (frame))
+  if (!FRAME_LIVE_P (SELECTED_FRAME ()))
     return;
 
-  /* Cocoa/Carbon will request update on every keystroke
-     via IsMenuKeyEvent -> CheckMenusForKeyEvent.  These are not needed
-     since key equivalents are handled through emacs.
-     On Leopard, even keystroke events generate SystemDefined event.
-     Third-party applications that enhance mouse / trackpad
-     interaction, or also VNC/Remote Desktop will send events
-     of type AppDefined rather than SysDefined.
-     Menus will fail to show up if they haven't been initialized.
-     AppDefined events may lack timing data.
-
-     Thus, we rely on the didBeginTrackingNotification notification
-     as above to indicate the need for updates.
-     From 10.6 on, we could also use -[NSMenu propertiesToUpdate]: In the
-     key press case, NSMenuPropertyItemImage (e.g.) won't be set.
-  */
-  if (trackingMenu == 0)
-    return;
-/*fprintf (stderr, "Updating menu '%s'\n", [[self title] UTF8String]); NSLog 
(@"%@\n", event); */
-#ifdef NS_IMPL_GNUSTEP
-  /* Don't know how to do this for anything other than Mac OS X 10.5 and later.
-     This is wrong, as it might run Lisp code in the event loop.  */
-  ns_update_menubar (frame, true, self);
-#endif
+  if (needsUpdate)
+    ns_update_menubar (SELECTED_FRAME (), true);
 }
 
 
@@ -593,33 +460,8 @@ ns_activate_menubar (struct frame *f)
 }
 
 
-/* Parse a widget_value's key rep (examples: 's-p', 's-S', '(C-x C-s)', 
'<f13>')
-   into an accelerator string.  We are only able to display a single character
-   for an accelerator, together with an optional modifier combination.  (Under
-   Carbon more control was possible, but in Cocoa multi-char strings passed to
-   NSMenuItem get ignored.  For now we try to display a super-single letter
-   combo, and return the others as strings to be appended to the item title.
-   (This is signaled by setting keyEquivModMask to 0 for now.) */
--(NSString *)parseKeyEquiv: (const char *)key
-{
-  const char *tpos = key;
-  keyEquivModMask = NSEventModifierFlagCommand;
-
-  if (!key || !*key)
-    return @"";
-
-  while (*tpos == ' ' || *tpos == '(')
-    tpos++;
-  if ((*tpos == 's') && (*(tpos+1) == '-'))
-    {
-      return [NSString stringWithFormat: @"%c", tpos[2]];
-    }
-  keyEquivModMask = 0; /* signal */
-  return [NSString stringWithUTF8String: tpos];
-}
-
-
 - (NSMenuItem *)addItemWithWidgetValue: (void *)wvptr
+                            attributes: (NSDictionary *)attributes
 {
   NSMenuItem *item;
   widget_value *wv = (widget_value *)wvptr;
@@ -627,36 +469,33 @@ ns_activate_menubar (struct frame *f)
   if (menu_separator_name_p (wv->name))
     {
       item = [NSMenuItem separatorItem];
-      [self addItem: item];
     }
   else
     {
-      NSString *title, *keyEq;
-      title = [NSString stringWithUTF8String: wv->name];
+      NSString *title = [NSString stringWithUTF8String: wv->name];
       if (title == nil)
         title = @"< ? >";  /* (get out in the open so we know about it) */
 
-      keyEq = [self parseKeyEquiv: wv->key];
-#ifdef NS_IMPL_COCOA
-      /* macOS mangles modifier strings longer than one character.  */
-      if (keyEquivModMask == 0)
-        {
-          title = [title stringByAppendingFormat: @" (%@)", keyEq];
-          item = [self addItemWithTitle: (NSString *)title
-                                 action: @selector (menuDown:)
-                          keyEquivalent: @""];
-        }
-      else
+      item = [[[NSMenuItem alloc] init] autorelease];
+      if (wv->key)
         {
-#endif
-          item = [self addItemWithTitle: (NSString *)title
-                                 action: @selector (menuDown:)
-                          keyEquivalent: keyEq];
+          NSString *key = [NSString stringWithUTF8String: wv->key];
 #ifdef NS_IMPL_COCOA
-        }
+          /* Cocoa only permits a single key (with modifiers) as
+             keyEquivalent, so we put them in the title string
+             in a tab-separated column. */
+          title = [title stringByAppendingFormat: @"\t%@", key];
+#else
+          [item setKeyEquivalent: key];
 #endif
-      [item setKeyEquivalentModifierMask: keyEquivModMask];
+        }
 
+      NSAttributedString *atitle = [[[NSAttributedString alloc]
+                                         initWithString: title
+                                             attributes: attributes]
+                                     autorelease];
+      [item setAction: @selector (menuDown:)];
+      [item setAttributedTitle: atitle];
       [item setEnabled: wv->enabled];
 
       /* Draw radio buttons and tickboxes.  */
@@ -669,52 +508,145 @@ ns_activate_menubar (struct frame *f)
       [item setTag: (NSInteger)wv->call_data];
     }
 
+  [self addItem: item];
   return item;
 }
 
 
 /* convenience */
--(void)clear
+-(void)removeAllItems
 {
+#ifdef NS_IMPL_COCOA
+  [super removeAllItems];
+#else
+  /* GNUstep doesn't have removeAllItems yet, so do it
+     manually.  */
   int n;
 
   for (n = [self numberOfItems]-1; n >= 0; n--)
-    {
-      NSMenuItem *item = [self itemAtIndex: n];
-      NSString *title = [item title];
-      if ([ns_app_name isEqualToString: title]
-          && ![item isSeparatorItem])
-        continue;
-      [self removeItemAtIndex: n];
-    }
+    [self removeItemAtIndex: n];
+#endif
+
+  needsUpdate = YES;
 }
 
 
-- (void)fillWithWidgetValue: (void *)wvptr
+typedef struct {
+  const char *from, *to;
+} subst_t;
+
+/* Standard keyboard symbols used in menus. */
+static const subst_t key_symbols[] = {
+  {"<backspace>",  "⌫"},
+  {"DEL",          "⌫"},
+  {"<deletechar>", "⌦"},
+  {"<return>",     "↩"},
+  {"RET",          "↩"},
+  {"<left>",       "←"},
+  {"<right>",      "→"},
+  {"<up>",         "↑"},
+  {"<down>",       "↓"},
+  {"<prior>",      "⇞"},
+  {"<next>",       "⇟"},
+  {"<home>",       "↖"},
+  {"<end>",        "↘"},
+  {"<tab>",        "⇥"},
+  {"TAB",          "⇥"},
+  {"<backtab>",    "⇤"},
+};
+
+/* Transform the key sequence KEY into something prettier by
+   substituting keyboard symbols. */
+static char *
+prettify_key (const char *key)
 {
-  [self fillWithWidgetValue: wvptr frame: (struct frame *)nil];
+  while (*key == ' ') key++;
+
+  int len = strlen (key);
+  char *buf = xmalloc (len + 1);
+  memcpy (buf, key, len + 1);
+  for (int i = 0; i < ARRAYELTS (key_symbols); i++)
+    {
+      ptrdiff_t fromlen = strlen (key_symbols[i].from);
+      char *p = buf;
+      while (p < buf + len)
+        {
+          char *match = memmem (buf, len, key_symbols[i].from, fromlen);
+          if (!match)
+            break;
+          ptrdiff_t tolen = strlen (key_symbols[i].to);
+          eassert (tolen <= fromlen);
+          memcpy (match, key_symbols[i].to, tolen);
+          memmove (match + tolen, match + fromlen,
+                   len - (match + fromlen - buf) + 1);
+          len -= fromlen - tolen;
+          p = match + tolen;
+        }
+    }
+  Lisp_Object result = build_string (buf);
+  xfree (buf);
+  return SSDATA (result);
 }
 
-- (void)fillWithWidgetValue: (void *)wvptr frame: (struct frame *)f
+- (void)fillWithWidgetValue: (void *)wvptr
 {
-  widget_value *wv = (widget_value *)wvptr;
+  widget_value *first_wv = (widget_value *)wvptr;
+  NSFont *menuFont = [NSFont menuFontOfSize:0];
+  NSDictionary *attributes = nil;
+
+#ifdef NS_IMPL_COCOA
+  /* Cocoa doesn't allow multi-key sequences in its menu display, so
+     work around it by using tabs to split the title into two
+     columns.  */
+  NSDictionary *font_attribs = @{NSFontAttributeName: menuFont};
+  CGFloat maxNameWidth = 0;
+  CGFloat maxKeyWidth = 0;
+
+  /* Determine the maximum width of all menu items. */
+  for (widget_value *wv = first_wv; wv != NULL; wv = wv->next)
+    if (!menu_separator_name_p (wv->name))
+      {
+        NSString *name = [NSString stringWithUTF8String: wv->name];
+        NSSize nameSize = [name sizeWithAttributes: font_attribs];
+        maxNameWidth = MAX(maxNameWidth, nameSize.width);
+        if (wv->key)
+          {
+            wv->key = prettify_key (wv->key);
+            NSString *key = [NSString stringWithUTF8String: wv->key];
+            NSSize keySize = [key sizeWithAttributes: font_attribs];
+            maxKeyWidth = MAX(maxKeyWidth, keySize.width);
+          }
+      }
+
+  /* Put some space between the names and keys. */
+  CGFloat maxWidth = maxNameWidth + maxKeyWidth + 40;
+
+  /* Set a right-aligned tab stop at the maximum width, so that the
+     key will appear immediately to the left of it. */
+  NSTextTab *tab =
+    [[[NSTextTab alloc] initWithTextAlignment: NSTextAlignmentRight
+                                     location: maxWidth
+                                      options: @{}] autorelease];
+  NSMutableParagraphStyle *pstyle = [[[NSMutableParagraphStyle alloc] init]
+                                      autorelease];
+  [pstyle setTabStops: @[tab]];
+  attributes = @{NSParagraphStyleAttributeName: pstyle};
+#endif
 
   /* clear existing contents */
-  [self clear];
+  [self removeAllItems];
 
   /* add new contents */
-  for (; wv != NULL; wv = wv->next)
+  for (widget_value *wv = first_wv; wv != NULL; wv = wv->next)
     {
-      NSMenuItem *item = [self addItemWithWidgetValue: wv];
+      NSMenuItem *item = [self addItemWithWidgetValue: wv
+                                           attributes: attributes];
 
       if (wv->contents)
         {
           EmacsMenu *submenu;
 
-          if (f)
-            submenu = [[EmacsMenu alloc] initWithTitle: [item title] frame:f];
-          else
-            submenu = [[EmacsMenu alloc] initWithTitle: [item title]];
+          submenu = [[EmacsMenu alloc] initWithTitle: [item title]];
 
           [self setSubmenu: submenu forItem: item];
           [submenu fillWithWidgetValue: wv->contents];
@@ -723,6 +655,8 @@ ns_activate_menubar (struct frame *f)
         }
     }
 
+  needsUpdate = NO;
+
 #ifdef NS_IMPL_GNUSTEP
   if ([[self window] isVisible])
     [self sizeToFit];
@@ -731,13 +665,13 @@ ns_activate_menubar (struct frame *f)
 
 
 /* Adds an empty submenu and returns it.  */
-- (EmacsMenu *)addSubmenuWithTitle: (const char *)title forFrame: (struct 
frame *)f
+- (EmacsMenu *)addSubmenuWithTitle: (const char *)title
 {
   NSString *titleStr = [NSString stringWithUTF8String: title];
   NSMenuItem *item = [self addItemWithTitle: titleStr
                                      action: (SEL)nil /*@selector (menuDown:) 
*/
                               keyEquivalent: @""];
-  EmacsMenu *submenu = [[EmacsMenu alloc] initWithTitle: titleStr frame: f];
+  EmacsMenu *submenu = [[EmacsMenu alloc] initWithTitle: titleStr];
   [self setSubmenu: submenu forItem: item];
   [submenu release];
   return submenu;
@@ -970,7 +904,7 @@ ns_menu_show (struct frame *f, int x, int y, int menuflags,
     }
 
   pmenu = [[EmacsMenu alloc] initWithTitle:
-                               [NSString stringWithUTF8String: SSDATA 
(title)]];
+                               [NSString stringWithLispString: title]];
   [pmenu fillWithWidgetValue: first_wv->contents];
   free_menubar_widget_value_tree (first_wv);
   unbind_to (specpdl_count, Qnil);
@@ -1022,15 +956,12 @@ update_frame_tool_bar (struct frame *f)
   int i, k = 0;
   EmacsView *view = FRAME_NS_VIEW (f);
   EmacsToolbar *toolbar = [view toolbar];
-  int oldh;
 
   NSTRACE ("update_frame_tool_bar");
 
   if (view == nil || toolbar == nil) return;
   block_input ();
 
-  oldh = FRAME_TOOLBAR_HEIGHT (f);
-
 #ifdef NS_IMPL_COCOA
   [toolbar clearActive];
 #else
@@ -1881,12 +1812,6 @@ DEFUN ("menu-or-popup-active-p", 
Fmenu_or_popup_active_p, Smenu_or_popup_active_
 void
 syms_of_nsmenu (void)
 {
-#ifndef NS_IMPL_COCOA
-  /* Don't know how to keep track of this in Next/Open/GNUstep.  Always
-     update menus there.  */
-  trackingMenu = 1;
-  PDUMPER_REMEMBER_SCALAR (trackingMenu);
-#endif
   defsubr (&Sns_reset_menu);
   defsubr (&Smenu_or_popup_active_p);
 
diff --git a/src/nsselect.m b/src/nsselect.m
index 7b1937f..27db924 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -1,5 +1,5 @@
 /* NeXT/Open/GNUstep / macOS Cocoa selection processing for emacs.
-   Copyright (C) 1993-1994, 2005-2006, 2008-2020 Free Software
+   Copyright (C) 1993-1994, 2005-2006, 2008-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -58,7 +58,7 @@ symbol_to_nsstring (Lisp_Object sym)
   if (EQ (sym, QPRIMARY))     return NXPrimaryPboard;
   if (EQ (sym, QSECONDARY))   return NXSecondaryPboard;
   if (EQ (sym, QTEXT))        return NSPasteboardTypeString;
-  return [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (sym))];
+  return [NSString stringWithLispString: SYMBOL_NAME (sym)];
 }
 
 static NSPasteboard *
@@ -170,17 +170,12 @@ ns_string_to_pasteboard_internal (id pb, Lisp_Object str, 
NSString *gtype)
     }
   else
     {
-      char *utfStr;
       NSString *type, *nsStr;
       NSEnumerator *tenum;
 
       CHECK_STRING (str);
 
-      utfStr = SSDATA (str);
-      nsStr = [[NSString alloc] initWithBytesNoCopy: utfStr
-                                             length: SBYTES (str)
-                                           encoding: NSUTF8StringEncoding
-                                       freeWhenDone: NO];
+      nsStr = [NSString stringWithLispString: str];
       // FIXME: Why those 2 different code paths?
       if (gtype == nil)
         {
@@ -196,7 +191,6 @@ ns_string_to_pasteboard_internal (id pb, Lisp_Object str, 
NSString *gtype)
          eassert (gtype == NSPasteboardTypeString);
           [pb setString: nsStr forType: gtype];
         }
-      [nsStr release];
       ns_store_pb_change_count (pb);
     }
 }
diff --git a/src/nsterm.h b/src/nsterm.h
index f292993..3fb6449 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -1,5 +1,5 @@
 /* Definitions and headers for communication with NeXT/Open/GNUstep API.
-   Copyright (C) 1989, 1993, 2005, 2008-2020 Free Software Foundation,
+   Copyright (C) 1989, 1993, 2005, 2008-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
@@ -414,6 +414,7 @@ typedef id instancetype;
    ========================================================================== 
*/
 
 @class EmacsToolbar;
+@class EmacsSurface;
 
 #ifdef NS_IMPL_COCOA
 @interface EmacsView : NSView <NSTextInput, NSWindowDelegate>
@@ -435,7 +436,7 @@ typedef id instancetype;
    BOOL fs_is_native;
    BOOL in_fullscreen_transition;
 #ifdef NS_DRAW_TO_BUFFER
-   CGContextRef drawingBuffer;
+   EmacsSurface *surface;
 #endif
 @public
    struct frame *emacsframe;
@@ -478,7 +479,7 @@ typedef id instancetype;
 
 #ifdef NS_DRAW_TO_BUFFER
 - (void)focusOnDrawingBuffer;
-- (void)createDrawingBuffer;
+- (void)unfocusDrawingBuffer;
 #endif
 - (void)copyRect:(NSRect)srcRect to:(NSRect)dstRect;
 
@@ -513,25 +514,17 @@ typedef id instancetype;
 
    ========================================================================== 
*/
 
-#ifdef NS_IMPL_COCOA
 @interface EmacsMenu : NSMenu  <NSMenuDelegate>
-#else
-@interface EmacsMenu : NSMenu
-#endif
 {
-  struct frame *frame;
-  unsigned long keyEquivModMask;
+  BOOL needsUpdate;
 }
 
-- (instancetype)initWithTitle: (NSString *)title frame: (struct frame *)f;
-- (void)setFrame: (struct frame *)f;
 - (void)menuNeedsUpdate: (NSMenu *)menu; /* (delegate method) */
-- (NSString *)parseKeyEquiv: (const char *)key;
-- (NSMenuItem *)addItemWithWidgetValue: (void *)wvptr;
+- (NSMenuItem *)addItemWithWidgetValue: (void *)wvptr
+                            attributes: (NSDictionary *)attributes;
 - (void)fillWithWidgetValue: (void *)wvptr;
-- (void)fillWithWidgetValue: (void *)wvptr frame: (struct frame *)f;
-- (EmacsMenu *)addSubmenuWithTitle: (const char *)title forFrame: (struct 
frame *)f;
-- (void) clear;
+- (EmacsMenu *)addSubmenuWithTitle: (const char *)title;
+- (void) removeAllItems;
 - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
                  keymaps: (bool)keymaps;
 @end
@@ -666,6 +659,7 @@ typedef id instancetype;
 - (BOOL)setFrame: (unsigned int) index;
 - (void)setTransform: (double[3][3]) m;
 - (void)setSmoothing: (BOOL)s;
+- (size_t)sizeInBytes;
 @end
 
 
@@ -711,6 +705,25 @@ typedef id instancetype;
 + (CGFloat)scrollerWidth;
 @end
 
+#ifdef NS_DRAW_TO_BUFFER
+@interface EmacsSurface : NSObject
+{
+  NSMutableArray *cache;
+  NSSize size;
+  CGColorSpaceRef colorSpace;
+  IOSurfaceRef currentSurface;
+  IOSurfaceRef lastSurface;
+  CGContextRef context;
+}
+- (id) initWithSize: (NSSize)s ColorSpace: (CGColorSpaceRef)cs;
+- (void) dealloc;
+- (NSSize) getSize;
+- (CGContextRef) getContext;
+- (void) releaseContext;
+- (IOSurfaceRef) getSurface;
+@end
+#endif
+
 
 /* ==========================================================================
 
@@ -1129,8 +1142,6 @@ extern int ns_lisp_to_color (Lisp_Object color, NSColor 
**col);
 extern NSColor *ns_lookup_indexed_color (unsigned long idx, struct frame *f);
 extern unsigned long ns_index_color (NSColor *color, struct frame *f);
 extern const char *ns_get_pending_menu_title (void);
-extern void ns_check_menu_open (NSMenu *menu);
-extern void ns_check_pending_open_menu (void);
 #endif
 
 /* Implemented in nsfns, published in nsterm.  */
@@ -1195,6 +1206,7 @@ extern void ns_set_alpha (void *img, int x, int y, 
unsigned char a);
 
 extern int ns_display_pixel_height (struct ns_display_info *);
 extern int ns_display_pixel_width (struct ns_display_info *);
+extern size_t ns_image_size_in_bytes (void *img);
 
 /* This in nsterm.m */
 extern float ns_antialias_threshold;
diff --git a/src/nsterm.m b/src/nsterm.m
index 0729c96..2731063 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1,6 +1,6 @@
 /* NeXT/Open/GNUstep / macOS communication module.      -*- coding: utf-8 -*-
 
-Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2020 Free Software
+Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -72,6 +72,10 @@ GNUstep port and post-20 update by Adrian Robert 
(arobert@cogsci.ucsd.edu)
 #include <Carbon/Carbon.h>
 #endif
 
+#ifdef NS_DRAW_TO_BUFFER
+#include <IOSurface/IOSurface.h>
+#endif
+
 static EmacsMenu *dockMenu;
 #ifdef NS_IMPL_COCOA
 static EmacsMenu *mainMenu;
@@ -310,24 +314,6 @@ static struct {
   NULL, 0, 0
 };
 
-#ifdef NS_IMPL_COCOA
-/*
- * State for pending menu activation:
- * MENU_NONE     Normal state
- * MENU_PENDING  A menu has been clicked on, but has been canceled so we can
- *               run lisp to update the menu.
- * MENU_OPENING  Menu is up to date, and the click event is redone so the menu
- *               will open.
- */
-#define MENU_NONE 0
-#define MENU_PENDING 1
-#define MENU_OPENING 2
-static int menu_will_open_state = MENU_NONE;
-
-/* Saved position for menu click.  */
-static CGPoint menu_mouse_point;
-#endif
-
 /* Convert modifiers in a NeXTstep event to emacs style modifiers.  */
 #define NS_FUNCTION_KEY_MASK 0x800000
 #define NSLeftControlKeyMask    (0x000001 | NSEventModifierFlagControl)
@@ -1165,8 +1151,7 @@ ns_update_end (struct frame *f)
   if ([FRAME_NS_VIEW (f) wantsUpdateLayer])
     {
 #endif
-      [NSGraphicsContext setCurrentContext:nil];
-      [view setNeedsDisplay:YES];
+      [FRAME_NS_VIEW (f) unfocusDrawingBuffer];
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
     }
   else
@@ -1274,6 +1259,8 @@ ns_unfocus (struct frame *f)
   if ([FRAME_NS_VIEW (f) wantsUpdateLayer])
     {
 #endif
+      if (! ns_updating_frame)
+        [FRAME_NS_VIEW (f) unfocusDrawingBuffer];
       [FRAME_NS_VIEW (f) setNeedsDisplay:YES];
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
     }
@@ -3056,7 +3043,7 @@ ns_clear_under_internal_border (struct frame *f)
       if (!face)
         return;
 
-      ns_focus (f, &frame_rect, 1);
+      ns_focus (f, NULL, 1);
       [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set];
       for (int i = 0; i < 4 ; i++)
         {
@@ -3405,6 +3392,8 @@ ns_draw_window_cursor (struct window *w, struct glyph_row 
*glyph_row,
   /* Prevent the cursor from being drawn outside the text area.  */
   r = NSIntersectionRect (r, ns_row_rect (w, glyph_row, TEXT_AREA));
 
+  ns_focus (f, &r, 1);
+
   face = FACE_FROM_ID_OR_NULL (f, phys_cursor_glyph->face_id);
   if (face && NS_FACE_BACKGROUND (face)
       == ns_index_color (FRAME_CURSOR_COLOR (f), f))
@@ -3415,8 +3404,6 @@ ns_draw_window_cursor (struct window *w, struct glyph_row 
*glyph_row,
   else
     [FRAME_CURSOR_COLOR (f) set];
 
-  ns_focus (f, &r, 1);
-
   switch (cursor_type)
     {
     case DEFAULT_CURSOR:
@@ -4608,79 +4595,6 @@ check_native_fs ()
 }
 #endif
 
-/* GNUstep does not have cancelTracking.  */
-#ifdef NS_IMPL_COCOA
-/* Check if menu open should be canceled or continued as normal.  */
-void
-ns_check_menu_open (NSMenu *menu)
-{
-  /* Click in menu bar?  */
-  NSArray *a = [[NSApp mainMenu] itemArray];
-  int i;
-  BOOL found = NO;
-
-  if (menu == nil) // Menu tracking ended.
-    {
-      if (menu_will_open_state == MENU_OPENING)
-        menu_will_open_state = MENU_NONE;
-      return;
-    }
-
-  for (i = 0; ! found && i < [a count]; i++)
-    found = menu == [[a objectAtIndex:i] submenu];
-  if (found)
-    {
-      if (menu_will_open_state == MENU_NONE && emacs_event)
-        {
-          NSEvent *theEvent = [NSApp currentEvent];
-          struct frame *emacsframe = SELECTED_FRAME ();
-
-          /* On macOS, the following can cause an event loop when the
-             Spotlight for Help search field is populated.  Avoid this by
-             not postponing mouse drag and non-user-generated mouse down
-             events (Bug#31371).  */
-          if (([theEvent type] == NSEventTypeLeftMouseDown)
-              && [theEvent eventNumber])
-            {
-              [menu cancelTracking];
-              menu_will_open_state = MENU_PENDING;
-              emacs_event->kind = MENU_BAR_ACTIVATE_EVENT;
-              EV_TRAILER (theEvent);
-
-              CGEventRef ourEvent = CGEventCreate (NULL);
-              menu_mouse_point = CGEventGetLocation (ourEvent);
-              CFRelease (ourEvent);
-            }
-        }
-      else if (menu_will_open_state == MENU_OPENING)
-        {
-          menu_will_open_state = MENU_NONE;
-        }
-    }
-}
-
-/* Redo saved menu click if state is MENU_PENDING.  */
-void
-ns_check_pending_open_menu ()
-{
-  if (menu_will_open_state == MENU_PENDING)
-    {
-      CGEventSourceRef source
-        = CGEventSourceCreate (kCGEventSourceStateHIDSystemState);
-
-      CGEventRef event = CGEventCreateMouseEvent (source,
-                                                  kCGEventLeftMouseDown,
-                                                  menu_mouse_point,
-                                                  kCGMouseButtonLeft);
-      CGEventSetType (event, kCGEventLeftMouseDown);
-      CGEventPost (kCGHIDEventTap, event);
-      CFRelease (event);
-      CFRelease (source);
-
-      menu_will_open_state = MENU_OPENING;
-    }
-}
-#endif /* NS_IMPL_COCOA */
 
 static int
 ns_read_socket (struct terminal *terminal, struct input_event *hold_quit)
@@ -4789,7 +4703,8 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds,
       return -1;
     }
 
-  for (k = 0; k < nfds+1; k++)
+  eassert (nfds <= FD_SETSIZE);
+  for (k = 0; k < nfds; k++)
     {
       if (readfds && FD_ISSET(k, readfds)) ++nr;
       if (writefds && FD_ISSET(k, writefds)) ++nr;
@@ -4806,8 +4721,22 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds,
       thread_select(pselect, 0, NULL, NULL, NULL, &t, sigmask);
     }
 
-  [outerpool release];
-  outerpool = [[NSAutoreleasePool alloc] init];
+  /* FIXME: This draining of outerpool causes a crash when a buffer
+     running over tramp is displayed and the user tries to use the
+     menus.  I believe some other autorelease pool's lifetime
+     straddles this call causing a violation of autorelease pool
+     nesting.  There's no good reason to keep these here since the
+     pool will be drained some other time anyway, but removing them
+     leaves the menus sometimes not opening until the user moves their
+     mouse pointer, but that's better than a crash.
+
+     There must be something about running external processes like
+     tramp that interferes with the modal menu code.
+
+     See bugs 24472, 37557, 37922.  */
+
+  // [outerpool release];
+  // outerpool = [[NSAutoreleasePool alloc] init];
 
 
   send_appdefined = YES;
@@ -4987,8 +4916,8 @@ ns_set_vertical_scroll_bar (struct window *window,
           [bar removeFromSuperview];
           wset_vertical_scroll_bar (window, Qnil);
           [bar release];
+          ns_clear_frame_area (f, left, top, width, height);
         }
-      ns_clear_frame_area (f, left, top, width, height);
       unblock_input ();
       return;
     }
@@ -5010,7 +4939,7 @@ ns_set_vertical_scroll_bar (struct window *window,
       r.size.width = oldRect.size.width;
       if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r))
         {
-          if (oldRect.origin.x != r.origin.x)
+          if (! NSEqualRects (oldRect, r))
               ns_clear_frame_area (f, left, top, width, height);
           [bar setFrame: r];
         }
@@ -5088,8 +5017,7 @@ ns_set_horizontal_scroll_bar (struct window *window,
       oldRect = [bar frame];
       if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r))
         {
-          if (oldRect.origin.y != r.origin.y)
-            ns_clear_frame_area (f, left, top, width, height);
+          ns_clear_frame_area (f, left, top, width, height);
           [bar setFrame: r];
           update_p = YES;
         }
@@ -5166,15 +5094,13 @@ ns_judge_scroll_bars (struct frame *f)
   id view;
   EmacsView *eview = FRAME_NS_VIEW (f);
   NSArray *subviews = [[eview superview] subviews];
-  BOOL removed = NO;
 
   NSTRACE ("ns_judge_scroll_bars");
   for (i = [subviews count]-1; i >= 0; --i)
     {
       view = [subviews objectAtIndex: i];
       if (![view isKindOfClass: [EmacsScroller class]]) continue;
-      if ([view judge])
-        removed = YES;
+      [view judge];
     }
 }
 
@@ -5418,7 +5344,6 @@ ns_create_terminal (struct ns_display_info *dpyinfo)
   terminal->set_new_font_hook = ns_new_font;
   terminal->implicit_set_name_hook = ns_implicitly_set_name;
   terminal->menu_show_hook = ns_menu_show;
-  terminal->activate_menubar_hook = ns_activate_menubar;
   terminal->popup_dialog_hook = ns_popup_dialog;
   terminal->set_vertical_scroll_bar_hook = ns_set_vertical_scroll_bar;
   terminal->set_horizontal_scroll_bar_hook = ns_set_horizontal_scroll_bar;
@@ -5543,9 +5468,8 @@ ns_term_init (Lisp_Object display_name)
     /* There are 752 colors defined in rgb.txt.  */
     if ( cl == nil || [[cl allKeys] count] < 752)
       {
-        Lisp_Object color_file, color_map, color;
+        Lisp_Object color_file, color_map, color, name;
         unsigned long c;
-        char *name;
 
         color_file = Fexpand_file_name (build_string ("rgb.txt"),
                          Fsymbol_value (intern ("data-directory")));
@@ -5558,14 +5482,14 @@ ns_term_init (Lisp_Object display_name)
         for ( ; CONSP (color_map); color_map = XCDR (color_map))
           {
             color = XCAR (color_map);
-            name = SSDATA (XCAR (color));
+            name = XCAR (color);
             c = XFIXNUM (XCDR (color));
             [cl setColor:
                   [NSColor colorForEmacsRed: RED_FROM_ULONG (c) / 255.0
                                       green: GREEN_FROM_ULONG (c) / 255.0
                                        blue: BLUE_FROM_ULONG (c) / 255.0
                                       alpha: 1.0]
-                  forKey: [NSString stringWithUTF8String: name]];
+                  forKey: [NSString stringWithLispString: name]];
           }
 
         /* FIXME: Report any errors writing the color file below.  */
@@ -5664,15 +5588,6 @@ ns_term_init (Lisp_Object display_name)
     [NSApp setServicesMenu: svcsMenu];
     /* Needed at least on Cocoa, to get dock menu to show windows */
     [NSApp setWindowsMenu: [[NSMenu alloc] init]];
-
-    [[NSNotificationCenter defaultCenter]
-      addObserver: mainMenu
-         selector: @selector (trackingNotification:)
-             name: NSMenuDidBeginTrackingNotification object: mainMenu];
-    [[NSNotificationCenter defaultCenter]
-      addObserver: mainMenu
-         selector: @selector (trackingNotification:)
-             name: NSMenuDidEndTrackingNotification object: mainMenu];
   }
 #endif /* macOS menu setup */
 
@@ -6370,7 +6285,7 @@ not_in_argv (NSString *arg)
             object:nil];
 
 #ifdef NS_DRAW_TO_BUFFER
-  CGContextRelease (drawingBuffer);
+  [surface release];
 #endif
 
   [toolbar release];
@@ -7393,8 +7308,9 @@ not_in_argv (NSString *arg)
   if ([self wantsUpdateLayer])
     {
       CGFloat scale = [[self window] backingScaleFactor];
-      int oldw = (CGFloat)CGBitmapContextGetWidth (drawingBuffer) / scale;
-      int oldh = (CGFloat)CGBitmapContextGetHeight (drawingBuffer) / scale;
+      NSSize size = [surface getSize];
+      int oldw = size.width / scale;
+      int oldh = size.height / scale;
 
       NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh));
 
@@ -7404,6 +7320,9 @@ not_in_argv (NSString *arg)
           NSTRACE_MSG ("No change");
           return;
         }
+
+      [surface release];
+      surface = nil;
     }
 #endif
 
@@ -7416,9 +7335,6 @@ not_in_argv (NSString *arg)
                      FRAME_PIXEL_TO_TEXT_HEIGHT (emacsframe, newh),
                      0, YES, 0, 1);
 
-#ifdef NS_DRAW_TO_BUFFER
-  [self createDrawingBuffer];
-#endif
   SET_FRAME_GARBAGED (emacsframe);
   cancel_mouse_face (emacsframe);
 }
@@ -7621,8 +7537,7 @@ not_in_argv (NSString *arg)
     [self registerForDraggedTypes: ns_drag_types];
 
   tem = f->name;
-  name = [NSString stringWithUTF8String:
-                   NILP (tem) ? "Emacs" : SSDATA (tem)];
+  name = NILP (tem) ? @"Emacs" : [NSString stringWithLispString:tem];
   [win setTitle: name];
 
   /* toolbar support */
@@ -7690,10 +7605,6 @@ not_in_argv (NSString *arg)
   [NSApp registerServicesMenuSendTypes: ns_send_types
                            returnTypes: [NSArray array]];
 
-#ifdef NS_DRAW_TO_BUFFER
-  [self createDrawingBuffer];
-#endif
-
   /* Set up view resize notifications.  */
   [self setPostsFrameChangedNotifications:YES];
   [[NSNotificationCenter defaultCenter]
@@ -8413,45 +8324,41 @@ not_in_argv (NSString *arg)
 
 
 #ifdef NS_DRAW_TO_BUFFER
-- (void)createDrawingBuffer
-  /* Create and store a new CGGraphicsContext for Emacs to draw into.
-
-     We can't do this in GNUstep as there's no equivalent, so under
-     GNUstep we retain the old method of drawing direct to the
-     EmacsView.  */
+- (void)focusOnDrawingBuffer
 {
-  NSTRACE ("EmacsView createDrawingBuffer]");
+  CGFloat scale = [[self window] backingScaleFactor];
 
-  if (! [self wantsUpdateLayer])
-    return;
+  NSTRACE ("[EmacsView focusOnDrawingBuffer]");
 
-  NSGraphicsContext *screen;
-  CGColorSpaceRef colorSpace = [[[self window] colorSpace] CGColorSpace];
-  CGFloat scale = [[self window] backingScaleFactor];
-  NSRect frame = [self frame];
+  if (! surface)
+    {
+      NSRect frame = [self frame];
+      NSSize s = NSMakeSize (NSWidth (frame) * scale, NSHeight (frame) * 
scale);
+
+      surface = [[EmacsSurface alloc] initWithSize:s
+                                        ColorSpace:[[[self window] colorSpace]
+                                                     CGColorSpace]];
+    }
 
-  if (drawingBuffer != nil)
-    CGContextRelease (drawingBuffer);
+  CGContextRef context = [surface getContext];
 
-  drawingBuffer = CGBitmapContextCreate (nil, NSWidth (frame) * scale, 
NSHeight (frame) * scale,
-                                         8, 0, colorSpace,
-                                         kCGImageAlphaPremultipliedFirst | 
kCGBitmapByteOrder32Host);
+  CGContextTranslateCTM(context, 0, [surface getSize].height);
+  CGContextScaleCTM(context, scale, -scale);
 
-  /* This fixes the scale to match the backing scale factor, and flips the 
image.  */
-  CGContextTranslateCTM(drawingBuffer, 0, NSHeight (frame) * scale);
-  CGContextScaleCTM(drawingBuffer, scale, -scale);
+  [NSGraphicsContext
+    setCurrentContext:[NSGraphicsContext
+                        graphicsContextWithCGContext:context
+                                             flipped:YES]];
 }
 
 
-- (void)focusOnDrawingBuffer
+- (void)unfocusDrawingBuffer
 {
-  NSTRACE ("EmacsView focusOnDrawingBuffer]");
-
-  NSGraphicsContext *buf =
-    [NSGraphicsContext
-        graphicsContextWithCGContext:drawingBuffer flipped:YES];
+  NSTRACE ("[EmacsView unfocusDrawingBuffer]");
 
-  [NSGraphicsContext setCurrentContext:buf];
+  [NSGraphicsContext setCurrentContext:nil];
+  [surface releaseContext];
+  [self setNeedsDisplay:YES];
 }
 
 
@@ -8460,11 +8367,11 @@ not_in_argv (NSString *arg)
 {
   NSTRACE ("EmacsView windowDidChangeBackingProperties:]");
 
-  if (! [self wantsUpdateLayer])
-    return;
-
   NSRect frame = [self frame];
-  [self createDrawingBuffer];
+
+  [surface release];
+  surface = nil;
+
   ns_clear_frame (emacsframe);
   expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
 }
@@ -8482,33 +8389,28 @@ not_in_argv (NSString *arg)
   if ([self wantsUpdateLayer])
     {
 #endif
-      CGImageRef copy;
-      NSRect frame = [self frame];
-      NSAffineTransform *setOrigin = [NSAffineTransform transform];
-
-      [[NSGraphicsContext currentContext] saveGraphicsState];
-
-      /* Set the clipping before messing with the buffer's
-         orientation.  */
-      NSRectClip (dstRect);
-
-      /* Unflip the buffer as the copied image will be unflipped, and
-         offset the top left so when we draw back into the buffer the
-         correct part of the image is drawn.  */
-      CGContextScaleCTM(drawingBuffer, 1, -1);
-      CGContextTranslateCTM(drawingBuffer,
-                            NSMinX (dstRect) - NSMinX (srcRect),
-                            -NSHeight (frame) - (NSMinY (dstRect) - NSMinY 
(srcRect)));
-
-      /* Take a copy of the buffer and then draw it back to the buffer,
-         limited by the clipping rectangle.  */
-      copy = CGBitmapContextCreateImage (drawingBuffer);
-      CGContextDrawImage (drawingBuffer, frame, copy);
-
-      CGImageRelease (copy);
-
-      [[NSGraphicsContext currentContext] restoreGraphicsState];
-      [self setNeedsDisplayInRect:dstRect];
+      double scale = [[self window] backingScaleFactor];
+      CGContextRef context = [[NSGraphicsContext currentContext] CGContext];
+      int bpp = CGBitmapContextGetBitsPerPixel (context) / 8;
+      void *pixels = CGBitmapContextGetData (context);
+      int rowSize = CGBitmapContextGetBytesPerRow (context);
+      int srcRowSize = NSWidth (srcRect) * scale * bpp;
+      void *srcPixels = pixels + (int)(NSMinY (srcRect) * scale * rowSize
+                                       + NSMinX (srcRect) * scale * bpp);
+      void *dstPixels = pixels + (int)(NSMinY (dstRect) * scale * rowSize
+                                       + NSMinX (dstRect) * scale * bpp);
+
+      if (NSIntersectsRect (srcRect, dstRect)
+          && NSMinY (srcRect) < NSMinY (dstRect))
+        for (int y = NSHeight (srcRect) * scale - 1 ; y >= 0 ; y--)
+          memmove (dstPixels + y * rowSize,
+                   srcPixels + y * rowSize,
+                   srcRowSize);
+      else
+        for (int y = 0 ; y < NSHeight (srcRect) * scale ; y++)
+          memmove (dstPixels + y * rowSize,
+                   srcPixels + y * rowSize,
+                   srcRowSize);
 
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
     }
@@ -8549,9 +8451,12 @@ not_in_argv (NSString *arg)
 {
   NSTRACE ("[EmacsView updateLayer]");
 
-  CGImageRef contentsImage = CGBitmapContextCreateImage(drawingBuffer);
-  [[self layer] setContents:(id)contentsImage];
-  CGImageRelease(contentsImage);
+  /* This can fail to update the screen if the same surface is
+     provided twice in a row, even if its contents have changed.
+     There's a private method, -[CALayer setContentsChanged], that we
+     could use to force it, but we shouldn't often get the same
+     surface twice in a row.  */
+  [[self layer] setContents:(id)[surface getSurface]];
 }
 #endif
 
@@ -9594,6 +9499,210 @@ not_in_argv (NSString *arg)
 @end  /* EmacsScroller */
 
 
+#ifdef NS_DRAW_TO_BUFFER
+
+/* ==========================================================================
+
+   A class to handle the screen buffer.
+
+   ========================================================================== 
*/
+
+@implementation EmacsSurface
+
+
+/* An IOSurface is a pixel buffer that is efficiently copied to VRAM
+   for display.  In order to use an IOSurface we must first lock it,
+   write to it, then unlock it.  At this point it is transferred to
+   VRAM and if we modify it during this transfer we may see corruption
+   of the output.  To avoid this problem we can check if the surface
+   is "in use", and if it is then avoid using it.  Unfortunately to
+   avoid writing to a surface that's in use, but still maintain the
+   ability to draw to the screen at any time, we need to keep a cache
+   of multiple surfaces that we can use at will.
+
+   The EmacsSurface class maintains this cache of surfaces, and
+   handles the conversion to a CGGraphicsContext that AppKit can use
+   to draw on.
+
+   The cache is simple: if a free surface is found it is removed from
+   the cache and set as the "current" surface.  Once Emacs is done
+   with drawing to the current surface, the previous surface that was
+   drawn to is added to the cache for reuse, and the current one is
+   set as the last surface.  If no free surfaces are found in the
+   cache then a new one is created.
+
+   When AppKit wants to update the screen, we provide it with the last
+   surface, as that has the most recent data.
+
+   FIXME: It is possible for the cache to grow if Emacs draws faster
+   than the surfaces can be drawn to the screen, so there should
+   probably be some sort of pruning job that removes excess
+   surfaces.  */
+
+
+- (id) initWithSize: (NSSize)s
+         ColorSpace: (CGColorSpaceRef)cs
+{
+  NSTRACE ("[EmacsSurface initWithSize:ColorSpace:]");
+
+  [super init];
+
+  cache = [[NSMutableArray arrayWithCapacity:3] retain];
+  size = s;
+  colorSpace = cs;
+
+  return self;
+}
+
+
+- (void) dealloc
+{
+  if (context)
+    CGContextRelease (context);
+
+  if (currentSurface)
+    CFRelease (currentSurface);
+  if (lastSurface)
+    CFRelease (lastSurface);
+
+  for (id object in cache)
+    CFRelease ((IOSurfaceRef)object);
+
+  [cache removeAllObjects];
+
+  [super dealloc];
+}
+
+
+/* Return the size values our cached data is using.  */
+- (NSSize) getSize
+{
+  return size;
+}
+
+
+/* Return a CGContextRef that can be used for drawing to the screen.
+   This must ALWAYS be paired with a call to releaseContext, and the
+   calls cannot be nested.  */
+- (CGContextRef) getContext
+{
+  IOSurfaceRef surface = NULL;
+
+  NSTRACE ("[EmacsSurface getContextWithSize:]");
+  NSTRACE_MSG (@"IOSurface count: %lu", [cache count] + (lastSurface ? 1 : 0));
+
+  for (id object in cache)
+    {
+      if (!IOSurfaceIsInUse ((IOSurfaceRef)object))
+      {
+        surface = (IOSurfaceRef)object;
+        [cache removeObject:object];
+        break;
+      }
+    }
+
+  if (!surface)
+    {
+      int bytesPerRow = IOSurfaceAlignProperty (kIOSurfaceBytesPerRow,
+                                                size.width * 4);
+
+      surface = IOSurfaceCreate
+        ((CFDictionaryRef)@{(id)kIOSurfaceWidth:[NSNumber 
numberWithInt:size.width],
+            (id)kIOSurfaceHeight:[NSNumber numberWithInt:size.height],
+            (id)kIOSurfaceBytesPerRow:[NSNumber numberWithInt:bytesPerRow],
+            (id)kIOSurfaceBytesPerElement:[NSNumber numberWithInt:4],
+            (id)kIOSurfacePixelFormat:[NSNumber 
numberWithUnsignedInt:'BGRA']});
+    }
+
+  IOReturn lockStatus = IOSurfaceLock (surface, 0, nil);
+  if (lockStatus != kIOReturnSuccess)
+    NSLog (@"Failed to lock surface: %x", lockStatus);
+
+  [self copyContentsTo:surface];
+
+  currentSurface = surface;
+
+  context = CGBitmapContextCreate (IOSurfaceGetBaseAddress (currentSurface),
+                                   IOSurfaceGetWidth (currentSurface),
+                                   IOSurfaceGetHeight (currentSurface),
+                                   8,
+                                   IOSurfaceGetBytesPerRow (currentSurface),
+                                   colorSpace,
+                                   (kCGImageAlphaPremultipliedFirst
+                                    | kCGBitmapByteOrder32Host));
+  return context;
+}
+
+
+/* Releases the CGGraphicsContext and unlocks the associated
+   IOSurface, so it will be sent to VRAM.  */
+- (void) releaseContext
+{
+  NSTRACE ("[EmacsSurface releaseContextAndGetSurface]");
+
+  CGContextRelease (context);
+  context = NULL;
+
+  IOReturn lockStatus = IOSurfaceUnlock (currentSurface, 0, nil);
+  if (lockStatus != kIOReturnSuccess)
+    NSLog (@"Failed to unlock surface: %x", lockStatus);
+
+  /* Put lastSurface back on the end of the cache.  It may not have
+     been displayed on the screen yet, but we probably want the new
+     data and not some stale data anyway.  */
+  if (lastSurface)
+    [cache addObject:(id)lastSurface];
+  lastSurface = currentSurface;
+  currentSurface = NULL;
+}
+
+
+/* Get the IOSurface that we want to draw to the screen.  */
+- (IOSurfaceRef) getSurface
+{
+  /* lastSurface always contains the most up-to-date and complete data.  */
+  return lastSurface;
+}
+
+
+/* Copy the contents of lastSurface to DESTINATION.  This is required
+   every time we want to use an IOSurface as its contents are probably
+   blanks (if it's new), or stale.  */
+- (void) copyContentsTo: (IOSurfaceRef) destination
+{
+  IOReturn lockStatus;
+  void *sourceData, *destinationData;
+  int numBytes = IOSurfaceGetAllocSize (destination);
+
+  NSTRACE ("[EmacsSurface copyContentsTo:]");
+
+  if (! lastSurface)
+    return;
+
+  lockStatus = IOSurfaceLock (lastSurface, kIOSurfaceLockReadOnly, nil);
+  if (lockStatus != kIOReturnSuccess)
+    NSLog (@"Failed to lock source surface: %x", lockStatus);
+
+  sourceData = IOSurfaceGetBaseAddress (lastSurface);
+  destinationData = IOSurfaceGetBaseAddress (destination);
+
+  /* Since every IOSurface should have the exact same settings, a
+     memcpy seems like the fastest way to copy the data from one to
+     the other.  */
+  memcpy (destinationData, sourceData, numBytes);
+
+  lockStatus = IOSurfaceUnlock (lastSurface, kIOSurfaceLockReadOnly, nil);
+  if (lockStatus != kIOReturnSuccess)
+    NSLog (@"Failed to unlock source surface: %x", lockStatus);
+}
+
+
+@end /* EmacsSurface */
+
+
+#endif
+
+
 #ifdef NS_IMPL_GNUSTEP
 /* Dummy class to get rid of startup warnings.  */
 @implementation EmacsDocument
diff --git a/src/nsxwidget.h b/src/nsxwidget.h
index dcdb26c..9cc90b0 100644
--- a/src/nsxwidget.h
+++ b/src/nsxwidget.h
@@ -1,6 +1,6 @@
 /* Header for NS Cocoa part of xwidget and webkit widget.
 
-Copyright (C) 2019-2020 Free Software Foundation, Inc.
+Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/nsxwidget.m b/src/nsxwidget.m
index dbd4cb2..eff5f0a 100644
--- a/src/nsxwidget.m
+++ b/src/nsxwidget.m
@@ -1,6 +1,6 @@
 /* NS Cocoa part implementation of xwidget and webkit widget.
 
-Copyright (C) 2019-2020 Free Software Foundation, Inc.
+Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -296,8 +296,6 @@ static NSString *xwScript;
 
 /* Xwidget webkit commands.  */
 
-static Lisp_Object build_string_with_nsstr (NSString *nsstr);
-
 bool
 nsxwidget_is_web_view (struct xwidget *xw)
 {
@@ -309,14 +307,14 @@ Lisp_Object
 nsxwidget_webkit_uri (struct xwidget *xw)
 {
   XwWebView *xwWebView = (XwWebView *) xw->xwWidget;
-  return build_string_with_nsstr (xwWebView.URL.absoluteString);
+  return [xwWebView.URL.absoluteString lispString];
 }
 
 Lisp_Object
 nsxwidget_webkit_title (struct xwidget *xw)
 {
   XwWebView *xwWebView = (XwWebView *) xw->xwWidget;
-  return build_string_with_nsstr (xwWebView.title);
+  return [xwWebView.title lispString];
 }
 
 /* @Note ATS - Need application transport security in 'Info.plist' or
@@ -350,15 +348,6 @@ nsxwidget_webkit_zoom (struct xwidget *xw, double 
zoom_change)
   /* TODO: setMagnification:centeredAtPoint.  */
 }
 
-/* Build lisp string */
-static Lisp_Object
-build_string_with_nsstr (NSString *nsstr)
-{
-  const char *utfstr = [nsstr UTF8String];
-  NSUInteger bytes = [nsstr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
-  return make_string (utfstr, bytes);
-}
-
 /* Recursively convert an objc native type JavaScript value to a Lisp
    value.  Mostly copied from GTK xwidget 'webkit_js_to_lisp'.  */
 static Lisp_Object
@@ -367,7 +356,7 @@ js_to_lisp (id value)
   if (value == nil || [value isKindOfClass:NSNull.class])
     return Qnil;
   else if ([value isKindOfClass:NSString.class])
-    return build_string_with_nsstr ((NSString *) value);
+    return [(NSString *) value lispString];
   else if ([value isKindOfClass:NSNumber.class])
     {
       NSNumber *nsnum = (NSNumber *) value;
@@ -407,7 +396,7 @@ js_to_lisp (id value)
         {
           NSString *prop_key = (NSString *) [keys objectAtIndex:i];
           id prop_value = [nsdict valueForKey:prop_key];
-          p->contents[i] = Fcons (build_string_with_nsstr (prop_key),
+          p->contents[i] = Fcons ([prop_key lispString],
                                   js_to_lisp (prop_value));
         }
       XSETVECTOR (obj, p);
diff --git a/src/pdumper.c b/src/pdumper.c
index 0096a4d..6956ee3 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -2692,7 +2692,7 @@ dump_hash_table (struct dump_context *ctx,
 static dump_off
 dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer)
 {
-#if CHECK_STRUCTS && !defined HASH_buffer_EE36B4292E
+#if CHECK_STRUCTS && !defined HASH_buffer_99D642C1CB
 # error "buffer changed. See CHECK_STRUCTS comment in config.h."
 #endif
   struct buffer munged_buffer = *in_buffer;
diff --git a/src/pdumper.h b/src/pdumper.h
index c793fb4..ed665ac 100644
--- a/src/pdumper.h
+++ b/src/pdumper.h
@@ -1,6 +1,6 @@
 /* Header file for the portable dumper.
 
-Copyright (C) 2016, 2018-2020 Free Software Foundation, Inc.
+Copyright (C) 2016, 2018-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/print.c b/src/print.c
index 008bf5e..94a8bcb 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1,6 +1,6 @@
 /* Lisp object printing and output streams.
 
-Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2020 Free Software
+Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -562,7 +562,7 @@ temp_output_buffer_setup (const char *bufname)
 
   record_unwind_current_buffer ();
 
-  Fset_buffer (Fget_buffer_create (build_string (bufname)));
+  Fset_buffer (Fget_buffer_create (build_string (bufname), Qnil));
 
   Fkill_all_local_variables ();
   delete_all_overlays (current_buffer);
diff --git a/src/process.c b/src/process.c
index bf64ead..06d750d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1,6 +1,6 @@
 /* Asynchronous subprocess control for GNU Emacs.
 
-Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2020 Free Software
+Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -80,15 +80,6 @@ static struct rlimit nofile_limit;
 
 #endif
 
-#ifdef NEED_BSDTTY
-#include <bsdtty.h>
-#endif
-
-#ifdef USG5_4
-# include <sys/stream.h>
-# include <sys/stropts.h>
-#endif
-
 #ifdef HAVE_UTIL_H
 #include <util.h>
 #endif
@@ -465,6 +456,7 @@ add_read_fd (int fd, fd_callback func, void *data)
 {
   add_keyboard_wait_descriptor (fd);
 
+  eassert (0 <= fd && fd < FD_SETSIZE);
   fd_callback_info[fd].func = func;
   fd_callback_info[fd].data = data;
 }
@@ -485,6 +477,7 @@ static void
 add_process_read_fd (int fd)
 {
   add_non_keyboard_read_fd (fd);
+  eassert (0 <= fd && fd < FD_SETSIZE);
   fd_callback_info[fd].flags |= PROCESS_FD;
 }
 
@@ -495,6 +488,7 @@ delete_read_fd (int fd)
 {
   delete_keyboard_wait_descriptor (fd);
 
+  eassert (0 <= fd && fd < FD_SETSIZE);
   if (fd_callback_info[fd].flags == 0)
     {
       fd_callback_info[fd].func = 0;
@@ -534,6 +528,7 @@ recompute_max_desc (void)
 {
   int fd;
 
+  eassert (max_desc < FD_SETSIZE);
   for (fd = max_desc; fd >= 0; --fd)
     {
       if (fd_callback_info[fd].flags != 0)
@@ -542,6 +537,7 @@ recompute_max_desc (void)
          break;
        }
     }
+  eassert (max_desc < FD_SETSIZE);
 }
 
 /* Stop monitoring file descriptor FD for when write is possible.  */
@@ -549,6 +545,7 @@ recompute_max_desc (void)
 void
 delete_write_fd (int fd)
 {
+  eassert (0 <= fd && fd < FD_SETSIZE);
   if ((fd_callback_info[fd].flags & NON_BLOCKING_CONNECT_FD) != 0)
     {
       if (--num_pending_connects < 0)
@@ -571,6 +568,7 @@ compute_input_wait_mask (fd_set *mask)
   int fd;
 
   FD_ZERO (mask);
+  eassert (max_desc < FD_SETSIZE);
   for (fd = 0; fd <= max_desc; ++fd)
     {
       if (fd_callback_info[fd].thread != NULL
@@ -593,6 +591,7 @@ compute_non_process_wait_mask (fd_set *mask)
   int fd;
 
   FD_ZERO (mask);
+  eassert (max_desc < FD_SETSIZE);
   for (fd = 0; fd <= max_desc; ++fd)
     {
       if (fd_callback_info[fd].thread != NULL
@@ -616,6 +615,7 @@ compute_non_keyboard_wait_mask (fd_set *mask)
   int fd;
 
   FD_ZERO (mask);
+  eassert (max_desc < FD_SETSIZE);
   for (fd = 0; fd <= max_desc; ++fd)
     {
       if (fd_callback_info[fd].thread != NULL
@@ -639,6 +639,7 @@ compute_write_mask (fd_set *mask)
   int fd;
 
   FD_ZERO (mask);
+  eassert (max_desc < FD_SETSIZE);
   for (fd = 0; fd <= max_desc; ++fd)
     {
       if (fd_callback_info[fd].thread != NULL
@@ -660,6 +661,7 @@ clear_waiting_thread_info (void)
 {
   int fd;
 
+  eassert (max_desc < FD_SETSIZE);
   for (fd = 0; fd <= max_desc; ++fd)
     {
       if (fd_callback_info[fd].waiting_thread == current_thread)
@@ -936,8 +938,10 @@ update_processes_for_thread_death (Lisp_Object 
dying_thread)
          struct Lisp_Process *proc = XPROCESS (process);
 
          pset_thread (proc, Qnil);
+         eassert (proc->infd < FD_SETSIZE);
          if (proc->infd >= 0)
            fd_callback_info[proc->infd].thread = NULL;
+         eassert (proc->outfd < FD_SETSIZE);
          if (proc->outfd >= 0)
            fd_callback_info[proc->outfd].thread = NULL;
        }
@@ -1378,8 +1382,10 @@ If THREAD is nil, the process is unlocked.  */)
 
   proc = XPROCESS (process);
   pset_thread (proc, thread);
+  eassert (proc->infd < FD_SETSIZE);
   if (proc->infd >= 0)
     fd_callback_info[proc->infd].thread = tstate;
+  eassert (proc->outfd < FD_SETSIZE);
   if (proc->outfd >= 0)
     fd_callback_info[proc->outfd].thread = tstate;
 
@@ -1731,7 +1737,7 @@ usage: (make-process &rest ARGS)  */)
 
   buffer = Fplist_get (contact, QCbuffer);
   if (!NILP (buffer))
-    buffer = Fget_buffer_create (buffer);
+    buffer = Fget_buffer_create (buffer, Qnil);
 
   /* Make sure that the child will be able to chdir to the current
      buffer's current directory, or its unhandled equivalent.  We
@@ -1768,7 +1774,7 @@ usage: (make-process &rest ARGS)  */)
                          QCname,
                          concat2 (name, build_string (" stderr")),
                          QCbuffer,
-                         Fget_buffer_create (xstderr),
+                         Fget_buffer_create (xstderr, Qnil),
                          QCnoquery,
                          query_on_exit ? Qnil : Qt);
     }
@@ -2047,13 +2053,12 @@ create_process (Lisp_Object process, char **new_argv, 
Lisp_Object current_dir)
 {
   struct Lisp_Process *p = XPROCESS (process);
   int inchannel, outchannel;
-  pid_t pid;
+  pid_t pid = -1;
   int vfork_errno;
   int forkin, forkout, forkerr = -1;
   bool pty_flag = 0;
   char pty_name[PTY_NAME_SIZE];
   Lisp_Object lisp_pty_name = Qnil;
-  sigset_t oldset;
 
   inchannel = outchannel = -1;
 
@@ -2100,6 +2105,9 @@ create_process (Lisp_Object process, char **new_argv, 
Lisp_Object current_dir)
        }
     }
 
+  if (FD_SETSIZE <= inchannel || FD_SETSIZE <= outchannel)
+    report_file_errno ("Creating pipe", Qnil, EMFILE);
+
 #ifndef WINDOWSNT
   if (emacs_pipe (p->open_fd + READ_FROM_EXEC_MONITOR) != 0)
     report_file_error ("Creating pipe", Qnil);
@@ -2109,6 +2117,7 @@ create_process (Lisp_Object process, char **new_argv, 
Lisp_Object current_dir)
   fcntl (outchannel, F_SETFL, O_NONBLOCK);
 
   /* Record this as an active process, with its channels.  */
+  eassert (0 <= inchannel && inchannel < FD_SETSIZE);
   chan_process[inchannel] = process;
   p->infd = inchannel;
   p->outfd = outchannel;
@@ -2124,152 +2133,28 @@ create_process (Lisp_Object process, char **new_argv, 
Lisp_Object current_dir)
   if (!EQ (p->command, Qt))
     add_process_read_fd (inchannel);
 
+  ptrdiff_t count = SPECPDL_INDEX ();
+
   /* This may signal an error.  */
   setup_process_coding_systems (process);
-
-  block_input ();
-  block_child_signal (&oldset);
-
-#ifndef WINDOWSNT
-  /* vfork, and prevent local vars from being clobbered by the vfork.  */
-  Lisp_Object volatile current_dir_volatile = current_dir;
-  Lisp_Object volatile lisp_pty_name_volatile = lisp_pty_name;
-  char **volatile new_argv_volatile = new_argv;
-  int volatile forkin_volatile = forkin;
-  int volatile forkout_volatile = forkout;
-  int volatile forkerr_volatile = forkerr;
-  struct Lisp_Process *p_volatile = p;
-
-#ifdef DARWIN_OS
-  /* Darwin doesn't let us run setsid after a vfork, so use fork when
-     necessary.  Also, reset SIGCHLD handling after a vfork, as
-     apparently macOS can mistakenly deliver SIGCHLD to the child.  */
-  if (pty_flag)
-    pid = fork ();
-  else
-    {
-      pid = vfork ();
-      if (pid == 0)
-       signal (SIGCHLD, SIG_DFL);
-    }
-#else
-  pid = vfork ();
-#endif
-
-  current_dir = current_dir_volatile;
-  lisp_pty_name = lisp_pty_name_volatile;
-  new_argv = new_argv_volatile;
-  forkin = forkin_volatile;
-  forkout = forkout_volatile;
-  forkerr = forkerr_volatile;
-  p = p_volatile;
+  char **env = make_environment_block (current_dir);
 
   pty_flag = p->pty_flag;
+  eassert (pty_flag == ! NILP (lisp_pty_name));
 
-  if (pid == 0)
-#endif /* not WINDOWSNT */
-    {
-      /* Make the pty be the controlling terminal of the process.  */
-#ifdef HAVE_PTYS
-      dissociate_controlling_tty ();
-
-      /* Make the pty's terminal the controlling terminal.  */
-      if (pty_flag && forkin >= 0)
-       {
-#ifdef TIOCSCTTY
-         /* We ignore the return value
-            because faith@cs.unc.edu says that is necessary on Linux.  */
-         ioctl (forkin, TIOCSCTTY, 0);
-#endif
-       }
-#if defined (LDISC1)
-      if (pty_flag && forkin >= 0)
-       {
-         struct termios t;
-         tcgetattr (forkin, &t);
-         t.c_lflag = LDISC1;
-         if (tcsetattr (forkin, TCSANOW, &t) < 0)
-           emacs_perror ("create_process/tcsetattr LDISC1");
-       }
-#else
-#if defined (NTTYDISC) && defined (TIOCSETD)
-      if (pty_flag && forkin >= 0)
-       {
-         /* Use new line discipline.  */
-         int ldisc = NTTYDISC;
-         ioctl (forkin, TIOCSETD, &ldisc);
-       }
-#endif
-#endif
-
-#if !defined (DONT_REOPEN_PTY)
-/*** There is a suggestion that this ought to be a
-     conditional on TIOCSPGRP, or !defined TIOCSCTTY.
-     Trying the latter gave the wrong results on Debian GNU/Linux 1.1;
-     that system does seem to need this code, even though
-     both TIOCSCTTY is defined.  */
-       /* Now close the pty (if we had it open) and reopen it.
-          This makes the pty the controlling terminal of the subprocess.  */
-      if (pty_flag)
-       {
-
-         /* I wonder if emacs_close (emacs_open (SSDATA (lisp_pty_name), ...))
-            would work?  */
-         if (forkin >= 0)
-           emacs_close (forkin);
-         forkout = forkin = emacs_open (SSDATA (lisp_pty_name), O_RDWR, 0);
+  vfork_errno
+    = emacs_spawn (&pid, forkin, forkout, forkerr, new_argv, env,
+                   SSDATA (current_dir),
+                   pty_flag ? SSDATA (lisp_pty_name) : NULL);
 
-         if (forkin < 0)
-           {
-             emacs_perror (SSDATA (lisp_pty_name));
-             _exit (EXIT_CANCELED);
-           }
+  eassert ((vfork_errno == 0) == (0 < pid));
 
-       }
-#endif /* not DONT_REOPEN_PTY */
-
-#ifdef SETUP_SLAVE_PTY
-      if (pty_flag)
-       {
-         SETUP_SLAVE_PTY;
-       }
-#endif /* SETUP_SLAVE_PTY */
-#endif /* HAVE_PTYS */
-
-      signal (SIGINT, SIG_DFL);
-      signal (SIGQUIT, SIG_DFL);
-#ifdef SIGPROF
-      signal (SIGPROF, SIG_DFL);
-#endif
-
-      /* Emacs ignores SIGPIPE, but the child should not.  */
-      signal (SIGPIPE, SIG_DFL);
-
-      /* Stop blocking SIGCHLD in the child.  */
-      unblock_child_signal (&oldset);
-
-      if (pty_flag)
-       child_setup_tty (forkout);
-
-      if (forkerr < 0)
-       forkerr = forkout;
-#ifdef WINDOWSNT
-      pid = child_setup (forkin, forkout, forkerr, new_argv, 1, current_dir);
-#else  /* not WINDOWSNT */
-      child_setup (forkin, forkout, forkerr, new_argv, 1, current_dir);
-#endif /* not WINDOWSNT */
-    }
-
-  /* Back in the parent process.  */
-
-  vfork_errno = errno;
   p->pid = pid;
   if (pid >= 0)
     p->alive = 1;
 
-  /* Stop blocking in the parent.  */
-  unblock_child_signal (&oldset);
-  unblock_input ();
+  /* Environment block no longer needed.  */
+  unbind_to (count, Qnil);
 
   if (pid < 0)
     report_file_errno (CHILD_SETUP_ERROR_DESC, Qnil, vfork_errno);
@@ -2319,6 +2204,8 @@ create_pty (Lisp_Object process)
   if (pty_fd >= 0)
     {
       p->open_fd[SUBPROCESS_STDIN] = pty_fd;
+      if (FD_SETSIZE <= pty_fd)
+       report_file_errno ("Opening pty", Qnil, EMFILE);
 #if ! defined (USG) || defined (USG_SUBTTY_WORKS)
       /* On most USG systems it does not work to open the pty's tty here,
         then close it and reopen it in the child.  */
@@ -2340,6 +2227,7 @@ create_pty (Lisp_Object process)
 
       /* Record this as an active process, with its channels.
         As a result, child_setup will close Emacs's side of the pipes.  */
+      eassert (0 <= pty_fd && pty_fd < FD_SETSIZE);
       chan_process[pty_fd] = process;
       p->infd = pty_fd;
       p->outfd = pty_fd;
@@ -2425,6 +2313,9 @@ usage:  (make-pipe-process &rest ARGS)  */)
   outchannel = p->open_fd[WRITE_TO_SUBPROCESS];
   inchannel = p->open_fd[READ_FROM_SUBPROCESS];
 
+  if (FD_SETSIZE <= inchannel || FD_SETSIZE <= outchannel)
+    report_file_errno ("Creating pipe", Qnil, EMFILE);
+
   fcntl (inchannel, F_SETFL, O_NONBLOCK);
   fcntl (outchannel, F_SETFL, O_NONBLOCK);
 
@@ -2433,6 +2324,7 @@ usage:  (make-pipe-process &rest ARGS)  */)
 #endif
 
   /* Record this as an active process, with its channels.  */
+  eassert (0 <= inchannel && inchannel < FD_SETSIZE);
   chan_process[inchannel] = proc;
   p->infd = inchannel;
   p->outfd = outchannel;
@@ -2443,7 +2335,7 @@ usage:  (make-pipe-process &rest ARGS)  */)
   buffer = Fplist_get (contact, QCbuffer);
   if (NILP (buffer))
     buffer = name;
-  buffer = Fget_buffer_create (buffer);
+  buffer = Fget_buffer_create (buffer, Qnil);
   pset_buffer (p, buffer);
 
   pset_childp (p, contact);
@@ -2762,6 +2654,7 @@ set up yet, this function will block until socket setup 
has completed.  */)
     return Qnil;
 
   channel = XPROCESS (process)->infd;
+  eassert (0 <= channel && channel < FD_SETSIZE);
   return conv_sockaddr_to_lisp (datagram_address[channel].sa,
                                datagram_address[channel].len);
 }
@@ -2790,6 +2683,7 @@ set up yet, this function will block until socket setup 
has completed.  */)
   channel = XPROCESS (process)->infd;
 
   len = get_lisp_to_sockaddr_size (address, &family);
+  eassert (0 <= channel && channel < FD_SETSIZE);
   if (len == 0 || datagram_address[channel].len != len)
     return Qnil;
   conv_lisp_to_sockaddr (family, address, datagram_address[channel].sa, len);
@@ -3164,16 +3058,19 @@ usage:  (make-serial-process &rest ARGS)  */)
 
   fd = serial_open (port);
   p->open_fd[SUBPROCESS_STDIN] = fd;
+  if (FD_SETSIZE <= fd)
+    report_file_errno ("Opening serial port", port, EMFILE);
   p->infd = fd;
   p->outfd = fd;
   if (fd > max_desc)
     max_desc = fd;
+  eassert (0 <= fd && fd < FD_SETSIZE);
   chan_process[fd] = proc;
 
   buffer = Fplist_get (contact, QCbuffer);
   if (NILP (buffer))
     buffer = name;
-  buffer = Fget_buffer_create (buffer);
+  buffer = Fget_buffer_create (buffer, Qnil);
   pset_buffer (p, buffer);
 
   pset_childp (p, contact);
@@ -3338,6 +3235,7 @@ finish_after_tls_connection (Lisp_Object proc)
                    Fplist_get (contact, QChost),
                    Fplist_get (contact, QCservice));
 
+  eassert (p->outfd < FD_SETSIZE);
   if (NILP (result))
     {
       pset_status (p, list2 (Qfailed,
@@ -3383,6 +3281,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object 
addrinfos,
   if (!NILP (use_external_socket_p))
     {
       socket_to_use = external_sock_fd;
+      eassert (socket_to_use < FD_SETSIZE);
 
       /* Ensure we don't consume the external socket twice.  */
       external_sock_fd = -1;
@@ -3424,6 +3323,14 @@ connect_network_socket (Lisp_Object proc, Lisp_Object 
addrinfos,
              xerrno = errno;
              continue;
            }
+         /* Reject file descriptors that would be too large.  */
+         if (FD_SETSIZE <= s)
+           {
+             emacs_close (s);
+             s = -1;
+             xerrno = EMFILE;
+             continue;
+           }
        }
 
       if (p->is_non_blocking_client && ! (SOCK_NONBLOCK && socket_to_use < 0))
@@ -3588,6 +3495,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object 
addrinfos,
 #ifdef DATAGRAM_SOCKETS
       if (p->socktype == SOCK_DGRAM)
        {
+         eassert (0 <= s && s < FD_SETSIZE);
          if (datagram_address[s].sa)
            emacs_abort ();
 
@@ -3652,6 +3560,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object 
addrinfos,
   inch = s;
   outch = s;
 
+  eassert (0 <= inch && inch < FD_SETSIZE);
   chan_process[inch] = proc;
 
   fcntl (inch, F_SETFL, O_NONBLOCK);
@@ -3678,6 +3587,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object 
addrinfos,
       if (! (connecting_status (p->status)
             && EQ (XCDR (p->status), addrinfos)))
        pset_status (p, Fcons (Qconnect, addrinfos));
+      eassert (0 <= inch && inch < FD_SETSIZE);
       if ((fd_callback_info[inch].flags & NON_BLOCKING_CONNECT_FD) == 0)
        add_non_blocking_write_fd (inch);
     }
@@ -4188,7 +4098,7 @@ usage: (make-network-process &rest ARGS)  */)
  open_socket:
 
   if (!NILP (buffer))
-    buffer = Fget_buffer_create (buffer);
+    buffer = Fget_buffer_create (buffer, Qnil);
 
   /* Unwind bind_polling_period.  */
   unbind_to (count, Qnil);
@@ -4637,6 +4547,12 @@ network_lookup_address_info_1 (Lisp_Object host, const 
char *service,
   if (STRING_MULTIBYTE (host) && SBYTES (host) != SCHARS (host))
     error ("Non-ASCII hostname %s detected, please use puny-encode-domain",
            SSDATA (host));
+
+#ifdef WINDOWSNT
+  /* Ensure socket support is loaded if available.  */
+  init_winsock (TRUE);
+#endif
+
   ret = getaddrinfo (SSDATA (host), service, hints, res);
   if (ret)
     {
@@ -4662,12 +4578,13 @@ network_lookup_address_info_1 (Lisp_Object host, const 
char *service,
 
 DEFUN ("network-lookup-address-info", Fnetwork_lookup_address_info,
        Snetwork_lookup_address_info, 1, 2, 0,
-       doc: /* Look up ip address info of NAME.
+       doc: /* Look up Internet Protocol (IP) address info of NAME.
 Optional parameter FAMILY controls whether to look up IPv4 or IPv6
 addresses.  The default of nil means both, symbol `ipv4' means IPv4
 only, symbol `ipv6' means IPv6 only.  Returns a list of addresses, or
 nil if none were found.  Each address is a vector of integers, as per
-the description of ADDRESS in `make-network-process'.  */)
+the description of ADDRESS in `make-network-process'.  In case of
+error displays the error message.  */)
      (Lisp_Object name, Lisp_Object family)
 {
   Lisp_Object addresses = Qnil;
@@ -4739,6 +4656,7 @@ deactivate_process (Lisp_Object proc)
     close_process_fd (&p->open_fd[i]);
 
   inchannel = p->infd;
+  eassert (inchannel < FD_SETSIZE);
   if (inchannel >= 0)
     {
       p->infd  = -1;
@@ -4875,6 +4793,13 @@ server_accept_connection (Lisp_Object server, int 
channel)
 
   s = accept4 (channel, &saddr.sa, &len, SOCK_CLOEXEC);
 
+  if (FD_SETSIZE <= s)
+    {
+      emacs_close (s);
+      s = -1;
+      errno = EMFILE;
+    }
+
   if (s < 0)
     {
       int code = errno;
@@ -4961,7 +4886,7 @@ server_accept_connection (Lisp_Object server, int channel)
       if (!NILP (buffer))
        {
          args[1] = buffer;
-         buffer = Fget_buffer_create (Fformat (nargs, args));
+         buffer = Fget_buffer_create (Fformat (nargs, args), Qnil);
        }
     }
 
@@ -4972,6 +4897,7 @@ server_accept_connection (Lisp_Object server, int channel)
   Lisp_Object name = Fformat (nargs, args);
   Lisp_Object proc = make_process (name);
 
+  eassert (0 <= s && s < FD_SETSIZE);
   chan_process[s] = proc;
 
   fcntl (s, F_SETFL, O_NONBLOCK);
@@ -5251,6 +5177,8 @@ wait_reading_process_output (intmax_t time_limit, int 
nsecs, int read_kbd,
       if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
        break;
 
+      eassert (max_desc < FD_SETSIZE);
+
 #if defined HAVE_GETADDRINFO_A || defined HAVE_GNUTLS
       {
        Lisp_Object process_list_head, aproc;
@@ -5328,19 +5256,9 @@ wait_reading_process_output (intmax_t time_limit, int 
nsecs, int read_kbd,
          do
            {
              unsigned old_timers_run = timers_run;
-             struct buffer *old_buffer = current_buffer;
-             Lisp_Object old_window = selected_window;
 
              timer_delay = timer_check ();
 
-             /* If a timer has run, this might have changed buffers
-                an alike.  Make read_key_sequence aware of that.  */
-             if (timers_run != old_timers_run
-                 && (old_buffer != current_buffer
-                     || !EQ (old_window, selected_window))
-                 && waiting_for_user_input_p == -1)
-               record_asynch_buffer_change ();
-
              if (timers_run != old_timers_run && do_display)
                /* We must retry, since a timer may have requeued itself
                   and that could alter the time_delay.  */
@@ -5694,9 +5612,6 @@ wait_reading_process_output (intmax_t time_limit, int 
nsecs, int read_kbd,
 
       if (read_kbd != 0)
        {
-         unsigned old_timers_run = timers_run;
-         struct buffer *old_buffer = current_buffer;
-         Lisp_Object old_window = selected_window;
          bool leave = false;
 
          if (detect_input_pending_run_timers (do_display))
@@ -5706,14 +5621,6 @@ wait_reading_process_output (intmax_t time_limit, int 
nsecs, int read_kbd,
                leave = true;
            }
 
-         /* If a timer has run, this might have changed buffers
-            an alike.  Make read_key_sequence aware of that.  */
-         if (timers_run != old_timers_run
-             && waiting_for_user_input_p == -1
-             && (old_buffer != current_buffer
-             || !EQ (old_window, selected_window)))
-           record_asynch_buffer_change ();
-
          if (leave)
            break;
        }
@@ -6015,6 +5922,7 @@ read_process_output (Lisp_Object proc, int channel)
 {
   ssize_t nbytes;
   struct Lisp_Process *p = XPROCESS (proc);
+  eassert (0 <= channel && channel < FD_SETSIZE);
   struct coding_system *coding = proc_decode_coding_system[channel];
   int carryover = p->decoding_carryover;
   ptrdiff_t readmax = clip_to_bounds (1, read_process_output_max, PTRDIFF_MAX);
@@ -6179,6 +6087,7 @@ read_and_dispose_of_process_output (struct Lisp_Process 
*p, char *chars,
         proc_encode_coding_system[p->outfd] surely points to a
         valid memory because p->outfd will be changed once EOF is
         sent to the process.  */
+      eassert (p->outfd < FD_SETSIZE);
       if (NILP (p->encode_coding_system) && p->outfd >= 0
          && proc_encode_coding_system[p->outfd])
        {
@@ -6213,18 +6122,6 @@ read_and_dispose_of_process_output (struct Lisp_Process 
*p, char *chars,
   /* Restore waiting_for_user_input_p as it was
      when we were called, in case the filter clobbered it.  */
   waiting_for_user_input_p = waiting;
-
-#if 0 /* Call record_asynch_buffer_change unconditionally,
-        because we might have changed minor modes or other things
-        that affect key bindings.  */
-  if (! EQ (Fcurrent_buffer (), obuffer)
-      || ! EQ (current_buffer->keymap, okeymap))
-#endif
-    /* But do it only if the caller is actually going to read events.
-       Otherwise there's no need to make him wake up, and it could
-       cause trouble (for example it would make sit_for return).  */
-    if (waiting_for_user_input_p == -1)
-      record_asynch_buffer_change ();
 }
 
 DEFUN ("internal-default-process-filter", Finternal_default_process_filter,
@@ -6430,6 +6327,7 @@ send_process (Lisp_Object proc, const char *buf, 
ptrdiff_t len,
   if (p->outfd < 0)
     error ("Output file descriptor of %s is closed", SDATA (p->name));
 
+  eassert (p->outfd < FD_SETSIZE);
   coding = proc_encode_coding_system[p->outfd];
   Vlast_coding_system_used = CODING_ID_NAME (coding->id);
 
@@ -6539,6 +6437,7 @@ send_process (Lisp_Object proc, const char *buf, 
ptrdiff_t len,
          /* Send this batch, using one or more write calls.  */
          ptrdiff_t written = 0;
          int outfd = p->outfd;
+         eassert (0 <= outfd && outfd < FD_SETSIZE);
 #ifdef DATAGRAM_SOCKETS
          if (DATAGRAM_CHAN_P (outfd))
            {
@@ -6989,6 +6888,7 @@ traffic.  */)
       struct Lisp_Process *p;
 
       p = XPROCESS (process);
+      eassert (p->infd < FD_SETSIZE);
       if (EQ (p->command, Qt)
          && p->infd >= 0
          && (!EQ (p->filter, Qt) || EQ (p->status, Qlisten)))
@@ -7116,6 +7016,7 @@ process has been transmitted to the serial port.  */)
 
 
   outfd = XPROCESS (proc)->outfd;
+  eassert (outfd < FD_SETSIZE);
   if (outfd >= 0)
     coding = proc_encode_coding_system[outfd];
 
@@ -7163,11 +7064,13 @@ process has been transmitted to the serial port.  */)
       p->open_fd[WRITE_TO_SUBPROCESS] = new_outfd;
       p->outfd = new_outfd;
 
+      eassert (0 <= new_outfd && new_outfd < FD_SETSIZE);
       if (!proc_encode_coding_system[new_outfd])
        proc_encode_coding_system[new_outfd]
          = xmalloc (sizeof (struct coding_system));
       if (old_outfd >= 0)
        {
+         eassert (old_outfd < FD_SETSIZE);
          *proc_encode_coding_system[new_outfd]
            = *proc_encode_coding_system[old_outfd];
          memset (proc_encode_coding_system[old_outfd], 0,
@@ -7390,16 +7293,6 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
      when we were called, in case the filter clobbered it.  */
   waiting_for_user_input_p = waiting;
 
-#if 0
-  if (! EQ (Fcurrent_buffer (), obuffer)
-      || ! EQ (current_buffer->keymap, okeymap))
-#endif
-    /* But do it only if the caller is actually going to read events.
-       Otherwise there's no need to make him wake up, and it could
-       cause trouble (for example it would make sit_for return).  */
-    if (waiting_for_user_input_p == -1)
-      record_asynch_buffer_change ();
-
   unbind_to (count, Qnil);
 }
 
@@ -7626,6 +7519,7 @@ DEFUN ("process-filter-multibyte-p", 
Fprocess_filter_multibyte_p,
   struct Lisp_Process *p = XPROCESS (process);
   if (p->infd < 0)
     return Qnil;
+  eassert (p->infd < FD_SETSIZE);
   struct coding_system *coding = proc_decode_coding_system[p->infd];
   return (CODING_FOR_UNIBYTE (coding) ? Qnil : Qt);
 }
@@ -7659,6 +7553,7 @@ keyboard_bit_set (fd_set *mask)
 {
   int fd;
 
+  eassert (max_desc < FD_SETSIZE);
   for (fd = 0; fd <= max_desc; fd++)
     if (FD_ISSET (fd, mask)
        && ((fd_callback_info[fd].flags & (FOR_READ | KEYBOARD_FD))
@@ -7906,6 +7801,7 @@ wait_reading_process_output (intmax_t time_limit, int 
nsecs, int read_kbd,
 void
 add_timer_wait_descriptor (int fd)
 {
+  eassert (0 <= fd && fd < FD_SETSIZE);
   add_read_fd (fd, timerfd_callback, NULL);
   fd_callback_info[fd].flags &= ~KEYBOARD_FD;
 }
@@ -7968,6 +7864,7 @@ setup_process_coding_systems (Lisp_Object process)
   if (inch < 0 || outch < 0)
     return;
 
+  eassert (0 <= inch && inch < FD_SETSIZE);
   if (!proc_decode_coding_system[inch])
     proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system));
   coding_system = p->decode_coding_system;
@@ -7979,6 +7876,7 @@ setup_process_coding_systems (Lisp_Object process)
     }
   setup_coding_system (coding_system, proc_decode_coding_system[inch]);
 
+  eassert (0 <= outch && outch < FD_SETSIZE);
   if (!proc_encode_coding_system[outch])
     proc_encode_coding_system[outch] = xmalloc (sizeof (struct coding_system));
   setup_coding_system (p->encode_coding_system,
diff --git a/src/process.h b/src/process.h
index a783a31..d041ada 100644
--- a/src/process.h
+++ b/src/process.h
@@ -1,5 +1,5 @@
 /* Definitions for asynchronous process control in GNU Emacs.
-   Copyright (C) 1985, 1994, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1994, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/profiler.c b/src/profiler.c
index 9d2e828..21ae244 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -1,6 +1,6 @@
 /* Profiler implementation.
 
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
+Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/puresize.h b/src/puresize.h
index 7611f6e..811d0b4 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -1,5 +1,5 @@
 /* How much read-only Lisp storage a dumped Emacs needs.
-   Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/ralloc.c b/src/ralloc.c
index a7cac13..0268926 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -1,5 +1,5 @@
 /* Block-relocating memory allocator.
-   Copyright (C) 1993, 1995, 2000-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1995, 2000-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 971a5f6..8350e54 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -1,6 +1,6 @@
 /* Emacs regular expression matching and search
 
-   Copyright (C) 1993-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -3575,9 +3575,11 @@ skip_noops (re_char *p, re_char *pend)
    opcode.  When the function finishes, *PP will be advanced past that opcode.
    C is character to test (possibly after translations) and CORIG is original
    character (i.e. without any translations).  UNIBYTE denotes whether c is
-   unibyte or multibyte character. */
+   unibyte or multibyte character.
+   CANON_TABLE is the canonicalisation table for case folding or Qnil.  */
 static bool
-execute_charset (re_char **pp, int c, int corig, bool unibyte)
+execute_charset (re_char **pp, int c, int corig, bool unibyte,
+                 Lisp_Object canon_table)
 {
   eassume (0 <= c && 0 <= corig);
   re_char *p = *pp, *rtp = NULL;
@@ -3617,11 +3619,9 @@ execute_charset (re_char **pp, int c, int corig, bool 
unibyte)
           (class_bits & BIT_BLANK && ISBLANK (c)) ||
          (class_bits & BIT_WORD  && ISWORD  (c)) ||
          ((class_bits & BIT_UPPER) &&
-          (ISUPPER (c) || (corig != c &&
-                           c == downcase (corig) && ISLOWER (c)))) ||
+          (ISUPPER (corig) || (!NILP (canon_table) && ISLOWER (corig)))) ||
          ((class_bits & BIT_LOWER) &&
-          (ISLOWER (c) || (corig != c &&
-                           c == upcase (corig) && ISUPPER(c)))) ||
+          (ISLOWER (corig) || (!NILP (canon_table) && ISUPPER (corig)))) ||
          (class_bits & BIT_PUNCT && ISPUNCT (c)) ||
          (class_bits & BIT_GRAPH && ISGRAPH (c)) ||
          (class_bits & BIT_PRINT && ISPRINT (c)))
@@ -3696,7 +3696,8 @@ mutually_exclusive_p (struct re_pattern_buffer *bufp, 
re_char *p1,
        else if ((re_opcode_t) *p1 == charset
                 || (re_opcode_t) *p1 == charset_not)
          {
-           if (!execute_charset (&p1, c, c, !multibyte || ASCII_CHAR_P (c)))
+           if (!execute_charset (&p1, c, c, !multibyte || ASCII_CHAR_P (c),
+                                  Qnil))
              {
                DEBUG_PRINT ("   No match => fast loop.\n");
                return true;
@@ -4367,7 +4368,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp,
              }
 
            p -= 1;
-           if (!execute_charset (&p, c, corig, unibyte_char))
+           if (!execute_charset (&p, c, corig, unibyte_char, translate))
              goto fail;
 
            d += len;
diff --git a/src/regex-emacs.h b/src/regex-emacs.h
index 354408b..027ab65 100644
--- a/src/regex-emacs.h
+++ b/src/regex-emacs.h
@@ -1,6 +1,6 @@
 /* Emacs regular expression API
 
-   Copyright (C) 1985, 1989-1993, 1995, 2000-2020 Free Software
+   Copyright (C) 1985, 1989-1993, 1995, 2000-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/src/region-cache.c b/src/region-cache.c
index 8362967..b75a969 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -1,6 +1,6 @@
 /* Caching facts about regions of the buffer, for optimization.
 
-Copyright (C) 1985-1989, 1993, 1995, 2001-2020 Free Software Foundation,
+Copyright (C) 1985-1989, 1993, 1995, 2001-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/region-cache.h b/src/region-cache.h
index 46e45a2..1282157 100644
--- a/src/region-cache.h
+++ b/src/region-cache.h
@@ -1,6 +1,6 @@
 /* Header file: Caching facts about regions of the buffer, for optimization.
 
-Copyright (C) 1985-1986, 1993, 1995, 2001-2020 Free Software Foundation,
+Copyright (C) 1985-1986, 1993, 1995, 2001-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/scroll.c b/src/scroll.c
index 145c256..9042888 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -1,6 +1,6 @@
 /* Calculate what line insertion or deletion to do, and do it
 
-Copyright (C) 1985-1986, 1990, 1993-1994, 2001-2020 Free Software
+Copyright (C) 1985-1986, 1990, 1993-1994, 2001-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/search.c b/src/search.c
index 50d82fd..c757bf3 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1,6 +1,6 @@
 /* String search routines for GNU Emacs.
 
-Copyright (C) 1985-1987, 1993-1994, 1997-1999, 2001-2020 Free Software
+Copyright (C) 1985-1987, 1993-1994, 1997-1999, 2001-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/sheap.c b/src/sheap.c
index 7d6429c..5401e79 100644
--- a/src/sheap.c
+++ b/src/sheap.c
@@ -1,7 +1,7 @@
 /* simulate `sbrk' with an array in .bss, for `unexec' support for Cygwin;
    complete rewrite of xemacs Cygwin `unexec' code
 
-   Copyright (C) 2004-2020 Free Software Foundation, Inc.
+   Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/sheap.h b/src/sheap.h
index 50f602a..f1004d6 100644
--- a/src/sheap.h
+++ b/src/sheap.h
@@ -1,6 +1,6 @@
 /* Static heap allocation for GNU Emacs.
 
-Copyright 2016-2020 Free Software Foundation, Inc.
+Copyright 2016-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/sound.c b/src/sound.c
index f74c476..e5f66f8 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -1,6 +1,6 @@
 /* sound.c -- sound support.
 
-Copyright (C) 1998-1999, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1998-1999, 2001-2021 Free Software Foundation, Inc.
 
 Author: Gerd Moellmann <gerd@gnu.org>
 
diff --git a/src/syntax.c b/src/syntax.c
index df07809..9fbf885 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1,5 +1,5 @@
 /* GNU Emacs routines to deal with syntax tables; also word and list parsing.
-   Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2020 Free
+   Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2021 Free
    Software Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/syntax.h b/src/syntax.h
index a2ec330..66ee139 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -1,6 +1,6 @@
 /* Declarations having to do with GNU Emacs syntax tables.
 
-Copyright (C) 1985, 1993-1994, 1997-1998, 2001-2020 Free Software
+Copyright (C) 1985, 1993-1994, 1997-1998, 2001-2021 Free Software
 Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/sysdep.c b/src/sysdep.c
index 29c88f5..6ede06b 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1,5 +1,5 @@
 /* Interfaces to system-dependent kernel and library entries.
-   Copyright (C) 1985-1988, 1993-1995, 1999-2020 Free Software
+   Copyright (C) 1985-1988, 1993-1995, 1999-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -314,33 +314,21 @@ get_current_dir_name_or_unreachable (void)
       && emacs_fstatat (AT_FDCWD, ".", &dotstat, 0) == 0
       && dotstat.st_ino == pwdstat.st_ino
       && dotstat.st_dev == pwdstat.st_dev)
-    {
-      char *buf = malloc (pwdlen + 1);
-      if (!buf)
-        return NULL;
-      return memcpy (buf, pwd, pwdlen + 1);
-    }
+    return strdup (pwd);
   else
     {
       ptrdiff_t buf_size = min (bufsize_max, 1024);
-      char *buf = malloc (buf_size);
-      if (!buf)
-        return NULL;
       for (;;)
         {
+         char *buf = malloc (buf_size);
+         if (!buf)
+           return NULL;
           if (getcwd (buf, buf_size) == buf)
            return buf;
-         int getcwd_errno = errno;
-         if (getcwd_errno != ERANGE || buf_size == bufsize_max)
-            {
-              free (buf);
-             errno = getcwd_errno;
-              return NULL;
-            }
+         free (buf);
+         if (errno != ERANGE || buf_size == bufsize_max)
+           return NULL;
          buf_size = buf_size <= bufsize_max / 2 ? 2 * buf_size : bufsize_max;
-          buf = realloc (buf, buf_size);
-          if (!buf)
-            return NULL;
         }
     }
 }
diff --git a/src/sysselect.h b/src/sysselect.h
index ecba1f3..017c02b 100644
--- a/src/sysselect.h
+++ b/src/sysselect.h
@@ -1,5 +1,5 @@
 /* sysselect.h - System-dependent definitions for the select function.
-   Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/syssignal.h b/src/syssignal.h
index a3e462b..285a3c5 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -1,6 +1,6 @@
 /* syssignal.h - System-dependent definitions for signals.
 
-Copyright (C) 1993, 1999, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1993, 1999, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/sysstdio.h b/src/sysstdio.h
index 4610192..d4df3d7 100644
--- a/src/sysstdio.h
+++ b/src/sysstdio.h
@@ -1,6 +1,6 @@
 /* Standard I/O for Emacs.
 
-Copyright 2013-2020 Free Software Foundation, Inc.
+Copyright 2013-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/systhread.c b/src/systhread.c
index ebd7552..c68853c 100644
--- a/src/systhread.c
+++ b/src/systhread.c
@@ -1,5 +1,5 @@
 /* System thread definitions
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
+Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/systhread.h b/src/systhread.h
index 73c764a..0f47d7c 100644
--- a/src/systhread.h
+++ b/src/systhread.h
@@ -1,5 +1,5 @@
 /* System thread definitions
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
+Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/systime.h b/src/systime.h
index b59a3d1..08ab5bd 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -1,5 +1,5 @@
 /* systime.h - System-dependent definitions for time manipulations.
-   Copyright (C) 1993-1994, 2002-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 2002-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/systty.h b/src/systty.h
index 43fe824..c19b4b3 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -1,5 +1,5 @@
 /* systty.h - System-dependent definitions for terminals.
-   Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/syswait.h b/src/syswait.h
index 57b0f70..42e8c40 100644
--- a/src/syswait.h
+++ b/src/syswait.h
@@ -1,5 +1,5 @@
 /* Define wait system call interface for Emacs.
-   Copyright (C) 1993-1995, 2000-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993-1995, 2000-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/term.c b/src/term.c
index fee3b55..a87f9c7 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1,5 +1,5 @@
 /* Terminal control module for terminals described by TERMCAP
-   Copyright (C) 1985-1987, 1993-1995, 1998, 2000-2020 Free Software
+   Copyright (C) 1985-1987, 1993-1995, 1998, 2000-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/termcap.c b/src/termcap.c
index 1ace4c9..227dbeb 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -1,5 +1,5 @@
 /* Work-alike for termcap, plus extra features.
-   Copyright (C) 1985-1986, 1993-1995, 2000-2008, 2011, 2013-2020 Free
+   Copyright (C) 1985-1986, 1993-1995, 2000-2008, 2011, 2013-2021 Free
    Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
diff --git a/src/termchar.h b/src/termchar.h
index c967e7d..f50c1bf 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -1,5 +1,5 @@
 /* Flags and parameters describing terminal's characteristics.
-   Copyright (C) 1985-1986, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985-1986, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/termhooks.h b/src/termhooks.h
index 44ab142..85a47c0 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -1,6 +1,6 @@
 /* Parameters and display hooks for terminal devices.
 
-Copyright (C) 1985-1986, 1993-1994, 2001-2020 Free Software Foundation,
+Copyright (C) 1985-1986, 1993-1994, 2001-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -159,7 +159,6 @@ enum event_kind
   SELECTION_REQUEST_EVENT,     /* Another X client wants a selection from us.
                                   See `struct selection_input_event'.  */
   SELECTION_CLEAR_EVENT,       /* Another X client cleared our selection.  */
-  BUFFER_SWITCH_EVENT,         /* A process filter has switched buffers.  */
   DELETE_WINDOW_EVENT,         /* An X client said "delete this window".  */
 #ifdef HAVE_NTGUI
   END_SESSION_EVENT,           /* The user is logging out or shutting down.  */
diff --git a/src/terminal.c b/src/terminal.c
index e3b666b..b83adc5 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1,5 +1,5 @@
 /* Functions related to terminal devices.
-   Copyright (C) 2005-2020 Free Software Foundation, Inc.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/terminfo.c b/src/terminfo.c
index 0765996..15aff31 100644
--- a/src/terminfo.c
+++ b/src/terminfo.c
@@ -1,5 +1,5 @@
 /* Interface from Emacs to terminfo.
-   Copyright (C) 1985-1986, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1985-1986, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/termopts.h b/src/termopts.h
index 5c5caea..0a3dfa0 100644
--- a/src/termopts.h
+++ b/src/termopts.h
@@ -1,5 +1,5 @@
 /* Flags and parameters describing user options for handling the terminal.
-   Copyright (C) 1985-1986, 1990, 2001-2020 Free Software Foundation,
+   Copyright (C) 1985-1986, 1990, 2001-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/textprop.c b/src/textprop.c
index 0876bad..d7d6a66 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1,5 +1,5 @@
 /* Interface code for dealing with text properties.
-   Copyright (C) 1993-1995, 1997, 1999-2020 Free Software Foundation,
+   Copyright (C) 1993-1995, 1997, 1999-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/thread.c b/src/thread.c
index 7ab1e6d..f74f611 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -1,5 +1,5 @@
 /* Threading code.
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
+Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/thread.h b/src/thread.h
index a09929f..cf3ce92 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -1,5 +1,5 @@
 /* Thread definitions
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
+Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -140,7 +140,6 @@ struct thread_state
      for user-input when that process-filter was called.
      waiting_for_input cannot be used as that is by definition 0 when
      lisp code is being evalled.
-     This is also used in record_asynch_buffer_change.
      For that purpose, this must be 0
      when not inside wait_reading_process_output.  */
   int m_waiting_for_user_input_p;
diff --git a/src/timefns.c b/src/timefns.c
index 4a28f70..f0e2e97 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -1,6 +1,6 @@
 /* Timestamp functions for Emacs
 
-Copyright (C) 1985-1987, 1989, 1993-2020 Free Software Foundation, Inc.
+Copyright (C) 1985-1987, 1989, 1993-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/tparam.c b/src/tparam.c
index 6afef2e..c89a9bd 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -1,5 +1,5 @@
 /* Merge parameters into a termcap entry string.
-   Copyright (C) 1985, 1987, 1993, 1995, 2000-2008, 2013-2020 Free
+   Copyright (C) 1985, 1987, 1993, 1995, 2000-2008, 2013-2021 Free
    Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
diff --git a/src/tparam.h b/src/tparam.h
index 5cab147..893c3ca 100644
--- a/src/tparam.h
+++ b/src/tparam.h
@@ -1,6 +1,6 @@
 /* Interface definitions for termcap entries.
 
-Copyright (C) 2011-2020 Free Software Foundation, Inc.
+Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/undo.c b/src/undo.c
index 0fcd8af..2db401e 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -1,5 +1,5 @@
 /* undo handling for GNU Emacs.
-   Copyright (C) 1990, 1993-1994, 2000-2020 Free Software Foundation,
+   Copyright (C) 1990, 1993-1994, 2000-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/unexaix.c b/src/unexaix.c
index 0e57b25..949750f 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -1,5 +1,5 @@
 /* Dump an executable file.
-   Copyright (C) 1985-1988, 1999, 2001-2020 Free Software Foundation,
+   Copyright (C) 1985-1988, 1999, 2001-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/unexcoff.c b/src/unexcoff.c
index 3daa9d1..c4b2f6e 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1985-1988, 1992-1994, 2001-2020 Free Software
+/* Copyright (C) 1985-1988, 1992-1994, 2001-2021 Free Software
  * Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/unexcw.c b/src/unexcw.c
index 83efbc7..7a80b05 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -1,7 +1,7 @@
 /* unexec() support for Cygwin;
    complete rewrite of xemacs Cygwin unexec() code
 
-   Copyright (C) 2004-2020 Free Software Foundation, Inc.
+   Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/unexelf.c b/src/unexelf.c
index 2506cc6..b5cded5 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1985-1988, 1990, 1992, 1999-2020 Free Software
+/* Copyright (C) 1985-1988, 1990, 1992, 1999-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 8cf68bb..f226f1b 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -1,5 +1,5 @@
 /* Dump Emacs in Mach-O format for use on macOS.
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/unexw32.c b/src/unexw32.c
index 3c0f335..1c60e3d 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -1,5 +1,5 @@
 /* unexec for GNU Emacs on Windows NT.
-   Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/vm-limit.c b/src/vm-limit.c
index 1a07ecf..b9058d0 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -1,5 +1,5 @@
 /* Functions for memory limit warnings.
-   Copyright (C) 1990, 1992, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1992, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w16select.c b/src/w16select.c
index 7593352..3723913 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -1,6 +1,6 @@
 /* 16-bit Windows Selection processing for emacs on MS-Windows
 
-Copyright (C) 1996-1997, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1996-1997, 2001-2021 Free Software Foundation, Inc.
 
 Author: Dale P. Smith <dpsm@en.com>
 
diff --git a/src/w32.c b/src/w32.c
index 5ebae32..a3c247b 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1,6 +1,6 @@
 /* Utility and Unix shadow routines for GNU Emacs on the Microsoft Windows API.
 
-Copyright (C) 1994-1995, 2000-2020 Free Software Foundation, Inc.
+Copyright (C) 1994-1995, 2000-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -8667,6 +8667,11 @@ pipe2 (int * phandles, int pipe2_flags)
        {
          _close (phandles[0]);
          _close (phandles[1]);
+         /* Since we close the handles, set them to -1, so as to
+            avoid an assertion violation if the caller then tries to
+            close the handle again (emacs_close will abort otherwise
+            if errno is EBADF).  */
+         phandles[0] = phandles[1] = -1;
          errno = EMFILE;
          rc = -1;
        }
diff --git a/src/w32.h b/src/w32.h
index 1afb8ad..3f8eb25 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -2,7 +2,7 @@
 #define EMACS_W32_H
 
 /* Support routines for the NT version of Emacs.
-   Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -216,7 +216,7 @@ extern int sys_rename_replace (char const *, char const *, 
BOOL);
 extern int pipe2 (int *, int);
 extern void register_aux_fd (int);
 
-extern void set_process_dir (char *);
+extern void set_process_dir (const char *);
 extern int sys_spawnve (int, char *, char **, char **);
 extern void register_child (pid_t, int);
 
diff --git a/src/w32common.h b/src/w32common.h
index eb7faa1..94bb457 100644
--- a/src/w32common.h
+++ b/src/w32common.h
@@ -1,5 +1,5 @@
 /* Common functions for Microsoft Windows builds of Emacs
-   Copyright (C) 2012-2020 Free Software Foundation, Inc.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32console.c b/src/w32console.c
index 72df888b..cb9e288 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -1,5 +1,5 @@
 /* Terminal hooks for GNU Emacs on the Microsoft Windows API.
-   Copyright (C) 1992, 1999, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1999, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32cygwinx.c b/src/w32cygwinx.c
index 2d72983..b58febc 100644
--- a/src/w32cygwinx.c
+++ b/src/w32cygwinx.c
@@ -1,6 +1,6 @@
 /* Common functions for the Microsoft Windows and Cygwin builds.
 
-Copyright (C) 2018-2020 Free Software Foundation, Inc.
+Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32fns.c b/src/w32fns.c
index a840f0e..c1e18ff 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1,6 +1,6 @@
 /* Graphical user interface functions for the Microsoft Windows API.
 
-Copyright (C) 1989, 1992-2020 Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -7372,7 +7372,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
 
   tip_f = XFRAME (tip_frame);
   window = FRAME_ROOT_WINDOW (tip_f);
-  tip_buf = Fget_buffer_create (tip);
+  tip_buf = Fget_buffer_create (tip, Qnil);
   /* We will mark the tip window a "pseudo-window" below, and such
      windows cannot have display margins.  */
   bset_left_margin_cols (XBUFFER (tip_buf), make_fixnum (0));
diff --git a/src/w32font.c b/src/w32font.c
index c1d5f25..6b9ab04 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -1,5 +1,5 @@
 /* Font backend for the Microsoft Windows API.
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32font.h b/src/w32font.h
index a76f8c3..cf2bf3c 100644
--- a/src/w32font.h
+++ b/src/w32font.h
@@ -1,5 +1,5 @@
 /* Shared GDI and Uniscribe Font backend declarations for the Windows API.
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32gui.h b/src/w32gui.h
index dfec1f0..d2c34bd 100644
--- a/src/w32gui.h
+++ b/src/w32gui.h
@@ -1,5 +1,5 @@
 /* Definitions and headers for communication on the Microsoft Windows API.
-   Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -46,6 +46,7 @@ extern int w32_load_image (struct frame *f, struct image *img,
                            Lisp_Object spec_file, Lisp_Object spec_data);
 extern bool w32_can_use_native_image_api (Lisp_Object);
 extern void w32_gdiplus_shutdown (void);
+extern size_t w32_image_size (Emacs_Pixmap);
 
 #define FACE_DEFAULT (~0)
 
diff --git a/src/w32heap.c b/src/w32heap.c
index a72bed6..e002f72 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -1,5 +1,5 @@
 /* Heap management routines for GNU Emacs on the Microsoft Windows API.
-   Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
    This file is part of GNU Emacs.
 
diff --git a/src/w32heap.h b/src/w32heap.h
index 5c06267..0b34f8a 100644
--- a/src/w32heap.h
+++ b/src/w32heap.h
@@ -1,5 +1,5 @@
 /* Heap management routines (including unexec) for GNU Emacs on Windows NT.
-   Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32image.c b/src/w32image.c
index 70b2eb2..cc1a6eb 100644
--- a/src/w32image.c
+++ b/src/w32image.c
@@ -1,6 +1,6 @@
 /* Implementation of MS-Windows native image API via the GDI+ library.
 
-Copyright (C) 2020 Free Software Foundation, Inc.
+Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 7023e71..1a80a00 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -1,5 +1,5 @@
 /* Input event support for Emacs on the Microsoft Windows API.
-   Copyright (C) 1992-1993, 1995, 2001-2020 Free Software Foundation,
+   Copyright (C) 1992-1993, 1995, 2001-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/w32inevt.h b/src/w32inevt.h
index 3426ac6..f009771 100644
--- a/src/w32inevt.h
+++ b/src/w32inevt.h
@@ -1,5 +1,5 @@
 /* Input routines for GNU Emacs on the Microsoft Windows API.
-   Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32menu.c b/src/w32menu.c
index da2db78..8bf0c46 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1,5 +1,5 @@
 /* Menu support for GNU Emacs on the Microsoft Windows API.
-   Copyright (C) 1986, 1988, 1993-1994, 1996, 1998-1999, 2001-2020 Free
+   Copyright (C) 1986, 1988, 1993-1994, 1996, 1998-1999, 2001-2021 Free
    Software Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/w32notify.c b/src/w32notify.c
index 0871abb..b9e9063 100644
--- a/src/w32notify.c
+++ b/src/w32notify.c
@@ -1,6 +1,6 @@
 /* Filesystem notifications support for GNU Emacs on the Microsoft Windows API.
 
-Copyright (C) 2012-2020 Free Software Foundation, Inc.
+Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 Author: Eli Zaretskii <eliz@gnu.org>
 
diff --git a/src/w32proc.c b/src/w32proc.c
index 0cf8201..2b6cb9c 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1,6 +1,6 @@
 /* Process support for GNU Emacs on the Microsoft Windows API.
 
-Copyright (C) 1992, 1995, 1999-2020 Free Software Foundation, Inc.
+Copyright (C) 1992, 1995, 1999-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -3019,9 +3019,9 @@ reset_standard_handles (int in, int out, int err, HANDLE 
handles[3])
 }
 
 void
-set_process_dir (char * dir)
+set_process_dir (const char * dir)
 {
-  process_dir = dir;
+  process_dir = (char *) dir;
 }
 
 /* To avoid problems with winsock implementations that work over dial-up
diff --git a/src/w32reg.c b/src/w32reg.c
index 9ef50af..9794162 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -1,6 +1,6 @@
 /* Emulate the X Resource Manager through the registry.
 
-Copyright (C) 1990, 1993-1994, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1990, 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 Author: Kevin Gallo
 
diff --git a/src/w32select.c b/src/w32select.c
index e754e1f..85f8e55 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -1,6 +1,6 @@
 /* Selection processing for Emacs on the Microsoft Windows API.
 
-Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 Author: Kevin Gallo
        Benjamin Riefenstahl
diff --git a/src/w32select.h b/src/w32select.h
index 2cdc519..7ed8696 100644
--- a/src/w32select.h
+++ b/src/w32select.h
@@ -1,6 +1,6 @@
 /* Selection processing for Emacs on the Microsoft W32 API.
 
-Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
+Copyright (C) 1993-1994, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32term.c b/src/w32term.c
index 23cb380..e5a8a82 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1,6 +1,6 @@
 /* Implementation of GUI terminal on the Microsoft Windows API.
 
-Copyright (C) 1989, 1993-2020 Free Software Foundation, Inc.
+Copyright (C) 1989, 1993-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -1991,6 +1991,17 @@ w32_draw_image_foreground (struct glyph_string *s)
   RestoreDC (s->hdc ,-1);
 }
 
+size_t
+w32_image_size (Emacs_Pixmap pixmap)
+{
+  BITMAP bm_info;
+  size_t rv = 0;
+
+  if (GetObject (pixmap, sizeof (BITMAP), &bm_info))
+    rv = bm_info.bmWidth * bm_info.bmHeight * bm_info.bmBitsPixel / 8;
+  return rv;
+}
+
 
 /* Draw a relief around the image glyph string S.  */
 
@@ -4847,10 +4858,6 @@ w32_read_socket (struct terminal *terminal,
                      inev.kind = DEICONIFY_EVENT;
                      XSETFRAME (inev.frame_or_window, f);
                    }
-                 else if (!NILP (Vframe_list) && !NILP (XCDR (Vframe_list)))
-                   /* Force a redisplay sooner or later to update the
-                      frame titles in case this is the second frame.  */
-                   record_asynch_buffer_change ();
                }
              else
                {
@@ -5468,12 +5475,6 @@ w32_read_socket (struct terminal *terminal,
                        inev.kind = DEICONIFY_EVENT;
                        XSETFRAME (inev.frame_or_window, f);
                      }
-                   else if (! NILP (Vframe_list)
-                            && ! NILP (XCDR (Vframe_list)))
-                     /* Force a redisplay sooner or later
-                        to update the frame titles
-                        in case this is the second frame.  */
-                     record_asynch_buffer_change ();
 
                  /* Windows can send us a SIZE_MAXIMIZED message even
                     when fullscreen is fullboth.  The following is a
@@ -5521,12 +5522,6 @@ w32_read_socket (struct terminal *terminal,
                        inev.kind = DEICONIFY_EVENT;
                        XSETFRAME (inev.frame_or_window, f);
                      }
-                   else if (! NILP (Vframe_list)
-                            && ! NILP (XCDR (Vframe_list)))
-                     /* Force a redisplay sooner or later
-                        to update the frame titles
-                        in case this is the second frame.  */
-                     record_asynch_buffer_change ();
                  }
 
                  if (EQ (get_frame_param (f, Qfullscreen), Qmaximized))
@@ -5818,9 +5813,6 @@ w32_read_socket (struct terminal *terminal,
                    SET_FRAME_GARBAGED (f);
                    DebPrint (("obscured frame %p (%s) found to be visible\n",
                               f, SDATA (f->name)));
-
-                   /* Force a redisplay sooner or later.  */
-                   record_asynch_buffer_change ();
                  }
              }
          }
diff --git a/src/w32term.h b/src/w32term.h
index 694493c..7d351df 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -1,5 +1,5 @@
 /* Definitions and headers for communication on the Microsoft Windows API.
-   Copyright (C) 1995, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 7a84b21..0df1ff2 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -1,6 +1,6 @@
 /* Font backend for the Microsoft W32 Uniscribe API.
    Windows-specific parts of the HarfBuzz font backend.
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 70cee55..712214b 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -1,5 +1,5 @@
 /* Functions taken directly from X sources for use with the Microsoft Windows 
API.
-   Copyright (C) 1989, 1992-1995, 1999, 2001-2020 Free Software
+   Copyright (C) 1989, 1992-1995, 1999, 2001-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/widget.c b/src/widget.c
index b141612..43f0307 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -1,5 +1,5 @@
 /* The emacs frame widget.
-   Copyright (C) 1992-1993, 2000-2020 Free Software Foundation, Inc.
+   Copyright (C) 1992-1993, 2000-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/widget.h b/src/widget.h
index 7ec5b63..105bc66 100644
--- a/src/widget.h
+++ b/src/widget.h
@@ -1,5 +1,5 @@
 /* The emacs frame widget public header file.
-   Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/widgetprv.h b/src/widgetprv.h
index cf7cad7..58620a0 100644
--- a/src/widgetprv.h
+++ b/src/widgetprv.h
@@ -1,5 +1,5 @@
 /* The emacs frame widget private header file.
-   Copyright (C) 1993, 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993, 2001-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/window.c b/src/window.c
index 6cd3122..ba8682e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1,6 +1,6 @@
 /* Window creation, deletion and examination for GNU Emacs.
    Does not include redisplay.
-   Copyright (C) 1985-1987, 1993-1998, 2000-2020 Free Software
+   Copyright (C) 1985-1987, 1993-1998, 2000-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -617,11 +617,12 @@ equals the special symbol `mark-for-redisplay'.
 Run `buffer-list-update-hook' unless NORECORD is non-nil.  Note that
 applications and internal routines often select a window temporarily for
 various purposes; mostly, to simplify coding.  As a rule, such
-selections should be not recorded and therefore will not pollute
+selections should not be recorded and therefore will not pollute
 `buffer-list-update-hook'.  Selections that "really count" are those
 causing a visible change in the next redisplay of WINDOW's frame and
-should be always recorded.  So if you think of running a function each
-time a window gets selected put it on `buffer-list-update-hook'.
+should always be recorded.  So if you think of running a function each
+time a window gets selected, put it on `buffer-list-update-hook' or
+`window-selection-change-functions'.
 
 Also note that the main editor command loop sets the current buffer to
 the buffer of the selected window before each command.  */)
@@ -5669,7 +5670,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, 
bool whole, bool noerror)
   if (whole)
     {
       ptrdiff_t start_pos = IT_CHARPOS (it);
-      int dy = frame_line_height;
+      int flh = frame_line_height;
       int ht = window_box_height (w);
       int nscls = sanitize_next_screen_context_lines ();
       /* In the below we divide the window box height by the frame's
@@ -5677,14 +5678,30 @@ window_scroll_pixel_based (Lisp_Object window, int n, 
bool whole, bool noerror)
         box is not an integral multiple of the line height.  This is
         important to ensure we get back to the same position when
         scrolling up, then down.  */
-      dy = n * max (dy, (ht / dy - nscls) * dy);
+      int dy = n * max (flh, (ht / flh - nscls) * flh);
+      int goal_y;
+      void *it_data;
 
       /* Note that move_it_vertically always moves the iterator to the
          start of a line.  So, if the last line doesn't have a newline,
         we would end up at the start of the line ending at ZV.  */
       if (dy <= 0)
        {
+         goal_y = it.current_y + dy;
          move_it_vertically_backward (&it, -dy);
+         /* move_it_vertically_backward above always overshoots if DY
+            cannot be reached exactly, i.e. if it falls in the middle
+            of a screen line.  But if that screen line is large
+            (e.g., a tall image), it might make more sense to
+            undershoot instead.  */
+         if (goal_y - it.current_y > 0.5 * flh)
+           {
+             it_data = bidi_shelve_cache ();
+             struct it it1 = it;
+             if (line_bottom_y (&it1) - goal_y < goal_y - it.current_y)
+               move_it_by_lines (&it, 1);
+             bidi_unshelve_cache (it_data, true);
+           }
          /* Ensure we actually do move, e.g. in case we are currently
             looking at an image that is taller that the window height.  */
          while (start_pos == IT_CHARPOS (it)
@@ -5693,8 +5710,28 @@ window_scroll_pixel_based (Lisp_Object window, int n, 
bool whole, bool noerror)
        }
       else if (dy > 0)
        {
-         move_it_to (&it, ZV, -1, it.current_y + dy, -1,
-                     MOVE_TO_POS | MOVE_TO_Y);
+         goal_y = it.current_y + dy;
+         move_it_to (&it, ZV, -1, goal_y, -1, MOVE_TO_POS | MOVE_TO_Y);
+         /* Extra precision for people who want us to preserve the
+            screen position of the cursor: effectively round DY to the
+            nearest screen line, instead of rounding to zero; the latter
+            causes point to move by one line after C-v followed by M-v,
+            if the buffer has lines of different height.  */
+         if (!NILP (Vscroll_preserve_screen_position)
+             && goal_y - it.current_y  > 0.5 * flh)
+           {
+             it_data = bidi_shelve_cache ();
+             struct it it2 = it;
+
+             move_it_by_lines (&it, 1);
+             if (it.current_y > goal_y + 0.5 * flh)
+               {
+                 it = it2;
+                 bidi_unshelve_cache (it_data, false);
+               }
+             else
+               bidi_unshelve_cache (it_data, true);
+           }
          /* Ensure we actually do move, e.g. in case we are currently
             looking at an image that is taller that the window height.  */
          while (start_pos == IT_CHARPOS (it)
@@ -7786,7 +7823,7 @@ set_window_scroll_bars (struct window *w, Lisp_Object 
width,
         if more than a single window needs to be considered, see
         redisplay_internal.  */
       if (changed)
-       windows_or_buffers_changed = 31;
+       wset_redisplay (w);
 
       return changed ? w : NULL;
     }
@@ -8206,11 +8243,17 @@ is displayed in the `mode-line' face.  */);
   DEFVAR_LISP ("scroll-preserve-screen-position",
               Vscroll_preserve_screen_position,
               doc: /* Controls if scroll commands move point to keep its 
screen position unchanged.
+
 A value of nil means point does not keep its screen position except
 at the scroll margin or window boundary respectively.
+
 A value of t means point keeps its screen position if the scroll
 command moved it vertically out of the window, e.g. when scrolling
-by full screens.
+by full screens.  If point is within `next-screen-context-lines' lines
+from the edges of the window, point will typically not keep its screen
+position when doing commands like `scroll-up-command'/`scroll-down-command'
+and the like.
+
 Any other value means point always keeps its screen position.
 Scroll commands should have the `scroll-command' property
 on their symbols to be controlled by this variable.  */);
diff --git a/src/window.h b/src/window.h
index 167d1be..1f94fc0 100644
--- a/src/window.h
+++ b/src/window.h
@@ -1,5 +1,5 @@
 /* Window definitions for GNU Emacs.
-   Copyright (C) 1985-1986, 1993, 1995, 1997-2020 Free Software
+   Copyright (C) 1985-1986, 1993, 1995, 1997-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/xdisp.c b/src/xdisp.c
index ed1d476..749893b 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1,6 +1,6 @@
 /* Display generation from window structure and buffer text.
 
-Copyright (C) 1985-1988, 1993-1995, 1997-2020 Free Software Foundation,
+Copyright (C) 1985-1988, 1993-1995, 1997-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
@@ -1114,7 +1114,8 @@ static ptrdiff_t display_count_lines (ptrdiff_t, 
ptrdiff_t, ptrdiff_t,
 static void pint2str (register char *, register int, register ptrdiff_t);
 
 static int display_string (const char *, Lisp_Object, Lisp_Object,
-                           ptrdiff_t, ptrdiff_t, struct it *, int, int, int, 
int);
+                           ptrdiff_t, ptrdiff_t, struct it *, int, int, int,
+                          int);
 static void compute_line_metrics (struct it *);
 static void run_redisplay_end_trigger_hook (struct it *);
 static bool get_overlay_strings (struct it *, ptrdiff_t);
@@ -1925,12 +1926,12 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int 
*x, int *y,
                  /* If it3_moved stays false after the 'while' loop
                     below, that means we already were at a newline
                     before the loop (e.g., the display string begins
-                    with a newline), so we don't need to (and cannot)
-                    inspect the glyphs of it3.glyph_row, because
-                    PRODUCE_GLYPHS will not produce anything for a
-                    newline, and thus it3.glyph_row stays at its
-                    stale content it got at top of the window.  */
+                    with a newline), so we don't need to return to
+                    the last position before the display string,
+                    because PRODUCE_GLYPHS will not produce anything
+                    for a newline.  */
                  bool it3_moved = false;
+                 int top_x_before_string = it3.current_x;
                  /* Finally, advance the iterator until we hit the
                     first display element whose character position is
                     CHARPOS, or until the first newline from the
@@ -1938,6 +1939,8 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int 
*x, int *y,
                     display line.  */
                  while (get_next_display_element (&it3))
                    {
+                     if (!EQ (it3.object, string))
+                       top_x_before_string = it3.current_x;
                      PRODUCE_GLYPHS (&it3);
                      if (IT_CHARPOS (it3) == charpos
                          || ITERATOR_AT_END_OF_LINE_P (&it3))
@@ -1952,32 +1955,26 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int 
*x, int *y,
                  if (!it3.line_number_produced_p)
                    {
                      if (it3.lnum_pixel_width > 0)
-                       top_x += it3.lnum_pixel_width;
+                       {
+                         top_x += it3.lnum_pixel_width;
+                         top_x_before_string += it3.lnum_pixel_width;
+                       }
                      else if (it.line_number_produced_p)
-                       top_x += it.lnum_pixel_width;
+                       {
+                         top_x += it.lnum_pixel_width;
+                         top_x_before_string += it3.lnum_pixel_width;
+                       }
                    }
                  /* Normally, we would exit the above loop because we
                     found the display element whose character
                     position is CHARPOS.  For the contingency that we
                     didn't, and stopped at the first newline from the
-                    display string, move back over the glyphs
-                    produced from the string, until we find the
-                    rightmost glyph not from the string.  */
+                    display string, reset top_x to the coordinate of
+                    the rightmost glyph not from the string.  */
                  if (it3_moved
                      && newline_in_string
                      && IT_CHARPOS (it3) != charpos && EQ (it3.object, string))
-                   {
-                     struct glyph *g = it3.glyph_row->glyphs[TEXT_AREA]
-                                       + it3.glyph_row->used[TEXT_AREA];
-
-                     while (EQ ((g - 1)->object, string))
-                       {
-                         --g;
-                         top_x -= g->pixel_width;
-                       }
-                     eassert (g < it3.glyph_row->glyphs[TEXT_AREA]
-                                   + it3.glyph_row->used[TEXT_AREA]);
-                   }
+                   top_x = top_x_before_string;
                }
            }
 
@@ -9961,7 +9958,27 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int 
to_x, int to_y, int to_vpos
                {
                  skip = skip2;
                  if (skip == MOVE_POS_MATCH_OR_ZV)
-                   reached = 7;
+                   {
+                     reached = 7;
+                     /* If the last move_it_in_display_line_to call
+                        took us away from TO_CHARPOS, back up to the
+                        previous position, as it is a better
+                        approximation of TO_CHARPOS.  (Note that we
+                        could have both positions after TO_CHARPOS or
+                        both positions before it, due to bidi
+                        reordering.)  */
+                     if (IT_CHARPOS (*it) != to_charpos
+                         && ((IT_CHARPOS (it_backup) > to_charpos)
+                             == (IT_CHARPOS (*it) > to_charpos)))
+                       {
+                         int max_ascent = it->max_ascent;
+                         int max_descent = it->max_descent;
+
+                         RESTORE_IT (it, &it_backup, backup_data);
+                         it->max_ascent = max_ascent;
+                         it->max_descent = max_descent;
+                       }
+                   }
                }
            }
          else
@@ -10305,11 +10322,22 @@ move_it_vertically_backward (struct it *it, int dy)
            move_it_vertically (it, target_y - it->current_y);
          else
            {
+             struct text_pos last_pos;
+             int last_y, last_vpos;
              do
                {
+                 last_pos = it->current.pos;
+                 last_y = it->current_y;
+                 last_vpos = it->vpos;
                  move_it_by_lines (it, 1);
                }
-             while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV);
+             while (target_y > it->current_y && IT_CHARPOS (*it) < ZV);
+             if (it->current_y > target_y)
+               {
+                 reseat (it, last_pos, true);
+                 it->current_y = last_y;
+                 it->vpos = last_vpos;
+               }
            }
        }
     }
@@ -10853,7 +10881,7 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool 
nlflag, bool multibyte)
       /* Ensure the Messages buffer exists, and switch to it.
          If we created it, set the major-mode.  */
       bool newbuffer = NILP (Fget_buffer (Vmessages_buffer_name));
-      Fset_buffer (Fget_buffer_create (Vmessages_buffer_name));
+      Fset_buffer (Fget_buffer_create (Vmessages_buffer_name, Qnil));
       if (newbuffer
          && !NILP (Ffboundp (intern ("messages-buffer-mode"))))
        call0 (intern ("messages-buffer-mode"));
@@ -11339,7 +11367,7 @@ ensure_echo_area_buffers (void)
        static char const name_fmt[] = " *Echo Area %d*";
        char name[sizeof name_fmt + INT_STRLEN_BOUND (int)];
        AUTO_STRING_WITH_LEN (lname, name, sprintf (name, name_fmt, i));
-       echo_buffer[i] = Fget_buffer_create (lname);
+       echo_buffer[i] = Fget_buffer_create (lname, Qnil);
        bset_truncate_lines (XBUFFER (echo_buffer[i]), Qnil);
        /* to force word wrap in echo area -
           it was decided to postpone this*/
@@ -11755,9 +11783,10 @@ resize_mini_window (struct window *w, bool exact_p)
     return false;
 
   /* By default, start display at the beginning.  */
-  set_marker_both (w->start, w->contents,
-                  BUF_BEGV (XBUFFER (w->contents)),
-                  BUF_BEGV_BYTE (XBUFFER (w->contents)));
+  if (redisplay_adhoc_scroll_in_resize_mini_windows)
+    set_marker_both (w->start, w->contents,
+                    BUF_BEGV (XBUFFER (w->contents)),
+                    BUF_BEGV_BYTE (XBUFFER (w->contents)));
 
   /* Nil means don't try to resize.  */
   if ((NILP (Vresize_mini_windows)
@@ -11816,27 +11845,32 @@ resize_mini_window (struct window *w, bool exact_p)
       if (height > max_height)
        {
          height = (max_height / unit) * unit;
-         init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID);
-         move_it_vertically_backward (&it, height - unit);
-         /* The following move is usually a no-op when the stuff
-            displayed in the mini-window comes entirely from buffer
-            text, but it is needed when some of it comes from overlay
-            strings, especially when there's an after-string at ZV.
-            This happens with some completion packages, like
-            icomplete, ido-vertical, etc.  With those packages, if we
-            don't force w->start to be at the beginning of a screen
-            line, important parts of the stuff in the mini-window,
-            such as user prompt, will be hidden from view.  */
-         move_it_by_lines (&it, 0);
-         start = it.current.pos;
-         /* Prevent redisplay_window from recentering, and thus from
-            overriding the window-start point we computed here.  */
-         w->start_at_line_beg = false;
+         if (redisplay_adhoc_scroll_in_resize_mini_windows)
+           {
+             init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID);
+             move_it_vertically_backward (&it, height - unit);
+              /* The following move is usually a no-op when the stuff
+                 displayed in the mini-window comes entirely from buffer
+                 text, but it is needed when some of it comes from overlay
+                 strings, especially when there's an after-string at ZV.
+                 This happens with some completion packages, like
+                 icomplete, ido-vertical, etc.  With those packages, if we
+                 don't force w->start to be at the beginning of a screen
+                 line, important parts of the stuff in the mini-window,
+                 such as user prompt, will be hidden from view.  */
+              move_it_by_lines (&it, 0);
+              start = it.current.pos;
+              /* Prevent redisplay_window from recentering, and thus from
+                 overriding the window-start point we computed here.  */
+              w->start_at_line_beg = false;
+              SET_MARKER_FROM_TEXT_POS (w->start, start);
+            }
        }
       else
-       SET_TEXT_POS (start, BEGV, BEGV_BYTE);
-
-      SET_MARKER_FROM_TEXT_POS (w->start, start);
+       {
+         SET_TEXT_POS (start, BEGV, BEGV_BYTE);
+          SET_MARKER_FROM_TEXT_POS (w->start, start);
+        }
 
       if (EQ (Vresize_mini_windows, Qgrow_only))
        {
@@ -25418,14 +25452,62 @@ display_mode_line (struct window *w, enum face_id 
face_id, Lisp_Object format)
                         format_mode_line_unwind_data (NULL, NULL,
                                                       Qnil, false));
 
-  mode_line_target = MODE_LINE_DISPLAY;
-
   /* Temporarily make frame's keyboard the current kboard so that
      kboard-local variables in the mode_line_format will get the right
      values.  */
   push_kboard (FRAME_KBOARD (it.f));
   record_unwind_save_match_data ();
-  display_mode_element (&it, 0, 0, 0, format, Qnil, false);
+
+  if (NILP (Vmode_line_compact))
+    {
+      mode_line_target = MODE_LINE_DISPLAY;
+      display_mode_element (&it, 0, 0, 0, format, Qnil, false);
+    }
+  else
+    {
+      Lisp_Object mode_string = Fformat_mode_line (format, Qnil, Qnil, Qnil);
+      if (EQ (Vmode_line_compact, Qlong)
+         && WINDOW_TOTAL_COLS (w) >= SCHARS (mode_string))
+       {
+         /* The window is wide enough; just display the mode line we
+            just computed. */
+         display_string (NULL, mode_string, Qnil,
+                         0, 0, &it, 0, 0, 0,
+                         STRING_MULTIBYTE (mode_string));
+       }
+      else
+       {
+         /* Compress the mode line. */
+         ptrdiff_t i = 0, i_byte = 0, start = 0;
+         int prev = 0;
+
+         while (i < SCHARS (mode_string))
+           {
+             int c = fetch_string_char_advance (mode_string, &i, &i_byte);
+             if (c == ' ' && prev == ' ')
+               {
+                 display_string (NULL,
+                                 Fsubstring (mode_string, make_fixnum (start),
+                                             make_fixnum (i - 1)),
+                                 Qnil, 0, 0, &it, 0, 0, 0,
+                                 STRING_MULTIBYTE (mode_string));
+                 /* Skip past the rest of the space characters. */
+                 while (c == ' ' && i < SCHARS (mode_string))
+                     c = fetch_string_char_advance (mode_string, &i, &i_byte);
+                 start = i - 1;
+               }
+             prev = c;
+           }
+
+         /* Display the final bit. */
+         if (start < i)
+           display_string (NULL,
+                           Fsubstring (mode_string, make_fixnum (start),
+                                       make_fixnum (i - 1)),
+                           Qnil, 0, 0, &it, 0, 0, 0,
+                           STRING_MULTIBYTE (mode_string));
+       }
+    }
   pop_kboard ();
 
   unbind_to (count, Qnil);
@@ -27057,6 +27139,7 @@ display_string (const char *string, Lisp_Object 
lisp_string, Lisp_Object face_st
      with index START.  */
   reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string,
                     start, precision, field_width, multibyte);
+
   if (string && STRINGP (lisp_string))
     /* LISP_STRING is the one returned by decode_mode_spec.  We should
        ignore its text properties.  */
@@ -34772,6 +34855,14 @@ wide as that tab on the display.  */);
 The face used for trailing whitespace is `trailing-whitespace'.  */);
   Vshow_trailing_whitespace = Qnil;
 
+  DEFVAR_LISP ("mode-line-compact", Vmode_line_compact,
+    doc: /* Non-nil means that mode lines should be compact.
+This means that repeating spaces will be replaced with a single space.
+If this variable is `long', only mode lines that are wider than the
+currently selected window are compressed. */);
+  Vmode_line_compact = Qnil;
+  DEFSYM (Qlong, "long");
+
   DEFVAR_LISP ("nobreak-char-display", Vnobreak_char_display,
     doc: /* Control highlighting of non-ASCII space and hyphen chars.
 If the value is t, Emacs highlights non-ASCII chars which have the
@@ -35490,7 +35581,7 @@ message displayed by its counterpart function specified 
by
 
   DEFVAR_BOOL ("display-raw-bytes-as-hex", display_raw_bytes_as_hex,
     doc: /* Non-nil means display raw bytes in hexadecimal format.
-The default is to use octal format (\200) whereas hexadecimal (\x80)
+The default is to use octal format (\\200) whereas hexadecimal (\\x80)
 may be more familiar to users.  */);
   display_raw_bytes_as_hex = false;
 
@@ -35506,6 +35597,14 @@ The initial frame is not displayed anywhere, so 
skipping it is
 best except in special circumstances such as running redisplay tests
 in batch mode.   */);
   redisplay_skip_initial_frame = true;
+
+  DEFVAR_BOOL ("redisplay-adhoc-scroll-in-resize-mini-windows",
+               redisplay_adhoc_scroll_in_resize_mini_windows,
+    doc: /* If nil always use normal scrolling in minibuffer windows.
+Otherwise, use custom-tailored code after resizing minibuffer windows to try
+and display the most important part of the minibuffer.   */);
+  /* See bug#43519 for some discussion around this.  */
+  redisplay_adhoc_scroll_in_resize_mini_windows = true;
 }
 
 
diff --git a/src/xfaces.c b/src/xfaces.c
index 73a536b..b3b19a9 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1,6 +1,6 @@
 /* xfaces.c -- "Face" primitives.
 
-Copyright (C) 1993-1994, 1998-2020 Free Software Foundation, Inc.
+Copyright (C) 1993-1994, 1998-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/xfns.c b/src/xfns.c
index 46e4bd7..9ab537c 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1,6 +1,6 @@
 /* Functions for the X Window System.
 
-Copyright (C) 1989, 1992-2020 Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -2321,24 +2321,6 @@ hack_wm_protocols (struct frame *f, Widget widget)
 static XFontSet xic_create_xfontset (struct frame *);
 static XIMStyle best_xim_style (XIMStyles *);
 
-
-/* Supported XIM styles, ordered by preference.  */
-
-static const XIMStyle supported_xim_styles[] =
-{
-  XIMPreeditPosition | XIMStatusArea,
-  XIMPreeditPosition | XIMStatusNothing,
-  XIMPreeditPosition | XIMStatusNone,
-  XIMPreeditNothing | XIMStatusArea,
-  XIMPreeditNothing | XIMStatusNothing,
-  XIMPreeditNothing | XIMStatusNone,
-  XIMPreeditNone | XIMStatusArea,
-  XIMPreeditNone | XIMStatusNothing,
-  XIMPreeditNone | XIMStatusNone,
-  0,
-};
-
-
 #if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
 /* Create an X fontset on frame F with base font name BASE_FONTNAME.  */
 
@@ -2622,15 +2604,8 @@ xic_free_xfontset (struct frame *f)
 static XIMStyle
 best_xim_style (XIMStyles *xim)
 {
-  int i, j;
-  int nr_supported = ARRAYELTS (supported_xim_styles);
-
-  for (i = 0; i < nr_supported; ++i)
-    for (j = 0; j < xim->count_styles; ++j)
-      if (supported_xim_styles[i] == xim->supported_styles[j])
-       return supported_xim_styles[i];
-
-  /* Return the default style.  */
+  /* Return the default style. This is what GTK3 uses and
+     should work fine with all modern input methods.  */
   return XIMPreeditNothing | XIMStatusNothing;
 }
 
@@ -7041,7 +7016,7 @@ Text larger than the specified size is clipped.  */)
 
   tip_f = XFRAME (tip_frame);
   window = FRAME_ROOT_WINDOW (tip_f);
-  tip_buf = Fget_buffer_create (tip);
+  tip_buf = Fget_buffer_create (tip, Qnil);
   /* We will mark the tip window a "pseudo-window" below, and such
      windows cannot have display margins.  */
   bset_left_margin_cols (XBUFFER (tip_buf), make_fixnum (0));
diff --git a/src/xfont.c b/src/xfont.c
index 32f63c3..0570ee9 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -1,5 +1,5 @@
 /* xfont.c -- X core font driver.
-   Copyright (C) 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H13PRO009
diff --git a/src/xftfont.c b/src/xftfont.c
index eb60d21..f734931 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -1,5 +1,5 @@
 /* xftfont.c -- XFT font driver.
-   Copyright (C) 2006-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H13PRO009
diff --git a/src/xgselect.c b/src/xgselect.c
index be70107..0d91d55 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -1,6 +1,6 @@
 /* Function for handling the GLib event loop.
 
-Copyright (C) 2009-2020 Free Software Foundation, Inc.
+Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/xgselect.h b/src/xgselect.h
index 512bf3a..2142a23 100644
--- a/src/xgselect.h
+++ b/src/xgselect.h
@@ -1,6 +1,6 @@
 /* Header for xg_select.
 
-Copyright (C) 2009-2020 Free Software Foundation, Inc.
+Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/xmenu.c b/src/xmenu.c
index dba7e88..ea3813a 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1,6 +1,6 @@
 /* X Communication module for terminals which understand the X protocol.
 
-Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2020 Free Software
+Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2021 Free Software
 Foundation, Inc.
 
 Author: Jon Arnold
diff --git a/src/xml.c b/src/xml.c
index d7da864..495988a 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -1,5 +1,5 @@
 /* Interface to libxml2.
-   Copyright (C) 2010-2020 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/xrdb.c b/src/xrdb.c
index 3d7f715..7d84762 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -1,5 +1,5 @@
 /* Deal with the X Resource Manager.
-   Copyright (C) 1990, 1993-1994, 2000-2020 Free Software Foundation,
+   Copyright (C) 1990, 1993-1994, 2000-2021 Free Software Foundation,
    Inc.
 
 Author: Joseph Arceneaux
diff --git a/src/xselect.c b/src/xselect.c
index 383aebf..030f624 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1,5 +1,5 @@
 /* X Selection processing for Emacs.
-   Copyright (C) 1993-1997, 2000-2020 Free Software Foundation, Inc.
+   Copyright (C) 1993-1997, 2000-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/xsettings.c b/src/xsettings.c
index 1ba1021..58dfd43 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -1,6 +1,6 @@
 /* Functions for handling font and other changes dynamically.
 
-Copyright (C) 2009-2020 Free Software Foundation, Inc.
+Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/xsettings.h b/src/xsettings.h
index f29ce77..26717fc 100644
--- a/src/xsettings.h
+++ b/src/xsettings.h
@@ -1,6 +1,6 @@
 /* Functions for handle font changes dynamically.
 
-Copyright (C) 2009-2020 Free Software Foundation, Inc.
+Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 203085e..10565a4 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -1,7 +1,7 @@
 /* Session management module for systems which understand the X Session
    management protocol.
 
-Copyright (C) 2002-2020 Free Software Foundation, Inc.
+Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/src/xterm.c b/src/xterm.c
index 0d2452d..0a86738 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1,6 +1,6 @@
 /* X Communication module for terminals which understand the X protocol.
 
-Copyright (C) 1989, 1993-2020 Free Software Foundation, Inc.
+Copyright (C) 1989, 1993-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -8383,10 +8383,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
               inev.ie.kind = DEICONIFY_EVENT;
               XSETFRAME (inev.ie.frame_or_window, f);
             }
-          else if (! NILP (Vframe_list) && ! NILP (XCDR (Vframe_list)))
-            /* Force a redisplay sooner or later to update the
-              frame titles in case this is the second frame.  */
-            record_asynch_buffer_change ();
         }
       goto OTHER;
 
@@ -8951,7 +8947,9 @@ handle_one_xevent (struct x_display_info *dpyinfo,
       if (!f
          && (f = any)
          && configureEvent.xconfigure.window == FRAME_X_WINDOW (f)
-         && FRAME_VISIBLE_P(f))
+         && (FRAME_VISIBLE_P(f)
+             || !(configureEvent.xconfigure.width <= 1
+                  && configureEvent.xconfigure.height <= 1)))
         {
           block_input ();
           if (FRAME_X_DOUBLE_BUFFERED_P (f))
@@ -8966,7 +8964,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
           f = 0;
        }
 #endif
-      if (f && FRAME_VISIBLE_P(f))
+      if (f
+         && (FRAME_VISIBLE_P(f)
+             || !(configureEvent.xconfigure.width <= 1
+                  && configureEvent.xconfigure.height <= 1)))
        {
 #ifdef USE_GTK
          /* For GTK+ don't call x_net_wm_state for the scroll bar
@@ -9705,7 +9706,7 @@ x_draw_window_cursor (struct window *w, struct glyph_row 
*glyph_row, int x,
 
 #ifdef HAVE_X_I18N
       if (w == XWINDOW (f->selected_window))
-       if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMPreeditPosition))
+       if (FRAME_XIC (f))
          xic_set_preeditarea (w, x, y);
 #endif
     }
@@ -10388,11 +10389,8 @@ xim_instantiate_callback (Display *display, XPointer 
client_data, XPointer call_
                create_frame_xic (f);
                if (FRAME_XIC_STYLE (f) & XIMStatusArea)
                  xic_set_statusarea (f);
-               if (FRAME_XIC_STYLE (f) & XIMPreeditPosition)
-                 {
-                   struct window *w = XWINDOW (f->selected_window);
-                   xic_set_preeditarea (w, w->cursor.x, w->cursor.y);
-                 }
+               struct window *w = XWINDOW (f->selected_window);
+               xic_set_preeditarea (w, w->cursor.x, w->cursor.y);
              }
        }
 
diff --git a/src/xterm.h b/src/xterm.h
index 0f8ba5e..ebc42b7 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1,5 +1,5 @@
 /* Definitions and headers for communication with X protocol.
-   Copyright (C) 1989, 1993-1994, 1998-2020 Free Software Foundation,
+   Copyright (C) 1989, 1993-1994, 1998-2021 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
diff --git a/src/xwidget.c b/src/xwidget.c
index e078a28..e4b42e6 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -1,6 +1,6 @@
 /* Support for embedding graphical components in a buffer.
 
-Copyright (C) 2011-2020 Free Software Foundation, Inc.
+Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -100,7 +100,8 @@ Returns the newly constructed xwidget, or nil if 
construction fails.  */)
   Lisp_Object val;
   xw->type = type;
   xw->title = title;
-  xw->buffer = NILP (buffer) ? Fcurrent_buffer () : Fget_buffer_create 
(buffer);
+  xw->buffer = (NILP (buffer) ? Fcurrent_buffer ()
+               : Fget_buffer_create (buffer, Qnil));
   xw->height = XFIXNAT (height);
   xw->width = XFIXNAT (width);
   xw->kill_without_query = false;
diff --git a/src/xwidget.h b/src/xwidget.h
index 40ad8ae..591f234 100644
--- a/src/xwidget.h
+++ b/src/xwidget.h
@@ -1,6 +1,6 @@
 /* Support for embedding graphical components in a buffer.
 
-Copyright (C) 2011-2020 Free Software Foundation, Inc.
+Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
diff --git a/test/ChangeLog.1 b/test/ChangeLog.1
index 2bf014d..7085b9e 100644
--- a/test/ChangeLog.1
+++ b/test/ChangeLog.1
@@ -2952,7 +2952,7 @@
 ;; coding: utf-8
 ;; End:
 
-  Copyright (C) 2008-2020 Free Software Foundation, Inc.
+  Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
diff --git a/test/Makefile.in b/test/Makefile.in
index 67d203d..8aa37ca 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 2010-2020 Free Software Foundation, Inc.
+# Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -268,6 +268,7 @@ $(test_module): $(test_module:${SO}=.c) 
../src/emacs-module.h
        $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \
          -o $@ $< $(LIBGMP) \
          $(and $(GMP_H),$(srcdir)/../lib/mini-gmp-gnulib.c) \
+         $(if $(OMIT_GNULIB_MODULE_free-posix),,$(srcdir)/../lib/free.c) \
          $(srcdir)/../lib/timespec.c $(srcdir)/../lib/gettime.c
 endif
 
diff --git a/test/README b/test/README
index d0da89d..ec566cb 100644
--- a/test/README
+++ b/test/README
@@ -1,4 +1,4 @@
-Copyright (C) 2008-2020 Free Software Foundation, Inc.
+Copyright (C) 2008-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 This directory contains files intended to test various aspects of
@@ -113,7 +113,8 @@ $EMACS_HYDRA_CI indicates the hydra environment, and 
$EMACS_EMBA_CI
 indicates the emba environment, respectively.
 
 
-(Also, see etc/compilation.txt for compilation mode font lock tests.)
+(Also, see etc/compilation.txt for compilation mode font lock tests
+and etc/grep.txt for grep mode font lock tests.)
 
 
 This file is part of GNU Emacs.
diff --git a/test/lib-src/emacsclient-tests.el 
b/test/lib-src/emacsclient-tests.el
index a502bb7..8bad9c0 100644
--- a/test/lib-src/emacsclient-tests.el
+++ b/test/lib-src/emacsclient-tests.el
@@ -1,6 +1,6 @@
 ;;; emacsclient-tests.el --- Test emacsclient  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/abbrev-tests.el b/test/lisp/abbrev-tests.el
index aaf1d4a..2a42d56 100644
--- a/test/lisp/abbrev-tests.el
+++ b/test/lisp/abbrev-tests.el
@@ -1,6 +1,6 @@
 ;;; abbrev-tests.el --- Test suite for abbrevs  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Eli Zaretskii <eliz@gnu.org>
 ;; Keywords: abbrevs
@@ -69,8 +69,9 @@
     (define-abbrev ert-test-abbrevs "sys" "system abbrev" nil :system t)
     (should (equal (mapcar #'symbol-name (abbrev--table-symbols 
'ert-test-abbrevs))
                    '("a-e-t")))
-    (should (equal (mapcar #'symbol-name (abbrev--table-symbols 
'ert-test-abbrevs t))
-                   '("a-e-t" "sys")))))
+    (let ((syms (abbrev--table-symbols 'ert-test-abbrevs t)))
+      (should (equal (sort (mapcar #'symbol-name syms) #'string<)
+                     '("a-e-t" "sys"))))))
 
 (ert-deftest abbrev-table-get-put-test ()
   (let ((table (make-abbrev-table)))
diff --git a/test/lisp/align-resources/align-post.c 
b/test/lisp/align-resources/align-post.c
new file mode 100644
index 0000000..157e1d6
--- /dev/null
+++ b/test/lisp/align-resources/align-post.c
@@ -0,0 +1,3 @@
+int
+main (int       argc,
+      char     *argv[]);
diff --git a/test/lisp/align-resources/align-post.java 
b/test/lisp/align-resources/align-post.java
new file mode 100644
index 0000000..e0ea8e7
--- /dev/null
+++ b/test/lisp/align-resources/align-post.java
@@ -0,0 +1,9 @@
+class X
+{
+    String     field1;
+    String[]   field2;
+    int                field3;
+    int[]      field4;
+    X          field5;
+    X[]                field6;
+}
diff --git a/test/lisp/align-resources/align-pre.c 
b/test/lisp/align-resources/align-pre.c
new file mode 100644
index 0000000..b177418
--- /dev/null
+++ b/test/lisp/align-resources/align-pre.c
@@ -0,0 +1,3 @@
+int
+main (int argc,
+      char *argv[]);
diff --git a/test/lisp/align-resources/align-pre.java 
b/test/lisp/align-resources/align-pre.java
new file mode 100644
index 0000000..fe7a87a
--- /dev/null
+++ b/test/lisp/align-resources/align-pre.java
@@ -0,0 +1,9 @@
+class X
+{
+    String     field1;
+    String[] field2;
+    int                field3;
+    int[] field4;
+    X          field5;
+    X[] field6;
+}
diff --git a/test/lisp/align-tests.el b/test/lisp/align-tests.el
new file mode 100644
index 0000000..a9c36e3
--- /dev/null
+++ b/test/lisp/align-tests.el
@@ -0,0 +1,47 @@
+;;; align-tests.el --- Test suite for aligns  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'ert-x)
+(require 'align)
+
+(defun test-align-compare (file function)
+  (should (equal
+           (with-temp-buffer
+             (insert-file-contents (ert-resource-file (format file "pre")))
+             (funcall function)
+             (align (point-min) (point-max))
+             (buffer-substring-no-properties (point-min) (point-max)))
+           (with-temp-buffer
+             (insert-file-contents (ert-resource-file (format file "post")))
+             (buffer-string)))))
+
+(ert-deftest align-java ()
+  (test-align-compare "align-%s.java" #'java-mode))
+
+(ert-deftest align-c ()
+  (test-align-compare "align-%s.c" #'c-mode))
+
+(provide 'align-tests)
+
+;;; align-tests.el ends here
diff --git a/test/lisp/allout-tests.el b/test/lisp/allout-tests.el
index f7cd6db..3a346fd 100644
--- a/test/lisp/allout-tests.el
+++ b/test/lisp/allout-tests.el
@@ -1,6 +1,6 @@
 ;;; allout-tests.el --- Tests for allout.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -74,7 +74,7 @@
   "Ensure that prior local value is resumed."
   (with-temp-buffer
     (allout-tests-obliterate-variable 'allout-tests-locally-true)
-    (set (make-local-variable 'allout-tests-locally-true) t)
+    (setq-local allout-tests-locally-true t)
     (cl-assert (not (default-boundp 'allout-tests-locally-true))
                nil (concat "Test setup mistake -- variable supposed to"
                            " not have global binding, but it does."))
@@ -98,7 +98,7 @@
     (allout-tests-obliterate-variable 'allout-tests-globally-true)
     (setq allout-tests-globally-true t)
     (allout-tests-obliterate-variable 'allout-tests-locally-true)
-    (set (make-local-variable 'allout-tests-locally-true) t)
+    (setq-local allout-tests-locally-true t)
     (allout-add-resumptions '(allout-tests-globally-unbound t)
                             '(allout-tests-globally-true nil)
                             '(allout-tests-locally-true nil))
@@ -135,7 +135,7 @@
     (allout-tests-obliterate-variable 'allout-tests-globally-true)
     (setq allout-tests-globally-true t)
     (allout-tests-obliterate-variable 'allout-tests-locally-true)
-    (set (make-local-variable 'allout-tests-locally-true) t)
+    (setq-local allout-tests-locally-true t)
     (allout-add-resumptions '(allout-tests-globally-unbound t)
                             '(allout-tests-globally-true nil)
                             '(allout-tests-locally-true nil))
diff --git a/test/lisp/allout-widgets-tests.el 
b/test/lisp/allout-widgets-tests.el
index 2b1bcaa..59ff678 100644
--- a/test/lisp/allout-widgets-tests.el
+++ b/test/lisp/allout-widgets-tests.el
@@ -1,6 +1,6 @@
 ;;; allout-widgets-tests.el --- Tests for allout-widgets.el  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/ansi-color-tests.el b/test/lisp/ansi-color-tests.el
index 5c3da87..107dc8e 100644
--- a/test/lisp/ansi-color-tests.el
+++ b/test/lisp/ansi-color-tests.el
@@ -1,6 +1,6 @@
 ;;; ansi-color-tests.el --- Test suite for ansi-color  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Pablo Barbáchano <pablob@amazon.com>
 ;; Keywords: ansi
diff --git a/test/lisp/apropos-tests.el b/test/lisp/apropos-tests.el
index 4c5522d..7eaa642 100644
--- a/test/lisp/apropos-tests.el
+++ b/test/lisp/apropos-tests.el
@@ -1,6 +1,6 @@
 ;;; apropos-tests.el --- Tests for apropos.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/arc-mode-tests.el b/test/lisp/arc-mode-tests.el
index e92a4d2..5c6af9b 100644
--- a/test/lisp/arc-mode-tests.el
+++ b/test/lisp/arc-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; arc-mode-tests.el --- Test suite for arc-mode. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/auth-source-pass-tests.el 
b/test/lisp/auth-source-pass-tests.el
index 677abb3..bfbef53 100644
--- a/test/lisp/auth-source-pass-tests.el
+++ b/test/lisp/auth-source-pass-tests.el
@@ -1,6 +1,6 @@
 ;;; auth-source-pass-tests.el --- Tests for auth-source-pass.el  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013, 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Damien Cassou <damien.cassou@gmail.com>
 
diff --git a/test/lisp/auth-source-tests.el b/test/lisp/auth-source-tests.el
index deb1b91..4f0d994 100644
--- a/test/lisp/auth-source-tests.el
+++ b/test/lisp/auth-source-tests.el
@@ -1,6 +1,6 @@
 ;;; auth-source-tests.el --- Tests for auth-source.el  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Damien Cassou <damien@cassou.me>,
 ;;         Nicolas Petton <nicolas@petton.fr>
diff --git a/test/lisp/autoinsert-tests.el b/test/lisp/autoinsert-tests.el
index eafa9c6..7ec4bf6 100644
--- a/test/lisp/autoinsert-tests.el
+++ b/test/lisp/autoinsert-tests.el
@@ -1,6 +1,6 @@
 ;;; autoinsert-tests.el --- Tests for autoinsert.el  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el
index 84f8700..6da515b 100644
--- a/test/lisp/autorevert-tests.el
+++ b/test/lisp/autorevert-tests.el
@@ -1,6 +1,6 @@
 ;;; auto-revert-tests.el --- Tests of auto-revert   -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
diff --git a/test/lisp/battery-tests.el b/test/lisp/battery-tests.el
index 8d7cc7f..e34d591 100644
--- a/test/lisp/battery-tests.el
+++ b/test/lisp/battery-tests.el
@@ -1,6 +1,6 @@
 ;;; battery-tests.el --- tests for battery.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/bookmark-tests.el b/test/lisp/bookmark-tests.el
index 6745e4c..9c33a27 100644
--- a/test/lisp/bookmark-tests.el
+++ b/test/lisp/bookmark-tests.el
@@ -1,6 +1,6 @@
 ;;; bookmark-tests.el --- Tests for bookmark.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/buff-menu-tests.el b/test/lisp/buff-menu-tests.el
index 7d7824b..18c9886 100644
--- a/test/lisp/buff-menu-tests.el
+++ b/test/lisp/buff-menu-tests.el
@@ -1,6 +1,6 @@
 ;;; buff-menu-tests.el --- Test suite for buff-menu.el -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Tino Calancha <tino.calancha@gmail.com>
 
diff --git a/test/lisp/button-tests.el b/test/lisp/button-tests.el
index b463366..e0944af 100644
--- a/test/lisp/button-tests.el
+++ b/test/lisp/button-tests.el
@@ -1,6 +1,6 @@
 ;;; button-tests.el --- tests for button.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el
index b59f4dc..bdcf78e 100644
--- a/test/lisp/calc/calc-tests.el
+++ b/test/lisp/calc/calc-tests.el
@@ -1,6 +1,6 @@
 ;;; calc-tests.el --- tests for calc                 -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Leo Liu <sdl.web@gmail.com>
 ;; Keywords: maint
diff --git a/test/lisp/calendar/cal-julian-tests.el 
b/test/lisp/calendar/cal-julian-tests.el
index 76118b3..db3a490 100644
--- a/test/lisp/calendar/cal-julian-tests.el
+++ b/test/lisp/calendar/cal-julian-tests.el
@@ -1,6 +1,6 @@
 ;;; cal-julian-tests.el --- tests for calendar/cal-julian.el  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/calendar/icalendar-tests.el 
b/test/lisp/calendar/icalendar-tests.el
index 8b44f63..7993a1f 100644
--- a/test/lisp/calendar/icalendar-tests.el
+++ b/test/lisp/calendar/icalendar-tests.el
@@ -1,6 +1,6 @@
 ;; icalendar-tests.el --- Test suite for icalendar.el  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2005, 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2008-2021 Free Software Foundation, Inc.
 
 ;; Author:         Ulf Jasper <ulf.jasper@web.de>
 ;; Created:        March 2005
diff --git a/test/lisp/calendar/iso8601-tests.el 
b/test/lisp/calendar/iso8601-tests.el
index c835f57..618e5b1 100644
--- a/test/lisp/calendar/iso8601-tests.el
+++ b/test/lisp/calendar/iso8601-tests.el
@@ -1,6 +1,6 @@
 ;;; iso8601-tests.el --- tests for calendar/iso8601.el    -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/calendar/lunar-tests.el 
b/test/lisp/calendar/lunar-tests.el
index d2647aa..5f1f678 100644
--- a/test/lisp/calendar/lunar-tests.el
+++ b/test/lisp/calendar/lunar-tests.el
@@ -1,6 +1,6 @@
 ;;; lunar-tests.el --- tests for calendar/lunar.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/calendar/parse-time-tests.el 
b/test/lisp/calendar/parse-time-tests.el
index e1801a5..b90fe0b 100644
--- a/test/lisp/calendar/parse-time-tests.el
+++ b/test/lisp/calendar/parse-time-tests.el
@@ -1,6 +1,6 @@
 ;; parse-time-tests.el --- Test suite for parse-time.el  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Ingebrigtsen <larsi@gnus.org>
 
diff --git a/test/lisp/calendar/solar-tests.el 
b/test/lisp/calendar/solar-tests.el
index 441beaf..7a37f8d 100644
--- a/test/lisp/calendar/solar-tests.el
+++ b/test/lisp/calendar/solar-tests.el
@@ -1,6 +1,6 @@
 ;;; solar-tests.el --- tests for solar.el            -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/calendar/time-date-tests.el 
b/test/lisp/calendar/time-date-tests.el
index 76a5641..4568947 100644
--- a/test/lisp/calendar/time-date-tests.el
+++ b/test/lisp/calendar/time-date-tests.el
@@ -1,6 +1,6 @@
 ;;; time-date-tests.el --- tests for calendar/time-date.el    -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/calendar/todo-mode-tests.el 
b/test/lisp/calendar/todo-mode-tests.el
index 6ed5512..6fa2b9d 100644
--- a/test/lisp/calendar/todo-mode-tests.el
+++ b/test/lisp/calendar/todo-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; todo-mode-tests.el --- tests for todo-mode.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Stephen Berman <stephen.berman@gmx.net>
 ;; Keywords: calendar
diff --git a/test/lisp/cedet/semantic-utest-c.el 
b/test/lisp/cedet/semantic-utest-c.el
index c776a0f..a7cbe11 100644
--- a/test/lisp/cedet/semantic-utest-c.el
+++ b/test/lisp/cedet/semantic-utest-c.el
@@ -1,6 +1,6 @@
 ;;; semantic-utest-c.el --- C based parsing tests.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/lisp/cedet/semantic-utest-fmt.el 
b/test/lisp/cedet/semantic-utest-fmt.el
index c2f2bb7..d6e5ce7 100644
--- a/test/lisp/cedet/semantic-utest-fmt.el
+++ b/test/lisp/cedet/semantic-utest-fmt.el
@@ -1,6 +1,6 @@
 ;;; cedet/semantic-utest-fmt.el --- Parsing / Formatting tests -*- 
lexical-binding:t -*-
 
-;;; Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/lisp/cedet/semantic-utest-ia.el 
b/test/lisp/cedet/semantic-utest-ia.el
index c99ef97..7210f66 100644
--- a/test/lisp/cedet/semantic-utest-ia.el
+++ b/test/lisp/cedet/semantic-utest-ia.el
@@ -1,6 +1,6 @@
 ;;; semantic-utest-ia.el --- Analyzer unit tests  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -86,6 +86,7 @@
     (should-not (semantic-ia-utest tst))))
 
 (ert-deftest semantic-utest-ia-nsp.cpp ()
+  (skip-unless (executable-find "g++"))
   (let ((tst (expand-file-name "testnsp.cpp" semantic-utest-test-directory)))
     (should (file-exists-p tst))
     (should-not (semantic-ia-utest tst))))
@@ -96,6 +97,7 @@
     (should-not (semantic-ia-utest tst))))
 
 (ert-deftest semantic-utest-ia-namespace.cpp ()
+  (skip-unless (executable-find "g++"))
   (let ((tst (expand-file-name "testnsp.cpp" semantic-utest-test-directory)))
     (should (file-exists-p tst))
     (should-not (semantic-ia-utest tst))))
diff --git a/test/lisp/cedet/semantic-utest.el 
b/test/lisp/cedet/semantic-utest.el
index bcbd7d6..c009938 100644
--- a/test/lisp/cedet/semantic-utest.el
+++ b/test/lisp/cedet/semantic-utest.el
@@ -1,6 +1,6 @@
 ;;; semantic-utest.el --- Tests for semantic's parsing system. -*- 
lexical-binding:t -*-
 
-;;; Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/lisp/cedet/srecode-utest-getset.el 
b/test/lisp/cedet/srecode-utest-getset.el
index fc66ac4..0497dea 100644
--- a/test/lisp/cedet/srecode-utest-getset.el
+++ b/test/lisp/cedet/srecode-utest-getset.el
@@ -1,6 +1,6 @@
 ;;; srecode/test-getset.el --- Test the getset inserter. -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2008, 2009, 2011, 2019-2020 Free Software Foundation, Inc
+;; Copyright (C) 2008, 2009, 2011, 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/cedet/srecode-utest-template.el 
b/test/lisp/cedet/srecode-utest-template.el
index 7c5bbc5..57d8a64 100644
--- a/test/lisp/cedet/srecode-utest-template.el
+++ b/test/lisp/cedet/srecode-utest-template.el
@@ -1,6 +1,6 @@
 ;;; srecode/test.el --- SRecode Core Template tests. -*- lexical-binding:t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/char-fold-tests.el b/test/lisp/char-fold-tests.el
index 599d9d6..063c893 100644
--- a/test/lisp/char-fold-tests.el
+++ b/test/lisp/char-fold-tests.el
@@ -1,6 +1,6 @@
 ;;; char-fold-tests.el --- Tests for char-fold.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Artur Malabarba <bruce.connor.am@gmail.com>
 
diff --git a/test/lisp/color-tests.el b/test/lisp/color-tests.el
index 3fb9bd5..2493476 100644
--- a/test/lisp/color-tests.el
+++ b/test/lisp/color-tests.el
@@ -1,6 +1,6 @@
 ;;; color-tests.el --- Tests for color.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el
index 923f588..de1bc54 100644
--- a/test/lisp/comint-tests.el
+++ b/test/lisp/comint-tests.el
@@ -1,6 +1,6 @@
 ;;; comint-tests.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/completion-tests.el b/test/lisp/completion-tests.el
index 7473bbb..c13fb2e 100644
--- a/test/lisp/completion-tests.el
+++ b/test/lisp/completion-tests.el
@@ -1,6 +1,6 @@
 ;;; completion-tests.el --- Tests for completion.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/cus-edit-tests.el b/test/lisp/cus-edit-tests.el
index bb88b8d..95f62e0 100644
--- a/test/lisp/cus-edit-tests.el
+++ b/test/lisp/cus-edit-tests.el
@@ -1,6 +1,6 @@
 ;;; cus-edit-tests.el --- Tests for cus-edit.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el
index 232e3be..10854c7 100644
--- a/test/lisp/custom-tests.el
+++ b/test/lisp/custom-tests.el
@@ -1,6 +1,6 @@
 ;;; custom-tests.el --- tests for custom.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/dabbrev-tests.el b/test/lisp/dabbrev-tests.el
index 06c5c06..0b20dcf 100644
--- a/test/lisp/dabbrev-tests.el
+++ b/test/lisp/dabbrev-tests.el
@@ -1,6 +1,6 @@
 ;;; dabbrev-tests.el --- Test suite for dabbrev.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Alan Third <alan@idiocy.org>
 ;; Keywords: dabbrev
diff --git a/test/lisp/delim-col-tests.el b/test/lisp/delim-col-tests.el
index c46c0f7..838fc92 100644
--- a/test/lisp/delim-col-tests.el
+++ b/test/lisp/delim-col-tests.el
@@ -1,6 +1,6 @@
 ;;; delim-col-tests.el --- Tests for delim-col.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/descr-text-tests.el b/test/lisp/descr-text-tests.el
index b060dff..6ba455b 100644
--- a/test/lisp/descr-text-tests.el
+++ b/test/lisp/descr-text-tests.el
@@ -1,6 +1,6 @@
 ;;; descr-text-test.el --- ERT tests for descr-text.el -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2014, 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Michal Nazarewicz <mina86@mina86.com>
 
diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el
index 6bb8ced..7f1743f 100644
--- a/test/lisp/dired-aux-tests.el
+++ b/test/lisp/dired-aux-tests.el
@@ -1,6 +1,6 @@
 ;;; dired-aux-tests.el --- Test suite for dired-aux. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index 66f8ed9..aac78c6 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -1,6 +1,6 @@
 ;;; dired-tests.el --- Test suite. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/dired-x-tests.el b/test/lisp/dired-x-tests.el
index 245e36e..5b51c99 100644
--- a/test/lisp/dired-x-tests.el
+++ b/test/lisp/dired-x-tests.el
@@ -1,6 +1,6 @@
 ;;; dired-x-tests.el --- Test suite for dired-x. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/dom-tests.el b/test/lisp/dom-tests.el
index f743df7..dbe3a15 100644
--- a/test/lisp/dom-tests.el
+++ b/test/lisp/dom-tests.el
@@ -1,6 +1,6 @@
 ;;; dom-tests.el --- Tests for dom.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index 5f63f68..1b7beea 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -1,6 +1,6 @@
 ;;; electric-tests.el --- tests for electric.el
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: João Távora <joaotavora@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/elide-head-tests.el b/test/lisp/elide-head-tests.el
index c9ef26a..4b9a559 100644
--- a/test/lisp/elide-head-tests.el
+++ b/test/lisp/elide-head-tests.el
@@ -1,6 +1,6 @@
 ;;; elide-head-tests.el --- Tests for elide-head.el  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/emacs-lisp/backquote-tests.el 
b/test/lisp/emacs-lisp/backquote-tests.el
index d1e6494..a196d0b 100644
--- a/test/lisp/emacs-lisp/backquote-tests.el
+++ b/test/lisp/emacs-lisp/backquote-tests.el
@@ -1,6 +1,6 @@
 ;;; backquote-tests.el --- Tests for backquote.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/backtrace-tests.el 
b/test/lisp/emacs-lisp/backtrace-tests.el
index fbc71e0..5c4e530 100644
--- a/test/lisp/emacs-lisp/backtrace-tests.el
+++ b/test/lisp/emacs-lisp/backtrace-tests.el
@@ -1,6 +1,6 @@
 ;;; backtrace-tests.el --- Tests for backtraces -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Gemini Lasswell
 
diff --git a/test/lisp/emacs-lisp/benchmark-tests.el 
b/test/lisp/emacs-lisp/benchmark-tests.el
index 7cca0d1..71bb52f 100644
--- a/test/lisp/emacs-lisp/benchmark-tests.el
+++ b/test/lisp/emacs-lisp/benchmark-tests.el
@@ -1,6 +1,6 @@
 ;;; benchmark-tests.el --- Test suite for benchmark.  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/bindat-tests.el 
b/test/lisp/emacs-lisp/bindat-tests.el
index 842ef10..a9a8819 100644
--- a/test/lisp/emacs-lisp/bindat-tests.el
+++ b/test/lisp/emacs-lisp/bindat-tests.el
@@ -1,6 +1,6 @@
 ;;; bindat-tests.el --- tests for bindat.el  -*- lexical-binding: t; coding: 
utf-8; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-autoload.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-autoload.el
new file mode 100644
index 0000000..96deb1b
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-autoload.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(autoload 'foox "foo"
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-custom-declare-variable.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-custom-declare-variable.el
new file mode 100644
index 0000000..2a4700b
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-custom-declare-variable.el
@@ -0,0 +1,4 @@
+;;; -*- lexical-binding: t -*-
+(custom-declare-variable
+ 'foo t
+ 
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defalias.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defalias.el
new file mode 100644
index 0000000..a4235d2
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defalias.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defalias 'foo #'ignore
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defconst.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defconst.el
new file mode 100644
index 0000000..946f019
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defconst.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defconst foo-bar nil
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-abbrev-table.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-abbrev-table.el
new file mode 100644
index 0000000..3da9ccd
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-abbrev-table.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(define-abbrev-table 'foo ()
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-obsolete-function-alias.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-obsolete-function-alias.el
new file mode 100644
index 0000000..fea841b
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-obsolete-function-alias.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(define-obsolete-function-alias 'foo #'ignore "99.1"
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-obsolete-variable-alias.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-obsolete-variable-alias.el
new file mode 100644
index 0000000..2d5f201
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-obsolete-variable-alias.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(define-obsolete-variable-alias 'foo 'ignore "99.1"
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el
new file mode 100644
index 0000000..94b0e80
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defun foo ()
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defvar.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defvar.el
new file mode 100644
index 0000000..99aacd0
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defvar.el
@@ -0,0 +1,6 @@
+;;; -*- lexical-binding: t -*-
+(defvar foo-bar nil
+  "multiline
+foo
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+bar")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defvaralias.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defvaralias.el
new file mode 100644
index 0000000..52fdc17
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defvaralias.el
@@ -0,0 +1,3 @@
+;;; -*- lexical-binding: t -*-
+(defvaralias 'foo-bar #'ignore
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-fill-column.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-fill-column.el
new file mode 100644
index 0000000..1ff554f
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-fill-column.el
@@ -0,0 +1,7 @@
+;;; -*- lexical-binding: t -*-
+(defvar foo-bar nil
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+
+;; Local Variables:
+;; fill-column: 100
+;; End:
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-override.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-override.el
new file mode 100644
index 0000000..0bcf7b1
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-override.el
@@ -0,0 +1,8 @@
+;;; -*- lexical-binding: t -*-
+(defvar foo-bar nil
+  "123456789012345")
+
+;; Local Variables:
+;; byte-compile-docstring-max-column: 10
+;; fill-column: 20
+;; End:
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore.el
new file mode 100644
index 0000000..c80ddd1
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore.el
@@ -0,0 +1,7 @@
+;;; -*- lexical-binding: t -*-
+(defvar foo-bar nil
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
+
+;; Local Variables:
+;; byte-compile-docstring-max-column: 100
+;; End:
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-multiline-first.el
 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-multiline-first.el
new file mode 100644
index 0000000..2563dbb
--- /dev/null
+++ 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-multiline-first.el
@@ -0,0 +1,5 @@
+;;; -*- lexical-binding: t -*-
+(defvar foo-bar nil
+  
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+This is a multiline docstring where the first line is long.
+foobar")
diff --git 
a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-multiline.el 
b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-multiline.el
new file mode 100644
index 0000000..9ae7bc9
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-multiline.el
@@ -0,0 +1,6 @@
+;;; -*- lexical-binding: t -*-
+(defvar foo-bar nil
+  "This is a multiline docstring.
+But it's not the first line that is long.
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+foobar")
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index 8fa4d27..5e5f99d 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -1,6 +1,6 @@
 ;;; bytecomp-tests.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Shigeru Fukaya <shigeru.fukaya@gmail.com>
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
@@ -540,6 +540,16 @@ Subtests signal errors if something goes wrong."
   (bytecomp--with-warning-test "foo.*lacks a prefix"
     '(defvar foo nil)))
 
+(defvar bytecomp-tests--docstring (make-string 100 ?x))
+
+(ert-deftest bytecomp-warn-wide-docstring/defconst ()
+  (bytecomp--with-warning-test "defconst.*foo.*wider than.*characters"
+    `(defconst foo t ,bytecomp-tests--docstring)))
+
+(ert-deftest bytecomp-warn-wide-docstring/defvar ()
+  (bytecomp--with-warning-test "defvar.*foo.*wider than.*characters"
+    `(defvar foo t ,bytecomp-tests--docstring)))
+
 (defmacro bytecomp--define-warning-file-test (file re-warning &optional 
reverse)
   `(ert-deftest ,(intern (format "bytecomp/%s" file)) ()
      :expected-result ,(if reverse :failed :passed)
@@ -639,6 +649,67 @@ Subtests signal errors if something goes wrong."
 (bytecomp--define-warning-file-test "warn-variable-set-nonvariable.el"
                             "variable reference to nonvariable")
 
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-autoload.el"
+ "autoload.*foox.*wider than.*characters")
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-custom-declare-variable.el"
+ "custom-declare-variable.*foo.*wider than.*characters")
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-defalias.el"
+ "defalias.*foo.*wider than.*characters")
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-defconst.el"
+ "defconst.*foo.*wider than.*characters")
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-define-abbrev-table.el"
+ "define-abbrev.*foo.*wider than.*characters")
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-define-obsolete-function-alias.el"
+ "defalias.*foo.*wider than.*characters")
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-define-obsolete-variable-alias.el"
+ "defvaralias.*foo.*wider than.*characters")
+
+;; TODO: We don't yet issue warnings for defuns.
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-defun.el"
+ "wider than.*characters" 'reverse)
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-defvar.el"
+ "defvar.*foo.*wider than.*characters")
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-defvaralias.el"
+ "defvaralias.*foo.*wider than.*characters")
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-ignore-fill-column.el"
+ "defvar.*foo.*wider than.*characters" 'reverse)
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-ignore-override.el"
+ "defvar.*foo.*wider than.*characters" 'reverse)
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-ignore.el"
+ "defvar.*foo.*wider than.*characters" 'reverse)
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-multiline-first.el"
+ "defvar.*foo.*wider than.*characters")
+
+(bytecomp--define-warning-file-test
+ "warn-wide-docstring-multiline.el"
+ "defvar.*foo.*wider than.*characters")
+
 
 ;;;; Macro expansion.
 
@@ -947,6 +1018,90 @@ literals (Bug#20852)."
    '((suspicious set-buffer))
    "Warning: Use .with-current-buffer. rather than"))
 
+(ert-deftest bytecomp-tests--not-writable-directory ()
+  "Test that byte compilation works if the output directory isn't
+writable (Bug#44631)."
+  (let ((directory (make-temp-file "bytecomp-tests-" :directory)))
+    (unwind-protect
+        (let* ((input-file (expand-file-name "test.el" directory))
+               (output-file (expand-file-name "test.elc" directory))
+               (byte-compile-dest-file-function
+                (lambda (_) output-file))
+               (byte-compile-error-on-warn t))
+          (write-region "" nil input-file nil nil nil 'excl)
+          (write-region "" nil output-file nil nil nil 'excl)
+          (set-file-modes input-file #o400)
+          (set-file-modes output-file #o200)
+          (set-file-modes directory #o500)
+          (should (byte-compile-file input-file))
+          (should (file-regular-p output-file))
+          (should (cl-plusp (file-attribute-size
+                             (file-attributes output-file)))))
+      (with-demoted-errors "Error cleaning up directory: %s"
+        (set-file-modes directory #o700)
+        (delete-directory directory :recursive)))))
+
+(ert-deftest bytecomp-tests--dest-mountpoint ()
+  "Test that byte compilation works if the destination file is a
+mountpoint (Bug#44631)."
+  (let ((bwrap (executable-find "bwrap"))
+        (emacs (expand-file-name invocation-name invocation-directory)))
+    (skip-unless bwrap)
+    (skip-unless (file-executable-p bwrap))
+    (skip-unless (not (file-remote-p bwrap)))
+    (skip-unless (file-executable-p emacs))
+    (skip-unless (not (file-remote-p emacs)))
+    (let ((directory (make-temp-file "bytecomp-tests-" :directory)))
+      (unwind-protect
+          (let* ((input-file (expand-file-name "test.el" directory))
+                 (output-file (expand-file-name "test.elc" directory))
+                 (unquoted-file (file-name-unquote output-file))
+                 (byte-compile-dest-file-function
+                  (lambda (_) output-file))
+                 (byte-compile-error-on-warn t))
+            (should-not (file-remote-p input-file))
+            (should-not (file-remote-p output-file))
+            (write-region "" nil input-file nil nil nil 'excl)
+            (write-region "" nil output-file nil nil nil 'excl)
+            (set-file-modes input-file #o400)
+            (set-file-modes output-file #o200)
+            (set-file-modes directory #o500)
+            (with-temp-buffer
+              (let ((status (call-process
+                             bwrap nil t nil
+                             "--ro-bind" "/" "/"
+                             "--bind" unquoted-file unquoted-file
+                             emacs "--quick" "--batch" "--load=bytecomp"
+                             (format "--eval=%S"
+                                     `(setq byte-compile-dest-file-function
+                                            (lambda (_) ,output-file)
+                                            byte-compile-error-on-warn t))
+                             "--funcall=batch-byte-compile" input-file)))
+                (unless (eql status 0)
+                  (ert-fail `((status . ,status)
+                              (output . ,(buffer-string)))))))
+            (should (file-regular-p output-file))
+            (should (cl-plusp (file-attribute-size
+                               (file-attributes output-file)))))
+        (with-demoted-errors "Error cleaning up directory: %s"
+          (set-file-modes directory #o700)
+          (delete-directory directory :recursive))))))
+
+(ert-deftest bytecomp-tests--target-file-no-directory ()
+  "Check that Bug#45287 is fixed."
+  (let ((directory (make-temp-file "bytecomp-tests-" :directory)))
+    (unwind-protect
+        (let* ((default-directory directory)
+               (byte-compile-dest-file-function (lambda (_) "test.elc"))
+               (byte-compile-error-on-warn t))
+          (write-region "" nil "test.el" nil nil nil 'excl)
+          (should (byte-compile-file "test.el"))
+          (should (file-regular-p "test.elc"))
+          (should (cl-plusp (file-attribute-size
+                             (file-attributes "test.elc")))))
+      (with-demoted-errors "Error cleaning up directory: %s"
+        (delete-directory directory :recursive)))))
+
 ;; Local Variables:
 ;; no-byte-compile: t
 ;; End:
diff --git a/test/lisp/emacs-lisp/cconv-tests.el 
b/test/lisp/emacs-lisp/cconv-tests.el
index 0ea9742..5173733 100644
--- a/test/lisp/emacs-lisp/cconv-tests.el
+++ b/test/lisp/emacs-lisp/cconv-tests.el
@@ -1,6 +1,6 @@
 ;;; cconv-tests.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/check-declare-tests.el 
b/test/lisp/emacs-lisp/check-declare-tests.el
index bb95421..9552bf0 100644
--- a/test/lisp/emacs-lisp/check-declare-tests.el
+++ b/test/lisp/emacs-lisp/check-declare-tests.el
@@ -1,6 +1,6 @@
 ;;; check-declare-tests.el --- Tests for check-declare.el  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/emacs-lisp/checkdoc-tests.el 
b/test/lisp/emacs-lisp/checkdoc-tests.el
index c12d0d3..cf7baf4 100644
--- a/test/lisp/emacs-lisp/checkdoc-tests.el
+++ b/test/lisp/emacs-lisp/checkdoc-tests.el
@@ -1,6 +1,6 @@
 ;;; checkdoc-tests.el --- unit tests for checkdoc.el  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Philipp Stephani <phst@google.com>
 
diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el 
b/test/lisp/emacs-lisp/cl-extra-tests.el
index 7546c14..f3c3087 100644
--- a/test/lisp/emacs-lisp/cl-extra-tests.el
+++ b/test/lisp/emacs-lisp/cl-extra-tests.el
@@ -1,6 +1,6 @@
 ;;; cl-extra-tests.el --- tests for emacs-lisp/cl-extra.el  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/cl-generic-tests.el 
b/test/lisp/emacs-lisp/cl-generic-tests.el
index 9582907..4a01623 100644
--- a/test/lisp/emacs-lisp/cl-generic-tests.el
+++ b/test/lisp/emacs-lisp/cl-generic-tests.el
@@ -1,6 +1,6 @@
 ;;; cl-generic-tests.el --- Tests for cl-generic.el functionality  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 
diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el 
b/test/lisp/emacs-lisp/cl-lib-tests.el
index 40dd7e4..97a44c4 100644
--- a/test/lisp/emacs-lisp/cl-lib-tests.el
+++ b/test/lisp/emacs-lisp/cl-lib-tests.el
@@ -1,6 +1,6 @@
 ;;; cl-lib-tests.el --- tests for emacs-lisp/cl-lib.el  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el 
b/test/lisp/emacs-lisp/cl-macs-tests.el
index 29ae95e..446983c 100644
--- a/test/lisp/emacs-lisp/cl-macs-tests.el
+++ b/test/lisp/emacs-lisp/cl-macs-tests.el
@@ -1,6 +1,6 @@
 ;;; cl-macs-tests.el --- tests for emacs-lisp/cl-macs.el  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/cl-preloaded-tests.el 
b/test/lisp/emacs-lisp/cl-preloaded-tests.el
index c643916..97cb204 100644
--- a/test/lisp/emacs-lisp/cl-preloaded-tests.el
+++ b/test/lisp/emacs-lisp/cl-preloaded-tests.el
@@ -1,6 +1,6 @@
 ;;; cl-preloaded-tests.el --- unit tests for cl-preloaded.el  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 ;; Author: Philipp Stephani <phst@google.com>
 
 ;; This file is part of GNU Emacs.
diff --git a/test/lisp/emacs-lisp/cl-print-tests.el 
b/test/lisp/emacs-lisp/cl-print-tests.el
index ca5db8d..1997951 100644
--- a/test/lisp/emacs-lisp/cl-print-tests.el
+++ b/test/lisp/emacs-lisp/cl-print-tests.el
@@ -1,6 +1,6 @@
 ;;; cl-print-tests.el --- Test suite for the cl-print facility.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/cl-seq-tests.el 
b/test/lisp/emacs-lisp/cl-seq-tests.el
index 7e0f538..d0fad89 100644
--- a/test/lisp/emacs-lisp/cl-seq-tests.el
+++ b/test/lisp/emacs-lisp/cl-seq-tests.el
@@ -1,6 +1,6 @@
 ;;; cl-seq-tests.el --- Tests for cl-seq.el functionality  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Richard <youngfrog@members.fsf.org>
 
diff --git a/test/lisp/emacs-lisp/copyright-tests.el 
b/test/lisp/emacs-lisp/copyright-tests.el
index 77b9e05..7deb8b5 100644
--- a/test/lisp/emacs-lisp/copyright-tests.el
+++ b/test/lisp/emacs-lisp/copyright-tests.el
@@ -1,6 +1,6 @@
 ;;; copyright-tests.el --- tests for copyright.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/derived-tests.el 
b/test/lisp/emacs-lisp/derived-tests.el
index d79c41e..9c8e6c3 100644
--- a/test/lisp/emacs-lisp/derived-tests.el
+++ b/test/lisp/emacs-lisp/derived-tests.el
@@ -1,6 +1,6 @@
 ;;; derived-tests.el --- tests for derived.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/easy-mmode-tests.el 
b/test/lisp/emacs-lisp/easy-mmode-tests.el
index bbd0197..77eaed6 100644
--- a/test/lisp/emacs-lisp/easy-mmode-tests.el
+++ b/test/lisp/emacs-lisp/easy-mmode-tests.el
@@ -1,6 +1,6 @@
 ;;; easy-mmode-tests.el --- tests for easy-mmode.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el 
b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
index 7be057d..a3010f9 100644
--- a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
+++ b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
@@ -1,6 +1,6 @@
 ;;; edebug-test-code.el --- Sample code for the Edebug test suite  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Gemini Lasswell
 
diff --git a/test/lisp/emacs-lisp/edebug-tests.el 
b/test/lisp/emacs-lisp/edebug-tests.el
index 8aae26a..d60a6cb 100644
--- a/test/lisp/emacs-lisp/edebug-tests.el
+++ b/test/lisp/emacs-lisp/edebug-tests.el
@@ -1,6 +1,6 @@
 ;;; edebug-tests.el --- Edebug test suite   -*- lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Gemini Lasswell
 
@@ -97,7 +97,10 @@ back to the top level.")
 
               ;; sit-on interferes with keyboard macros.
               (edebug-sit-on-break nil)
-              (edebug-continue-kbd-macro t))
+              (edebug-continue-kbd-macro t)
+
+              ;; don't print backtraces, otherwise error messages don't match
+              (backtrace-on-error-noninteractive nil))
      ,@body))
 
 (defmacro edebug-tests-with-normal-env (&rest body)
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el 
b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
index 73c3ea8..285616a 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
@@ -1,6 +1,6 @@
 ;;; eieio-testsinvoke.el -- eieio tests for method invocation  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2005, 2008, 2010, 2013-2020 Free Software Foundation,
+;; Copyright (C) 2005, 2008, 2010, 2013-2021 Free Software Foundation,
 ;; Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el 
b/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el
index 6979da8..ddbef02 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el
@@ -1,6 +1,6 @@
 ;;; eieio-test-persist.el --- Tests for eieio-persistent class  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el 
b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
index 21adc91..a47fb80 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
@@ -1,6 +1,6 @@
 ;;; eieio-tests.el -- eieio test routines -*- lexical-binding: t -*-
 
-;; Copyright (C) 1999-2003, 2005-2010, 2012-2020 Free Software
+;; Copyright (C) 1999-2003, 2005-2010, 2012-2021 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/test/lisp/emacs-lisp/ert-tests.el 
b/test/lisp/emacs-lisp/ert-tests.el
index 1f54c8d..40cb432 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -1,6 +1,6 @@
 ;;; ert-tests.el --- ERT's self-tests  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-2008, 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2008, 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Christian Ohler <ohler@gnu.org>
 
@@ -806,6 +806,16 @@ This macro is used to test if macroexpansion in `should' 
works."
   :expected-result :failed  ;; FIXME!  Bug#11218
   (should-not (with-demoted-errors (error "Foo"))))
 
+(ert-deftest ert-test-fail-inside-should ()
+  "Check that `ert-fail' inside `should' works correctly."
+  (let ((result (ert-run-test
+                 (make-ert-test
+                  :name 'test-1
+                  :body (lambda () (should (integerp (ert-fail "Boo"))))))))
+    (should (ert-test-failed-p result))
+    (should (equal (ert-test-failed-condition result)
+                   '(ert-test-failed ("Boo"))))))
+
 
 (provide 'ert-tests)
 
diff --git a/test/lisp/emacs-lisp/ert-x-tests.el 
b/test/lisp/emacs-lisp/ert-x-tests.el
index f342bff..f46fa63 100644
--- a/test/lisp/emacs-lisp/ert-x-tests.el
+++ b/test/lisp/emacs-lisp/ert-x-tests.el
@@ -1,6 +1,6 @@
 ;;; ert-x-tests.el --- Tests for ert-x.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2008, 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008, 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Phil Hagelberg
 ;;        Christian Ohler <ohler@gnu.org>
diff --git a/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el 
b/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el
index c77f2dc..9040cc0 100644
--- a/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el
+++ b/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el
@@ -1,6 +1,6 @@
 ;;; faceup-test-mode.el --- Dummy major mode for testing `faceup'.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Anders Lindgren
 ;; Keywords: languages, faces
@@ -67,8 +67,8 @@ If `prog-mode' is defined, inherit from it."
 
 (faceup-test-define-prog-mode faceup-test-mode "faceup-test"
   "Dummy major mode for testing `faceup', a test system for font-lock."
-  (set (make-local-variable 'syntax-propertize-function)
-       #'faceup-test-syntax-propertize)
+  (setq-local syntax-propertize-function
+              #'faceup-test-syntax-propertize)
   (setq font-lock-defaults '(faceup-test-font-lock-keywords nil)))
 
 (provide 'faceup-test-mode)
diff --git 
a/test/lisp/emacs-lisp/faceup-resources/faceup-test-this-file-directory.el 
b/test/lisp/emacs-lisp/faceup-resources/faceup-test-this-file-directory.el
index d8ab02b..3303e7b 100644
--- a/test/lisp/emacs-lisp/faceup-resources/faceup-test-this-file-directory.el
+++ b/test/lisp/emacs-lisp/faceup-resources/faceup-test-this-file-directory.el
@@ -1,6 +1,6 @@
 ;;; faceup-test-this-file-directory.el --- Support file for faceup tests  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Anders Lindgren
 ;; Keywords: languages, faces
diff --git a/test/lisp/emacs-lisp/faceup-tests/faceup-test-basics.el 
b/test/lisp/emacs-lisp/faceup-tests/faceup-test-basics.el
index 3c9ec76..0c7e001 100644
--- a/test/lisp/emacs-lisp/faceup-tests/faceup-test-basics.el
+++ b/test/lisp/emacs-lisp/faceup-tests/faceup-test-basics.el
@@ -1,6 +1,6 @@
 ;;; faceup-test-basics.el --- Tests for the `faceup' package.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Anders Lindgren
 ;; Keywords: languages, faces
diff --git a/test/lisp/emacs-lisp/faceup-tests/faceup-test-files.el 
b/test/lisp/emacs-lisp/faceup-tests/faceup-test-files.el
index a87c16d..16e1726 100644
--- a/test/lisp/emacs-lisp/faceup-tests/faceup-test-files.el
+++ b/test/lisp/emacs-lisp/faceup-tests/faceup-test-files.el
@@ -1,6 +1,6 @@
 ;;; faceup-test-files.el --- Self test of `faceup' using dummy major mode.  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Anders Lindgren
 ;; Keywords: languages, faces
diff --git a/test/lisp/emacs-lisp/find-func-tests.el 
b/test/lisp/emacs-lisp/find-func-tests.el
index d77eb67..28a9a7e 100644
--- a/test/lisp/emacs-lisp/find-func-tests.el
+++ b/test/lisp/emacs-lisp/find-func-tests.el
@@ -1,6 +1,6 @@
 ;;; find-func-tests.el --- Unit tests for find-func.el  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords:
@@ -27,6 +27,7 @@
 ;;; Code:
 
 (require 'ert-x)                        ;For `ert-run-keys'.
+(require 'find-func)
 
 (ert-deftest find-func-tests--library-completion () ;bug#43393
   ;; FIXME: How can we make this work in batch (see also
@@ -43,5 +44,77 @@
                      (concat data-directory (kbd "n x / TAB RET"))
                    (read-library-name)))))
 
+(ert-deftest find-func-tests--locate-symbols ()
+  (should (cdr
+           (find-function-search-for-symbol
+            #'goto-line nil "simple")))
+  (should (cdr
+           (find-function-search-for-symbol
+            'minibuffer-history 'defvar "simple")))
+  (should (cdr
+           (find-function-search-for-symbol
+            'with-current-buffer nil "subr")))
+  (should (cdr
+           (find-function-search-for-symbol
+            'font-lock-warning-face 'defface "font-lock")))
+  (should-not (cdr
+               (find-function-search-for-symbol
+                'wrong-variable 'defvar "simple")))
+  (should-not (cdr
+               (find-function-search-for-symbol
+                'wrong-function nil "simple")))
+  (should (cdr (find-function-noselect #'goto-line)))
+  (should (cdr (find-function-noselect #'goto-char)))
+  ;; Setting LISP-ONLY and passing a primitive should error.
+  (should-error (find-function-noselect #'goto-char t))
+  (should-error (find-function-noselect 'wrong-function)))
+
+(defun test-locate-helper (func &optional expected-result)
+  "Assert on the result of `find-function-library' for FUNC.
+EXPECTED-RESULT is an alist (FUNC . LIBRARY) with the
+expected function symbol and function library, respectively."
+  (cl-destructuring-bind (orig-function . library)
+      (find-function-library func)
+    (cl-destructuring-bind (expected-func . expected-library)
+        expected-result
+      (should (eq orig-function expected-func))
+      (should (and
+               (not (string-empty-p expected-library))
+               (string-match-p expected-library library))))))
+
+(ert-deftest find-func-tests--locate-library ()
+  (test-locate-helper #'goto-line '(goto-line . "simple"))
+  (test-locate-helper #'forward-char '(forward-char . "cmds.c"))
+  (should-error (test-locate-helper 'wrong-function)))
+
+(ert-deftest find-func-tests--locate-adviced-symbols ()
+  (defun my-message ()
+    (message "Hello!"))
+  (advice-add #'mark-sexp :around 'my-message)
+  (test-locate-helper #'mark-sexp '(mark-sexp . "lisp"))
+  (advice-remove #'mark-sexp 'my-message))
+
+(ert-deftest find-func-tests--find-library-verbose ()
+  (find-function-library #'join-line nil t)
+  (with-current-buffer "*Messages*"
+    (save-excursion
+      (goto-char (point-max))
+      (skip-chars-backward "\n")
+      (should (string-match-p
+               ".join-line. is an alias for .delete-indentation."
+               (buffer-substring
+                (line-beginning-position)
+                (point)))))))
+
+;; Avoid a byte-compilation warning that may confuse people reading
+;; the result of the following test.
+(declare-function compilation--message->loc nil "compile")
+
+(ert-deftest find-func-tests--locate-macro-generated-symbols () ;bug#45443
+  (should (cdr (find-function-search-for-symbol
+                #'compilation--message->loc nil "compile")))
+  (should (cdr (find-function-search-for-symbol
+                'c-mode-hook 'defvar "cc-mode"))))
+
 (provide 'find-func-tests)
 ;;; find-func-tests.el ends here
diff --git a/test/lisp/emacs-lisp/float-sup-tests.el 
b/test/lisp/emacs-lisp/float-sup-tests.el
index 9f9a3da..9e87928 100644
--- a/test/lisp/emacs-lisp/float-sup-tests.el
+++ b/test/lisp/emacs-lisp/float-sup-tests.el
@@ -1,6 +1,6 @@
 ;;; float-sup-tests.el --- Tests for float-sup.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/generator-tests.el 
b/test/lisp/emacs-lisp/generator-tests.el
index 72eee07..ffcd16a 100644
--- a/test/lisp/emacs-lisp/generator-tests.el
+++ b/test/lisp/emacs-lisp/generator-tests.el
@@ -1,6 +1,6 @@
 ;;; generator-tests.el --- Testing generators -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel Colascione <dancol@dancol.org>
 ;; Keywords:
diff --git a/test/lisp/emacs-lisp/gv-tests.el b/test/lisp/emacs-lisp/gv-tests.el
index 29e4273..b9850ec 100644
--- a/test/lisp/emacs-lisp/gv-tests.el
+++ b/test/lisp/emacs-lisp/gv-tests.el
@@ -1,6 +1,6 @@
 ;;; gv-tests.el --- tests for gv.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -83,7 +83,10 @@
     (with-temp-buffer
       (call-process (concat invocation-directory invocation-name)
                     nil '(t t) nil
-                    "-Q" "-batch" "--eval" (prin1-to-string 
`(byte-compile-file ,el))
+                    "-Q" "-batch"
+                    "--eval" (prin1-to-string
+                              `(let ((backtrace-on-error-noninteractive nil))
+                                 (byte-compile-file ,el)))
                     "-l" elc)
       (should (equal (buffer-string)
                      "Symbol's function definition is void: \\(setf\\ 
gv-test-foo\\)\n")))))
@@ -133,8 +136,10 @@
                     "-Q" "-batch" "--eval" (prin1-to-string 
`(byte-compile-file ,el))
                     "-l" elc
                     "--eval"
-                    (prin1-to-string '(progn (setf (gv-test-foo gv-test-pair) 
99)
-                                             (message "%d" (car 
gv-test-pair)))))
+                    (prin1-to-string
+                     '(let ((backtrace-on-error-noninteractive nil))
+                        (setf (gv-test-foo gv-test-pair) 99)
+                        (message "%d" (car gv-test-pair)))))
       (should (string-match
                "\\`Symbol.s function definition is void: \\\\(setf\\\\ 
gv-test-foo\\\\)\n\\'"
                (buffer-string))))))
diff --git a/test/lisp/emacs-lisp/let-alist-tests.el 
b/test/lisp/emacs-lisp/let-alist-tests.el
index d283ecb..d856696 100644
--- a/test/lisp/emacs-lisp/let-alist-tests.el
+++ b/test/lisp/emacs-lisp/let-alist-tests.el
@@ -1,6 +1,6 @@
 ;;; let-alist.el --- tests for file handling. -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el 
b/test/lisp/emacs-lisp/lisp-mode-tests.el
index d1183d8..85db3a0 100644
--- a/test/lisp/emacs-lisp/lisp-mode-tests.el
+++ b/test/lisp/emacs-lisp/lisp-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; lisp-mode-tests.el --- Test Lisp editing commands  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
diff --git a/test/lisp/emacs-lisp/lisp-tests.el 
b/test/lisp/emacs-lisp/lisp-tests.el
index 437b907..fd07011 100644
--- a/test/lisp/emacs-lisp/lisp-tests.el
+++ b/test/lisp/emacs-lisp/lisp-tests.el
@@ -1,6 +1,6 @@
 ;;; lisp-tests.el --- Test Lisp editing commands     -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Aaron S. Hawley <aaron.s.hawley@gmail.com>
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/test/lisp/emacs-lisp/map-tests.el 
b/test/lisp/emacs-lisp/map-tests.el
index 1888baf..9a2cd42 100644
--- a/test/lisp/emacs-lisp/map-tests.el
+++ b/test/lisp/emacs-lisp/map-tests.el
@@ -1,6 +1,6 @@
 ;;; map-tests.el --- Tests for map.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Petton <nicolas@petton.fr>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/test/lisp/emacs-lisp/memory-report-tests.el 
b/test/lisp/emacs-lisp/memory-report-tests.el
new file mode 100644
index 0000000..da5f4f5
--- /dev/null
+++ b/test/lisp/emacs-lisp/memory-report-tests.el
@@ -0,0 +1,57 @@
+;;; memory-report-tests.el --- tests for memory-report.el -*- lexical-binding: 
t -*-
+
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+(require 'ert)
+(require 'memory-report)
+
+(defun setup-memory-report-tests ()
+  ;; Set the sizes on things based on a 64-bit architecture.  (We're
+  ;; hard-coding this to be able to write simple tests that'll work on
+  ;; all architectures.)
+  (memory-report--set-size
+   '((conses 16 499173 99889)
+     (symbols 48 22244 3)
+     (strings 32 92719 4559)
+     (string-bytes 1 40402011)
+     (vectors 16 31919)
+     (vector-slots 8 385148 149240)
+     (floats 8 434 4519)
+     (intervals 56 24499 997)
+     (buffers 984 33))))
+
+(ert-deftest memory-report-sizes ()
+  (setup-memory-report-tests)
+  (should (equal (memory-report-object-size (cons nil nil)) 16))
+  (should (equal (memory-report-object-size (cons 1 2)) 16))
+
+  (should (equal (memory-report-object-size (list 1 2)) 32))
+  (should (equal (memory-report-object-size (list 1)) 16))
+
+  (should (equal (memory-report-object-size (list 'foo)) 16))
+
+  (should (equal (memory-report-object-size (vector 1 2 3 4)) 80))
+
+  (should (equal (memory-report-object-size "") 32))
+  (should (equal (memory-report-object-size "a") 33))
+  (should (equal (memory-report-object-size (propertize "a" 'face 'foo))
+                 81)))
+
+(provide 'memory-report-tests)
+
+;;; memory-report-tests.el ends here
diff --git a/test/lisp/emacs-lisp/nadvice-tests.el 
b/test/lisp/emacs-lisp/nadvice-tests.el
index a955df0..358d902 100644
--- a/test/lisp/emacs-lisp/nadvice-tests.el
+++ b/test/lisp/emacs-lisp/nadvice-tests.el
@@ -1,6 +1,6 @@
 ;;; nadvice-tests.el --- Test suite for the new advice thingy.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh 
b/test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh
index a48c9bb..ca16f8b 100755
--- a/test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh
+++ b/test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh
@@ -2,7 +2,7 @@
 
 # Generate a new key and update the signatures for tests.
 
-# Copyright (C) 2020 Free Software Foundation, Inc.
+# Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/package-tests.el 
b/test/lisp/emacs-lisp/package-tests.el
index 2326754..67d647d 100644
--- a/test/lisp/emacs-lisp/package-tests.el
+++ b/test/lisp/emacs-lisp/package-tests.el
@@ -1,6 +1,6 @@
 ;;; package-tests.el --- Tests for the Emacs package system  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel Hackney <dan@haxney.org>
 ;; Version: 1.0
@@ -405,9 +405,9 @@ Must called from within a `tar-mode' buffer."
 (ert-deftest package-test-list-filter-by-name ()
   "Ensure package list is filtered correctly by package name."
   (with-package-menu-test ()
-    (package-menu-filter-by-name "tetris")
+    (package-menu-filter-by-name "ansi-color")
     (goto-char (point-min))
-    (should (re-search-forward "^\\s-+tetris" nil t))
+    (should (re-search-forward "^\\s-+ansi-color" nil t))
     (should (= (count-lines (point-min) (point-max)) 1))))
 
 (ert-deftest package-test-list-filter-by-status ()
@@ -463,7 +463,7 @@ Must called from within a `tar-mode' buffer."
   "Ensure package list filter is cleared correctly."
   (with-package-menu-test
     (let ((num-packages (count-lines (point-min) (point-max))))
-      (package-menu-filter-by-name "tetris")
+      (package-menu-filter-by-name "ansi-color")
       (should (= (count-lines (point-min) (point-max)) 1))
       (package-menu-clear-filter)
       (should (= (count-lines (point-min) (point-max)) num-packages)))))
diff --git a/test/lisp/emacs-lisp/pcase-tests.el 
b/test/lisp/emacs-lisp/pcase-tests.el
index ac51241..1b06c6e 100644
--- a/test/lisp/emacs-lisp/pcase-tests.el
+++ b/test/lisp/emacs-lisp/pcase-tests.el
@@ -1,6 +1,6 @@
 ;;; pcase-tests.el --- Test suite for pcase macro.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/pp-tests.el b/test/lisp/emacs-lisp/pp-tests.el
index 8e8de08..b04030c 100644
--- a/test/lisp/emacs-lisp/pp-tests.el
+++ b/test/lisp/emacs-lisp/pp-tests.el
@@ -1,6 +1,6 @@
 ;;; pp-tests.el --- Test suite for pretty printer.  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/regexp-opt-tests.el 
b/test/lisp/emacs-lisp/regexp-opt-tests.el
index ff93b8b..940feb5 100644
--- a/test/lisp/emacs-lisp/regexp-opt-tests.el
+++ b/test/lisp/emacs-lisp/regexp-opt-tests.el
@@ -1,6 +1,6 @@
 ;;; regexp-opt-tests.el --- Tests for regexp-opt.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords:       internal
diff --git a/test/lisp/emacs-lisp/ring-tests.el 
b/test/lisp/emacs-lisp/ring-tests.el
index e348165..55df4f3 100644
--- a/test/lisp/emacs-lisp/ring-tests.el
+++ b/test/lisp/emacs-lisp/ring-tests.el
@@ -1,6 +1,6 @@
 ;;; ring-tests.el --- Tests for ring.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/emacs-lisp/rmc-tests.el 
b/test/lisp/emacs-lisp/rmc-tests.el
index 5add24c..9d8f3d4 100644
--- a/test/lisp/emacs-lisp/rmc-tests.el
+++ b/test/lisp/emacs-lisp/rmc-tests.el
@@ -1,6 +1,6 @@
 ;;; rmc-tests.el --- Test suite for rmc.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Tino Calancha <tino.calancha@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index d2e11cf..63d7c7b 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -1,6 +1,6 @@
 ;;; rx-tests.el --- tests for rx.el              -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/seq-tests.el 
b/test/lisp/emacs-lisp/seq-tests.el
index a6a8095..6703983 100644
--- a/test/lisp/emacs-lisp/seq-tests.el
+++ b/test/lisp/emacs-lisp/seq-tests.el
@@ -1,6 +1,6 @@
 ;;; seq-tests.el --- Tests for seq.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Petton <nicolas@petton.fr>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/test/lisp/emacs-lisp/shadow-tests.el 
b/test/lisp/emacs-lisp/shadow-tests.el
index 5d6215a..52d1d21 100644
--- a/test/lisp/emacs-lisp/shadow-tests.el
+++ b/test/lisp/emacs-lisp/shadow-tests.el
@@ -1,6 +1,6 @@
 ;;; shadow-tests.el --- Test suite for shadow.  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el 
b/test/lisp/emacs-lisp/subr-x-tests.el
index 9d14a5a..112f3c1 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -1,6 +1,6 @@
 ;;; subr-x-tests.el --- Testing the extended lisp routines  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Fabián E. Gallina <fgallina@gnu.org>
 ;; Keywords:
@@ -582,5 +582,58 @@
   (should (equal (string-remove-suffix "a" "aa") "a"))
   (should (equal (string-remove-suffix "a" "ba") "b")))
 
+(ert-deftest subr-clean-whitespace ()
+  (should (equal (string-clean-whitespace " foo ") "foo"))
+  (should (equal (string-clean-whitespace " foo   \r\n\t  Bar") "foo Bar")))
+
+(ert-deftest subr-string-fill ()
+  (should (equal (string-fill "foo" 10) "foo"))
+  (should (equal (string-fill "foobar" 5) "foobar"))
+  (should (equal (string-fill "foo bar zot" 5) "foo\nbar\nzot"))
+  (should (equal (string-fill "foo bar zot" 7) "foo bar\nzot")))
+
+(ert-deftest subr-string-limit ()
+  (should (equal (string-limit "foo" 10) "foo"))
+  (should (equal (string-limit "foo" 2) "fo"))
+  (should (equal (string-limit "foo" 2 t) "oo"))
+  (should (equal (string-limit "abc" 10 t) "abc"))
+  (should (equal (string-limit "foo" 0) ""))
+  (should-error (string-limit "foo" -1)))
+
+(ert-deftest subr-string-limit-coding ()
+  (should (not (multibyte-string-p (string-limit "foó" 10 nil 'utf-8))))
+  (should (equal (string-limit "foó" 10 nil 'utf-8) "fo\303\263"))
+  (should (equal (string-limit "foó" 3 nil 'utf-8) "fo"))
+  (should (equal (string-limit "foó" 4 nil 'utf-8) "fo\303\263"))
+  (should (equal (string-limit "foóa" 4 nil 'utf-8) "fo\303\263"))
+  (should (equal (string-limit "foóá" 4 nil 'utf-8) "fo\303\263"))
+  (should (equal (string-limit "foóa" 4 nil 'iso-8859-1) "fo\363a"))
+  (should (equal (string-limit "foóá" 4 nil 'iso-8859-1) "fo\363\341"))
+  (should (equal (string-limit "foóá" 4 nil 'utf-16) "\376\377\000f"))
+
+  (should (equal (string-limit "foó" 10 t 'utf-8) "fo\303\263"))
+  (should (equal (string-limit "foó" 3 t 'utf-8) "o\303\263"))
+  (should (equal (string-limit "foó" 4 t 'utf-8) "fo\303\263"))
+  (should (equal (string-limit "foóa" 4 t 'utf-8) "o\303\263a"))
+  (should (equal (string-limit "foóá" 4 t 'utf-8) "\303\263\303\241"))
+  (should (equal (string-limit "foóa" 4 t 'iso-8859-1) "fo\363a"))
+  (should (equal (string-limit "foóá" 4 t 'iso-8859-1) "fo\363\341"))
+  (should (equal (string-limit "foóá" 4 t 'utf-16) "\376\377\000\341")))
+
+(ert-deftest subr-string-lines ()
+  (should (equal (string-lines "foo") '("foo")))
+  (should (equal (string-lines "foo \nbar") '("foo " "bar"))))
+
+(ert-deftest subr-string-pad ()
+  (should (equal (string-pad "foo" 5) "foo  "))
+  (should (equal (string-pad "foo" 5 ?-) "foo--"))
+  (should (equal (string-pad "foo" 5 ?- t) "--foo"))
+  (should (equal (string-pad "foo" 2 ?-) "foo")))
+
+(ert-deftest subr-string-chop-newline ()
+  (should (equal (string-chop-newline "foo\n") "foo"))
+  (should (equal (string-chop-newline "foo\nbar\n") "foo\nbar"))
+  (should (equal (string-chop-newline "foo\nbar") "foo\nbar")))
+
 (provide 'subr-x-tests)
 ;;; subr-x-tests.el ends here
diff --git a/test/lisp/emacs-lisp/syntax-tests.el 
b/test/lisp/emacs-lisp/syntax-tests.el
index 9d4c411..1ae1cbc 100644
--- a/test/lisp/emacs-lisp/syntax-tests.el
+++ b/test/lisp/emacs-lisp/syntax-tests.el
@@ -1,6 +1,6 @@
 ;;; syntax-tests.el --- tests for syntax.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/tabulated-list-test.el 
b/test/lisp/emacs-lisp/tabulated-list-test.el
index 7486e2b..db1ce312 100644
--- a/test/lisp/emacs-lisp/tabulated-list-test.el
+++ b/test/lisp/emacs-lisp/tabulated-list-test.el
@@ -1,6 +1,6 @@
 ;;; tabulated-list-test.el --- Tests for emacs-lisp/tabulated-list.el  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Artur Malabarba <bruce.connor.am@gmail.com>
 
diff --git a/test/lisp/emacs-lisp/testcover-resources/testcases.el 
b/test/lisp/emacs-lisp/testcover-resources/testcases.el
index 77edf2f..5dbf227 100644
--- a/test/lisp/emacs-lisp/testcover-resources/testcases.el
+++ b/test/lisp/emacs-lisp/testcover-resources/testcases.el
@@ -1,6 +1,6 @@
 ;;;; testcases.el -- Test cases for testcover-tests.el
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Gemini Lasswell
 
diff --git a/test/lisp/emacs-lisp/testcover-tests.el 
b/test/lisp/emacs-lisp/testcover-tests.el
index 9e7a3bf..9f0312d 100644
--- a/test/lisp/emacs-lisp/testcover-tests.el
+++ b/test/lisp/emacs-lisp/testcover-tests.el
@@ -1,6 +1,6 @@
 ;;; testcover-tests.el --- Testcover test suite   -*- lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Gemini Lasswell
 
diff --git a/test/lisp/emacs-lisp/text-property-search-tests.el 
b/test/lisp/emacs-lisp/text-property-search-tests.el
index f643e49..90f06c3 100644
--- a/test/lisp/emacs-lisp/text-property-search-tests.el
+++ b/test/lisp/emacs-lisp/text-property-search-tests.el
@@ -1,6 +1,6 @@
 ;;; text-property-search-tests.el --- Testing text-property-search  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Ingebrigtsen <larsi@gnus.org>
 ;; Keywords:
diff --git a/test/lisp/emacs-lisp/thunk-tests.el 
b/test/lisp/emacs-lisp/thunk-tests.el
index 67ec415..1a8537f 100644
--- a/test/lisp/emacs-lisp/thunk-tests.el
+++ b/test/lisp/emacs-lisp/thunk-tests.el
@@ -1,6 +1,6 @@
 ;;; thunk-tests.el --- Tests for thunk.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Petton <nicolas@petton.fr>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/test/lisp/emacs-lisp/timer-tests.el 
b/test/lisp/emacs-lisp/timer-tests.el
index bc712ee..74da33e 100644
--- a/test/lisp/emacs-lisp/timer-tests.el
+++ b/test/lisp/emacs-lisp/timer-tests.el
@@ -1,6 +1,6 @@
 ;;; timer-tests.el --- tests for timers -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/unsafep-tests.el 
b/test/lisp/emacs-lisp/unsafep-tests.el
index 06c40d2..b2a48d8 100644
--- a/test/lisp/emacs-lisp/unsafep-tests.el
+++ b/test/lisp/emacs-lisp/unsafep-tests.el
@@ -2,7 +2,7 @@
 
 ;; Author: Jonathan Yavner <jyavner@member.fsf.org>
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emacs-lisp/warnings-tests.el 
b/test/lisp/emacs-lisp/warnings-tests.el
index 02c09b4..aa39463 100644
--- a/test/lisp/emacs-lisp/warnings-tests.el
+++ b/test/lisp/emacs-lisp/warnings-tests.el
@@ -2,7 +2,7 @@
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/emulation/viper-tests.el 
b/test/lisp/emulation/viper-tests.el
index b981938..0d99976 100644
--- a/test/lisp/emulation/viper-tests.el
+++ b/test/lisp/emulation/viper-tests.el
@@ -1,6 +1,6 @@
 ;;; viper-tests.el --- tests for viper.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el
index c9c92f5..741574f 100644
--- a/test/lisp/epg-tests.el
+++ b/test/lisp/epg-tests.el
@@ -1,6 +1,6 @@
 ;;; epg-tests.el --- Test suite for epg.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -96,8 +96,7 @@
                  context
                   (ert-resource-file "seckey.asc")))
           (with-temp-buffer
-            (make-local-variable 'epg-tests-context)
-            (setq epg-tests-context context)
+             (setq-local epg-tests-context context)
             ,@body))
        (when (file-directory-p epg-tests-home-directory)
         (delete-directory epg-tests-home-directory t)))))
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 27f48fa..26e14b9 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -1,6 +1,6 @@
 ;;; erc-tests.el --- Tests for erc.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Ingebrigtsen <larsi@gnus.org>
 
diff --git a/test/lisp/erc/erc-track-tests.el b/test/lisp/erc/erc-track-tests.el
index 4124094..0ce93bd 100644
--- a/test/lisp/erc/erc-track-tests.el
+++ b/test/lisp/erc/erc-track-tests.el
@@ -1,6 +1,6 @@
 ;;; erc-track-tests.el --- Tests for erc-track.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Author: Vivek Dasmohapatra <vivek@etla.org>
diff --git a/test/lisp/eshell/em-hist-tests.el 
b/test/lisp/eshell/em-hist-tests.el
index 5bb16f6..ec65397 100644
--- a/test/lisp/eshell/em-hist-tests.el
+++ b/test/lisp/eshell/em-hist-tests.el
@@ -1,6 +1,6 @@
 ;;; tests/em-hist-tests.el --- em-hist test suite  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/eshell/em-ls-tests.el b/test/lisp/eshell/em-ls-tests.el
index 975701e..fc2cd9c 100644
--- a/test/lisp/eshell/em-ls-tests.el
+++ b/test/lisp/eshell/em-ls-tests.el
@@ -1,6 +1,6 @@
 ;;; tests/em-ls-tests.el --- em-ls test suite  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Tino Calancha <tino.calancha@gmail.com>
 
diff --git a/test/lisp/eshell/esh-opt-tests.el 
b/test/lisp/eshell/esh-opt-tests.el
index caba153..0c99da6 100644
--- a/test/lisp/eshell/esh-opt-tests.el
+++ b/test/lisp/eshell/esh-opt-tests.el
@@ -1,6 +1,6 @@
 ;;; tests/esh-opt-tests.el --- esh-opt test suite  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index 1b93fb0..4dac702 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -1,6 +1,6 @@
 ;;; tests/eshell-tests.el --- Eshell test suite  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
diff --git a/test/lisp/faces-resources/faces-test-dark-theme.el 
b/test/lisp/faces-resources/faces-test-dark-theme.el
index a5e2ca4..f3ef6b6 100644
--- a/test/lisp/faces-resources/faces-test-dark-theme.el
+++ b/test/lisp/faces-resources/faces-test-dark-theme.el
@@ -1,6 +1,6 @@
 ;;; faces-test-dark-theme.el --- A dark theme from tests ;;; -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/faces-resources/faces-test-light-theme.el 
b/test/lisp/faces-resources/faces-test-light-theme.el
index b2f7ec6..390b846 100644
--- a/test/lisp/faces-resources/faces-test-light-theme.el
+++ b/test/lisp/faces-resources/faces-test-light-theme.el
@@ -1,6 +1,6 @@
 ;;; faces-test-light-theme.el --- A dark theme from tests ;;; -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el
index bdd18a5..6e77259 100644
--- a/test/lisp/faces-tests.el
+++ b/test/lisp/faces-tests.el
@@ -1,6 +1,6 @@
 ;;; faces-tests.el --- Tests for faces.el            -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Artur Malabarba <bruce.connor.am@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el
index ca8c108..3ceb392 100644
--- a/test/lisp/ffap-tests.el
+++ b/test/lisp/ffap-tests.el
@@ -1,6 +1,6 @@
 ;;; ffap-tests.el --- Test suite for ffap.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Tino Calancha <tino.calancha@gmail.com>
 
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index 268c318..047109a 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -1,6 +1,6 @@
 ;;; filenotify-tests.el --- Tests of file notifications  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
@@ -108,11 +108,8 @@ There are different timeouts for local and remote file 
notification libraries."
     ;; gio/gpollfilemonitor.c declares POLL_TIME_SECS 5.  So we must
     ;; wait at least this time in the GPollFileMonitor case.  A
     ;; similar timeout seems to be needed in the GFamFileMonitor case,
-    ;; at least on Cygwin.
-    ((and (string-equal (file-notify--test-library) "gfilenotify")
-          (memq (file-notify--test-monitor)
-                '(GFamFileMonitor GPollFileMonitor)))
-     7)
+    ;; at least on cygwin.
+    ((memq (file-notify--test-monitor) '(GFamFileMonitor GPollFileMonitor)) 7)
     ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe") 1)
     ((file-remote-p temporary-file-directory) 0.1)
     (t 0.01))))
@@ -264,13 +261,19 @@ This returns only for the local case and gfilenotify; 
otherwise it is nil.
   ;; We cache the result, because after `file-notify-rm-watch',
   ;; `gfile-monitor-name' does not return a proper result anymore.
   ;; But we still need this information.
-  (unless (file-remote-p temporary-file-directory)
-    (or (cdr (assq file-notify--test-desc file-notify--test-monitors))
-        (when (functionp 'gfile-monitor-name)
-          (add-to-list 'file-notify--test-monitors
-                       (cons file-notify--test-desc
-                             (gfile-monitor-name file-notify--test-desc)))
-          (cdr (assq file-notify--test-desc file-notify--test-monitors))))))
+  ;; So far, we know the monitors GFamFileMonitor, GFenFileMonitor,
+  ;; GInotifyFileMonitor, GKqueueFileMonitor and GPollFileMonitor.
+  (or (cdr (assq file-notify--test-desc file-notify--test-monitors))
+      (progn
+       (add-to-list
+        'file-notify--test-monitors
+        (cons file-notify--test-desc
+              (if (file-remote-p temporary-file-directory)
+                  (tramp-get-connection-property
+                   file-notify--test-desc "gio-file-monitor" nil)
+                (and (functionp 'gfile-monitor-name)
+                     (gfile-monitor-name file-notify--test-desc)))))
+       (cdr (assq file-notify--test-desc file-notify--test-monitors)))))
 
 (defmacro file-notify--deftest-remote (test docstring &optional unstable)
   "Define ert `TEST-remote' for remote files.
@@ -457,7 +460,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
 
   (unwind-protect
       ;; Check, that removing watch descriptors out of order do not
-      ;; harm.  This fails on Cygwin because of timing issues unless a
+      ;; harm.  This fails on cygwin because of timing issues unless a
       ;; long `sit-for' is added before the call to
       ;; `file-notify--test-read-event'.
       (unless (eq system-type 'cygwin)
@@ -631,13 +634,15 @@ delivered."
             (cond
              ;; gvfs-monitor-dir on cygwin does not detect the
              ;; `created' event reliably.
-            ((string-equal
-              (file-notify--test-library) "gvfs-monitor-dir.exe")
+            ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe")
              '((deleted stopped)
                (created deleted stopped)))
              ;; cygwin does not raise a `changed' event.
              ((eq system-type 'cygwin)
               '(created deleted stopped))
+            ;; GKqueueFileMonitor does not report the `changed' event.
+            ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+             '(created deleted stopped))
              (t '(created changed deleted stopped)))
           (write-region
            "another text" nil file-notify--test-tmpfile nil 'no-message)
@@ -668,6 +673,9 @@ delivered."
             ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe")
              '((deleted stopped)
                (changed deleted stopped)))
+            ;; GKqueueFileMonitor does not report the `changed' event.
+            ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+             '(deleted stopped))
             ;; There could be one or two `changed' events.
             (t '((changed deleted stopped)
                  (changed changed deleted stopped))))
@@ -718,6 +726,9 @@ delivered."
              '(created deleted stopped))
             ((string-equal (file-notify--test-library) "kqueue")
              '(created changed deleted stopped))
+            ;; GKqueueFileMonitor does not report the `changed' event.
+            ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+             '(created deleted deleted stopped))
             (t '(created changed deleted deleted stopped)))
          (write-region
           "any text" nil file-notify--test-tmpfile nil 'no-message)
@@ -767,6 +778,9 @@ delivered."
              ;; directory are not detected.
              ((getenv "EMACS_EMBA_CI")
               '(created changed created changed deleted deleted))
+            ;; GKqueueFileMonitor does not report the `changed' event.
+            ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+             '(created created deleted deleted deleted stopped))
             (t '(created changed created changed
                  deleted deleted deleted stopped)))
          (write-region
@@ -823,6 +837,9 @@ delivered."
              '(created created deleted deleted stopped))
             ((string-equal (file-notify--test-library) "kqueue")
              '(created changed renamed deleted stopped))
+            ;; GKqueueFileMonitor does not report the `changed' event.
+            ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+             '(created renamed deleted deleted stopped))
             (t '(created changed renamed deleted deleted stopped)))
          (write-region
           "any text" nil file-notify--test-tmpfile nil 'no-message)
@@ -859,6 +876,8 @@ delivered."
             ((string-equal (file-notify--test-library) "w32notify")
              '((changed changed)
                (changed changed changed changed)))
+            ;; GKqueueFileMonitor does not report the `attribute-changed' 
event.
+            ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) nil)
             ;; For kqueue and in the remote case, `write-region'
             ;; raises also an `attribute-changed' event.
             ((or (string-equal (file-notify--test-library) "kqueue")
@@ -925,6 +944,10 @@ delivered."
             ;; timeouts.
             (setq file-notify--test-desc auto-revert-notify-watch-descriptor)
 
+           ;; GKqueueFileMonitor does not report the `changed' event.
+           (skip-unless
+            (not (equal (file-notify--test-monitor) 'GKqueueFileMonitor)))
+
            ;; Check, that file notification has been used.
            (should auto-revert-mode)
            (should auto-revert-use-notify)
@@ -956,7 +979,7 @@ delivered."
 
            ;; Modify file.  We wait for two seconds, in order to
            ;; have another timestamp.  One second seems to be too
-            ;; short.  And Cygwin sporadically requires more than two.
+            ;; short.  And cygwin sporadically requires more than two.
             (ert-with-message-capture captured-messages
               (let ((inhibit-message t))
                 (sleep-for (if (eq system-type 'cygwin) 3 2))
@@ -1028,6 +1051,9 @@ delivered."
             ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe")
              '((deleted stopped)
                (changed deleted stopped)))
+            ;; GKqueueFileMonitor does not report the `changed' event.
+            ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+             '(deleted stopped))
             ;; There could be one or two `changed' events.
             (t '((changed deleted stopped)
                  (changed changed deleted stopped))))
@@ -1077,6 +1103,9 @@ delivered."
                '(created deleted stopped))
               ((string-equal (file-notify--test-library) "kqueue")
                '(created changed deleted stopped))
+              ;; GKqueueFileMonitor does not report the `changed' event.
+              ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+               '(created deleted deleted stopped))
               (t '(created changed deleted deleted stopped)))
            (write-region
             "any text" nil file-notify--test-tmpfile nil 'no-message)
@@ -1254,9 +1283,12 @@ delivered."
                '(change) #'file-notify--test-event-handler)))
         (should (file-notify-valid-p file-notify--test-desc))
         (file-notify--test-with-actions
-            ;; There could be one or two `changed' events.
-            '((changed)
-              (changed changed))
+           (cond
+            ;; GKqueueFileMonitor does not report the `changed' event.
+            ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) nil)
+             ;; There could be one or two `changed' events.
+            (t '((changed)
+                 (changed changed))))
           ;; There shouldn't be any problem, because the file is kept.
           (with-temp-buffer
             (let ((buffer-file-name file-notify--test-tmpfile)
@@ -1294,6 +1326,9 @@ delivered."
              ;; On cygwin we only get the `changed' event.
              ((eq system-type 'cygwin)
               '(changed))
+            ;; GKqueueFileMonitor does not report the `changed' event.
+            ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+             '(renamed created))
              (t '(renamed created changed)))
           ;; The file is renamed when creating a backup.  It shall
           ;; still be watched.
@@ -1391,7 +1426,12 @@ the file watch."
                 (make-list (/ n 2) 'changed)
                 ;; Just the directory monitor.
                 (make-list (/ n 2) 'created)
-                (make-list (/ n 2) 'changed)))
+                (make-list (/ n 2) 'changed))
+              (append
+                '(:random)
+               ;; Just the directory monitor.  GKqueueFileMonitor
+               ;; does not report the `changed' event.
+                (make-list (/ n 2) 'created)))
             (dotimes (i n)
               (file-notify--test-read-event)
               (if (zerop (mod i 2))
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 8818099..149cc68 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -1,6 +1,6 @@
 ;;; files-tests.el --- tests for files.el.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/files-x-tests.el b/test/lisp/files-x-tests.el
index 6b05e6a..e97e2c3 100644
--- a/test/lisp/files-x-tests.el
+++ b/test/lisp/files-x-tests.el
@@ -1,6 +1,6 @@
 ;;; files-x-tests.el --- tests for files-x.el.  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
diff --git a/test/lisp/font-lock-tests.el b/test/lisp/font-lock-tests.el
index 477c430..eba51f2 100644
--- a/test/lisp/font-lock-tests.el
+++ b/test/lisp/font-lock-tests.el
@@ -1,6 +1,6 @@
 ;;; font-lock-tests.el --- Test suite for font-lock. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/format-spec-tests.el b/test/lisp/format-spec-tests.el
index 1188221..ff2abde 100644
--- a/test/lisp/format-spec-tests.el
+++ b/test/lisp/format-spec-tests.el
@@ -1,6 +1,6 @@
 ;;; format-spec-tests.el --- tests for format-spec.el -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -178,4 +178,14 @@
   (should (equal (format-spec "foo %>4b zot" '((?b . "longbar")))
                  "foo long zot")))
 
+(ert-deftest format-spec-split ()
+  (should (equal (format-spec "foo %b bar" '((?b . "zot")) nil t)
+                 '("foo " "zot" " bar")))
+  (should (equal (format-spec "%b bar" '((?b . "zot")) nil t)
+                 '("zot" " bar")))
+  (should (equal (format-spec "%b" '((?b . "zot")) nil t)
+                 '("zot")))
+  (should (equal (format-spec "foo %b" '((?b . "zot")) nil t)
+                 '("foo " "zot"))))
+
 ;;; format-spec-tests.el ends here
diff --git a/test/lisp/gnus/gnus-icalendar-tests.el 
b/test/lisp/gnus/gnus-icalendar-tests.el
index dd265b4..90c3a34 100644
--- a/test/lisp/gnus/gnus-icalendar-tests.el
+++ b/test/lisp/gnus/gnus-icalendar-tests.el
@@ -1,6 +1,6 @@
 ;;; gnus-icalendar-tests.el --- tests                -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Jan Tatarik <jan.tatarik@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/gnus/gnus-search-tests.el 
b/test/lisp/gnus/gnus-search-tests.el
index 5bae9cb..63469f8 100644
--- a/test/lisp/gnus/gnus-search-tests.el
+++ b/test/lisp/gnus/gnus-search-tests.el
@@ -1,6 +1,6 @@
 ;;; gnus-search-tests.el --- Tests for Gnus' search routines  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2017  Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
 ;; Keywords:
diff --git a/test/lisp/gnus/gnus-test-headers.el 
b/test/lisp/gnus/gnus-test-headers.el
index 958360a..a240784 100644
--- a/test/lisp/gnus/gnus-test-headers.el
+++ b/test/lisp/gnus/gnus-test-headers.el
@@ -1,6 +1,6 @@
 ;;; gnus-test-headers.el --- Tests for Gnus header-related functions  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
 
diff --git a/test/lisp/gnus/gnus-tests.el b/test/lisp/gnus/gnus-tests.el
index fb1b204..6602e67 100644
--- a/test/lisp/gnus/gnus-tests.el
+++ b/test/lisp/gnus/gnus-tests.el
@@ -1,6 +1,6 @@
 ;;; gnus-tests.el --- Wrapper for the Gnus tests  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Teodor Zlatanov <tzz@lifelogs.com>
 
diff --git a/test/lisp/gnus/gnus-util-tests.el 
b/test/lisp/gnus/gnus-util-tests.el
index 5a5e665..7f64b96 100644
--- a/test/lisp/gnus/gnus-util-tests.el
+++ b/test/lisp/gnus/gnus-util-tests.el
@@ -1,5 +1,5 @@
 ;;; gnus-util-tests.el --- Selectived tests only.  -*- lexical-binding:t -*-
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Jens Lechtenbörger <jens.lechtenboerger@fsfe.org>
 
diff --git a/test/lisp/gnus/message-tests.el b/test/lisp/gnus/message-tests.el
index 99a4ae4..8650053 100644
--- a/test/lisp/gnus/message-tests.el
+++ b/test/lisp/gnus/message-tests.el
@@ -1,6 +1,6 @@
 ;;; message-mode-tests.el --- Tests for message-mode  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: João Távora <joaotavora@gmail.com>
 
diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el
index a6002b4..b7431870 100644
--- a/test/lisp/gnus/mml-sec-tests.el
+++ b/test/lisp/gnus/mml-sec-tests.el
@@ -1,5 +1,5 @@
 ;;; mml-sec-tests.el --- Tests mml-sec.el, see README-mml-secure.txt.  -*- 
lexical-binding:t -*-
-;; Copyright (C) 2015, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Jens Lechtenbörger <jens.lechtenboerger@fsfe.org>
 
@@ -432,6 +432,7 @@ In both cases, the first key is customized for signing and 
encryption."
 (ert-deftest mml-secure-select-preferred-keys-4 ()
   "Multiple keys can be recorded per recipient or signature."
   (skip-unless (test-conf))
+  (skip-unless (ignore-errors (epg-find-configuration 'CMS)))
   (mml-secure-test-fixture
    (lambda ()
      (let ((pcontext (epg-make-context 'OpenPGP))
@@ -590,6 +591,7 @@ In this test, the single matching key is chosen 
automatically."
   "Encrypt message; then decrypt and test for expected result.
 In this test, the encryption key needs to fixed among multiple ones."
   (skip-unless (test-conf))
+  (skip-unless (ignore-errors (epg-find-configuration 'CMS)))
   ;; sub@example.org with multiple candidate keys,
   ;; fixture customizes preferred ones.
   (mml-secure-test-key-fixture
@@ -603,6 +605,7 @@ In this test, the encryption key needs to fixed among 
multiple ones."
   "Encrypt message; then decrypt and test for expected result.
 In this test, encrypt-to-self variables are set to t."
   (skip-unless (test-conf))
+  (skip-unless (ignore-errors (epg-find-configuration 'CMS)))
   ;; sub@example.org with multiple candidate keys,
   ;; fixture customizes preferred ones.
   (mml-secure-test-key-fixture
@@ -745,6 +748,7 @@ Use sign-with-sender and encrypt-to-self."
 (ert-deftest mml-secure-sign-verify-1 ()
   "Sign message with sender; then verify and test for expected result."
   (skip-unless (test-conf))
+  (skip-unless (ignore-errors (epg-find-configuration 'CMS)))
   (mml-secure-test-key-fixture
    (lambda ()
      (dolist (method (sign-standards) nil)
@@ -880,10 +884,12 @@ So the second decryption fails."
   (dolist (pid (list-system-processes))
     (let ((atts (process-attributes pid)))
       (when (and (equal (cdr (assq 'user atts)) (user-login-name))
-                 (equal (cdr (assq 'comm atts)) "gpg-agent")
+                 (or (equal (cdr (assq 'comm atts)) "gpg-agent")
+                    (equal (cdr (assq 'comm atts)) "scdaemon"))
                  (string-match
                   (concat "homedir.*"
-                          (regexp-quote (ert-resource-directory)))
+                          (regexp-quote (directory-file-name
+                                         (ert-resource-directory))))
                   (cdr (assq 'args atts))))
         (call-process "kill" nil nil nil (format "%d" pid))))))
 
diff --git a/test/lisp/gnus/nnrss-tests.el b/test/lisp/gnus/nnrss-tests.el
index a4040c9..9821ec7 100644
--- a/test/lisp/gnus/nnrss-tests.el
+++ b/test/lisp/gnus/nnrss-tests.el
@@ -1,6 +1,6 @@
 ;;; nnrss-tests.el --- tests for gnus/nnrss.el    -*- lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el
index 3359821..80d90da 100644
--- a/test/lisp/help-fns-tests.el
+++ b/test/lisp/help-fns-tests.el
@@ -1,6 +1,6 @@
 ;;; help-fns-tests.el --- tests for help-fns.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 
diff --git a/test/lisp/help-mode-tests.el b/test/lisp/help-mode-tests.el
index 2b9552a..e0e82c9 100644
--- a/test/lisp/help-mode-tests.el
+++ b/test/lisp/help-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; help-mode-tests.el --- Tests for help-mode.el    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el
index 49cb40b..95557c95 100644
--- a/test/lisp/help-tests.el
+++ b/test/lisp/help-tests.el
@@ -1,6 +1,6 @@
 ;;; help-tests.el --- Tests for help.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Juanma Barranquero <lekktu@gmail.com>
 ;;         Eli Zaretskii <eliz@gnu.org>
diff --git a/test/lisp/hfy-cmap-tests.el b/test/lisp/hfy-cmap-tests.el
index 4cdc6ff..7e0be37 100644
--- a/test/lisp/hfy-cmap-tests.el
+++ b/test/lisp/hfy-cmap-tests.el
@@ -1,6 +1,6 @@
 ;;; hfy-cmap-tests.el --- tests for hfy-cmap.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/hi-lock-tests.el b/test/lisp/hi-lock-tests.el
index d30a6d0..199512f 100644
--- a/test/lisp/hi-lock-tests.el
+++ b/test/lisp/hi-lock-tests.el
@@ -1,6 +1,6 @@
 ;;; hi-lock-tests.el --- Tests for hi-lock.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Tino Calancha <tino.calancha@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/htmlfontify-tests.el b/test/lisp/htmlfontify-tests.el
index 4e48db3..879131c 100644
--- a/test/lisp/htmlfontify-tests.el
+++ b/test/lisp/htmlfontify-tests.el
@@ -1,6 +1,6 @@
 ;;; htmlfontify-tests.el --- Test suite. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/ibuffer-tests.el b/test/lisp/ibuffer-tests.el
index 2211cae..a510791 100644
--- a/test/lisp/ibuffer-tests.el
+++ b/test/lisp/ibuffer-tests.el
@@ -1,6 +1,6 @@
 ;;; ibuffer-tests.el --- Test suite. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/ido-tests.el b/test/lisp/ido-tests.el
index 1bca4cd..90a64b2 100644
--- a/test/lisp/ido-tests.el
+++ b/test/lisp/ido-tests.el
@@ -1,6 +1,6 @@
 ;;; ido-tests.el --- unit tests for ido.el           -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Philipp Stephani <phst@google.com>
 
diff --git a/test/lisp/image-file-tests.el b/test/lisp/image-file-tests.el
index ad7c26e..d3290f6 100644
--- a/test/lisp/image-file-tests.el
+++ b/test/lisp/image-file-tests.el
@@ -1,6 +1,6 @@
 ;;; image-file-tests.el --- Test suite for image-files  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el
index 0355e78..ab7585c 100644
--- a/test/lisp/image-tests.el
+++ b/test/lisp/image-tests.el
@@ -1,6 +1,6 @@
 ;;; image-tests.el --- tests for image.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/image/exif-tests.el b/test/lisp/image/exif-tests.el
index 9e5da46..ddbee75 100644
--- a/test/lisp/image/exif-tests.el
+++ b/test/lisp/image/exif-tests.el
@@ -1,6 +1,6 @@
 ;;; exif-tests.el --- tests for exif.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/image/gravatar-tests.el 
b/test/lisp/image/gravatar-tests.el
index 43c3024..2324dc5 100644
--- a/test/lisp/image/gravatar-tests.el
+++ b/test/lisp/image/gravatar-tests.el
@@ -1,6 +1,6 @@
 ;;; gravatar-tests.el --- tests for gravatar.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/imenu-tests.el b/test/lisp/imenu-tests.el
index e5cdb9e..17f2501 100644
--- a/test/lisp/imenu-tests.el
+++ b/test/lisp/imenu-tests.el
@@ -1,6 +1,6 @@
 ;;; imenu-tests.el --- Test suite for imenu.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Masatake YAMATO <yamato@redhat.com>
 ;; Keywords: tools convenience
diff --git a/test/lisp/info-xref-tests.el b/test/lisp/info-xref-tests.el
index 940aa7d..95af21f 100644
--- a/test/lisp/info-xref-tests.el
+++ b/test/lisp/info-xref-tests.el
@@ -1,6 +1,6 @@
 ;;; info-xref.el --- tests for info-xref.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/international/ccl-tests.el 
b/test/lisp/international/ccl-tests.el
index 16e591f..0f765e4 100644
--- a/test/lisp/international/ccl-tests.el
+++ b/test/lisp/international/ccl-tests.el
@@ -1,6 +1,6 @@
 ;;; ccl-tests.el --- unit tests for ccl.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/international/mule-tests.el 
b/test/lisp/international/mule-tests.el
index 9520d9d..7727c11 100644
--- a/test/lisp/international/mule-tests.el
+++ b/test/lisp/international/mule-tests.el
@@ -1,6 +1,6 @@
 ;;; mule-tests.el --- unit tests for mule.el         -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/international/mule-util-tests.el 
b/test/lisp/international/mule-util-tests.el
index 0524dad..6518be6 100644
--- a/test/lisp/international/mule-util-tests.el
+++ b/test/lisp/international/mule-util-tests.el
@@ -1,6 +1,6 @@
 ;;; mule-util-tests.el --- tests for international/mule-util.el  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/international/ucs-normalize-tests.el 
b/test/lisp/international/ucs-normalize-tests.el
index 2c60bd3..a2da737 100644
--- a/test/lisp/international/ucs-normalize-tests.el
+++ b/test/lisp/international/ucs-normalize-tests.el
@@ -1,6 +1,6 @@
 ;;; ucs-normalize --- tests for international/ucs-normalize.el -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/isearch-tests.el b/test/lisp/isearch-tests.el
index 516077a..9f3ac37 100644
--- a/test/lisp/isearch-tests.el
+++ b/test/lisp/isearch-tests.el
@@ -1,6 +1,6 @@
 ;;; isearch-tests.el --- Tests for isearch.el        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Artur Malabarba <bruce.connor.am@gmail.com>
 
diff --git a/test/lisp/jit-lock-tests.el b/test/lisp/jit-lock-tests.el
index dfa74cf..121966b 100644
--- a/test/lisp/jit-lock-tests.el
+++ b/test/lisp/jit-lock-tests.el
@@ -1,6 +1,6 @@
 ;;; jit-lock-tests.el --- tests for jit-lock  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Dmitry Gutov <dgutov@yandex.ru>
 
diff --git a/test/lisp/json-tests.el b/test/lisp/json-tests.el
index 8ac4544..11b61d8 100644
--- a/test/lisp/json-tests.el
+++ b/test/lisp/json-tests.el
@@ -1,6 +1,6 @@
 ;;; json-tests.el --- Test suite for json.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Dmitry Gutov <dgutov@yandex.ru>
 
diff --git a/test/lisp/jsonrpc-tests.el b/test/lisp/jsonrpc-tests.el
index 1ef83da..ea340c3 100644
--- a/test/lisp/jsonrpc-tests.el
+++ b/test/lisp/jsonrpc-tests.el
@@ -1,6 +1,6 @@
 ;;; jsonrpc-tests.el --- tests for jsonrpc.el        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: João Távora <joaotavora@gmail.com>
 ;; Keywords: tests
diff --git a/test/lisp/kmacro-tests.el b/test/lisp/kmacro-tests.el
index bb18c82..c891072 100644
--- a/test/lisp/kmacro-tests.el
+++ b/test/lisp/kmacro-tests.el
@@ -1,6 +1,6 @@
 ;;; kmacro-tests.el --- Tests for kmacro.el       -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Gemini Lasswell <gazally@runbox.com>
 
diff --git a/test/lisp/ls-lisp-tests.el b/test/lisp/ls-lisp-tests.el
index e08e406..e386398 100644
--- a/test/lisp/ls-lisp-tests.el
+++ b/test/lisp/ls-lisp-tests.el
@@ -1,6 +1,6 @@
 ;;; ls-lisp-tests.el --- tests for ls-lisp.el  -*- lexical-binding: t-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Tino Calancha <tino.calancha@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/mail/flow-fill-tests.el 
b/test/lisp/mail/flow-fill-tests.el
index c2e4178..ec5b984 100644
--- a/test/lisp/mail/flow-fill-tests.el
+++ b/test/lisp/mail/flow-fill-tests.el
@@ -1,6 +1,6 @@
 ;;; flow-fill-tests.el --- Tests for flow-fill.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/mail/footnote-tests.el b/test/lisp/mail/footnote-tests.el
index 6594aa2..731ba3e 100644
--- a/test/lisp/mail/footnote-tests.el
+++ b/test/lisp/mail/footnote-tests.el
@@ -1,6 +1,6 @@
 ;;; footnote-tests.el --- Tests for footnote-mode    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords:
diff --git a/test/lisp/mail/qp-tests.el b/test/lisp/mail/qp-tests.el
index 8d70449..89f0289 100644
--- a/test/lisp/mail/qp-tests.el
+++ b/test/lisp/mail/qp-tests.el
@@ -1,6 +1,6 @@
 ;;; qp-tests.el --- Tests for qp.el  -*- lexical-binding:t; coding:utf-8 -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/mail/rfc2045-tests.el b/test/lisp/mail/rfc2045-tests.el
index edd7a88..ac547aa 100644
--- a/test/lisp/mail/rfc2045-tests.el
+++ b/test/lisp/mail/rfc2045-tests.el
@@ -1,6 +1,6 @@
 ;;; rfc2045-tests.el --- Tests for rfc2045.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/mail/rfc2047-tests.el b/test/lisp/mail/rfc2047-tests.el
index 7a99e85..befcbc0 100644
--- a/test/lisp/mail/rfc2047-tests.el
+++ b/test/lisp/mail/rfc2047-tests.el
@@ -1,6 +1,6 @@
 ;;; rfc2047-tests.el --- tests for rfc2047.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/mail/rfc2368-tests.el b/test/lisp/mail/rfc2368-tests.el
index c35b8e3..f997ea3 100644
--- a/test/lisp/mail/rfc2368-tests.el
+++ b/test/lisp/mail/rfc2368-tests.el
@@ -1,6 +1,6 @@
 ;;; rfc2368-tests.el --- Tests for rfc2368.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/mail/rfc822-tests.el b/test/lisp/mail/rfc822-tests.el
index d13966c..3e36a61 100644
--- a/test/lisp/mail/rfc822-tests.el
+++ b/test/lisp/mail/rfc822-tests.el
@@ -1,6 +1,6 @@
 ;;; rfc822-tests.el --- Tests for rfc822.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/mail/rmail-tests.el b/test/lisp/mail/rmail-tests.el
index f96c31c..f533401 100644
--- a/test/lisp/mail/rmail-tests.el
+++ b/test/lisp/mail/rmail-tests.el
@@ -1,6 +1,6 @@
 ;;; rmail-tests.el --- Test suite. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/mail/rmailmm-tests.el b/test/lisp/mail/rmailmm-tests.el
index 645bb96..a022008 100644
--- a/test/lisp/mail/rmailmm-tests.el
+++ b/test/lisp/mail/rmailmm-tests.el
@@ -1,6 +1,6 @@
 ;;; rmailmm-tests.el --- Tests for rmailmm.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/mail/uudecode-tests.el b/test/lisp/mail/uudecode-tests.el
index 1756625..6ff7675 100644
--- a/test/lisp/mail/uudecode-tests.el
+++ b/test/lisp/mail/uudecode-tests.el
@@ -1,6 +1,6 @@
 ;;; uudecode-tests.el --- Tests for uudecode.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/makesum-tests.el b/test/lisp/makesum-tests.el
index d4dd832..2b57af7 100644
--- a/test/lisp/makesum-tests.el
+++ b/test/lisp/makesum-tests.el
@@ -1,6 +1,6 @@
 ;;; makesum-tests.el --- Tests for makesum.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/man-tests.el b/test/lisp/man-tests.el
index ddf22ec..7fb0c5e 100644
--- a/test/lisp/man-tests.el
+++ b/test/lisp/man-tests.el
@@ -1,6 +1,6 @@
 ;;; man-tests.el --- Test suite for man.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Wolfgang Jenkner <wjenkner@inode.at>
 ;; Keywords: help, internal, unix
diff --git a/test/lisp/md4-tests.el b/test/lisp/md4-tests.el
index 5c995ff..ac7eede 100644
--- a/test/lisp/md4-tests.el
+++ b/test/lisp/md4-tests.el
@@ -1,6 +1,6 @@
 ;;; md4-tests.el --- tests for md4.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Mark Oteiza <mvoteiza@udel.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index 3273479..3ebca14 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -1,6 +1,6 @@
 ;;; completion-tests.el --- Tests for completion functions  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords:
diff --git a/test/lisp/misc-tests.el b/test/lisp/misc-tests.el
index fbcbfb7..a519fd1 100644
--- a/test/lisp/misc-tests.el
+++ b/test/lisp/misc-tests.el
@@ -1,6 +1,6 @@
 ;;; misc-tests.el --- Tests for misc.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/mouse-tests.el b/test/lisp/mouse-tests.el
index d520da7..56411d0 100644
--- a/test/lisp/mouse-tests.el
+++ b/test/lisp/mouse-tests.el
@@ -1,6 +1,6 @@
 ;;; mouse-tests.el --- unit tests for mouse.el       -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Philipp Stephani <phst@google.com>
 
diff --git a/test/lisp/mwheel-tests.el b/test/lisp/mwheel-tests.el
index 315f25e..058f1a8 100644
--- a/test/lisp/mwheel-tests.el
+++ b/test/lisp/mwheel-tests.el
@@ -1,6 +1,6 @@
 ;;; mwheel-tests.el --- tests for mwheel.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/net/browse-url-tests.el 
b/test/lisp/net/browse-url-tests.el
index b2b27d2..898bef8 100644
--- a/test/lisp/net/browse-url-tests.el
+++ b/test/lisp/net/browse-url-tests.el
@@ -1,6 +1,6 @@
 ;;; browse-url-tests.el --- Tests for browse-url.el  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el
index 3cfb4b7..34a2af1 100644
--- a/test/lisp/net/dbus-tests.el
+++ b/test/lisp/net/dbus-tests.el
@@ -1,6 +1,6 @@
 ;;; dbus-tests.el --- Tests of D-Bus integration into Emacs  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
diff --git a/test/lisp/net/dig-tests.el b/test/lisp/net/dig-tests.el
index 1b14384..780985c 100644
--- a/test/lisp/net/dig-tests.el
+++ b/test/lisp/net/dig-tests.el
@@ -1,6 +1,6 @@
 ;;; dig-tests.el --- Tests for dig.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/net/gnutls-tests.el b/test/lisp/net/gnutls-tests.el
index 5205f0b..76c00b7 100644
--- a/test/lisp/net/gnutls-tests.el
+++ b/test/lisp/net/gnutls-tests.el
@@ -1,6 +1,6 @@
 ;;; gnutls-tests.el --- Test suite for gnutls.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Ted Zlatanov <tzz@lifelogs.com>
 
diff --git a/test/lisp/net/hmac-md5-tests.el b/test/lisp/net/hmac-md5-tests.el
index 30d221e..8e01353 100644
--- a/test/lisp/net/hmac-md5-tests.el
+++ b/test/lisp/net/hmac-md5-tests.el
@@ -1,6 +1,6 @@
 ;;; hmac-md5-tests.el --- Tests for hmac-md5.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/net/mailcap-tests.el b/test/lisp/net/mailcap-tests.el
index 0ebbec6..a1a0832 100644
--- a/test/lisp/net/mailcap-tests.el
+++ b/test/lisp/net/mailcap-tests.el
@@ -1,6 +1,6 @@
 ;;; mailcap-tests.el --- tests for mailcap.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Mark Oteiza <mvoteiza@udel.edu>
 
diff --git a/test/lisp/net/netrc-tests.el b/test/lisp/net/netrc-tests.el
index 2919439..1328b19 100644
--- a/test/lisp/net/netrc-tests.el
+++ b/test/lisp/net/netrc-tests.el
@@ -1,6 +1,6 @@
 ;;; netrc-tests.el --- Tests for netrc.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/net/network-stream-tests.el 
b/test/lisp/net/network-stream-tests.el
index 07eb282..e0a06a2 100644
--- a/test/lisp/net/network-stream-tests.el
+++ b/test/lisp/net/network-stream-tests.el
@@ -1,6 +1,6 @@
 ;;; network-stream-tests.el --- tests for network processes       -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Ingebrigtsen <larsi@gnus.org>
 
diff --git a/test/lisp/net/newsticker-tests.el 
b/test/lisp/net/newsticker-tests.el
index 5552fa8..e08f311 100644
--- a/test/lisp/net/newsticker-tests.el
+++ b/test/lisp/net/newsticker-tests.el
@@ -1,6 +1,6 @@
 ;;; newsticker-tests.el --- Test suite for newsticker.  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author:      Ulf Jasper <ulf.jasper@web.de>
 ;; Keywords:    News, RSS, Atom
diff --git a/test/lisp/net/nsm-tests.el b/test/lisp/net/nsm-tests.el
index c547533..88c30c2 100644
--- a/test/lisp/net/nsm-tests.el
+++ b/test/lisp/net/nsm-tests.el
@@ -1,6 +1,6 @@
 ;;; network-stream-tests.el --- tests for network security manager -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Robert Pluim <rpluim@gmail.com>
 
diff --git a/test/lisp/net/ntlm-tests.el b/test/lisp/net/ntlm-tests.el
index e515ebe..6408ac1 100644
--- a/test/lisp/net/ntlm-tests.el
+++ b/test/lisp/net/ntlm-tests.el
@@ -1,6 +1,6 @@
 ;;; ntlm-tests.el --- tests for ntlm.el            -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/net/puny-tests.el b/test/lisp/net/puny-tests.el
index 7dac397..b37168f 100644
--- a/test/lisp/net/puny-tests.el
+++ b/test/lisp/net/puny-tests.el
@@ -1,6 +1,6 @@
 ;;; puny-tests.el --- tests for net/puny.el  -*- coding: utf-8; 
lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/net/rcirc-tests.el b/test/lisp/net/rcirc-tests.el
index 285926a..fd96b7b 100644
--- a/test/lisp/net/rcirc-tests.el
+++ b/test/lisp/net/rcirc-tests.el
@@ -1,6 +1,6 @@
 ;;; rcirc-tests.el --- Tests for rcirc -*- lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 ;;
@@ -51,4 +51,16 @@
     "MODE #cchan +kl :a:b"
     nil "MODE" '("#cchan" "+kl" "a:b")))
 
+(ert-deftest rcirc-rename-nicks ()
+  (should (equal (rcirc--make-new-nick "foo" 16)
+                 "foo`"))
+  (should (equal (rcirc--make-new-nick "123456789012345" 16)
+                 "123456789012345`"))
+  (should (equal (rcirc--make-new-nick "1234567890123456" 16)
+                 "123456789012345`"))
+  (should (equal (rcirc--make-new-nick "123456789012345`" 16)
+                 "12345678901234``"))
+  (should (equal (rcirc--make-new-nick "123456789012````" 16)
+                 "12345678901`````")))
+
 ;;; rcirc-tests.el ends here
diff --git a/test/lisp/net/rfc2104-tests.el b/test/lisp/net/rfc2104-tests.el
index e7d5a7f..f3498e7 100644
--- a/test/lisp/net/rfc2104-tests.el
+++ b/test/lisp/net/rfc2104-tests.el
@@ -1,6 +1,6 @@
 ;;; rfc2104-tests.el --- Tests of RFC2104 hashes  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Ingebrigtsen <larsi@gnus.org>
 
diff --git a/test/lisp/net/sasl-scram-rfc-tests.el 
b/test/lisp/net/sasl-scram-rfc-tests.el
index 09e05b6..3e9879a 100644
--- a/test/lisp/net/sasl-scram-rfc-tests.el
+++ b/test/lisp/net/sasl-scram-rfc-tests.el
@@ -1,6 +1,6 @@
 ;;; sasl-scram-rfc-tests.el --- tests for SCRAM       -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Magnus Henoch <magnus.henoch@gmail.com>
 
diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el
index 1e2cf3a..b392c4d 100644
--- a/test/lisp/net/secrets-tests.el
+++ b/test/lisp/net/secrets-tests.el
@@ -1,6 +1,6 @@
 ;;; secrets-tests.el --- Tests of Secret Service API -*- lexical-binding: t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el
index abc4f6a..a06e31a 100644
--- a/test/lisp/net/shr-tests.el
+++ b/test/lisp/net/shr-tests.el
@@ -1,6 +1,6 @@
 ;;; network-stream-tests.el --- tests for network processes       -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Ingebrigtsen <larsi@gnus.org>
 
diff --git a/test/lisp/net/tramp-archive-tests.el 
b/test/lisp/net/tramp-archive-tests.el
index 97c22fd..6a6b56f 100644
--- a/test/lisp/net/tramp-archive-tests.el
+++ b/test/lisp/net/tramp-archive-tests.el
@@ -1,6 +1,6 @@
 ;;; tramp-archive-tests.el --- Tests of file archive access  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 819a3df..896b997 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -1,6 +1,6 @@
 ;;; tramp-tests.el --- Tests of remote file access  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
@@ -4459,6 +4459,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
                (should-error
                 (start-file-process "test4" (current-buffer) nil)
                 :type 'wrong-type-argument)
+
              (setq proc (start-file-process "test4" (current-buffer) nil))
              (should (processp proc))
              (should (equal (process-status proc) 'run))
@@ -4474,21 +4475,30 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
   "Define ert test `TEST-direct-async' for direct async processes.
 If UNSTABLE is non-nil, the test is tagged as `:unstable'."
   (declare (indent 1))
-  `(ert-deftest ,(intern (concat (symbol-name test) "-direct-async")) ()
-     ,docstring
-     :tags (if ,unstable '(:expensive-test :unstable) '(:expensive-test))
-     (skip-unless (tramp--test-enabled))
-     (let ((default-directory  tramp-test-temporary-file-directory)
-          (ert-test (ert-get-test ',test))
-          (tramp-connection-properties
-           (cons '(nil "direct-async-process" t) tramp-connection-properties)))
-       (skip-unless (tramp-direct-async-process-p))
-       ;; We do expect an established connection already,
-       ;; `file-truename' does it by side-effect.  Suppress
-       ;; `tramp--test-enabled', in order to keep the connection.
-       (cl-letf (((symbol-function #'tramp--test-enabled) (lambda nil t)))
-        (file-truename tramp-test-temporary-file-directory)
-        (funcall (ert-test-body ert-test))))))
+  ;; `make-process' supports file name handlers since Emacs 27.
+  (when (let ((file-name-handler-alist '(("" . (lambda (&rest _) t)))))
+         (ignore-errors (make-process :file-handler t)))
+    `(ert-deftest ,(intern (concat (symbol-name test) "-direct-async")) ()
+       ,docstring
+       :tags (if ,unstable '(:expensive-test :unstable) '(:expensive-test))
+       (skip-unless (tramp--test-enabled))
+       (let ((default-directory tramp-test-temporary-file-directory)
+            (ert-test (ert-get-test ',test))
+            (tramp-connection-properties
+             (cons '(nil "direct-async-process" t)
+                   tramp-connection-properties)))
+        (skip-unless (tramp-direct-async-process-p))
+        ;; For whatever reason, it doesn't cooperate with the "mock" method.
+        (skip-unless (not (tramp--test-mock-p)))
+        ;; We do expect an established connection already,
+        ;; `file-truename' does it by side-effect.  Suppress
+        ;; `tramp--test-enabled', in order to keep the connection.
+        ;; Suppress "Process ... finished" messages.
+        (cl-letf (((symbol-function #'tramp--test-enabled) (lambda nil t))
+                  ((symbol-function #'internal-default-process-sentinel)
+                   #'ignore))
+          (file-truename tramp-test-temporary-file-directory)
+          (funcall (ert-test-body ert-test)))))))
 
 (tramp--test--deftest-direct-async-process tramp-test29-start-file-process
   "Check direct async `start-file-process'.")
@@ -4660,7 +4670,8 @@ If UNSTABLE is non-nil, the test is tagged as 
`:unstable'."
 
 (ert-deftest tramp-test31-interrupt-process ()
   "Check `interrupt-process'."
-  :tags '(:expensive-test)
+  :tags (if (getenv "EMACS_EMBA_CI")
+           '(:expensive-test :unstable) '(:expensive-test))
   (skip-unless (tramp--test-enabled))
   (skip-unless (tramp--test-sh-p))
   (skip-unless (not (tramp--test-crypt-p)))
@@ -4700,15 +4711,16 @@ If UNSTABLE is non-nil, the test is tagged as 
`:unstable'."
     (command output-buffer &optional error-buffer input)
   "Like `async-shell-command', reading the output.
 INPUT, if non-nil, is a string sent to the process."
-  (async-shell-command command output-buffer error-buffer)
-  (let ((proc (get-buffer-process output-buffer))
+  (let ((proc (async-shell-command command output-buffer error-buffer))
        (delete-exited-processes t))
-    (when (stringp input)
-      (process-send-string proc input))
-    (with-timeout
-       ((if (getenv "EMACS_EMBA_CI") 30 10) (tramp--test-timeout-handler))
-      (while (or (accept-process-output proc nil nil t) (process-live-p 
proc))))
-    (accept-process-output proc nil nil t)))
+    (cl-letf (((symbol-function #'shell-command-sentinel) #'ignore))
+      (when (stringp input)
+       (process-send-string proc input))
+      (with-timeout
+         ((if (getenv "EMACS_EMBA_CI") 30 10) (tramp--test-timeout-handler))
+       (while
+           (or (accept-process-output proc nil nil t) (process-live-p proc))))
+      (accept-process-output proc nil nil t))))
 
 (defun tramp--test-shell-command-to-string-asynchronously (command)
   "Like `shell-command-to-string', but for asynchronous processes."
@@ -4762,19 +4774,20 @@ INPUT, if non-nil, is a string sent to the process."
          (ignore-errors (delete-file tmp-name)))
 
        ;; Test `{async-}shell-command' with error buffer.
-       (let ((stderr (generate-new-buffer "*stderr*")))
-         (unwind-protect
-             (with-temp-buffer
-               (funcall
-                this-shell-command
-                "echo foo >&2; echo bar" (current-buffer) stderr)
-               (should (string-equal "bar\n" (buffer-string)))
-               ;; Check stderr.
-               (with-current-buffer stderr
-                 (should (string-equal "foo\n" (buffer-string)))))
+       (unless (tramp-direct-async-process-p)
+         (let ((stderr (generate-new-buffer "*stderr*")))
+           (unwind-protect
+               (with-temp-buffer
+                 (funcall
+                  this-shell-command
+                  "echo foo >&2; echo bar" (current-buffer) stderr)
+                 (should (string-equal "bar\n" (buffer-string)))
+                 ;; Check stderr.
+                 (with-current-buffer stderr
+                   (should (string-equal "foo\n" (buffer-string)))))
 
-           ;; Cleanup.
-           (ignore-errors (kill-buffer stderr)))))
+             ;; Cleanup.
+             (ignore-errors (kill-buffer stderr))))))
 
       ;; Test sending string to `async-shell-command'.
       (unwind-protect
@@ -4810,6 +4823,9 @@ INPUT, if non-nil, is a string sent to the process."
       (when (natnump cols)
        (should (= cols async-shell-command-width))))))
 
+(tramp--test--deftest-direct-async-process tramp-test32-shell-command
+  "Check direct async `shell-command'." 'unstable)
+
 ;; This test is inspired by Bug#39067.
 (ert-deftest tramp-test32-shell-command-dont-erase-buffer ()
   "Check `shell-command-dont-erase-buffer'."
@@ -4817,6 +4833,7 @@ INPUT, if non-nil, is a string sent to the process."
   ;; this test cannot run properly.
   :tags '(:expensive-test :unstable)
   (skip-unless (tramp--test-enabled))
+  (skip-unless nil)
   (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
   (skip-unless (not (tramp--test-crypt-p)))
   ;; Prior Emacs 27, `shell-command-dont-erase-buffer' wasn't working properly.
@@ -4960,7 +4977,7 @@ INPUT, if non-nil, is a string sent to the process."
       (should
        (string-equal
        (format "%s,tramp:%s\n" emacs-version tramp-version)
-       (funcall this-shell-command-to-string "echo ${INSIDE_EMACS:-bla}")))
+       (funcall this-shell-command-to-string "echo \"${INSIDE_EMACS:-bla}\"")))
       (let ((process-environment
             (cons (format "INSIDE_EMACS=%s,foo" emacs-version)
                   process-environment)))
@@ -4968,7 +4985,7 @@ INPUT, if non-nil, is a string sent to the process."
         (string-equal
          (format "%s,foo,tramp:%s\n" emacs-version tramp-version)
          (funcall
-          this-shell-command-to-string "echo ${INSIDE_EMACS:-bla}"))))
+          this-shell-command-to-string "echo \"${INSIDE_EMACS:-bla}\""))))
 
       ;; Set a value.
       (let ((process-environment
@@ -4978,7 +4995,8 @@ INPUT, if non-nil, is a string sent to the process."
         (string-match
          "foo"
          (funcall
-          this-shell-command-to-string (format "echo ${%s:-bla}" envvar)))))
+          this-shell-command-to-string
+          (format "echo \"${%s:-bla}\"" envvar)))))
 
       ;; Set the empty value.
       (let ((process-environment
@@ -4988,38 +5006,45 @@ INPUT, if non-nil, is a string sent to the process."
         (string-match
          "bla"
          (funcall
-          this-shell-command-to-string (format "echo ${%s:-bla}" envvar))))
+          this-shell-command-to-string (format "echo \"${%s:-bla}\"" envvar))))
        ;; Variable is set.
        (should
         (string-match
          (regexp-quote envvar)
          (funcall this-shell-command-to-string "set"))))
 
-      ;; We force a reconnect, in order to have a clean environment.
-      (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
-      ;; Unset the variable.
-      (let ((tramp-remote-process-environment
-            (cons (concat envvar "=foo") tramp-remote-process-environment)))
-       ;; Set the initial value, we want to unset below.
-       (should
-        (string-match
-         "foo"
-         (funcall
-          this-shell-command-to-string (format "echo ${%s:-bla}" envvar))))
-       (let ((process-environment (cons envvar process-environment)))
-         ;; Variable is unset.
+      (unless (tramp-direct-async-process-p)
+       ;; We force a reconnect, in order to have a clean environment.
+       (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+       ;; Unset the variable.
+       (let ((tramp-remote-process-environment
+              (cons (concat envvar "=foo") tramp-remote-process-environment)))
+         ;; Set the initial value, we want to unset below.
          (should
           (string-match
-           "bla"
-           (funcall
-            this-shell-command-to-string (format "echo ${%s:-bla}" envvar))))
-         ;; Variable is unset.
-         (should-not
-          (string-match
-           (regexp-quote envvar)
-           ;; We must remove PS1, the output is truncated otherwise.
+           "foo"
            (funcall
-            this-shell-command-to-string "printenv | grep -v PS1"))))))))
+            this-shell-command-to-string
+            (format "echo \"${%s:-bla}\"" envvar))))
+         (let ((process-environment (cons envvar process-environment)))
+           ;; Variable is unset.
+           (should
+            (string-match
+             "bla"
+             (funcall
+              this-shell-command-to-string
+              (format "echo \"${%s:-bla}\"" envvar))))
+           ;; Variable is unset.
+           (should-not
+            (string-match
+             (regexp-quote envvar)
+             ;; We must remove PS1, the output is truncated otherwise.
+             (funcall
+              this-shell-command-to-string "printenv | grep -v PS1")))))))))
+
+(tramp--test--deftest-direct-async-process tramp-test33-environment-variables
+  "Check that remote processes set / unset environment variables properly.
+Use direct async.")
 
 ;; This test is inspired by Bug#27009.
 (ert-deftest tramp-test33-environment-variables-and-port-numbers ()
@@ -6236,15 +6261,15 @@ This is needed in timer functions as well as process 
filters and sentinels."
   "Check parallel asynchronous requests.
 Such requests could arrive from timers, process filters and
 process sentinels.  They shall not disturb each other."
-  ;; The test fails from time to time, w/o a reproducible pattern.  So
-  ;; we mark it as unstable.
-  :tags '(:expensive-test :unstable)
+  :tags (if (getenv "EMACS_EMBA_CI")
+           '(:expensive-test :unstable) '(:expensive-test))
   (skip-unless (tramp--test-enabled))
   ;; Prior Emacs 27, `shell-file-name' was hard coded as "/bin/sh" for
   ;; remote processes in Emacs.  That doesn't work for tramp-adb.el.
   (skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p))
                   (tramp--test-sh-p)))
   (skip-unless (not (tramp--test-crypt-p)))
+  (skip-unless (not (tramp--test-docker-p)))
 
   (with-timeout
       (tramp--test-asynchronous-requests-timeout (tramp--test-timeout-handler))
@@ -6283,10 +6308,10 @@ process sentinels.  They shall not disturb each other."
              ((getenv "EMACS_HYDRA_CI") 10)
              (t 1)))
            ;; We must distinguish due to performance reasons.
-           ;; (timer-operation
-           ;;  (cond
-           ;;   ((tramp--test-mock-p) #'vc-registered)
-           ;;   (t #'file-attributes)))
+           (timer-operation
+            (cond
+             ((tramp--test-mock-p) #'vc-registered)
+             (t #'file-attributes)))
           ;; This is when all timers start.  We check inside the
           ;; timer function, that we don't exceed timeout.
           (timer-start (current-time))
@@ -6314,10 +6339,15 @@ process sentinels.  They shall not disturb each other."
                           (default-directory tmp-name)
                           (file
                            (buffer-name
-                            (nth (random (length buffers)) buffers))))
+                            (nth (random (length buffers)) buffers)))
+                         ;; A remote operation in a timer could
+                         ;; confuse Tramp heavily.  So we ignore this
+                         ;; error here.
+                         (debug-ignored-errors
+                          (cons 'remote-file-error debug-ignored-errors)))
                       (tramp--test-message
                        "Start timer %s %s" file (current-time-string))
-                      ;; (funcall timer-operation file)
+                     (funcall timer-operation file)
                       (tramp--test-message
                        "Stop timer %s %s" file (current-time-string))
                       ;; Adjust timer if it takes too much time.
@@ -6427,6 +6457,9 @@ process sentinels.  They shall not disturb each other."
         (ignore-errors (cancel-timer timer))
         (ignore-errors (delete-directory tmp-name 'recursive))))))
 
+;; (tramp--test--deftest-direct-async-process 
tramp-test43-asynchronous-requests
+;;   "Check parallel direct asynchronous requests." 'unstable)
+
 ;; This test is inspired by Bug#29163.
 (ert-deftest tramp-test44-auto-load ()
   "Check that Tramp autoloads properly."
@@ -6618,14 +6651,12 @@ If INTERACTIVE is non-nil, the tests are run 
interactively."
 
 ;; * Work on skipped tests.  Make a comment, when it is impossible.
 ;; * Revisit expensive tests, once problems in `tramp-error' are solved.
-;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'.
 ;; * Fix `tramp-test06-directory-file-name' for `ftp'.
 ;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file'
 ;;   do not work properly for `nextcloud'.
 ;; * Implement `tramp-test31-interrupt-process' for `adb' and for
 ;;   direct async processes.
-;; * Fix Bug#16928 in `tramp-test43-asynchronous-requests'.  A remote
-;;   file name operation cannot run in the timer.  Remove `:unstable' tag?
+;; * Fix `tramp-test44-threads'.
 
 (provide 'tramp-tests)
 
diff --git a/test/lisp/net/webjump-tests.el b/test/lisp/net/webjump-tests.el
index 47569c9..f767099 100644
--- a/test/lisp/net/webjump-tests.el
+++ b/test/lisp/net/webjump-tests.el
@@ -1,6 +1,6 @@
 ;;; webjump-tests.el --- Tests for webjump.el        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/nxml/nxml-mode-tests.el 
b/test/lisp/nxml/nxml-mode-tests.el
index 54d3bd8..4baab1f 100644
--- a/test/lisp/nxml/nxml-mode-tests.el
+++ b/test/lisp/nxml/nxml-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; nxml-mode-tests.el --- Test NXML Mode -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
diff --git a/test/lisp/nxml/xsd-regexp-tests.el 
b/test/lisp/nxml/xsd-regexp-tests.el
index 4c0b3b1..4dbc899 100644
--- a/test/lisp/nxml/xsd-regexp-tests.el
+++ b/test/lisp/nxml/xsd-regexp-tests.el
@@ -1,6 +1,6 @@
 ;;; xsd-regexp-tests.el --- Test NXML Mode -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
diff --git a/test/lisp/obarray-tests.el b/test/lisp/obarray-tests.el
index 4b9b4e4..45d82c7 100644
--- a/test/lisp/obarray-tests.el
+++ b/test/lisp/obarray-tests.el
@@ -1,6 +1,6 @@
 ;;; obarray-tests.el --- Tests for obarray -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Przemysław Wojnowski <esperanto@cumego.com>
 
diff --git a/test/lisp/obsolete/cl-tests.el b/test/lisp/obsolete/cl-tests.el
index 3f3fda3..4a5f4f8 100644
--- a/test/lisp/obsolete/cl-tests.el
+++ b/test/lisp/obsolete/cl-tests.el
@@ -1,6 +1,6 @@
 ;;; cl-tests.el --- tests for emacs-lisp/cl.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/org/org-tests.el b/test/lisp/org/org-tests.el
index 6e91dd2..c1985a4 100644
--- a/test/lisp/org/org-tests.el
+++ b/test/lisp/org/org-tests.el
@@ -1,6 +1,6 @@
 ;;; org-tests.el --- tests for org/org.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 
diff --git a/test/lisp/paren-tests.el b/test/lisp/paren-tests.el
index b732b86..c4bec5d 100644
--- a/test/lisp/paren-tests.el
+++ b/test/lisp/paren-tests.el
@@ -1,6 +1,6 @@
 ;;; paren-tests.el --- Tests for paren.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/password-cache-tests.el 
b/test/lisp/password-cache-tests.el
index 55ebbfc..11cb65c 100644
--- a/test/lisp/password-cache-tests.el
+++ b/test/lisp/password-cache-tests.el
@@ -1,6 +1,6 @@
 ;;; password-cache-tests.el --- Tests for password-cache.el  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/pcmpl-linux-tests.el b/test/lisp/pcmpl-linux-tests.el
index 91a9965..1b795ad 100644
--- a/test/lisp/pcmpl-linux-tests.el
+++ b/test/lisp/pcmpl-linux-tests.el
@@ -1,6 +1,6 @@
 ;;; pcmpl-linux-tests.el --- Tests for pcmpl-linux.el  -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/play/animate-tests.el b/test/lisp/play/animate-tests.el
index 7c41d3b..6252724 100644
--- a/test/lisp/play/animate-tests.el
+++ b/test/lisp/play/animate-tests.el
@@ -1,6 +1,6 @@
 ;;; animate-tests.el --- Tests for animate.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/play/dissociate-tests.el 
b/test/lisp/play/dissociate-tests.el
index e8d9031..e2f1e03 100644
--- a/test/lisp/play/dissociate-tests.el
+++ b/test/lisp/play/dissociate-tests.el
@@ -1,6 +1,6 @@
 ;;; dissociate-tests.el --- Tests for dissociate.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/play/fortune-tests.el b/test/lisp/play/fortune-tests.el
index 9726340..3b85feb 100644
--- a/test/lisp/play/fortune-tests.el
+++ b/test/lisp/play/fortune-tests.el
@@ -1,6 +1,6 @@
 ;;; fortune-tests.el --- Tests for fortune.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/play/life-tests.el b/test/lisp/play/life-tests.el
index 38726bb..cdc507b 100644
--- a/test/lisp/play/life-tests.el
+++ b/test/lisp/play/life-tests.el
@@ -1,6 +1,6 @@
 ;;; life-tests.el --- Tests for life.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/play/morse-tests.el b/test/lisp/play/morse-tests.el
index ded4ef6..7e03952 100644
--- a/test/lisp/play/morse-tests.el
+++ b/test/lisp/play/morse-tests.el
@@ -1,6 +1,6 @@
 ;;; morse-tests.el --- Tests for morse.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/play/studly-tests.el b/test/lisp/play/studly-tests.el
index 6b6e205..87e16fd 100644
--- a/test/lisp/play/studly-tests.el
+++ b/test/lisp/play/studly-tests.el
@@ -1,6 +1,6 @@
 ;;; studly-tests.el --- Tests for studly.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/progmodes/asm-mode-tests.el 
b/test/lisp/progmodes/asm-mode-tests.el
index 72d0f00..6ae4fdf 100644
--- a/test/lisp/progmodes/asm-mode-tests.el
+++ b/test/lisp/progmodes/asm-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; asm-mode-tests.el --- Tests for asm-mode.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/progmodes/autoconf-tests.el 
b/test/lisp/progmodes/autoconf-tests.el
index 63cf288..3d347fe 100644
--- a/test/lisp/progmodes/autoconf-tests.el
+++ b/test/lisp/progmodes/autoconf-tests.el
@@ -1,6 +1,6 @@
 ;;; autoconf-tests.el --- Tests for autoconf.el      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/progmodes/bat-mode-tests.el 
b/test/lisp/progmodes/bat-mode-tests.el
index 2afa5c3..7814512 100644
--- a/test/lisp/progmodes/bat-mode-tests.el
+++ b/test/lisp/progmodes/bat-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; bat-mode-tests.el --- Tests for bat-mode.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Vladimir Panteleev <vladimir@thecybershadow.net>
 ;; Keywords:
diff --git a/test/lisp/progmodes/cc-mode-tests.el 
b/test/lisp/progmodes/cc-mode-tests.el
index 64d52a9..a3a8ff2 100644
--- a/test/lisp/progmodes/cc-mode-tests.el
+++ b/test/lisp/progmodes/cc-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; cc-mode-tests.el --- Test suite for cc-mode.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Michal Nazarewicz <mina86@mina86.com>
 ;; Keywords:       internal
diff --git a/test/lisp/progmodes/compile-tests.el 
b/test/lisp/progmodes/compile-tests.el
index 74d7c76..da6a1e6 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -1,6 +1,6 @@
 ;;; compile-tests.el --- Test suite for compile.el.  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Chong Yidong <cyd@stupidchicken.com>
 ;; Keywords:       internal
diff --git a/test/lisp/progmodes/cperl-mode-tests.el 
b/test/lisp/progmodes/cperl-mode-tests.el
index 896160bb..46e687f 100644
--- a/test/lisp/progmodes/cperl-mode-tests.el
+++ b/test/lisp/progmodes/cperl-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; cperl-mode-tests --- Test for cperl-mode  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Harald Jörg <haj@posteo.de>
 ;; Maintainer: Harald Jörg
@@ -312,4 +312,12 @@ have a face property."
   (let ((code "{ $a- / $b } # /"))
     (should (equal (nth 8 (cperl-test-ppss code "/")) 7))))
 
+(ert-deftest cperl-test-bug-45255 ()
+  "Verify that \"<<>>\" is recognized as not starting a HERE-doc."
+  (let ((code (concat "while (<<>>) {\n"
+                      "   ...;\n"
+                      "}\n")))
+    ;; The yadda-yadda operator should not be in a string.
+    (should (equal (nth 8 (cperl-test-ppss code "\\.")) nil))))
+
 ;;; cperl-mode-tests.el ends here
diff --git a/test/lisp/progmodes/elisp-mode-tests.el 
b/test/lisp/progmodes/elisp-mode-tests.el
index 6c30e4f..a10d5da 100644
--- a/test/lisp/progmodes/elisp-mode-tests.el
+++ b/test/lisp/progmodes/elisp-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; elisp-mode-tests.el --- Tests for emacs-lisp-mode  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Dmitry Gutov <dgutov@yandex.ru>
 ;; Author: Stephen Leake <stephen_leake@member.fsf.org>
diff --git a/test/lisp/progmodes/etags-tests.el 
b/test/lisp/progmodes/etags-tests.el
index 79368cd..35a2592 100644
--- a/test/lisp/progmodes/etags-tests.el
+++ b/test/lisp/progmodes/etags-tests.el
@@ -1,6 +1,6 @@
 ;;; etags-tests.el --- Test suite for etags.el.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Eli Zaretskii <eliz@gnu.org>
 
diff --git a/test/lisp/progmodes/f90-tests.el b/test/lisp/progmodes/f90-tests.el
index b8a3f7e..b3d1222 100644
--- a/test/lisp/progmodes/f90-tests.el
+++ b/test/lisp/progmodes/f90-tests.el
@@ -1,6 +1,6 @@
 ;;; f90-tests.el --- tests for progmodes/f90.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Glenn Morris <rgm@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/test/lisp/progmodes/flymake-tests.el 
b/test/lisp/progmodes/flymake-tests.el
index df72b52..bda1b66 100644
--- a/test/lisp/progmodes/flymake-tests.el
+++ b/test/lisp/progmodes/flymake-tests.el
@@ -1,6 +1,6 @@
 ;;; flymake-tests.el --- Test suite for flymake -*- lexical-binding: t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Eduard Wiebe <usenet@pusto.de>
 
diff --git a/test/lisp/progmodes/gdb-mi-tests.el 
b/test/lisp/progmodes/gdb-mi-tests.el
index 64b7a26..ab48221 100644
--- a/test/lisp/progmodes/gdb-mi-tests.el
+++ b/test/lisp/progmodes/gdb-mi-tests.el
@@ -1,6 +1,6 @@
 ;;; gdb-mi-tests.el --- tests for gdb-mi.el    -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/progmodes/glasses-tests.el 
b/test/lisp/progmodes/glasses-tests.el
index 277a9cc..633c7bf 100644
--- a/test/lisp/progmodes/glasses-tests.el
+++ b/test/lisp/progmodes/glasses-tests.el
@@ -1,6 +1,6 @@
 ;;; glasses-tests.el --- Tests for glasses.el        -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el
index 6c3a618..cb7011e 100644
--- a/test/lisp/progmodes/js-tests.el
+++ b/test/lisp/progmodes/js-tests.el
@@ -1,6 +1,6 @@
 ;;; js-tests.el --- Test suite for js-mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/progmodes/opascal-tests.el 
b/test/lisp/progmodes/opascal-tests.el
index 70a4ebf..682f2c6 100644
--- a/test/lisp/progmodes/opascal-tests.el
+++ b/test/lisp/progmodes/opascal-tests.el
@@ -1,6 +1,6 @@
 ;;; opascal-tests.el --- tests for opascal.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/progmodes/pascal-tests.el 
b/test/lisp/progmodes/pascal-tests.el
index ed4c6fb..e9c7058 100644
--- a/test/lisp/progmodes/pascal-tests.el
+++ b/test/lisp/progmodes/pascal-tests.el
@@ -1,6 +1,6 @@
 ;;; pascal-tests.el --- tests for pascal.el    -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/progmodes/perl-mode-tests.el 
b/test/lisp/progmodes/perl-mode-tests.el
index a2ea972..9f6800c 100644
--- a/test/lisp/progmodes/perl-mode-tests.el
+++ b/test/lisp/progmodes/perl-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; perl-mode-tests --- Test for perl-mode  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/progmodes/ps-mode-tests.el 
b/test/lisp/progmodes/ps-mode-tests.el
index 61cf4c6..eccc862 100644
--- a/test/lisp/progmodes/ps-mode-tests.el
+++ b/test/lisp/progmodes/ps-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; ps-mode-tests.el --- Test suite for ps-mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/progmodes/python-tests.el 
b/test/lisp/progmodes/python-tests.el
index 6462633..3e653cb 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1,6 +1,6 @@
 ;;; python-tests.el --- Test suite for python.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby.rb 
b/test/lisp/progmodes/ruby-mode-resources/ruby.rb
index 9592803..434237c 100644
--- a/test/lisp/progmodes/ruby-mode-resources/ruby.rb
+++ b/test/lisp/progmodes/ruby-mode-resources/ruby.rb
@@ -475,3 +475,11 @@ top test(
 foo bar, {
       tee: qux
     }
+
+# Bug#42846, bug#18644
+
+:foo=
+# indent here
+2 = 3
+:foo= if true
+{:abc=>4} # not indented, and '=' is not highlighted
diff --git a/test/lisp/progmodes/ruby-mode-tests.el 
b/test/lisp/progmodes/ruby-mode-tests.el
index 97ac1e1..67b592e 100644
--- a/test/lisp/progmodes/ruby-mode-tests.el
+++ b/test/lisp/progmodes/ruby-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; ruby-mode-tests.el --- Test suite for ruby-mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/progmodes/scheme-tests.el 
b/test/lisp/progmodes/scheme-tests.el
index e3736bd..8f2f75f 100644
--- a/test/lisp/progmodes/scheme-tests.el
+++ b/test/lisp/progmodes/scheme-tests.el
@@ -1,6 +1,6 @@
 ;;; scheme-tests.el --- Test suite for scheme.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/progmodes/sql-tests.el b/test/lisp/progmodes/sql-tests.el
index 91805ab..21dd064 100644
--- a/test/lisp/progmodes/sql-tests.el
+++ b/test/lisp/progmodes/sql-tests.el
@@ -1,6 +1,6 @@
 ;;; sql-tests.el --- Tests for sql.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/progmodes/subword-tests.el 
b/test/lisp/progmodes/subword-tests.el
index 6aeee76..28a9445 100644
--- a/test/lisp/progmodes/subword-tests.el
+++ b/test/lisp/progmodes/subword-tests.el
@@ -1,6 +1,6 @@
 ;;; subword-tests.el --- Testing the subword rules  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords:
diff --git a/test/lisp/progmodes/tcl-tests.el b/test/lisp/progmodes/tcl-tests.el
index fb5a19d..8ff8547 100644
--- a/test/lisp/progmodes/tcl-tests.el
+++ b/test/lisp/progmodes/tcl-tests.el
@@ -1,6 +1,6 @@
 ;;; tcl-tests.el --- Test suite for tcl-mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/progmodes/xref-tests.el 
b/test/lisp/progmodes/xref-tests.el
index 038f9d0..eaafc58 100644
--- a/test/lisp/progmodes/xref-tests.el
+++ b/test/lisp/progmodes/xref-tests.el
@@ -1,6 +1,6 @@
 ;;; xref-tests.el --- tests for xref  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Dmitry Gutov <dgutov@yandex.ru>
 
@@ -27,44 +27,50 @@
 (require 'xref)
 (require 'cl-lib)
 
-(defvar xref-tests-data-dir
+(defvar xref-tests--data-dir
   (expand-file-name "xref-resources/"
                     (file-name-directory
                      (or load-file-name buffer-file-name))))
 
+(defun xref-tests--matches-in-data-dir (regexp &optional files)
+  (xref-matches-in-directory regexp (or files "*") xref-tests--data-dir nil))
+
+(defun xref-tests--locations-in-data-dir (regexp &optional files)
+  (let ((matches (xref-tests--matches-in-data-dir regexp files)))
+    ;; Sort in order to guarantee an order independent from the
+    ;; filesystem traversal.
+    (cl-sort (mapcar #'xref-item-location matches)
+             #'string<
+             :key #'xref-location-group)))
+
 (ert-deftest xref-matches-in-directory-finds-none-for-some-regexp ()
-  (should (null (xref-matches-in-directory "zzz" "*" xref-tests-data-dir 
nil))))
+  (should (null (xref-tests--matches-in-data-dir "zzz"))))
 
 (ert-deftest xref-matches-in-directory-finds-some-for-bar ()
-  (let* ((matches (xref-matches-in-directory "bar" "*" xref-tests-data-dir 
nil))
-         (locs (cl-sort (mapcar #'xref-item-location matches)
-                        #'string<
-                        :key #'xref-location-group)))
-    (should (= 2 (length matches)))
+  (let ((locs (xref-tests--locations-in-data-dir "bar")))
+    (should (= 2 (length locs)))
     (should (string-match-p "file1\\.txt\\'" (xref-location-group (nth 0 
locs))))
     (should (string-match-p "file2\\.txt\\'" (xref-location-group (nth 1 
locs))))))
 
 (ert-deftest xref-matches-in-directory-finds-two-matches-on-the-same-line ()
-  (let* ((matches (xref-matches-in-directory "foo" "*" xref-tests-data-dir 
nil))
-         (locs (mapcar #'xref-item-location matches)))
-    (should (= 2 (length matches)))
+  (let ((locs (xref-tests--locations-in-data-dir "foo")))
+    (should (= 2 (length locs)))
     (should (string-match-p "file1\\.txt\\'" (xref-location-group (nth 0 
locs))))
     (should (string-match-p "file1\\.txt\\'" (xref-location-group (nth 1 
locs))))
     (should (equal 1 (xref-location-line (nth 0 locs))))
     (should (equal 1 (xref-location-line (nth 1 locs))))
-    (should (equal 0 (xref-file-location-column (nth 0 locs))))
-    (should (equal 4 (xref-file-location-column (nth 1 locs))))))
+    (should (equal 0 (xref-location-column (nth 0 locs))))
+    (should (equal 4 (xref-location-column (nth 1 locs))))))
 
 (ert-deftest xref-matches-in-directory-finds-an-empty-line-regexp-match ()
-  (let* ((matches (xref-matches-in-directory "^$" "*" xref-tests-data-dir nil))
-         (locs (mapcar #'xref-item-location matches)))
-    (should (= 1 (length matches)))
+  (let ((locs (xref-tests--locations-in-data-dir "^$")))
+    (should (= 1 (length locs)))
     (should (string-match-p "file2\\.txt\\'" (xref-location-group (nth 0 
locs))))
     (should (equal 1 (xref-location-line (nth 0 locs))))
-    (should (equal 0 (xref-file-location-column (nth 0 locs))))))
+    (should (equal 0 (xref-location-column (nth 0 locs))))))
 
 (ert-deftest xref--buf-pairs-iterator-groups-markers-by-buffers-1 ()
-  (let* ((xrefs (xref-matches-in-directory "foo" "*" xref-tests-data-dir nil))
+  (let* ((xrefs (xref-tests--matches-in-data-dir "foo"))
          (iter (xref--buf-pairs-iterator xrefs))
          (cons (funcall iter :next)))
     (should (null (funcall iter :next)))
@@ -72,7 +78,7 @@
     (should (= 2 (length (cdr cons))))))
 
 (ert-deftest xref--buf-pairs-iterator-groups-markers-by-buffers-2 ()
-  (let* ((xrefs (xref-matches-in-directory "bar" "*" xref-tests-data-dir nil))
+  (let* ((xrefs (xref-tests--matches-in-data-dir "bar"))
          (iter (xref--buf-pairs-iterator xrefs))
          (cons1 (funcall iter :next))
          (cons2 (funcall iter :next)))
@@ -82,7 +88,7 @@
     (should (= 1 (length (cdr cons2))))))
 
 (ert-deftest xref--buf-pairs-iterator-cleans-up-markers ()
-  (let* ((xrefs (xref-matches-in-directory "bar" "*" xref-tests-data-dir nil))
+  (let* ((xrefs (xref-tests--matches-in-data-dir "bar"))
          (iter (xref--buf-pairs-iterator xrefs))
          (cons1 (funcall iter :next))
          (cons2 (funcall iter :next)))
@@ -91,3 +97,34 @@
     (should (null (marker-position (cdr (nth 0 (cdr cons1))))))
     (should (null (marker-position (car (nth 0 (cdr cons2))))))
     (should (null (marker-position (cdr (nth 0 (cdr cons2))))))))
+
+(ert-deftest xref--xref-file-name-display-is-abs ()
+  (let ((xref-file-name-display 'abs))
+    (should (equal (delete-dups
+                    (mapcar 'xref-location-group
+                            (xref-tests--locations-in-data-dir 
"\\(bar\\|foo\\)")))
+                   (list
+                    (concat xref-tests--data-dir "file1.txt")
+                    (concat xref-tests--data-dir "file2.txt"))))))
+
+(ert-deftest xref--xref-file-name-display-is-nondirectory ()
+  (let ((xref-file-name-display 'nondirectory))
+    (should (equal (delete-dups
+                    (mapcar 'xref-location-group
+                            (xref-tests--locations-in-data-dir 
"\\(bar\\|foo\\)")))
+                   (list
+                    "file1.txt"
+                    "file2.txt")))))
+
+(ert-deftest xref--xref-file-name-display-is-relative-to-project-root ()
+  (let* ((data-parent-dir
+          (file-name-directory (directory-file-name xref-tests--data-dir)))
+         (project-find-functions
+          #'(lambda (_) (cons 'transient data-parent-dir)))
+        (xref-file-name-display 'project-relative))
+    (should (equal (delete-dups
+                    (mapcar 'xref-location-group
+                            (xref-tests--locations-in-data-dir 
"\\(bar\\|foo\\)")))
+                   (list
+                    "xref-resources/file1.txt"
+                    "xref-resources/file2.txt")))))
diff --git a/test/lisp/ps-print-tests.el b/test/lisp/ps-print-tests.el
index cae86f6..b25e886 100644
--- a/test/lisp/ps-print-tests.el
+++ b/test/lisp/ps-print-tests.el
@@ -1,6 +1,6 @@
 ;;; ps-print-tests.el --- Test suite for ps-print.el  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Phillip Lord <phillip.lord@russet.org.uk>
 
diff --git a/test/lisp/register-tests.el b/test/lisp/register-tests.el
index cfad442..537a6673 100644
--- a/test/lisp/register-tests.el
+++ b/test/lisp/register-tests.el
@@ -1,6 +1,6 @@
 ;;; register-tests.el --- tests for register.el  -*- lexical-binding: t-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Tino Calancha <tino.calancha@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index aed14c3..8c2682a 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -1,6 +1,6 @@
 ;;; replace-tests.el --- tests for replace.el.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Richard <youngfrog@members.fsf.org>
 ;; Author: Juri Linkov <juri@jurta.org>
diff --git a/test/lisp/rot13-tests.el b/test/lisp/rot13-tests.el
index 2b12a46..374d4eb 100644
--- a/test/lisp/rot13-tests.el
+++ b/test/lisp/rot13-tests.el
@@ -1,6 +1,6 @@
 ;;; rot13-tests.el --- Tests for rot13.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/saveplace-tests.el b/test/lisp/saveplace-tests.el
index 8d31e28..17199ed 100644
--- a/test/lisp/saveplace-tests.el
+++ b/test/lisp/saveplace-tests.el
@@ -1,6 +1,6 @@
 ;;; saveplace-tests.el --- Tests for saveplace.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/scroll-lock-tests.el b/test/lisp/scroll-lock-tests.el
index 08f0aeb..8391a75 100644
--- a/test/lisp/scroll-lock-tests.el
+++ b/test/lisp/scroll-lock-tests.el
@@ -1,6 +1,6 @@
 ;;; scroll-lock-tests.el --- Test suite for scroll-lock -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/ses-tests.el b/test/lisp/ses-tests.el
index 4080944..04f255d 100644
--- a/test/lisp/ses-tests.el
+++ b/test/lisp/ses-tests.el
@@ -1,6 +1,6 @@
 ;;; ses-tests.el --- Tests for ses.el              -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Vincent Belaïche <vincentb1@users.sourceforge.net>
 
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index eed9cb5..0c2d712 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -1,6 +1,6 @@
 ;;; shadowfile-tests.el --- Tests of shadowfile  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
diff --git a/test/lisp/shell-tests.el b/test/lisp/shell-tests.el
index 606de15..d918de7 100644
--- a/test/lisp/shell-tests.el
+++ b/test/lisp/shell-tests.el
@@ -1,6 +1,6 @@
 ;;; shell-tests.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 786dd16..7b02281 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -1,6 +1,6 @@
 ;;; simple-test.el --- Tests for simple.el           -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Artur Malabarba <bruce.connor.am@gmail.com>
 
diff --git a/test/lisp/so-long-tests/autoload-longlines-mode-tests.el 
b/test/lisp/so-long-tests/autoload-longlines-mode-tests.el
index fd7e030..696206e 100644
--- a/test/lisp/so-long-tests/autoload-longlines-mode-tests.el
+++ b/test/lisp/so-long-tests/autoload-longlines-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; autoload-longlines-mode-tests.el --- Test suite for so-long.el  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Phil Sainty <psainty@orcon.net.nz>
 ;; Keywords: convenience
diff --git a/test/lisp/so-long-tests/autoload-major-mode-tests.el 
b/test/lisp/so-long-tests/autoload-major-mode-tests.el
index f81a284..87adf82 100644
--- a/test/lisp/so-long-tests/autoload-major-mode-tests.el
+++ b/test/lisp/so-long-tests/autoload-major-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; autoload-major-mode-tests.el --- Test suite for so-long.el  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Phil Sainty <psainty@orcon.net.nz>
 ;; Keywords: convenience
diff --git a/test/lisp/so-long-tests/autoload-minor-mode-tests.el 
b/test/lisp/so-long-tests/autoload-minor-mode-tests.el
index e611cfb..4980a7e 100644
--- a/test/lisp/so-long-tests/autoload-minor-mode-tests.el
+++ b/test/lisp/so-long-tests/autoload-minor-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; autoload-minor-mode-tests.el --- Test suite for so-long.el  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Phil Sainty <psainty@orcon.net.nz>
 ;; Keywords: convenience
diff --git a/test/lisp/so-long-tests/so-long-tests-helpers.el 
b/test/lisp/so-long-tests/so-long-tests-helpers.el
index 3f7bb36..ab4d9c6 100644
--- a/test/lisp/so-long-tests/so-long-tests-helpers.el
+++ b/test/lisp/so-long-tests/so-long-tests-helpers.el
@@ -1,6 +1,6 @@
 ;;; so-long-tests-helpers.el --- Test suite for so-long.el  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Phil Sainty <psainty@orcon.net.nz>
 ;; Keywords: convenience
diff --git a/test/lisp/so-long-tests/so-long-tests.el 
b/test/lisp/so-long-tests/so-long-tests.el
index b72ee2f..a6d8721 100644
--- a/test/lisp/so-long-tests/so-long-tests.el
+++ b/test/lisp/so-long-tests/so-long-tests.el
@@ -1,6 +1,6 @@
 ;;; so-long-tests.el --- Test suite for so-long.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Phil Sainty <psainty@orcon.net.nz>
 ;; Keywords: convenience
diff --git a/test/lisp/so-long-tests/spelling-tests.el 
b/test/lisp/so-long-tests/spelling-tests.el
index 478a027..0be8555 100644
--- a/test/lisp/so-long-tests/spelling-tests.el
+++ b/test/lisp/so-long-tests/spelling-tests.el
@@ -1,6 +1,6 @@
 ;;; spelling-tests.el --- Test suite for so-long.el  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Phil Sainty <psainty@orcon.net.nz>
 ;; Keywords: convenience
diff --git a/test/lisp/sort-tests.el b/test/lisp/sort-tests.el
index 9033745..62b89c1 100644
--- a/test/lisp/sort-tests.el
+++ b/test/lisp/sort-tests.el
@@ -1,6 +1,6 @@
 ;;; sort-tests.el --- Tests for sort.el              -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Artur Malabarba <bruce.connor.am@gmail.com>
 
diff --git a/test/lisp/soundex-tests.el b/test/lisp/soundex-tests.el
index 4170d66..aa3609e 100644
--- a/test/lisp/soundex-tests.el
+++ b/test/lisp/soundex-tests.el
@@ -1,6 +1,6 @@
 ;;; soundex-tests.el --- tests for soundex.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 
diff --git a/test/lisp/startup-tests.el b/test/lisp/startup-tests.el
index 314ffc9..109d909 100644
--- a/test/lisp/startup-tests.el
+++ b/test/lisp/startup-tests.el
@@ -1,6 +1,6 @@
 ;;; startup-tests.el --- unit tests for startup.el   -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020  Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Philipp Stephani <phst@google.com>
 
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index e275e4b..2f5b38d 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -1,6 +1,6 @@
 ;;; subr-tests.el --- Tests for subr.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Oleh Krehel <ohwoeowho@gmail.com>,
 ;;         Nicolas Petton <nicolas@petton.fr>
@@ -598,5 +598,37 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350.";
     (undo)
     (should (equal (buffer-string) ""))))
 
+(defvar subr--ordered nil)
+
+(ert-deftest subr--add-to-ordered-list-eq ()
+  (setq subr--ordered nil)
+  (add-to-ordered-list 'subr--ordered 'b 2)
+  (should (equal subr--ordered '(b)))
+  (add-to-ordered-list 'subr--ordered 'c 3)
+  (should (equal subr--ordered '(b c)))
+  (add-to-ordered-list 'subr--ordered 'a 1)
+  (should (equal subr--ordered '(a b c)))
+  (add-to-ordered-list 'subr--ordered 'e)
+  (should (equal subr--ordered '(a b c e)))
+  (add-to-ordered-list 'subr--ordered 'd 4)
+  (should (equal subr--ordered '(a b c d e)))
+  (add-to-ordered-list 'subr--ordered 'e)
+  (should (equal subr--ordered '(a b c d e)))
+  (add-to-ordered-list 'subr--ordered 'b 5)
+  (should (equal subr--ordered '(a c d b e))))
+
+
+;;; Apropos.
+
+(ert-deftest apropos-apropos-internal ()
+  (should (equal (apropos-internal "^next-line$") '(next-line)))
+  (should (>= (length (apropos-internal "^help")) 100))
+  (should-not (apropos-internal "^test-a-missing-symbol-foo-bar-zot$")))
+
+(ert-deftest apropos-apropos-internal/predicate ()
+  (should (equal (apropos-internal "^next-line$" #'commandp) '(next-line)))
+  (should (>= (length (apropos-internal "^help" #'commandp)) 15))
+  (should-not (apropos-internal "^next-line$" #'keymapp)))
+
 (provide 'subr-tests)
 ;;; subr-tests.el ends here
diff --git a/test/lisp/tabify-tests.el b/test/lisp/tabify-tests.el
index 1fde67b..4896e4a 100644
--- a/test/lisp/tabify-tests.el
+++ b/test/lisp/tabify-tests.el
@@ -1,6 +1,6 @@
 ;;; tabify-tests.el --- tests for tabify.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/tar-mode-tests.el b/test/lisp/tar-mode-tests.el
index f05389d..48a1271 100644
--- a/test/lisp/tar-mode-tests.el
+++ b/test/lisp/tar-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; tar-mode-tests.el --- Test suite for tar-mode. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/tempo-tests.el b/test/lisp/tempo-tests.el
index bfe4759..7594c36 100644
--- a/test/lisp/tempo-tests.el
+++ b/test/lisp/tempo-tests.el
@@ -1,6 +1,6 @@
 ;;; tempo-tests.el --- Test suite for tempo.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Federico Tedin <federicotedin@gmail.com>
 ;; Keywords: abbrev
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
index b9e4921..503cb5d 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -1,6 +1,6 @@
 ;;; term-tests.el --- tests for term.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017, 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017, 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/term/tty-colors-tests.el 
b/test/lisp/term/tty-colors-tests.el
index 968c699..ba29a9c 100644
--- a/test/lisp/term/tty-colors-tests.el
+++ b/test/lisp/term/tty-colors-tests.el
@@ -1,6 +1,6 @@
 ;;; tty-colors-tests.el --- tests for tty-colors.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/textmodes/bibtex-tests.el 
b/test/lisp/textmodes/bibtex-tests.el
index 56bd54e..010808c 100644
--- a/test/lisp/textmodes/bibtex-tests.el
+++ b/test/lisp/textmodes/bibtex-tests.el
@@ -1,6 +1,6 @@
 ;;; bibtex-tests.el --- Test suite for bibtex.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Keywords: bibtex
 
diff --git a/test/lisp/textmodes/conf-mode-tests.el 
b/test/lisp/textmodes/conf-mode-tests.el
index 7e094e8..9c4fd1a 100644
--- a/test/lisp/textmodes/conf-mode-tests.el
+++ b/test/lisp/textmodes/conf-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; conf-mode-tests.el --- Test suite for conf mode  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: J. Alexander Branham <alex.branham@gmail.com>
 ;; Keywords: internal
diff --git a/test/lisp/textmodes/css-mode-tests.el 
b/test/lisp/textmodes/css-mode-tests.el
index 476fd32..97f5abf 100644
--- a/test/lisp/textmodes/css-mode-tests.el
+++ b/test/lisp/textmodes/css-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; css-mode-tests.el --- Test suite for CSS mode  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords: internal
diff --git a/test/lisp/textmodes/dns-mode-tests.el 
b/test/lisp/textmodes/dns-mode-tests.el
index 6eca932..694d683 100644
--- a/test/lisp/textmodes/dns-mode-tests.el
+++ b/test/lisp/textmodes/dns-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; dns-mode-tests.el --- Test suite for dns-mode  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Peder O. Klingenberg <peder@klingenberg.no>
 ;; Keywords: dns zone
diff --git a/test/lisp/textmodes/fill-tests.el 
b/test/lisp/textmodes/fill-tests.el
index 833d74d..f2c63a9 100644
--- a/test/lisp/textmodes/fill-tests.el
+++ b/test/lisp/textmodes/fill-tests.el
@@ -1,6 +1,6 @@
 ;;; fill-test.el --- ERT tests for fill.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author:     Marcin Borkowski <mbork@mbork.pl>
 ;; Keywords:   text, wp
diff --git a/test/lisp/textmodes/mhtml-mode-tests.el 
b/test/lisp/textmodes/mhtml-mode-tests.el
index 1840e8b..ad386bf 100644
--- a/test/lisp/textmodes/mhtml-mode-tests.el
+++ b/test/lisp/textmodes/mhtml-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; mhtml-mode-tests.el --- Tests for mhtml-mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Keywords: tests
 
diff --git a/test/lisp/textmodes/page-tests.el 
b/test/lisp/textmodes/page-tests.el
index 79aabd8..c02d125 100644
--- a/test/lisp/textmodes/page-tests.el
+++ b/test/lisp/textmodes/page-tests.el
@@ -1,6 +1,6 @@
 ;;; page-tests.el --- Tests for page.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/textmodes/paragraphs-tests.el 
b/test/lisp/textmodes/paragraphs-tests.el
index 0b264e7..bf7f370 100644
--- a/test/lisp/textmodes/paragraphs-tests.el
+++ b/test/lisp/textmodes/paragraphs-tests.el
@@ -1,6 +1,6 @@
 ;;; paragraphs-tests.el --- Tests for paragraphs.el  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/textmodes/po-tests.el b/test/lisp/textmodes/po-tests.el
index a098290..c75cb5e 100644
--- a/test/lisp/textmodes/po-tests.el
+++ b/test/lisp/textmodes/po-tests.el
@@ -1,6 +1,6 @@
 ;;; po-tests.el --- Tests for po.el                  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Simen Heggestøyl <simenheg@gmail.com>
 ;; Keywords:
diff --git a/test/lisp/textmodes/reftex-tests.el 
b/test/lisp/textmodes/reftex-tests.el
index 42a060b..b824e05 100644
--- a/test/lisp/textmodes/reftex-tests.el
+++ b/test/lisp/textmodes/reftex-tests.el
@@ -1,6 +1,6 @@
 ;;; reftex-tests.el --- Test suite for reftex. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
 ;; Keywords:       internal
diff --git a/test/lisp/textmodes/sgml-mode-tests.el 
b/test/lisp/textmodes/sgml-mode-tests.el
index a445730..697c96c 100644
--- a/test/lisp/textmodes/sgml-mode-tests.el
+++ b/test/lisp/textmodes/sgml-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; sgml-mode-tests.el --- Tests for sgml-mode  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Przemysław Wojnowski <esperanto@cumego.com>
 ;; Keywords: tests
diff --git a/test/lisp/textmodes/tildify-tests.el 
b/test/lisp/textmodes/tildify-tests.el
index 61f80cc..59c2394 100644
--- a/test/lisp/textmodes/tildify-tests.el
+++ b/test/lisp/textmodes/tildify-tests.el
@@ -1,6 +1,6 @@
 ;;; tildify-test.el --- ERT tests for tildify.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author:     Michal Nazarewicz <mina86@mina86.com>
 ;; Version:    4.5
diff --git a/test/lisp/textmodes/underline-tests.el 
b/test/lisp/textmodes/underline-tests.el
index 3fbb586..481c9cc 100644
--- a/test/lisp/textmodes/underline-tests.el
+++ b/test/lisp/textmodes/underline-tests.el
@@ -1,6 +1,6 @@
 ;;; underline-tests.el --- Tests for underline.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el
index f02aeae..c43c81a 100644
--- a/test/lisp/thingatpt-tests.el
+++ b/test/lisp/thingatpt-tests.el
@@ -1,6 +1,6 @@
 ;;; thingatpt.el --- tests for thing-at-point.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/thread-tests.el b/test/lisp/thread-tests.el
index 849ca07..4aed505 100644
--- a/test/lisp/thread-tests.el
+++ b/test/lisp/thread-tests.el
@@ -1,6 +1,6 @@
 ;;; thread-tests.el --- Test suite for thread.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Gemini Lasswell <gazally@runbox.com>
 ;; Keywords: threads
diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el
index e75e84b..81488c3 100644
--- a/test/lisp/time-stamp-tests.el
+++ b/test/lisp/time-stamp-tests.el
@@ -1,6 +1,6 @@
 ;;; time-stamp-tests.el --- tests for time-stamp.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/time-tests.el b/test/lisp/time-tests.el
index 2d327b9..3cf8b54 100644
--- a/test/lisp/time-tests.el
+++ b/test/lisp/time-tests.el
@@ -1,6 +1,6 @@
 ;;; time-tests.el --- Tests for time.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/timezone-tests.el b/test/lisp/timezone-tests.el
index 8992e3e..9f69614 100644
--- a/test/lisp/timezone-tests.el
+++ b/test/lisp/timezone-tests.el
@@ -1,6 +1,6 @@
 ;;; timezone-tests.el --- Tests for timezone.el  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Stefan Kangas <stefankangas@gmail.com>
 
diff --git a/test/lisp/url/url-auth-tests.el b/test/lisp/url/url-auth-tests.el
index d3acdef..ff30f10 100644
--- a/test/lisp/url/url-auth-tests.el
+++ b/test/lisp/url/url-auth-tests.el
@@ -1,6 +1,6 @@
 ;;; url-auth-tests.el --- Test suite for url-auth.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Jarno Malmari <jarno@malmari.fi>
 
diff --git a/test/lisp/url/url-domsuf-tests.el 
b/test/lisp/url/url-domsuf-tests.el
index a4fffb0..d084c7a 100644
--- a/test/lisp/url/url-domsuf-tests.el
+++ b/test/lisp/url/url-domsuf-tests.el
@@ -1,6 +1,6 @@
 ;;; url-domsuf-tests.el --- Tests for url-domsuf.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/url/url-expand-tests.el 
b/test/lisp/url/url-expand-tests.el
index 3b0b6fb..52124df 100644
--- a/test/lisp/url/url-expand-tests.el
+++ b/test/lisp/url/url-expand-tests.el
@@ -1,6 +1,6 @@
 ;;; url-expand-tests.el --- Test suite for relative URI/URL resolution.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Alain Schneble <a.s@realize.ch>
 ;; Version: 1.0
diff --git a/test/lisp/url/url-file-tests.el b/test/lisp/url/url-file-tests.el
index 810504f..18365c7 100644
--- a/test/lisp/url/url-file-tests.el
+++ b/test/lisp/url/url-file-tests.el
@@ -1,6 +1,6 @@
 ;;; url-file-tests.el --- Test suite for url-file. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/url/url-future-tests.el 
b/test/lisp/url/url-future-tests.el
index a07730a..8b0e20c 100644
--- a/test/lisp/url/url-future-tests.el
+++ b/test/lisp/url/url-future-tests.el
@@ -1,6 +1,6 @@
 ;;; url-future-tests.el --- Test suite for url-future.  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Teodor Zlatanov <tzz@lifelogs.com>
 ;; Keywords: data
@@ -31,13 +31,13 @@
   (let* (url-future-tests--saver
          (text "running future")
          (good (make-url-future :value (lambda () (format text))
-                                :callback (lambda (f) (set 
'url-future-tests--saver f))))
+                                :callback (lambda (f) (setq 
url-future-tests--saver f))))
          (bad (make-url-future :value (lambda () (/ 1 0))
-                               :errorback (lambda (&rest d) (set 
'url-future-tests--saver d))))
+                               :errorback (lambda (&rest d) (setq 
url-future-tests--saver d))))
          (tocancel (make-url-future :value (lambda () (/ 1 0))
-                                    :callback (lambda (f) (set 
'url-future-tests--saver f))
+                                    :callback (lambda (f) (setq 
url-future-tests--saver f))
                                     :errorback (lambda (&rest d)
-                                                 (set 'url-future-tests--saver 
d)))))
+                                                 (setq url-future-tests--saver 
d)))))
     (should (equal good (url-future-call good)))
     (should (equal good url-future-tests--saver))
     (should (equal text (url-future-value good)))
diff --git a/test/lisp/url/url-handlers-test.el 
b/test/lisp/url/url-handlers-test.el
index 57692e5..7e5a603 100644
--- a/test/lisp/url/url-handlers-test.el
+++ b/test/lisp/url/url-handlers-test.el
@@ -1,6 +1,6 @@
 ;;; url-handlers-test.el --- Test suite for url-handlers.el  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Petton <nicolas@petton.fr>
 
diff --git a/test/lisp/url/url-misc-tests.el b/test/lisp/url/url-misc-tests.el
index 7b1467c..40c6edb 100644
--- a/test/lisp/url/url-misc-tests.el
+++ b/test/lisp/url/url-misc-tests.el
@@ -1,6 +1,6 @@
 ;;; url-misc-tests.el --- Test suite for url-misc. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/url/url-parse-tests.el b/test/lisp/url/url-parse-tests.el
index 6ec4647..2418af4 100644
--- a/test/lisp/url/url-parse-tests.el
+++ b/test/lisp/url/url-parse-tests.el
@@ -1,6 +1,6 @@
 ;;; url-parse-tests.el --- Test suite for URI/URL parsing.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Alain Schneble <a.s@realize.ch>
 ;; Version: 1.0
diff --git a/test/lisp/url/url-tramp-tests.el b/test/lisp/url/url-tramp-tests.el
index 965b9ea..63d752a 100644
--- a/test/lisp/url/url-tramp-tests.el
+++ b/test/lisp/url/url-tramp-tests.el
@@ -1,6 +1,6 @@
 ;;; url-tramp-tests.el --- Test suite for Tramp / URL conversion.  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
diff --git a/test/lisp/url/url-util-tests.el b/test/lisp/url/url-util-tests.el
index 0416331..57b67a04 100644
--- a/test/lisp/url/url-util-tests.el
+++ b/test/lisp/url/url-util-tests.el
@@ -1,6 +1,6 @@
 ;;; url-util-tests.el --- Test suite for url-util.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Teodor Zlatanov <tzz@lifelogs.com>
 ;; Keywords: data
diff --git a/test/lisp/vc/add-log-tests.el b/test/lisp/vc/add-log-tests.el
index f256945..dc2b996 100644
--- a/test/lisp/vc/add-log-tests.el
+++ b/test/lisp/vc/add-log-tests.el
@@ -1,6 +1,6 @@
 ;;; add-log-tests.el --- Test suite for add-log.  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Masatake YAMATO <yamato@redhat.com>
 ;; Keywords: vc tools
diff --git a/test/lisp/vc/diff-mode-tests.el b/test/lisp/vc/diff-mode-tests.el
index b258364..f4e5c89 100644
--- a/test/lisp/vc/diff-mode-tests.el
+++ b/test/lisp/vc/diff-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; diff-mode-tests.el --- Tests for diff-mode.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Dima Kogan <dima@secretsauce.net>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/test/lisp/vc/ediff-diff-tests.el b/test/lisp/vc/ediff-diff-tests.el
index e6d5205..001db8b 100644
--- a/test/lisp/vc/ediff-diff-tests.el
+++ b/test/lisp/vc/ediff-diff-tests.el
@@ -1,6 +1,6 @@
 ;;; ediff-diff-tests.el --- Unit tests for ediff-diff.el  -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Philipp Stephani <phst@google.com>
 
diff --git a/test/lisp/vc/ediff-ptch-tests.el b/test/lisp/vc/ediff-ptch-tests.el
index 15270d6..a464db2 100644
--- a/test/lisp/vc/ediff-ptch-tests.el
+++ b/test/lisp/vc/ediff-ptch-tests.el
@@ -1,6 +1,6 @@
 ;;; ediff-ptch-tests.el --- Tests for ediff-ptch.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Tino Calancha <tino.calancha@gmail.com>
 
diff --git a/test/lisp/vc/log-edit-tests.el b/test/lisp/vc/log-edit-tests.el
index 86a40a9..84e363a 100644
--- a/test/lisp/vc/log-edit-tests.el
+++ b/test/lisp/vc/log-edit-tests.el
@@ -1,6 +1,6 @@
 ;;; log-edit-tests.el --- Unit tests for log-edit.el  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/vc/smerge-mode-tests.el 
b/test/lisp/vc/smerge-mode-tests.el
index 5b15a09..2c8f486 100644
--- a/test/lisp/vc/smerge-mode-tests.el
+++ b/test/lisp/vc/smerge-mode-tests.el
@@ -1,6 +1,6 @@
 ;;; smerge-mode-tests.el --- Tests for smerge-mode.el  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 
diff --git a/test/lisp/vc/vc-bzr-tests.el b/test/lisp/vc/vc-bzr-tests.el
index bd26f79..aeab51e 100644
--- a/test/lisp/vc/vc-bzr-tests.el
+++ b/test/lisp/vc/vc-bzr-tests.el
@@ -1,6 +1,6 @@
 ;;; vc-bzr.el --- tests for vc/vc-bzr.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Glenn Morris <rgm@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/test/lisp/vc/vc-hg-tests.el b/test/lisp/vc/vc-hg-tests.el
index e4a20bb..2edd4b6 100644
--- a/test/lisp/vc/vc-hg-tests.el
+++ b/test/lisp/vc/vc-hg-tests.el
@@ -1,6 +1,6 @@
 ;;; vc-hg-tests.el --- tests for vc/vc-hg.el  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Dmitry Gutov <dgutov@yandex.ru>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/test/lisp/vc/vc-tests.el b/test/lisp/vc/vc-tests.el
index 7b88b8d..5430535 100644
--- a/test/lisp/vc/vc-tests.el
+++ b/test/lisp/vc/vc-tests.el
@@ -1,6 +1,6 @@
 ;;; vc-tests.el --- Tests of different backends of vc.el  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
@@ -439,8 +439,9 @@ This checks also `vc-backend' and `vc-responsible-backend'."
            ;; nil: Git Mtn
            ;; "0": Bzr CVS Hg SRC SVN
            ;; "1.1": RCS SCCS
+            ;; "-1": Hg versions before 5 (probably)
             (message "vc-working-revision4 %s" (vc-working-revision tmp-name))
-            (should (member (vc-working-revision tmp-name) '(nil "0" "1.1")))
+            (should (member (vc-working-revision tmp-name) '(nil "0" "1.1" 
"-1")))
 
             ;; TODO: Call `vc-checkin', and check the resulting
             ;; working revision.  None of the return values should be
diff --git a/test/lisp/version-tests.el b/test/lisp/version-tests.el
index 8fbd4a1..ef2e945 100644
--- a/test/lisp/version-tests.el
+++ b/test/lisp/version-tests.el
@@ -1,6 +1,6 @@
 ;;; version-tests.el --- Tests for version.el  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el
index f876967..ba276e2 100644
--- a/test/lisp/wdired-tests.el
+++ b/test/lisp/wdired-tests.el
@@ -1,6 +1,6 @@
 ;;; wdired-tests.el --- tests for wdired.el          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/whitespace-tests.el b/test/lisp/whitespace-tests.el
index cb3189c..9f54a4f 100644
--- a/test/lisp/whitespace-tests.el
+++ b/test/lisp/whitespace-tests.el
@@ -1,6 +1,6 @@
 ;;; whitespace-tests.el --- Test suite for whitespace -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el
index 1bd4297..35235c6 100644
--- a/test/lisp/wid-edit-tests.el
+++ b/test/lisp/wid-edit-tests.el
@@ -1,6 +1,6 @@
 ;;; wid-edit-tests.el --- tests for wid-edit.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/lisp/xdg-tests.el b/test/lisp/xdg-tests.el
index c2a1600..67cd940 100644
--- a/test/lisp/xdg-tests.el
+++ b/test/lisp/xdg-tests.el
@@ -1,6 +1,6 @@
 ;;; xdg-tests.el --- tests for xdg.el -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Mark Oteiza <mvoteiza@udel.edu>
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/test/lisp/xml-tests.el b/test/lisp/xml-tests.el
index d09336c..cd3e113 100644
--- a/test/lisp/xml-tests.el
+++ b/test/lisp/xml-tests.el
@@ -1,6 +1,6 @@
 ;;; xml-parse-tests.el --- Test suite for XML parsing.  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Chong Yidong <cyd@stupidchicken.com>
 ;; Keywords:       internal
diff --git a/test/lisp/xt-mouse-tests.el b/test/lisp/xt-mouse-tests.el
index 12840df..72659dd 100644
--- a/test/lisp/xt-mouse-tests.el
+++ b/test/lisp/xt-mouse-tests.el
@@ -1,6 +1,6 @@
 ;;; xt-mouse-tests.el --- Test suite for xt-mouse.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Philipp Stephani <phst@google.com>
 
diff --git a/test/manual/biditest.el b/test/manual/biditest.el
index c4ee96a..dc78ef5 100644
--- a/test/manual/biditest.el
+++ b/test/manual/biditest.el
@@ -1,6 +1,6 @@
 ;;; biditest.el --- test bidi reordering in GNU Emacs display engine.
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Eli Zaretskii
 ;; Maintainer: emacs-devel@gnu.org
diff --git a/test/manual/cedet/cedet-utests.el 
b/test/manual/cedet/cedet-utests.el
index ee6be43..7805fce 100644
--- a/test/manual/cedet/cedet-utests.el
+++ b/test/manual/cedet/cedet-utests.el
@@ -1,6 +1,6 @@
 ;;; cedet-utests.el --- Run all unit tests in the CEDET suite.
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/ede-tests.el b/test/manual/cedet/ede-tests.el
index 0fa7539..eb31323 100644
--- a/test/manual/cedet/ede-tests.el
+++ b/test/manual/cedet/ede-tests.el
@@ -1,6 +1,6 @@
 ;;; ede-tests.el --- Some tests for the Emacs Development Environment
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/semantic-tests.el 
b/test/manual/cedet/semantic-tests.el
index a0899cb..716bcc7 100644
--- a/test/manual/cedet/semantic-tests.el
+++ b/test/manual/cedet/semantic-tests.el
@@ -1,6 +1,6 @@
 ;;; semantic-utest.el --- Miscellaneous Semantic tests.
 
-;;; Copyright (C) 2003-2004, 2007-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/srecode-tests.el 
b/test/manual/cedet/srecode-tests.el
index 7c42dfb..ebc3261 100644
--- a/test/manual/cedet/srecode-tests.el
+++ b/test/manual/cedet/srecode-tests.el
@@ -1,6 +1,6 @@
 ;;; srecode-tests.el --- Some tests for CEDET's srecode
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/test-fmt.cpp 
b/test/manual/cedet/tests/test-fmt.cpp
index 31cd629..ab869c1 100644
--- a/test/manual/cedet/tests/test-fmt.cpp
+++ b/test/manual/cedet/tests/test-fmt.cpp
@@ -1,6 +1,6 @@
 /** test-fmt.cpp --- Signatures, and format answers for testing
  *
- * Copyright (C) 2012, 2016, 2019-2020 Free Software Foundation
+ * Copyright (C) 2012, 2016, 2019-2021 Free Software Foundation, Inc.
  *
  * Author: Eric M. Ludlam <zappo@gnu.org>
  *
diff --git a/test/manual/cedet/tests/test-fmt.el 
b/test/manual/cedet/tests/test-fmt.el
index 39641dc..1225713 100644
--- a/test/manual/cedet/tests/test-fmt.el
+++ b/test/manual/cedet/tests/test-fmt.el
@@ -1,6 +1,6 @@
 ;;; test-fmt.el --- test semantic tag formatting
 
-;;; Copyright (C) 2012, 2019-2020 Free Software Foundation, Inc.
+;;; Copyright (C) 2012, 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/test.c b/test/manual/cedet/tests/test.c
index daecb54..2cdaf4f 100644
--- a/test/manual/cedet/tests/test.c
+++ b/test/manual/cedet/tests/test.c
@@ -1,6 +1,6 @@
 /* test.c --- Semantic unit test for C.
 
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
    Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/test.el b/test/manual/cedet/tests/test.el
index f82e3fb..3bc945d 100644
--- a/test/manual/cedet/tests/test.el
+++ b/test/manual/cedet/tests/test.el
@@ -1,6 +1,6 @@
 ;;; test.el --- Unit test file for Semantic Emacs Lisp support.
 
-;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/test.make 
b/test/manual/cedet/tests/test.make
index 2da0984..9841567 100644
--- a/test/manual/cedet/tests/test.make
+++ b/test/manual/cedet/tests/test.make
@@ -1,6 +1,6 @@
 # test.make --- Semantic unit test for Make -*- makefile -*-
 
-# Copyright (C) 2001-2002, 2010-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2002, 2010-2021 Free Software Foundation, Inc.
 
 # Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/test.srt b/test/manual/cedet/tests/test.srt
index 24769ec..38e6f9e 100644
--- a/test/manual/cedet/tests/test.srt
+++ b/test/manual/cedet/tests/test.srt
@@ -1,6 +1,6 @@
 ;; test.srt --- unit test support file for semantic-utest-ia
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testdoublens.cpp 
b/test/manual/cedet/tests/testdoublens.cpp
index e25e604..ea3afc7 100644
--- a/test/manual/cedet/tests/testdoublens.cpp
+++ b/test/manual/cedet/tests/testdoublens.cpp
@@ -1,6 +1,6 @@
 // testdoublens.cpp --- semantic-ia-utest completion engine unit tests
 
-// Copyright (C) 2008-2020 Free Software Foundation, Inc.
+// Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 // Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testdoublens.hpp 
b/test/manual/cedet/tests/testdoublens.hpp
index 4338f28..e8c9b34 100644
--- a/test/manual/cedet/tests/testdoublens.hpp
+++ b/test/manual/cedet/tests/testdoublens.hpp
@@ -1,6 +1,6 @@
 // testdoublens.hpp --- Header file used in one of the Semantic tests
 
-// Copyright (C) 2008-2020 Free Software Foundation, Inc.
+// Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 // Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testjavacomp.java 
b/test/manual/cedet/tests/testjavacomp.java
index 09ec4e0..bfc0169 100644
--- a/test/manual/cedet/tests/testjavacomp.java
+++ b/test/manual/cedet/tests/testjavacomp.java
@@ -1,6 +1,6 @@
 //  testjavacomp.java --- Semantic unit test for Java
 
-// Copyright (C) 2009-2020 Free Software Foundation, Inc.
+// Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 //  Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testlocalvars.cpp 
b/test/manual/cedet/tests/testlocalvars.cpp
index f4853fa..9d2329a 100644
--- a/test/manual/cedet/tests/testlocalvars.cpp
+++ b/test/manual/cedet/tests/testlocalvars.cpp
@@ -1,6 +1,6 @@
 //  testlocalvars.java --- Semantic unit test for Java
 
-// Copyright (C) 2009-2020 Free Software Foundation, Inc.
+// Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 //  Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testnsp.cpp 
b/test/manual/cedet/tests/testnsp.cpp
index b72a44c..db1603c 100644
--- a/test/manual/cedet/tests/testnsp.cpp
+++ b/test/manual/cedet/tests/testnsp.cpp
@@ -1,6 +1,6 @@
 /* testnsp.cpp --- semantic-ia-utest completion engine unit tests
 
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testpolymorph.cpp 
b/test/manual/cedet/tests/testpolymorph.cpp
index 2a24a59..e4befcf 100644
--- a/test/manual/cedet/tests/testpolymorph.cpp
+++ b/test/manual/cedet/tests/testpolymorph.cpp
@@ -1,6 +1,6 @@
 /** testpolymorph.cpp --- A sequence of polymorphism examples.
  *
- * Copyright (C) 2009-2020 Free Software Foundation, Inc.
+ * Copyright (C) 2009-2021 Free Software Foundation, Inc.
  *
  * Author: Eric M. Ludlam <zappo@gnu.org>
  *
diff --git a/test/manual/cedet/tests/testspp.c 
b/test/manual/cedet/tests/testspp.c
index 8acdb1b..2698f48 100644
--- a/test/manual/cedet/tests/testspp.c
+++ b/test/manual/cedet/tests/testspp.c
@@ -1,6 +1,6 @@
 /* testspp.cpp --- Semantic unit test for the C preprocessor
 
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testsppcomplete.c 
b/test/manual/cedet/tests/testsppcomplete.c
index b2612fa..084d6a8 100644
--- a/test/manual/cedet/tests/testsppcomplete.c
+++ b/test/manual/cedet/tests/testsppcomplete.c
@@ -1,6 +1,6 @@
 /* testesppcomplete.cpp --- semantic-ia-utest completion engine unit tests
 
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testsppreplace.c 
b/test/manual/cedet/tests/testsppreplace.c
index a9ea9a7..42a22e1 100644
--- a/test/manual/cedet/tests/testsppreplace.c
+++ b/test/manual/cedet/tests/testsppreplace.c
@@ -1,5 +1,5 @@
 /* testsppreplace.c --- unit test for CPP/SPP Replacement
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testsppreplaced.c 
b/test/manual/cedet/tests/testsppreplaced.c
index 2517542..d546d61 100644
--- a/test/manual/cedet/tests/testsppreplaced.c
+++ b/test/manual/cedet/tests/testsppreplaced.c
@@ -1,5 +1,5 @@
 /* testsppreplaced.c --- unit test for CPP/SPP Replacement
-   Copyright (C) 2007-2020 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/teststruct.cpp 
b/test/manual/cedet/tests/teststruct.cpp
index 10217c1..6659b55 100644
--- a/test/manual/cedet/tests/teststruct.cpp
+++ b/test/manual/cedet/tests/teststruct.cpp
@@ -1,6 +1,6 @@
 // teststruct.cpp --- semantic-ia-utest completion engine unit tests
 
-// Copyright (C) 2008-2020 Free Software Foundation, Inc.
+// Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 // Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testsubclass.cpp 
b/test/manual/cedet/tests/testsubclass.cpp
index 8a2e8d7..409950c 100644
--- a/test/manual/cedet/tests/testsubclass.cpp
+++ b/test/manual/cedet/tests/testsubclass.cpp
@@ -1,6 +1,6 @@
 // testsubclass.cpp --- unit test for analyzer and complex C++ inheritance
 
-// Copyright (C) 2007-2020 Free Software Foundation, Inc.
+// Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 // Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testsubclass.hh 
b/test/manual/cedet/tests/testsubclass.hh
index cbca24d..5d795b3 100644
--- a/test/manual/cedet/tests/testsubclass.hh
+++ b/test/manual/cedet/tests/testsubclass.hh
@@ -1,6 +1,6 @@
 // testsubclass.hh --- unit test for analyzer and complex C++ inheritance
 
-// Copyright (C) 2007-2020 Free Software Foundation, Inc.
+// Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 // Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testtemplates.cpp 
b/test/manual/cedet/tests/testtemplates.cpp
index 6f376e7..ed7a057 100644
--- a/test/manual/cedet/tests/testtemplates.cpp
+++ b/test/manual/cedet/tests/testtemplates.cpp
@@ -1,6 +1,6 @@
 // testtemplates.cpp --- semantic-ia-utest completion engine unit tests
 
-// Copyright (C) 2008-2020 Free Software Foundation, Inc.
+// Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 // Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testtypedefs.cpp 
b/test/manual/cedet/tests/testtypedefs.cpp
index 9d25776..c82535f 100644
--- a/test/manual/cedet/tests/testtypedefs.cpp
+++ b/test/manual/cedet/tests/testtypedefs.cpp
@@ -1,6 +1,6 @@
 // testtypedefs.cpp --- Sample with some fake bits out of std::string
 
-// Copyright (C) 2008-2020 Free Software Foundation, Inc.
+// Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 // Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testusing.cpp 
b/test/manual/cedet/tests/testusing.cpp
index df6ab2f..6f6c854 100644
--- a/test/manual/cedet/tests/testusing.cpp
+++ b/test/manual/cedet/tests/testusing.cpp
@@ -1,6 +1,6 @@
 // testusing.cpp --- semantic-ia-utest completion engine unit tests
 
-// Copyright (C) 2008-2020 Free Software Foundation, Inc.
+// Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 // Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testusing.hh 
b/test/manual/cedet/tests/testusing.hh
index cd703f0..d3b690f 100644
--- a/test/manual/cedet/tests/testusing.hh
+++ b/test/manual/cedet/tests/testusing.hh
@@ -1,6 +1,6 @@
 // testusing.hh --- semantic-ia-utest completion engine unit tests
 
-// Copyright (C) 2008-2020 Free Software Foundation, Inc.
+// Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 // Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testvarnames.c 
b/test/manual/cedet/tests/testvarnames.c
index 940c0ff..e796eb2 100644
--- a/test/manual/cedet/tests/testvarnames.c
+++ b/test/manual/cedet/tests/testvarnames.c
@@ -1,6 +1,6 @@
 /* testvarnames.cpp --- semantic-ia-utest completion engine unit tests
 
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testvarnames.java 
b/test/manual/cedet/tests/testvarnames.java
index c1cbf6e..7ed9785 100644
--- a/test/manual/cedet/tests/testvarnames.java
+++ b/test/manual/cedet/tests/testvarnames.java
@@ -1,6 +1,6 @@
 //  testvarnames.java --- Semantic unit test for Java
 
-// Copyright (C) 2009-2020 Free Software Foundation, Inc.
+// Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 //  Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/cedet/tests/testwisent.wy 
b/test/manual/cedet/tests/testwisent.wy
index cc600e4..49eb578 100644
--- a/test/manual/cedet/tests/testwisent.wy
+++ b/test/manual/cedet/tests/testwisent.wy
@@ -1,6 +1,6 @@
 ;; testwisent.wy --- unit test support file for semantic-utest-ia
 
-;; Copyright (C) 2008-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
diff --git a/test/manual/etags/c-src/abbrev.c b/test/manual/etags/c-src/abbrev.c
index 44563d6..039addc 100644
--- a/test/manual/etags/c-src/abbrev.c
+++ b/test/manual/etags/c-src/abbrev.c
@@ -1,5 +1,5 @@
 /* Primitives for word-abbrev mode.
-   Copyright (C) 1985-1986, 1993, 1996, 1998, 2016-2020 Free Software
+   Copyright (C) 1985-1986, 1993, 1996, 1998, 2016-2021 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
diff --git a/test/manual/etags/c-src/emacs/src/gmalloc.c 
b/test/manual/etags/c-src/emacs/src/gmalloc.c
index e847e44..f56a243 100644
--- a/test/manual/etags/c-src/emacs/src/gmalloc.c
+++ b/test/manual/etags/c-src/emacs/src/gmalloc.c
@@ -1,5 +1,5 @@
 /* Declarations for `malloc' and friends.
-   Copyright (C) 1990-1993, 1995-1996, 1999, 2002-2007, 2013-2020 Free
+   Copyright (C) 1990-1993, 1995-1996, 1999, 2002-2007, 2013-2021 Free
    Software Foundation, Inc.
                  Written May 1989 by Mike Haertel.
 
diff --git a/test/manual/etags/c-src/emacs/src/keyboard.c 
b/test/manual/etags/c-src/emacs/src/keyboard.c
index e869363..db86515 100644
--- a/test/manual/etags/c-src/emacs/src/keyboard.c
+++ b/test/manual/etags/c-src/emacs/src/keyboard.c
@@ -1,6 +1,6 @@
 /* Keyboard and mouse input; editor command loop.
 
-Copyright (C) 1985-1989, 1993-1997, 1999-2020 Free Software Foundation,
+Copyright (C) 1985-1989, 1993-1997, 1999-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
diff --git a/test/manual/etags/c-src/emacs/src/lisp.h 
b/test/manual/etags/c-src/emacs/src/lisp.h
index eceef4c..e2744a1 100644
--- a/test/manual/etags/c-src/emacs/src/lisp.h
+++ b/test/manual/etags/c-src/emacs/src/lisp.h
@@ -1,6 +1,6 @@
 /* Fundamental definitions for GNU Emacs Lisp interpreter.
 
-Copyright (C) 1985-1987, 1993-1995, 1997-2020 Free Software Foundation,
+Copyright (C) 1985-1987, 1993-1995, 1997-2021 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
diff --git a/test/manual/etags/c-src/emacs/src/regex.h 
b/test/manual/etags/c-src/emacs/src/regex.h
index 367aada..3e87130 100644
--- a/test/manual/etags/c-src/emacs/src/regex.h
+++ b/test/manual/etags/c-src/emacs/src/regex.h
@@ -1,7 +1,7 @@
 /* Definitions for data structures and routines for the regular
    expression library, version 0.12.
 
-   Copyright (C) 1985, 1989-1993, 1995, 2000-2020 Free Software
+   Copyright (C) 1985, 1989-1993, 1995, 2000-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/test/manual/etags/c-src/etags.c b/test/manual/etags/c-src/etags.c
index 2dd4897..7105ad5 100644
--- a/test/manual/etags/c-src/etags.c
+++ b/test/manual/etags/c-src/etags.c
@@ -28,7 +28,7 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN
 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2020 Free Software
+Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2021 Free Software
 Foundation, Inc.
 
 This file is not considered part of GNU Emacs.
diff --git a/test/manual/etags/c-src/exit.c b/test/manual/etags/c-src/exit.c
index 556ee93..93b3563 100644
--- a/test/manual/etags/c-src/exit.c
+++ b/test/manual/etags/c-src/exit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 2016-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 2016-2021 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
diff --git a/test/manual/etags/c-src/exit.strange_suffix 
b/test/manual/etags/c-src/exit.strange_suffix
index 556ee93..93b3563 100644
--- a/test/manual/etags/c-src/exit.strange_suffix
+++ b/test/manual/etags/c-src/exit.strange_suffix
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 2016-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 2016-2021 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
diff --git a/test/manual/etags/c-src/getopt.h b/test/manual/etags/c-src/getopt.h
index eff9032..ec74c83 100644
--- a/test/manual/etags/c-src/getopt.h
+++ b/test/manual/etags/c-src/getopt.h
@@ -1,5 +1,5 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-1992, 2016-2020 Free Software Foundation, Inc.
+   Copyright (C) 1989-1992, 2016-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
diff --git a/test/manual/etags/c-src/sysdep.h b/test/manual/etags/c-src/sysdep.h
index 3cafc9e..187692f 100644
--- a/test/manual/etags/c-src/sysdep.h
+++ b/test/manual/etags/c-src/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-1993, 2016-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1992-1993, 2016-2021 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
diff --git a/test/manual/etags/el-src/emacs/lisp/progmodes/etags.el 
b/test/manual/etags/el-src/emacs/lisp/progmodes/etags.el
index 3a99986..36f6624 100644
--- a/test/manual/etags/el-src/emacs/lisp/progmodes/etags.el
+++ b/test/manual/etags/el-src/emacs/lisp/progmodes/etags.el
@@ -1,6 +1,6 @@
 ;;; etags.el --- etags facility for Emacs  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1988-1989, 1992-1996, 1998, 2000-2020 Free
+;; Copyright (C) 1985-1986, 1988-1989, 1992-1996, 1998, 2000-2021 Free
 ;; Software Foundation, Inc.
 
 ;; Author: Roland McGrath <roland@gnu.org>
diff --git a/test/manual/etags/tex-src/texinfo.tex 
b/test/manual/etags/tex-src/texinfo.tex
index 8d84f51..a04371d 100644
--- a/test/manual/etags/tex-src/texinfo.tex
+++ b/test/manual/etags/tex-src/texinfo.tex
@@ -1,6 +1,6 @@
 %% TeX macros to handle texinfo files
 
-%   Copyright (C) 1985--1986, 1988, 1990--1991, 2016--2020 Free Software
+%   Copyright (C) 1985--1986, 1988, 1990--1991, 2016--2021 Free Software
 %   Foundation, Inc.
 
 %This texinfo.tex file is free software; you can redistribute it and/or
diff --git a/test/manual/etags/y-src/cccp.c b/test/manual/etags/y-src/cccp.c
index 89241cd..7156414 100644
--- a/test/manual/etags/y-src/cccp.c
+++ b/test/manual/etags/y-src/cccp.c
@@ -320,7 +320,7 @@ static const short yycheck[] =
 #line 3 "/usr/share/bison/bison.simple"
 
 /* Skeleton output parser for bison,
-   Copyright (C) 1984, 1989-1990, 2000-2001, 2016-2020 Free Software
+   Copyright (C) 1984, 1989-1990, 2000-2001, 2016-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/test/manual/etags/y-src/parse.c b/test/manual/etags/y-src/parse.c
index 0415c4a..f90d315 100644
--- a/test/manual/etags/y-src/parse.c
+++ b/test/manual/etags/y-src/parse.c
@@ -28,7 +28,7 @@
 
 #line 1 "y-src/parse.y"
 
-/*     Copyright (C) 1990, 1992-1993, 2016-2020 Free Software Foundation,
+/*     Copyright (C) 1990, 1992-1993, 2016-2021 Free Software Foundation,
  *     Inc.
 
 This file is part of Oleo, the GNU Spreadsheet.
diff --git a/test/manual/etags/y-src/parse.y b/test/manual/etags/y-src/parse.y
index eeef44c..7985da5 100644
--- a/test/manual/etags/y-src/parse.y
+++ b/test/manual/etags/y-src/parse.y
@@ -1,5 +1,5 @@
 %{
-/*     Copyright (C) 1990, 1992-1993, 2016-2020 Free Software Foundation,
+/*     Copyright (C) 1990, 1992-1993, 2016-2021 Free Software Foundation,
  *     Inc.
 
 This file is part of Oleo, the GNU Spreadsheet.
diff --git a/test/manual/image-circular-tests.el 
b/test/manual/image-circular-tests.el
index 33ea3ea..3d1d232 100644
--- a/test/manual/image-circular-tests.el
+++ b/test/manual/image-circular-tests.el
@@ -1,6 +1,6 @@
-;;; image-tests.el --- Test suite for image-related functions.
+;;; image-circular-tests.el --- test image functions with circular objects
 
-;; Copyright (C) 2019 Free Software Foundation, Inc.
+;; Copyright (C) 2019, 2021 Free Software Foundation, Inc.
 
 ;; Author: Pip Cet <pipcet@gmail.com>
 ;; Keywords:       internal
@@ -61,84 +61,5 @@
      (and (equal (image-size spec1 t) (cons 1 1))
           (equal (image-size spec2 t) (cons 1 1))))))
 
-(provide 'image-tests)
-;;; image-tests.el ends here.
-;;; image-tests.el --- tests for image.el -*- lexical-binding: t -*-
-
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
-
-;;; Code:
-
-(require 'ert)
-(require 'image)
-(eval-when-compile
-  (require 'cl-lib))
-
-(defconst image-tests--emacs-images-directory
-  (expand-file-name "../etc/images" (getenv "EMACS_TEST_DIRECTORY"))
-  "Directory containing Emacs images.")
-
-(ert-deftest image--set-property ()
-  "Test `image--set-property' behavior."
-  (let ((image (list 'image)))
-    ;; Add properties.
-    (setf (image-property image :scale) 1)
-    (should (equal image '(image :scale 1)))
-    (setf (image-property image :width) 8)
-    (should (equal image '(image :scale 1 :width 8)))
-    (setf (image-property image :height) 16)
-    (should (equal image '(image :scale 1 :width 8 :height 16)))
-    ;; Delete properties.
-    (setf (image-property image :type) nil)
-    (should (equal image '(image :scale 1 :width 8 :height 16)))
-    (setf (image-property image :scale) nil)
-    (should (equal image '(image :width 8 :height 16)))
-    (setf (image-property image :height) nil)
-    (should (equal image '(image :width 8)))
-    (setf (image-property image :width) nil)
-    (should (equal image '(image)))))
-
-(ert-deftest image-type-from-file-header-test ()
-  "Test image-type-from-file-header."
-  (should (eq (if (image-type-available-p 'svg) 'svg)
-             (image-type-from-file-header
-              (expand-file-name "splash.svg"
-                                image-tests--emacs-images-directory)))))
-
-(ert-deftest image-rotate ()
-  "Test `image-rotate'."
-  (cl-letf* ((image (list 'image))
-             ((symbol-function 'image--get-imagemagick-and-warn)
-              (lambda () image)))
-    (let ((current-prefix-arg '(4)))
-      (call-interactively #'image-rotate))
-    (should (equal image '(image :rotation 270.0)))
-    (call-interactively #'image-rotate)
-    (should (equal image '(image :rotation 0.0)))
-    (image-rotate)
-    (should (equal image '(image :rotation 90.0)))
-    (image-rotate 0)
-    (should (equal image '(image :rotation 90.0)))
-    (image-rotate 1)
-    (should (equal image '(image :rotation 91.0)))
-    (image-rotate 1234.5)
-    (should (equal image '(image :rotation 245.5)))
-    (image-rotate -154.5)
-    (should (equal image '(image :rotation 91.0)))))
-
-;;; image-tests.el ends here
+(provide 'image-circular-tests)
+;;; image-circular-tests.el ends here.
diff --git a/test/manual/image-size-tests.el b/test/manual/image-size-tests.el
index 159e902..489b397 100644
--- a/test/manual/image-size-tests.el
+++ b/test/manual/image-size-tests.el
@@ -1,6 +1,6 @@
 ;;; image-size-tests.el -- tests for image scaling
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/manual/image-transforms-tests.el 
b/test/manual/image-transforms-tests.el
index 13d74a7..5342b5e 100644
--- a/test/manual/image-transforms-tests.el
+++ b/test/manual/image-transforms-tests.el
@@ -1,6 +1,6 @@
 ;;; image-transform-tests.el --- Test suite for image transforms.  -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Alan Third <alan@idiocy.org>
 ;; Keywords:       internal
diff --git a/test/manual/indent/pascal.pas b/test/manual/indent/pascal.pas
index 35ee521..a166eed 100644
--- a/test/manual/indent/pascal.pas
+++ b/test/manual/indent/pascal.pas
@@ -1,6 +1,6 @@
 { GPC demo program for the CRT unit.
 
-Copyright (C) 1999-2006, 2013-2020 Free Software Foundation, Inc.
+Copyright (C) 1999-2006, 2013-2021 Free Software Foundation, Inc.
 
 Author: Frank Heckenbach <frank@pascal.gnu.de>
 
diff --git a/test/manual/redisplay-testsuite.el 
b/test/manual/redisplay-testsuite.el
index 46f4a92..48f3788 100644
--- a/test/manual/redisplay-testsuite.el
+++ b/test/manual/redisplay-testsuite.el
@@ -1,6 +1,6 @@
 ;;; redisplay-testsuite.el --- Test suite for redisplay.
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Chong Yidong <cyd@stupidchicken.com>
 ;; Keywords:       internal
diff --git a/test/manual/scroll-tests.el b/test/manual/scroll-tests.el
index 937e0b1..2f40b2b 100644
--- a/test/manual/scroll-tests.el
+++ b/test/manual/scroll-tests.el
@@ -1,6 +1,6 @@
 ;;; scroll-tests.el -- tests for scrolling -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/alloc-tests.el b/test/src/alloc-tests.el
index aa1ab16..1324c2d 100644
--- a/test/src/alloc-tests.el
+++ b/test/src/alloc-tests.el
@@ -1,6 +1,6 @@
 ;;; alloc-tests.el --- alloc tests -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel Colascione <dancol@dancol.org>
 ;; Keywords:
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index 0db66f9..123f2e8 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -1,6 +1,6 @@
 ;;; buffer-tests.el --- tests for buffer.c functions -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -19,9 +19,7 @@
 
 ;;; Code:
 
-(require 'ert)
-(require 'seq)
-(eval-when-compile (require 'cl-lib))
+(require 'cl-lib)
 
 (ert-deftest overlay-modification-hooks-message-other-buf ()
   "Test for bug#21824.
@@ -1334,4 +1332,33 @@ with parameters from the *Messages* buffer modification."
   (with-temp-buffer
     (should (assq 'buffer-undo-list (buffer-local-variables)))))
 
+(ert-deftest buffer-tests-inhibit-buffer-hooks ()
+  "Test `get-buffer-create' argument INHIBIT-BUFFER-HOOKS."
+  (let* (run-bluh (bluh (lambda () (setq run-bluh t))))
+    (unwind-protect
+        (let* ( run-kbh  (kbh  (lambda () (setq run-kbh  t)))
+                run-kbqf (kbqf (lambda () (setq run-kbqf t))) )
+
+          ;; Inhibited.
+          (add-hook 'buffer-list-update-hook bluh)
+          (with-current-buffer (generate-new-buffer " foo" t)
+            (add-hook 'kill-buffer-hook kbh nil t)
+            (add-hook 'kill-buffer-query-functions kbqf nil t)
+            (kill-buffer))
+          (with-temp-buffer)
+          (with-output-to-string)
+          (should-not run-bluh)
+          (should-not run-kbh)
+          (should-not run-kbqf)
+
+          ;; Not inhibited.
+          (with-current-buffer (generate-new-buffer " foo")
+            (should run-bluh)
+            (add-hook 'kill-buffer-hook kbh nil t)
+            (add-hook 'kill-buffer-query-functions kbqf nil t)
+            (kill-buffer))
+          (should run-kbh)
+          (should run-kbqf))
+      (remove-hook 'buffer-list-update-hook bluh))))
+
 ;;; buffer-tests.el ends here
diff --git a/test/src/callint-tests.el b/test/src/callint-tests.el
index 42dae42..0df5887 100644
--- a/test/src/callint-tests.el
+++ b/test/src/callint-tests.el
@@ -1,6 +1,6 @@
 ;;; callint-tests.el --- unit tests for callint.c    -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Philipp Stephani <phst@google.com>
 
diff --git a/test/src/callproc-tests.el b/test/src/callproc-tests.el
index 1617d5e..7262abb 100644
--- a/test/src/callproc-tests.el
+++ b/test/src/callproc-tests.el
@@ -1,6 +1,6 @@
 ;;; callproc-tests.el --- callproc.c tests -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/casefiddle-tests.el b/test/src/casefiddle-tests.el
index 7abb79e..9fa54dc 100644
--- a/test/src/casefiddle-tests.el
+++ b/test/src/casefiddle-tests.el
@@ -1,6 +1,6 @@
 ;;; casefiddle-tests.el --- tests for casefiddle.c functions -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2015-2016, 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2016, 2018-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -247,7 +247,8 @@
   ;;             input upcase downcase [titlecase]
   (dolist (test '((?a ?A ?a) (?A ?A ?a)
                   (?ł ?Ł ?ł) (?Ł ?Ł ?ł)
-                  (?ß ?ß ?ß) (?ẞ ?ẞ ?ß)
+                  ;; We char-upcase ß to ẞ; see bug #11309.
+                  (?ß ?ẞ ?ß) (?ẞ ?ẞ ?ß)
                   (?ⅷ ?Ⅷ ?ⅷ) (?Ⅷ ?Ⅷ ?ⅷ)
                   (?DŽ ?DŽ ?dž ?Dž) (?Dž ?DŽ ?dž ?Dž) (?dž ?DŽ ?dž ?Dž)))
     (let ((ch (car test))
diff --git a/test/src/charset-tests.el b/test/src/charset-tests.el
index 86a0d6f..5c46627 100644
--- a/test/src/charset-tests.el
+++ b/test/src/charset-tests.el
@@ -1,6 +1,6 @@
 ;;; charset-tests.el --- Tests for charset.c -*- lexical-binding: t -*-
 
-;; Copyright 2017-2020 Free Software Foundation, Inc.
+;; Copyright 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/chartab-tests.el b/test/src/chartab-tests.el
index 4d52dc3..bf37fb5 100644
--- a/test/src/chartab-tests.el
+++ b/test/src/chartab-tests.el
@@ -1,6 +1,6 @@
 ;;; chartab-tests.el --- Tests for char-tab.c -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Eli Zaretskii <eliz@gnu.org>
 
@@ -49,5 +49,25 @@
           (#xe0e00 . #xe0ef6)
           )))
 
+(ert-deftest chartab-test-char-table-p ()
+  (should (char-table-p (make-char-table 'foo)))
+  (should (not (char-table-p (make-hash-table)))))
+
+(ert-deftest chartab-test-char-table-subtype ()
+  (should (eq (char-table-subtype (make-char-table 'foo)) 'foo)))
+
+(ert-deftest chartab-test-char-table-parent ()
+  (should (eq (char-table-parent (make-char-table 'foo)) nil))
+  (let ((parent (make-char-table 'foo))
+        (child (make-char-table 'bar)))
+    (set-char-table-parent child parent)
+    (should (eq (char-table-parent child) parent))))
+
+(ert-deftest chartab-test-char-table-extra-slot ()
+  ;; Use any type with extra slots, e.g. 'case-table.
+  (let ((tbl (make-char-table 'case-table)))
+    (set-char-table-extra-slot tbl 1 'bar)
+    (should (eq (char-table-extra-slot tbl 1) 'bar))))
+
 (provide 'chartab-tests)
 ;;; chartab-tests.el ends here
diff --git a/test/src/cmds-tests.el b/test/src/cmds-tests.el
index 302b00c..681bfb3 100644
--- a/test/src/cmds-tests.el
+++ b/test/src/cmds-tests.el
@@ -1,6 +1,6 @@
 ;;; cmds-tests.el --- Testing some Emacs commands -*- lexical-binding: t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Nicolas Richard <youngfrog@members.fsf.org>
 ;; Keywords:
diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el
index 82883a0..0bdcff2 100644
--- a/test/src/coding-tests.el
+++ b/test/src/coding-tests.el
@@ -1,6 +1,6 @@
 ;;; coding-tests.el --- tests for text encoding and decoding -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Eli Zaretskii <eliz@gnu.org>
 ;; Author: Kenichi Handa <handa@gnu.org>
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 1312683..03d867f 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -1,6 +1,6 @@
 ;;; data-tests.el --- tests for src/data.c  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -324,7 +324,7 @@ comparing the subr with a much slower lisp implementation."
 
 (defvar binding-test-some-local 'some)
 (with-current-buffer binding-test-buffer-A
-  (set (make-local-variable 'binding-test-some-local) 'local))
+  (setq-local binding-test-some-local 'local))
 
 (ert-deftest binding-test-manual ()
   "A test case from the elisp manual."
diff --git a/test/src/decompress-tests.el b/test/src/decompress-tests.el
index 0a32839..67a7fef 100644
--- a/test/src/decompress-tests.el
+++ b/test/src/decompress-tests.el
@@ -1,6 +1,6 @@
 ;;; decompress-tests.el --- Test suite for decompress. -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Lars Ingebrigtsen <larsi@gnus.org>
 
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el
index de0aeab..64f9137 100644
--- a/test/src/editfns-tests.el
+++ b/test/src/editfns-tests.el
@@ -1,6 +1,6 @@
 ;;; editfns-tests.el -- tests for editfns.c  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/emacs-module-resources/mod-test.c 
b/test/src/emacs-module-resources/mod-test.c
index f855e9b..ad59cfc 100644
--- a/test/src/emacs-module-resources/mod-test.c
+++ b/test/src/emacs-module-resources/mod-test.c
@@ -1,6 +1,6 @@
 /* Test GNU Emacs modules.
 
-Copyright 2015-2020 Free Software Foundation, Inc.
+Copyright 2015-2021 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -24,6 +24,7 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
 #include <limits.h>
+#include <stdbool.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -699,6 +700,34 @@ Fmod_test_funcall (emacs_env *env, ptrdiff_t nargs, 
emacs_value *args,
   return env->funcall (env, args[0], nargs - 1, args + 1);
 }
 
+static emacs_value
+Fmod_test_make_string (emacs_env *env, ptrdiff_t nargs,
+                       emacs_value *args, void *data)
+{
+  assert (nargs == 2);
+  intmax_t length_arg = env->extract_integer (env, args[0]);
+  if (env->non_local_exit_check (env) != emacs_funcall_exit_return)
+    return args[0];
+  if (length_arg < 0 || SIZE_MAX < length_arg)
+    {
+      signal_error (env, "Invalid string length");
+      return args[0];
+    }
+  size_t length = (size_t) length_arg;
+  bool multibyte = env->is_not_nil (env, args[1]);
+  char *buffer = length == 0 ? NULL : malloc (length);
+  if (buffer == NULL && length != 0)
+    {
+      memory_full (env);
+      return args[0];
+    }
+  memset (buffer, 'a', length);
+  emacs_value ret = multibyte ? env->make_string (env, buffer, length)
+                              : env->make_unibyte_string (env, buffer, length);
+  free (buffer);
+  return ret;
+}
+
 /* Lisp utilities for easier readability (simple wrappers).  */
 
 /* Provide FEATURE to Emacs.  */
@@ -790,6 +819,7 @@ emacs_module_init (struct emacs_runtime *ert)
   DEFUN ("mod-test-async-pipe", Fmod_test_async_pipe, 1, 1, NULL, NULL);
   DEFUN ("mod-test-funcall", Fmod_test_funcall, 1, emacs_variadic_function,
          NULL, NULL);
+  DEFUN ("mod-test-make-string", Fmod_test_make_string, 2, 2, NULL, NULL);
 
 #undef DEFUN
 
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 99d4caf..af5bc2a 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -1,6 +1,6 @@
 ;;; emacs-module-tests --- Test GNU Emacs modules.  -*- lexical-binding: t; -*-
 
-;; Copyright 2015-2020 Free Software Foundation, Inc.
+;; Copyright 2015-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -30,6 +30,7 @@
 (require 'ert)
 (require 'ert-x)
 (require 'help-fns)
+(require 'subr-x)
 
 (defconst mod-test-emacs
   (expand-file-name invocation-name invocation-directory)
@@ -556,4 +557,23 @@ See Bug#36226."
     (thread-join thread-1)
     (thread-join thread-2)))
 
+(ert-deftest mod-test-make-string/empty ()
+  (dolist (multibyte '(nil t))
+    (ert-info ((format "Multibyte: %s" multibyte))
+      (let ((got (mod-test-make-string 0 multibyte)))
+        (should (stringp got))
+        (should (string-empty-p got))
+        (should (eq (multibyte-string-p got) multibyte))))))
+
+(ert-deftest mod-test-make-string/nonempty ()
+  (dolist (multibyte '(nil t))
+    (ert-info ((format "Multibyte: %s" multibyte))
+      (let ((first (mod-test-make-string 1 multibyte))
+            (second (mod-test-make-string 1 multibyte)))
+        (should (stringp first))
+        (should (eql (length first) 1))
+        (should (eq (multibyte-string-p first) multibyte))
+        (should (string-equal first second))
+        (should-not (eq first second))))))
+
 ;;; emacs-module-tests.el ends here
diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el
index 4125573..b2b7dfe 100644
--- a/test/src/eval-tests.el
+++ b/test/src/eval-tests.el
@@ -1,6 +1,6 @@
 ;;; eval-tests.el --- unit tests for src/eval.c      -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Philipp Stephani <phst@google.com>
 
@@ -195,6 +195,23 @@ expressions works for identifiers starting with period."
         (search-forward "  foo()")
         (search-forward "  normal-top-level()")))))
 
+(ert-deftest eval-tests/backtrace-in-batch-mode/inhibit ()
+  (let ((emacs (expand-file-name invocation-name invocation-directory)))
+    (skip-unless (file-executable-p emacs))
+    (with-temp-buffer
+      (let ((status (call-process
+                     emacs nil t nil
+                     "--quick" "--batch"
+                     (concat "--eval="
+                             (prin1-to-string
+                              '(progn
+                                 (defun foo () (error "Boo"))
+                                 (let ((backtrace-on-error-noninteractive nil))
+                                   (foo))))))))
+        (should (natnump status))
+        (should-not (eql status 0)))
+      (should (equal (string-trim (buffer-string)) "Boo")))))
+
 (ert-deftest eval-tests/backtrace-in-batch-mode/demoted-errors ()
   (let ((emacs (expand-file-name invocation-name invocation-directory)))
     (skip-unless (file-executable-p emacs))
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index ed381d1..7f193d4 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -1,6 +1,6 @@
 ;;; unit tests for src/fileio.c      -*- lexical-binding: t; -*-
 
-;; Copyright 2017-2020 Free Software Foundation, Inc.
+;; Copyright 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -155,3 +155,9 @@ Also check that an encoding error can appear in a symlink."
     (write-region "hello\n" nil f nil 'silent)
     (should-error (insert-file-contents f) :type 'circular-list)
     (delete-file f)))
+
+(ert-deftest fileio-tests/null-character ()
+  (should-error (file-exists-p "/foo\0bar")
+                :type 'wrong-type-argument))
+
+;;; fileio-tests.el ends here
diff --git a/test/src/floatfns-tests.el b/test/src/floatfns-tests.el
index 8c56674..4a3c03d 100644
--- a/test/src/floatfns-tests.el
+++ b/test/src/floatfns-tests.el
@@ -1,6 +1,6 @@
 ;;; floatfns-tests.el --- tests for floating point operations -*- 
lexical-binding: t -*-
 
-;; Copyright 2017-2020 Free Software Foundation, Inc.
+;; Copyright 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 86b8d65..a9daf87 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -1,6 +1,6 @@
 ;;; fns-tests.el --- tests for src/fns.c  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -983,3 +983,60 @@
   (should (equal (string-search (string-to-multibyte "o\303\270") 
"foo\303\270")
                  2))
   (should (equal (string-search "\303\270" "foo\303\270") 3)))
+
+(ert-deftest object-intervals ()
+  (should (equal (object-intervals (propertize "foo" 'bar 'zot))
+                 '((0 3 (bar zot)))))
+  (should (equal (object-intervals (concat (propertize "foo" 'bar 'zot)
+                                           (propertize "foo" 'gazonk 
"gazonk")))
+                 '((0 3 (bar zot)) (3 6 (gazonk "gazonk")))))
+  (should (equal
+           (with-temp-buffer
+             (insert "foobar")
+             (put-text-property 1 3 'foo 1)
+             (put-text-property 3 6 'bar 2)
+             (put-text-property 2 5 'zot 3)
+             (object-intervals (current-buffer)))
+           '((0 1 (foo 1)) (1 2 (zot 3 foo 1)) (2 4 (zot 3 bar 2))
+             (4 5 (bar 2)) (5 6 nil)))))
+
+(ert-deftest length-equals-tests ()
+  (should-not (length< (list 1 2 3) 2))
+  (should-not (length< (list 1 2 3) 3))
+  (should (length< (list 1 2 3) 4))
+
+  (should-not (length< "abc" 2))
+  (should-not (length< "abc" 3))
+  (should (length< "abc" 4))
+
+  (should (length> (list 1 2 3) 2))
+  (should-not (length> (list 1 2 3) 3))
+  (should-not (length> (list 1 2 3) 4))
+
+  (should (length> "abc" 2))
+  (should-not (length> "abc" 3))
+  (should-not (length> "abc" 4))
+
+  (should-not (length= (list 1 2 3) 2))
+  (should (length= (list 1 2 3) 3))
+  (should-not (length= (list 1 2 3) 4))
+
+  (should-not (length= "abc" 2))
+  (should (length= "abc" 3))
+  (should-not (length= "abc" 4))
+
+  (should-not (length< (list 1 2 3) -1))
+  (should-not (length< (list 1 2 3) 0))
+  (should-not (length< (list 1 2 3) -10))
+
+  (should (length> (list 1 2 3) -1))
+  (should (length> (list 1 2 3) 0))
+
+  (should-not (length= (list 1 2 3) -1))
+  (should-not (length= (list 1 2 3) 0))
+  (should-not (length= (list 1 2 3) 1))
+
+  (should-error
+   (let ((list (list 1)))
+     (setcdr list list)
+     (length< list #x1fffe))))
diff --git a/test/src/font-tests.el b/test/src/font-tests.el
index cfc6f4c..de153b8 100644
--- a/test/src/font-tests.el
+++ b/test/src/font-tests.el
@@ -1,6 +1,6 @@
 ;;; font-tests.el --- Test suite for font-related functions. -*- 
lexical-binding: t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Chong Yidong <cyd@stupidchicken.com>
 ;; Keywords:       internal
diff --git a/test/src/indent-tests.el b/test/src/indent-tests.el
index 7d1a6ce..10f1202 100644
--- a/test/src/indent-tests.el
+++ b/test/src/indent-tests.el
@@ -1,6 +1,6 @@
 ;;; indent-tests.el --- tests for src/indent.c  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/inotify-tests.el b/test/src/inotify-tests.el
index d42fe1b..5572c7d 100644
--- a/test/src/inotify-tests.el
+++ b/test/src/inotify-tests.el
@@ -1,6 +1,6 @@
 ;;; inotify-tests.el --- Test suite for inotify. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
 ;; Keywords:       internal
diff --git a/test/src/json-tests.el b/test/src/json-tests.el
index 028f92f..4be11b8 100644
--- a/test/src/json-tests.el
+++ b/test/src/json-tests.el
@@ -1,6 +1,6 @@
 ;;; json-tests.el --- unit tests for json.c          -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/keyboard-tests.el b/test/src/keyboard-tests.el
index 970a535..607d2ea 100644
--- a/test/src/keyboard-tests.el
+++ b/test/src/keyboard-tests.el
@@ -1,6 +1,6 @@
 ;;; keyboard-tests.el --- Tests for keyboard.c -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el
index 6411cd1..74fb3c8 100644
--- a/test/src/keymap-tests.el
+++ b/test/src/keymap-tests.el
@@ -1,6 +1,6 @@
 ;;; keymap-tests.el --- Test suite for src/keymap.c -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Juanma Barranquero <lekktu@gmail.com>
 ;;         Stefan Kangas <stefankangas@gmail.com>
@@ -248,19 +248,6 @@ g .. h             foo
 0 .. 3         foo
 ")))))
 
-
-;;;; apropos-internal
-
-(ert-deftest keymap-apropos-internal ()
-  (should (equal (apropos-internal "^next-line$") '(next-line)))
-  (should (>= (length (apropos-internal "^help")) 100))
-  (should-not (apropos-internal "^test-a-missing-symbol-foo-bar-zut$")))
-
-(ert-deftest keymap-apropos-internal/predicate ()
-  (should (equal (apropos-internal "^next-line$" #'commandp) '(next-line)))
-  (should (>= (length (apropos-internal "^help" #'commandp)) 15))
-  (should-not (apropos-internal "^next-line$" #'keymapp)))
-
 (provide 'keymap-tests)
 
 ;;; keymap-tests.el ends here
diff --git a/test/src/lcms-tests.el b/test/src/lcms-tests.el
index 4430d69..40a48f1 100644
--- a/test/src/lcms-tests.el
+++ b/test/src/lcms-tests.el
@@ -1,6 +1,6 @@
 ;;; lcms-tests.el --- tests for Little CMS interface -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el
index 825b74e..edf8821 100644
--- a/test/src/lread-tests.el
+++ b/test/src/lread-tests.el
@@ -1,6 +1,6 @@
 ;;; lread-tests.el --- tests for lread.c -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; Author: Philipp Stephani <phst@google.com>
 
diff --git a/test/src/marker-tests.el b/test/src/marker-tests.el
index 37140f8..234a0b3 100644
--- a/test/src/marker-tests.el
+++ b/test/src/marker-tests.el
@@ -1,6 +1,6 @@
 ;;; marker-tests.el --- tests for marker.c functions -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/minibuf-tests.el b/test/src/minibuf-tests.el
index 13f5fac..b9cd255 100644
--- a/test/src/minibuf-tests.el
+++ b/test/src/minibuf-tests.el
@@ -1,6 +1,6 @@
 ;;; minibuf-tests.el --- tests for minibuf.c functions -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/print-tests.el b/test/src/print-tests.el
index 202555a..0d2ea6e 100644
--- a/test/src/print-tests.el
+++ b/test/src/print-tests.el
@@ -1,6 +1,6 @@
 ;;; print-tests.el --- tests for src/print.c         -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index e15ad47..5294bc0 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -1,6 +1,6 @@
 ;;; process-tests.el --- Testing the process facilities -*- lexical-binding: t 
-*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -23,8 +23,11 @@
 
 ;;; Code:
 
+(require 'cl-lib)
 (require 'ert)
 (require 'puny)
+(require 'rx)
+(require 'subr-x)
 
 ;; Timeout in seconds; the test fails if the timeout is reached.
 (defvar process-test-sentinel-wait-timeout 2.0)
@@ -47,13 +50,15 @@
 
 (ert-deftest process-test-sentinel-accept-process-output ()
   (skip-unless (executable-find "bash"))
+  (with-timeout (60 (ert-fail "Test timed out"))
   (should (process-test-sentinel-wait-function-working-p
-           #'accept-process-output)))
+           #'accept-process-output))))
 
 (ert-deftest process-test-sentinel-sit-for ()
   (skip-unless (executable-find "bash"))
+  (with-timeout (60 (ert-fail "Test timed out"))
   (should
-   (process-test-sentinel-wait-function-working-p (lambda () (sit-for 0.01 
t)))))
+   (process-test-sentinel-wait-function-working-p (lambda () (sit-for 0.01 
t))))))
 
 (when (eq system-type 'windows-nt)
   (ert-deftest process-test-quoted-batfile ()
@@ -79,6 +84,7 @@
 
 (ert-deftest process-test-stderr-buffer ()
   (skip-unless (executable-find "bash"))
+  (with-timeout (60 (ert-fail "Test timed out"))
   (let* ((stdout-buffer (generate-new-buffer "*stdout*"))
         (stderr-buffer (generate-new-buffer "*stderr*"))
         (proc (make-process :name "test"
@@ -103,10 +109,11 @@
              (looking-at "hello stdout!")))
     (should (with-current-buffer stderr-buffer
              (goto-char (point-min))
-             (looking-at "hello stderr!")))))
+             (looking-at "hello stderr!"))))))
 
 (ert-deftest process-test-stderr-filter ()
   (skip-unless (executable-find "bash"))
+  (with-timeout (60 (ert-fail "Test timed out"))
   (let* ((sentinel-called nil)
         (stderr-sentinel-called nil)
         (stdout-output nil)
@@ -145,10 +152,11 @@
     (should (equal 1 (with-current-buffer stderr-buffer
                       (point-max))))
     (should (equal "hello stderr!\n"
-                  (mapconcat #'identity (nreverse stderr-output) "")))))
+                  (mapconcat #'identity (nreverse stderr-output) ""))))))
 
 (ert-deftest set-process-filter-t ()
   "Test setting process filter to t and back." ;; Bug#36591
+  (with-timeout (60 (ert-fail "Test timed out"))
   (with-temp-buffer
     (let* ((print-level nil)
            (print-length nil)
@@ -180,11 +188,12 @@
                           (line-beginning-position) (point-max))
                          "2> "))
         (accept-process-output proc))   ; Read "Two".
-      (should (equal (buffer-string) "0> one\n1> two\n2> ")))))
+      (should (equal (buffer-string) "0> one\n1> two\n2> "))))))
 
 (ert-deftest start-process-should-not-modify-arguments ()
   "`start-process' must not modify its arguments in-place."
   ;; See bug#21831.
+  (with-timeout (60 (ert-fail "Test timed out"))
   (let* ((path (pcase system-type
                  ((or 'windows-nt 'ms-dos)
                   ;; Make sure the file name uses forward slashes.
@@ -198,11 +207,12 @@
     (should (process-live-p (condition-case nil
                                 (start-process "" nil path)
                               (error nil))))
-    (should (equal path samepath))))
+    (should (equal path samepath)))))
 
 (ert-deftest make-process/noquery-stderr ()
   "Checks that Bug#30031 is fixed."
   (skip-unless (executable-find "sleep"))
+  (with-timeout (60 (ert-fail "Test timed out"))
   (with-temp-buffer
     (let* ((previous-processes (process-list))
            (process (make-process :name "sleep"
@@ -217,7 +227,7 @@
             (should new-processes)
             (dolist (process new-processes)
               (should-not (process-query-on-exit-flag process))))
-        (kill-process process)))))
+        (kill-process process))))))
 
 ;; Return t if OUTPUT could have been generated by merging the INPUTS somehow.
 (defun process-tests--mixable (output &rest inputs)
@@ -233,6 +243,7 @@
 (ert-deftest make-process/mix-stderr ()
   "Check that `make-process' mixes the output streams if STDERR is nil."
   (skip-unless (executable-find "bash"))
+  (with-timeout (60 (ert-fail "Test timed out"))
   ;; Frequent random (?) failures on hydra.nixos.org, with no process output.
   ;; Maybe this test should be tagged unstable?  See bug#31214.
   (skip-unless (not (getenv "EMACS_HYDRA_CI")))
@@ -251,11 +262,12 @@
       (should (eq (process-exit-status process) 0))
       (should (process-tests--mixable (string-to-list (buffer-string))
                                       (string-to-list "stdout\n")
-                                      (string-to-list "stderr\n"))))))
+                                      (string-to-list "stderr\n")))))))
 
 (ert-deftest make-process-w32-debug-spawn-error ()
   "Check that debugger runs on `make-process' failure (Bug#33016)."
   (skip-unless (eq system-type 'windows-nt))
+  (with-timeout (60 (ert-fail "Test timed out"))
   (let* ((debug-on-error t)
          (have-called-debugger nil)
          (debugger (lambda (&rest _)
@@ -271,11 +283,12 @@
                     ;; code.
                     (make-process :name "test" :command 
'("c:/No-Such-Command"))
                   (error :got-error))))
-    (should have-called-debugger)))
+    (should have-called-debugger))))
 
 (ert-deftest make-process/file-handler/found ()
-  "Check that the ‘:file-handler’ argument of ‘make-process’
+  "Check that the `:file-handler’ argument of `make-process’
 works as expected if a file name handler is found."
+  (with-timeout (60 (ert-fail "Test timed out"))
   (let ((file-handler-calls 0))
     (cl-flet ((file-handler
                (&rest args)
@@ -292,27 +305,29 @@ works as expected if a file name handler is found."
                                   :command '("/some/binary")
                                   :file-handler t)
                     'fake-process))
-        (should (= file-handler-calls 1))))))
+        (should (= file-handler-calls 1)))))))
 
 (ert-deftest make-process/file-handler/not-found ()
-  "Check that the ‘:file-handler’ argument of ‘make-process’
+  "Check that the `:file-handler’ argument of `make-process’
 works as expected if no file name handler is found."
+  (with-timeout (60 (ert-fail "Test timed out"))
   (let ((file-name-handler-alist ())
         (default-directory invocation-directory)
         (program (expand-file-name invocation-name invocation-directory)))
     (should (processp (make-process :name "name"
                                     :command (list program "--version")
-                                    :file-handler t)))))
+                                    :file-handler t))))))
 
 (ert-deftest make-process/file-handler/disable ()
-  "Check ‘make-process’ works as expected if it shouldn’t use the
+  "Check `make-process’ works as expected if it shouldn’t use the
 file name handler."
+  (with-timeout (60 (ert-fail "Test timed out"))
   (let ((file-name-handler-alist (list (cons (rx bos "test-handler:")
                                              #'process-tests--file-handler)))
         (default-directory "test-handler:/dir/")
         (program (expand-file-name invocation-name invocation-directory)))
     (should (processp (make-process :name "name"
-                                    :command (list program "--version"))))))
+                                    :command (list program "--version")))))))
 
 (defun process-tests--file-handler (operation &rest _args)
   (cl-ecase operation
@@ -325,48 +340,374 @@ file name handler."
 (ert-deftest make-process/stop ()
   "Check that `make-process' doesn't accept a `:stop' key.
 See Bug#30460."
+  (with-timeout (60 (ert-fail "Test timed out"))
   (should-error
    (make-process :name "test"
                  :command (list (expand-file-name invocation-name
                                                   invocation-directory))
-                 :stop t)))
+                 :stop t))))
 
 ;; All the following tests require working DNS, which appears not to
 ;; be the case for hydra.nixos.org, so disable them there for now.
 
 (ert-deftest lookup-family-specification ()
-  "network-lookup-address-info should only accept valid family symbols."
+  "`network-lookup-address-info' should only accept valid family symbols."
   (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+  (with-timeout (60 (ert-fail "Test timed out"))
   (should-error (network-lookup-address-info "google.com" 'both))
   (should (network-lookup-address-info "google.com" 'ipv4))
   (when (featurep 'make-network-process '(:family ipv6))
-    (should (network-lookup-address-info "google.com" 'ipv6))))
+    (should (network-lookup-address-info "google.com" 'ipv6)))))
 
 (ert-deftest lookup-unicode-domains ()
-  "Unicode domains should fail"
+  "Unicode domains should fail."
   (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+  (with-timeout (60 (ert-fail "Test timed out"))
   (should-error (network-lookup-address-info "faß.de"))
-  (should (network-lookup-address-info (puny-encode-domain "faß.de"))))
+  (should (network-lookup-address-info (puny-encode-domain "faß.de")))))
 
 (ert-deftest unibyte-domain-name ()
-  "Unibyte domain names should work"
+  "Unibyte domain names should work."
   (skip-unless (not (getenv "EMACS_HYDRA_CI")))
-  (should (network-lookup-address-info (string-to-unibyte "google.com"))))
+  (with-timeout (60 (ert-fail "Test timed out"))
+  (should (network-lookup-address-info (string-to-unibyte "google.com")))))
 
 (ert-deftest lookup-google ()
-  "Check that we can look up google IP addresses"
+  "Check that we can look up google IP addresses."
   (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+  (with-timeout (60 (ert-fail "Test timed out"))
   (let ((addresses-both (network-lookup-address-info "google.com"))
         (addresses-v4 (network-lookup-address-info "google.com" 'ipv4)))
     (should addresses-both)
     (should addresses-v4))
   (when (featurep 'make-network-process '(:family ipv6))
-    (should (network-lookup-address-info "google.com" 'ipv6))))
+    (should (network-lookup-address-info "google.com" 'ipv6)))))
 
 (ert-deftest non-existent-lookup-failure ()
+  "Check that looking up non-existent domain returns nil."
   (skip-unless (not (getenv "EMACS_HYDRA_CI")))
-  "Check that looking up non-existent domain returns nil"
-  (should (eq nil (network-lookup-address-info "emacs.invalid"))))
+  (with-timeout (60 (ert-fail "Test timed out"))
+  (should (eq nil (network-lookup-address-info "emacs.invalid")))))
+
+(defmacro process-tests--ignore-EMFILE (&rest body)
+  "Evaluate BODY, ignoring EMFILE errors."
+  (declare (indent 0) (debug t))
+  (let ((err (make-symbol "err"))
+        (message (make-symbol "message")))
+    `(let ((,message (process-tests--EMFILE-message)))
+       (condition-case ,err
+           ,(macroexp-progn body)
+         (file-error
+          ;; If we couldn't determine the EMFILE message, just ignore
+          ;; all `file-error' signals.
+          (and ,message
+               (not (string-equal (caddr ,err) ,message))
+               (signal (car ,err) (cdr ,err))))))))
+
+(defmacro process-tests--with-buffers (var &rest body)
+  "Bind VAR to nil and evaluate BODY.
+Afterwards, kill all buffers in the list VAR.  BODY should add
+some buffer objects to VAR."
+  (declare (indent 1) (debug (symbolp body)))
+  (cl-check-type var symbol)
+  `(let ((,var nil))
+     (unwind-protect
+         ,(macroexp-progn body)
+       (mapc #'kill-buffer ,var))))
+
+(defmacro process-tests--with-processes (var &rest body)
+  "Bind VAR to nil and evaluate BODY.
+Afterwards, delete all processes in the list VAR.  BODY should
+add some process objects to VAR."
+  (declare (indent 1) (debug (symbolp body)))
+  (cl-check-type var symbol)
+  `(let ((,var nil))
+     (unwind-protect
+         ,(macroexp-progn body)
+       (mapc #'delete-process ,var))))
+
+(defmacro process-tests--with-raised-rlimit (&rest body)
+  "Evaluate BODY using a higher limit for the number of open files.
+Attempt to set the resource limit for the number of open files
+temporarily to the highest possible value."
+  (declare (indent 0) (debug t))
+  (let ((prlimit (make-symbol "prlimit"))
+        (soft (make-symbol "soft"))
+        (hard (make-symbol "hard"))
+        (pid-arg (make-symbol "pid-arg")))
+    `(let ((,prlimit (executable-find "prlimit"))
+           (,pid-arg (format "--pid=%d" (emacs-pid)))
+           (,soft nil) (,hard nil))
+       (cl-flet ((set-limit
+                  (value)
+                  (cl-check-type value natnum)
+                  (when ,prlimit
+                    (call-process ,prlimit nil nil nil
+                                  ,pid-arg
+                                  (format "--nofile=%d:" value)))))
+         (when ,prlimit
+           (with-temp-buffer
+             (when (eql (call-process ,prlimit nil t nil
+                                      ,pid-arg "--nofile"
+                                      "--raw" "--noheadings"
+                                      "--output=SOFT,HARD")
+                        0)
+               (goto-char (point-min))
+               (when (looking-at (rx (group (+ digit)) (+ blank)
+                                     (group (+ digit)) ?\n))
+                 (setq ,soft (string-to-number
+                              (match-string-no-properties 1))
+                       ,hard (string-to-number
+                              (match-string-no-properties 2))))))
+           (and ,soft ,hard (< ,soft ,hard)
+                (set-limit ,hard)))
+         (unwind-protect
+             ,(macroexp-progn body)
+           (when ,soft (set-limit ,soft)))))))
+
+(defmacro process-tests--fd-setsize-test (&rest body)
+  "Run BODY as a test for FD_SETSIZE overflow.
+Try to generate pipe processes until we are close to the
+FD_SETSIZE limit.  Within BODY, only a small number of file
+descriptors should still be available.  Furthermore, raise the
+maximum number of open files in the Emacs process above
+FD_SETSIZE."
+  (declare (indent 0) (debug t))
+  (let ((process (make-symbol "process"))
+        (processes (make-symbol "processes"))
+        (buffer (make-symbol "buffer"))
+        (buffers (make-symbol "buffers"))
+        ;; FD_SETSIZE is typically 1024 on Unix-like systems.  On
+        ;; MS-Windows we artificially limit FD_SETSIZE to 64, see the
+        ;; commentary in w32proc.c.
+        (fd-setsize (if (eq system-type 'windows-nt) 64 1024)))
+    `(process-tests--with-raised-rlimit
+       (process-tests--with-buffers ,buffers
+         (process-tests--with-processes ,processes
+           ;; First, allocate enough pipes to definitely exceed the
+           ;; FD_SETSIZE limit.
+           (cl-loop for i from 1 to ,(1+ fd-setsize)
+                    for ,buffer = (generate-new-buffer
+                                   (format " *pipe %d*" i))
+                    do (push ,buffer ,buffers)
+                    for ,process = (process-tests--ignore-EMFILE
+                                     (make-pipe-process
+                                      :name (format "pipe %d" i)
+                                      ;; Prevent delete-process from
+                                      ;; trying to read from pipe
+                                      ;; processes that didn't exit
+                                      ;; yet, because no one is
+                                      ;; writing to those pipes, and
+                                      ;; the read will stall.
+                                      :stop (eq system-type 'windows-nt)
+                                      :buffer ,buffer
+                                      :coding 'no-conversion
+                                      :noquery t))
+                    while ,process
+                    do (push ,process ,processes))
+           (unless (cddr ,processes)
+             (ert-fail "Couldn't allocate enough pipes"))
+           ;; Delete two pipes to test more edge cases.
+           (delete-process (pop ,processes))
+           (delete-process (pop ,processes))
+           ,@body)))))
+
+(defmacro process-tests--with-temp-directory (var &rest body)
+  "Bind VAR to the name of a new directory and evaluate BODY.
+Afterwards, delete the directory."
+  (declare (indent 1) (debug (symbolp body)))
+  (cl-check-type var symbol)
+  (let ((dir (make-symbol "dir")))
+    `(let ((,dir (make-temp-file "emacs-test-" :dir)))
+       (unwind-protect
+           (let ((,var ,dir))
+             ,@body)
+         (delete-directory ,dir :recursive)))))
+
+;; Tests for FD_SETSIZE overflow (Bug#24325).  The following tests
+;; generate lots of process objects of the various kinds.  Running the
+;; tests with assertions enabled should not result in any crashes due
+;; to file descriptor set overflow.  These tests first generate lots
+;; of unused pipe processes to fill up the file descriptor space.
+;; Then, they create a few instances of the process type under test.
+
+(ert-deftest process-tests/fd-setsize-no-crash/make-process ()
+  "Check that Emacs doesn't crash when trying to use more than
+FD_SETSIZE file descriptors (Bug#24325)."
+  (with-timeout (60 (ert-fail "Test timed out"))
+    (let ((cat (executable-find "cat")))
+      (skip-unless cat)
+      (dolist (conn-type '(pipe pty))
+        (ert-info ((format "Connection type `%s'" conn-type))
+          (process-tests--fd-setsize-test
+            (process-tests--with-processes processes
+              ;; Start processes until we exhaust the file descriptor
+              ;; set size.  We assume that each process requires at
+              ;; least one file descriptor.
+              (dotimes (i 10)
+                (let ((process
+                       ;; Failure to allocate more file descriptors
+                       ;; should signal `file-error', but not crash.
+                       ;; Since we don't know the exact limit, we
+                       ;; ignore `file-error'.
+                       (process-tests--ignore-EMFILE
+                         (make-process :name (format "test %d" i)
+                                       :command (list cat)
+                                       :connection-type conn-type
+                                       :coding 'no-conversion
+                                       :noquery t))))
+                  (when process (push process processes))))
+              ;; We should have managed to start at least one process.
+              (should processes)
+              (dolist (process processes)
+                (should (process-live-p process))
+                (process-send-eof process)
+                (while (accept-process-output process))
+                (should (eq (process-status process) 'exit))
+                ;; If there's an error between fork and exec, Emacs
+                ;; will use exit statuses between 125 and 127, see
+                ;; process.h.  This can happen if the child process
+                ;; tries to set up terminal device but fails due to
+                ;; file number limits.  We don't treat this as an
+                ;; error.
+                (should (memql (process-exit-status process)
+                               '(0 125 126 127)))))))))))
+
+(ert-deftest process-tests/fd-setsize-no-crash/make-pipe-process ()
+  "Check that Emacs doesn't crash when trying to use more than
+FD_SETSIZE file descriptors (Bug#24325)."
+  (with-timeout (60 (ert-fail "Test timed out"))
+    (process-tests--fd-setsize-test
+      (process-tests--with-buffers buffers
+        (process-tests--with-processes processes
+          ;; Start processes until we exhaust the file descriptor set
+          ;; size.  We assume that each process requires at least one
+          ;; file descriptor.
+          (dotimes (i 10)
+            (let ((buffer (generate-new-buffer (format " *%d*" i))))
+              (push buffer buffers)
+              (let ((process
+                     ;; Failure to allocate more file descriptors
+                     ;; should signal `file-error', but not crash.
+                     ;; Since we don't know the exact limit, we ignore
+                     ;; `file-error'.
+                     (process-tests--ignore-EMFILE
+                       (make-pipe-process :name (format "test %d" i)
+                                          :buffer buffer
+                                          :coding 'no-conversion
+                                          :noquery t))))
+                (when process (push process processes)))))
+          ;; We should have managed to start at least one process.
+          (should processes))))))
+
+(ert-deftest process-tests/fd-setsize-no-crash/make-network-process ()
+  "Check that Emacs doesn't crash when trying to use more than
+FD_SETSIZE file descriptors (Bug#24325)."
+  (skip-unless (featurep 'make-network-process '(:server t)))
+  (skip-unless (featurep 'make-network-process '(:family local)))
+  (with-timeout (60 (ert-fail "Test timed out"))
+    (process-tests--with-temp-directory directory
+      (process-tests--with-processes processes
+        (let* ((num-clients 10)
+               (socket-name (expand-file-name "socket" directory))
+               ;; Run a UNIX server to connect to.
+               (server (make-network-process :name "server"
+                                             :server num-clients
+                                             :buffer nil
+                                             :service socket-name
+                                             :family 'local
+                                             :coding 'no-conversion
+                                             :noquery t)))
+          (push server processes)
+          (process-tests--fd-setsize-test
+            ;; Start processes until we exhaust the file descriptor
+            ;; set size.  We assume that each process requires at
+            ;; least one file descriptor.
+            (dotimes (i num-clients)
+              (let ((client
+                     ;; Failure to allocate more file descriptors
+                     ;; should signal `file-error', but not crash.
+                     ;; Since we don't know the exact limit, we ignore
+                     ;; `file-error'.
+                     (process-tests--ignore-EMFILE
+                       (make-network-process
+                        :name (format "client %d" i)
+                        :service socket-name
+                        :family 'local
+                        :coding 'no-conversion
+                        :noquery t))))
+                (when client (push client processes))))
+            ;; We should have managed to start at least one process.
+            (should processes)))))))
+
+(ert-deftest process-tests/fd-setsize-no-crash/make-serial-process ()
+  "Check that Emacs doesn't crash when trying to use more than
+FD_SETSIZE file descriptors (Bug#24325)."
+  (with-timeout (60 (ert-fail "Test timed out"))
+    (process-tests--with-processes processes
+      ;; In order to use `make-serial-process', we need to create some
+      ;; pseudoterminals.  The easiest way to do that is to start a
+      ;; normal process using the `pty' connection type.  We need to
+      ;; ensure that the terminal stays around while we connect to it.
+      ;; Create the host processes before the dummy pipes so we have a
+      ;; high chance of succeeding here.
+      (let ((sleep (executable-find "sleep"))
+            (tty-names ()))
+        (skip-unless sleep)
+        (dotimes (i 10)
+          (let* ((host (make-process :name (format "tty host %d" i)
+                                     :command (list sleep "60")
+                                     :buffer nil
+                                     :coding 'utf-8-unix
+                                     :connection-type 'pty
+                                     :noquery t))
+                 (tty-name (process-tty-name host)))
+            (should (processp host))
+            (push host processes)
+            (should tty-name)
+            (should (file-exists-p tty-name))
+            (should-not (member tty-name tty-names))
+            (push tty-name tty-names)))
+        (process-tests--fd-setsize-test
+          (process-tests--with-processes processes
+            (process-tests--with-buffers buffers
+              (dolist (tty-name tty-names)
+                (let ((buffer (generate-new-buffer
+                               (format " *%s*" tty-name))))
+                  (push buffer buffers)
+                  ;; Failure to allocate more file descriptors should
+                  ;; signal `file-error', but not crash.  Since we
+                  ;; don't know the exact limit, we ignore
+                  ;; `file-error'.
+                  (let ((process (process-tests--ignore-EMFILE
+                                   (make-serial-process
+                                    :name (format "test %s" tty-name)
+                                    :port tty-name
+                                    :speed 9600
+                                    :buffer buffer
+                                    :coding 'no-conversion
+                                    :noquery t))))
+                    (when process (push process processes))))))
+            ;; We should have managed to start at least one process.
+            (should processes)))))))
+
+(defvar process-tests--EMFILE-message :unknown
+  "Cached result of the function `process-tests--EMFILE-message'.")
+
+(defun process-tests--EMFILE-message ()
+  "Return the error message for the EMFILE POSIX error.
+Return nil if that can't be determined."
+  (when (eq process-tests--EMFILE-message :unknown)
+    (setq process-tests--EMFILE-message
+          (with-temp-buffer
+            (when (eql (ignore-error 'file-error
+                         (call-process "errno" nil t nil "EMFILE"))
+                       0)
+              (goto-char (point-min))
+              (when (looking-at (rx "EMFILE" (+ blank) (+ digit)
+                                    (+ blank) (group (+ nonl))))
+                (match-string-no-properties 1))))))
+  process-tests--EMFILE-message)
 
 (provide 'process-tests)
-;; process-tests.el ends here.
+;;; process-tests.el ends here
diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el
index f9372e3..0607eac 100644
--- a/test/src/regex-emacs-tests.el
+++ b/test/src/regex-emacs-tests.el
@@ -1,6 +1,6 @@
 ;;; regex-emacs-tests.el --- tests for regex-emacs.c -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -803,4 +803,68 @@ This evaluates the TESTS test cases from glibc."
   (should-not (string-match "å" "\xe5"))
   (should-not (string-match "[å]" "\xe5")))
 
+(ert-deftest regexp-case-fold ()
+  "Test case-sensitive and case-insensitive matching."
+  (let ((case-fold-search nil))
+    (should (equal (string-match "aB" "ABaB") 2))
+    (should (equal (string-match "åÄ" "ÅäåäÅÄåÄ") 6))
+    (should (equal (string-match "λΛ" "lΛλλΛ") 3))
+    (should (equal (string-match "шШ" "zШшшШ") 3))
+    (should (equal (string-match "[[:alpha:]]+" ".3aBåÄßλΛшШ中﷽") 2))
+    (should (equal (match-end 0) 12))
+    (should (equal (string-match "[[:alnum:]]+" ".3aBåÄßλΛшШ中﷽") 1))
+    (should (equal (match-end 0) 12))
+    (should (equal (string-match "[[:upper:]]+" ".3aåλшBÄΛШ中﷽") 6))
+    (should (equal (match-end 0) 10))
+    (should (equal (string-match "[[:lower:]]+" ".3BÄΛШaåλш中﷽") 6))
+    (should (equal (match-end 0) 10)))
+  (let ((case-fold-search t))
+    (should (equal (string-match "aB" "ABaB") 0))
+    (should (equal (string-match "åÄ" "ÅäåäÅÄåÄ") 0))
+    (should (equal (string-match "λΛ" "lΛλλΛ") 1))
+    (should (equal (string-match "шШ" "zШшшШ") 1))
+    (should (equal (string-match "[[:alpha:]]+" ".3aBåÄßλΛшШ中﷽") 2))
+    (should (equal (match-end 0) 12))
+    (should (equal (string-match "[[:alnum:]]+" ".3aBåÄßλΛшШ中﷽") 1))
+    (should (equal (match-end 0) 12))
+    (should (equal (string-match "[[:upper:]]+" ".3aåλшBÄΛШ中﷽") 2))
+    (should (equal (match-end 0) 10))
+    (should (equal (string-match "[[:lower:]]+" ".3BÄΛШaåλш中﷽") 2))
+    (should (equal (match-end 0) 10))))
+
+(ert-deftest regexp-eszett ()
+  "Test matching of ß and ẞ."
+  ;; Sanity checks.
+  (should (equal (upcase "ß") "SS"))
+  (should (equal (downcase "ß") "ß"))
+  (should (equal (capitalize "ß") "Ss"))  ; undeutsch...
+  (should (equal (upcase "ẞ") "ẞ"))
+  (should (equal (downcase "ẞ") "ß"))
+  (should (equal (capitalize "ẞ") "ẞ"))
+  ;; ß is a lower-case letter (Ll); ẞ is an upper-case letter (Lu).
+  (let ((case-fold-search nil))
+    (should (equal (string-match "ß" "ß") 0))
+    (should (equal (string-match "ß" "ẞ") nil))
+    (should (equal (string-match "ẞ" "ß") nil))
+    (should (equal (string-match "ẞ" "ẞ") 0))
+    (should (equal (string-match "[[:alpha:]]" "ß") 0))
+    ;; bug#11309
+    (should (equal (string-match "[[:lower:]]" "ß") 0))
+    (should (equal (string-match "[[:upper:]]" "ß") nil))
+    (should (equal (string-match "[[:alpha:]]" "ẞ") 0))
+    (should (equal (string-match "[[:lower:]]" "ẞ") nil))
+    (should (equal (string-match "[[:upper:]]" "ẞ") 0)))
+  (let ((case-fold-search t))
+    (should (equal (string-match "ß" "ß") 0))
+    (should (equal (string-match "ß" "ẞ") 0))
+    (should (equal (string-match "ẞ" "ß") 0))
+    (should (equal (string-match "ẞ" "ẞ") 0))
+    (should (equal (string-match "[[:alpha:]]" "ß") 0))
+    ;; bug#11309
+    (should (equal (string-match "[[:lower:]]" "ß") 0))
+    (should (equal (string-match "[[:upper:]]" "ß") 0))
+    (should (equal (string-match "[[:alpha:]]" "ẞ") 0))
+    (should (equal (string-match "[[:lower:]]" "ẞ") 0))
+    (should (equal (string-match "[[:upper:]]" "ẞ") 0))))
+
 ;;; regex-emacs-tests.el ends here
diff --git a/test/src/syntax-tests.el b/test/src/syntax-tests.el
index edee01e..479b818 100644
--- a/test/src/syntax-tests.el
+++ b/test/src/syntax-tests.el
@@ -1,6 +1,6 @@
 ;;; syntax-tests.el --- tests for syntax.c functions -*- lexical-binding: t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/textprop-tests.el b/test/src/textprop-tests.el
index 365d2c7..b083588 100644
--- a/test/src/textprop-tests.el
+++ b/test/src/textprop-tests.el
@@ -1,6 +1,6 @@
 ;;; textprop-tests.el --- Test suite for text properties. -*- lexical-binding: 
t -*-
 
-;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
 
 ;; Author: Wolfgang Jenkner <wjenkner@inode.at>
 ;; Keywords: internal
diff --git a/test/src/thread-tests.el b/test/src/thread-tests.el
index df34a2b..f14d242 100644
--- a/test/src/thread-tests.el
+++ b/test/src/thread-tests.el
@@ -1,6 +1,6 @@
 ;;; threads.el --- tests for threads. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el
index b35a528..e55bd1e 100644
--- a/test/src/timefns-tests.el
+++ b/test/src/timefns-tests.el
@@ -1,6 +1,6 @@
 ;;; timefns-tests.el -- tests for timefns.c -*- lexical-binding: t -*-
 
-;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/undo-tests.el b/test/src/undo-tests.el
index 182e2df..055bf10 100644
--- a/test/src/undo-tests.el
+++ b/test/src/undo-tests.el
@@ -1,6 +1,6 @@
 ;;; undo-tests.el --- Tests of primitive-undo -*- lexical-binding: t -*-
 
-;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
 ;; Author: Aaron S. Hawley <aaron.s.hawley@gmail.com>
 
diff --git a/test/src/xdisp-tests.el b/test/src/xdisp-tests.el
index a7e05a5..d13ce77 100644
--- a/test/src/xdisp-tests.el
+++ b/test/src/xdisp-tests.el
@@ -1,6 +1,6 @@
 ;;; xdisp-tests.el --- tests for xdisp.c functions -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/xfaces-tests.el b/test/src/xfaces-tests.el
index bde3a35..0a7ef55 100644
--- a/test/src/xfaces-tests.el
+++ b/test/src/xfaces-tests.el
@@ -1,6 +1,6 @@
 ;;; xfaces-tests.el --- tests for xfaces.c           -*- lexical-binding: t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
diff --git a/test/src/xml-tests.el b/test/src/xml-tests.el
index 800f400..632cf96 100644
--- a/test/src/xml-tests.el
+++ b/test/src/xml-tests.el
@@ -1,6 +1,6 @@
 ;;; xml-tests.el --- Test suite for libxml parsing. -*- lexical-binding: t -*-
 
-;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
 ;; Author: Ulf Jasper <ulf.jasper@web.de>
 ;; Keywords:       internal



reply via email to

[Prev in Thread] Current Thread [Next in Thread]