aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2020-12-12 15:31:33 +0100
committerAndrea Corallo2020-12-12 15:31:33 +0100
commit0474fda62d79cb7eb250f34f19773c87f283c665 (patch)
treedf7418a6b22fbbfda725c56825ec0290f8e6be39
parentbe907b0ba82c2a65e0468d50653cae8a7cf5f16b (diff)
parent4afef614cd6c93b4d4a57aa5bb211563649abc56 (diff)
downloademacs-0474fda62d79cb7eb250f34f19773c87f283c665.tar.gz
emacs-0474fda62d79cb7eb250f34f19773c87f283c665.zip
Merge remote-tracking branch 'savannah/master' into HEAD
-rw-r--r--.gitlab-ci.yml2
-rwxr-xr-xadmin/nt/dist-build/build-dep-zips.py1
-rw-r--r--doc/emacs/maintaining.texi10
-rw-r--r--doc/emacs/misc.texi25
-rw-r--r--doc/lispref/backups.texi6
-rw-r--r--doc/lispref/display.texi44
-rw-r--r--doc/lispref/internals.texi13
-rw-r--r--doc/lispref/os.texi16
-rw-r--r--doc/lispref/streams.texi18
-rw-r--r--doc/lispref/text.texi16
-rw-r--r--doc/lispref/variables.texi10
-rw-r--r--doc/misc/calc.texi8
-rw-r--r--doc/misc/cl.texi13
-rw-r--r--doc/misc/gnus.texi31
-rw-r--r--etc/NEWS97
-rw-r--r--etc/grep.txt6
-rw-r--r--etc/publicsuffix.txt108
-rw-r--r--lib-src/etags.c1
-rw-r--r--lisp/apropos.el4
-rw-r--r--lisp/array.el34
-rw-r--r--lisp/battery.el10
-rw-r--r--lisp/buff-menu.el4
-rw-r--r--lisp/button.el14
-rw-r--r--lisp/calc/calc-bin.el52
-rw-r--r--lisp/calc/calc-comb.el10
-rw-r--r--lisp/calc/calc-ext.el30
-rw-r--r--lisp/calc/calc-funcs.el4
-rw-r--r--lisp/calc/calc-graph.el2
-rw-r--r--lisp/calc/calc-macs.el8
-rw-r--r--lisp/calc/calc-math.el16
-rw-r--r--lisp/calc/calc.el2
-rw-r--r--lisp/calendar/calendar.el2
-rw-r--r--lisp/calendar/diary-lib.el23
-rw-r--r--lisp/chistory.el2
-rw-r--r--lisp/comint.el32
-rw-r--r--lisp/dabbrev.el10
-rw-r--r--lisp/desktop.el8
-rw-r--r--lisp/dframe.el8
-rw-r--r--lisp/dired-aux.el10
-rw-r--r--lisp/dired-x.el4
-rw-r--r--lisp/dired.el12
-rw-r--r--lisp/doc-view.el2
-rw-r--r--lisp/ebuff-menu.el7
-rw-r--r--lisp/edmacro.el6
-rw-r--r--lisp/emacs-lisp/cl-generic.el14
-rw-r--r--lisp/emacs-lisp/eldoc.el1
-rw-r--r--lisp/emacs-lisp/elint.el10
-rw-r--r--lisp/emacs-lisp/ert.el2
-rw-r--r--lisp/emacs-lisp/lisp-mode.el8
-rw-r--r--lisp/emacs-lisp/memory-report.el301
-rw-r--r--lisp/emacs-lisp/pcase.el3
-rw-r--r--lisp/emacs-lisp/thunk.el2
-rw-r--r--lisp/epa-file.el3
-rw-r--r--lisp/epg.el7
-rw-r--r--lisp/face-remap.el4
-rw-r--r--lisp/files.el17
-rw-r--r--lisp/filesets.el3
-rw-r--r--lisp/find-dired.el15
-rw-r--r--lisp/find-lisp.el30
-rw-r--r--lisp/finder.el2
-rw-r--r--lisp/font-core.el8
-rw-r--r--lisp/font-lock.el27
-rw-r--r--lisp/format.el5
-rw-r--r--lisp/gnus/gnus-agent.el8
-rw-r--r--lisp/gnus/gnus-art.el35
-rw-r--r--lisp/gnus/gnus-cus.el34
-rw-r--r--lisp/gnus/gnus-group.el5
-rw-r--r--lisp/gnus/gnus-msg.el21
-rw-r--r--lisp/gnus/gnus-salt.el10
-rw-r--r--lisp/gnus/gnus-score.el6
-rw-r--r--lisp/gnus/gnus-search.el41
-rw-r--r--lisp/gnus/gnus-srvr.el3
-rw-r--r--lisp/gnus/gnus-start.el13
-rw-r--r--lisp/gnus/gnus-sum.el67
-rw-r--r--lisp/gnus/gnus-topic.el23
-rw-r--r--lisp/gnus/gnus-undo.el4
-rw-r--r--lisp/gnus/gnus-win.el4
-rw-r--r--lisp/gnus/gnus.el54
-rw-r--r--lisp/gnus/message.el91
-rw-r--r--lisp/gnus/mm-view.el2
-rw-r--r--lisp/gnus/mml.el4
-rw-r--r--lisp/gnus/nndiary.el8
-rw-r--r--lisp/gnus/nnfolder.el6
-rw-r--r--lisp/gnus/nnheader.el2
-rw-r--r--lisp/gnus/nnimap.el8
-rw-r--r--lisp/gnus/nnml.el4
-rw-r--r--lisp/help-fns.el3
-rw-r--r--lisp/help-mode.el8
-rw-r--r--lisp/hexl.el10
-rw-r--r--lisp/ibuffer.el47
-rw-r--r--lisp/icomplete.el11
-rw-r--r--lisp/ido.el5
-rw-r--r--lisp/ielm.el28
-rw-r--r--lisp/image.el45
-rw-r--r--lisp/image/exif.el2
-rw-r--r--lisp/info.el6
-rw-r--r--lisp/international/characters.el9
-rw-r--r--lisp/international/isearch-x.el15
-rw-r--r--lisp/international/robin.el3
-rw-r--r--lisp/isearch.el13
-rw-r--r--lisp/language/korea-util.el15
-rw-r--r--lisp/language/korean.el1
-rw-r--r--lisp/leim/quail/hangul.el2
-rw-r--r--lisp/leim/quail/uni-input.el3
-rw-r--r--lisp/locate.el10
-rw-r--r--lisp/man.el8
-rw-r--r--lisp/master.el3
-rw-r--r--lisp/minibuffer.el6
-rw-r--r--lisp/net/rcirc.el36
-rw-r--r--lisp/net/socks.el6
-rw-r--r--lisp/net/tramp-adb.el6
-rw-r--r--lisp/net/tramp-gvfs.el11
-rw-r--r--lisp/net/tramp-sh.el34
-rw-r--r--lisp/net/tramp-smb.el6
-rw-r--r--lisp/net/tramp.el4
-rw-r--r--lisp/newcomment.el68
-rw-r--r--lisp/outline.el2
-rw-r--r--lisp/pcomplete.el4
-rw-r--r--lisp/play/dunnet.el200
-rw-r--r--lisp/proced.el6
-rw-r--r--lisp/progmodes/cfengine.el46
-rw-r--r--lisp/progmodes/compile.el70
-rw-r--r--lisp/progmodes/cperl-mode.el206
-rw-r--r--lisp/progmodes/dcl-mode.el12
-rw-r--r--lisp/progmodes/elisp-mode.el7
-rw-r--r--lisp/progmodes/etags.el77
-rw-r--r--lisp/progmodes/fortran.el43
-rw-r--r--lisp/progmodes/gdb-mi.el39
-rw-r--r--lisp/progmodes/grep.el35
-rw-r--r--lisp/progmodes/gud.el8
-rw-r--r--lisp/progmodes/hideif.el16
-rw-r--r--lisp/progmodes/inf-lisp.el9
-rw-r--r--lisp/progmodes/meta-mode.el50
-rw-r--r--lisp/progmodes/project.el12
-rw-r--r--lisp/progmodes/ps-mode.el26
-rw-r--r--lisp/progmodes/python.el152
-rw-r--r--lisp/progmodes/sql.el63
-rw-r--r--lisp/progmodes/tcl.el64
-rw-r--r--lisp/progmodes/xref.el31
-rw-r--r--lisp/progmodes/xscheme.el18
-rw-r--r--lisp/recentf.el6
-rw-r--r--lisp/replace.el2
-rw-r--r--lisp/reveal.el2
-rw-r--r--lisp/ruler-mode.el4
-rw-r--r--lisp/scroll-lock.el2
-rw-r--r--lisp/server.el26
-rw-r--r--lisp/shell.el46
-rw-r--r--lisp/simple.el54
-rw-r--r--lisp/skeleton.el13
-rw-r--r--lisp/speedbar.el21
-rw-r--r--lisp/startup.el4
-rw-r--r--lisp/strokes.el18
-rw-r--r--lisp/subr.el65
-rw-r--r--lisp/svg.el13
-rw-r--r--lisp/tab-bar.el2
-rw-r--r--lisp/tar-mode.el32
-rw-r--r--lisp/term.el39
-rw-r--r--lisp/textmodes/bibtex-style.el12
-rw-r--r--lisp/textmodes/bibtex.el30
-rw-r--r--lisp/textmodes/table.el2
-rw-r--r--lisp/textmodes/tex-mode.el9
-rw-r--r--lisp/thumbs.el5
-rw-r--r--lisp/timezone.el2
-rw-r--r--lisp/tool-bar.el3
-rw-r--r--lisp/tree-widget.el7
-rw-r--r--lisp/tutorial.el14
-rw-r--r--lisp/vc/ediff-ptch.el3
-rw-r--r--lisp/vc/vc-git.el2
-rw-r--r--lisp/vc/vc-hg.el11
-rw-r--r--lisp/vc/vc.el16
-rw-r--r--lisp/wdired.el16
-rw-r--r--lisp/whitespace.el29
-rw-r--r--lisp/window.el6
-rw-r--r--lisp/xwidget.el2
-rw-r--r--lwlib/lwlib-utils.c15
-rw-r--r--src/charset.c4
-rw-r--r--src/chartab.c6
-rw-r--r--src/data.c5
-rw-r--r--src/emacs.c13
-rw-r--r--src/eval.c11
-rw-r--r--src/fileio.c7
-rw-r--r--src/fns.c78
-rw-r--r--src/frame.c12
-rw-r--r--src/image.c124
-rw-r--r--src/lisp.h33
-rw-r--r--src/nsterm.m10
-rw-r--r--src/regex-emacs.c17
-rw-r--r--src/w32gui.h1
-rw-r--r--src/w32term.c11
-rw-r--r--src/window.c56
-rw-r--r--src/xdisp.c40
-rw-r--r--test/README3
-rw-r--r--test/lisp/abbrev-tests.el5
-rw-r--r--test/lisp/allout-tests.el6
-rw-r--r--test/lisp/emacs-lisp/edebug-tests.el5
-rw-r--r--test/lisp/emacs-lisp/ert-tests.el10
-rw-r--r--test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el4
-rw-r--r--test/lisp/emacs-lisp/gv-tests.el11
-rw-r--r--test/lisp/emacs-lisp/memory-report-tests.el57
-rw-r--r--test/lisp/epg-tests.el3
-rw-r--r--test/lisp/filenotify-tests.el80
-rw-r--r--test/lisp/net/rcirc-tests.el12
-rw-r--r--test/src/casefiddle-tests.el3
-rw-r--r--test/src/data-tests.el2
-rw-r--r--test/src/eval-tests.el17
-rw-r--r--test/src/fns-tests.el16
-rw-r--r--test/src/regex-emacs-tests.el64
207 files changed, 2783 insertions, 1752 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e5ebd6a92a1..bc099a720a8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -91,7 +91,7 @@ test-filenotify-gio:
91 - ./autogen.sh autoconf 91 - ./autogen.sh autoconf
92 - ./configure --without-makeinfo --with-file-notification=gfile 92 - ./configure --without-makeinfo --with-file-notification=gfile
93 - make bootstrap 93 - make bootstrap
94 - make -C test autorevert-tests filenotify-tests 94 - make -k -C test autorevert-tests filenotify-tests
95 95
96test-native-bootstrap-speed0: 96test-native-bootstrap-speed0:
97 # Test a full native bootstrap 97 # Test a full native bootstrap
diff --git a/admin/nt/dist-build/build-dep-zips.py b/admin/nt/dist-build/build-dep-zips.py
index 7047d28346d..bc5f65f0853 100755
--- a/admin/nt/dist-build/build-dep-zips.py
+++ b/admin/nt/dist-build/build-dep-zips.py
@@ -18,7 +18,6 @@
18## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. 18## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19import argparse 19import argparse
20import multiprocessing as mp 20import multiprocessing as mp
21import glob
22import os 21import os
23import shutil 22import shutil
24import re 23import re
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 1f10b68b8a7..aa4513e3175 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -2199,12 +2199,22 @@ Display the reference on the current line.
2199Move to the next reference and display it in the other window 2199Move to the next reference and display it in the other window
2200(@code{xref-next-line}). 2200(@code{xref-next-line}).
2201 2201
2202@item N
2203@findex xref-next-group
2204Move to the first reference of the next reference group and display it
2205in the other window (@code{xref-next-group}).
2206
2202@item p 2207@item p
2203@itemx , 2208@itemx ,
2204@findex xref-prev-line 2209@findex xref-prev-line
2205Move to the previous reference and display it in the other window 2210Move to the previous reference and display it in the other window
2206(@code{xref-prev-line}). 2211(@code{xref-prev-line}).
2207 2212
2213@item P
2214@findex xref-prev-group
2215Move to the first reference of the previous reference group and
2216display it in the other window (@code{xref-prev-group}).
2217
2208@item C-o 2218@item C-o
2209@findex xref-show-location-at-point 2219@findex xref-show-location-at-point
2210Display the reference on the current line in the other window 2220Display the reference on the current line in the other window
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 5b5134b7c3f..c2c382ead0b 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -1893,6 +1893,12 @@ with @kbd{C-x #}. But @kbd{C-x #} is the way to tell
1893window or a frame, @kbd{C-x #} always displays the next server buffer 1893window or a frame, @kbd{C-x #} always displays the next server buffer
1894in that window or in that frame. 1894in that window or in that frame.
1895 1895
1896@vindex server-client-instructions
1897 When @command{emacsclient} connects, the server will normally output
1898a message that says how to exit the client frame. If
1899@code{server-client-instructions} is set to @code{nil}, this message
1900is inhibited.
1901
1896@node emacsclient Options 1902@node emacsclient Options
1897@subsection @code{emacsclient} Options 1903@subsection @code{emacsclient} Options
1898@cindex @code{emacsclient} options 1904@cindex @code{emacsclient} options
@@ -2255,13 +2261,18 @@ off.
2255@vindex ps-print-color-p 2261@vindex ps-print-color-p
2256 If your printer doesn't support colors, you should turn off color 2262 If your printer doesn't support colors, you should turn off color
2257processing by setting @code{ps-print-color-p} to @code{nil}. By 2263processing by setting @code{ps-print-color-p} to @code{nil}. By
2258default, if the display supports colors, Emacs produces hardcopy output 2264default, if the display supports colors, Emacs produces hardcopy
2259with color information; on black-and-white printers, colors are emulated 2265output with color information; on black-and-white printers, colors are
2260with shades of gray. This might produce illegible output, even if your 2266emulated with shades of gray. This might produce barely-readable or
2261screen colors only use shades of gray. 2267even illegible output, even if your screen colors only use shades of
2262 2268gray.
2263 Alternatively, you can set @code{ps-print-color-p} to @code{black-white} to 2269
2264print colors on black/white printers. 2270@vindex ps-black-white-faces
2271 Alternatively, you can set @code{ps-print-color-p} to @code{black-white}
2272to have colors display better on black/white printers. This works by
2273using information in @code{ps-black-white-faces} to express colors by
2274customizable list of shades of gray, augmented by bold and italic
2275face attributes.
2265 2276
2266@vindex ps-use-face-background 2277@vindex ps-use-face-background
2267 By default, PostScript printing ignores the background colors of the 2278 By default, PostScript printing ignores the background colors of the
diff --git a/doc/lispref/backups.texi b/doc/lispref/backups.texi
index 379279575ca..c20ef6830ad 100644
--- a/doc/lispref/backups.texi
+++ b/doc/lispref/backups.texi
@@ -706,7 +706,11 @@ contents and the file contents are identical before the revert
706operation, reverting preserves all the markers. If they are not 706operation, reverting preserves all the markers. If they are not
707identical, reverting does change the buffer; in that case, it preserves 707identical, reverting does change the buffer; in that case, it preserves
708the markers in the unchanged text (if any) at the beginning and end of 708the markers in the unchanged text (if any) at the beginning and end of
709the buffer. Preserving any additional markers would be problematical. 709the buffer. Preserving any additional markers would be problematic.
710
711When reverting from non-file sources, markers are usually not
712preserved, but this is up to the specific @code{revert-buffer-function}
713implementation.
710@end deffn 714@end deffn
711 715
712@defvar revert-buffer-in-progress-p 716@defvar revert-buffer-in-progress-p
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index f86baf59360..2b3119ea590 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2632,10 +2632,12 @@ appearance of @var{face} will again be determined by its default face
2632spec. 2632spec.
2633 2633
2634@cindex @code{eval-defun}, and @code{defface} forms 2634@cindex @code{eval-defun}, and @code{defface} forms
2635@cindex @code{eval-last-sexp}, and @code{defface} forms
2635As an exception, if you evaluate a @code{defface} form with 2636As an exception, if you evaluate a @code{defface} form with
2636@kbd{C-M-x} in Emacs Lisp mode (@code{eval-defun}), a special feature 2637@kbd{C-M-x} (@code{eval-defun}) or with @kbd{C-x C-e}
2637of @code{eval-defun} overrides any custom face specs on the face, 2638(@code{eval-last-sexp}) in Emacs Lisp mode, a special feature of these
2638causing the face to reflect exactly what the @code{defface} says. 2639commands overrides any custom face specs on the face, causing the face
2640to reflect exactly what the @code{defface} says.
2639 2641
2640The @var{spec} argument is a @dfn{face spec}, which states how the 2642The @var{spec} argument is a @dfn{face spec}, which states how the
2641face should appear on different kinds of terminals. It should be an 2643face should appear on different kinds of terminals. It should be an
@@ -5898,6 +5900,26 @@ string containing the image data as raw bytes. @var{image-type} should be a
5898@end lisp 5900@end lisp
5899@end defun 5901@end defun
5900 5902
5903@defun svg-embed-base-uri-image svg relative-filename &rest args
5904To @var{svg} add an embedded (raster) image placed at
5905@var{relative-filename}. @var{relative-filename} is searched inside
5906@code{file-name-directory} of the @code{:base-uri} svg image property.
5907This improves the performance of embedding large images.
5908
5909@lisp
5910;; Embeding /tmp/subdir/rms.jpg and /tmp/another/rms.jpg
5911(svg-embed-base-uri-image svg "subdir/rms.jpg"
5912 :width "100px" :height "100px"
5913 :x "50px" :y "75px")
5914(svg-embed-base-uri-image svg "another/rms.jpg"
5915 :width "100px" :height "100px"
5916 :x "75px" :y "50px")
5917(svg-image svg :scale 1.0
5918 :base-uri "/tmp/dummy"
5919 :width 175 :height 175)
5920@end lisp
5921@end defun
5922
5901@defun svg-clip-path svg &rest args 5923@defun svg-clip-path svg &rest args
5902Add a clipping path to @var{svg}. If applied to a shape via the 5924Add a clipping path to @var{svg}. If applied to a shape via the
5903@var{:clip-path} property, parts of that shape which lie outside of 5925@var{:clip-path} property, parts of that shape which lie outside of
@@ -6575,6 +6597,12 @@ except when you explicitly clear it. This mode can be useful for
6575debugging. 6597debugging.
6576@end defvar 6598@end defvar
6577 6599
6600@defun image-cache-size
6601This function returns the total size of the current image cache, in
6602bytes. An image of size 200x100 with 24 bits per color will have a
6603cache size of 60000 bytes, for instance.
6604@end defun
6605
6578@node Xwidgets 6606@node Xwidgets
6579@section Embedded Native Widgets 6607@section Embedded Native Widgets
6580@cindex xwidget 6608@cindex xwidget
@@ -6879,6 +6907,16 @@ This inserts a button with the label @var{label} at point, using text
6879properties. 6907properties.
6880@end defun 6908@end defun
6881 6909
6910@defun button-buttonize string callback &optional data
6911Sometimes it's more convenient to make a string into a button without
6912inserting it into a buffer immediately, for instance when creating
6913data structures that may then, later, be inserted into a buffer. This
6914function makes @var{string} into such a string, and @var{callback}
6915will be called when the user clicks on the button. The optional
6916@var{data} parameter will be used as the parameter when @var{callback}
6917is called. If @code{nil}, the button is used as the parameter instead.
6918@end defun
6919
6882@node Manipulating Buttons 6920@node Manipulating Buttons
6883@subsection Manipulating Buttons 6921@subsection Manipulating Buttons
6884@cindex manipulating buttons 6922@cindex manipulating buttons
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index bb25983aa4b..fb24544c917 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -615,6 +615,19 @@ during garbage collection so far in this Emacs session, as a
615floating-point number. 615floating-point number.
616@end defvar 616@end defvar
617 617
618@defun memory-report
619It can sometimes be useful to see where Emacs is using memory (in
620various variables, buffers, and caches). This command will open a new
621buffer (called @samp{"*Memory Report*"}) that will give an overview,
622in addition to listing the ``largest'' buffers and variables.
623
624All the data here is approximate, because there's really no consistent
625way to compute the size of a variable. For instance, two variables
626may share parts of a data structure, and this will be counted twice,
627but this command may still give a useful high-level overview of which
628parts of Emacs is using memory.
629@end defun
630
618@node Stack-allocated Objects 631@node Stack-allocated Objects
619@section Stack-allocated Objects 632@section Stack-allocated Objects
620 633
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index f897cfa4eab..bc602205f5d 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -2633,14 +2633,14 @@ calls @var{function} with no arguments, or @samp{--eval=@var{form}}.
2633 2633
2634 Any Lisp program output that would normally go to the echo area, 2634 Any Lisp program output that would normally go to the echo area,
2635either using @code{message}, or using @code{prin1}, etc., with 2635either using @code{message}, or using @code{prin1}, etc., with
2636@code{t} as the stream, goes instead to Emacs's standard descriptors 2636@code{t} as the stream (@pxref{Output Streams}), goes instead to
2637when in batch mode: @code{message} writes to the standard error 2637Emacs's standard descriptors when in batch mode: @code{message} writes
2638descriptor, while @code{prin1} and other print functions write to the 2638to the standard error descriptor, while @code{prin1} and other print
2639standard output. Similarly, input that would normally come from the 2639functions write to the standard output. Similarly, input that would
2640minibuffer is read from the standard input descriptor. Thus, Emacs 2640normally come from the minibuffer is read from the standard input
2641behaves much like a noninteractive application program. (The echo 2641descriptor. Thus, Emacs behaves much like a noninteractive
2642area output that Emacs itself normally generates, such as command 2642application program. (The echo area output that Emacs itself normally
2643echoing, is suppressed entirely.) 2643generates, such as command echoing, is suppressed entirely.)
2644 2644
2645Non-ASCII text written to the standard output or error descriptors is 2645Non-ASCII text written to the standard output or error descriptors is
2646by default encoded using @code{locale-coding-system} (@pxref{Locales}) 2646by default encoded using @code{locale-coding-system} (@pxref{Locales})
diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi
index 0534afb67fa..5b4be832507 100644
--- a/doc/lispref/streams.texi
+++ b/doc/lispref/streams.texi
@@ -123,13 +123,13 @@ came from. In this case, it makes no difference what value
123@code{t} used as a stream means that the input is read from the 123@code{t} used as a stream means that the input is read from the
124minibuffer. In fact, the minibuffer is invoked once and the text 124minibuffer. In fact, the minibuffer is invoked once and the text
125given by the user is made into a string that is then used as the 125given by the user is made into a string that is then used as the
126input stream. If Emacs is running in batch mode, standard input is used 126input stream. If Emacs is running in batch mode (@pxref{Batch Mode}),
127instead of the minibuffer. For example, 127standard input is used instead of the minibuffer. For example,
128@example 128@example
129(message "%s" (read t)) 129(message "%s" (read t))
130@end example 130@end example
131will read a Lisp expression from standard input and print the result 131will in batch mode read a Lisp expression from standard input and
132to standard output. 132print the result to standard output.
133 133
134@item @code{nil} 134@item @code{nil}
135@cindex @code{nil} input stream 135@cindex @code{nil} input stream
@@ -392,13 +392,15 @@ is responsible for storing the characters wherever you want to put them.
392 392
393@item @code{t} 393@item @code{t}
394@cindex @code{t} output stream 394@cindex @code{t} output stream
395The output characters are displayed in the echo area. 395The output characters are displayed in the echo area. If Emacs is
396running in batch mode (@pxref{Batch Mode}), the output is written to
397the standard output descriptor instead.
396 398
397@item @code{nil} 399@item @code{nil}
398@cindex @code{nil} output stream 400@cindex @code{nil} output stream
399@code{nil} specified as an output stream means to use the value of 401@code{nil} specified as an output stream means to use the value of the
400@code{standard-output} instead; that value is the @dfn{default output 402@code{standard-output} variable instead; that value is the
401stream}, and must not be @code{nil}. 403@dfn{default output stream}, and must not be @code{nil}.
402 404
403@item @var{symbol} 405@item @var{symbol}
404A symbol as output stream is equivalent to the symbol's function 406A symbol as output stream is equivalent to the symbol's function
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index c6ca4eed2e1..b712768a213 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -2931,6 +2931,22 @@ used instead. Here is an example:
2931@end example 2931@end example
2932@end defvar 2932@end defvar
2933 2933
2934@defun object-intervals OBJECT
2935This function returns a copy of the intervals (i.e., text properties)
2936in @var{object} as a list of intervals. @var{object} must be a string
2937or a buffer. Altering the structure of this list does not change the
2938intervals in the object.
2939
2940@example
2941(object-intervals (propertize "foo" 'face 'bold))
2942 @result{} ((0 3 (face bold)))
2943@end example
2944
2945Each element in the returned list represents one interval. Each
2946interval has three parts: The first is the start, the second is the
2947end, and the third part is the text property itself.
2948@end defun
2949
2934@node Changing Properties 2950@node Changing Properties
2935@subsection Changing Text Properties 2951@subsection Changing Text Properties
2936@cindex changing text properties 2952@cindex changing text properties
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 095ea9dce24..b9ff0747382 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -481,10 +481,12 @@ form occurs in a @code{let} form with lexical binding enabled), then
481effect until its binding construct exits. @xref{Variable Scoping}. 481effect until its binding construct exits. @xref{Variable Scoping}.
482 482
483@cindex @code{eval-defun}, and @code{defvar} forms 483@cindex @code{eval-defun}, and @code{defvar} forms
484When you evaluate a top-level @code{defvar} form with @kbd{C-M-x} in 484@cindex @code{eval-last-sexp}, and @code{defvar} forms
485Emacs Lisp mode (@code{eval-defun}), a special feature of 485When you evaluate a top-level @code{defvar} form with @kbd{C-M-x}
486@code{eval-defun} arranges to set the variable unconditionally, without 486(@code{eval-defun}) or with @kbd{C-x C-e} (@code{eval-last-sexp}) in
487testing whether its value is void. 487Emacs Lisp mode, a special feature of these two commands arranges to
488set the variable unconditionally, without testing whether its value is
489void.
488 490
489If the @var{doc-string} argument is supplied, it specifies the 491If the @var{doc-string} argument is supplied, it specifies the
490documentation string for the variable (stored in the symbol's 492documentation string for the variable (stored in the symbol's
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index 6a6f585ce20..1fa13e98b3c 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -28047,13 +28047,7 @@ defined as the distance that light will travel in a vacuum in
28047vacuum is exactly 299792458 m/s. Many other units have been 28047vacuum is exactly 299792458 m/s. Many other units have been
28048redefined in terms of fundamental physical processes; a second, for 28048redefined in terms of fundamental physical processes; a second, for
28049example, is currently defined as 9192631770 periods of a certain 28049example, is currently defined as 9192631770 periods of a certain
28050radiation related to the cesium-133 atom. The only SI unit that is not 28050radiation related to the cesium-133 atom.
28051based on a fundamental physical process (although there are efforts to
28052change this) is the kilogram, which was originally defined as the mass
28053of one liter of water, but is now defined as the mass of the
28054international prototype of the kilogram (IPK), a cylinder of platinum-iridium
28055kept at the Bureau international des poids et mesures in Sèvres,
28056France. (There are several copies of the IPK throughout the world.)
28057The British imperial units, once defined in terms of physical objects, 28051The British imperial units, once defined in terms of physical objects,
28058were redefined in 1963 in terms of SI units. The US customary units, 28052were redefined in 1963 in terms of SI units. The US customary units,
28059which were the same as British units until the British imperial system 28053which were the same as British units until the British imperial system
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 084edd11b2d..742be28fe34 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -1097,10 +1097,9 @@ by @var{x} if specified.
1097 1097
1098@defmac cl-pushnew x place @t{&key :test :test-not :key} 1098@defmac cl-pushnew x place @t{&key :test :test-not :key}
1099This macro inserts @var{x} at the front of the list stored in 1099This macro inserts @var{x} at the front of the list stored in
1100@var{place}, but only if @var{x} was not @code{eql} to any 1100@var{place}, but only if @var{x} isn't present in the list already.
1101existing element of the list. The optional keyword arguments 1101The optional keyword arguments are interpreted in the same way as for
1102are interpreted in the same way as for @code{cl-adjoin}. 1102@code{cl-adjoin}. @xref{Lists as Sets}.
1103@xref{Lists as Sets}.
1104@end defmac 1103@end defmac
1105 1104
1106@defmac cl-shiftf place@dots{} newvalue 1105@defmac cl-shiftf place@dots{} newvalue
@@ -3796,8 +3795,10 @@ This is a destructive version of @code{cl-sublis}.
3796@section Lists as Sets 3795@section Lists as Sets
3797 3796
3798@noindent 3797@noindent
3799These functions perform operations on lists that represent sets 3798These functions perform operations on lists that represent sets of
3800of elements. 3799elements. All these functions (unless otherwise specified) default to
3800using @code{eql} as the test function, but that can be modified by the
3801@code{:test} parameter.
3801 3802
3802@defun cl-member item list @t{&key :test :test-not :key} 3803@defun cl-member item list @t{&key :test :test-not :key}
3803This function searches @var{list} for an element matching @var{item}. 3804This function searches @var{list} for an element matching @var{item}.
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 4aa07ce3887..cfd3ceda3ff 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -5028,10 +5028,37 @@ Nothing if the article is a root and lots of spaces if it isn't (it
5028pushes everything after it off the screen). 5028pushes everything after it off the screen).
5029@item [ 5029@item [
5030Opening bracket, which is normally @samp{[}, but can also be @samp{<} 5030Opening bracket, which is normally @samp{[}, but can also be @samp{<}
5031for adopted articles (@pxref{Customizing Threading}). 5031for adopted articles (@pxref{Customizing Threading}). This can be
5032customized using following settings:
5033
5034@table @code
5035@item gnus-sum-opening-bracket
5036@vindex gnus-sum-opening-bracket
5037Opening bracket for normal (non-adopted) articles. The default is
5038@samp{[}.
5039
5040@item gnus-sum-opening-bracket-adopted
5041@vindex gnus-sum-opening-bracket-adopted
5042Opening bracket for adopted articles. The default is @samp{<}.
5043
5044@end table
5045
5032@item ] 5046@item ]
5033Closing bracket, which is normally @samp{]}, but can also be @samp{>} 5047Closing bracket, which is normally @samp{]}, but can also be @samp{>}
5034for adopted articles. 5048for adopted articles. This can be customised using following settings:
5049
5050@table @code
5051@item gnus-sum-closing-bracket
5052@vindex gnus-sum-closing-bracket
5053Closing bracket for normal (non-adopted) articles. The default is
5054@samp{]}.
5055
5056@item gnus-sum-closing-bracket-adopted
5057@vindex gnus-sum-opening-bracket-adopted
5058Closing bracket for adopted articles. The default is @samp{>}.
5059
5060@end table
5061
5035@item > 5062@item >
5036One space for each thread level. 5063One space for each thread level.
5037@item < 5064@item <
diff --git a/etc/NEWS b/etc/NEWS
index 6444e217035..9bf067f37a8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -192,8 +192,10 @@ have been replaced with "chat.freenode.net" throughout Emacs.
192These functions return the connection local value of the respective 192These functions return the connection local value of the respective
193variables. This can be used for remote hosts. 193variables. This can be used for remote hosts.
194 194
195** Emacs now prints a backtrace when signaling an error in batch mode. This 195** Emacs now prints a backtrace when signaling an error in batch mode.
196makes debugging Emacs Lisp scripts run in batch mode easier. 196This makes debugging Emacs Lisp scripts run in batch mode easier. To
197get back the old behavior, set the new variable
198'backtrace-on-error-noninteractive' to a nil value.
197 199
198 200
199* Editing Changes in Emacs 28.1 201* Editing Changes in Emacs 28.1
@@ -273,6 +275,11 @@ preserving markers, properties and overlays. The new variable
273number of seconds that 'revert-buffer-with-fine-grain' should spend 275number of seconds that 'revert-buffer-with-fine-grain' should spend
274trying to be non-destructive. 276trying to be non-destructive.
275 277
278+++
279** New command 'memory-report'.
280This command opens a new buffer called "*Memory Report*" and gives a
281summary of where Emacs is using memory currently.
282
276** Outline 283** Outline
277 284
278+++ 285+++
@@ -285,6 +292,18 @@ the buffer cycles the whole buffer between "only top-level headings",
285 292
286* Changes in Specialized Modes and Packages in Emacs 28.1 293* Changes in Specialized Modes and Packages in Emacs 28.1
287 294
295** Loading dunnet.el in batch mode doesn't start the game any more
296Instead you need to do 'emacs -f dun-batch' to start the game in
297batch mode.
298
299** Emacs Server
300
301+++
302*** New user option 'server-client-instructions'.
303When emacsclient connects, Emacs will (by default) output a message
304about how to exit the client frame. If 'server-client-instructions'
305is set to nil, this message is inhibited.
306
288** Python mode 307** Python mode
289 308
290*** 'C-c C-r' can now be used on arbitrary regions. 309*** 'C-c C-r' can now be used on arbitrary regions.
@@ -492,6 +511,19 @@ tags to be considered as well.
492** Gnus 511** Gnus
493 512
494+++ 513+++
514*** New user options to customise the summary line specs %[ and %].
515Four new options introduced in customisation group
516'gnus-summary-format'. These are 'gnus-sum-opening-bracket',
517'gnus-sum-closing-bracket', 'gnus-sum-opening-bracket-adopted', and
518'gnus-sum-closing-bracket-adopted'. Their default values are '[', ']',
519'<', '>' respectively. These variables control the appearance of '%['
520and '%]' specs in the summary line format. '%[' will normally display
521the value of 'gnus-sum-opening-bracket', but can also be
522'gnus-sum-opening-bracket-adopted' for the adopted articles. '%]' will
523normally display the value of 'gnus-sum-closing-bracket', but can also
524be 'gnus-sum-closing-bracket-adopted' for the adopted articles.
525
526+++
495*** New user option 'gnus-paging-select-next'. 527*** New user option 'gnus-paging-select-next'.
496This controls what happens when using commands like 'SPC' and 'DEL' to 528This controls what happens when using commands like 'SPC' and 'DEL' to
497page the current article. If non-nil (the default), go to the 529page the current article. If non-nil (the default), go to the
@@ -1084,6 +1116,22 @@ If 'shr-width' is non-nil, it overrides this variable.
1084** Images 1116** Images
1085 1117
1086--- 1118---
1119** Can explicitly specify base_uri for svg images.
1120':base-uri' image property can be used to explicitly specify base_uri
1121for embedded images into svg. ':base-uri' is supported for both file
1122and data svg images.
1123
1124+++
1125** 'svg-embed-base-uri-image' added to embed images
1126'svg-embed-base-uri-image' can be used to embed images located
1127relatively to 'file-name-directory' of the ':base-uri' svg image property.
1128This works much faster then 'svg-embed'.
1129
1130+++
1131*** New function 'image-cache-size'.
1132This function returns the size of the current image cache, in bytes.
1133
1134---
1087*** Animated images stop automatically under high CPU pressure sooner. 1135*** Animated images stop automatically under high CPU pressure sooner.
1088Previously, an animated image would stop animating if any single image 1136Previously, an animated image would stop animating if any single image
1089took more than two seconds to display. The new algorithm maintains a 1137took more than two seconds to display. The new algorithm maintains a
@@ -1199,6 +1247,11 @@ So far Grep and ripgrep are supported. ripgrep seems to offer better
1199performance in certain cases, in particular for case-insensitive 1247performance in certain cases, in particular for case-insensitive
1200searches. 1248searches.
1201 1249
1250+++
1251*** New commands 'xref-prev-group' and 'xref-next-group'.
1252These commands are bound respectively to 'P' and 'N', and navigate to
1253the first item of the previous or next group in the "*xref*" buffer.
1254
1202** json.el 1255** json.el
1203 1256
1204--- 1257---
@@ -1357,8 +1410,41 @@ This face is used for error messages from 'diff'.
1357*** New command 'diff-refresh-hunk'. 1410*** New command 'diff-refresh-hunk'.
1358This new command (bound to 'C-c C-l') regenerates the current hunk. 1411This new command (bound to 'C-c C-l') regenerates the current hunk.
1359 1412
1413** Buttons
1414
1415+++
1416*** New minor mode 'button-mode'.
1417This minor mode does nothing else than install 'button-buffer-map' as
1418a minor mode map (which binds the 'TAB' / 'S-TAB' key bindings to navigate
1419to buttons), and can be used in any view-mode-like buffer that has
1420buttons in it.
1421
1422+++
1423*** New utility function 'button-buttonize'.
1424This function takes a string and returns a string propertized in a way
1425that makes it a valid button.
1426
1427
1360** Miscellaneous 1428** Miscellaneous
1361 1429
1430+++
1431*** New function 'object-intervals'.
1432This function returns a copy of the list of intervals (i.e., text
1433properties) in the object in question (which must either be a string
1434or a buffer).
1435
1436---
1437*** 'hexl-mode' scrolling commands now heed 'next-screen-context-lines'.
1438Previously, 'hexl-scroll-down' and 'hexl-scroll-up' would scroll
1439up/down an entire window, but they now work more like the standard
1440scrolling commands.
1441
1442---
1443*** Errors in 'kill-emacs-hook' no longer prevent Emacs from shutting down.
1444If a function in that hook signals an error in an interactive Emacs,
1445the user will be prompted on whether to continue. If the user doesn't
1446answer within five seconds, Emacs will continue shutting down anyway.
1447
1362--- 1448---
1363*** iso-transl is now preloaded. 1449*** iso-transl is now preloaded.
1364This means that keystrokes like 'Alt-[' are defined by default, 1450This means that keystrokes like 'Alt-[' are defined by default,
@@ -1457,13 +1543,6 @@ both modes are on).
1457This works like 'report-emacs-bug', but is more geared towards sending 1543This works like 'report-emacs-bug', but is more geared towards sending
1458patches to the Emacs issue tracker. 1544patches to the Emacs issue tracker.
1459 1545
1460+++
1461*** New minor mode 'button-mode'.
1462This minor mode does nothing else than install 'button-buffer-map' as
1463a minor mode map (which binds the 'TAB' / 'S-TAB' key bindings to navigate
1464to buttons), and can be used in any view-mode-like buffer that has
1465buttons in it.
1466
1467--- 1546---
1468*** 'icomplete-show-matches-on-no-input' behavior change. 1547*** 'icomplete-show-matches-on-no-input' behavior change.
1469Previously, choosing a different completion with commands like 'C-.' 1548Previously, choosing a different completion with commands like 'C-.'
diff --git a/etc/grep.txt b/etc/grep.txt
index 19a3b4b47b7..3dc4aac3c89 100644
--- a/etc/grep.txt
+++ b/etc/grep.txt
@@ -85,6 +85,12 @@ git --no-pager grep -inH -p -e "org-element-map"
85lisp/org/org.el=20969=(defun org-fill-paragraph (&optional justify) 85lisp/org/org.el=20969=(defun org-fill-paragraph (&optional justify)
86lisp/org/org.el:21047: (org-element-map 86lisp/org/org.el:21047: (org-element-map
87 87
88* ripgrep
89
90rg -nH --color always --no-heading -e grep-match-regexp
91lisp/progmodes/grep.el:608: (while (re-search-forward grep-match-regexp end 1)
92Binary file emacs.info matches (found "\u{0}" byte around offset 2222525)
93
88* unknown greps 94* unknown greps
89 95
90grep -nH -e "xyzxyz" ../info/* 96grep -nH -e "xyzxyz" ../info/*
diff --git a/etc/publicsuffix.txt b/etc/publicsuffix.txt
index bcde6728b5c..1ede2b929a0 100644
--- a/etc/publicsuffix.txt
+++ b/etc/publicsuffix.txt
@@ -1152,7 +1152,7 @@ gov.gr
1152// gs : https://en.wikipedia.org/wiki/.gs 1152// gs : https://en.wikipedia.org/wiki/.gs
1153gs 1153gs
1154 1154
1155// gt : http://www.gt/politicas_de_registro.html 1155// gt : https://www.gt/sitio/registration_policy.php?lang=en
1156gt 1156gt
1157com.gt 1157com.gt
1158edu.gt 1158edu.gt
@@ -4703,6 +4703,7 @@ nl
4703// Norid geographical second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-b/ 4703// Norid geographical second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-b/
4704// Norid category second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-c/ 4704// Norid category second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-c/
4705// Norid category second-level domains managed by parties other than Norid : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-d/ 4705// Norid category second-level domains managed by parties other than Norid : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-d/
4706// RSS feed: https://teknisk.norid.no/en/feed/
4706no 4707no
4707// Norid category second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-c/ 4708// Norid category second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-c/
4708fhs.no 4709fhs.no
@@ -7110,7 +7111,7 @@ org.zw
7110 7111
7111// newGTLDs 7112// newGTLDs
7112 7113
7113// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2020-10-08T17:45:32Z 7114// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2020-11-30T20:26:10Z
7114// This list is auto-generated, don't edit it manually. 7115// This list is auto-generated, don't edit it manually.
7115// aaa : 2015-02-26 American Automobile Association, Inc. 7116// aaa : 2015-02-26 American Automobile Association, Inc.
7116aaa 7117aaa
@@ -7328,7 +7329,7 @@ author
7328// auto : 2014-11-13 XYZ.COM LLC 7329// auto : 2014-11-13 XYZ.COM LLC
7329auto 7330auto
7330 7331
7331// autos : 2014-01-09 DERAutos, LLC 7332// autos : 2014-01-09 XYZ.COM LLC
7332autos 7333autos
7333 7334
7334// avianca : 2015-01-08 Avianca Holdings S.A. 7335// avianca : 2015-01-08 Avianca Holdings S.A.
@@ -7337,7 +7338,7 @@ avianca
7337// aws : 2015-06-25 Amazon Registry Services, Inc. 7338// aws : 2015-06-25 Amazon Registry Services, Inc.
7338aws 7339aws
7339 7340
7340// axa : 2013-12-19 AXA SA 7341// axa : 2013-12-19 AXA Group Operations SAS
7341axa 7342axa
7342 7343
7343// azure : 2014-12-18 Microsoft Corporation 7344// azure : 2014-12-18 Microsoft Corporation
@@ -7478,7 +7479,7 @@ bmw
7478// bnpparibas : 2014-05-29 BNP Paribas 7479// bnpparibas : 2014-05-29 BNP Paribas
7479bnpparibas 7480bnpparibas
7480 7481
7481// boats : 2014-12-04 DERBoats, LLC 7482// boats : 2014-12-04 XYZ.COM LLC
7482boats 7483boats
7483 7484
7484// boehringer : 2015-07-09 Boehringer Ingelheim International GmbH 7485// boehringer : 2015-07-09 Boehringer Ingelheim International GmbH
@@ -7517,7 +7518,7 @@ bot
7517// boutique : 2013-11-14 Binky Moon, LLC 7518// boutique : 2013-11-14 Binky Moon, LLC
7518boutique 7519boutique
7519 7520
7520// box : 2015-11-12 .BOX INC. 7521// box : 2015-11-12 Intercap Registry Inc.
7521box 7522box
7522 7523
7523// bradesco : 2014-12-18 Banco Bradesco S.A. 7524// bradesco : 2014-12-18 Banco Bradesco S.A.
@@ -8501,7 +8502,7 @@ homedepot
8501// homegoods : 2015-07-16 The TJX Companies, Inc. 8502// homegoods : 2015-07-16 The TJX Companies, Inc.
8502homegoods 8503homegoods
8503 8504
8504// homes : 2014-01-09 DERHomes, LLC 8505// homes : 2014-01-09 XYZ.COM LLC
8505homes 8506homes
8506 8507
8507// homesense : 2015-07-16 The TJX Companies, Inc. 8508// homesense : 2015-07-16 The TJX Companies, Inc.
@@ -8651,9 +8652,6 @@ java
8651// jcb : 2014-11-20 JCB Co., Ltd. 8652// jcb : 2014-11-20 JCB Co., Ltd.
8652jcb 8653jcb
8653 8654
8654// jcp : 2015-04-23 JCP Media, Inc.
8655jcp
8656
8657// jeep : 2015-07-30 FCA US LLC. 8655// jeep : 2015-07-30 FCA US LLC.
8658jeep 8656jeep
8659 8657
@@ -9077,7 +9075,7 @@ moscow
9077// moto : 2015-06-04 Motorola Trademark Holdings, LLC 9075// moto : 2015-06-04 Motorola Trademark Holdings, LLC
9078moto 9076moto
9079 9077
9080// motorcycles : 2014-01-09 DERMotorcycles, LLC 9078// motorcycles : 2014-01-09 XYZ.COM LLC
9081motorcycles 9079motorcycles
9082 9080
9083// mov : 2014-01-30 Charleston Road Registry Inc. 9081// mov : 2014-01-30 Charleston Road Registry Inc.
@@ -9242,7 +9240,7 @@ one
9242// ong : 2014-03-06 Public Interest Registry 9240// ong : 2014-03-06 Public Interest Registry
9243ong 9241ong
9244 9242
9245// onl : 2013-09-16 I-Registry Ltd. 9243// onl : 2013-09-16 iRegistry GmbH
9246onl 9244onl
9247 9245
9248// online : 2015-01-15 DotOnline Inc. 9246// online : 2015-01-15 DotOnline Inc.
@@ -9539,7 +9537,7 @@ reviews
9539// rexroth : 2015-06-18 Robert Bosch GMBH 9537// rexroth : 2015-06-18 Robert Bosch GMBH
9540rexroth 9538rexroth
9541 9539
9542// rich : 2013-11-21 I-Registry Ltd. 9540// rich : 2013-11-21 iRegistry GmbH
9543rich 9541rich
9544 9542
9545// richardli : 2015-05-14 Pacific Century Asset Management (HK) Limited 9543// richardli : 2015-05-14 Pacific Century Asset Management (HK) Limited
@@ -9758,9 +9756,6 @@ show
9758// showtime : 2015-08-06 CBS Domains Inc. 9756// showtime : 2015-08-06 CBS Domains Inc.
9759showtime 9757showtime
9760 9758
9761// shriram : 2014-01-23 Shriram Capital Ltd.
9762shriram
9763
9764// silk : 2015-06-25 Amazon Registry Services, Inc. 9759// silk : 2015-06-25 Amazon Registry Services, Inc.
9765silk 9760silk
9766 9761
@@ -10073,7 +10068,7 @@ travelers
10073// travelersinsurance : 2015-03-26 Travelers TLD, LLC 10068// travelersinsurance : 2015-03-26 Travelers TLD, LLC
10074travelersinsurance 10069travelersinsurance
10075 10070
10076// trust : 2014-10-16 NCC Group Domain Services, Inc. 10071// trust : 2014-10-16 UNR Corp.
10077trust 10072trust
10078 10073
10079// trv : 2015-03-26 Travelers TLD, LLC 10074// trv : 2015-03-26 Travelers TLD, LLC
@@ -10595,7 +10590,7 @@ vermögensberatung
10595// xyz : 2013-12-05 XYZ.COM LLC 10590// xyz : 2013-12-05 XYZ.COM LLC
10596xyz 10591xyz
10597 10592
10598// yachts : 2014-01-09 DERYachts, LLC 10593// yachts : 2014-01-09 XYZ.COM LLC
10599yachts 10594yachts
10600 10595
10601// yahoo : 2015-04-02 Yahoo! Domain Services Inc. 10596// yahoo : 2015-04-02 Yahoo! Domain Services Inc.
@@ -10680,12 +10675,6 @@ barsy.ca
10680// Submitted by Werner Kaltofen <wk@all-inkl.com> 10675// Submitted by Werner Kaltofen <wk@all-inkl.com>
10681kasserver.com 10676kasserver.com
10682 10677
10683// Algorithmia, Inc. : algorithmia.com
10684// Submitted by Eli Perelman <eperelman@algorithmia.io>
10685*.algorithmia.com
10686!teams.algorithmia.com
10687!test.algorithmia.com
10688
10689// Altervista: https://www.altervista.org 10678// Altervista: https://www.altervista.org
10690// Submitted by Carlo Cannas <tech_staff@altervista.it> 10679// Submitted by Carlo Cannas <tech_staff@altervista.it>
10691altervista.org 10680altervista.org
@@ -10868,6 +10857,10 @@ bnr.la
10868// Submitted by Paul Crowder <paul.crowder@blackbaud.com> 10857// Submitted by Paul Crowder <paul.crowder@blackbaud.com>
10869blackbaudcdn.net 10858blackbaudcdn.net
10870 10859
10860// Blatech : http://www.blatech.net
10861// Submitted by Luke Bratch <luke@bratch.co.uk>
10862of.je
10863
10871// Boomla : https://boomla.com 10864// Boomla : https://boomla.com
10872// Submitted by Tibor Halter <thalter@boomla.com> 10865// Submitted by Tibor Halter <thalter@boomla.com>
10873boomla.net 10866boomla.net
@@ -10981,10 +10974,6 @@ c.la
10981// Submitted by B. Blechschmidt <hostmaster@certmgr.org> 10974// Submitted by B. Blechschmidt <hostmaster@certmgr.org>
10982certmgr.org 10975certmgr.org
10983 10976
10984// Citrix : https://citrix.com
10985// Submitted by Alex Stoddard <alex.stoddard@citrix.com>
10986xenapponazure.com
10987
10988// Civilized Discourse Construction Kit, Inc. : https://www.discourse.org/ 10977// Civilized Discourse Construction Kit, Inc. : https://www.discourse.org/
10989// Submitted by Rishabh Nambiar & Michael Brown <team@discourse.org> 10978// Submitted by Rishabh Nambiar & Michael Brown <team@discourse.org>
10990discourse.group 10979discourse.group
@@ -11073,10 +11062,6 @@ cloudns.pro
11073cloudns.pw 11062cloudns.pw
11074cloudns.us 11063cloudns.us
11075 11064
11076// Cloudeity Inc : https://cloudeity.com
11077// Submitted by Stefan Dimitrov <contact@cloudeity.com>
11078cloudeity.net
11079
11080// CNPY : https://cnpy.gdn 11065// CNPY : https://cnpy.gdn
11081// Submitted by Angelo Gladding <angelo@lahacker.net> 11066// Submitted by Angelo Gladding <angelo@lahacker.net>
11082cnpy.gdn 11067cnpy.gdn
@@ -11537,6 +11522,10 @@ ddnss.org
11537definima.net 11522definima.net
11538definima.io 11523definima.io
11539 11524
11525// DigitalOcean : https://digitalocean.com/
11526// Submitted by Braxton Huggins <bhuggins@digitalocean.com>
11527ondigitalocean.app
11528
11540// dnstrace.pro : https://dnstrace.pro/ 11529// dnstrace.pro : https://dnstrace.pro/
11541// Submitted by Chris Partridge <chris@partridge.tech> 11530// Submitted by Chris Partridge <chris@partridge.tech>
11542bci.dnstrace.pro 11531bci.dnstrace.pro
@@ -11802,6 +11791,10 @@ ukco.me
11802// submitted by Koen Van Isterdael <k.vanisterdael@fermax.be> 11791// submitted by Koen Van Isterdael <k.vanisterdael@fermax.be>
11803mydobiss.com 11792mydobiss.com
11804 11793
11794// FH Muenster : https://www.fh-muenster.de
11795// Submitted by Robin Naundorf <r.naundorf@fh-muenster.de>
11796fh-muenster.io
11797
11805// Filegear Inc. : https://www.filegear.com 11798// Filegear Inc. : https://www.filegear.com
11806// Submitted by Jason Zhu <jason@owtware.com> 11799// Submitted by Jason Zhu <jason@owtware.com>
11807filegear.me 11800filegear.me
@@ -11872,6 +11865,7 @@ usercontent.jp
11872gentapps.com 11865gentapps.com
11873gentlentapis.com 11866gentlentapis.com
11874lab.ms 11867lab.ms
11868cdn-edges.net
11875 11869
11876// GitHub, Inc. 11870// GitHub, Inc.
11877// Submitted by Patrick Toomey <security@github.com> 11871// Submitted by Patrick Toomey <security@github.com>
@@ -11931,9 +11925,10 @@ pagespeedmobilizer.com
11931publishproxy.com 11925publishproxy.com
11932withgoogle.com 11926withgoogle.com
11933withyoutube.com 11927withyoutube.com
11934cloudfunctions.net 11928*.gateway.dev
11935cloud.goog 11929cloud.goog
11936translate.goog 11930translate.goog
11931cloudfunctions.net
11937 11932
11938blogspot.ae 11933blogspot.ae
11939blogspot.al 11934blogspot.al
@@ -12056,6 +12051,10 @@ ravendb.me
12056development.run 12051development.run
12057ravendb.run 12052ravendb.run
12058 12053
12054// Hong Kong Productivity Council: https://www.hkpc.org/
12055// Submitted by SECaaS Team <summchan@hkpc.org>
12056secaas.hk
12057
12059// HOSTBIP REGISTRY : https://www.hostbip.com/ 12058// HOSTBIP REGISTRY : https://www.hostbip.com/
12060// Submitted by Atanunu Igbunuroghene <publicsuffixlist@hostbip.com> 12059// Submitted by Atanunu Igbunuroghene <publicsuffixlist@hostbip.com>
12061bpl.biz 12060bpl.biz
@@ -12165,7 +12164,7 @@ iserv.dev
12165// Submitted by Yuji Minagawa <domains-admin@iodata.jp> 12164// Submitted by Yuji Minagawa <domains-admin@iodata.jp>
12166iobb.net 12165iobb.net
12167 12166
12168//Jelastic, Inc. : https://jelastic.com/ 12167// Jelastic, Inc. : https://jelastic.com/
12169// Submited by Ihor Kolodyuk <ik@jelastic.com> 12168// Submited by Ihor Kolodyuk <ik@jelastic.com>
12170mel.cloudlets.com.au 12169mel.cloudlets.com.au
12171cloud.interhostsolutions.be 12170cloud.interhostsolutions.be
@@ -12180,6 +12179,9 @@ jele.cloud
12180it1.eur.aruba.jenv-aruba.cloud 12179it1.eur.aruba.jenv-aruba.cloud
12181it1.jenv-aruba.cloud 12180it1.jenv-aruba.cloud
12182it1-eur.jenv-arubabiz.cloud 12181it1-eur.jenv-arubabiz.cloud
12182oxa.cloud
12183tn.oxa.cloud
12184uk.oxa.cloud
12183primetel.cloud 12185primetel.cloud
12184uk.primetel.cloud 12186uk.primetel.cloud
12185ca.reclaim.cloud 12187ca.reclaim.cloud
@@ -12250,6 +12252,7 @@ jelastic.regruhosting.ru
12250enscaled.sg 12252enscaled.sg
12251jele.site 12253jele.site
12252jelastic.team 12254jelastic.team
12255orangecloud.tn
12253j.layershift.co.uk 12256j.layershift.co.uk
12254phx.enscaled.us 12257phx.enscaled.us
12255mircloud.us 12258mircloud.us
@@ -12327,10 +12330,6 @@ co.technology
12327// Submitted by Greg Holland <greg.holland@lmpm.com> 12330// Submitted by Greg Holland <greg.holland@lmpm.com>
12328app.lmpm.com 12331app.lmpm.com
12329 12332
12330// Linki Tools UG : https://linki.tools
12331// Submitted by Paulo Matos <pmatos@linki.tools>
12332linkitools.space
12333
12334// linkyard ldt: https://www.linkyard.ch/ 12333// linkyard ldt: https://www.linkyard.ch/
12335// Submitted by Mario Siegenthaler <mario.siegenthaler@linkyard.ch> 12334// Submitted by Mario Siegenthaler <mario.siegenthaler@linkyard.ch>
12336linkyard.cloud 12335linkyard.cloud
@@ -12369,7 +12368,6 @@ swidnik.pl
12369 12368
12370// Lug.org.uk : https://lug.org.uk 12369// Lug.org.uk : https://lug.org.uk
12371// Submitted by Jon Spriggs <admin@lug.org.uk> 12370// Submitted by Jon Spriggs <admin@lug.org.uk>
12372uklugs.org
12373glug.org.uk 12371glug.org.uk
12374lug.org.uk 12372lug.org.uk
12375lugs.org.uk 12373lugs.org.uk
@@ -12446,11 +12444,17 @@ eu.meteorapp.com
12446co.pl 12444co.pl
12447 12445
12448// Microsoft Corporation : http://microsoft.com 12446// Microsoft Corporation : http://microsoft.com
12449// Submitted by Mostafa Elzeiny <moelzein@microsoft.com> 12447// Submitted by Mitch Webster <miwebst@microsoft.com>
12450*.azurecontainer.io 12448*.azurecontainer.io
12451azurewebsites.net 12449azurewebsites.net
12452azure-mobile.net 12450azure-mobile.net
12453cloudapp.net 12451cloudapp.net
12452azurestaticapps.net
12453centralus.azurestaticapps.net
12454eastasia.azurestaticapps.net
12455eastus2.azurestaticapps.net
12456westeurope.azurestaticapps.net
12457westus2.azurestaticapps.net
12454 12458
12455// minion.systems : http://minion.systems 12459// minion.systems : http://minion.systems
12456// Submitted by Robert Böttinger <r@minion.systems> 12460// Submitted by Robert Böttinger <r@minion.systems>
@@ -12492,19 +12496,22 @@ cust.retrosnub.co.uk
12492ui.nabu.casa 12496ui.nabu.casa
12493 12497
12494// Names.of.London : https://names.of.london/ 12498// Names.of.London : https://names.of.london/
12495// Submitted by James Stevens <registry@names.of.london> or <james@jrcs.net> 12499// Submitted by James Stevens <registry[at]names.of.london> or <publiclist[at]jrcs.net>
12496pony.club 12500pony.club
12497of.fashion 12501of.fashion
12498on.fashion
12499of.football
12500in.london 12502in.london
12501of.london 12503of.london
12504from.marketing
12505with.marketing
12502for.men 12506for.men
12507repair.men
12503and.mom 12508and.mom
12504for.mom 12509for.mom
12505for.one 12510for.one
12511under.one
12506for.sale 12512for.sale
12507of.work 12513that.win
12514from.work
12508to.work 12515to.work
12509 12516
12510// NCTU.ME : https://nctu.me/ 12517// NCTU.ME : https://nctu.me/
@@ -12824,6 +12831,12 @@ mypep.link
12824// Submitted by Kenneth Van Alstyne <kvanalstyne@perspecta.com> 12831// Submitted by Kenneth Van Alstyne <kvanalstyne@perspecta.com>
12825perspecta.cloud 12832perspecta.cloud
12826 12833
12834// PE Ulyanov Kirill Sergeevich : https://airy.host
12835// Submitted by Kirill Ulyanov <k.ulyanov@airy.host>
12836lk3.ru
12837ra-ru.ru
12838zsew.ru
12839
12827// Planet-Work : https://www.planet-work.com/ 12840// Planet-Work : https://www.planet-work.com/
12828// Submitted by Frédéric VANNIÈRE <f.vanniere@planet-work.com> 12841// Submitted by Frédéric VANNIÈRE <f.vanniere@planet-work.com>
12829on-web.fr 12842on-web.fr
@@ -12885,6 +12898,10 @@ byen.site
12885// Submitted by Kor Nielsen <kor@pubtls.org> 12898// Submitted by Kor Nielsen <kor@pubtls.org>
12886pubtls.org 12899pubtls.org
12887 12900
12901// QOTO, Org.
12902// Submitted by Jeffrey Phillips Freeman <jeffrey.freeman@qoto.org>
12903qoto.io
12904
12888// Qualifio : https://qualifio.com/ 12905// Qualifio : https://qualifio.com/
12889// Submitted by Xavier De Cock <xdecock@gmail.com> 12906// Submitted by Xavier De Cock <xdecock@gmail.com>
12890qualifioapp.com 12907qualifioapp.com
@@ -12970,7 +12987,6 @@ hzc.io
12970// Revitalised Limited : http://www.revitalised.co.uk 12987// Revitalised Limited : http://www.revitalised.co.uk
12971// Submitted by Jack Price <jack@revitalised.co.uk> 12988// Submitted by Jack Price <jack@revitalised.co.uk>
12972wellbeingzone.eu 12989wellbeingzone.eu
12973ptplus.fit
12974wellbeingzone.co.uk 12990wellbeingzone.co.uk
12975 12991
12976// Rochester Institute of Technology : http://www.rit.edu/ 12992// Rochester Institute of Technology : http://www.rit.edu/
@@ -13344,7 +13360,7 @@ wafflecell.com
13344// Submitted by Fajar Sodik <official@wapblog.id> 13360// Submitted by Fajar Sodik <official@wapblog.id>
13345idnblogger.com 13361idnblogger.com
13346indowapblog.com 13362indowapblog.com
13347bloghp.id 13363bloger.id
13348wblog.id 13364wblog.id
13349wbq.me 13365wbq.me
13350fastblog.net 13366fastblog.net
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 4315771a496..a1c6837e880 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -6063,6 +6063,7 @@ Erlang_functions (FILE *inf)
6063 { 6063 {
6064 free (last); 6064 free (last);
6065 last = NULL; 6065 last = NULL;
6066 allocated = lastlen = 0;
6066 } 6067 }
6067 } 6068 }
6068 else 6069 else
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 595db1d2f8e..97314cc489f 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -1225,8 +1225,8 @@ as a heading."
1225 (apropos-print-doc 6 'apropos-face t) 1225 (apropos-print-doc 6 'apropos-face t)
1226 (apropos-print-doc 5 'apropos-widget t) 1226 (apropos-print-doc 5 'apropos-widget t)
1227 (apropos-print-doc 4 'apropos-plist nil)) 1227 (apropos-print-doc 4 'apropos-plist nil))
1228 (set (make-local-variable 'truncate-partial-width-windows) t) 1228 (setq-local truncate-partial-width-windows t)
1229 (set (make-local-variable 'truncate-lines) t)))) 1229 (setq-local truncate-lines t))))
1230 (prog1 apropos-accumulator 1230 (prog1 apropos-accumulator
1231 (setq apropos-accumulator ()))) ; permit gc 1231 (setq apropos-accumulator ()))) ; permit gc
1232 1232
diff --git a/lisp/array.el b/lisp/array.el
index 0d1ac74432b..0ad565b5bc7 100644
--- a/lisp/array.el
+++ b/lisp/array.el
@@ -863,25 +863,25 @@ Entering array mode calls the function `array-mode-hook'."
863 (make-local-variable 'array-row) 863 (make-local-variable 'array-row)
864 (make-local-variable 'array-column) 864 (make-local-variable 'array-column)
865 (make-local-variable 'array-copy-string) 865 (make-local-variable 'array-copy-string)
866 (set (make-local-variable 'array-respect-tabs) nil) 866 (setq-local array-respect-tabs nil)
867 (set (make-local-variable 'array-max-row) 867 (setq-local array-max-row
868 (read-number "Number of array rows: ")) 868 (read-number "Number of array rows: "))
869 (set (make-local-variable 'array-max-column) 869 (setq-local array-max-column
870 (read-number "Number of array columns: ")) 870 (read-number "Number of array columns: "))
871 (set (make-local-variable 'array-columns-per-line) 871 (setq-local array-columns-per-line
872 (read-number "Array columns per line: ")) 872 (read-number "Array columns per line: "))
873 (set (make-local-variable 'array-field-width) 873 (setq-local array-field-width
874 (read-number "Field width: ")) 874 (read-number "Field width: "))
875 (set (make-local-variable 'array-rows-numbered) 875 (setq-local array-rows-numbered
876 (y-or-n-p "Rows numbered? ")) 876 (y-or-n-p "Rows numbered? "))
877 (set (make-local-variable 'array-line-length) 877 (setq-local array-line-length
878 (* array-field-width array-columns-per-line)) 878 (* array-field-width array-columns-per-line))
879 (set (make-local-variable 'array-lines-per-row) 879 (setq-local array-lines-per-row
880 (+ (floor (1- array-max-column) array-columns-per-line) 880 (+ (floor (1- array-max-column) array-columns-per-line)
881 (if array-rows-numbered 2 1))) 881 (if array-rows-numbered 2 1)))
882 (message "") 882 (message "")
883 (force-mode-line-update) 883 (force-mode-line-update)
884 (set (make-local-variable 'truncate-lines) t) 884 (setq-local truncate-lines t)
885 (setq overwrite-mode 'overwrite-mode-textual)) 885 (setq overwrite-mode 'overwrite-mode-textual))
886 886
887 887
diff --git a/lisp/battery.el b/lisp/battery.el
index e568ab52460..f59ad124794 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -661,10 +661,12 @@ Intended as a UPower PropertiesChanged signal handler."
661 (cond ((stringp battery-upower-device) 661 (cond ((stringp battery-upower-device)
662 (list battery-upower-device)) 662 (list battery-upower-device))
663 (battery-upower-device) 663 (battery-upower-device)
664 ((dbus-call-method :system battery-upower-service 664 ((dbus-ignore-errors
665 battery-upower-path 665 (dbus-call-method :system battery-upower-service
666 battery-upower-interface 666 battery-upower-path
667 "EnumerateDevices")))) 667 battery-upower-interface
668 "EnumerateDevices"
669 :timeout 1000)))))
668 670
669(defun battery--upower-state (props state) 671(defun battery--upower-state (props state)
670 "Merge the UPower battery state in PROPS with STATE. 672 "Merge the UPower battery state in PROPS with STATE.
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index d06ba287879..5392519d718 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -269,8 +269,8 @@ In Buffer Menu mode, the following commands are defined:
269\\[revert-buffer] Update the list of buffers. 269\\[revert-buffer] Update the list of buffers.
270\\[Buffer-menu-toggle-files-only] Toggle whether the menu displays only file buffers. 270\\[Buffer-menu-toggle-files-only] Toggle whether the menu displays only file buffers.
271\\[Buffer-menu-bury] Bury the buffer listed on this line." 271\\[Buffer-menu-bury] Bury the buffer listed on this line."
272 (set (make-local-variable 'buffer-stale-function) 272 (setq-local buffer-stale-function
273 (lambda (&optional _noconfirm) 'fast)) 273 (lambda (&optional _noconfirm) 'fast))
274 (add-hook 'tabulated-list-revert-hook 'list-buffers--refresh nil t)) 274 (add-hook 'tabulated-list-revert-hook 'list-buffers--refresh nil t))
275 275
276(defun buffer-menu (&optional arg) 276(defun buffer-menu (&optional arg)
diff --git a/lisp/button.el b/lisp/button.el
index ba0682348df..a6f70436f74 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -613,6 +613,20 @@ button at point is the button to describe."
613 (button--describe props) 613 (button--describe props)
614 t))) 614 t)))
615 615
616(defun button-buttonize (string callback &optional data)
617 "Make STRING into a button and return it.
618When clicked, CALLBACK will be called with the DATA as the
619function argument. If DATA isn't present (or is nil), the button
620itself will be used instead as the function argument."
621 (propertize string
622 'face 'button
623 'button t
624 'follow-link t
625 'category t
626 'button-data data
627 'keymap button-map
628 'action callback))
629
616(provide 'button) 630(provide 'button)
617 631
618;;; button.el ends here 632;;; button.el ends here
diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el
index 60dd17e5ed2..6d935872348 100644
--- a/lisp/calc/calc-bin.el
+++ b/lisp/calc/calc-bin.el
@@ -199,48 +199,16 @@
199 (message "Omitting leading zeros on integers")))) 199 (message "Omitting leading zeros on integers"))))
200 200
201 201
202(defvar math-power-of-2-cache (list 1 2 4 8 16 32 64 128 256 512 1024))
203(defvar math-big-power-of-2-cache nil)
204(defun math-power-of-2 (n) ; [I I] [Public] 202(defun math-power-of-2 (n) ; [I I] [Public]
205 (if (and (natnump n) (<= n 100)) 203 (if (natnump n)
206 (or (nth n math-power-of-2-cache) 204 (ash 1 n)
207 (let* ((i (length math-power-of-2-cache)) 205 (error "argument must be a natural number")))
208 (val (nth (1- i) math-power-of-2-cache)))
209 (while (<= i n)
210 (setq val (math-mul val 2)
211 math-power-of-2-cache (nconc math-power-of-2-cache
212 (list val))
213 i (1+ i)))
214 val))
215 (let ((found (assq n math-big-power-of-2-cache)))
216 (if found
217 (cdr found)
218 (let ((po2 (math-ipow 2 n)))
219 (setq math-big-power-of-2-cache
220 (cons (cons n po2) math-big-power-of-2-cache))
221 po2)))))
222 206
223(defun math-integer-log2 (n) ; [I I] [Public] 207(defun math-integer-log2 (n) ; [I I] [Public]
224 (let ((i 0) 208 (and (natnump n)
225 (p math-power-of-2-cache) 209 (not (zerop n))
226 val) 210 (zerop (logand n (1- n)))
227 (while (and p (Math-natnum-lessp (setq val (car p)) n)) 211 (logb n)))
228 (setq p (cdr p)
229 i (1+ i)))
230 (if p
231 (and (equal val n)
232 i)
233 (while (Math-natnum-lessp
234 (prog1
235 (setq val (math-mul val 2))
236 (setq math-power-of-2-cache (nconc math-power-of-2-cache
237 (list val))))
238 n)
239 (setq i (1+ i)))
240 (and (equal val n)
241 i))))
242
243
244 212
245 213
246;;; Bitwise operations. 214;;; Bitwise operations.
@@ -404,7 +372,7 @@
404 (math-clip (calcFunc-ash a n (- w)) w) 372 (math-clip (calcFunc-ash a n (- w)) w)
405 (if (Math-integer-negp a) 373 (if (Math-integer-negp a)
406 (setq a (math-clip a w))) 374 (setq a (math-clip a w)))
407 (let ((two-to-sizem1 (math-power-of-2 (1- w))) 375 (let ((two-to-sizem1 (and (not (zerop w)) (math-power-of-2 (1- w))))
408 (sh (calcFunc-lsh a n w))) 376 (sh (calcFunc-lsh a n w)))
409 (cond ((or (zerop w) 377 (cond ((or (zerop w)
410 (zerop (logand a two-to-sizem1))) 378 (zerop (logand a two-to-sizem1)))
@@ -438,7 +406,7 @@
438 (if (Math-integer-negp a) 406 (if (Math-integer-negp a)
439 (setq a (math-clip a w))) 407 (setq a (math-clip a w)))
440 (cond ((or (Math-integer-negp n) 408 (cond ((or (Math-integer-negp n)
441 (not (Math-natnum-lessp n w))) 409 (>= n w))
442 (calcFunc-rot a (math-mod n w) w)) 410 (calcFunc-rot a (math-mod n w) w))
443 (t 411 (t
444 (math-add (calcFunc-lsh a (- n w) w) 412 (math-add (calcFunc-lsh a (- n w) w)
@@ -455,7 +423,7 @@
455 (math-reject-arg a 'integerp)) 423 (math-reject-arg a 'integerp))
456 ((< (or w (setq w calc-word-size)) 0) 424 ((< (or w (setq w calc-word-size)) 0)
457 (setq a (math-clip a (- w))) 425 (setq a (math-clip a (- w)))
458 (if (Math-natnum-lessp a (math-power-of-2 (- -1 w))) 426 (if (< a (math-power-of-2 (- -1 w)))
459 a 427 a
460 (math-sub a (math-power-of-2 (- w))))) 428 (math-sub a (math-power-of-2 (- w)))))
461 ((math-zerop w) 429 ((math-zerop w)
diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el
index 5aeb8cba0df..0f6c40a663b 100644
--- a/lisp/calc/calc-comb.el
+++ b/lisp/calc/calc-comb.el
@@ -815,7 +815,7 @@
815 (error "Argument must be an integer")) 815 (error "Argument must be an integer"))
816 ((Math-integer-negp n) 816 ((Math-integer-negp n)
817 '(nil)) 817 '(nil))
818 ((Math-natnum-lessp n 8000000) 818 ((< n 8000000)
819 (let ((i -1) v) 819 (let ((i -1) v)
820 (while (and (> (% n (setq v (aref math-primes-table 820 (while (and (> (% n (setq v (aref math-primes-table
821 (setq i (1+ i))))) 821 (setq i (1+ i)))))
@@ -913,7 +913,7 @@
913 (if (Math-messy-integerp n) 913 (if (Math-messy-integerp n)
914 (setq n (math-trunc n))) 914 (setq n (math-trunc n)))
915 (if (Math-natnump n) 915 (if (Math-natnump n)
916 (if (Math-natnum-lessp 2 n) 916 (if (< 2 n)
917 (let (factors res p (i 0)) 917 (let (factors res p (i 0))
918 (while (and (not (eq n 1)) 918 (while (and (not (eq n 1))
919 (< i (length math-primes-table))) 919 (< i (length math-primes-table)))
@@ -927,7 +927,7 @@
927 (setq factors (nconc factors (list p)) 927 (setq factors (nconc factors (list p))
928 n (car res))) 928 n (car res)))
929 (or (eq n 1) 929 (or (eq n 1)
930 (Math-natnum-lessp p (car res)) 930 (< p (car res))
931 (setq factors (nconc factors (list n)) 931 (setq factors (nconc factors (list n))
932 n 1)) 932 n 1))
933 (setq i (1+ i))) 933 (setq i (1+ i)))
@@ -946,7 +946,7 @@
946 (if (Math-messy-integerp n) 946 (if (Math-messy-integerp n)
947 (setq n (math-trunc n))) 947 (setq n (math-trunc n)))
948 (if (Math-natnump n) 948 (if (Math-natnump n)
949 (if (Math-natnum-lessp n 2) 949 (if (< n 2)
950 (if (Math-negp n) 950 (if (Math-negp n)
951 (calcFunc-totient (math-abs n)) 951 (calcFunc-totient (math-abs n))
952 n) 952 n)
@@ -969,7 +969,7 @@
969 (if (Math-messy-integerp n) 969 (if (Math-messy-integerp n)
970 (setq n (math-trunc n))) 970 (setq n (math-trunc n)))
971 (if (and (Math-natnump n) (not (eq n 0))) 971 (if (and (Math-natnump n) (not (eq n 0)))
972 (if (Math-natnum-lessp n 2) 972 (if (< n 2)
973 (if (Math-negp n) 973 (if (Math-negp n)
974 (calcFunc-moebius (math-abs n)) 974 (calcFunc-moebius (math-abs n))
975 1) 975 1)
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 4877fa6e08c..7984c8bbaa2 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -2417,17 +2417,6 @@ If X is not an error form, return 1."
2417 (mapcar #'math-normalize (cdr a)))))) 2417 (mapcar #'math-normalize (cdr a))))))
2418 2418
2419 2419
2420;;; Normalize a bignum digit list by trimming high-end zeros. [L l]
2421(defun math-norm-bignum (a)
2422 (let ((digs a) (last nil))
2423 (while digs
2424 (or (eq (car digs) 0) (setq last digs))
2425 (setq digs (cdr digs)))
2426 (and last
2427 (progn
2428 (setcdr last nil)
2429 a))))
2430
2431;;; Return 0 for zero, -1 for negative, 1 for positive. [S n] [Public] 2420;;; Return 0 for zero, -1 for negative, 1 for positive. [S n] [Public]
2432(defun calcFunc-sign (a &optional x) 2421(defun calcFunc-sign (a &optional x)
2433 (let ((signs (math-possible-signs a))) 2422 (let ((signs (math-possible-signs a)))
@@ -2542,23 +2531,6 @@ If X is not an error form, return 1."
2542 0 2531 0
2543 2)))) 2532 2))))
2544 2533
2545;;; Compare two bignum digit lists, return -1 for A<B, 0 for A=B, 1 for A>B.
2546(defun math-compare-bignum (a b) ; [S l l]
2547 (let ((res 0))
2548 (while (and a b)
2549 (if (< (car a) (car b))
2550 (setq res -1)
2551 (if (> (car a) (car b))
2552 (setq res 1)))
2553 (setq a (cdr a)
2554 b (cdr b)))
2555 (if a
2556 (progn
2557 (while (eq (car a) 0) (setq a (cdr a)))
2558 (if a 1 res))
2559 (while (eq (car b) 0) (setq b (cdr b)))
2560 (if b -1 res))))
2561
2562(defun math-compare-lists (a b) 2534(defun math-compare-lists (a b)
2563 (cond ((null a) (null b)) 2535 (cond ((null a) (null b))
2564 ((null b) nil) 2536 ((null b) nil)
@@ -2685,7 +2657,7 @@ If X is not an error form, return 1."
2685 (if (Math-integer-negp a) (setq a (math-neg a))) 2657 (if (Math-integer-negp a) (setq a (math-neg a)))
2686 (if (Math-integer-negp b) (setq b (math-neg b))) 2658 (if (Math-integer-negp b) (setq b (math-neg b)))
2687 (let (c) 2659 (let (c)
2688 (if (Math-natnum-lessp a b) 2660 (if (< a b)
2689 (setq c b b a a c)) 2661 (setq c b b a a c))
2690 (while (and (consp a) (not (eq b 0))) 2662 (while (and (consp a) (not (eq b 0)))
2691 (setq c b 2663 (setq c b
diff --git a/lisp/calc/calc-funcs.el b/lisp/calc/calc-funcs.el
index 9ee86e755ea..fd544f9719b 100644
--- a/lisp/calc/calc-funcs.el
+++ b/lisp/calc/calc-funcs.el
@@ -410,7 +410,7 @@
410 ((and (math-num-integerp b) 410 ((and (math-num-integerp b)
411 (if (math-negp b) 411 (if (math-negp b)
412 (math-reject-arg b 'range) 412 (math-reject-arg b 'range)
413 (Math-natnum-lessp (setq b (math-trunc b)) 20))) 413 (< (setq b (math-trunc b)) 20)))
414 (and calc-symbolic-mode (or (math-floatp a) (math-floatp b)) 414 (and calc-symbolic-mode (or (math-floatp a) (math-floatp b))
415 (math-inexact-result)) 415 (math-inexact-result))
416 (math-mul 416 (math-mul
@@ -427,7 +427,7 @@
427 ((and (math-num-integerp a) 427 ((and (math-num-integerp a)
428 (if (math-negp a) 428 (if (math-negp a)
429 (math-reject-arg a 'range) 429 (math-reject-arg a 'range)
430 (Math-natnum-lessp (setq a (math-trunc a)) 20))) 430 (< (setq a (math-trunc a)) 20)))
431 (math-sub (or math-current-beta-value (calcFunc-beta a b)) 431 (math-sub (or math-current-beta-value (calcFunc-beta a b))
432 (calcFunc-betaB (math-sub 1 x) b a))) 432 (calcFunc-betaB (math-sub 1 x) b a)))
433 (t 433 (t
diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el
index 829fa44ca4f..b694a826ce5 100644
--- a/lisp/calc/calc-graph.el
+++ b/lisp/calc/calc-graph.el
@@ -351,7 +351,7 @@
351 (if (>= ver 3) 351 (if (>= ver 3)
352 (insert "set surface\nset nocontour\n" 352 (insert "set surface\nset nocontour\n"
353 "set " (if calc-graph-is-splot "" "no") "parametric\n" 353 "set " (if calc-graph-is-splot "" "no") "parametric\n"
354 "set notime\nset border\nset ztics\nset zeroaxis\n" 354 "set notimestamp\nset border\nset ztics\nset zeroaxis\n"
355 "set view 60,30,1,1\nset offsets 0,0,0,0\n")) 355 "set view 60,30,1,1\nset offsets 0,0,0,0\n"))
356 (setq samples-pos (point)) 356 (setq samples-pos (point))
357 (insert "\n\n" str)) 357 (insert "\n\n" str))
diff --git a/lisp/calc/calc-macs.el b/lisp/calc/calc-macs.el
index 06ef3ef0556..a15095e3753 100644
--- a/lisp/calc/calc-macs.el
+++ b/lisp/calc/calc-macs.el
@@ -29,7 +29,6 @@
29(declare-function math-looks-negp "calc-misc" (a)) 29(declare-function math-looks-negp "calc-misc" (a))
30(declare-function math-posp "calc-misc" (a)) 30(declare-function math-posp "calc-misc" (a))
31(declare-function math-compare "calc-ext" (a b)) 31(declare-function math-compare "calc-ext" (a b))
32(declare-function math-compare-bignum "calc-ext" (a b))
33 32
34 33
35(defmacro calc-wrapper (&rest body) 34(defmacro calc-wrapper (&rest body)
@@ -174,13 +173,6 @@
174 (eq (nth 1 a) b) 173 (eq (nth 1 a) b)
175 (= (nth 2 a) 0)))) 174 (= (nth 2 a) 0))))
176 175
177(defsubst Math-natnum-lessp (a b)
178 (if (consp a)
179 (and (consp b)
180 (= (math-compare-bignum (cdr a) (cdr b)) -1))
181 (or (consp b)
182 (< a b))))
183
184(provide 'calc-macs) 176(provide 'calc-macs)
185 177
186;;; calc-macs.el ends here 178;;; calc-macs.el ends here
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index 46172d1b7f6..1d0d94e992f 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -370,18 +370,6 @@ If this can't be done, return NIL."
370 (math-isqrt (math-floor a)) 370 (math-isqrt (math-floor a))
371 (math-floor (math-sqrt a)))) 371 (math-floor (math-sqrt a))))
372 372
373(defun math-zerop-bignum (a)
374 (and (eq (car a) 0)
375 (progn
376 (while (eq (car (setq a (cdr a))) 0))
377 (null a))))
378
379(defun math-scale-bignum-digit-size (a n) ; [L L S]
380 (while (> n 0)
381 (setq a (cons 0 a)
382 n (1- n)))
383 a)
384
385;;; Compute the square root of a number. 373;;; Compute the square root of a number.
386;;; [T N] if possible, else [F N] if possible, else [C N]. [Public] 374;;; [T N] if possible, else [F N] if possible, else [C N]. [Public]
387(defun math-sqrt (a) 375(defun math-sqrt (a)
@@ -666,7 +654,7 @@ If this can't be done, return NIL."
666 (let* ((q (math-idivmod a (math-ipow guess (1- math-nri-n)))) 654 (let* ((q (math-idivmod a (math-ipow guess (1- math-nri-n))))
667 (s (math-add (car q) (math-mul (1- math-nri-n) guess))) 655 (s (math-add (car q) (math-mul (1- math-nri-n) guess)))
668 (g2 (math-idivmod s math-nri-n))) 656 (g2 (math-idivmod s math-nri-n)))
669 (if (Math-natnum-lessp (car g2) guess) 657 (if (< (car g2) guess)
670 (math-nth-root-int-iter a (car g2)) 658 (math-nth-root-int-iter a (car g2))
671 (cons (and (equal (car g2) guess) 659 (cons (and (equal (car g2) guess)
672 (eq (cdr q) 0) 660 (eq (cdr q) 0)
@@ -1615,7 +1603,7 @@ If this can't be done, return NIL."
1615 (math-natnump b) (not (eq b 0))) 1603 (math-natnump b) (not (eq b 0)))
1616 (if (eq b 1) 1604 (if (eq b 1)
1617 (math-reject-arg x "*Logarithm base one") 1605 (math-reject-arg x "*Logarithm base one")
1618 (if (Math-natnum-lessp x b) 1606 (if (< x b)
1619 0 1607 0
1620 (cdr (math-integer-log x b)))) 1608 (cdr (math-integer-log x b))))
1621 (math-floor (calcFunc-log x b)))) 1609 (math-floor (calcFunc-log x b))))
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 9d869f359bc..bb02281111f 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -2100,7 +2100,7 @@ the United States."
2100 (set-buffer calc-trail-buffer) 2100 (set-buffer calc-trail-buffer)
2101 (unless (derived-mode-p 'calc-trail-mode) 2101 (unless (derived-mode-p 'calc-trail-mode)
2102 (calc-trail-mode) 2102 (calc-trail-mode)
2103 (set (make-local-variable 'calc-main-buffer) buf))))) 2103 (setq-local calc-main-buffer buf)))))
2104 (or (and calc-trail-pointer 2104 (or (and calc-trail-pointer
2105 (eq (marker-buffer calc-trail-pointer) calc-trail-buffer)) 2105 (eq (marker-buffer calc-trail-pointer) calc-trail-buffer))
2106 (with-current-buffer calc-trail-buffer 2106 (with-current-buffer calc-trail-buffer
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index de9b1f3ff53..d262b607796 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1788,7 +1788,7 @@ For a complete description, see the info node `Calendar/Diary'.
1788 (setq buffer-read-only t 1788 (setq buffer-read-only t
1789 buffer-undo-list t 1789 buffer-undo-list t
1790 indent-tabs-mode nil) 1790 indent-tabs-mode nil)
1791 (set (make-local-variable 'scroll-margin) 0) ; bug#10379 1791 (setq-local scroll-margin 0) ; bug#10379
1792 (calendar-update-mode-line) 1792 (calendar-update-mode-line)
1793 (make-local-variable 'calendar-mark-ring) 1793 (make-local-variable 'calendar-mark-ring)
1794 (make-local-variable 'displayed-month) ; month in middle of window 1794 (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 fbc13f59b2a..bf1e8ebf9d6 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -839,7 +839,7 @@ LIST-ONLY is non-nil, in which case it just returns the list."
839 (goto-char (point-min)) 839 (goto-char (point-min))
840 (unless list-only 840 (unless list-only
841 (let ((ol (make-overlay (point-min) (point-max) nil t nil))) 841 (let ((ol (make-overlay (point-min) (point-max) nil t nil)))
842 (set (make-local-variable 'diary-selective-display) t) 842 (setq-local diary-selective-display t)
843 (overlay-put ol 'invisible 'diary) 843 (overlay-put ol 'invisible 'diary)
844 (overlay-put ol 'evaporate t))) 844 (overlay-put ol 'evaporate t)))
845 (dotimes (_ number) 845 (dotimes (_ number)
@@ -2381,10 +2381,9 @@ return a font-lock pattern matching array of MONTHS and marking SYMBOL."
2381;;;###autoload 2381;;;###autoload
2382(define-derived-mode diary-mode fundamental-mode "Diary" 2382(define-derived-mode diary-mode fundamental-mode "Diary"
2383 "Major mode for editing the diary file." 2383 "Major mode for editing the diary file."
2384 (set (make-local-variable 'font-lock-defaults) 2384 (setq-local font-lock-defaults '(diary-font-lock-keywords t))
2385 '(diary-font-lock-keywords t)) 2385 (setq-local comment-start diary-comment-start)
2386 (set (make-local-variable 'comment-start) diary-comment-start) 2386 (setq-local comment-end diary-comment-end)
2387 (set (make-local-variable 'comment-end) diary-comment-end)
2388 (add-to-invisibility-spec '(diary . nil)) 2387 (add-to-invisibility-spec '(diary . nil))
2389 (add-hook 'after-save-hook #'diary-redraw-calendar nil t) 2388 (add-hook 'after-save-hook #'diary-redraw-calendar nil t)
2390 ;; In case the file was modified externally, refresh the calendar 2389 ;; 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."
2465(define-derived-mode diary-fancy-display-mode special-mode 2464(define-derived-mode diary-fancy-display-mode special-mode
2466 "Diary" 2465 "Diary"
2467 "Major mode used while displaying diary entries using Fancy Display." 2466 "Major mode used while displaying diary entries using Fancy Display."
2468 (set (make-local-variable 'font-lock-defaults) 2467 (setq-local font-lock-defaults
2469 '(diary-fancy-font-lock-keywords 2468 '(diary-fancy-font-lock-keywords
2470 t nil nil nil 2469 t nil nil nil
2471 (font-lock-fontify-region-function 2470 (font-lock-fontify-region-function
2472 . diary-fancy-font-lock-fontify-region-function))) 2471 . diary-fancy-font-lock-fontify-region-function)))
2473 (set (make-local-variable 'minor-mode-overriding-map-alist) 2472 (setq-local minor-mode-overriding-map-alist
2474 (list (cons t diary-fancy-overriding-map))) 2473 (list (cons t diary-fancy-overriding-map)))
2475 (view-mode 1)) 2474 (view-mode 1))
2476 2475
2477;; Following code from Dave Love <fx@gnu.org>. 2476;; Following code from Dave Love <fx@gnu.org>.
diff --git a/lisp/chistory.el b/lisp/chistory.el
index c9aa927b94f..98443bfa88f 100644
--- a/lisp/chistory.el
+++ b/lisp/chistory.el
@@ -140,7 +140,7 @@ The buffer is left in Command History mode."
140Keybindings: 140Keybindings:
141\\{command-history-mode-map}" 141\\{command-history-mode-map}"
142 (lisp-mode-variables nil) 142 (lisp-mode-variables nil)
143 (set (make-local-variable 'revert-buffer-function) 'command-history-revert) 143 (setq-local revert-buffer-function 'command-history-revert)
144 (set-syntax-table emacs-lisp-mode-syntax-table)) 144 (set-syntax-table emacs-lisp-mode-syntax-table))
145 145
146(defcustom command-history-hook nil 146(defcustom command-history-hook nil
diff --git a/lisp/comint.el b/lisp/comint.el
index 2873416c5f4..628a93ddf95 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1224,7 +1224,7 @@ Moves relative to START, or `comint-input-ring-index'."
1224 (process-mark (get-buffer-process (current-buffer)))) 1224 (process-mark (get-buffer-process (current-buffer))))
1225 (point-max))) 1225 (point-max)))
1226 1226
1227(defun comint-previous-matching-input (regexp n) 1227(defun comint-previous-matching-input (regexp n &optional restore)
1228 "Search backwards through input history for match for REGEXP. 1228 "Search backwards through input history for match for REGEXP.
1229\(Previous history elements are earlier commands.) 1229\(Previous history elements are earlier commands.)
1230With prefix argument N, search for Nth previous match. 1230With prefix argument N, search for Nth previous match.
@@ -1235,16 +1235,24 @@ If N is negative, find the next or Nth next match."
1235 ;; Has a match been found? 1235 ;; Has a match been found?
1236 (if (null pos) 1236 (if (null pos)
1237 (user-error "Not found") 1237 (user-error "Not found")
1238 ;; If leaving the edit line, save partial input 1238 (if (and comint-input-ring-index
1239 (if (null comint-input-ring-index) ;not yet on ring 1239 restore
1240 (setq comint-stored-incomplete-input 1240 (or (and (< n 0)
1241 (funcall comint-get-old-input))) 1241 (< comint-input-ring-index pos))
1242 (setq comint-input-ring-index pos) 1242 (and (> n 0)
1243 (unless isearch-mode 1243 (> comint-input-ring-index pos))))
1244 (let ((message-log-max nil)) ; Do not write to *Messages*. 1244 ;; We have a wrap; restore contents.
1245 (message "History item: %d" (1+ pos)))) 1245 (comint-restore-input)
1246 (comint-delete-input) 1246 ;; If leaving the edit line, save partial input
1247 (insert (ring-ref comint-input-ring pos))))) 1247 (if (null comint-input-ring-index) ;not yet on ring
1248 (setq comint-stored-incomplete-input
1249 (funcall comint-get-old-input)))
1250 (setq comint-input-ring-index pos)
1251 (unless isearch-mode
1252 (let ((message-log-max nil)) ; Do not write to *Messages*.
1253 (message "History item: %d" (1+ pos))))
1254 (comint-delete-input)
1255 (insert (ring-ref comint-input-ring pos))))))
1248 1256
1249(defun comint-next-matching-input (regexp n) 1257(defun comint-next-matching-input (regexp n)
1250 "Search forwards through input history for match for REGEXP. 1258 "Search forwards through input history for match for REGEXP.
@@ -1272,7 +1280,7 @@ If N is negative, search forwards for the -Nth following match."
1272 comint-input-ring-index nil)) 1280 comint-input-ring-index nil))
1273 (comint-previous-matching-input 1281 (comint-previous-matching-input
1274 (concat "^" (regexp-quote comint-matching-input-from-input-string)) 1282 (concat "^" (regexp-quote comint-matching-input-from-input-string))
1275 n) 1283 n t)
1276 (when (eq comint-move-point-for-matching-input 'after-input) 1284 (when (eq comint-move-point-for-matching-input 'after-input)
1277 (goto-char opoint)))) 1285 (goto-char opoint))))
1278 1286
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index a9df0314215..c8bb749eb38 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -45,7 +45,7 @@
45;; dabbrev-case-replace nil t 45;; dabbrev-case-replace nil t
46;; 46;;
47;; Set the variables you want special for your mode like this: 47;; Set the variables you want special for your mode like this:
48;; (set (make-local-variable 'dabbrev-case-replace) nil) 48;; (setq-local dabbrev-case-replace nil)
49;; Then you don't interfere with other modes. 49;; Then you don't interfere with other modes.
50;; 50;;
51;; If your mode handles buffers that refers to other buffers 51;; If your mode handles buffers that refers to other buffers
@@ -59,10 +59,10 @@
59 59
60;; Example for GNUS (when we write a reply, we want dabbrev to look in 60;; Example for GNUS (when we write a reply, we want dabbrev to look in
61;; the article for expansion): 61;; the article for expansion):
62;; (set (make-local-variable 'dabbrev-friend-buffer-function) 62;; (setq-local dabbrev-friend-buffer-function
63;; (lambda (buffer) 63;; (lambda (buffer)
64;; (with-current-buffer buffer 64;; (with-current-buffer buffer
65;; (memq major-mode '(news-reply-mode gnus-article-mode))))) 65;; (memq major-mode '(news-reply-mode gnus-article-mode)))))
66 66
67 67
68;; Known bugs and limitations. 68;; Known bugs and limitations.
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 7a7f1d07c93..4be330375da 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1222,7 +1222,13 @@ This function is a no-op when Emacs is running in batch mode.
1222It returns t if a desktop file was loaded, nil otherwise. 1222It returns t if a desktop file was loaded, nil otherwise.
1223\n(fn DIRNAME)" 1223\n(fn DIRNAME)"
1224 (interactive "i\nP") 1224 (interactive "i\nP")
1225 (unless noninteractive 1225 (if (or noninteractive
1226 (and (desktop-owner)
1227 (= (desktop-owner) (emacs-pid))))
1228 (message "Not reloading the desktop%s"
1229 (if noninteractive
1230 ""
1231 "; already loaded"))
1226 (setq desktop-dirname 1232 (setq desktop-dirname
1227 (file-name-as-directory 1233 (file-name-as-directory
1228 (expand-file-name 1234 (expand-file-name
diff --git a/lisp/dframe.el b/lisp/dframe.el
index 417477be27b..31e571410bc 100644
--- a/lisp/dframe.el
+++ b/lisp/dframe.el
@@ -280,7 +280,7 @@ CREATE-HOOK is a hook to run after creating a frame."
280 280
281 ;; Enable mouse tracking in emacs 281 ;; Enable mouse tracking in emacs
282 (if dframe-track-mouse-function 282 (if dframe-track-mouse-function
283 (set (make-local-variable 'track-mouse) t)) ;this could be messy. 283 (setq-local track-mouse t)) ;this could be messy.
284 284
285 ;; Override `temp-buffer-show-hook' so that help and such 285 ;; Override `temp-buffer-show-hook' so that help and such
286 ;; put their stuff into a frame other than our own. 286 ;; 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."
290 ;; FIXME: Doesn't this get us into an inf-loop when the 290 ;; FIXME: Doesn't this get us into an inf-loop when the
291 ;; `temp-buffer-show-function' runs `temp-buffer-show-hook' 291 ;; `temp-buffer-show-function' runs `temp-buffer-show-hook'
292 ;; (as is normally the case)? 292 ;; (as is normally the case)?
293 (progn (make-local-variable 'temp-buffer-show-hook) 293 (setq-local temp-buffer-show-hook temp-buffer-show-function))
294 (setq temp-buffer-show-hook temp-buffer-show-function))) 294 (setq-local temp-buffer-show-function 'dframe-temp-buffer-show-function)
295 (make-local-variable 'temp-buffer-show-function)
296 (setq temp-buffer-show-function 'dframe-temp-buffer-show-function)
297 ;; If this buffer is killed, we must make sure that we destroy 295 ;; If this buffer is killed, we must make sure that we destroy
298 ;; the frame the dedicated window is in. 296 ;; the frame the dedicated window is in.
299 (add-hook 'kill-buffer-hook (lambda () 297 (add-hook 'kill-buffer-hook (lambda ()
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 26155190d47..0f68b470733 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -259,7 +259,7 @@ the string of command switches used as the third argument of `diff'."
259 (list 259 (list
260 (minibuffer-with-setup-hook 260 (minibuffer-with-setup-hook
261 (lambda () 261 (lambda ()
262 (set (make-local-variable 'minibuffer-default-add-function) nil) 262 (setq-local minibuffer-default-add-function nil)
263 (setq minibuffer-default defaults)) 263 (setq minibuffer-default defaults))
264 (read-file-name (format-prompt "Diff %s with" default current) 264 (read-file-name (format-prompt "Diff %s with" default current)
265 target-dir default t)) 265 target-dir default t))
@@ -334,7 +334,7 @@ only in the active region if `dired-mark-region' is non-nil."
334 (defaults (dired-dwim-target-defaults nil target-dir))) 334 (defaults (dired-dwim-target-defaults nil target-dir)))
335 (minibuffer-with-setup-hook 335 (minibuffer-with-setup-hook
336 (lambda () 336 (lambda ()
337 (set (make-local-variable 'minibuffer-default-add-function) nil) 337 (setq-local minibuffer-default-add-function nil)
338 (setq minibuffer-default defaults)) 338 (setq minibuffer-default defaults))
339 (read-directory-name (format "Compare %s with: " 339 (read-directory-name (format "Compare %s with: "
340 (dired-current-directory)) 340 (dired-current-directory))
@@ -2049,7 +2049,7 @@ Optional arg HOW-TO determines how to treat the target.
2049 (target (expand-file-name ; fluid variable inside dired-create-files 2049 (target (expand-file-name ; fluid variable inside dired-create-files
2050 (minibuffer-with-setup-hook 2050 (minibuffer-with-setup-hook
2051 (lambda () 2051 (lambda ()
2052 (set (make-local-variable 'minibuffer-default-add-function) nil) 2052 (setq-local minibuffer-default-add-function nil)
2053 (setq minibuffer-default defaults)) 2053 (setq minibuffer-default defaults))
2054 (dired-mark-read-file-name 2054 (dired-mark-read-file-name
2055 (format "%s %%s %s: " 2055 (format "%s %%s %s: "
@@ -3013,14 +3013,14 @@ is part of a file name (i.e., has the text property `dired-filename')."
3013(defun dired-isearch-filenames () 3013(defun dired-isearch-filenames ()
3014 "Search for a string using Isearch only in file names in the Dired buffer." 3014 "Search for a string using Isearch only in file names in the Dired buffer."
3015 (interactive) 3015 (interactive)
3016 (set (make-local-variable 'dired-isearch-filenames) t) 3016 (setq-local dired-isearch-filenames t)
3017 (isearch-forward nil t)) 3017 (isearch-forward nil t))
3018 3018
3019;;;###autoload 3019;;;###autoload
3020(defun dired-isearch-filenames-regexp () 3020(defun dired-isearch-filenames-regexp ()
3021 "Search for a regexp using Isearch only in file names in the Dired buffer." 3021 "Search for a regexp using Isearch only in file names in the Dired buffer."
3022 (interactive) 3022 (interactive)
3023 (set (make-local-variable 'dired-isearch-filenames) t) 3023 (setq-local dired-isearch-filenames t)
3024 (isearch-forward-regexp nil t)) 3024 (isearch-forward-regexp nil t))
3025 3025
3026 3026
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 55077e71882..75e4f466246 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -636,7 +636,7 @@ you can relist single subdirs using \\[dired-do-redisplay]."
636 (dired-mode dirname (or switches dired-listing-switches)) 636 (dired-mode dirname (or switches dired-listing-switches))
637 (setq mode-name "Virtual Dired" 637 (setq mode-name "Virtual Dired"
638 revert-buffer-function 'dired-virtual-revert) 638 revert-buffer-function 'dired-virtual-revert)
639 (set (make-local-variable 'dired-subdir-alist) nil) 639 (setq-local dired-subdir-alist nil)
640 (dired-build-subdir-alist) 640 (dired-build-subdir-alist)
641 (goto-char (point-min)) 641 (goto-char (point-min))
642 (dired-initial-position dirname)) 642 (dired-initial-position dirname))
@@ -1226,7 +1226,7 @@ Otherwise obeys the value of `dired-vm-read-only-folders'."
1226 (and dired-vm-read-only-folders 1226 (and dired-vm-read-only-folders
1227 (not (file-writable-p fil))))) 1227 (not (file-writable-p fil)))))
1228 ;; So that pressing `v' inside VM does prompt within current directory: 1228 ;; So that pressing `v' inside VM does prompt within current directory:
1229 (set (make-local-variable 'vm-folder-directory) dir))) 1229 (setq-local vm-folder-directory dir)))
1230 1230
1231(defun dired-rmail () 1231(defun dired-rmail ()
1232 "Run RMAIL on this file." 1232 "Run RMAIL on this file."
diff --git a/lisp/dired.el b/lisp/dired.el
index 30b9f5b8fa1..baf99da7b48 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2419,6 +2419,8 @@ If the current buffer can be edited with Wdired, (i.e. the major
2419mode is `dired-mode'), call `wdired-change-to-wdired-mode'. 2419mode is `dired-mode'), call `wdired-change-to-wdired-mode'.
2420Otherwise, toggle `read-only-mode'." 2420Otherwise, toggle `read-only-mode'."
2421 (interactive) 2421 (interactive)
2422 (unless (file-writable-p default-directory)
2423 (user-error "Directory %s isn't writeable" default-directory))
2422 (if (derived-mode-p 'dired-mode) 2424 (if (derived-mode-p 'dired-mode)
2423 (wdired-change-to-wdired-mode) 2425 (wdired-change-to-wdired-mode)
2424 (read-only-mode 'toggle))) 2426 (read-only-mode 'toggle)))
@@ -2499,6 +2501,10 @@ directory in another window."
2499(defun dired-find-file () 2501(defun dired-find-file ()
2500 "In Dired, visit the file or directory named on this line." 2502 "In Dired, visit the file or directory named on this line."
2501 (interactive) 2503 (interactive)
2504 (dired--find-file #'find-file (dired-get-file-for-visit)))
2505
2506(defun dired--find-file (find-file-function file)
2507 "Call FIND-FILE-FUNCTION on FILE, but bind some relevant variables."
2502 ;; Bind `find-file-run-dired' so that the command works on directories 2508 ;; Bind `find-file-run-dired' so that the command works on directories
2503 ;; too, independent of the user's setting. 2509 ;; too, independent of the user's setting.
2504 (let ((find-file-run-dired t) 2510 (let ((find-file-run-dired t)
@@ -2511,7 +2517,7 @@ directory in another window."
2511 (if dired-auto-revert-buffer 2517 (if dired-auto-revert-buffer
2512 nil 2518 nil
2513 switch-to-buffer-preserve-window-point))) 2519 switch-to-buffer-preserve-window-point)))
2514 (find-file (dired-get-file-for-visit)))) 2520 (funcall find-file-function file)))
2515 2521
2516(defun dired-find-alternate-file () 2522(defun dired-find-alternate-file ()
2517 "In Dired, visit file or directory on current line via `find-alternate-file'. 2523 "In Dired, visit file or directory on current line via `find-alternate-file'.
@@ -2547,7 +2553,7 @@ respectively."
2547 (select-window window) 2553 (select-window window)
2548 (funcall find-dir-func file))) 2554 (funcall find-dir-func file)))
2549 (select-window window) 2555 (select-window window)
2550 (funcall find-file-func (file-name-sans-versions file t))))) 2556 (dired--find-file find-file-func (file-name-sans-versions file t)))))
2551 2557
2552(defun dired-mouse-find-file-other-window (event) 2558(defun dired-mouse-find-file-other-window (event)
2553 "In Dired, visit the file or directory name you click on in another window." 2559 "In Dired, visit the file or directory name you click on in another window."
@@ -2574,7 +2580,7 @@ Otherwise, display it in another buffer."
2574(defun dired-find-file-other-window () 2580(defun dired-find-file-other-window ()
2575 "In Dired, visit this file or directory in another window." 2581 "In Dired, visit this file or directory in another window."
2576 (interactive) 2582 (interactive)
2577 (find-file-other-window (dired-get-file-for-visit))) 2583 (dired--find-file #'find-file-other-window (dired-get-file-for-visit)))
2578 2584
2579(defun dired-display-file () 2585(defun dired-display-file ()
2580 "In Dired, display this file or directory in another window." 2586 "In Dired, display this file or directory in another window."
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 9997c1ae7b8..f7a7be96b3d 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -2055,7 +2055,7 @@ See the command `doc-view-mode' for more information on this mode."
2055 :init-value nil :keymap doc-view-presentation-mode-map 2055 :init-value nil :keymap doc-view-presentation-mode-map
2056 (if doc-view-presentation-mode 2056 (if doc-view-presentation-mode
2057 (progn 2057 (progn
2058 (set (make-local-variable 'mode-line-format) nil) 2058 (setq-local mode-line-format nil)
2059 (doc-view-fit-page-to-window) 2059 (doc-view-fit-page-to-window)
2060 ;; (doc-view-convert-all-pages) 2060 ;; (doc-view-convert-all-pages)
2061 ) 2061 )
diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el
index 079fce88def..cf7b28a1e80 100644
--- a/lisp/ebuff-menu.el
+++ b/lisp/ebuff-menu.el
@@ -202,8 +202,7 @@ Electric Buffer Menu mode is a minor mode which is automatically
202enabled and disabled by the \\[electric-buffer-list] command. 202enabled and disabled by the \\[electric-buffer-list] command.
203See the documentation of `electric-buffer-list' for details." 203See the documentation of `electric-buffer-list' for details."
204 (setq mode-line-buffer-identification "Electric Buffer List") 204 (setq mode-line-buffer-identification "Electric Buffer List")
205 (set (make-local-variable 'Helper-return-blurb) 205 (setq-local Helper-return-blurb "return to buffer editing"))
206 "return to buffer editing"))
207 206
208(define-obsolete-function-alias 'Electric-buffer-menu-mode 207(define-obsolete-function-alias 'Electric-buffer-menu-mode
209 'electric-buffer-menu-mode "24.3") 208 'electric-buffer-menu-mode "24.3")
@@ -270,8 +269,8 @@ Return to Electric Buffer Menu when done."
270 (when (derived-mode-p 'electric-buffer-menu-mode) 269 (when (derived-mode-p 'electric-buffer-menu-mode)
271 ;; Make sure we have an overlay to use. 270 ;; Make sure we have an overlay to use.
272 (or electric-buffer-overlay 271 (or electric-buffer-overlay
273 (set (make-local-variable 'electric-buffer-overlay) 272 (setq-local electric-buffer-overlay
274 (make-overlay (point) (point)))) 273 (make-overlay (point) (point))))
275 (move-overlay electric-buffer-overlay 274 (move-overlay electric-buffer-overlay
276 (line-beginning-position) 275 (line-beginning-position)
277 (line-end-position)) 276 (line-end-position))
diff --git a/lisp/edmacro.el b/lisp/edmacro.el
index 44cf5aad387..8ff766cee99 100644
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -151,9 +151,9 @@ With a prefix argument, format the macro in a more concise way."
151 (setq buffer-read-only nil) 151 (setq buffer-read-only nil)
152 (setq major-mode 'edmacro-mode) 152 (setq major-mode 'edmacro-mode)
153 (setq mode-name "Edit Macro") 153 (setq mode-name "Edit Macro")
154 (set (make-local-variable 'edmacro-original-buffer) oldbuf) 154 (setq-local edmacro-original-buffer oldbuf)
155 (set (make-local-variable 'edmacro-finish-hook) finish-hook) 155 (setq-local edmacro-finish-hook finish-hook)
156 (set (make-local-variable 'edmacro-store-hook) store-hook) 156 (setq-local edmacro-store-hook store-hook)
157 (erase-buffer) 157 (erase-buffer)
158 (insert ";; Keyboard Macro Editor. Press C-c C-c to finish; " 158 (insert ";; Keyboard Macro Editor. Press C-c C-c to finish; "
159 "press C-x k RET to cancel.\n") 159 "press C-x k RET to cancel.\n")
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 02da07daaf4..b37b05b9a3a 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -410,8 +410,18 @@ the specializer used will be the one returned by BODY."
410;;;###autoload 410;;;###autoload
411(defmacro cl-defmethod (name args &rest body) 411(defmacro cl-defmethod (name args &rest body)
412 "Define a new method for generic function NAME. 412 "Define a new method for generic function NAME.
413I.e. it defines the implementation of NAME to use for invocations where the 413This it defines an implementation of NAME to use for invocations
414values of the dispatch arguments match the specified TYPEs. 414of specific types of arguments.
415
416ARGS is a list of dispatch arguments (see `cl-defun'), but where
417each variable element is either just a single variable name VAR,
418or a list on the form (VAR TYPE).
419
420For instance:
421
422 (cl-defmethod foo (bar (format-string string) &optional zot)
423 (format format-string bar))
424
415The dispatch arguments have to be among the mandatory arguments, and 425The dispatch arguments have to be among the mandatory arguments, and
416all methods of NAME have to use the same set of arguments for dispatch. 426all methods of NAME have to use the same set of arguments for dispatch.
417Each dispatch argument and TYPE are specified in ARGS where the corresponding 427Each dispatch argument and TYPE are specified in ARGS where the corresponding
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index d81060ef165..6a976841038 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -467,7 +467,6 @@ This holds the results of the last documentation request."
467 467
468(defun eldoc--format-doc-buffer (docs) 468(defun eldoc--format-doc-buffer (docs)
469 "Ensure DOCS are displayed in an *eldoc* buffer." 469 "Ensure DOCS are displayed in an *eldoc* buffer."
470 (interactive (list t))
471 (with-current-buffer (if (buffer-live-p eldoc--doc-buffer) 470 (with-current-buffer (if (buffer-live-p eldoc--doc-buffer)
472 eldoc--doc-buffer 471 eldoc--doc-buffer
473 (setq eldoc--doc-buffer 472 (setq eldoc--doc-buffer
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el
index ef97c8279d7..79b72ff969f 100644
--- a/lisp/emacs-lisp/elint.el
+++ b/lisp/emacs-lisp/elint.el
@@ -558,7 +558,8 @@ Return nil if there are no more forms, t otherwise."
558 (when . elint-check-conditional-form) 558 (when . elint-check-conditional-form)
559 (unless . elint-check-conditional-form) 559 (unless . elint-check-conditional-form)
560 (and . elint-check-conditional-form) 560 (and . elint-check-conditional-form)
561 (or . elint-check-conditional-form)) 561 (or . elint-check-conditional-form)
562 (require . elint-require-form))
562 "Functions to call when some special form should be linted.") 563 "Functions to call when some special form should be linted.")
563 564
564(defun elint-form (form env &optional nohandler) 565(defun elint-form (form env &optional nohandler)
@@ -953,6 +954,13 @@ Does basic handling of `featurep' tests."
953 (elint-form form env t)))) 954 (elint-form form env t))))
954 env) 955 env)
955 956
957(defun elint-require-form (form _env)
958 "Load `require'd files."
959 (pcase form
960 (`(require ',x)
961 (require x)))
962 nil)
963
956;;; 964;;;
957;;; Message functions 965;;; Message functions
958;;; 966;;;
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 5f29c2665a3..25237feae2a 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -274,7 +274,7 @@ DATA is displayed to the user and should state the reason for skipping."
274It should only be stopped when ran from inside ert--run-test-internal." 274It should only be stopped when ran from inside ert--run-test-internal."
275 (when (and (not (symbolp debugger)) ; only run on anonymous debugger 275 (when (and (not (symbolp debugger)) ; only run on anonymous debugger
276 (memq error-symbol '(ert-test-failed ert-test-skipped))) 276 (memq error-symbol '(ert-test-failed ert-test-skipped)))
277 (funcall debugger 'error data))) 277 (funcall debugger 'error (list error-symbol data))))
278 278
279(defun ert--special-operator-p (thing) 279(defun ert--special-operator-p (thing)
280 "Return non-nil if THING is a symbol naming a special operator." 280 "Return non-nil if THING is a symbol naming a special operator."
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 081ef8d441a..e477ef17000 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -38,7 +38,7 @@
38(define-abbrev-table 'lisp-mode-abbrev-table () 38(define-abbrev-table 'lisp-mode-abbrev-table ()
39 "Abbrev table for Lisp mode.") 39 "Abbrev table for Lisp mode.")
40 40
41(defvar lisp--mode-syntax-table 41(defvar lisp-data-mode-syntax-table
42 (let ((table (make-syntax-table)) 42 (let ((table (make-syntax-table))
43 (i 0)) 43 (i 0))
44 (while (< i ?0) 44 (while (< i ?0)
@@ -77,11 +77,13 @@
77 (modify-syntax-entry ?\\ "\\ " table) 77 (modify-syntax-entry ?\\ "\\ " table)
78 (modify-syntax-entry ?\( "() " table) 78 (modify-syntax-entry ?\( "() " table)
79 (modify-syntax-entry ?\) ")( " table) 79 (modify-syntax-entry ?\) ")( " table)
80 (modify-syntax-entry ?\[ "(]" table)
81 (modify-syntax-entry ?\] ")[" table)
80 table) 82 table)
81 "Parent syntax table used in Lisp modes.") 83 "Parent syntax table used in Lisp modes.")
82 84
83(defvar lisp-mode-syntax-table 85(defvar lisp-mode-syntax-table
84 (let ((table (make-syntax-table lisp--mode-syntax-table))) 86 (let ((table (make-syntax-table lisp-data-mode-syntax-table)))
85 (modify-syntax-entry ?\[ "_ " table) 87 (modify-syntax-entry ?\[ "_ " table)
86 (modify-syntax-entry ?\] "_ " table) 88 (modify-syntax-entry ?\] "_ " table)
87 (modify-syntax-entry ?# "' 14" table) 89 (modify-syntax-entry ?# "' 14" table)
@@ -669,7 +671,7 @@ font-lock keywords will not be case sensitive."
669(define-derived-mode lisp-data-mode prog-mode "Lisp-Data" 671(define-derived-mode lisp-data-mode prog-mode "Lisp-Data"
670 "Major mode for buffers holding data written in Lisp syntax." 672 "Major mode for buffers holding data written in Lisp syntax."
671 :group 'lisp 673 :group 'lisp
672 (lisp-mode-variables t t nil) 674 (lisp-mode-variables nil t nil)
673 (setq-local electric-quote-string t) 675 (setq-local electric-quote-string t)
674 (setq imenu-case-fold-search nil)) 676 (setq imenu-case-fold-search nil))
675 677
diff --git a/lisp/emacs-lisp/memory-report.el b/lisp/emacs-lisp/memory-report.el
new file mode 100644
index 00000000000..c88d9f2768a
--- /dev/null
+++ b/lisp/emacs-lisp/memory-report.el
@@ -0,0 +1,301 @@
1;;; memory-report.el --- Short function summaries -*- lexical-binding: t -*-
2
3;; Copyright (C) 2020 Free Software Foundation, Inc.
4
5;; Keywords: lisp, help
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
21
22;;; Commentary:
23
24;; Todo (possibly): Font cache, regexp cache, bidi cache, various
25;; buffer caches (newline cache, free_region_cache, etc), composition
26;; cache, face cache.
27
28;;; Code:
29
30(require 'seq)
31(require 'subr-x)
32(eval-when-compile (require 'cl-lib))
33
34(defvar memory-report--type-size (make-hash-table))
35
36;;;###autoload
37(defun memory-report ()
38 "Generate a report of how Emacs is using memory.
39
40This report is approximate, and will commonly over-count memory
41usage by variables, because shared data structures will usually
42by counted more than once."
43 (interactive)
44 (pop-to-buffer "*Memory Report*")
45 (special-mode)
46 (button-mode 1)
47 (setq truncate-lines t)
48 (message "Gathering data...")
49 (let ((reports (append (memory-report--garbage-collect)
50 (memory-report--image-cache)
51 (memory-report--buffers)
52 (memory-report--largest-variables)))
53 (inhibit-read-only t)
54 summaries details)
55 (message "Gathering data...done")
56 (erase-buffer)
57 (insert (propertize "Estimated Emacs Memory Usage\n\n" 'face 'bold))
58 (dolist (report reports)
59 (if (listp report)
60 (push report summaries)
61 (push report details)))
62 (dolist (summary (seq-sort (lambda (e1 e2)
63 (> (cdr e1) (cdr e2)))
64 summaries))
65 (insert (format "%s %s\n"
66 (memory-report--format (cdr summary))
67 (car summary))))
68 (insert "\n")
69 (dolist (detail (nreverse details))
70 (insert detail "\n")))
71 (goto-char (point-min)))
72
73(defun memory-report-object-size (object)
74 "Return the size of OBJECT in bytes."
75 (unless memory-report--type-size
76 (memory-report--garbage-collect))
77 (memory-report--object-size (make-hash-table :test #'eq) object))
78
79(defun memory-report--size (type)
80 (or (gethash type memory-report--type-size)
81 (gethash 'object memory-report--type-size)))
82
83(defun memory-report--set-size (elems)
84 (setf (gethash 'string memory-report--type-size)
85 (cadr (assq 'strings elems)))
86 (setf (gethash 'cons memory-report--type-size)
87 (cadr (assq 'conses elems)))
88 (setf (gethash 'symbol memory-report--type-size)
89 (cadr (assq 'symbols elems)))
90 (setf (gethash 'object memory-report--type-size)
91 (cadr (assq 'vectors elems)))
92 (setf (gethash 'float memory-report--type-size)
93 (cadr (assq 'floats elems)))
94 (setf (gethash 'buffer memory-report--type-size)
95 (cadr (assq 'buffers elems))))
96
97(defun memory-report--garbage-collect ()
98 (let ((elems (garbage-collect)))
99 (memory-report--set-size elems)
100 (let ((data (list
101 (list 'strings
102 (+ (memory-report--gc-elem elems 'strings)
103 (memory-report--gc-elem elems 'string-bytes)))
104 (list 'vectors
105 (+ (memory-report--gc-elem elems 'vectors)
106 (memory-report--gc-elem elems 'vector-slots)))
107 (list 'floats (memory-report--gc-elem elems 'floats))
108 (list 'conses (memory-report--gc-elem elems 'conses))
109 (list 'symbols (memory-report--gc-elem elems 'symbols))
110 (list 'intervals (memory-report--gc-elem elems 'intervals))
111 (list 'buffer-objects
112 (memory-report--gc-elem elems 'buffers)))))
113 (list (cons "Overall Object Memory Usage"
114 (seq-reduce #'+ (mapcar (lambda (elem)
115 (* (nth 1 elem) (nth 2 elem)))
116 elems)
117 0))
118 (cons "Reserved (But Unused) Object Memory"
119 (seq-reduce #'+ (mapcar (lambda (elem)
120 (if (nth 3 elem)
121 (* (nth 1 elem) (nth 3 elem))
122 0))
123 elems)
124 0))
125 (with-temp-buffer
126 (insert (propertize "Object Storage\n\n" 'face 'bold))
127 (dolist (object (seq-sort (lambda (e1 e2)
128 (> (cadr e1) (cadr e2)))
129 data))
130 (insert (format "%s %s\n"
131 (memory-report--format (cadr object))
132 (capitalize (symbol-name (car object))))))
133 (buffer-string))))))
134
135(defun memory-report--largest-variables ()
136 (let ((variables nil))
137 (mapatoms
138 (lambda (symbol)
139 (when (boundp symbol)
140 (let ((size (memory-report--object-size
141 (make-hash-table :test #'eq)
142 (symbol-value symbol))))
143 (when (> size 1000)
144 (push (cons symbol size) variables)))))
145 obarray)
146 (list
147 (cons (propertize "Memory Used By Global Variables"
148 'help-echo "Upper bound; mutually overlapping data from different variables are counted several times")
149 (seq-reduce #'+ (mapcar #'cdr variables) 0))
150 (with-temp-buffer
151 (insert (propertize "Largest Variables\n\n" 'face 'bold))
152 (cl-loop for i from 1 upto 20
153 for (symbol . size) in (seq-sort (lambda (e1 e2)
154 (> (cdr e1) (cdr e2)))
155 variables)
156 do (insert (memory-report--format size)
157 " "
158 (symbol-name symbol)
159 "\n"))
160 (buffer-string)))))
161
162(defun memory-report--object-size (counted value)
163 (if (gethash value counted)
164 0
165 (setf (gethash value counted) t)
166 (memory-report--object-size-1 counted value)))
167
168(cl-defgeneric memory-report--object-size-1 (_counted _value)
169 0)
170
171(cl-defmethod memory-report--object-size-1 (_ (value symbol))
172 ;; Don't count global symbols -- makes sizes of lists of symbols too
173 ;; heavey.
174 (if (intern-soft value obarray)
175 0
176 (memory-report--size 'symbol)))
177
178(cl-defmethod memory-report--object-size-1 (_ (_value buffer))
179 (memory-report--size 'buffer))
180
181(cl-defmethod memory-report--object-size-1 (counted (value string))
182 (+ (memory-report--size 'string)
183 (string-bytes value)
184 (memory-report--interval-size counted (object-intervals value))))
185
186(defun memory-report--interval-size (counted intervals)
187 ;; We get a list back of intervals, but only count the "inner list"
188 ;; (i.e., the actual text properties), and add the size of the
189 ;; intervals themselves.
190 (+ (* (memory-report--size 'interval) (length intervals))
191 (seq-reduce #'+ (mapcar
192 (lambda (interval)
193 (memory-report--object-size counted (nth 2 interval)))
194 intervals)
195 0)))
196
197(cl-defmethod memory-report--object-size-1 (counted (value list))
198 (let ((total 0)
199 (size (memory-report--size 'cons)))
200 (while value
201 (cl-incf total size)
202 (setf (gethash value counted) t)
203 (when (car value)
204 (cl-incf total (memory-report--object-size counted (car value))))
205 (if (cdr value)
206 (if (consp (cdr value))
207 (setq value (cdr value))
208 (cl-incf total (memory-report--object-size counted (cdr value)))
209 (setq value nil))
210 (setq value nil)))
211 total))
212
213(cl-defmethod memory-report--object-size-1 (counted (value vector))
214 (let ((total (+ (memory-report--size 'vector)
215 (* (memory-report--size 'object) (length value)))))
216 (cl-loop for elem across value
217 do (setf (gethash elem counted) t)
218 (cl-incf total (memory-report--object-size counted elem)))
219 total))
220
221(cl-defmethod memory-report--object-size-1 (counted (value hash-table))
222 (let ((total (+ (memory-report--size 'vector)
223 (* (memory-report--size 'object) (hash-table-size value)))))
224 (maphash
225 (lambda (key elem)
226 (setf (gethash key counted) t)
227 (setf (gethash elem counted) t)
228 (cl-incf total (memory-report--object-size counted key))
229 (cl-incf total (memory-report--object-size counted elem)))
230 value)
231 total))
232
233(defun memory-report--format (bytes)
234 (setq bytes (/ bytes 1024.0))
235 (let ((units '("kB" "MB" "GB" "TB")))
236 (while (>= bytes 1024)
237 (setq bytes (/ bytes 1024.0))
238 (setq units (cdr units)))
239 (format "%6.1f%s" bytes (car units))))
240
241(defun memory-report--gc-elem (elems type)
242 (* (nth 1 (assq type elems))
243 (nth 2 (assq type elems))))
244
245(defun memory-report--buffers ()
246 (let ((buffers (mapcar (lambda (buffer)
247 (cons buffer (memory-report--buffer buffer)))
248 (buffer-list))))
249 (list (cons "Total Buffer Memory Usage"
250 (seq-reduce #'+ (mapcar #'cdr buffers) 0))
251 (with-temp-buffer
252 (insert (propertize "Largest Buffers\n\n" 'face 'bold))
253 (cl-loop for i from 1 upto 20
254 for (buffer . size) in (seq-sort (lambda (e1 e2)
255 (> (cdr e1) (cdr e2)))
256 buffers)
257 do (insert (memory-report--format size)
258 " "
259 (button-buttonize
260 (buffer-name buffer)
261 #'memory-report--buffer-details buffer)
262 "\n"))
263 (buffer-string)))))
264
265(defun memory-report--buffer-details (buffer)
266 (with-current-buffer buffer
267 (apply
268 #'message
269 "Buffer text: %s; variables: %s; text properties: %s; overlays: %s"
270 (mapcar #'string-trim (mapcar #'memory-report--format
271 (memory-report--buffer-data buffer))))))
272
273(defun memory-report--buffer (buffer)
274 (seq-reduce #'+ (memory-report--buffer-data buffer) 0))
275
276(defun memory-report--buffer-data (buffer)
277 (with-current-buffer buffer
278 (list (save-restriction
279 (widen)
280 (+ (position-bytes (point-max))
281 (- (position-bytes (point-min)))
282 (gap-size)))
283 (seq-reduce #'+ (mapcar (lambda (elem)
284 (if (cdr elem)
285 (memory-report--object-size
286 (make-hash-table :test #'eq)
287 (cdr elem))
288 0))
289 (buffer-local-variables buffer))
290 0)
291 (memory-report--object-size (make-hash-table :test #'eq)
292 (object-intervals buffer))
293 (memory-report--object-size (make-hash-table :test #'eq)
294 (overlay-lists)))))
295
296(defun memory-report--image-cache ()
297 (list (cons "Total Image Cache Size" (image-cache-size))))
298
299(provide 'memory-report)
300
301;;; memory-report.el ends here
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index e603900b095..206f0dd1a9d 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -409,7 +409,8 @@ of the elements of LIST is performed as if by `pcase-let'.
409 (dolist (case cases) 409 (dolist (case cases)
410 (unless (or (memq case used-cases) 410 (unless (or (memq case used-cases)
411 (memq (car case) pcase--dontwarn-upats)) 411 (memq (car case) pcase--dontwarn-upats))
412 (message "Redundant pcase pattern: %S" (car case)))) 412 (message "pcase pattern %S shadowed by previous pcase pattern"
413 (car case))))
413 (macroexp-let* defs main)))) 414 (macroexp-let* defs main))))
414 415
415(defun pcase--macroexpand (pat) 416(defun pcase--macroexpand (pat)
diff --git a/lisp/emacs-lisp/thunk.el b/lisp/emacs-lisp/thunk.el
index c8e483e9a4a..cd42152527e 100644
--- a/lisp/emacs-lisp/thunk.el
+++ b/lisp/emacs-lisp/thunk.el
@@ -122,7 +122,7 @@ Using `thunk-let' and `thunk-let*' requires `lexical-binding'."
122 (declare (indent 1) (debug let)) 122 (declare (indent 1) (debug let))
123 (cl-reduce 123 (cl-reduce
124 (lambda (expr binding) `(thunk-let (,binding) ,expr)) 124 (lambda (expr binding) `(thunk-let (,binding) ,expr))
125 (nreverse bindings) 125 (reverse bindings)
126 :initial-value (macroexp-progn body))) 126 :initial-value (macroexp-progn body)))
127 127
128;; (defalias 'lazy-let #'thunk-let) 128;; (defalias 'lazy-let #'thunk-let)
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index 7fd41784746..21dc1ebaff0 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -309,7 +309,8 @@ encryption is used."
309If no one is selected, symmetric encryption will be performed. " 309If no one is selected, symmetric encryption will be performed. "
310 recipients) 310 recipients)
311 (if epa-file-encrypt-to 311 (if epa-file-encrypt-to
312 (epg-list-keys context recipients))))) 312 (epg--filter-revoked-keys
313 (epg-list-keys context recipients))))))
313 (error 314 (error
314 (epa-display-error context) 315 (epa-display-error context)
315 (if (setq entry (assoc file epa-file-passphrase-alist)) 316 (if (setq entry (assoc file epa-file-passphrase-alist))
diff --git a/lisp/epg.el b/lisp/epg.el
index 920b85398f3..b27e2c638c2 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -1382,6 +1382,13 @@ NAME is either a string or a list of strings."
1382 (setq pointer (cdr pointer))) 1382 (setq pointer (cdr pointer)))
1383 keys)) 1383 keys))
1384 1384
1385(defun epg--filter-revoked-keys (keys)
1386 (seq-remove (lambda (key)
1387 (seq-find (lambda (user)
1388 (eq (epg-user-id-validity user) 'revoked))
1389 (epg-key-user-id-list key)))
1390 keys))
1391
1385(defun epg--args-from-sig-notations (notations) 1392(defun epg--args-from-sig-notations (notations)
1386 (apply #'nconc 1393 (apply #'nconc
1387 (mapcar 1394 (mapcar
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 4ccd463aff2..13bbb5284a3 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -446,7 +446,7 @@ local, and sets it to FACE."
446 (setq specs (car specs))) 446 (setq specs (car specs)))
447 (if (null specs) 447 (if (null specs)
448 (buffer-face-mode 0) 448 (buffer-face-mode 0)
449 (set (make-local-variable 'buffer-face-mode-face) specs) 449 (setq-local buffer-face-mode-face specs)
450 (buffer-face-mode t))) 450 (buffer-face-mode t)))
451 451
452;;;###autoload 452;;;###autoload
@@ -470,7 +470,7 @@ buffer local, and set it to SPECS."
470 (if (or (null specs) 470 (if (or (null specs)
471 (and buffer-face-mode (equal buffer-face-mode-face specs))) 471 (and buffer-face-mode (equal buffer-face-mode-face specs)))
472 (buffer-face-mode 0) 472 (buffer-face-mode 0)
473 (set (make-local-variable 'buffer-face-mode-face) specs) 473 (setq-local buffer-face-mode-face specs)
474 (buffer-face-mode t))) 474 (buffer-face-mode t)))
475 475
476(defun buffer-face-mode-invoke (specs arg &optional interactive) 476(defun buffer-face-mode-invoke (specs arg &optional interactive)
diff --git a/lisp/files.el b/lisp/files.el
index a20182790fa..bb37bc69d88 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -597,7 +597,7 @@ settings being applied, but still respect file-local ones.")
597 597
598;; This is an odd variable IMO. 598;; This is an odd variable IMO.
599;; You might wonder why it is needed, when we could just do: 599;; You might wonder why it is needed, when we could just do:
600;; (set (make-local-variable 'enable-local-variables) nil) 600;; (setq-local enable-local-variables nil)
601;; These two are not precisely the same. 601;; These two are not precisely the same.
602;; Setting this variable does not cause -*- mode settings to be 602;; Setting this variable does not cause -*- mode settings to be
603;; ignored, whereas setting enable-local-variables does. 603;; ignored, whereas setting enable-local-variables does.
@@ -2424,9 +2424,7 @@ Do you want to revisit the file normally now? ")))
2424 ;; this is a permanent local, the major mode won't eliminate it. 2424 ;; this is a permanent local, the major mode won't eliminate it.
2425 (and backup-enable-predicate 2425 (and backup-enable-predicate
2426 (not (funcall backup-enable-predicate buffer-file-name)) 2426 (not (funcall backup-enable-predicate buffer-file-name))
2427 (progn 2427 (setq-local backup-inhibited t))
2428 (make-local-variable 'backup-inhibited)
2429 (setq backup-inhibited t)))
2430 (if rawfile 2428 (if rawfile
2431 (progn 2429 (progn
2432 (set-buffer-multibyte nil) 2430 (set-buffer-multibyte nil)
@@ -3525,7 +3523,7 @@ n -- to ignore the local variables list.")
3525 (let ((print-escape-newlines t)) 3523 (let ((print-escape-newlines t))
3526 (prin1 (cdr elt) buf)) 3524 (prin1 (cdr elt) buf))
3527 (insert "\n")) 3525 (insert "\n"))
3528 (set (make-local-variable 'cursor-type) nil) 3526 (setq-local cursor-type nil)
3529 (set-buffer-modified-p nil) 3527 (set-buffer-modified-p nil)
3530 (goto-char (point-min))) 3528 (goto-char (point-min)))
3531 3529
@@ -4497,9 +4495,7 @@ the old visited file has been renamed to the new name FILENAME."
4497 (and buffer-file-name 4495 (and buffer-file-name
4498 backup-enable-predicate 4496 backup-enable-predicate
4499 (not (funcall backup-enable-predicate buffer-file-name)) 4497 (not (funcall backup-enable-predicate buffer-file-name))
4500 (progn 4498 (setq-local backup-inhibited t))
4501 (make-local-variable 'backup-inhibited)
4502 (setq backup-inhibited t)))
4503 (let ((oauto buffer-auto-save-file-name)) 4499 (let ((oauto buffer-auto-save-file-name))
4504 (cond ((null filename) 4500 (cond ((null filename)
4505 (setq buffer-auto-save-file-name nil)) 4501 (setq buffer-auto-save-file-name nil))
@@ -6128,6 +6124,9 @@ This undoes all changes since the file was visited or saved.
6128With a prefix argument, offer to revert from latest auto-save file, if 6124With a prefix argument, offer to revert from latest auto-save file, if
6129that is more recent than the visited file. 6125that is more recent than the visited file.
6130 6126
6127Reverting a buffer will try to preserve markers in the buffer;
6128see the Info node `(elisp)Reverting' for details.
6129
6131This command also implements an interface for special buffers 6130This command also implements an interface for special buffers
6132that contain text that doesn't come from a file, but reflects 6131that contain text that doesn't come from a file, but reflects
6133some other data instead (e.g. Dired buffers, `buffer-list' 6132some other data instead (e.g. Dired buffers, `buffer-list'
@@ -6224,7 +6223,7 @@ Non-file buffers need a custom function."
6224 ;; Run after-revert-hook as it was before we reverted. 6223 ;; Run after-revert-hook as it was before we reverted.
6225 (setq-default revert-buffer-internal-hook global-hook) 6224 (setq-default revert-buffer-internal-hook global-hook)
6226 (if local-hook 6225 (if local-hook
6227 (set (make-local-variable 'revert-buffer-internal-hook) 6226 (setq-local revert-buffer-internal-hook
6228 local-hook) 6227 local-hook)
6229 (kill-local-variable 'revert-buffer-internal-hook)) 6228 (kill-local-variable 'revert-buffer-internal-hook))
6230 (run-hooks 'revert-buffer-internal-hook)) 6229 (run-hooks 'revert-buffer-internal-hook))
diff --git a/lisp/filesets.el b/lisp/filesets.el
index 883871c4d80..62dc5a54d53 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -1336,8 +1336,7 @@ Use the viewer defined in EV-ENTRY (a valid element of
1336 (progn 1336 (progn
1337 (switch-to-buffer (format "Filesets: %s %s" vwr file)) 1337 (switch-to-buffer (format "Filesets: %s %s" vwr file))
1338 (insert output) 1338 (insert output)
1339 (make-local-variable 'filesets-output-buffer-flag) 1339 (setq-local filesets-output-buffer-flag t)
1340 (setq filesets-output-buffer-flag t)
1341 (set-visited-file-name file t) 1340 (set-visited-file-name file t)
1342 (when oh 1341 (when oh
1343 (run-hooks 'oh)) 1342 (run-hooks 'oh))
diff --git a/lisp/find-dired.el b/lisp/find-dired.el
index 18330d821ce..d2b82bdd51c 100644
--- a/lisp/find-dired.el
+++ b/lisp/find-dired.el
@@ -223,11 +223,10 @@ it finishes, type \\[kill-find]."
223 (set-keymap-parent map (current-local-map)) 223 (set-keymap-parent map (current-local-map))
224 (define-key map "\C-c\C-k" 'kill-find) 224 (define-key map "\C-c\C-k" 'kill-find)
225 (use-local-map map)) 225 (use-local-map map))
226 (make-local-variable 'dired-sort-inhibit) 226 (setq-local dired-sort-inhibit t)
227 (setq dired-sort-inhibit t) 227 (setq-local revert-buffer-function
228 (set (make-local-variable 'revert-buffer-function) 228 `(lambda (ignore-auto noconfirm)
229 `(lambda (ignore-auto noconfirm) 229 (find-dired ,dir ,find-args)))
230 (find-dired ,dir ,find-args)))
231 ;; Set subdir-alist so that Tree Dired will work: 230 ;; Set subdir-alist so that Tree Dired will work:
232 (if (fboundp 'dired-simple-subdir-alist) 231 (if (fboundp 'dired-simple-subdir-alist)
233 ;; will work even with nested dired format (dired-nstd.el,v 1.15 232 ;; will work even with nested dired format (dired-nstd.el,v 1.15
@@ -235,9 +234,9 @@ it finishes, type \\[kill-find]."
235 (dired-simple-subdir-alist) 234 (dired-simple-subdir-alist)
236 ;; else we have an ancient tree dired (or classic dired, where 235 ;; else we have an ancient tree dired (or classic dired, where
237 ;; this does no harm) 236 ;; this does no harm)
238 (set (make-local-variable 'dired-subdir-alist) 237 (setq-local dired-subdir-alist
239 (list (cons default-directory (point-min-marker))))) 238 (list (cons default-directory (point-min-marker)))))
240 (set (make-local-variable 'dired-subdir-switches) find-ls-subdir-switches) 239 (setq-local dired-subdir-switches find-ls-subdir-switches)
241 (setq buffer-read-only nil) 240 (setq buffer-read-only nil)
242 ;; Subdir headlerline must come first because the first marker in 241 ;; Subdir headlerline must come first because the first marker in
243 ;; subdir-alist points there. 242 ;; subdir-alist points there.
diff --git a/lisp/find-lisp.el b/lisp/find-lisp.el
index c1be5ff403d..44a2e6d7371 100644
--- a/lisp/find-lisp.el
+++ b/lisp/find-lisp.el
@@ -212,21 +212,17 @@ It is a function which takes two arguments, the directory and its parent."
212 212
213 (use-local-map (append (make-sparse-keymap) (current-local-map))) 213 (use-local-map (append (make-sparse-keymap) (current-local-map)))
214 214
215 (make-local-variable 'find-lisp-file-predicate) 215 (setq-local find-lisp-file-predicate file-predicate)
216 (setq find-lisp-file-predicate file-predicate) 216 (setq-local find-lisp-directory-predicate directory-predicate)
217 (make-local-variable 'find-lisp-directory-predicate) 217 (setq-local find-lisp-regexp regexp)
218 (setq find-lisp-directory-predicate directory-predicate) 218
219 (make-local-variable 'find-lisp-regexp) 219 (setq-local revert-buffer-function
220 (setq find-lisp-regexp regexp) 220 (lambda (_ignore1 _ignore2)
221 221 (find-lisp-insert-directory
222 (make-local-variable 'revert-buffer-function) 222 default-directory
223 (setq revert-buffer-function 223 find-lisp-file-predicate
224 (lambda (_ignore1 _ignore2) 224 find-lisp-directory-predicate
225 (find-lisp-insert-directory 225 'ignore)))
226 default-directory
227 find-lisp-file-predicate
228 find-lisp-directory-predicate
229 'ignore)))
230 226
231 ;; Set subdir-alist so that Tree Dired will work: 227 ;; Set subdir-alist so that Tree Dired will work:
232 (if (fboundp 'dired-simple-subdir-alist) 228 (if (fboundp 'dired-simple-subdir-alist)
@@ -235,8 +231,8 @@ It is a function which takes two arguments, the directory and its parent."
235 (dired-simple-subdir-alist) 231 (dired-simple-subdir-alist)
236 ;; else we have an ancient tree dired (or classic dired, where 232 ;; else we have an ancient tree dired (or classic dired, where
237 ;; this does no harm) 233 ;; this does no harm)
238 (set (make-local-variable 'dired-subdir-alist) 234 (setq-local dired-subdir-alist
239 (list (cons default-directory (point-min-marker))))) 235 (list (cons default-directory (point-min-marker)))))
240 (find-lisp-insert-directory 236 (find-lisp-insert-directory
241 dir file-predicate directory-predicate 'ignore) 237 dir file-predicate directory-predicate 'ignore)
242 (goto-char (point-min)) 238 (goto-char (point-min))
diff --git a/lisp/finder.el b/lisp/finder.el
index a59a185cc9b..98859f6a395 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -448,7 +448,7 @@ FILE should be in a form suitable for passing to `locate-library'."
448 :syntax-table finder-mode-syntax-table 448 :syntax-table finder-mode-syntax-table
449 (setq buffer-read-only t 449 (setq buffer-read-only t
450 buffer-undo-list t) 450 buffer-undo-list t)
451 (set (make-local-variable 'finder-headmark) nil)) 451 (setq-local finder-headmark nil))
452 452
453(defun finder-summary () 453(defun finder-summary ()
454 "Summarize basic Finder commands." 454 "Summarize basic Finder commands."
diff --git a/lisp/font-core.el b/lisp/font-core.el
index 098253eb162..1b15d8cd30e 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -160,8 +160,8 @@ this function onto `change-major-mode-hook'."
160(defun font-lock-default-function (mode) 160(defun font-lock-default-function (mode)
161 ;; Turn on Font Lock mode. 161 ;; Turn on Font Lock mode.
162 (when mode 162 (when mode
163 (set (make-local-variable 'char-property-alias-alist) 163 (setq-local char-property-alias-alist
164 (copy-tree char-property-alias-alist)) 164 (copy-tree char-property-alias-alist))
165 ;; Add `font-lock-face' as an alias for the `face' property. 165 ;; Add `font-lock-face' as an alias for the `face' property.
166 (let ((elt (assq 'face char-property-alias-alist))) 166 (let ((elt (assq 'face char-property-alias-alist)))
167 (if elt 167 (if elt
@@ -171,8 +171,8 @@ this function onto `change-major-mode-hook'."
171 ;; Turn off Font Lock mode. 171 ;; Turn off Font Lock mode.
172 (unless mode 172 (unless mode
173 ;; Remove `font-lock-face' as an alias for the `face' property. 173 ;; Remove `font-lock-face' as an alias for the `face' property.
174 (set (make-local-variable 'char-property-alias-alist) 174 (setq-local char-property-alias-alist
175 (copy-tree char-property-alias-alist)) 175 (copy-tree char-property-alias-alist))
176 (let ((elt (assq 'face char-property-alias-alist))) 176 (let ((elt (assq 'face char-property-alias-alist)))
177 (when elt 177 (when elt
178 (setcdr elt (remq 'font-lock-face (cdr elt))) 178 (setcdr elt (remq 'font-lock-face (cdr elt)))
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index e708e69bd59..0e771e8e0a5 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -152,8 +152,8 @@
152;; 152;;
153;; (add-hook 'foo-mode-hook 153;; (add-hook 'foo-mode-hook
154;; (lambda () 154;; (lambda ()
155;; (set (make-local-variable 'font-lock-defaults) 155;; (setq-local font-lock-defaults
156;; '(foo-font-lock-keywords t)))) 156;; '(foo-font-lock-keywords t))))
157 157
158;;;; Adding Font Lock support for modes: 158;;;; Adding Font Lock support for modes:
159 159
@@ -173,8 +173,8 @@
173;; 173;;
174;; and within `bar-mode' there could be: 174;; and within `bar-mode' there could be:
175;; 175;;
176;; (set (make-local-variable 'font-lock-defaults) 176;; (setq-local font-lock-defaults
177;; '(bar-font-lock-keywords nil t)) 177;; '(bar-font-lock-keywords nil t))
178 178
179;; What is fontification for? You might say, "It's to make my code look nice." 179;; What is fontification for? You might say, "It's to make my code look nice."
180;; I think it should be for adding information in the form of cues. These cues 180;; 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',
733 ;; font-lock-mode it only enabled the font-core.el part, not the 733 ;; font-lock-mode it only enabled the font-core.el part, not the
734 ;; font-lock-mode-internal. Try again. 734 ;; font-lock-mode-internal. Try again.
735 (font-lock-mode -1) 735 (font-lock-mode -1)
736 (set (make-local-variable 'font-lock-defaults) '(nil t)) 736 (setq-local font-lock-defaults '(nil t))
737 (font-lock-mode 1)) 737 (font-lock-mode 1))
738 ;; Otherwise set or add the keywords now. 738 ;; Otherwise set or add the keywords now.
739 ;; This is a no-op if it has been done already in this buffer 739 ;; 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."
933 ;; Prepare for jit-lock 933 ;; Prepare for jit-lock
934 (remove-hook 'after-change-functions 934 (remove-hook 'after-change-functions
935 #'font-lock-after-change-function t) 935 #'font-lock-after-change-function t)
936 (set (make-local-variable 'font-lock-flush-function) 936 (setq-local font-lock-flush-function #'jit-lock-refontify)
937 #'jit-lock-refontify) 937 (setq-local font-lock-ensure-function #'jit-lock-fontify-now)
938 (set (make-local-variable 'font-lock-ensure-function)
939 #'jit-lock-fontify-now)
940 ;; Prevent font-lock-fontify-buffer from fontifying eagerly the whole 938 ;; Prevent font-lock-fontify-buffer from fontifying eagerly the whole
941 ;; buffer. This is important for things like CWarn mode which 939 ;; buffer. This is important for things like CWarn mode which
942 ;; adds/removes a few keywords and does a refontify (which takes ages on 940 ;; adds/removes a few keywords and does a refontify (which takes ages on
943 ;; large files). 941 ;; large files).
944 (set (make-local-variable 'font-lock-fontify-buffer-function) 942 (setq-local font-lock-fontify-buffer-function #'jit-lock-refontify)
945 #'jit-lock-refontify)
946 ;; Don't fontify eagerly (and don't abort if the buffer is large). 943 ;; Don't fontify eagerly (and don't abort if the buffer is large).
947 (set (make-local-variable 'font-lock-fontified) t) 944 (setq-local font-lock-fontified t)
948 ;; Use jit-lock. 945 ;; Use jit-lock.
949 (jit-lock-register #'font-lock-fontify-region 946 (jit-lock-register #'font-lock-fontify-region
950 (not font-lock-keywords-only)) 947 (not font-lock-keywords-only))
@@ -1558,7 +1555,7 @@ START should be at the beginning of a line."
1558 (unless parse-sexp-lookup-properties 1555 (unless parse-sexp-lookup-properties
1559 ;; We wouldn't go through so much trouble if we didn't intend to use those 1556 ;; We wouldn't go through so much trouble if we didn't intend to use those
1560 ;; properties, would we? 1557 ;; properties, would we?
1561 (set (make-local-variable 'parse-sexp-lookup-properties) t)) 1558 (setq-local parse-sexp-lookup-properties t))
1562 ;; If `font-lock-syntactic-keywords' is a symbol, get the real keywords. 1559 ;; If `font-lock-syntactic-keywords' is a symbol, get the real keywords.
1563 (when (symbolp font-lock-syntactic-keywords) 1560 (when (symbolp font-lock-syntactic-keywords)
1564 (setq font-lock-syntactic-keywords (font-lock-eval-keywords 1561 (setq font-lock-syntactic-keywords (font-lock-eval-keywords
@@ -1942,8 +1939,8 @@ Sets various variables using `font-lock-defaults' and
1942 (set (make-local-variable (car x)) (cdr x))) 1939 (set (make-local-variable (car x)) (cdr x)))
1943 ;; Set up `font-lock-keywords' last because its value might depend 1940 ;; Set up `font-lock-keywords' last because its value might depend
1944 ;; on other settings. 1941 ;; on other settings.
1945 (set (make-local-variable 'font-lock-keywords) 1942 (setq-local font-lock-keywords
1946 (font-lock-eval-keywords keywords)) 1943 (font-lock-eval-keywords keywords))
1947 ;; Local fontification? 1944 ;; Local fontification?
1948 (while local 1945 (while local
1949 (font-lock-add-keywords nil (car (car local)) (cdr (car local))) 1946 (font-lock-add-keywords nil (car (car local)) (cdr (car local)))
diff --git a/lisp/format.el b/lisp/format.el
index 905ca2d9ec9..16456eb5877 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -237,9 +237,8 @@ For most purposes, consider using `format-encode-region' instead."
237 ;; delete the buffer once the write is done, but do 237 ;; delete the buffer once the write is done, but do
238 ;; it after running to-fn so it doesn't affect 238 ;; it after running to-fn so it doesn't affect
239 ;; write-region calls in to-fn. 239 ;; write-region calls in to-fn.
240 (set (make-local-variable 240 (setq-local write-region-post-annotation-function
241 'write-region-post-annotation-function) 241 #'kill-buffer)))
242 'kill-buffer)))
243 nil) 242 nil)
244 ;; Otherwise just call function, it will return annotations. 243 ;; Otherwise just call function, it will return annotations.
245 (funcall to-fn from to orig-buf))))) 244 (funcall to-fn from to orig-buf)))))
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 053e7ea1f6b..d6802a35d0c 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -454,7 +454,7 @@ manipulated as follows:
454 (symbol-name major-mode)) 454 (symbol-name major-mode))
455 (match-string 1 (symbol-name major-mode)))) 455 (match-string 1 (symbol-name major-mode))))
456 (mode (intern (format "gnus-agent-%s-mode" buffer)))) 456 (mode (intern (format "gnus-agent-%s-mode" buffer))))
457 (set (make-local-variable 'gnus-agent-mode) t) 457 (setq-local gnus-agent-mode t)
458 (set mode nil) 458 (set mode nil)
459 (set (make-local-variable mode) t) 459 (set (make-local-variable mode) t)
460 ;; Set up the menu. 460 ;; Set up the menu.
@@ -1056,8 +1056,8 @@ article's mark is toggled."
1056(defun gnus-agent-get-undownloaded-list () 1056(defun gnus-agent-get-undownloaded-list ()
1057 "Construct list of articles that have not been downloaded." 1057 "Construct list of articles that have not been downloaded."
1058 (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name))) 1058 (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name)))
1059 (when (set (make-local-variable 'gnus-newsgroup-agentized) 1059 (when (setq-local gnus-newsgroup-agentized
1060 (gnus-agent-method-p gnus-command-method)) 1060 (gnus-agent-method-p gnus-command-method))
1061 (let* ((alist (gnus-agent-load-alist gnus-newsgroup-name)) 1061 (let* ((alist (gnus-agent-load-alist gnus-newsgroup-name))
1062 (headers (sort (mapcar (lambda (h) 1062 (headers (sort (mapcar (lambda (h)
1063 (mail-header-number h)) 1063 (mail-header-number h))
@@ -1440,7 +1440,7 @@ downloaded into the agent."
1440 (let ((file (gnus-agent-lib-file "history"))) 1440 (let ((file (gnus-agent-lib-file "history")))
1441 (when (file-exists-p file) 1441 (when (file-exists-p file)
1442 (nnheader-insert-file-contents file)) 1442 (nnheader-insert-file-contents file))
1443 (set (make-local-variable 'gnus-agent-file-name) file)))) 1443 (setq-local gnus-agent-file-name file))))
1444 1444
1445(defun gnus-agent-close-history () 1445(defun gnus-agent-close-history ()
1446 (when (gnus-buffer-live-p gnus-agent-current-history) 1446 (when (gnus-buffer-live-p gnus-agent-current-history)
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 7f594c9c360..5b50bcbbe1f 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -3850,8 +3850,7 @@ This format is defined by the `gnus-article-time-format' variable."
3850 (unless gnus-article-emphasis-alist 3850 (unless gnus-article-emphasis-alist
3851 (let ((name (and gnus-newsgroup-name 3851 (let ((name (and gnus-newsgroup-name
3852 (gnus-group-real-name gnus-newsgroup-name)))) 3852 (gnus-group-real-name gnus-newsgroup-name))))
3853 (make-local-variable 'gnus-article-emphasis-alist) 3853 (setq-local gnus-article-emphasis-alist
3854 (setq gnus-article-emphasis-alist
3855 (nconc 3854 (nconc
3856 (let ((alist gnus-group-highlight-words-alist) elem highlight) 3855 (let ((alist gnus-group-highlight-words-alist) elem highlight)
3857 (while (setq elem (pop alist)) 3856 (while (setq elem (pop alist))
@@ -4495,10 +4494,10 @@ commands:
4495 (when (gnus-visual-p 'article-menu 'menu) 4494 (when (gnus-visual-p 'article-menu 'menu)
4496 (gnus-article-make-menu-bar) 4495 (gnus-article-make-menu-bar)
4497 (when gnus-summary-tool-bar-map 4496 (when gnus-summary-tool-bar-map
4498 (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map))) 4497 (setq-local tool-bar-map gnus-summary-tool-bar-map)))
4499 (gnus-update-format-specifications nil 'article-mode) 4498 (gnus-update-format-specifications nil 'article-mode)
4500 (set (make-local-variable 'page-delimiter) gnus-page-delimiter) 4499 (setq-local page-delimiter gnus-page-delimiter)
4501 (set (make-local-variable 'gnus-page-broken) nil) 4500 (setq-local gnus-page-broken nil)
4502 (make-local-variable 'gnus-article-current-summary) 4501 (make-local-variable 'gnus-article-current-summary)
4503 (make-local-variable 'gnus-article-mime-handles) 4502 (make-local-variable 'gnus-article-mime-handles)
4504 (make-local-variable 'gnus-article-decoded-p) 4503 (make-local-variable 'gnus-article-decoded-p)
@@ -4507,13 +4506,12 @@ commands:
4507 (make-local-variable 'gnus-article-image-alist) 4506 (make-local-variable 'gnus-article-image-alist)
4508 (make-local-variable 'gnus-article-charset) 4507 (make-local-variable 'gnus-article-charset)
4509 (make-local-variable 'gnus-article-ignored-charsets) 4508 (make-local-variable 'gnus-article-ignored-charsets)
4510 (set (make-local-variable 'bookmark-make-record-function) 4509 (setq-local bookmark-make-record-function 'gnus-summary-bookmark-make-record)
4511 'gnus-summary-bookmark-make-record)
4512 ;; Prevent Emacs from displaying non-break space with 4510 ;; Prevent Emacs from displaying non-break space with
4513 ;; `nobreak-space' face. 4511 ;; `nobreak-space' face.
4514 (set (make-local-variable 'nobreak-char-display) nil) 4512 (setq-local nobreak-char-display nil)
4515 ;; Enable `gnus-article-remove-images' to delete images shr.el renders. 4513 ;; Enable `gnus-article-remove-images' to delete images shr.el renders.
4516 (set (make-local-variable 'shr-put-image-function) 'gnus-shr-put-image) 4514 (setq-local shr-put-image-function 'gnus-shr-put-image)
4517 (unless gnus-article-show-cursor 4515 (unless gnus-article-show-cursor
4518 (setq cursor-in-non-selected-windows nil)) 4516 (setq cursor-in-non-selected-windows nil))
4519 (gnus-set-default-directory) 4517 (gnus-set-default-directory)
@@ -4557,7 +4555,7 @@ commands:
4557 t))) 4555 t)))
4558 (let ((summary gnus-summary-buffer)) 4556 (let ((summary gnus-summary-buffer))
4559 (with-current-buffer name 4557 (with-current-buffer name
4560 (set (make-local-variable 'gnus-article-edit-mode) nil) 4558 (setq-local gnus-article-edit-mode nil)
4561 (gnus-article-stop-animations) 4559 (gnus-article-stop-animations)
4562 (when gnus-article-mime-handles 4560 (when gnus-article-mime-handles
4563 (mm-destroy-parts gnus-article-mime-handles) 4561 (mm-destroy-parts gnus-article-mime-handles)
@@ -4568,14 +4566,14 @@ commands:
4568 (setq buffer-read-only t) 4566 (setq buffer-read-only t)
4569 (unless (derived-mode-p 'gnus-article-mode) 4567 (unless (derived-mode-p 'gnus-article-mode)
4570 (gnus-article-mode)) 4568 (gnus-article-mode))
4571 (set (make-local-variable 'gnus-summary-buffer) summary) 4569 (setq-local gnus-summary-buffer summary)
4572 (setq truncate-lines gnus-article-truncate-lines) 4570 (setq truncate-lines gnus-article-truncate-lines)
4573 (current-buffer))) 4571 (current-buffer)))
4574 (let ((summary gnus-summary-buffer)) 4572 (let ((summary gnus-summary-buffer))
4575 (with-current-buffer (gnus-get-buffer-create name) 4573 (with-current-buffer (gnus-get-buffer-create name)
4576 (gnus-article-mode) 4574 (gnus-article-mode)
4577 (setq truncate-lines gnus-article-truncate-lines) 4575 (setq truncate-lines gnus-article-truncate-lines)
4578 (set (make-local-variable 'gnus-summary-buffer) summary) 4576 (setq-local gnus-summary-buffer summary)
4579 (gnus-summary-set-local-parameters gnus-newsgroup-name) 4577 (gnus-summary-set-local-parameters gnus-newsgroup-name)
4580 (when article-lapsed-timer 4578 (when article-lapsed-timer
4581 (gnus-stop-date-timer)) 4579 (gnus-stop-date-timer))
@@ -5036,7 +5034,7 @@ and `gnus-mime-delete-part', and not provided at run-time normally."
5036 (setq gnus-article-mime-handles nil) 5034 (setq gnus-article-mime-handles nil)
5037 (let ((mbl1 mml-buffer-list)) 5035 (let ((mbl1 mml-buffer-list))
5038 (setq mml-buffer-list mbl) 5036 (setq mml-buffer-list mbl)
5039 (set (make-local-variable 'mml-buffer-list) mbl1)) 5037 (setq-local mml-buffer-list mbl1))
5040 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))) 5038 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))
5041 `(lambda (no-highlight) 5039 `(lambda (no-highlight)
5042 (let ((mail-parse-charset (or gnus-article-charset 5040 (let ((mail-parse-charset (or gnus-article-charset
@@ -6902,8 +6900,8 @@ then we display only bindings that start with that prefix."
6902 (setq draft gnus-draft-mode))) 6900 (setq draft gnus-draft-mode)))
6903 (with-temp-buffer 6901 (with-temp-buffer
6904 (use-local-map keymap) 6902 (use-local-map keymap)
6905 (set (make-local-variable 'gnus-agent-summary-mode) agent) 6903 (setq-local gnus-agent-summary-mode agent)
6906 (set (make-local-variable 'gnus-draft-mode) draft) 6904 (setq-local gnus-draft-mode draft)
6907 (describe-bindings prefix)) 6905 (describe-bindings prefix))
6908 (let ((item `((lambda (prefix) 6906 (let ((item `((lambda (prefix)
6909 (with-current-buffer ,(current-buffer) 6907 (with-current-buffer ,(current-buffer)
@@ -7247,10 +7245,9 @@ This is an extended text-mode.
7247\\{gnus-article-edit-mode-map}" 7245\\{gnus-article-edit-mode-map}"
7248 (make-local-variable 'gnus-article-edit-done-function) 7246 (make-local-variable 'gnus-article-edit-done-function)
7249 (make-local-variable 'gnus-prev-winconf) 7247 (make-local-variable 'gnus-prev-winconf)
7250 (set (make-local-variable 'font-lock-defaults) 7248 (setq-local font-lock-defaults '(message-font-lock-keywords t))
7251 '(message-font-lock-keywords t)) 7249 (setq-local mail-header-separator "")
7252 (set (make-local-variable 'mail-header-separator) "") 7250 (setq-local gnus-article-edit-mode t)
7253 (set (make-local-variable 'gnus-article-edit-mode) t)
7254 (mml-mode) 7251 (mml-mode)
7255 (setq buffer-read-only nil) 7252 (setq buffer-read-only nil)
7256 (buffer-enable-undo) 7253 (buffer-enable-undo)
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el
index f0c4d07ca93..d832d0ebae1 100644
--- a/lisp/gnus/gnus-cus.el
+++ b/lisp/gnus/gnus-cus.el
@@ -49,18 +49,15 @@ if that value is non-nil."
49 ;; Emacs stuff: 49 ;; Emacs stuff:
50 (when (and (facep 'custom-button-face) 50 (when (and (facep 'custom-button-face)
51 (facep 'custom-button-pressed-face)) 51 (facep 'custom-button-pressed-face))
52 (set (make-local-variable 'widget-button-face) 52 (setq-local widget-button-face 'custom-button-face)
53 'custom-button-face) 53 (setq-local widget-button-pressed-face 'custom-button-pressed-face)
54 (set (make-local-variable 'widget-button-pressed-face) 54 (setq-local widget-mouse-face 'custom-button-pressed-face))
55 'custom-button-pressed-face)
56 (set (make-local-variable 'widget-mouse-face)
57 'custom-button-pressed-face))
58 (when (and (boundp 'custom-raised-buttons) 55 (when (and (boundp 'custom-raised-buttons)
59 (symbol-value 'custom-raised-buttons)) 56 (symbol-value 'custom-raised-buttons))
60 (set (make-local-variable 'widget-push-button-prefix) "") 57 (setq-local widget-push-button-prefix "")
61 (set (make-local-variable 'widget-push-button-suffix) "") 58 (setq-local widget-push-button-suffix "")
62 (set (make-local-variable 'widget-link-prefix) "") 59 (setq-local widget-link-prefix "")
63 (set (make-local-variable 'widget-link-suffix) ""))) 60 (setq-local widget-link-suffix "")))
64 61
65;;; Group Customization: 62;;; Group Customization:
66 63
@@ -380,10 +377,8 @@ category."))
380 (gnus-kill-buffer "*Gnus Customize*") 377 (gnus-kill-buffer "*Gnus Customize*")
381 (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*")) 378 (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*"))
382 (gnus-custom-mode) 379 (gnus-custom-mode)
383 (make-local-variable 'gnus-custom-group) 380 (setq-local gnus-custom-group group)
384 (setq gnus-custom-group group) 381 (setq-local gnus-custom-topic topic)
385 (make-local-variable 'gnus-custom-topic)
386 (setq gnus-custom-topic topic)
387 (buffer-disable-undo) 382 (buffer-disable-undo)
388 (widget-insert "Customize the ") 383 (widget-insert "Customize the ")
389 (if group 384 (if group
@@ -848,8 +843,7 @@ This can be changed using the `\\[gnus-score-change-score-file]' command."
848 (kill-buffer (gnus-get-buffer-create "*Gnus Customize*")) 843 (kill-buffer (gnus-get-buffer-create "*Gnus Customize*"))
849 (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*")) 844 (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*"))
850 (gnus-custom-mode) 845 (gnus-custom-mode)
851 (make-local-variable 'gnus-custom-score-alist) 846 (setq-local gnus-custom-score-alist scores)
852 (setq gnus-custom-score-alist scores)
853 (widget-insert "Customize the ") 847 (widget-insert "Customize the ")
854 (widget-create 'info-link 848 (widget-create 'info-link
855 :help-echo "Push me to learn more." 849 :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
867edit the value to suit your taste. Don't forget to mark the checkbox, 861edit the value to suit your taste. Don't forget to mark the checkbox,
868if you do all your changes will be lost. ") 862if you do all your changes will be lost. ")
869 (widget-insert "\n\n") 863 (widget-insert "\n\n")
870 (make-local-variable 'gnus-custom-scores) 864 (setq-local gnus-custom-scores
871 (setq gnus-custom-scores
872 (widget-create 'group 865 (widget-create 'group
873 :value scores 866 :value scores
874 `(checklist :inline t 867 `(checklist :inline t
@@ -1052,10 +1045,9 @@ articles in the thread.
1052 "\n Note: Empty fields default to the customizable global\ 1045 "\n Note: Empty fields default to the customizable global\
1053 variables.\n\n") 1046 variables.\n\n")
1054 1047
1055 (set (make-local-variable 'gnus-agent-cat-name) 1048 (setq-local gnus-agent-cat-name name))
1056 name))
1057 1049
1058 (set (make-local-variable 'category-fields) nil) 1050 (setq-local category-fields nil)
1059 (gnus-agent-cat-prepare-category-field agent-predicate) 1051 (gnus-agent-cat-prepare-category-field agent-predicate)
1060 1052
1061 (gnus-agent-cat-prepare-category-field agent-score) 1053 (gnus-agent-cat-prepare-category-field agent-score)
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 73fda66fb6b..24534a1b66d 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1098,7 +1098,7 @@ When FORCE, rebuild the tool bar."
1098 gnus-group-tool-bar-zap-list 1098 gnus-group-tool-bar-zap-list
1099 'gnus-group-mode-map))) 1099 'gnus-group-mode-map)))
1100 (if map 1100 (if map
1101 (set (make-local-variable 'tool-bar-map) map)))) 1101 (setq-local tool-bar-map map))))
1102 gnus-group-tool-bar-map) 1102 gnus-group-tool-bar-map)
1103 1103
1104(define-derived-mode gnus-group-mode gnus-mode "Group" 1104(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."
1745 (prog1 1745 (prog1
1746 (setq mode-line-buffer-identification 1746 (setq mode-line-buffer-identification
1747 (gnus-mode-line-buffer-identification 1747 (gnus-mode-line-buffer-identification
1748 (list mode-string))) 1748 (list (propertize mode-string
1749 'face 'mode-line-buffer-id))))
1749 (set-buffer-modified-p modified)))))) 1750 (set-buffer-modified-p modified))))))
1750 1751
1751(defun gnus-group-group-name () 1752(defun gnus-group-group-name ()
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 465871eafbd..3733babfe0f 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -464,8 +464,7 @@ only affect the Gcc copy, but not the original message."
464 (gnus-inews-add-send-actions ,winconf ,buffer ,oarticle ,config 464 (gnus-inews-add-send-actions ,winconf ,buffer ,oarticle ,config
465 ,yanked ,winconf-name) 465 ,yanked ,winconf-name)
466 (setq gnus-message-buffer (current-buffer)) 466 (setq gnus-message-buffer (current-buffer))
467 (set (make-local-variable 'gnus-message-group-art) 467 (setq-local gnus-message-group-art (cons ,group ,article))
468 (cons ,group ,article))
469 ;; Enable highlighting of different citation levels 468 ;; Enable highlighting of different citation levels
470 (when gnus-message-highlight-citation 469 (when gnus-message-highlight-citation
471 (gnus-message-citation-mode 1)) 470 (gnus-message-citation-mode 1))
@@ -473,7 +472,7 @@ only affect the Gcc copy, but not the original message."
473 (if (eq major-mode 'message-mode) 472 (if (eq major-mode 'message-mode)
474 (let ((mbl1 mml-buffer-list)) 473 (let ((mbl1 mml-buffer-list))
475 (setq mml-buffer-list mbl) ;; Global value 474 (setq mml-buffer-list mbl) ;; Global value
476 (set (make-local-variable 'mml-buffer-list) mbl1);; Local value 475 (setq-local mml-buffer-list mbl1) ;; Local value
477 (add-hook 'change-major-mode-hook 'mml-destroy-buffers nil t) 476 (add-hook 'change-major-mode-hook 'mml-destroy-buffers nil t)
478 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)) 477 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))
479 (mml-destroy-buffers) 478 (mml-destroy-buffers)
@@ -724,10 +723,10 @@ network. The corresponding back end must have a `request-post' method."
724 (gnus-setup-message 'message 723 (gnus-setup-message 'message
725 (progn 724 (progn
726 (message-news (gnus-group-real-name gnus-newsgroup-name)) 725 (message-news (gnus-group-real-name gnus-newsgroup-name))
727 (set (make-local-variable 'gnus-discouraged-post-methods) 726 (setq-local gnus-discouraged-post-methods
728 (remove 727 (remove
729 (car (gnus-find-method-for-group gnus-newsgroup-name)) 728 (car (gnus-find-method-for-group gnus-newsgroup-name))
730 gnus-discouraged-post-methods))))))))) 729 gnus-discouraged-post-methods)))))))))
731 730
732(defun gnus-summary-post-news (&optional arg) 731(defun gnus-summary-post-news (&optional arg)
733 "Start composing a message. Post to the current group by default. 732 "Start composing a message. Post to the current group by default.
@@ -1926,8 +1925,8 @@ this is a reply."
1926 (message-goto-body) 1925 (message-goto-body)
1927 (insert ,(cdr result))))) 1926 (insert ,(cdr result)))))
1928 ((eq 'signature (car result)) 1927 ((eq 'signature (car result))
1929 (set (make-local-variable 'message-signature) nil) 1928 (setq-local message-signature nil)
1930 (set (make-local-variable 'message-signature-file) nil) 1929 (setq-local message-signature-file nil)
1931 (if (not (cdr result)) 1930 (if (not (cdr result))
1932 'ignore 1931 'ignore
1933 `(lambda () 1932 `(lambda ()
@@ -1953,8 +1952,8 @@ this is a reply."
1953 (when (or name address) 1952 (when (or name address)
1954 (add-hook 'message-setup-hook 1953 (add-hook 'message-setup-hook
1955 `(lambda () 1954 `(lambda ()
1956 (set (make-local-variable 'user-mail-address) 1955 (setq-local user-mail-address
1957 ,(or (cdr address) user-mail-address)) 1956 ,(or (cdr address) user-mail-address))
1958 (let ((user-full-name ,(or (cdr name) (user-full-name))) 1957 (let ((user-full-name ,(or (cdr name) (user-full-name)))
1959 (user-mail-address 1958 (user-mail-address
1960 ,(or (cdr address) user-mail-address))) 1959 ,(or (cdr address) user-mail-address)))
diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el
index 8d58cd59e45..f19678a634a 100644
--- a/lisp/gnus/gnus-salt.el
+++ b/lisp/gnus/gnus-salt.el
@@ -106,7 +106,7 @@ It accepts the same format specs that `gnus-summary-line-format' does."
106 (remove-hook 'gnus-message-setup-hook 'gnus-pick-setup-message)) 106 (remove-hook 'gnus-message-setup-hook 'gnus-pick-setup-message))
107 (t 107 (t
108 ;; Make sure that we don't select any articles upon group entry. 108 ;; Make sure that we don't select any articles upon group entry.
109 (set (make-local-variable 'gnus-auto-select-first) nil) 109 (setq-local gnus-auto-select-first nil)
110 ;; Change line format. 110 ;; Change line format.
111 (setq gnus-summary-line-format gnus-summary-pick-line-format) 111 (setq gnus-summary-line-format gnus-summary-pick-line-format)
112 (setq gnus-summary-line-format-spec nil) 112 (setq gnus-summary-line-format-spec nil)
@@ -114,7 +114,7 @@ It accepts the same format specs that `gnus-summary-line-format' does."
114 (gnus-update-summary-mark-positions) 114 (gnus-update-summary-mark-positions)
115 ;; FIXME: a buffer-local minor mode adding globally to a hook?? 115 ;; FIXME: a buffer-local minor mode adding globally to a hook??
116 (add-hook 'gnus-message-setup-hook 'gnus-pick-setup-message) 116 (add-hook 'gnus-message-setup-hook 'gnus-pick-setup-message)
117 (set (make-local-variable 'gnus-summary-goto-unread) 'never) 117 (setq-local gnus-summary-goto-unread 'never)
118 ;; Set up the menu. 118 ;; Set up the menu.
119 (when (gnus-visual-p 'pick-menu 'menu) 119 (when (gnus-visual-p 'pick-menu 'menu)
120 (gnus-pick-make-menu-bar))))) 120 (gnus-pick-make-menu-bar)))))
@@ -333,10 +333,8 @@ This must be bound to a button-down mouse event."
333 ((not (derived-mode-p 'gnus-summary-mode)) (setq gnus-binary-mode nil)) 333 ((not (derived-mode-p 'gnus-summary-mode)) (setq gnus-binary-mode nil))
334 (gnus-binary-mode 334 (gnus-binary-mode
335 ;; Make sure that we don't select any articles upon group entry. 335 ;; Make sure that we don't select any articles upon group entry.
336 (make-local-variable 'gnus-auto-select-first) 336 (setq-local gnus-auto-select-first nil)
337 (setq gnus-auto-select-first nil) 337 (setq-local gnus-summary-display-article-function 'gnus-binary-display-article)
338 (make-local-variable 'gnus-summary-display-article-function)
339 (setq gnus-summary-display-article-function 'gnus-binary-display-article)
340 ;; Set up the menu. 338 ;; Set up the menu.
341 (when (gnus-visual-p 'binary-menu 'menu) 339 (when (gnus-visual-p 'binary-menu 'menu)
342 (gnus-binary-make-menu-bar))))) 340 (gnus-binary-make-menu-bar)))))
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index 2e3abe7832d..94f2cc310fa 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -1117,8 +1117,7 @@ EXTRA is the possible non-standard header."
1117 (gnus-configure-windows 'edit-score) 1117 (gnus-configure-windows 'edit-score)
1118 (gnus-score-mode) 1118 (gnus-score-mode)
1119 (setq gnus-score-edit-exit-function 'gnus-score-edit-done) 1119 (setq gnus-score-edit-exit-function 'gnus-score-edit-done)
1120 (make-local-variable 'gnus-prev-winconf) 1120 (setq-local gnus-prev-winconf winconf))
1121 (setq gnus-prev-winconf winconf))
1122 (gnus-message 1121 (gnus-message
1123 4 "%s" (substitute-command-keys 1122 4 "%s" (substitute-command-keys
1124 "\\<gnus-score-mode-map>\\[gnus-score-edit-exit] to save edits")))) 1123 "\\<gnus-score-mode-map>\\[gnus-score-edit-exit] to save edits"))))
@@ -1145,8 +1144,7 @@ EXTRA is the possible non-standard header."
1145 (gnus-configure-windows 'edit-score) 1144 (gnus-configure-windows 'edit-score)
1146 (gnus-score-mode) 1145 (gnus-score-mode)
1147 (setq gnus-score-edit-exit-function 'gnus-score-edit-done) 1146 (setq gnus-score-edit-exit-function 'gnus-score-edit-done)
1148 (make-local-variable 'gnus-prev-winconf) 1147 (setq-local gnus-prev-winconf winconf))
1149 (setq gnus-prev-winconf winconf))
1150 (gnus-message 1148 (gnus-message
1151 4 "%s" (substitute-command-keys 1149 4 "%s" (substitute-command-keys
1152 "\\<gnus-score-mode-map>\\[gnus-score-edit-exit] to save edits"))) 1150 "\\<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 89d8cff9257..0e67fac002d 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -105,6 +105,8 @@
105 105
106(define-error 'gnus-search-parse-error "Gnus search parsing error") 106(define-error 'gnus-search-parse-error "Gnus search parsing error")
107 107
108(define-error 'gnus-search-config-error "Gnus search configuration error")
109
108;;; User Customizable Variables: 110;;; User Customizable Variables:
109 111
110(defgroup gnus-search nil 112(defgroup gnus-search nil
@@ -1852,8 +1854,10 @@ Assume \"size\" key is equal to \"larger\"."
1852 (grouplist (or groups (gnus-search-get-active server))) 1854 (grouplist (or groups (gnus-search-get-active server)))
1853 (buffer (slot-value engine 'proc-buffer))) 1855 (buffer (slot-value engine 'proc-buffer)))
1854 (unless directory 1856 (unless directory
1855 (error "No directory found in method specification of server %s" 1857 (signal 'gnus-search-config-error
1856 server)) 1858 (list (format-message
1859 "No directory found in definition of server %s"
1860 server))))
1857 (apply 1861 (apply
1858 'vconcat 1862 'vconcat
1859 (mapcar (lambda (x) 1863 (mapcar (lambda (x)
@@ -1885,7 +1889,9 @@ Assume \"size\" key is equal to \"larger\"."
1885 group nil t))) 1889 group nil t)))
1886 group)))))) 1890 group))))))
1887 (unless group 1891 (unless group
1888 (error "Cannot locate directory for group")) 1892 (signal 'gnus-search-config-error
1893 (list
1894 "Cannot locate directory for group")))
1889 (save-excursion 1895 (save-excursion
1890 (apply 1896 (apply
1891 'call-process "find" nil t 1897 'call-process "find" nil t
@@ -1934,12 +1940,19 @@ Assume \"size\" key is equal to \"larger\"."
1934 (limit (alist-get 'limit prepared-query))) 1940 (limit (alist-get 'limit prepared-query)))
1935 (mapc 1941 (mapc
1936 (pcase-lambda (`(,server . ,groups)) 1942 (pcase-lambda (`(,server . ,groups))
1937 (let ((search-engine (gnus-search-server-to-engine server))) 1943 (condition-case err
1938 (setq results 1944 (let ((search-engine (gnus-search-server-to-engine server)))
1939 (vconcat 1945 (setq results
1940 (gnus-search-run-search 1946 (vconcat
1941 search-engine server prepared-query groups) 1947 (gnus-search-run-search
1942 results)))) 1948 search-engine server prepared-query groups)
1949 results)))
1950 (gnus-search-config-error
1951 (if (< 1 (length (alist-get 'search-group-spec specs)))
1952 (apply #'nnheader-message 4
1953 "Search engine for %s improperly configured: %s"
1954 server (cdr err))
1955 (signal 'gnus-search-config-error err)))))
1943 (alist-get 'search-group-spec specs)) 1956 (alist-get 'search-group-spec specs))
1944 ;; Some search engines do their own limiting, but some don't, so 1957 ;; Some search engines do their own limiting, but some don't, so
1945 ;; do it again here. This is bad because, if the user is 1958 ;; do it again here. This is bad because, if the user is
@@ -1949,7 +1962,7 @@ Assume \"size\" key is equal to \"larger\"."
1949 ;; from a later group entirely. 1962 ;; from a later group entirely.
1950 (if limit 1963 (if limit
1951 (seq-subseq results 0 (min limit (length results))) 1964 (seq-subseq results 0 (min limit (length results)))
1952 results))) 1965 results)))
1953 1966
1954(defun gnus-search-prepare-query (query-spec) 1967(defun gnus-search-prepare-query (query-spec)
1955 "Accept a search query in raw format, and prepare it. 1968 "Accept a search query in raw format, and prepare it.
@@ -2023,11 +2036,13 @@ remaining string, then adds all that to the top-level spec."
2023 (condition-case nil 2036 (condition-case nil
2024 (setf (slot-value inst key) value) 2037 (setf (slot-value inst key) value)
2025 ((invalid-slot-name invalid-slot-type) 2038 ((invalid-slot-name invalid-slot-type)
2026 (nnheader-message 2039 (nnheader-report 'search
2027 5 "Invalid search engine parameter: (%s %s)" 2040 "Invalid search engine parameter: (%s %s)"
2028 key value))))) 2041 key value)))))
2029 (push (cons srv inst) gnus-search-engine-instance-alist)) 2042 (push (cons srv inst) gnus-search-engine-instance-alist))
2030 (error "No search engine defined for %s" srv)) 2043 (signal 'gnus-search-config-error
2044 (list (format-message
2045 "No search engine configured for %s" srv))))
2031 inst)) 2046 inst))
2032 2047
2033(declare-function gnus-registry-get-id-key "gnus-registry" (id key)) 2048(declare-function gnus-registry-get-id-key "gnus-registry" (id key))
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index 6beb543e5a1..ba15f1a04cc 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -262,8 +262,7 @@ The following commands are available:
262 (setq mode-line-process nil) 262 (setq mode-line-process nil)
263 (buffer-disable-undo) 263 (buffer-disable-undo)
264 (setq truncate-lines t) 264 (setq truncate-lines t)
265 (set (make-local-variable 'font-lock-defaults) 265 (setq-local font-lock-defaults '(gnus-server-font-lock-keywords t)))
266 '(gnus-server-font-lock-keywords t)))
267 266
268 267
269(defun gnus-server-insert-server-line (name method) 268(defun gnus-server-insert-server-line (name method)
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 615f8dfa877..d15fc8217ab 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -741,8 +741,7 @@ of an NNTP server to use. As opposed to \\[gnus], this command
741will not connect to the local server." 741will not connect to the local server."
742 (let ((val (or arg (1- gnus-level-default-subscribed)))) 742 (let ((val (or arg (1- gnus-level-default-subscribed))))
743 (gnus val t child) 743 (gnus val t child)
744 (make-local-variable 'gnus-group-use-permanent-levels) 744 (setq-local gnus-group-use-permanent-levels val)))
745 (setq gnus-group-use-permanent-levels val)))
746 745
747(defun gnus-1 (&optional arg dont-connect child) 746(defun gnus-1 (&optional arg dont-connect child)
748 "Read network news. 747 "Read network news.
@@ -875,13 +874,13 @@ If REGEXP is given, lines that match it will be deleted."
875 (with-current-buffer (setq gnus-dribble-buffer 874 (with-current-buffer (setq gnus-dribble-buffer
876 (gnus-get-buffer-create 875 (gnus-get-buffer-create
877 (file-name-nondirectory dribble-file))) 876 (file-name-nondirectory dribble-file)))
878 (set (make-local-variable 'file-precious-flag) t) 877 (setq-local file-precious-flag t)
879 (setq buffer-save-without-query t) 878 (setq buffer-save-without-query t)
880 (erase-buffer) 879 (erase-buffer)
881 (setq buffer-file-name dribble-file) 880 (setq buffer-file-name dribble-file)
882 ;; The buffer may be shrunk a lot when deleting old entries. 881 ;; The buffer may be shrunk a lot when deleting old entries.
883 ;; It caused the auto-saving to stop. 882 ;; It caused the auto-saving to stop.
884 (set (make-local-variable 'auto-save-include-big-deletions) t) 883 (setq-local auto-save-include-big-deletions t)
885 (auto-save-mode t) 884 (auto-save-mode t)
886 (buffer-disable-undo) 885 (buffer-disable-undo)
887 (bury-buffer (current-buffer)) 886 (bury-buffer (current-buffer))
@@ -2763,8 +2762,7 @@ values from `gnus-newsrc-hashtb', and write a new value of
2763 2762
2764 ;; Save .newsrc.eld. 2763 ;; Save .newsrc.eld.
2765 (set-buffer (gnus-get-buffer-create " *Gnus-newsrc*")) 2764 (set-buffer (gnus-get-buffer-create " *Gnus-newsrc*"))
2766 (make-local-variable 'version-control) 2765 (setq-local version-control gnus-backup-startup-file)
2767 (setq version-control gnus-backup-startup-file)
2768 (setq buffer-file-name 2766 (setq buffer-file-name
2769 (concat gnus-current-startup-file ".eld")) 2767 (concat gnus-current-startup-file ".eld"))
2770 (setq default-directory (file-name-directory buffer-file-name)) 2768 (setq default-directory (file-name-directory buffer-file-name))
@@ -2973,8 +2971,7 @@ SPECIFIC-VARIABLES, or those in `gnus-variable-list'."
2973 (when ranges 2971 (when ranges
2974 (insert ","))))) 2972 (insert ",")))))
2975 (insert "\n"))) 2973 (insert "\n")))
2976 (make-local-variable 'version-control) 2974 (setq-local version-control 'never)
2977 (setq version-control 'never)
2978 ;; It has been reported that sometime the modtime on the .newsrc 2975 ;; It has been reported that sometime the modtime on the .newsrc
2979 ;; file seems to be off. We really do want to overwrite it, so 2976 ;; file seems to be off. We really do want to overwrite it, so
2980 ;; we clear the modtime here before saving. It's a bit odd, 2977 ;; 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 469fa36fb77..9488b324878 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1460,8 +1460,8 @@ the normal Gnus MIME machinery."
1460 (?I gnus-tmp-indentation ?s) 1460 (?I gnus-tmp-indentation ?s)
1461 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s) 1461 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s)
1462 (?R gnus-tmp-replied ?c) 1462 (?R gnus-tmp-replied ?c)
1463 (?\[ gnus-tmp-opening-bracket ?c) 1463 (?\[ gnus-tmp-opening-bracket ?s)
1464 (?\] gnus-tmp-closing-bracket ?c) 1464 (?\] gnus-tmp-closing-bracket ?s)
1465 (?\> (make-string gnus-tmp-level ? ) ?s) 1465 (?\> (make-string gnus-tmp-level ? ) ?s)
1466 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s) 1466 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s)
1467 (?i gnus-tmp-score ?d) 1467 (?i gnus-tmp-score ?d)
@@ -3038,7 +3038,7 @@ When FORCE, rebuild the tool bar."
3038 ;; Need to set `gnus-summary-tool-bar-map' because `gnus-article-mode' 3038 ;; Need to set `gnus-summary-tool-bar-map' because `gnus-article-mode'
3039 ;; uses its value. 3039 ;; uses its value.
3040 (setq gnus-summary-tool-bar-map map)))) 3040 (setq gnus-summary-tool-bar-map map))))
3041 (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map)) 3041 (setq-local tool-bar-map gnus-summary-tool-bar-map))
3042 3042
3043(defun gnus-make-score-map (type) 3043(defun gnus-make-score-map (type)
3044 "Make a summary score map of type TYPE." 3044 "Make a summary score map of type TYPE."
@@ -3174,8 +3174,8 @@ The following commands are available:
3174 (make-local-variable 'gnus-original-article-buffer) 3174 (make-local-variable 'gnus-original-article-buffer)
3175 (add-hook 'pre-command-hook #'gnus-set-global-variables nil t) 3175 (add-hook 'pre-command-hook #'gnus-set-global-variables nil t)
3176 (mm-enable-multibyte) 3176 (mm-enable-multibyte)
3177 (set (make-local-variable 'bookmark-make-record-function) 3177 (setq-local bookmark-make-record-function
3178 #'gnus-summary-bookmark-make-record)) 3178 #'gnus-summary-bookmark-make-record))
3179 3179
3180(defun gnus-summary-make-local-variables () 3180(defun gnus-summary-make-local-variables ()
3181 "Make all the local summary buffer variables." 3181 "Make all the local summary buffer variables."
@@ -3547,7 +3547,7 @@ Returns non-nil if the setup was successful."
3547 (let ((gnus-summary-mode-group group)) 3547 (let ((gnus-summary-mode-group group))
3548 (gnus-summary-mode)) 3548 (gnus-summary-mode))
3549 (when (gnus-group-quit-config group) 3549 (when (gnus-group-quit-config group)
3550 (set (make-local-variable 'gnus-single-article-buffer) nil)) 3550 (setq-local gnus-single-article-buffer nil))
3551 (turn-on-gnus-mailing-list-mode) 3551 (turn-on-gnus-mailing-list-mode)
3552 ;; These functions don't currently depend on GROUP, but might in 3552 ;; These functions don't currently depend on GROUP, but might in
3553 ;; the future. 3553 ;; the future.
@@ -3748,6 +3748,30 @@ buffer that was in action when the last article was fetched."
3748 (inline 3748 (inline
3749 (gnus-summary-extract-address-component gnus-tmp-from)))))) 3749 (gnus-summary-extract-address-component gnus-tmp-from))))))
3750 3750
3751(defcustom gnus-sum-opening-bracket "["
3752 "With %[ spec, used to identify normal (non-adopted) articles."
3753 :version "28.1"
3754 :type 'string
3755 :group 'gnus-summary-format)
3756
3757(defcustom gnus-sum-closing-bracket "]"
3758 "With %] spec, used to identify normal (non-adopted) articles."
3759 :version "28.1"
3760 :type 'string
3761 :group 'gnus-summary-format)
3762
3763(defcustom gnus-sum-opening-bracket-adopted "<"
3764 "With %[ spec, used to identify adopted articles."
3765 :version "28.1"
3766 :type 'string
3767 :group 'gnus-summary-format)
3768
3769(defcustom gnus-sum-closing-bracket-adopted ">"
3770 "With %] spec, used to identify adopted articles."
3771 :version "28.1"
3772 :type 'string
3773 :group 'gnus-summary-format)
3774
3751(defun gnus-summary-insert-line (header level current undownloaded 3775(defun gnus-summary-insert-line (header level current undownloaded
3752 unread replied expirable subject-or-nil 3776 unread replied expirable subject-or-nil
3753 &optional dummy score process) 3777 &optional dummy score process)
@@ -3805,8 +3829,14 @@ buffer that was in action when the last article was fetched."
3805 (1+ (match-beginning 0)) (1- (match-end 0)))) 3829 (1+ (match-beginning 0)) (1- (match-end 0))))
3806 (t gnus-tmp-from))) 3830 (t gnus-tmp-from)))
3807 (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) 3831 (gnus-tmp-subject (mail-header-subject gnus-tmp-header))
3808 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) 3832 (gnus-tmp-opening-bracket
3809 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) 3833 (if gnus-tmp-dummy
3834 gnus-sum-opening-bracket-adopted
3835 gnus-sum-opening-bracket))
3836 (gnus-tmp-closing-bracket
3837 (if gnus-tmp-dummy
3838 gnus-sum-closing-bracket-adopted
3839 gnus-sum-closing-bracket))
3810 (inhibit-read-only t)) 3840 (inhibit-read-only t))
3811 (when (string= gnus-tmp-name "") 3841 (when (string= gnus-tmp-name "")
3812 (setq gnus-tmp-name gnus-tmp-from)) 3842 (setq gnus-tmp-name gnus-tmp-from))
@@ -5439,10 +5469,10 @@ or a straight list of headers."
5439 (if (and (eq gnus-summary-make-false-root 'adopt) 5469 (if (and (eq gnus-summary-make-false-root 'adopt)
5440 (= gnus-tmp-level 1) 5470 (= gnus-tmp-level 1)
5441 (memq number gnus-tmp-gathered)) 5471 (memq number gnus-tmp-gathered))
5442 (setq gnus-tmp-opening-bracket ?\< 5472 (setq gnus-tmp-opening-bracket gnus-sum-opening-bracket-adopted
5443 gnus-tmp-closing-bracket ?\>) 5473 gnus-tmp-closing-bracket gnus-sum-closing-bracket-adopted)
5444 (setq gnus-tmp-opening-bracket ?\[ 5474 (setq gnus-tmp-opening-bracket gnus-sum-opening-bracket
5445 gnus-tmp-closing-bracket ?\])) 5475 gnus-tmp-closing-bracket gnus-sum-closing-bracket))
5446 (if (>= gnus-tmp-level (length gnus-thread-indent-array)) 5476 (if (>= gnus-tmp-level (length gnus-thread-indent-array))
5447 (gnus-make-thread-indent-array 5477 (gnus-make-thread-indent-array
5448 (max (* 2 (length gnus-thread-indent-array)) 5478 (max (* 2 (length gnus-thread-indent-array))
@@ -5670,8 +5700,8 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5670 articles fetched-articles cached) 5700 articles fetched-articles cached)
5671 5701
5672 (unless (gnus-check-server 5702 (unless (gnus-check-server
5673 (set (make-local-variable 'gnus-current-select-method) 5703 (setq-local gnus-current-select-method
5674 (gnus-find-method-for-group group))) 5704 (gnus-find-method-for-group group)))
5675 (error "Couldn't open server")) 5705 (error "Couldn't open server"))
5676 5706
5677 (or (and entry (not (eq (car entry) t))) ; Either it's active... 5707 (or (and entry (not (eq (car entry) t))) ; Either it's active...
@@ -6254,7 +6284,9 @@ If WHERE is `summary', the summary mode line format will be used."
6254 mode-string (- max-len 3) nil nil t))))) 6284 mode-string (- max-len 3) nil nil t)))))
6255 ;; Update the mode line. 6285 ;; Update the mode line.
6256 (setq mode-line-buffer-identification 6286 (setq mode-line-buffer-identification
6257 (gnus-mode-line-buffer-identification (list mode-string))) 6287 (gnus-mode-line-buffer-identification
6288 (list (propertize mode-string
6289 'face 'mode-line-buffer-id))))
6258 (set-buffer-modified-p t)))) 6290 (set-buffer-modified-p t))))
6259 6291
6260(defun gnus-create-xref-hashtb (from-newsgroup headers unreads) 6292(defun gnus-create-xref-hashtb (from-newsgroup headers unreads)
@@ -10638,7 +10670,7 @@ groups."
10638 (mime-to-mml current-handles)) 10670 (mime-to-mml current-handles))
10639 (let ((mbl1 mml-buffer-list)) 10671 (let ((mbl1 mml-buffer-list))
10640 (setq mml-buffer-list mbl) 10672 (setq mml-buffer-list mbl)
10641 (set (make-local-variable 'mml-buffer-list) mbl1)) 10673 (setq-local mml-buffer-list mbl1))
10642 (add-hook 'kill-buffer-hook #'mml-destroy-buffers t t)))) 10674 (add-hook 'kill-buffer-hook #'mml-destroy-buffers t t))))
10643 `(lambda (no-highlight) 10675 `(lambda (no-highlight)
10644 (let ((mail-parse-charset ',gnus-newsgroup-charset) 10676 (let ((mail-parse-charset ',gnus-newsgroup-charset)
@@ -12846,8 +12878,7 @@ UNREAD is a sorted list."
12846 (and gnus-newsgroup-name 12878 (and gnus-newsgroup-name
12847 (gnus-parameter-charset gnus-newsgroup-name)) 12879 (gnus-parameter-charset gnus-newsgroup-name))
12848 gnus-default-charset)) 12880 gnus-default-charset))
12849 (set (make-local-variable 'gnus-newsgroup-ignored-charsets) 12881 (setq-local gnus-newsgroup-ignored-charsets ignored-charsets))))
12850 ignored-charsets))))
12851 12882
12852;;; 12883;;;
12853;;; Mime Commands 12884;;; Mime Commands
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index c913002f70b..75de1e031c3 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -1129,18 +1129,17 @@ articles in the topic and its subtopics."
1129 (gnus-topic-make-menu-bar)) 1129 (gnus-topic-make-menu-bar))
1130 (gnus-set-format 'topic t) 1130 (gnus-set-format 'topic t)
1131 (add-hook 'gnus-group-catchup-group-hook 'gnus-topic-update-topic) 1131 (add-hook 'gnus-group-catchup-group-hook 'gnus-topic-update-topic)
1132 (set (make-local-variable 'gnus-group-prepare-function) 1132 (setq-local gnus-group-prepare-function
1133 'gnus-group-prepare-topics) 1133 'gnus-group-prepare-topics)
1134 (set (make-local-variable 'gnus-group-get-parameter-function) 1134 (setq-local gnus-group-get-parameter-function
1135 'gnus-group-topic-parameters) 1135 'gnus-group-topic-parameters)
1136 (set (make-local-variable 'gnus-group-goto-next-group-function) 1136 (setq-local gnus-group-goto-next-group-function
1137 'gnus-topic-goto-next-group) 1137 'gnus-topic-goto-next-group)
1138 (set (make-local-variable 'gnus-group-indentation-function) 1138 (setq-local gnus-group-indentation-function
1139 'gnus-topic-group-indentation) 1139 'gnus-topic-group-indentation)
1140 (set (make-local-variable 'gnus-group-update-group-function) 1140 (setq-local gnus-group-update-group-function
1141 'gnus-topic-update-topics-containing-group) 1141 'gnus-topic-update-topics-containing-group)
1142 (set (make-local-variable 'gnus-group-sort-alist-function) 1142 (setq-local gnus-group-sort-alist-function 'gnus-group-sort-topic)
1143 'gnus-group-sort-topic)
1144 (setq gnus-group-change-level-function 'gnus-topic-change-level) 1143 (setq gnus-group-change-level-function 'gnus-topic-change-level)
1145 (setq gnus-goto-missing-group-function 'gnus-topic-goto-missing-group) 1144 (setq gnus-goto-missing-group-function 'gnus-topic-goto-missing-group)
1146 (add-hook 'gnus-check-bogus-groups-hook 'gnus-topic-clean-alist 1145 (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 3f2b5768db2..a852f20109e 100644
--- a/lisp/gnus/gnus-undo.el
+++ b/lisp/gnus/gnus-undo.el
@@ -100,8 +100,8 @@
100 100
101\\{gnus-undo-mode-map}" 101\\{gnus-undo-mode-map}"
102 :keymap gnus-undo-mode-map 102 :keymap gnus-undo-mode-map
103 (set (make-local-variable 'gnus-undo-actions) nil) 103 (setq-local gnus-undo-actions nil)
104 (set (make-local-variable 'gnus-undo-boundary) t) 104 (setq-local gnus-undo-boundary t)
105 (when gnus-undo-mode 105 (when gnus-undo-mode
106 ;; Set up the menu. 106 ;; Set up the menu.
107 (when (gnus-visual-p 'undo-menu 'menu) 107 (when (gnus-visual-p 'undo-menu 'menu)
diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el
index baa3146e64e..e900e294c57 100644
--- a/lisp/gnus/gnus-win.el
+++ b/lisp/gnus/gnus-win.el
@@ -68,7 +68,7 @@ used to display Gnus windows."
68 :type 'boolean) 68 :type 'boolean)
69 69
70(defvar gnus-buffer-configuration 70(defvar gnus-buffer-configuration
71 '((group 71 `((group
72 (vertical 1.0 72 (vertical 1.0
73 (group 1.0 point))) 73 (group 1.0 point)))
74 (summary 74 (summary
@@ -142,7 +142,7 @@ used to display Gnus windows."
142 (pipe 142 (pipe
143 (vertical 1.0 143 (vertical 1.0
144 (summary 0.25 point) 144 (summary 0.25 point)
145 (shell-command-buffer-name 1.0))) 145 (,shell-command-buffer-name 1.0)))
146 (bug 146 (bug
147 (vertical 1.0 147 (vertical 1.0
148 (if gnus-bug-create-help-buffer '("*Gnus Help Bug*" 0.5)) 148 (if gnus-bug-create-help-buffer '("*Gnus Help Bug*" 0.5))
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 3c91c3e1caf..0a20a99f457 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -309,34 +309,29 @@ be set in `.emacs' instead."
309 :group 'gnus-start 309 :group 'gnus-start
310 :type 'boolean) 310 :type 'boolean)
311 311
312(defvar gnus-mode-line-image-cache t) 312(defun gnus-mode-line-buffer-identification (line)
313 313 (let ((str (car-safe line)))
314(eval-and-compile 314 (if (or (not (fboundp 'find-image))
315 (if (fboundp 'find-image) 315 (not (display-graphic-p))
316 (defun gnus-mode-line-buffer-identification (line) 316 (not (stringp str))
317 (let ((str (car-safe line)) 317 (not (string-match "^Gnus:" str)))
318 (load-path (append (mm-image-load-path) load-path))) 318 line
319 (if (and (display-graphic-p) 319 (let ((load-path (append (mm-image-load-path) load-path)))
320 (stringp str) 320 ;; Add the Gnus logo.
321 (string-match "^Gnus:" str)) 321 (add-text-properties
322 (progn (add-text-properties 322 0 5
323 0 5 323 (list 'display
324 (list 'display 324 (find-image
325 (if (eq t gnus-mode-line-image-cache) 325 '((:type xpm :file "gnus-pointer.xpm"
326 (setq gnus-mode-line-image-cache 326 :ascent center)
327 (find-image 327 (:type xbm :file "gnus-pointer.xbm"
328 '((:type xpm :file "gnus-pointer.xpm" 328 :ascent center))
329 :ascent center) 329 t)
330 (:type xbm :file "gnus-pointer.xbm" 330 'help-echo (format
331 :ascent center)))) 331 "This is %s, %s."
332 gnus-mode-line-image-cache) 332 gnus-version (gnus-emacs-version)))
333 'help-echo (format 333 str)
334 "This is %s, %s." 334 (list str)))))
335 gnus-version (gnus-emacs-version)))
336 str)
337 (list str))
338 line)))
339 (defalias 'gnus-mode-line-buffer-identification 'identity)))
340 335
341;; We define these group faces here to avoid the display 336;; We define these group faces here to avoid the display
342;; update forced when creating new faces. 337;; update forced when creating new faces.
@@ -3175,8 +3170,7 @@ that that variable is buffer-local to the summary buffers."
3175 "Make mode lines a bit simpler." 3170 "Make mode lines a bit simpler."
3176 (setq mode-line-modified "--") 3171 (setq mode-line-modified "--")
3177 (when (listp mode-line-format) 3172 (when (listp mode-line-format)
3178 (make-local-variable 'mode-line-format) 3173 (setq-local mode-line-format (copy-sequence mode-line-format))
3179 (setq mode-line-format (copy-sequence mode-line-format))
3180 (when (equal (nth 3 mode-line-format) " ") 3174 (when (equal (nth 3 mode-line-format) " ")
3181 (setcar (nthcdr 3 mode-line-format) " ")))) 3175 (setcar (nthcdr 3 mode-line-format) " "))))
3182 3176
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 2ab3eb62120..b6c1c0b0713 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1155,7 +1155,7 @@ Note: Many newsgroups frown upon nontraditional reply styles.
1155You probably want to set this variable only for specific groups, 1155You probably want to set this variable only for specific groups,
1156e.g. using `gnus-posting-styles': 1156e.g. using `gnus-posting-styles':
1157 1157
1158 (eval (set (make-local-variable \\='message-cite-reply-position) \\='above))" 1158 (eval (setq-local message-cite-reply-position \\='above))"
1159 :version "24.1" 1159 :version "24.1"
1160 :type '(choice (const :tag "Reply inline" traditional) 1160 :type '(choice (const :tag "Reply inline" traditional)
1161 (const :tag "Reply above" above) 1161 (const :tag "Reply above" above)
@@ -1172,7 +1172,7 @@ Presets to impersonate popular mail agents are found in the
1172message-cite-style-* variables. This variable is intended for 1172message-cite-style-* variables. This variable is intended for
1173use in `gnus-posting-styles', such as: 1173use in `gnus-posting-styles', such as:
1174 1174
1175 ((posting-from-work-p) (eval (set (make-local-variable \\='message-cite-style) message-cite-style-outlook)))" 1175 ((posting-from-work-p) (eval (setq-local message-cite-style message-cite-style-outlook)))"
1176 :version "24.1" 1176 :version "24.1"
1177 :group 'message-insertion 1177 :group 'message-insertion
1178 :type '(choice (const :tag "Do not override variables" :value nil) 1178 :type '(choice (const :tag "Do not override variables" :value nil)
@@ -3078,44 +3078,43 @@ See also `message-forbidden-properties'."
3078Like `text-mode', but with these additional commands: 3078Like `text-mode', but with these additional commands:
3079 3079
3080\\{message-mode-map}" 3080\\{message-mode-map}"
3081 (set (make-local-variable 'message-reply-buffer) nil) 3081 (setq-local message-reply-buffer nil)
3082 (set (make-local-variable 'message-inserted-headers) nil) 3082 (setq-local message-inserted-headers nil)
3083 (set (make-local-variable 'message-send-actions) nil) 3083 (setq-local message-send-actions nil)
3084 (set (make-local-variable 'message-return-action) nil) 3084 (setq-local message-return-action nil)
3085 (set (make-local-variable 'message-exit-actions) nil) 3085 (setq-local message-exit-actions nil)
3086 (set (make-local-variable 'message-kill-actions) nil) 3086 (setq-local message-kill-actions nil)
3087 (set (make-local-variable 'message-postpone-actions) nil) 3087 (setq-local message-postpone-actions nil)
3088 (set (make-local-variable 'message-draft-article) nil) 3088 (setq-local message-draft-article nil)
3089 (setq buffer-offer-save t) 3089 (setq buffer-offer-save t)
3090 (set (make-local-variable 'facemenu-add-face-function) 3090 (setq-local facemenu-add-face-function
3091 (lambda (face end) 3091 (lambda (face end)
3092 (let ((face-fun (cdr (assq face message-face-alist)))) 3092 (let ((face-fun (cdr (assq face message-face-alist))))
3093 (if face-fun 3093 (if face-fun
3094 (funcall face-fun (point) end) 3094 (funcall face-fun (point) end)
3095 (error "Face %s not configured for %s mode" face mode-name))) 3095 (error "Face %s not configured for %s mode" face mode-name)))
3096 "")) 3096 ""))
3097 (set (make-local-variable 'facemenu-remove-face-function) t) 3097 (setq-local facemenu-remove-face-function t)
3098 (set (make-local-variable 'message-reply-headers) nil) 3098 (setq-local message-reply-headers nil)
3099 (make-local-variable 'message-newsreader) 3099 (make-local-variable 'message-newsreader)
3100 (make-local-variable 'message-mailer) 3100 (make-local-variable 'message-mailer)
3101 (make-local-variable 'message-post-method) 3101 (make-local-variable 'message-post-method)
3102 (set (make-local-variable 'message-sent-message-via) nil) 3102 (setq-local message-sent-message-via nil)
3103 (set (make-local-variable 'message-checksum) nil) 3103 (setq-local message-checksum nil)
3104 (set (make-local-variable 'message-mime-part) 0) 3104 (setq-local message-mime-part 0)
3105 (message-setup-fill-variables) 3105 (message-setup-fill-variables)
3106 (when message-fill-column 3106 (when message-fill-column
3107 (setq fill-column message-fill-column) 3107 (setq fill-column message-fill-column)
3108 (turn-on-auto-fill)) 3108 (turn-on-auto-fill))
3109 ;; Allow using comment commands to add/remove quoting. 3109 ;; Allow using comment commands to add/remove quoting.
3110 ;; (set (make-local-variable 'comment-start) message-yank-prefix) 3110 ;; (setq-local comment-start message-yank-prefix)
3111 (when message-yank-prefix 3111 (when message-yank-prefix
3112 (set (make-local-variable 'comment-start) message-yank-prefix) 3112 (setq-local comment-start message-yank-prefix)
3113 (set (make-local-variable 'comment-start-skip) 3113 (setq-local comment-start-skip
3114 (concat "^" (regexp-quote message-yank-prefix) "[ \t]*"))) 3114 (concat "^" (regexp-quote message-yank-prefix) "[ \t]*")))
3115 (set (make-local-variable 'font-lock-defaults) 3115 (setq-local font-lock-defaults '(message-font-lock-keywords t))
3116 '(message-font-lock-keywords t))
3117 (if (boundp 'tool-bar-map) 3116 (if (boundp 'tool-bar-map)
3118 (set (make-local-variable 'tool-bar-map) (message-make-tool-bar))) 3117 (setq-local tool-bar-map (message-make-tool-bar)))
3119 ;; Mmmm... Forbidden properties... 3118 ;; Mmmm... Forbidden properties...
3120 (add-hook 'after-change-functions #'message-strip-forbidden-properties 3119 (add-hook 'after-change-functions #'message-strip-forbidden-properties
3121 nil 'local) 3120 nil 'local)
@@ -3134,45 +3133,41 @@ Like `text-mode', but with these additional commands:
3134 ;; Don't enable multibyte on an indirect buffer. Maybe enabling 3133 ;; Don't enable multibyte on an indirect buffer. Maybe enabling
3135 ;; multibyte is not necessary at all. -- zsh 3134 ;; multibyte is not necessary at all. -- zsh
3136 (mm-enable-multibyte)) 3135 (mm-enable-multibyte))
3137 (set (make-local-variable 'indent-tabs-mode) nil) ;No tabs for indentation. 3136 (setq-local indent-tabs-mode nil) ; No tabs for indentation.
3138 (mml-mode) 3137 (mml-mode)
3139 ;; Syntactic fontification. Helps `show-paren-mode', 3138 ;; Syntactic fontification. Helps `show-paren-mode',
3140 ;; `electric-pair-mode', and C-M-* navigation by syntactically 3139 ;; `electric-pair-mode', and C-M-* navigation by syntactically
3141 ;; excluding citations and other artifacts. 3140 ;; excluding citations and other artifacts.
3142 ;; 3141 ;;
3143 (set (make-local-variable 'syntax-propertize-function) 'message--syntax-propertize) 3142 (setq-local syntax-propertize-function 'message--syntax-propertize)
3144 (set (make-local-variable 'parse-sexp-ignore-comments) t) 3143 (setq-local parse-sexp-ignore-comments t)
3145 (setq-local message-encoded-mail-cache nil)) 3144 (setq-local message-encoded-mail-cache nil))
3146 3145
3147(defun message-setup-fill-variables () 3146(defun message-setup-fill-variables ()
3148 "Setup message fill variables." 3147 "Setup message fill variables."
3149 (set (make-local-variable 'fill-paragraph-function) 3148 (setq-local fill-paragraph-function 'message-fill-paragraph)
3150 'message-fill-paragraph)
3151 (make-local-variable 'paragraph-separate)
3152 (make-local-variable 'paragraph-start)
3153 (make-local-variable 'adaptive-fill-regexp)
3154 (make-local-variable 'adaptive-fill-first-line-regexp) 3149 (make-local-variable 'adaptive-fill-first-line-regexp)
3155 (let ((quote-prefix-regexp 3150 (let ((quote-prefix-regexp
3156 ;; User should change message-cite-prefix-regexp if 3151 ;; User should change message-cite-prefix-regexp if
3157 ;; message-yank-prefix is set to an abnormal value. 3152 ;; message-yank-prefix is set to an abnormal value.
3158 (concat "\\(" message-cite-prefix-regexp "\\)[ \t]*"))) 3153 (concat "\\(" message-cite-prefix-regexp "\\)[ \t]*")))
3159 (setq paragraph-start 3154 (setq-local paragraph-start
3160 (concat 3155 (concat
3161 (regexp-quote mail-header-separator) "$\\|" 3156 (regexp-quote mail-header-separator) "$\\|"
3162 "[ \t]*$\\|" ; blank lines 3157 "[ \t]*$\\|" ; blank lines
3163 "-- $\\|" ; signature delimiter 3158 "-- $\\|" ; signature delimiter
3164 "---+$\\|" ; delimiters for forwarded messages 3159 "---+$\\|" ; delimiters for forwarded messages
3165 page-delimiter "$\\|" ; spoiler warnings 3160 page-delimiter "$\\|" ; spoiler warnings
3166 ".*wrote:$\\|" ; attribution lines 3161 ".*wrote:$\\|" ; attribution lines
3167 quote-prefix-regexp "$\\|" ; empty lines in quoted text 3162 quote-prefix-regexp "$\\|" ; empty lines in quoted text
3168 ; mml tags 3163 ; mml tags
3169 "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)")) 3164 "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)"))
3170 (setq paragraph-separate paragraph-start) 3165 (setq-local paragraph-separate paragraph-start)
3171 (setq adaptive-fill-regexp 3166 (setq-local adaptive-fill-regexp
3172 (concat quote-prefix-regexp "\\|" adaptive-fill-regexp)) 3167 (concat quote-prefix-regexp "\\|" adaptive-fill-regexp))
3173 (setq adaptive-fill-first-line-regexp 3168 (setq-local adaptive-fill-first-line-regexp
3174 (concat quote-prefix-regexp "\\|" 3169 (concat quote-prefix-regexp "\\|"
3175 adaptive-fill-first-line-regexp))) 3170 adaptive-fill-first-line-regexp)))
3176 (setq-local auto-fill-inhibit-regexp nil) 3171 (setq-local auto-fill-inhibit-regexp nil)
3177 (setq-local normal-auto-fill-function 'message-do-auto-fill)) 3172 (setq-local normal-auto-fill-function 'message-do-auto-fill))
3178 3173
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index ca610010917..015bc79f455 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -486,7 +486,7 @@ If MODE is not set, try to find mode automatically."
486 ;; support modes, but now that we use font-lock-ensure, support modes 486 ;; support modes, but now that we use font-lock-ensure, support modes
487 ;; aren't a problem any more. So we could probably get rid of this 487 ;; aren't a problem any more. So we could probably get rid of this
488 ;; setting now, but it seems harmless and potentially still useful. 488 ;; setting now, but it seems harmless and potentially still useful.
489 (set (make-local-variable 'font-lock-mode-hook) nil) 489 (setq-local font-lock-mode-hook nil)
490 (setq buffer-file-name (mm-handle-filename handle)) 490 (setq buffer-file-name (mm-handle-filename handle))
491 (with-demoted-errors 491 (with-demoted-errors
492 (if mode 492 (if mode
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 067396fc2a6..47dcb54562c 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -1266,8 +1266,8 @@ See Info node `(emacs-mime)Composing'.
1266 :lighter " MML" :keymap mml-mode-map 1266 :lighter " MML" :keymap mml-mode-map
1267 (when mml-mode 1267 (when mml-mode
1268 (when (boundp 'dnd-protocol-alist) 1268 (when (boundp 'dnd-protocol-alist)
1269 (set (make-local-variable 'dnd-protocol-alist) 1269 (setq-local dnd-protocol-alist
1270 (append mml-dnd-protocol-alist dnd-protocol-alist))))) 1270 (append mml-dnd-protocol-alist dnd-protocol-alist)))))
1271 1271
1272;;; 1272;;;
1273;;; Helper functions for reading MIME stuff from the minibuffer and 1273;;; Helper functions for reading MIME stuff from the minibuffer and
diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el
index ccd17744993..ef520704123 100644
--- a/lisp/gnus/nndiary.el
+++ b/lisp/gnus/nndiary.el
@@ -1002,10 +1002,10 @@ all. This may very well take some time.")
1002 (let ((buffer (gnus-get-buffer-create 1002 (let ((buffer (gnus-get-buffer-create
1003 (format " *nndiary overview %s*" group)))) 1003 (format " *nndiary overview %s*" group))))
1004 (with-current-buffer buffer 1004 (with-current-buffer buffer
1005 (set (make-local-variable 'nndiary-nov-buffer-file-name) 1005 (setq-local nndiary-nov-buffer-file-name
1006 (expand-file-name 1006 (expand-file-name
1007 nndiary-nov-file-name 1007 nndiary-nov-file-name
1008 (nnmail-group-pathname group nndiary-directory))) 1008 (nnmail-group-pathname group nndiary-directory)))
1009 (erase-buffer) 1009 (erase-buffer)
1010 (when (file-exists-p nndiary-nov-buffer-file-name) 1010 (when (file-exists-p nndiary-nov-buffer-file-name)
1011 (nnheader-insert-file-contents nndiary-nov-buffer-file-name))) 1011 (nnheader-insert-file-contents nndiary-nov-buffer-file-name)))
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el
index 6ff99056d84..b7bfd9afd05 100644
--- a/lisp/gnus/nnfolder.el
+++ b/lisp/gnus/nnfolder.el
@@ -1083,7 +1083,7 @@ This command does not work if you use short group names."
1083 (let ((coding-system-for-write 1083 (let ((coding-system-for-write
1084 (or nnfolder-file-coding-system-for-write 1084 (or nnfolder-file-coding-system-for-write
1085 nnfolder-file-coding-system))) 1085 nnfolder-file-coding-system)))
1086 (set (make-local-variable 'copyright-update) nil) 1086 (setq-local copyright-update nil)
1087 (save-buffer))) 1087 (save-buffer)))
1088 (unless (or gnus-nov-is-evil nnfolder-nov-is-evil) 1088 (unless (or gnus-nov-is-evil nnfolder-nov-is-evil)
1089 (nnfolder-save-nov)))) 1089 (nnfolder-save-nov))))
@@ -1098,8 +1098,8 @@ This command does not work if you use short group names."
1098 (or (cdr (assoc group nnfolder-nov-buffer-alist)) 1098 (or (cdr (assoc group nnfolder-nov-buffer-alist))
1099 (let ((buffer (gnus-get-buffer-create (format " *nnfolder overview %s*" group)))) 1099 (let ((buffer (gnus-get-buffer-create (format " *nnfolder overview %s*" group))))
1100 (with-current-buffer buffer 1100 (with-current-buffer buffer
1101 (set (make-local-variable 'nnfolder-nov-buffer-file-name) 1101 (setq-local nnfolder-nov-buffer-file-name
1102 (nnfolder-group-nov-pathname group)) 1102 (nnfolder-group-nov-pathname group))
1103 (erase-buffer) 1103 (erase-buffer)
1104 (when (file-exists-p nnfolder-nov-buffer-file-name) 1104 (when (file-exists-p nnfolder-nov-buffer-file-name)
1105 (nnheader-insert-file-contents nnfolder-nov-buffer-file-name))) 1105 (nnheader-insert-file-contents nnfolder-nov-buffer-file-name)))
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index 2952e20928b..c97622114dc 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -568,7 +568,7 @@ the line could be found."
568 (mm-enable-multibyte) 568 (mm-enable-multibyte)
569 (kill-all-local-variables) 569 (kill-all-local-variables)
570 (setq case-fold-search t) ;Should ignore case. 570 (setq case-fold-search t) ;Should ignore case.
571 (set (make-local-variable 'nntp-process-response) nil) 571 (setq-local nntp-process-response nil)
572 t)) 572 t))
573 573
574;;; Various functions the backends use. 574;;; Various functions the backends use.
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index c8b700ebcc6..61693a08b98 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -376,10 +376,10 @@ during splitting, which may be slow."
376 (mm-disable-multibyte) 376 (mm-disable-multibyte)
377 (buffer-disable-undo) 377 (buffer-disable-undo)
378 (gnus-add-buffer) 378 (gnus-add-buffer)
379 (set (make-local-variable 'after-change-functions) nil) ;FIXME: Why? 379 (setq-local after-change-functions nil) ;FIXME: Why?
380 (set (make-local-variable 'nnimap-object) 380 (setq-local nnimap-object
381 (make-nnimap :server (nnoo-current-server 'nnimap) 381 (make-nnimap :server (nnoo-current-server 'nnimap)
382 :initial-resync 0)) 382 :initial-resync 0))
383 (push (list buffer (current-buffer)) nnimap-connection-alist) 383 (push (list buffer (current-buffer)) nnimap-connection-alist)
384 (push (current-buffer) nnimap-process-buffers) 384 (push (current-buffer) nnimap-process-buffers)
385 (current-buffer))) 385 (current-buffer)))
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index ad608b6575e..c648e3aae7c 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -778,8 +778,8 @@ article number. This function is called narrowed to an article."
778 group))) 778 group)))
779 (file-name-coding-system nnmail-pathname-coding-system)) 779 (file-name-coding-system nnmail-pathname-coding-system))
780 (with-current-buffer buffer 780 (with-current-buffer buffer
781 (set (make-local-variable 'nnml-nov-buffer-file-name) 781 (setq-local nnml-nov-buffer-file-name
782 (nnmail-group-pathname group nnml-directory nnml-nov-file-name)) 782 (nnmail-group-pathname group nnml-directory nnml-nov-file-name))
783 (erase-buffer) 783 (erase-buffer)
784 (when (and (not incrementalp) 784 (when (and (not incrementalp)
785 (file-exists-p nnml-nov-buffer-file-name)) 785 (file-exists-p nnml-nov-buffer-file-name))
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index d5b8df98189..0ed834266f9 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1139,8 +1139,7 @@ it is displayed along with the global value."
1139 (when (looking-at "value is") (replace-match "")) 1139 (when (looking-at "value is") (replace-match ""))
1140 (save-excursion 1140 (save-excursion
1141 (insert "\n\nValue:") 1141 (insert "\n\nValue:")
1142 (set (make-local-variable 'help-button-cache) 1142 (setq-local help-button-cache (point-marker)))
1143 (point-marker)))
1144 (insert "value is shown ") 1143 (insert "value is shown ")
1145 (insert-button "below" 1144 (insert-button "below"
1146 'action help-button-cache 1145 'action help-button-cache
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 732e6cc28dd..025a67016b6 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -319,10 +319,10 @@ The format is (FUNCTION ARGS...).")
319Entry to this mode runs the normal hook `help-mode-hook'. 319Entry to this mode runs the normal hook `help-mode-hook'.
320Commands: 320Commands:
321\\{help-mode-map}" 321\\{help-mode-map}"
322 (set (make-local-variable 'revert-buffer-function) 322 (setq-local revert-buffer-function
323 'help-mode-revert-buffer) 323 #'help-mode-revert-buffer)
324 (set (make-local-variable 'bookmark-make-record-function) 324 (setq-local bookmark-make-record-function
325 'help-bookmark-make-record)) 325 #'help-bookmark-make-record))
326 326
327;;;###autoload 327;;;###autoload
328(defun help-mode-setup () 328(defun help-mode-setup ()
diff --git a/lisp/hexl.el b/lisp/hexl.el
index 5d813c410c2..1fe9aad66de 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -722,7 +722,10 @@ With prefix arg N, puts point N bytes of the way from the true beginning."
722 "Scroll hexl buffer window upward ARG lines; or near full window if no ARG." 722 "Scroll hexl buffer window upward ARG lines; or near full window if no ARG."
723 (interactive "P") 723 (interactive "P")
724 (setq arg (if (null arg) 724 (setq arg (if (null arg)
725 (1- (window-height)) 725 (- (window-height)
726 1
727 (if ruler-mode 1 0)
728 next-screen-context-lines)
726 (prefix-numeric-value arg))) 729 (prefix-numeric-value arg)))
727 (hexl-scroll-up (- arg))) 730 (hexl-scroll-up (- arg)))
728 731
@@ -731,7 +734,10 @@ With prefix arg N, puts point N bytes of the way from the true beginning."
731If there's no byte at the target address, move to the first or last line." 734If there's no byte at the target address, move to the first or last line."
732 (interactive "P") 735 (interactive "P")
733 (setq arg (if (null arg) 736 (setq arg (if (null arg)
734 (1- (window-height)) 737 (- (window-height)
738 1
739 (if ruler-mode 1 0)
740 next-screen-context-lines)
735 (prefix-numeric-value arg))) 741 (prefix-numeric-value arg)))
736 (let* ((movement (* arg 16)) 742 (let* ((movement (* arg 16))
737 (address (hexl-current-address)) 743 (address (hexl-current-address))
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 00ba868d78f..7269af3fe04 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -2464,7 +2464,7 @@ FORMATS is the value to use for `ibuffer-formats'.
2464 (require 'ibuf-ext) 2464 (require 'ibuf-ext)
2465 (setq ibuffer-filter-groups filter-groups)) 2465 (setq ibuffer-filter-groups filter-groups))
2466 (when formats 2466 (when formats
2467 (set (make-local-variable 'ibuffer-formats) formats)) 2467 (setq-local ibuffer-formats formats))
2468 (ibuffer-update nil) 2468 (ibuffer-update nil)
2469 ;; Skip the group name by default. 2469 ;; Skip the group name by default.
2470 (ibuffer-forward-line 0 t) 2470 (ibuffer-forward-line 0 t)
@@ -2683,7 +2683,7 @@ You may rearrange filter groups by using the usual pair
2683`\\[ibuffer-kill-line]' and `\\[ibuffer-yank]'. Yanked groups 2683`\\[ibuffer-kill-line]' and `\\[ibuffer-yank]'. Yanked groups
2684will be inserted before the group at point." 2684will be inserted before the group at point."
2685 ;; Include state info next to the mode name. 2685 ;; Include state info next to the mode name.
2686 (set (make-local-variable 'mode-line-process) 2686 (setq-local mode-line-process
2687 '(" by " 2687 '(" by "
2688 (ibuffer-sorting-mode (:eval (symbol-name ibuffer-sorting-mode)) 2688 (ibuffer-sorting-mode (:eval (symbol-name ibuffer-sorting-mode))
2689 "view time") 2689 "view time")
@@ -2712,28 +2712,27 @@ will be inserted before the group at point."
2712 (setq show-trailing-whitespace nil) 2712 (setq show-trailing-whitespace nil)
2713 ;; disable `show-paren-mode' buffer-locally 2713 ;; disable `show-paren-mode' buffer-locally
2714 (if (bound-and-true-p show-paren-mode) 2714 (if (bound-and-true-p show-paren-mode)
2715 (set (make-local-variable 'show-paren-mode) nil)) 2715 (setq-local show-paren-mode nil))
2716 (set (make-local-variable 'revert-buffer-function) 2716 (setq-local revert-buffer-function #'ibuffer-update)
2717 #'ibuffer-update) 2717 (setq-local ibuffer-sorting-mode
2718 (set (make-local-variable 'ibuffer-sorting-mode) 2718 ibuffer-default-sorting-mode)
2719 ibuffer-default-sorting-mode) 2719 (setq-local ibuffer-sorting-reversep
2720 (set (make-local-variable 'ibuffer-sorting-reversep) 2720 ibuffer-default-sorting-reversep)
2721 ibuffer-default-sorting-reversep) 2721 (setq-local ibuffer-shrink-to-minimum-size
2722 (set (make-local-variable 'ibuffer-shrink-to-minimum-size) 2722 ibuffer-default-shrink-to-minimum-size)
2723 ibuffer-default-shrink-to-minimum-size) 2723 (setq-local ibuffer-display-maybe-show-predicates
2724 (set (make-local-variable 'ibuffer-display-maybe-show-predicates) 2724 ibuffer-default-display-maybe-show-predicates)
2725 ibuffer-default-display-maybe-show-predicates) 2725 (setq-local ibuffer-filtering-qualifiers nil)
2726 (set (make-local-variable 'ibuffer-filtering-qualifiers) nil) 2726 (setq-local ibuffer-filter-groups nil)
2727 (set (make-local-variable 'ibuffer-filter-groups) nil) 2727 (setq-local ibuffer-filter-group-kill-ring nil)
2728 (set (make-local-variable 'ibuffer-filter-group-kill-ring) nil) 2728 (setq-local ibuffer-hidden-filter-groups nil)
2729 (set (make-local-variable 'ibuffer-hidden-filter-groups) nil) 2729 (setq-local ibuffer-compiled-formats nil)
2730 (set (make-local-variable 'ibuffer-compiled-formats) nil) 2730 (setq-local ibuffer-cached-formats nil)
2731 (set (make-local-variable 'ibuffer-cached-formats) nil) 2731 (setq-local ibuffer-cached-eliding-string nil)
2732 (set (make-local-variable 'ibuffer-cached-eliding-string) nil) 2732 (setq-local ibuffer-current-format nil)
2733 (set (make-local-variable 'ibuffer-current-format) nil) 2733 (setq-local ibuffer-did-modification nil)
2734 (set (make-local-variable 'ibuffer-did-modification) nil) 2734 (setq-local ibuffer-tmp-hide-regexps nil)
2735 (set (make-local-variable 'ibuffer-tmp-hide-regexps) nil) 2735 (setq-local ibuffer-tmp-show-regexps nil)
2736 (set (make-local-variable 'ibuffer-tmp-show-regexps) nil)
2737 (define-key ibuffer-mode-map [menu-bar edit] 'undefined) 2736 (define-key ibuffer-mode-map [menu-bar edit] 'undefined)
2738 (define-key ibuffer-mode-map [menu-bar operate] (cons "Operate" ibuffer-mode-operate-map)) 2737 (define-key ibuffer-mode-map [menu-bar operate] (cons "Operate" ibuffer-mode-operate-map))
2739 (ibuffer-update-format) 2738 (ibuffer-update-format)
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 9c1470812ab..0fdacd0a3c6 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -75,12 +75,7 @@ everything preceding the ~/ is discarded so the interactive
75selection process starts again from the user's $HOME.") 75selection process starts again from the user's $HOME.")
76 76
77(defcustom icomplete-show-matches-on-no-input nil 77(defcustom icomplete-show-matches-on-no-input nil
78 "If nil, don't wait for completions before showing the prompt. 78 "When non-nil, show completions when the minibuffer is empty.
79Instead, when there's no input, completions may be displayed
80asynchronously later, when the completions have been computed.
81
82If non-nil, always compute the completions first.
83
84This also means that if you traverse the list of completions with 79This also means that if you traverse the list of completions with
85commands like `C-.' and just hit RET without typing any 80commands like `C-.' and just hit RET without typing any
86characters, the match under point will be chosen instead of the 81characters, the match under point will be chosen instead of the
@@ -446,7 +441,7 @@ Conditions are:
446 "Run in minibuffer on activation to establish incremental completion. 441 "Run in minibuffer on activation to establish incremental completion.
447Usually run by inclusion in `minibuffer-setup-hook'." 442Usually run by inclusion in `minibuffer-setup-hook'."
448 (when (and icomplete-mode (icomplete-simple-completing-p)) 443 (when (and icomplete-mode (icomplete-simple-completing-p))
449 (set (make-local-variable 'completion-show-inline-help) nil) 444 (setq-local completion-show-inline-help nil)
450 (use-local-map (make-composed-keymap icomplete-minibuffer-map 445 (use-local-map (make-composed-keymap icomplete-minibuffer-map
451 (current-local-map))) 446 (current-local-map)))
452 (add-hook 'pre-command-hook #'icomplete-pre-command-hook nil t) 447 (add-hook 'pre-command-hook #'icomplete-pre-command-hook nil t)
@@ -469,7 +464,7 @@ Usually run by inclusion in `minibuffer-setup-hook'."
469 (when (and completion-in-region-mode 464 (when (and completion-in-region-mode
470 icomplete-mode (icomplete-simple-completing-p)) 465 icomplete-mode (icomplete-simple-completing-p))
471 (setq icomplete--in-region-buffer (current-buffer)) 466 (setq icomplete--in-region-buffer (current-buffer))
472 (set (make-local-variable 'completion-show-inline-help) nil) 467 (setq-local completion-show-inline-help nil)
473 (let ((tem (assq 'completion-in-region-mode 468 (let ((tem (assq 'completion-in-region-mode
474 minor-mode-overriding-map-alist))) 469 minor-mode-overriding-map-alist)))
475 (unless (memq icomplete-minibuffer-map (cdr tem)) 470 (unless (memq icomplete-minibuffer-map (cdr tem))
diff --git a/lisp/ido.el b/lisp/ido.el
index c83b700e656..5758d3fdeac 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -3966,7 +3966,7 @@ If `ido-change-word-sub' cannot be found in WORD, return nil."
3966 (boundp 'ido-completion-buffer-full)) 3966 (boundp 'ido-completion-buffer-full))
3967 (set-window-start win (point-min)) 3967 (set-window-start win (point-min))
3968 (with-no-warnings 3968 (with-no-warnings
3969 (set (make-local-variable 'ido-completion-buffer-full) t)) 3969 (setq-local ido-completion-buffer-full t))
3970 (setq full-list t 3970 (setq full-list t
3971 display-it t)) 3971 display-it t))
3972 (scroll-other-window)) 3972 (scroll-other-window))
@@ -4810,8 +4810,7 @@ Modified from `icomplete-completions'."
4810 (delete-region ido-eoinput (point-max)))) 4810 (delete-region ido-eoinput (point-max))))
4811 4811
4812 ;; Reestablish the local variable 'cause minibuffer-setup is weird: 4812 ;; Reestablish the local variable 'cause minibuffer-setup is weird:
4813 (make-local-variable 'ido-eoinput) 4813 (setq-local ido-eoinput 1))))
4814 (setq ido-eoinput 1))))
4815 4814
4816(defun ido-summary-buffers-to-end () 4815(defun ido-summary-buffers-to-end ()
4817 ;; Move the summaries to the end of the buffer list. 4816 ;; Move the summaries to the end of the buffer list.
diff --git a/lisp/ielm.el b/lisp/ielm.el
index 91d025dd5dd..b958389ea57 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -529,8 +529,8 @@ Customized bindings may be defined in `ielm-map', which currently contains:
529 :syntax-table emacs-lisp-mode-syntax-table 529 :syntax-table emacs-lisp-mode-syntax-table
530 530
531 (setq comint-prompt-regexp (concat "^" (regexp-quote ielm-prompt))) 531 (setq comint-prompt-regexp (concat "^" (regexp-quote ielm-prompt)))
532 (set (make-local-variable 'paragraph-separate) "\\'") 532 (setq-local paragraph-separate "\\'")
533 (set (make-local-variable 'paragraph-start) comint-prompt-regexp) 533 (setq-local paragraph-start comint-prompt-regexp)
534 (setq comint-input-sender 'ielm-input-sender) 534 (setq comint-input-sender 'ielm-input-sender)
535 (setq comint-process-echoes nil) 535 (setq comint-process-echoes nil)
536 (dolist (f '(elisp-completion-at-point 536 (dolist (f '(elisp-completion-at-point
@@ -541,28 +541,28 @@ Customized bindings may be defined in `ielm-map', which currently contains:
541 #'elisp-eldoc-var-docstring nil t) 541 #'elisp-eldoc-var-docstring nil t)
542 (add-hook 'eldoc-documentation-functions 542 (add-hook 'eldoc-documentation-functions
543 #'elisp-eldoc-funcall nil t) 543 #'elisp-eldoc-funcall nil t)
544 (set (make-local-variable 'ielm-prompt-internal) ielm-prompt) 544 (setq-local ielm-prompt-internal ielm-prompt)
545 (set (make-local-variable 'comint-prompt-read-only) ielm-prompt-read-only) 545 (setq-local comint-prompt-read-only ielm-prompt-read-only)
546 (setq comint-get-old-input 'ielm-get-old-input) 546 (setq comint-get-old-input 'ielm-get-old-input)
547 (set (make-local-variable 'comint-completion-addsuffix) '("/" . "")) 547 (setq-local comint-completion-addsuffix '("/" . ""))
548 (setq mode-line-process '(":%s on " (:eval (buffer-name ielm-working-buffer)))) 548 (setq mode-line-process '(":%s on " (:eval (buffer-name ielm-working-buffer))))
549 ;; Useful for `hs-minor-mode'. 549 ;; Useful for `hs-minor-mode'.
550 (setq-local comment-start ";") 550 (setq-local comment-start ";")
551 (setq-local comment-use-syntax t) 551 (setq-local comment-use-syntax t)
552 (setq-local lexical-binding t) 552 (setq-local lexical-binding t)
553 553
554 (set (make-local-variable 'indent-line-function) #'ielm-indent-line) 554 (setq-local indent-line-function #'ielm-indent-line)
555 (set (make-local-variable 'ielm-working-buffer) (current-buffer)) 555 (setq-local ielm-working-buffer (current-buffer))
556 (set (make-local-variable 'fill-paragraph-function) #'lisp-fill-paragraph) 556 (setq-local fill-paragraph-function #'lisp-fill-paragraph)
557 557
558 ;; Value holders 558 ;; Value holders
559 (set (make-local-variable '*) nil) 559 (setq-local * nil)
560 (set (make-local-variable '**) nil) 560 (setq-local ** nil)
561 (set (make-local-variable '***) nil) 561 (setq-local *** nil)
562 (set (make-local-variable 'ielm-match-data) nil) 562 (setq-local ielm-match-data nil)
563 563
564 ;; font-lock support 564 ;; font-lock support
565 (set (make-local-variable 'font-lock-defaults) 565 (setq-local font-lock-defaults
566 '(ielm-font-lock-keywords nil nil ((?: . "w") (?- . "w") (?* . "w")))) 566 '(ielm-font-lock-keywords nil nil ((?: . "w") (?- . "w") (?* . "w"))))
567 567
568 ;; A dummy process to keep comint happy. It will never get any input 568 ;; 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:
577 577
578 ;; Lisp output can include raw characters that confuse comint's 578 ;; Lisp output can include raw characters that confuse comint's
579 ;; carriage control code. 579 ;; carriage control code.
580 (set (make-local-variable 'comint-inhibit-carriage-motion) t) 580 (setq-local comint-inhibit-carriage-motion t)
581 581
582 ;; Add a silly header 582 ;; Add a silly header
583 (insert ielm-header) 583 (insert ielm-header)
diff --git a/lisp/image.el b/lisp/image.el
index 9ebb603086e..023d64fc4ee 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -679,8 +679,10 @@ BUFFER nil or omitted means use the current buffer."
679 (setq path (cdr path))) 679 (setq path (cdr path)))
680 (if found filename))) 680 (if found filename)))
681 681
682(defvar find-image--cache (make-hash-table :test #'equal))
683
682;;;###autoload 684;;;###autoload
683(defun find-image (specs) 685(defun find-image (specs &optional cache)
684 "Find an image, choosing one of a list of image specifications. 686 "Find an image, choosing one of a list of image specifications.
685 687
686SPECS is a list of image specifications. 688SPECS is a list of image specifications.
@@ -695,26 +697,33 @@ is supported, and FILE exists, is used to construct the image
695specification to be returned. Return nil if no specification is 697specification to be returned. Return nil if no specification is
696satisfied. 698satisfied.
697 699
700If CACHE is non-nil, results are cached and returned on subsequent calls.
701
698The image is looked for in `image-load-path'. 702The image is looked for in `image-load-path'.
699 703
700Image files should not be larger than specified by `max-image-size'." 704Image files should not be larger than specified by `max-image-size'."
701 (let (image) 705 (or (and cache
702 (while (and specs (null image)) 706 (gethash specs find-image--cache))
703 (let* ((spec (car specs)) 707 (let ((orig-specs specs)
704 (type (plist-get spec :type)) 708 image)
705 (data (plist-get spec :data)) 709 (while (and specs (null image))
706 (file (plist-get spec :file)) 710 (let* ((spec (car specs))
707 found) 711 (type (plist-get spec :type))
708 (when (image-type-available-p type) 712 (data (plist-get spec :data))
709 (cond ((stringp file) 713 (file (plist-get spec :file))
710 (if (setq found (image-search-load-path file)) 714 found)
711 (setq image 715 (when (image-type-available-p type)
712 (cons 'image (plist-put (copy-sequence spec) 716 (cond ((stringp file)
713 :file found))))) 717 (if (setq found (image-search-load-path file))
714 ((not (null data)) 718 (setq image
715 (setq image (cons 'image spec))))) 719 (cons 'image (plist-put (copy-sequence spec)
716 (setq specs (cdr specs)))) 720 :file found)))))
717 image)) 721 ((not (null data))
722 (setq image (cons 'image spec)))))
723 (setq specs (cdr specs))))
724 (when cache
725 (setf (gethash orig-specs find-image--cache) image))
726 image)))
718 727
719 728
720;;;###autoload 729;;;###autoload
diff --git a/lisp/image/exif.el b/lisp/image/exif.el
index 6aeb52c726d..e328fcce5a8 100644
--- a/lisp/image/exif.el
+++ b/lisp/image/exif.el
@@ -165,7 +165,7 @@ If the orientation isn't present in the data, return nil."
165 ;; Another magical number. 165 ;; Another magical number.
166 (unless (= (exif--read-number 2 le) #x002a) 166 (unless (= (exif--read-number 2 le) #x002a)
167 (signal 'exif-error "Invalid TIFF header length")) 167 (signal 'exif-error "Invalid TIFF header length"))
168 (let ((offset (exif--read-number 2 le))) 168 (let ((offset (exif--read-number 4 le)))
169 ;; Jump to where the IFD (directory) starts and parse it. 169 ;; Jump to where the IFD (directory) starts and parse it.
170 (when (> (1+ offset) (point-max)) 170 (when (> (1+ offset) (point-max))
171 (signal 'exif-error "Invalid IFD (directory) offset")) 171 (signal 'exif-error "Invalid IFD (directory) offset"))
diff --git a/lisp/info.el b/lisp/info.el
index c3684deb96b..c049aa88a5d 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2473,7 +2473,7 @@ Table of contents is created from the tree structure of menus."
2473 (setq bound (or (and (equal nodename "Top") 2473 (setq bound (or (and (equal nodename "Top")
2474 (save-excursion 2474 (save-excursion
2475 (re-search-forward 2475 (re-search-forward
2476 "^[ \t-]*The Detailed Node Listing" nil t))) 2476 "^[ \t-]*The Detailed Node Listing" nil t)))
2477 bound)) 2477 bound))
2478 (while (< (point) bound) 2478 (while (< (point) bound)
2479 (cond 2479 (cond
@@ -4790,10 +4790,10 @@ first line or header line, and for breadcrumb links.")
4790 ;; an end of sentence 4790 ;; an end of sentence
4791 (skip-syntax-backward " (")) 4791 (skip-syntax-backward " ("))
4792 (setq other-tag 4792 (setq other-tag
4793 (cond ((save-match-data (looking-back "\\<see" 4793 (cond ((save-match-data (looking-back "\\(^\\| \\)see"
4794 (- (point) 3))) 4794 (- (point) 3)))
4795 "") 4795 "")
4796 ((save-match-data (looking-back "\\<in" 4796 ((save-match-data (looking-back "\\(^\\| \\)in"
4797 (- (point) 2))) 4797 (- (point) 2)))
4798 "") 4798 "")
4799 ((memq (char-before) '(nil ?\. ?! ??)) 4799 ((memq (char-before) '(nil ?\. ?! ??))
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index 0b6920cf180..5f610ddf670 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -759,7 +759,14 @@ with L, LRE, or LRO Unicode bidi character type.")
759 (funcall map-unicode-property 'uppercase 759 (funcall map-unicode-property 'uppercase
760 (lambda (lc uc) (aset up lc uc) (aset up uc uc))) 760 (lambda (lc uc) (aset up lc uc) (aset up uc uc)))
761 (funcall map-unicode-property 'lowercase 761 (funcall map-unicode-property 'lowercase
762 (lambda (uc lc) (aset down uc lc) (aset down lc lc)))))) 762 (lambda (uc lc) (aset down uc lc) (aset down lc lc)))
763
764 ;; Override the Unicode uppercase property for ß, since we are
765 ;; using our case tables for determining the case of a
766 ;; character (see uppercasep and lowercasep in buffer.h).
767 ;; The special-uppercase property of ß ensures that it is
768 ;; still upcased to SS per the usual convention.
769 (aset up ?ß ?ẞ))))
763 770
764 ;; Clear out the extra slots so that they will be recomputed from the main 771 ;; Clear out the extra slots so that they will be recomputed from the main
765 ;; (downcase) table and upcase table. Since we’re side-stepping the usual 772 ;; (downcase) table and upcase table. Since we’re side-stepping the usual
diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el
index f50f86a035f..867a3d86973 100644
--- a/lisp/international/isearch-x.el
+++ b/lisp/international/isearch-x.el
@@ -35,9 +35,8 @@
35 (interactive) 35 (interactive)
36 (let ((overriding-terminal-local-map nil)) 36 (let ((overriding-terminal-local-map nil))
37 (toggle-input-method t)) 37 (toggle-input-method t))
38 (setq isearch-input-method-function input-method-function 38 (setq isearch-input-method-function input-method-function)
39 isearch-input-method-local-p t) 39 (setq-local input-method-function nil)
40 (setq input-method-function nil)
41 (isearch-update)) 40 (isearch-update))
42 41
43;;;###autoload 42;;;###autoload
@@ -46,9 +45,8 @@
46 (interactive) 45 (interactive)
47 (let ((overriding-terminal-local-map nil)) 46 (let ((overriding-terminal-local-map nil))
48 (toggle-input-method)) 47 (toggle-input-method))
49 (setq isearch-input-method-function input-method-function 48 (setq isearch-input-method-function input-method-function)
50 isearch-input-method-local-p t) 49 (setq-local input-method-function nil)
51 (setq input-method-function nil)
52 (isearch-update)) 50 (isearch-update))
53 51
54;;;###autoload 52;;;###autoload
@@ -57,9 +55,8 @@
57 (interactive) 55 (interactive)
58 (let ((overriding-terminal-local-map nil)) 56 (let ((overriding-terminal-local-map nil))
59 (activate-transient-input-method)) 57 (activate-transient-input-method))
60 (setq isearch-input-method-function input-method-function 58 (setq isearch-input-method-function input-method-function)
61 isearch-input-method-local-p t) 59 (setq-local input-method-function nil)
62 (setq input-method-function nil)
63 (isearch-update)) 60 (isearch-update))
64 61
65(defvar isearch-minibuffer-local-map 62(defvar isearch-minibuffer-local-map
diff --git a/lisp/international/robin.el b/lisp/international/robin.el
index 94d2bf18088..16cac07c773 100644
--- a/lisp/international/robin.el
+++ b/lisp/international/robin.el
@@ -424,8 +424,7 @@ While this input method is active, the variable
424 (add-hook 'minibuffer-exit-hook 'robin-exit-from-minibuffer)) 424 (add-hook 'minibuffer-exit-hook 'robin-exit-from-minibuffer))
425 (run-hooks 'input-method-activate-hook 425 (run-hooks 'input-method-activate-hook
426 'robin-activate-hook) 426 'robin-activate-hook)
427 (set (make-local-variable 'input-method-function) 427 (setq-local input-method-function 'robin-input-method)))
428 'robin-input-method)))
429 428
430(define-obsolete-variable-alias 429(define-obsolete-variable-alias
431 'robin-inactivate-hook 430 'robin-inactivate-hook
diff --git a/lisp/isearch.el b/lisp/isearch.el
index a0aa250c4b6..0d5c480c8d4 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -965,10 +965,6 @@ Each element is an `isearch--state' struct where the slots are
965;; The value of input-method-function when isearch is invoked. 965;; The value of input-method-function when isearch is invoked.
966(defvar isearch-input-method-function nil) 966(defvar isearch-input-method-function nil)
967 967
968;; A flag to tell if input-method-function is locally bound when
969;; isearch is invoked.
970(defvar isearch-input-method-local-p nil)
971
972(defvar isearch--saved-overriding-local-map nil) 968(defvar isearch--saved-overriding-local-map nil)
973 969
974;; Minor-mode-alist changes - kind of redundant with the 970;; Minor-mode-alist changes - kind of redundant with the
@@ -1238,7 +1234,6 @@ used to set the value of `isearch-regexp-function'."
1238 search-ring-yank-pointer nil 1234 search-ring-yank-pointer nil
1239 isearch-opened-overlays nil 1235 isearch-opened-overlays nil
1240 isearch-input-method-function input-method-function 1236 isearch-input-method-function input-method-function
1241 isearch-input-method-local-p (local-variable-p 'input-method-function)
1242 regexp-search-ring-yank-pointer nil 1237 regexp-search-ring-yank-pointer nil
1243 1238
1244 isearch-pre-scroll-point nil 1239 isearch-pre-scroll-point nil
@@ -1259,9 +1254,7 @@ used to set the value of `isearch-regexp-function'."
1259 ;; We must bypass input method while reading key. When a user type 1254 ;; We must bypass input method while reading key. When a user type
1260 ;; printable character, appropriate input method is turned on in 1255 ;; printable character, appropriate input method is turned on in
1261 ;; minibuffer to read multibyte characters. 1256 ;; minibuffer to read multibyte characters.
1262 (or isearch-input-method-local-p 1257 (setq-local input-method-function nil)
1263 (make-local-variable 'input-method-function))
1264 (setq input-method-function nil)
1265 1258
1266 (looking-at "") 1259 (looking-at "")
1267 (setq isearch-window-configuration 1260 (setq isearch-window-configuration
@@ -1418,8 +1411,8 @@ NOPUSH is t and EDIT is t."
1418 (set-window-group-start (selected-window) found-start t)))) 1411 (set-window-group-start (selected-window) found-start t))))
1419 1412
1420 (setq isearch-mode nil) 1413 (setq isearch-mode nil)
1421 (if isearch-input-method-local-p 1414 (if isearch-input-method-function
1422 (setq input-method-function isearch-input-method-function) 1415 (setq-local input-method-function isearch-input-method-function)
1423 (kill-local-variable 'input-method-function)) 1416 (kill-local-variable 'input-method-function))
1424 1417
1425 (if isearch-tool-bar-old-map 1418 (if isearch-tool-bar-old-map
diff --git a/lisp/language/korea-util.el b/lisp/language/korea-util.el
index 3821785da73..36e1d20a22f 100644
--- a/lisp/language/korea-util.el
+++ b/lisp/language/korea-util.el
@@ -70,27 +70,24 @@
70 (interactive) 70 (interactive)
71 (let ((overriding-terminal-local-map nil)) 71 (let ((overriding-terminal-local-map nil))
72 (toggle-korean-input-method)) 72 (toggle-korean-input-method))
73 (setq isearch-input-method-function input-method-function 73 (setq isearch-input-method-function input-method-function)
74 isearch-input-method-local-p t) 74 (setq-local input-method-function nil)
75 (setq input-method-function nil)
76 (isearch-update)) 75 (isearch-update))
77 76
78(defun isearch-hangul-switch-symbol-ksc () 77(defun isearch-hangul-switch-symbol-ksc ()
79 (interactive) 78 (interactive)
80 (let ((overriding-terminal-local-map nil)) 79 (let ((overriding-terminal-local-map nil))
81 (quail-hangul-switch-symbol-ksc)) 80 (quail-hangul-switch-symbol-ksc))
82 (setq isearch-input-method-function input-method-function 81 (setq isearch-input-method-function input-method-function)
83 isearch-input-method-local-p t) 82 (setq-local input-method-function nil)
84 (setq input-method-function nil)
85 (isearch-update)) 83 (isearch-update))
86 84
87(defun isearch-hangul-switch-hanja () 85(defun isearch-hangul-switch-hanja ()
88 (interactive) 86 (interactive)
89 (let ((overriding-terminal-local-map nil)) 87 (let ((overriding-terminal-local-map nil))
90 (quail-hangul-switch-hanja)) 88 (quail-hangul-switch-hanja))
91 (setq isearch-input-method-function input-method-function 89 (setq isearch-input-method-function input-method-function)
92 isearch-input-method-local-p t) 90 (setq-local input-method-function nil)
93 (setq input-method-function nil)
94 (isearch-update)) 91 (isearch-update))
95 92
96;; Information for setting and exiting Korean environment. 93;; Information for setting and exiting Korean environment.
diff --git a/lisp/language/korean.el b/lisp/language/korean.el
index 7e758159a48..9bd11b9b9ea 100644
--- a/lisp/language/korean.el
+++ b/lisp/language/korean.el
@@ -42,6 +42,7 @@
42 42
43(define-coding-system-alias 'euc-kr 'korean-iso-8bit) 43(define-coding-system-alias 'euc-kr 'korean-iso-8bit)
44(define-coding-system-alias 'euc-korea 'korean-iso-8bit) 44(define-coding-system-alias 'euc-korea 'korean-iso-8bit)
45(define-coding-system-alias 'ks_c_5601-1987 'korean-iso-8bit)
45 46
46(define-coding-system 'iso-2022-kr 47(define-coding-system 'iso-2022-kr
47 "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)." 48 "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)."
diff --git a/lisp/leim/quail/hangul.el b/lisp/leim/quail/hangul.el
index b8562556eff..16f8de9cfbe 100644
--- a/lisp/leim/quail/hangul.el
+++ b/lisp/leim/quail/hangul.el
@@ -525,7 +525,7 @@ HELP-TEXT is a text set in `hangul-input-method-help-text'."
525 (quail-delete-overlays) 525 (quail-delete-overlays)
526 (if (eq (selected-window) (minibuffer-window)) 526 (if (eq (selected-window) (minibuffer-window))
527 (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer)) 527 (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer))
528 (set (make-local-variable 'input-method-function) func)) 528 (setq-local input-method-function func))
529 529
530(defun hangul-input-method-deactivate () 530(defun hangul-input-method-deactivate ()
531 "Deactivate the current Hangul input method." 531 "Deactivate the current Hangul input method."
diff --git a/lisp/leim/quail/uni-input.el b/lisp/leim/quail/uni-input.el
index 6f1fbcc9e5a..bee73d8e743 100644
--- a/lisp/leim/quail/uni-input.el
+++ b/lisp/leim/quail/uni-input.el
@@ -105,8 +105,7 @@ While this input method is active, the variable
105 (quail-delete-overlays) 105 (quail-delete-overlays)
106 (if (eq (selected-window) (minibuffer-window)) 106 (if (eq (selected-window) (minibuffer-window))
107 (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer)) 107 (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer))
108 (set (make-local-variable 'input-method-function) 108 (setq-local input-method-function 'ucs-input-method)))
109 'ucs-input-method)))
110 109
111(defun ucs-input-deactivate () 110(defun ucs-input-deactivate ()
112 "Deactivate UCS input method." 111 "Deactivate UCS input method."
diff --git a/lisp/locate.el b/lisp/locate.el
index 44a67ab4840..14fd2608034 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -319,9 +319,9 @@ then `locate-post-command-hook'."
319 (erase-buffer) 319 (erase-buffer)
320 320
321 (setq locate-current-filter filter) 321 (setq locate-current-filter filter)
322 (set (make-local-variable 'locate-local-search) search-string) 322 (setq-local locate-local-search search-string)
323 (set (make-local-variable 'locate-local-filter) filter) 323 (setq-local locate-local-filter filter)
324 (set (make-local-variable 'locate-local-prompt) run-locate-command) 324 (setq-local locate-local-prompt run-locate-command)
325 325
326 (if run-locate-command 326 (if run-locate-command
327 (shell-command search-string locate-buffer-name) 327 (shell-command search-string locate-buffer-name)
@@ -467,8 +467,8 @@ do not work in subdirectories.
467 buffer-read-only t) 467 buffer-read-only t)
468 (add-to-invisibility-spec '(dired . t)) 468 (add-to-invisibility-spec '(dired . t))
469 (dired-alist-add-1 default-directory (point-min-marker)) 469 (dired-alist-add-1 default-directory (point-min-marker))
470 (set (make-local-variable 'dired-directory) "/") 470 (setq-local dired-directory "/")
471 (set (make-local-variable 'dired-subdir-switches) locate-ls-subdir-switches) 471 (setq-local dired-subdir-switches locate-ls-subdir-switches)
472 (setq dired-switches-alist nil) 472 (setq dired-switches-alist nil)
473 ;; This should support both Unix and Windoze style names 473 ;; This should support both Unix and Windoze style names
474 (setq-local directory-listing-before-filename-regexp 474 (setq-local directory-listing-before-filename-regexp
diff --git a/lisp/man.el b/lisp/man.el
index 991b1bb60e5..8430201c562 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1583,10 +1583,10 @@ The following key bindings are currently in effect in the buffer:
1583 (auto-fill-mode -1) 1583 (auto-fill-mode -1)
1584 (setq imenu-generic-expression (list (list nil Man-heading-regexp 0))) 1584 (setq imenu-generic-expression (list (list nil Man-heading-regexp 0)))
1585 (imenu-add-to-menubar man-imenu-title) 1585 (imenu-add-to-menubar man-imenu-title)
1586 (set (make-local-variable 'outline-regexp) Man-heading-regexp) 1586 (setq-local outline-regexp Man-heading-regexp)
1587 (set (make-local-variable 'outline-level) (lambda () 1)) 1587 (setq-local outline-level (lambda () 1))
1588 (set (make-local-variable 'bookmark-make-record-function) 1588 (setq-local bookmark-make-record-function
1589 'Man-bookmark-make-record) 1589 #'Man-bookmark-make-record)
1590 (add-hook 'window-state-change-functions #'Man--window-state-change nil t)) 1590 (add-hook 'window-state-change-functions #'Man--window-state-change nil t))
1591 1591
1592(defun Man-build-section-list () 1592(defun Man-build-section-list ()
diff --git a/lisp/master.el b/lisp/master.el
index 32556a535f3..88baa1f8218 100644
--- a/lisp/master.el
+++ b/lisp/master.el
@@ -96,8 +96,7 @@ yourself the value of `master-of' by calling `master-show-slave'."
96 "Makes BUFFER the slave of the current buffer. 96 "Makes BUFFER the slave of the current buffer.
97Use \\[master-mode] to toggle control of the slave buffer." 97Use \\[master-mode] to toggle control of the slave buffer."
98 (interactive "bSlave: ") 98 (interactive "bSlave: ")
99 (make-local-variable 'master-of) 99 (setq-local master-of buffer)
100 (setq master-of buffer)
101 (run-hooks 'master-set-slave-hook)) 100 (run-hooks 'master-set-slave-hook))
102 101
103(defun master-show-slave () 102(defun master-show-slave ()
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index d44d8968221..456193d52e1 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2067,14 +2067,14 @@ variables.")
2067 (funcall aff-fun completions))) 2067 (funcall aff-fun completions)))
2068 2068
2069 (with-current-buffer standard-output 2069 (with-current-buffer standard-output
2070 (set (make-local-variable 'completion-base-position) 2070 (setq-local completion-base-position
2071 (list (+ start base-size) 2071 (list (+ start base-size)
2072 ;; FIXME: We should pay attention to completion 2072 ;; FIXME: We should pay attention to completion
2073 ;; boundaries here, but currently 2073 ;; boundaries here, but currently
2074 ;; completion-all-completions does not give us the 2074 ;; completion-all-completions does not give us the
2075 ;; necessary information. 2075 ;; necessary information.
2076 end)) 2076 end))
2077 (set (make-local-variable 'completion-list-insert-choice-function) 2077 (setq-local completion-list-insert-choice-function
2078 (let ((ctable minibuffer-completion-table) 2078 (let ((ctable minibuffer-completion-table)
2079 (cpred minibuffer-completion-predicate) 2079 (cpred minibuffer-completion-predicate)
2080 (cprops completion-extra-properties)) 2080 (cprops completion-extra-properties))
@@ -2866,7 +2866,7 @@ See `read-file-name' for the meaning of the arguments."
2866 ;; On the first request on `M-n' fill 2866 ;; On the first request on `M-n' fill
2867 ;; `minibuffer-default' with a list of defaults 2867 ;; `minibuffer-default' with a list of defaults
2868 ;; relevant for file-name reading. 2868 ;; relevant for file-name reading.
2869 (set (make-local-variable 'minibuffer-default-add-function) 2869 (setq-local minibuffer-default-add-function
2870 (lambda () 2870 (lambda ()
2871 (with-current-buffer 2871 (with-current-buffer
2872 (window-buffer (minibuffer-selected-window)) 2872 (window-buffer (minibuffer-selected-window))
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 63e6eedb200..c4b68f1be4e 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -416,6 +416,9 @@ will be killed."
416(defvar rcirc-server-buffer nil 416(defvar rcirc-server-buffer nil
417 "The server buffer associated with this channel buffer.") 417 "The server buffer associated with this channel buffer.")
418 418
419(defvar rcirc-server-parameters nil
420 "List of parameters received from the server.")
421
419(defvar rcirc-target nil 422(defvar rcirc-target nil
420 "The channel or user associated with this buffer.") 423 "The channel or user associated with this buffer.")
421 424
@@ -586,6 +589,7 @@ If ARG is non-nil, instead prompt for connection parameters."
586 (setq-local rcirc-user-disconnect nil) 589 (setq-local rcirc-user-disconnect nil)
587 (setq-local rcirc-user-authenticated nil) 590 (setq-local rcirc-user-authenticated nil)
588 (setq-local rcirc-connecting t) 591 (setq-local rcirc-connecting t)
592 (setq-local rcirc-server-parameters nil)
589 593
590 (add-hook 'auto-save-hook 'rcirc-log-write) 594 (add-hook 'auto-save-hook 'rcirc-log-write)
591 595
@@ -2873,9 +2877,28 @@ Not in rfc1459.txt"
2873(defun rcirc-handler-433 (process sender args text) 2877(defun rcirc-handler-433 (process sender args text)
2874 "ERR_NICKNAMEINUSE" 2878 "ERR_NICKNAMEINUSE"
2875 (rcirc-handler-generic process "433" sender args text) 2879 (rcirc-handler-generic process "433" sender args text)
2876 (let* ((new-nick (concat (cadr args) "`"))) 2880 (with-rcirc-process-buffer process
2877 (with-rcirc-process-buffer process 2881 (let* ((length (string-to-number
2878 (rcirc-cmd-nick new-nick nil process)))) 2882 (or (rcirc-server-parameter-value 'nicklen)
2883 "16"))))
2884 (rcirc-cmd-nick (rcirc--make-new-nick (cadr args) length) nil process))))
2885
2886(defun rcirc--make-new-nick (nick length)
2887 ;; If we already have some ` chars at the end, then shorten the
2888 ;; non-` bit of the name.
2889 (when (= (length nick) length)
2890 (setq nick (replace-regexp-in-string "[^`]\\(`+\\)\\'" "\\1" nick)))
2891 (concat
2892 (if (>= (length nick) length)
2893 (substring nick 0 (1- length))
2894 nick)
2895 "`"))
2896
2897(defun rcirc-handler-005 (process sender args text)
2898 "ERR_NICKNAMEINUSE"
2899 (rcirc-handler-generic process "005" sender args text)
2900 (with-rcirc-process-buffer process
2901 (setq rcirc-server-parameters (append rcirc-server-parameters args))))
2879 2902
2880(defun rcirc-authenticate () 2903(defun rcirc-authenticate ()
2881 "Send authentication to process associated with current buffer. 2904 "Send authentication to process associated with current buffer.
@@ -3072,6 +3095,13 @@ Passwords are stored in `rcirc-authinfo' (which see)."
3072 (>= (point) rcirc-prompt-end-marker)) 3095 (>= (point) rcirc-prompt-end-marker))
3073 3096
3074 3097
3098(defun rcirc-server-parameter-value (parameter)
3099 (cl-loop for elem in rcirc-server-parameters
3100 for setting = (split-string elem "=")
3101 when (and (= (length setting) 2)
3102 (string-equal (downcase (car setting)) parameter))
3103 return (cadr setting)))
3104
3075(provide 'rcirc) 3105(provide 'rcirc)
3076 3106
3077;;; rcirc.el ends here 3107;;; rcirc.el ends here
diff --git a/lisp/net/socks.el b/lisp/net/socks.el
index 9b22a5083fb..cb50a0adbea 100644
--- a/lisp/net/socks.el
+++ b/lisp/net/socks.el
@@ -260,7 +260,7 @@
260 (setq state (process-get proc 'socks-state)) 260 (setq state (process-get proc 'socks-state))
261 (cond 261 (cond
262 ((= state socks-state-waiting-for-auth) 262 ((= state socks-state-waiting-for-auth)
263 (cl-callf (lambda (s) (setq string (concat string s))) 263 (cl-callf (lambda (s) (setq string (concat s string)))
264 (process-get proc 'socks-scratch)) 264 (process-get proc 'socks-scratch))
265 (if (< (length string) 2) 265 (if (< (length string) 2)
266 nil ; We need to spin some more 266 nil ; We need to spin some more
@@ -272,7 +272,7 @@
272 ((= state socks-state-authenticated) 272 ((= state socks-state-authenticated)
273 ) 273 )
274 ((= state socks-state-waiting) 274 ((= state socks-state-waiting)
275 (cl-callf (lambda (s) (setq string (concat string s))) 275 (cl-callf (lambda (s) (setq string (concat s string)))
276 (process-get proc 'socks-scratch)) 276 (process-get proc 'socks-scratch))
277 (setq version (process-get proc 'socks-server-protocol)) 277 (setq version (process-get proc 'socks-server-protocol))
278 (cond 278 (cond
@@ -542,7 +542,7 @@
542 service)) 542 service))
543 (process-put proc 'socks-buffer buffer) 543 (process-put proc 'socks-buffer buffer)
544 (process-put proc 'socks-host host) 544 (process-put proc 'socks-host host)
545 (process-put proc 'socks-service host) 545 (process-put proc 'socks-service service)
546 (set-process-filter proc nil) 546 (set-process-filter proc nil)
547 (set-process-buffer proc (if buffer (get-buffer-create buffer))) 547 (set-process-buffer proc (if buffer (get-buffer-create buffer)))
548 proc)))) 548 proc))))
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 4947d161f3f..f6e89339b68 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1260,6 +1260,9 @@ connection if a previous connection has died for some reason."
1260 (process-put p 'adjust-window-size-function #'ignore) 1260 (process-put p 'adjust-window-size-function #'ignore)
1261 (set-process-query-on-exit-flag p nil) 1261 (set-process-query-on-exit-flag p nil)
1262 1262
1263 ;; Set connection-local variables.
1264 (tramp-set-connection-local-variables vec)
1265
1263 ;; Change prompt. 1266 ;; Change prompt.
1264 (tramp-set-connection-property 1267 (tramp-set-connection-property
1265 p "prompt" (regexp-quote (format "///%s#$" prompt))) 1268 p "prompt" (regexp-quote (format "///%s#$" prompt)))
@@ -1312,9 +1315,6 @@ connection if a previous connection has died for some reason."
1312 (tramp-error 1315 (tramp-error
1313 vec 'file-error "Cannot switch to user `%s'" user))) 1316 vec 'file-error "Cannot switch to user `%s'" user)))
1314 1317
1315 ;; Set connection-local variables.
1316 (tramp-set-connection-local-variables vec)
1317
1318 ;; Mark it as connected. 1318 ;; Mark it as connected.
1319 (tramp-set-connection-property p "connected" t))))))) 1319 (tramp-set-connection-property p "connected" t)))))))
1320 1320
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index f3d03d0fb0a..1722c53be05 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1434,6 +1434,9 @@ If FILE-SYSTEM is non-nil, return file system attributes."
1434 (unless (process-live-p p) 1434 (unless (process-live-p p)
1435 (tramp-error 1435 (tramp-error
1436 p 'file-notify-error "Monitoring not supported for `%s'" file-name)) 1436 p 'file-notify-error "Monitoring not supported for `%s'" file-name))
1437 ;; Set "gio-file-monitor" property. We believe, that "gio
1438 ;; monitor" uses polling when applied for mounted files.
1439 (tramp-set-connection-property p "gio-file-monitor" 'GPollFileMonitor)
1437 p)))) 1440 p))))
1438 1441
1439(defun tramp-gvfs-monitor-process-filter (proc string) 1442(defun tramp-gvfs-monitor-process-filter (proc string)
@@ -2112,7 +2115,10 @@ connection if a previous connection has died for some reason."
2112 :buffer (tramp-get-connection-buffer vec) 2115 :buffer (tramp-get-connection-buffer vec)
2113 :server t :host 'local :service t :noquery t))) 2116 :server t :host 'local :service t :noquery t)))
2114 (process-put p 'vector vec) 2117 (process-put p 'vector vec)
2115 (set-process-query-on-exit-flag p nil))) 2118 (set-process-query-on-exit-flag p nil)
2119
2120 ;; Set connection-local variables.
2121 (tramp-set-connection-local-variables vec)))
2116 2122
2117 (unless (tramp-gvfs-connection-mounted-p vec) 2123 (unless (tramp-gvfs-connection-mounted-p vec)
2118 (let ((method (tramp-file-name-method vec)) 2124 (let ((method (tramp-file-name-method vec))
@@ -2216,9 +2222,6 @@ connection if a previous connection has died for some reason."
2216 (and (functionp tramp-password-save-function) 2222 (and (functionp tramp-password-save-function)
2217 (funcall tramp-password-save-function))) 2223 (funcall tramp-password-save-function)))
2218 2224
2219 ;; Set connection-local variables.
2220 (tramp-set-connection-local-variables vec)
2221
2222 ;; Mark it as connected. 2225 ;; Mark it as connected.
2223 (tramp-set-connection-property 2226 (tramp-set-connection-property
2224 (tramp-get-connection-process vec) "connected" t))))) 2227 (tramp-get-connection-process vec) "connected" t)))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 137f0857f7e..98537a100f3 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3834,6 +3834,10 @@ Fall back to normal file name handler if no Tramp handler exists."
3834 (unless (process-live-p p) 3834 (unless (process-live-p p)
3835 (tramp-error 3835 (tramp-error
3836 p 'file-notify-error "Monitoring not supported for `%s'" file-name)) 3836 p 'file-notify-error "Monitoring not supported for `%s'" file-name))
3837 ;; Set "gio-file-monitor" property if needed.
3838 (when (string-equal (file-name-nondirectory command) "gio")
3839 (tramp-set-connection-property
3840 p "gio-file-monitor" (tramp-get-remote-gio-file-monitor v)))
3837 p)))) 3841 p))))
3838 3842
3839(defun tramp-sh-gio-monitor-process-filter (proc string) 3843(defun tramp-sh-gio-monitor-process-filter (proc string)
@@ -5030,6 +5034,9 @@ connection if a previous connection has died for some reason."
5030 5034
5031 (tramp-message vec 6 "%s" (string-join (process-command p) " ")) 5035 (tramp-message vec 6 "%s" (string-join (process-command p) " "))
5032 5036
5037 ;; Set connection-local variables.
5038 (tramp-set-connection-local-variables vec)
5039
5033 ;; Check whether process is alive. 5040 ;; Check whether process is alive.
5034 (tramp-barf-if-no-shell-prompt 5041 (tramp-barf-if-no-shell-prompt
5035 p 10 5042 p 10
@@ -5139,9 +5146,6 @@ connection if a previous connection has died for some reason."
5139 (setq options "" 5146 (setq options ""
5140 target-alist (cdr target-alist))) 5147 target-alist (cdr target-alist)))
5141 5148
5142 ;; Set connection-local variables.
5143 (tramp-set-connection-local-variables vec)
5144
5145 ;; Activate session timeout. 5149 ;; Activate session timeout.
5146 (when (tramp-get-connection-property p "session-timeout" nil) 5150 (when (tramp-get-connection-property p "session-timeout" nil)
5147 (run-at-time 5151 (run-at-time
@@ -5753,6 +5757,30 @@ This command is returned only if `delete-by-moving-to-trash' is non-nil."
5753 (tramp-message vec 5 "Finding a suitable `gio-monitor' command") 5757 (tramp-message vec 5 "Finding a suitable `gio-monitor' command")
5754 (tramp-find-executable vec "gio" (tramp-get-remote-path vec) t t))) 5758 (tramp-find-executable vec "gio" (tramp-get-remote-path vec) t t)))
5755 5759
5760(defun tramp-get-remote-gio-file-monitor (vec)
5761 "Determine remote GFileMonitor."
5762 (with-tramp-connection-property vec "gio-file-monitor"
5763 (with-current-buffer (tramp-get-connection-buffer vec)
5764 (tramp-message vec 5 "Finding the used GFileMonitor")
5765 (when-let ((gio (tramp-get-remote-gio-monitor vec)))
5766 ;; Search for the used FileMonitor. There is no known way to
5767 ;; get this information directly from gio, so we check for
5768 ;; linked libraries of libgio.
5769 (when (tramp-send-command-and-check vec (concat "ldd " gio))
5770 (goto-char (point-min))
5771 (when (re-search-forward "\\S-+/libgio\\S-+")
5772 (when (tramp-send-command-and-check
5773 vec (concat "strings " (match-string 0)))
5774 (goto-char (point-min))
5775 (re-search-forward
5776 (format
5777 "^%s$"
5778 (regexp-opt
5779 '("GFamFileMonitor" "GFenFileMonitor"
5780 "GInotifyFileMonitor" "GKqueueFileMonitor")))
5781 nil 'noerror)
5782 (intern (match-string 0)))))))))
5783
5756(defun tramp-get-remote-gvfs-monitor-dir (vec) 5784(defun tramp-get-remote-gvfs-monitor-dir (vec)
5757 "Determine remote `gvfs-monitor-dir' command." 5785 "Determine remote `gvfs-monitor-dir' command."
5758 (with-tramp-connection-property vec "gvfs-monitor-dir" 5786 (with-tramp-connection-property vec "gvfs-monitor-dir"
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index e5213713320..83c1b58a30d 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -2040,6 +2040,9 @@ If ARGUMENT is non-nil, use it as argument for
2040 (process-put p 'adjust-window-size-function #'ignore) 2040 (process-put p 'adjust-window-size-function #'ignore)
2041 (set-process-query-on-exit-flag p nil) 2041 (set-process-query-on-exit-flag p nil)
2042 2042
2043 ;; Set connection-local variables.
2044 (tramp-set-connection-local-variables vec)
2045
2043 (condition-case err 2046 (condition-case err
2044 (let ((inhibit-message t)) 2047 (let ((inhibit-message t))
2045 ;; Play login scenario. 2048 ;; Play login scenario.
@@ -2073,9 +2076,6 @@ If ARGUMENT is non-nil, use it as argument for
2073 (tramp-set-connection-property p "smb-share" share) 2076 (tramp-set-connection-property p "smb-share" share)
2074 (tramp-set-connection-property p "chunksize" 1) 2077 (tramp-set-connection-property p "chunksize" 1)
2075 2078
2076 ;; Set connection-local variables.
2077 (tramp-set-connection-local-variables vec)
2078
2079 ;; Mark it as connected. 2079 ;; Mark it as connected.
2080 (tramp-set-connection-property p "connected" t)) 2080 (tramp-set-connection-property p "connected" t))
2081 2081
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b3853aa3d6f..6750a7ff4c6 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -5210,6 +5210,8 @@ Invokes `password-read' if available, `read-passwd' else."
5210 (tramp-check-for-regexp proc tramp-password-prompt-regexp) 5210 (tramp-check-for-regexp proc tramp-password-prompt-regexp)
5211 (format "%s for %s " (capitalize (match-string 1)) key)))) 5211 (format "%s for %s " (capitalize (match-string 1)) key))))
5212 (auth-source-creation-prompts `((secret . ,pw-prompt))) 5212 (auth-source-creation-prompts `((secret . ,pw-prompt)))
5213 ;; Use connection-local value.
5214 (auth-sources (with-current-buffer (process-buffer proc) auth-sources))
5213 ;; We suspend the timers while reading the password. 5215 ;; We suspend the timers while reading the password.
5214 (stimers (with-timeout-suspend)) 5216 (stimers (with-timeout-suspend))
5215 auth-info auth-passwd) 5217 auth-info auth-passwd)
@@ -5250,7 +5252,7 @@ Invokes `password-read' if available, `read-passwd' else."
5250 (setq auth-passwd (funcall auth-passwd))) 5252 (setq auth-passwd (funcall auth-passwd)))
5251 auth-passwd) 5253 auth-passwd)
5252 5254
5253 ;; Try the password cache. 5255 ;; Try the password cache. Exists since Emacs 26.1.
5254 (progn 5256 (progn
5255 (setq auth-passwd (password-read pw-prompt key) 5257 (setq auth-passwd (password-read pw-prompt key)
5256 tramp-password-save-function 5258 tramp-password-save-function
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 3eb158dc2c8..5d318bbd2e1 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -304,7 +304,7 @@ This is useful when style-conventions require a certain minimal offset.
304Python's PEP8 for example recommends two spaces, so you could do: 304Python's PEP8 for example recommends two spaces, so you could do:
305 305
306\(add-hook \\='python-mode-hook 306\(add-hook \\='python-mode-hook
307 (lambda () (set (make-local-variable \\='comment-inline-offset) 2))) 307 (lambda () (setq-local comment-inline-offset 2)))
308 308
309See `comment-padding' for whole-line comments." 309See `comment-padding' for whole-line comments."
310 :version "24.3" 310 :version "24.3"
@@ -361,21 +361,21 @@ function should first call this function explicitly."
361 (let ((cs (read-string "No comment syntax is defined. Use: "))) 361 (let ((cs (read-string "No comment syntax is defined. Use: ")))
362 (if (zerop (length cs)) 362 (if (zerop (length cs))
363 (error "No comment syntax defined") 363 (error "No comment syntax defined")
364 (set (make-local-variable 'comment-start) cs) 364 (setq-local comment-start cs)
365 (set (make-local-variable 'comment-start-skip) cs)))) 365 (setq-local comment-start-skip cs))))
366 ;; comment-use-syntax 366 ;; comment-use-syntax
367 (when (eq comment-use-syntax 'undecided) 367 (when (eq comment-use-syntax 'undecided)
368 (set (make-local-variable 'comment-use-syntax) 368 (setq-local comment-use-syntax
369 (let ((st (syntax-table)) 369 (let ((st (syntax-table))
370 (cs comment-start) 370 (cs comment-start)
371 (ce (if (string= "" comment-end) "\n" comment-end))) 371 (ce (if (string= "" comment-end) "\n" comment-end)))
372 ;; Try to skip over a comment using forward-comment 372 ;; Try to skip over a comment using forward-comment
373 ;; to see if the syntax tables properly recognize it. 373 ;; to see if the syntax tables properly recognize it.
374 (with-temp-buffer 374 (with-temp-buffer
375 (set-syntax-table st) 375 (set-syntax-table st)
376 (insert cs " hello " ce) 376 (insert cs " hello " ce)
377 (goto-char (point-min)) 377 (goto-char (point-min))
378 (and (forward-comment 1) (eobp)))))) 378 (and (forward-comment 1) (eobp))))))
379 ;; comment-padding 379 ;; comment-padding
380 (unless comment-padding (setq comment-padding 0)) 380 (unless comment-padding (setq comment-padding 0))
381 (when (integerp comment-padding) 381 (when (integerp comment-padding)
@@ -385,9 +385,9 @@ function should first call this function explicitly."
385 ;;(setq comment-end (comment-string-strip comment-end nil t)) 385 ;;(setq comment-end (comment-string-strip comment-end nil t))
386 ;; comment-continue 386 ;; comment-continue
387 (unless (or comment-continue (string= comment-end "")) 387 (unless (or comment-continue (string= comment-end ""))
388 (set (make-local-variable 'comment-continue) 388 (setq-local comment-continue
389 (concat (if (string-match "\\S-\\S-" comment-start) " " "|") 389 (concat (if (string-match "\\S-\\S-" comment-start) " " "|")
390 (substring comment-start 1))) 390 (substring comment-start 1)))
391 ;; Hasn't been necessary yet. 391 ;; Hasn't been necessary yet.
392 ;; (unless (string-match comment-start-skip comment-continue) 392 ;; (unless (string-match comment-start-skip comment-continue)
393 ;; (kill-local-variable 'comment-continue)) 393 ;; (kill-local-variable 'comment-continue))
@@ -396,29 +396,29 @@ function should first call this function explicitly."
396 (unless (and comment-start-skip 396 (unless (and comment-start-skip
397 ;; In case comment-start has changed since last time. 397 ;; In case comment-start has changed since last time.
398 (string-match comment-start-skip comment-start)) 398 (string-match comment-start-skip comment-start))
399 (set (make-local-variable 'comment-start-skip) 399 (setq-local comment-start-skip
400 (concat (unless (eq comment-use-syntax t) 400 (concat (unless (eq comment-use-syntax t)
401 ;; `syntax-ppss' will detect escaping. 401 ;; `syntax-ppss' will detect escaping.
402 "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)") 402 "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)")
403 "\\(?:\\s<+\\|" 403 "\\(?:\\s<+\\|"
404 (regexp-quote (comment-string-strip comment-start t t)) 404 (regexp-quote (comment-string-strip comment-start t t))
405 ;; Let's not allow any \s- but only [ \t] since \n 405 ;; Let's not allow any \s- but only [ \t] since \n
406 ;; might be both a comment-end marker and \s-. 406 ;; might be both a comment-end marker and \s-.
407 "+\\)[ \t]*"))) 407 "+\\)[ \t]*")))
408 (unless (and comment-end-skip 408 (unless (and comment-end-skip
409 ;; In case comment-end has changed since last time. 409 ;; In case comment-end has changed since last time.
410 (string-match comment-end-skip 410 (string-match comment-end-skip
411 (if (string= "" comment-end) "\n" comment-end))) 411 (if (string= "" comment-end) "\n" comment-end)))
412 (let ((ce (if (string= "" comment-end) "\n" 412 (let ((ce (if (string= "" comment-end) "\n"
413 (comment-string-strip comment-end t t)))) 413 (comment-string-strip comment-end t t))))
414 (set (make-local-variable 'comment-end-skip) 414 (setq-local comment-end-skip
415 ;; We use [ \t] rather than \s- because we don't want to 415 ;; We use [ \t] rather than \s- because we don't want to
416 ;; remove ^L in C mode when uncommenting. 416 ;; remove ^L in C mode when uncommenting.
417 (concat "[ \t]*\\(\\s>" (if comment-quote-nested "" "+") 417 (concat "[ \t]*\\(\\s>" (if comment-quote-nested "" "+")
418 "\\|" (regexp-quote (substring ce 0 1)) 418 "\\|" (regexp-quote (substring ce 0 1))
419 (if (and comment-quote-nested (<= (length ce) 1)) "" "+") 419 (if (and comment-quote-nested (<= (length ce) 1)) "" "+")
420 (regexp-quote (substring ce 1)) 420 (regexp-quote (substring ce 1))
421 "\\)")))))) 421 "\\)"))))))
422 422
423(defun comment-quote-re (str unp) 423(defun comment-quote-re (str unp)
424 (concat (regexp-quote (substring str 0 1)) 424 (concat (regexp-quote (substring str 0 1))
diff --git a/lisp/outline.el b/lisp/outline.el
index 9b11b86b9d2..85f9de4e1b4 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -318,7 +318,7 @@ See the command `outline-mode' for more information on this mode."
318 (add-hook 'change-major-mode-hook 318 (add-hook 'change-major-mode-hook
319 (lambda () (outline-minor-mode -1)) 319 (lambda () (outline-minor-mode -1))
320 nil t) 320 nil t)
321 (set (make-local-variable 'line-move-ignore-invisible) t) 321 (setq-local line-move-ignore-invisible t)
322 ;; Cause use of ellipses for invisible text. 322 ;; Cause use of ellipses for invisible text.
323 (add-to-invisibility-spec '(outline . t))) 323 (add-to-invisibility-spec '(outline . t)))
324 (setq line-move-ignore-invisible nil) 324 (setq line-move-ignore-invisible nil)
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index a744165e0d5..1f3327435e2 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -738,8 +738,8 @@ user actually typed in."
738COMPLETEF-SYM should be the symbol where the 738COMPLETEF-SYM should be the symbol where the
739dynamic-complete-functions are kept. For comint mode itself, 739dynamic-complete-functions are kept. For comint mode itself,
740this is `comint-dynamic-complete-functions'." 740this is `comint-dynamic-complete-functions'."
741 (set (make-local-variable 'pcomplete-parse-arguments-function) 741 (setq-local pcomplete-parse-arguments-function
742 #'pcomplete-parse-comint-arguments) 742 #'pcomplete-parse-comint-arguments)
743 (add-hook 'completion-at-point-functions 743 (add-hook 'completion-at-point-functions
744 #'pcomplete-completions-at-point nil 'local) 744 #'pcomplete-completions-at-point nil 'local)
745 (set (make-local-variable completef-sym) 745 (set (make-local-variable completef-sym)
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el
index 1df28a0f376..45afb51041f 100644
--- a/lisp/play/dunnet.el
+++ b/lisp/play/dunnet.el
@@ -46,10 +46,10 @@
46 46
47;;;; 47;;;;
48;;;; This section defines the globals that are used in dunnet. 48;;;; This section defines the globals that are used in dunnet.
49;;;; 49;;
50;;;; IMPORTANT 50;; IMPORTANT
51;;;; All globals which can change must be saved from 'save-game. Add 51;; All globals which can change must be saved from 'save-game.
52;;;; all new globals to bottom of this section. 52;; Add all new globals to bottom of this section.
53 53
54(defvar dun-visited '(27)) 54(defvar dun-visited '(27))
55(defvar dun-current-room 1) 55(defvar dun-current-room 1)
@@ -771,7 +771,6 @@ A hole leads north."
771) 771)
772 772
773 773
774;;; How the user references *all* objects, permanent and regular.
775(defconst dun-objnames 774(defconst dun-objnames
776 '((shovel . 0) 775 '((shovel . 0)
777 (lamp . 1) 776 (lamp . 1)
@@ -831,7 +830,8 @@ A hole leads north."
831 (ladder . -27) 830 (ladder . -27)
832 (subway . -28) (train . -28) 831 (subway . -28) (train . -28)
833 (pc . -29) (drive . -29) (coconut . -30) (coconuts . -30) 832 (pc . -29) (drive . -29) (coconut . -30) (coconuts . -30)
834 (lake . -32) (water . -32))) 833 (lake . -32) (water . -32))
834 "How the user references *all* objects, permanent and regular.")
835 835
836(dolist (x dun-objnames) 836(dolist (x dun-objnames)
837 (let (name) 837 (let (name)
@@ -840,13 +840,6 @@ A hole leads north."
840 840
841(defconst obj-special 255) 841(defconst obj-special 255)
842 842
843;;; The initial setup of what objects are in each room.
844;;; Regular objects have whole numbers lower than 255.
845;;; Objects that cannot be taken but might move and are
846;;; described during room description are negative.
847;;; Stuff that is described and might change are 255, and are
848;;; handled specially by 'dun-describe-room.
849
850(defvar dun-room-objects (list nil 843(defvar dun-room-objects (list nil
851 844
852 (list obj-shovel) ;; treasure-room 845 (list obj-shovel) ;; treasure-room
@@ -899,10 +892,13 @@ A hole leads north."
899nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil 892nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
900nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil 893nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
901nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil 894nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
902nil)) 895nil)
903 896 "The initial setup of what objects are in each room.
904;;; These are objects in a room that are only described in the 897Regular objects have whole numbers lower than 255.
905;;; room description. They are permanent. 898Objects that cannot be taken but might move and are
899described during room description are negative.
900Stuff that is described and might change are 255, and are
901handled specially by 'dun-describe-room.")
906 902
907(defconst dun-room-silents (list nil 903(defconst dun-room-silents (list nil
908 (list obj-tree obj-coconut) ;; dead-end 904 (list obj-tree obj-coconut) ;; dead-end
@@ -947,12 +943,11 @@ nil))
947 nil nil nil nil nil nil nil nil 943 nil nil nil nil nil nil nil nil
948 (list obj-pc) ;; pc-area 944 (list obj-pc) ;; pc-area
949 nil nil nil nil nil nil 945 nil nil nil nil nil nil
950)) 946 )
947 "These are objects in a room that are only described in the
948room description. They are permanent.")
951(defvar dun-inventory '(1)) 949(defvar dun-inventory '(1))
952 950
953;;; Descriptions of objects, as they appear in the room description, and
954;;; the inventory.
955
956(defconst dun-objects 951(defconst dun-objects
957 '(("There is a shovel here." "A shovel") ;0 952 '(("There is a shovel here." "A shovel") ;0
958 ("There is a lamp nearby." "A lamp") ;1 953 ("There is a lamp nearby." "A lamp") ;1
@@ -982,26 +977,24 @@ nil))
982 ("There is a valuable amethyst here." "An amethyst") ;24 977 ("There is a valuable amethyst here." "An amethyst") ;24
983 ("The Mona Lisa is here." "The Mona Lisa") ;25 978 ("The Mona Lisa is here." "The Mona Lisa") ;25
984 ("There is a 100 dollar bill here." "A $100 bill") ;26 979 ("There is a 100 dollar bill here." "A $100 bill") ;26
985 ("There is a floppy disk here." "A floppy disk"))) ;27 980 ("There is a floppy disk here." "A floppy disk")) ;27
986 981 "Descriptions of objects, as they appear in the room description, and
987;;; Weight of objects 982the inventory.")
988 983
989(defconst dun-object-lbs 984(defconst dun-object-lbs
990 '(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)) 985 '(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)
986 "Weight of objects.")
991(defconst dun-object-pts 987(defconst dun-object-pts
992 '(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)) 988 '(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))
993 989
994 990
995;;; Unix representation of objects.
996(defconst dun-objfiles 991(defconst dun-objfiles
997 '("shovel.o" "lamp.o" "cpu.o" "food.o" "key.o" "paper.o" 992 '("shovel.o" "lamp.o" "cpu.o" "food.o" "key.o" "paper.o"
998 "rms.o" "diamond.o" "weight.o" "preserver.o" "bracelet.o" 993 "rms.o" "diamond.o" "weight.o" "preserver.o" "bracelet.o"
999 "gold.o" "platinum.o" "towel.o" "axe.o" "silver.o" "license.o" 994 "gold.o" "platinum.o" "towel.o" "axe.o" "silver.o" "license.o"
1000 "coins.o" "egg.o" "jar.o" "bone.o" "nitric.o" "glycerine.o" 995 "coins.o" "egg.o" "jar.o" "bone.o" "nitric.o" "glycerine.o"
1001 "ruby.o" "amethyst.o")) 996 "ruby.o" "amethyst.o")
1002 997 "Unix representation of objects.")
1003;;; These are the descriptions for the negative numbered objects from
1004;;; dun-room-objects
1005 998
1006(defconst dun-perm-objects 999(defconst dun-perm-objects
1007 '(nil 1000 '(nil
@@ -1016,12 +1009,11 @@ nil))
1016 ("There is a box with a slit in it, bolted to the wall here.") 1009 ("There is a box with a slit in it, bolted to the wall here.")
1017 nil nil 1010 nil nil
1018 ("There is a bus here.") 1011 ("There is a bus here.")
1019 nil nil nil)) 1012 nil nil nil)
1013 "These are the descriptions for the negative numbered objects from
1014`dun-room-objects'.")
1020 1015
1021 1016
1022;;; These are the descriptions the user gets when regular objects are
1023;;; examined.
1024
1025(defconst dun-physobj-desc '( 1017(defconst dun-physobj-desc '(
1026"It is a normal shovel with a price tag attached that says $19.99." 1018"It is a normal shovel with a price tag attached that says $19.99."
1027"The lamp is hand-crafted by Geppetto." 1019"The lamp is hand-crafted by Geppetto."
@@ -1043,10 +1035,8 @@ nil nil
1043"They are old coins from the 19th century." 1035"They are old coins from the 19th century."
1044"It is a valuable Fabrege egg." 1036"It is a valuable Fabrege egg."
1045"It is a plain glass jar." 1037"It is a plain glass jar."
1046nil nil nil nil nil)) 1038nil nil nil nil nil)
1047 1039 "The descriptions the user gets when regular objects are examined.")
1048;;; These are the descriptions the user gets when non-regular objects
1049;;; are examined.
1050 1040
1051(defconst dun-permobj-desc 1041(defconst dun-permobj-desc
1052 '(nil 1042 '(nil
@@ -1087,7 +1077,8 @@ it. It is very big, though."
1087nil nil nil nil 1077nil nil nil nil
1088"It is a normal ladder that is permanently attached to the hole." 1078"It is a normal ladder that is permanently attached to the hole."
1089"It is a passenger train that is ready to go." 1079"It is a passenger train that is ready to go."
1090"It is a personal computer that has only one floppy disk drive.")) 1080"It is a personal computer that has only one floppy disk drive.")
1081 "The descriptions the user gets when non-regular objects are examined.")
1091 1082
1092(defconst dun-diggables 1083(defconst dun-diggables
1093 (list nil nil nil (list obj-cpu) nil nil nil nil nil nil nil 1084 (list nil nil nil (list obj-cpu) nil nil nil nil nil nil nil
@@ -1189,10 +1180,9 @@ treasures for points?" "4" "four")
1189;;;; This section contains all of the verbs and commands. 1180;;;; This section contains all of the verbs and commands.
1190;;;; 1181;;;;
1191 1182
1192;;; Give long description of room if haven't been there yet. Otherwise
1193;;; short. Also give long if we were called with negative room number.
1194
1195(defun dun-describe-room (room) 1183(defun dun-describe-room (room)
1184 "Give long description of room if haven't been there yet.
1185Otherwise short. Also give long if we were called with negative room number."
1196 (if (and (not (member (abs room) dun-light-rooms)) 1186 (if (and (not (member (abs room) dun-light-rooms))
1197 (not (member obj-lamp dun-inventory)) 1187 (not (member obj-lamp dun-inventory))
1198 (not (member obj-lamp (nth dun-current-room dun-room-objects)))) 1188 (not (member obj-lamp (nth dun-current-room dun-room-objects))))
@@ -1222,10 +1212,9 @@ treasures for points?" "4" "four")
1222 (if (and (member obj-bus (nth dun-current-room dun-room-objects)) dun-inbus) 1212 (if (and (member obj-bus (nth dun-current-room dun-room-objects)) dun-inbus)
1223 (dun-mprincl "You are on the bus.")))) 1213 (dun-mprincl "You are on the bus."))))
1224 1214
1225;;; There is a special object in the room. This object's description,
1226;;; or lack thereof, depends on certain conditions.
1227
1228(defun dun-special-object () 1215(defun dun-special-object ()
1216 "There is a special object in the room. This object's description,
1217or lack thereof, depends on certain conditions."
1229 (cond 1218 (cond
1230 ((= dun-current-room computer-room) 1219 ((= dun-current-room computer-room)
1231 (if dun-computer 1220 (if dun-computer
@@ -1298,10 +1287,9 @@ disk bursts into flames, and disintegrates.")
1298(defun dun-quit (_args) 1287(defun dun-quit (_args)
1299 (dun-die nil)) 1288 (dun-die nil))
1300 1289
1301;;; Print every object in player's inventory. Special case for the jar,
1302;;; as we must also print what is in it.
1303
1304(defun dun-inven (_args) 1290(defun dun-inven (_args)
1291 "Print every object in player's inventory.
1292Special case for the jar, as we must also print what is in it."
1305 (dun-mprincl "You currently have:") 1293 (dun-mprincl "You currently have:")
1306 (dolist (curobj dun-inventory) 1294 (dolist (curobj dun-inventory)
1307 (when curobj 1295 (when curobj
@@ -1352,9 +1340,8 @@ on your head.")
1352 (if (member objnum (list obj-food obj-weight obj-jar)) 1340 (if (member objnum (list obj-food obj-weight obj-jar))
1353 (dun-drop-check objnum))))))) 1341 (dun-drop-check objnum)))))))
1354 1342
1355;;; Dropping certain things causes things to happen.
1356
1357(defun dun-drop-check (objnum) 1343(defun dun-drop-check (objnum)
1344 "Dropping certain things causes things to happen."
1358 (cond 1345 (cond
1359 ((and (= objnum obj-food) (= dun-room bear-hangout) 1346 ((and (= objnum obj-food) (= dun-room bear-hangout)
1360 (member obj-bear (nth bear-hangout dun-room-objects))) 1347 (member obj-bear (nth bear-hangout dun-room-objects)))
@@ -1381,9 +1368,8 @@ through.")))
1381 ((and (= objnum obj-weight) (= dun-current-room maze-button-room)) 1368 ((and (= objnum obj-weight) (= dun-current-room maze-button-room))
1382 (dun-mprincl "A passageway opens.")))) 1369 (dun-mprincl "A passageway opens."))))
1383 1370
1384;;; Give long description of current room, or an object.
1385
1386(defun dun-examine (obj) 1371(defun dun-examine (obj)
1372 "Give long description of current room, or an object."
1387 (let ((objnum (dun-objnum-from-args obj))) 1373 (let ((objnum (dun-objnum-from-args obj)))
1388 (cond 1374 (cond
1389 ((eq objnum obj-special) 1375 ((eq objnum obj-special)
@@ -1474,10 +1460,9 @@ For an explosive time, go to Fourth St. and Vermont.")
1474 (setq total (+ total (nth x dun-object-lbs)))) 1460 (setq total (+ total (nth x dun-object-lbs))))
1475 total)) 1461 total))
1476 1462
1477;;; We try to take an object that is untakable. Print a message
1478;;; depending on what it is.
1479
1480(defun dun-try-take (_obj) 1463(defun dun-try-take (_obj)
1464 "We try to take an object that is untakable.
1465Print a message depending on what it is."
1481 (dun-mprinc "You cannot take that.")) 1466 (dun-mprinc "You cannot take that."))
1482 1467
1483(defun dun-dig (_args) 1468(defun dun-dig (_args)
@@ -1670,15 +1655,15 @@ just try dropping it."))
1670(defun dun-go (args) 1655(defun dun-go (args)
1671 (if (or (not (car args)) 1656 (if (or (not (car args))
1672 (eq (dun-doverb dun-ignore dun-verblist (car args) 1657 (eq (dun-doverb dun-ignore dun-verblist (car args)
1673 (cdr (cdr args))) -1)) 1658 (cdr (cdr args)))
1659 -1))
1674 (dun-mprincl "I don't understand where you want me to go."))) 1660 (dun-mprincl "I don't understand where you want me to go.")))
1675 1661
1676;;; Uses the dungeon-map to figure out where we are going. If the
1677;;; requested direction yields 255, we know something special is
1678;;; supposed to happen, or perhaps you can't go that way unless
1679;;; certain conditions are met.
1680
1681(defun dun-move (dir) 1662(defun dun-move (dir)
1663 ;; Uses the dungeon-map to figure out where we are going. If the
1664 ;; requested direction yields 255, we know something special is
1665 ;; supposed to happen, or perhaps you can't go that way unless
1666 ;; certain conditions are met.
1682 (if (and (not (member dun-current-room dun-light-rooms)) 1667 (if (and (not (member dun-current-room dun-light-rooms))
1683 (not (member obj-lamp dun-inventory)) 1668 (not (member obj-lamp dun-inventory))
1684 (not (member obj-lamp (nth dun-current-room dun-room-objects)))) 1669 (not (member obj-lamp (nth dun-current-room dun-room-objects))))
@@ -1709,17 +1694,17 @@ body.")
1709 (list obj-bus))))) 1694 (list obj-bus)))))
1710 (setq dun-current-room newroom))))))) 1695 (setq dun-current-room newroom)))))))
1711 1696
1712;;; Movement in this direction causes something special to happen if the 1697(defun dun-special-move (dir)
1713;;; right conditions exist. It may be that you can't go this way unless 1698 ;; Movement in this direction causes something special to happen if the
1714;;; you have a key, or a passage has been opened. 1699 ;; right conditions exist. It may be that you can't go this way unless
1700 ;; you have a key, or a passage has been opened.
1715 1701
1716;;; coding note: Each check of the current room is on the same 'if' level, 1702 ;; coding note: Each check of the current room is on the same 'if' level,
1717;;; i.e. there aren't else's. If two rooms next to each other have 1703 ;; i.e. there aren't else's. If two rooms next to each other have
1718;;; specials, and they are connected by specials, this could cause 1704 ;; specials, and they are connected by specials, this could cause
1719;;; a problem. Be careful when adding them to consider this, and 1705 ;; a problem. Be careful when adding them to consider this, and
1720;;; perhaps use else's. 1706 ;; perhaps use else's.
1721 1707
1722(defun dun-special-move (dir)
1723 (if (= dun-current-room building-front) 1708 (if (= dun-current-room building-front)
1724 (if (not (member obj-key dun-inventory)) 1709 (if (not (member obj-key dun-inventory))
1725 (dun-mprincl "You don't have a key that can open this door.") 1710 (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")
2152;;;; 2137;;;;
2153 2138
2154 2139
2155;;; Function which takes a verb and a list of other words. Calls proper
2156;;; function associated with the verb, and passes along the other words.
2157
2158(defun dun-doverb (ignore verblist verb rest) 2140(defun dun-doverb (ignore verblist verb rest)
2141 "Take a verb and a list of other words.
2142Calls proper function associated with the verb, and passes along the
2143other words."
2159 (when verb 2144 (when verb
2160 (if (member (intern verb) ignore) 2145 (if (member (intern verb) ignore)
2161 (if (not (car rest)) -1 2146 (if (not (car rest)) -1
@@ -2165,9 +2150,8 @@ for a moment, then straighten yourself up.\n")
2165 (funcall (cdr (assq (intern verb) verblist)) rest))))) 2150 (funcall (cdr (assq (intern verb) verblist)) rest)))))
2166 2151
2167 2152
2168;;; Function to take a string and change it into a list of lowercase words.
2169
2170(defun dun-listify-string (strin) 2153(defun dun-listify-string (strin)
2154 "Take a string and change it into a list of lowercase words."
2171 (let (pos ret-list end-pos) 2155 (let (pos ret-list end-pos)
2172 (setq pos 0) 2156 (setq pos 0)
2173 (setq ret-list nil) 2157 (setq ret-list nil)
@@ -2177,7 +2161,8 @@ for a moment, then straighten yourself up.\n")
2177 (setq ret-list (append ret-list (list 2161 (setq ret-list (append ret-list (list
2178 (downcase 2162 (downcase
2179 (substring strin pos end-pos)))))) 2163 (substring strin pos end-pos))))))
2180 (setq pos (+ end-pos 1))) ret-list)) 2164 (setq pos (+ end-pos 1)))
2165 ret-list))
2181 2166
2182(defun dun-listify-string2 (strin) 2167(defun dun-listify-string2 (strin)
2183 (let (pos ret-list end-pos) 2168 (let (pos ret-list end-pos)
@@ -2194,10 +2179,8 @@ for a moment, then straighten yourself up.\n")
2194(defun dun-replace (list n number) 2179(defun dun-replace (list n number)
2195 (rplaca (nthcdr n list) number)) 2180 (rplaca (nthcdr n list) number))
2196 2181
2197
2198;;; Get the first non-ignored word from a list.
2199
2200(defun dun-firstword (list) 2182(defun dun-firstword (list)
2183 "Get the first non-ignored word from a list."
2201 (when (car list) 2184 (when (car list)
2202 (while (and list (memq (intern (car list)) dun-ignore)) 2185 (while (and list (memq (intern (car list)) dun-ignore))
2203 (setq list (cdr list))) 2186 (setq list (cdr list)))
@@ -2209,10 +2192,9 @@ for a moment, then straighten yourself up.\n")
2209 (setq list (cdr list))) 2192 (setq list (cdr list)))
2210 list)) 2193 list))
2211 2194
2212;;; parse a line passed in as a string Call the proper verb with the
2213;;; rest of the line passed in as a list.
2214
2215(defun dun-vparse (ignore verblist line) 2195(defun dun-vparse (ignore verblist line)
2196 "Parse a line passed in as a string.
2197Call the proper verb with the rest of the line passed in as a list."
2216 (dun-mprinc "\n") 2198 (dun-mprinc "\n")
2217 (setq dun-line-list (dun-listify-string (concat line " "))) 2199 (setq dun-line-list (dun-listify-string (concat line " ")))
2218 (dun-doverb ignore verblist (car dun-line-list) (cdr dun-line-list))) 2200 (dun-doverb ignore verblist (car dun-line-list) (cdr dun-line-list)))
@@ -2222,54 +2204,47 @@ for a moment, then straighten yourself up.\n")
2222 (setq dun-line-list (dun-listify-string2 (concat line " "))) 2204 (setq dun-line-list (dun-listify-string2 (concat line " ")))
2223 (dun-doverb ignore verblist (car dun-line-list) (cdr dun-line-list))) 2205 (dun-doverb ignore verblist (car dun-line-list) (cdr dun-line-list)))
2224 2206
2225;;; Read a line, in window mode
2226
2227(defun dun-read-line () 2207(defun dun-read-line ()
2208 "Read a line, in window mode."
2228 (let ((line (read-string ""))) 2209 (let ((line (read-string "")))
2229 (dun-mprinc line) 2210 (dun-mprinc line)
2230 line)) 2211 line))
2231 2212
2232;;; Insert something into the window buffer
2233
2234(defun dun-minsert (&rest args) 2213(defun dun-minsert (&rest args)
2214 "Insert something into the window buffer."
2235 (dolist (arg args) 2215 (dolist (arg args)
2236 (if (stringp arg) 2216 (if (stringp arg)
2237 (insert arg) 2217 (insert arg)
2238 (insert (prin1-to-string arg))))) 2218 (insert (prin1-to-string arg)))))
2239 2219
2240;;; Print something out, in window mode
2241
2242(defun dun-mprinc (&rest args) 2220(defun dun-mprinc (&rest args)
2221 "Print something out, in window mode."
2243 (dolist (arg args) 2222 (dolist (arg args)
2244 (if (stringp arg) 2223 (if (stringp arg)
2245 (insert arg) 2224 (insert arg)
2246 (insert (prin1-to-string arg))))) 2225 (insert (prin1-to-string arg)))))
2247 2226
2248;;; In window mode, keep screen from jumping by keeping last line at
2249;;; the bottom of the screen.
2250
2251(defun dun-fix-screen () 2227(defun dun-fix-screen ()
2228 "In window mode, keep screen from jumping by keeping last line at
2229the bottom of the screen."
2252 (interactive) 2230 (interactive)
2253 (forward-line (- 0 (- (window-height) 2 ))) 2231 (forward-line (- 0 (- (window-height) 2 )))
2254 (set-window-start (selected-window) (point)) 2232 (set-window-start (selected-window) (point))
2255 (goto-char (point-max))) 2233 (goto-char (point-max)))
2256 2234
2257;;; Insert something into the buffer, followed by newline.
2258
2259(defun dun-minsertl (&rest args) 2235(defun dun-minsertl (&rest args)
2236 "Insert something into the buffer, followed by newline."
2260 (apply #'dun-minsert args) 2237 (apply #'dun-minsert args)
2261 (dun-minsert "\n")) 2238 (dun-minsert "\n"))
2262 2239
2263;;; Print something, followed by a newline.
2264
2265(defun dun-mprincl (&rest args) 2240(defun dun-mprincl (&rest args)
2241 "Print something, followed by a newline."
2266 (apply #'dun-mprinc args) 2242 (apply #'dun-mprinc args)
2267 (dun-mprinc "\n")) 2243 (dun-mprinc "\n"))
2268 2244
2269;;; Function which will get an object number given the list of
2270;;; words in the command, except for the verb.
2271
2272(defun dun-objnum-from-args (obj) 2245(defun dun-objnum-from-args (obj)
2246 "Get an object number given the list of words in the command,
2247except for the verb."
2273 (setq obj (dun-firstword obj)) 2248 (setq obj (dun-firstword obj))
2274 (if (not obj) 2249 (if (not obj)
2275 obj-special 2250 obj-special
@@ -2285,9 +2260,8 @@ for a moment, then straighten yourself up.\n")
2285 nil 2260 nil
2286 result))) 2261 result)))
2287 2262
2288;;; Given a unix style pathname, build a list of path components (recursive)
2289
2290(defun dun-get-path (dirstring startlist) 2263(defun dun-get-path (dirstring startlist)
2264 "Given a unix style pathname, build a list of path components (recursive)"
2291 (let (slash) 2265 (let (slash)
2292 (if (= (length dirstring) 0) 2266 (if (= (length dirstring) 0)
2293 startlist 2267 startlist
@@ -2299,10 +2273,9 @@ for a moment, then straighten yourself up.\n")
2299 (append startlist 2273 (append startlist
2300 (list (substring dirstring 0 slash))))))))) 2274 (list (substring dirstring 0 slash)))))))))
2301 2275
2302;;; Function to put objects in the treasure room. Also prints current
2303;;; score to let user know he has scored.
2304
2305(defun dun-put-objs-in-treas (objlist) 2276(defun dun-put-objs-in-treas (objlist)
2277 "Put objects in the treasure room.
2278Also prints current score to let user know he has scored."
2306 (let (oscore newscore) 2279 (let (oscore newscore)
2307 (setq oscore (dun-reg-score)) 2280 (setq oscore (dun-reg-score))
2308 (dun-replace dun-room-objects 0 (append (nth 0 dun-room-objects) objlist)) 2281 (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")
2310 (if (not (= oscore newscore)) 2283 (if (not (= oscore newscore))
2311 (dun-score nil)))) 2284 (dun-score nil))))
2312 2285
2313;;; Load an encrypted file, and eval it.
2314
2315(defun dun-load-d (filename) 2286(defun dun-load-d (filename)
2287 "Load an encrypted file, and eval it."
2316 (let ((result t)) 2288 (let ((result t))
2317 (with-temp-buffer 2289 (with-temp-buffer
2318 (condition-case nil 2290 (condition-case nil
@@ -3154,14 +3126,16 @@ File not found")))
3154 (dun-mprinc "\n") 3126 (dun-mprinc "\n")
3155 (dun-batch-loop)) 3127 (dun-batch-loop))
3156 3128
3157(when noninteractive 3129;;;###autoload
3158 (fset 'dun-mprinc 'dun-batch-mprinc) 3130(defun dun-batch ()
3159 (fset 'dun-mprincl 'dun-batch-mprincl) 3131 "Start `dunnet' in batch mode."
3160 (fset 'dun-vparse 'dun-batch-parse) 3132 (fset 'dun-mprinc #'dun-batch-mprinc)
3161 (fset 'dun-parse2 'dun-batch-parse2) 3133 (fset 'dun-mprincl #'dun-batch-mprincl)
3162 (fset 'dun-read-line 'dun-batch-read-line) 3134 (fset 'dun-vparse #'dun-batch-parse)
3163 (fset 'dun-dos-interface 'dun-batch-dos-interface) 3135 (fset 'dun-parse2 #'dun-batch-parse2)
3164 (fset 'dun-unix-interface 'dun-batch-unix-interface) 3136 (fset 'dun-read-line #'dun-batch-read-line)
3137 (fset 'dun-dos-interface #'dun-batch-dos-interface)
3138 (fset 'dun-unix-interface #'dun-batch-unix-interface)
3165 (dun-mprinc "\n") 3139 (dun-mprinc "\n")
3166 (setq dun-batch-mode t) 3140 (setq dun-batch-mode t)
3167 (dun-batch-loop)) 3141 (dun-batch-loop))
diff --git a/lisp/proced.el b/lisp/proced.el
index 203d70331ce..5d4318d81f6 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -664,9 +664,9 @@ After displaying or updating a Proced buffer, Proced runs the normal hook
664 truncate-lines t 664 truncate-lines t
665 header-line-format '(:eval (proced-header-line))) 665 header-line-format '(:eval (proced-header-line)))
666 (add-hook 'post-command-hook #'force-mode-line-update nil t) ;; FIXME: Why? 666 (add-hook 'post-command-hook #'force-mode-line-update nil t) ;; FIXME: Why?
667 (set (make-local-variable 'revert-buffer-function) #'proced-revert) 667 (setq-local revert-buffer-function #'proced-revert)
668 (set (make-local-variable 'font-lock-defaults) 668 (setq-local font-lock-defaults
669 '(proced-font-lock-keywords t nil nil beginning-of-line)) 669 '(proced-font-lock-keywords t nil nil beginning-of-line))
670 (if (and (not proced-auto-update-timer) proced-auto-update-interval) 670 (if (and (not proced-auto-update-timer) proced-auto-update-interval)
671 (setq proced-auto-update-timer 671 (setq proced-auto-update-timer
672 (run-at-time t proced-auto-update-interval 672 (run-at-time t proced-auto-update-interval
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index a8fe485b702..6e915440f95 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -1314,19 +1314,19 @@ see. Use it by enabling `eldoc-mode'."
1314 (append bounds (list (cdr flist)))))) 1314 (append bounds (list (cdr flist))))))
1315 1315
1316(defun cfengine-common-settings () 1316(defun cfengine-common-settings ()
1317 (set (make-local-variable 'syntax-propertize-function) 1317 (setq-local syntax-propertize-function
1318 ;; In the main syntax-table, \ is marked as a punctuation, because 1318 ;; In the main syntax-table, \ is marked as a punctuation, because
1319 ;; of its use in DOS-style directory separators. Here we try to 1319 ;; of its use in DOS-style directory separators. Here we try to
1320 ;; recognize the cases where \ is used as an escape inside strings. 1320 ;; recognize the cases where \ is used as an escape inside strings.
1321 (syntax-propertize-rules ("\\(\\(?:\\\\\\)+\\)\"" (1 "\\")))) 1321 (syntax-propertize-rules ("\\(\\(?:\\\\\\)+\\)\"" (1 "\\"))))
1322 (set (make-local-variable 'parens-require-spaces) nil) 1322 (setq-local parens-require-spaces nil)
1323 (set (make-local-variable 'comment-start) "# ") 1323 (setq-local comment-start "# ")
1324 (set (make-local-variable 'comment-start-skip) 1324 (setq-local comment-start-skip
1325 "\\(\\(?:^\\|[^\\\n]\\)\\(?:\\\\\\\\\\)*\\)#+[ \t]*") 1325 "\\(\\(?:^\\|[^\\\n]\\)\\(?:\\\\\\\\\\)*\\)#+[ \t]*")
1326 ;; Like Lisp mode. Without this, we lose with, say, 1326 ;; Like Lisp mode. Without this, we lose with, say,
1327 ;; `backward-up-list' when there's an unbalanced quote in a 1327 ;; `backward-up-list' when there's an unbalanced quote in a
1328 ;; preceding comment. 1328 ;; preceding comment.
1329 (set (make-local-variable 'parse-sexp-ignore-comments) t)) 1329 (setq-local parse-sexp-ignore-comments t))
1330 1330
1331(defun cfengine-common-syntax (table) 1331(defun cfengine-common-syntax (table)
1332 ;; The syntax defaults seem OK to give reasonable word movement. 1332 ;; The syntax defaults seem OK to give reasonable word movement.
@@ -1374,7 +1374,7 @@ to the action header."
1374 (cfengine-common-settings) 1374 (cfengine-common-settings)
1375 (cfengine-common-syntax cfengine3-mode-syntax-table) 1375 (cfengine-common-syntax cfengine3-mode-syntax-table)
1376 1376
1377 (set (make-local-variable 'indent-line-function) #'cfengine3-indent-line) 1377 (setq-local indent-line-function #'cfengine3-indent-line)
1378 1378
1379 (setq font-lock-defaults 1379 (setq font-lock-defaults
1380 '(cfengine3-font-lock-keywords 1380 '(cfengine3-font-lock-keywords
@@ -1384,11 +1384,11 @@ to the action header."
1384 ;; `compile-command' is almost never a `make' call with CFEngine so 1384 ;; `compile-command' is almost never a `make' call with CFEngine so
1385 ;; we override it 1385 ;; we override it
1386 (when cfengine-cf-promises 1386 (when cfengine-cf-promises
1387 (set (make-local-variable 'compile-command) 1387 (setq-local compile-command
1388 (concat cfengine-cf-promises 1388 (concat cfengine-cf-promises
1389 " -f " 1389 " -f "
1390 (when buffer-file-name 1390 (when buffer-file-name
1391 (shell-quote-argument buffer-file-name))))) 1391 (shell-quote-argument buffer-file-name)))))
1392 1392
1393 (add-hook 'eldoc-documentation-functions 1393 (add-hook 'eldoc-documentation-functions
1394 #'cfengine3-documentation-function nil t) 1394 #'cfengine3-documentation-function nil t)
@@ -1418,20 +1418,18 @@ to the action header."
1418 ;; should avoid potential confusion in some cases. 1418 ;; should avoid potential confusion in some cases.
1419 (modify-syntax-entry ?\` "\"" cfengine2-mode-syntax-table) 1419 (modify-syntax-entry ?\` "\"" cfengine2-mode-syntax-table)
1420 1420
1421 (set (make-local-variable 'indent-line-function) #'cfengine2-indent-line) 1421 (setq-local indent-line-function #'cfengine2-indent-line)
1422 (set (make-local-variable 'outline-regexp) "[ \t]*\\(\\sw\\|\\s_\\)+:+") 1422 (setq-local outline-regexp "[ \t]*\\(\\sw\\|\\s_\\)+:+")
1423 (set (make-local-variable 'outline-level) #'cfengine2-outline-level) 1423 (setq-local outline-level #'cfengine2-outline-level)
1424 (set (make-local-variable 'fill-paragraph-function) 1424 (setq-local fill-paragraph-function #'cfengine-fill-paragraph)
1425 #'cfengine-fill-paragraph)
1426 (define-abbrev-table 'cfengine2-mode-abbrev-table cfengine-mode-abbrevs) 1425 (define-abbrev-table 'cfengine2-mode-abbrev-table cfengine-mode-abbrevs)
1427 (setq font-lock-defaults 1426 (setq font-lock-defaults
1428 '(cfengine2-font-lock-keywords nil nil nil beginning-of-line)) 1427 '(cfengine2-font-lock-keywords nil nil nil beginning-of-line))
1429 ;; Fixme: set the args of functions in evaluated classes to string 1428 ;; Fixme: set the args of functions in evaluated classes to string
1430 ;; syntax, and then obey syntax properties. 1429 ;; syntax, and then obey syntax properties.
1431 (setq imenu-generic-expression cfengine2-imenu-expression) 1430 (setq imenu-generic-expression cfengine2-imenu-expression)
1432 (set (make-local-variable 'beginning-of-defun-function) 1431 (setq-local beginning-of-defun-function #'cfengine2-beginning-of-defun)
1433 #'cfengine2-beginning-of-defun) 1432 (setq-local end-of-defun-function #'cfengine2-end-of-defun))
1434 (set (make-local-variable 'end-of-defun-function) #'cfengine2-end-of-defun))
1435 1433
1436;;;###autoload 1434;;;###autoload
1437(defun cfengine-auto-mode () 1435(defun cfengine-auto-mode ()
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 787f5d5ef30..d2293151c7d 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -241,11 +241,20 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
241 ;; GradleStyleMessagerRenderer.kt in kotlin sources, see 241 ;; GradleStyleMessagerRenderer.kt in kotlin sources, see
242 ;; https://youtrack.jetbrains.com/issue/KT-34683). 242 ;; https://youtrack.jetbrains.com/issue/KT-34683).
243 (gradle-kotlin 243 (gradle-kotlin
244 ,(concat 244 ,(rx bol
245 "^\\(?:\\(w\\)\\|.\\): *" ;type 245 (| (group "w") ; 1: warning
246 "\\(\\(?:[A-Za-z]:\\)?[^:\n]+\\): *" ;file 246 (group (in "iv")) ; 2: info
247 "(\\([0-9]+\\), *\\([0-9]+\\))") ;line, column 247 "e") ; error
248 2 3 4 (1)) 248 ": "
249 (group ; 3: file
250 (? (in "A-Za-z") ":")
251 (+ (not (in "\n:"))))
252 ": ("
253 (group (+ digit)) ; 4: line
254 ", "
255 (group (+ digit)) ; 5: column
256 "): ")
257 3 4 5 (1 . 2))
249 258
250 (iar 259 (iar
251 "^\"\\(.*\\)\",\\([0-9]+\\)\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[0-9]+\\]:" 260 "^\"\\(.*\\)\",\\([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:
807 (lambda () 816 (lambda ()
808 (unless (or (file-exists-p \"makefile\") 817 (unless (or (file-exists-p \"makefile\")
809 (file-exists-p \"Makefile\")) 818 (file-exists-p \"Makefile\"))
810 (set (make-local-variable \\='compile-command) 819 (setq-local compile-command
811 (concat \"make -k \" 820 (concat \"make -k \"
812 (if buffer-file-name 821 (if buffer-file-name
813 (shell-quote-argument 822 (shell-quote-argument
@@ -1839,14 +1848,13 @@ Returns the compilation buffer created."
1839 ;; default-directory' can't be used reliably for that because it may be 1848 ;; default-directory' can't be used reliably for that because it may be
1840 ;; affected by the special handling of "cd ...;". 1849 ;; affected by the special handling of "cd ...;".
1841 ;; NB: must be done after (funcall mode) as that resets local variables 1850 ;; NB: must be done after (funcall mode) as that resets local variables
1842 (set (make-local-variable 'compilation-directory) thisdir) 1851 (setq-local compilation-directory thisdir)
1843 (set (make-local-variable 'compilation-environment) thisenv) 1852 (setq-local compilation-environment thisenv)
1844 (if highlight-regexp 1853 (if highlight-regexp
1845 (set (make-local-variable 'compilation-highlight-regexp) 1854 (setq-local compilation-highlight-regexp highlight-regexp))
1846 highlight-regexp))
1847 (if (or compilation-auto-jump-to-first-error 1855 (if (or compilation-auto-jump-to-first-error
1848 (eq compilation-scroll-output 'first-error)) 1856 (eq compilation-scroll-output 'first-error))
1849 (set (make-local-variable 'compilation-auto-jump-to-next) t)) 1857 (setq-local compilation-auto-jump-to-next t))
1850 ;; Output a mode setter, for saving and later reloading this buffer. 1858 ;; Output a mode setter, for saving and later reloading this buffer.
1851 (insert "-*- mode: " name-of-mode 1859 (insert "-*- mode: " name-of-mode
1852 "; default-directory: " 1860 "; default-directory: "
@@ -1868,13 +1876,13 @@ Returns the compilation buffer created."
1868 (let ((process-environment 1876 (let ((process-environment
1869 (append 1877 (append
1870 compilation-environment 1878 compilation-environment
1871 (comint-term-environment) 1879 (and (derived-mode-p 'comint-mode)
1880 (comint-term-environment))
1872 (list (format "INSIDE_EMACS=%s,compile" emacs-version)) 1881 (list (format "INSIDE_EMACS=%s,compile" emacs-version))
1873 (copy-sequence process-environment)))) 1882 (copy-sequence process-environment))))
1874 (set (make-local-variable 'compilation-arguments) 1883 (setq-local compilation-arguments
1875 (list command mode name-function highlight-regexp)) 1884 (list command mode name-function highlight-regexp))
1876 (set (make-local-variable 'revert-buffer-function) 1885 (setq-local revert-buffer-function 'compilation-revert-buffer)
1877 'compilation-revert-buffer)
1878 (and outwin 1886 (and outwin
1879 ;; Forcing the window-start overrides the usual redisplay 1887 ;; Forcing the window-start overrides the usual redisplay
1880 ;; feature of bringing point into view, so setting the 1888 ;; feature of bringing point into view, so setting the
@@ -2179,20 +2187,19 @@ Runs `compilation-mode-hook' with `run-mode-hooks' (which see).
2179 (kill-all-local-variables) 2187 (kill-all-local-variables)
2180 (use-local-map compilation-mode-map) 2188 (use-local-map compilation-mode-map)
2181 ;; Let windows scroll along with the output. 2189 ;; Let windows scroll along with the output.
2182 (set (make-local-variable 'window-point-insertion-type) t) 2190 (setq-local window-point-insertion-type t)
2183 (set (make-local-variable 'tool-bar-map) compilation-mode-tool-bar-map) 2191 (setq-local tool-bar-map compilation-mode-tool-bar-map)
2184 (setq major-mode 'compilation-mode ; FIXME: Use define-derived-mode. 2192 (setq major-mode 'compilation-mode ; FIXME: Use define-derived-mode.
2185 mode-name (or name-of-mode "Compilation")) 2193 mode-name (or name-of-mode "Compilation"))
2186 (set (make-local-variable 'page-delimiter) 2194 (setq-local page-delimiter compilation-page-delimiter)
2187 compilation-page-delimiter) 2195 ;; (setq-local compilation-buffer-modtime nil)
2188 ;; (set (make-local-variable 'compilation-buffer-modtime) nil)
2189 (compilation-setup) 2196 (compilation-setup)
2190 ;; Turn off deferred fontifications in the compilation buffer, if 2197 ;; Turn off deferred fontifications in the compilation buffer, if
2191 ;; the user turned them on globally. This is because idle timers 2198 ;; the user turned them on globally. This is because idle timers
2192 ;; aren't re-run after receiving input from a subprocess, so the 2199 ;; aren't re-run after receiving input from a subprocess, so the
2193 ;; buffer is left unfontified after the compilation exits, until 2200 ;; buffer is left unfontified after the compilation exits, until
2194 ;; some other input event happens. 2201 ;; some other input event happens.
2195 (set (make-local-variable 'jit-lock-defer-time) nil) 2202 (setq-local jit-lock-defer-time nil)
2196 (setq buffer-read-only t) 2203 (setq buffer-read-only t)
2197 (run-mode-hooks 'compilation-mode-hook)) 2204 (run-mode-hooks 'compilation-mode-hook))
2198 2205
@@ -2262,7 +2269,7 @@ Optional argument MINOR indicates this is called from
2262 (setq-local compilation-num-errors-found 0) 2269 (setq-local compilation-num-errors-found 0)
2263 (setq-local compilation-num-warnings-found 0) 2270 (setq-local compilation-num-warnings-found 0)
2264 (setq-local compilation-num-infos-found 0) 2271 (setq-local compilation-num-infos-found 0)
2265 (set (make-local-variable 'overlay-arrow-string) "") 2272 (setq-local overlay-arrow-string "")
2266 (setq next-error-overlay-arrow-position nil) 2273 (setq next-error-overlay-arrow-position nil)
2267 (add-hook 'kill-buffer-hook 2274 (add-hook 'kill-buffer-hook
2268 (lambda () (setq next-error-overlay-arrow-position nil)) nil t) 2275 (lambda () (setq next-error-overlay-arrow-position nil)) nil t)
@@ -2270,10 +2277,10 @@ Optional argument MINOR indicates this is called from
2270 ;; with the next-error function in simple.el, and it's only 2277 ;; with the next-error function in simple.el, and it's only
2271 ;; coincidentally named similarly to compilation-next-error. 2278 ;; coincidentally named similarly to compilation-next-error.
2272 (setq next-error-function 'compilation-next-error-function) 2279 (setq next-error-function 'compilation-next-error-function)
2273 (set (make-local-variable 'comint-file-name-prefix) 2280 (setq-local comint-file-name-prefix
2274 (or (file-remote-p default-directory) "")) 2281 (or (file-remote-p default-directory) ""))
2275 (set (make-local-variable 'compilation-locs) 2282 (setq-local compilation-locs
2276 (make-hash-table :test 'equal :weakness 'value)) 2283 (make-hash-table :test 'equal :weakness 'value))
2277 ;; It's generally preferable to use after-change-functions since they 2284 ;; It's generally preferable to use after-change-functions since they
2278 ;; can be subject to combine-after-change-calls, but if we do that, we risk 2285 ;; can be subject to combine-after-change-calls, but if we do that, we risk
2279 ;; running our hook after font-lock, resulting in incorrect refontification. 2286 ;; running our hook after font-lock, resulting in incorrect refontification.
@@ -2411,8 +2418,7 @@ and runs `compilation-filter-hook'."
2411 (set-marker (process-mark proc) (point)) 2418 (set-marker (process-mark proc) (point))
2412 ;; Update the number of errors in compilation-mode-line-errors 2419 ;; Update the number of errors in compilation-mode-line-errors
2413 (compilation--ensure-parse (point)) 2420 (compilation--ensure-parse (point))
2414 ;; (set (make-local-variable 'compilation-buffer-modtime) 2421 ;; (setq-local compilation-buffer-modtime (current-time))
2415 ;; (current-time))
2416 (run-hooks 'compilation-filter-hook)) 2422 (run-hooks 'compilation-filter-hook))
2417 (goto-char pos) 2423 (goto-char pos)
2418 (narrow-to-region min max) 2424 (narrow-to-region min max)
@@ -3166,9 +3172,9 @@ TRUE-DIRNAME is the `file-truename' of DIRNAME, if given."
3166 ;; Again, since this command is used in buffers that contain several 3172 ;; Again, since this command is used in buffers that contain several
3167 ;; compilations, to set the beginning of "this compilation", it's a good 3173 ;; compilations, to set the beginning of "this compilation", it's a good
3168 ;; place to reset compilation-auto-jump-to-next. 3174 ;; place to reset compilation-auto-jump-to-next.
3169 (set (make-local-variable 'compilation-auto-jump-to-next) 3175 (setq-local compilation-auto-jump-to-next
3170 (or compilation-auto-jump-to-first-error 3176 (or compilation-auto-jump-to-first-error
3171 (eq compilation-scroll-output 'first-error)))) 3177 (eq compilation-scroll-output 'first-error))))
3172 3178
3173(provide 'compile) 3179(provide 'compile)
3174 3180
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 48f0a34880e..ae839a66220 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1599,111 +1599,106 @@ or as help on variables `cperl-tips', `cperl-problems',
1599 ;; Until Emacs is multi-threaded, we do not actually need it local: 1599 ;; Until Emacs is multi-threaded, we do not actually need it local:
1600 (make-local-variable 'cperl-font-lock-multiline-start) 1600 (make-local-variable 'cperl-font-lock-multiline-start)
1601 (make-local-variable 'cperl-font-locking) 1601 (make-local-variable 'cperl-font-locking)
1602 (set (make-local-variable 'outline-regexp) cperl-outline-regexp) 1602 (setq-local outline-regexp cperl-outline-regexp)
1603 (set (make-local-variable 'outline-level) 'cperl-outline-level) 1603 (setq-local outline-level 'cperl-outline-level)
1604 (set (make-local-variable 'add-log-current-defun-function) 1604 (setq-local add-log-current-defun-function
1605 (lambda () 1605 (lambda ()
1606 (save-excursion 1606 (save-excursion
1607 (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t) 1607 (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t)
1608 (match-string-no-properties 1))))) 1608 (match-string-no-properties 1)))))
1609 1609
1610 (set (make-local-variable 'paragraph-start) (concat "^$\\|" page-delimiter)) 1610 (setq-local paragraph-start (concat "^$\\|" page-delimiter))
1611 (set (make-local-variable 'paragraph-separate) paragraph-start) 1611 (setq-local paragraph-separate paragraph-start)
1612 (set (make-local-variable 'paragraph-ignore-fill-prefix) t) 1612 (setq-local paragraph-ignore-fill-prefix t)
1613 (set (make-local-variable 'indent-line-function) #'cperl-indent-line) 1613 (setq-local indent-line-function #'cperl-indent-line)
1614 (set (make-local-variable 'require-final-newline) mode-require-final-newline) 1614 (setq-local require-final-newline mode-require-final-newline)
1615 (set (make-local-variable 'comment-start) "# ") 1615 (setq-local comment-start "# ")
1616 (set (make-local-variable 'comment-end) "") 1616 (setq-local comment-end "")
1617 (set (make-local-variable 'comment-column) cperl-comment-column) 1617 (setq-local comment-column cperl-comment-column)
1618 (set (make-local-variable 'comment-start-skip) "#+ *") 1618 (setq-local comment-start-skip "#+ *")
1619 1619
1620;; "[ \t]*sub" 1620;; "[ \t]*sub"
1621;; (cperl-after-sub-regexp 'named nil) ; 8=name 11=proto 14=attr-start 1621;; (cperl-after-sub-regexp 'named nil) ; 8=name 11=proto 14=attr-start
1622;; cperl-maybe-white-and-comment-rex ; 15=pre-block 1622;; cperl-maybe-white-and-comment-rex ; 15=pre-block
1623 (set (make-local-variable 'defun-prompt-regexp) 1623 (setq-local defun-prompt-regexp
1624 (concat "^[ \t]*\\(" 1624 (concat "^[ \t]*\\("
1625 cperl-sub-regexp 1625 cperl-sub-regexp
1626 (cperl-after-sub-regexp 'named 'attr-groups) 1626 (cperl-after-sub-regexp 'named 'attr-groups)
1627 "\\|" ; per toke.c 1627 "\\|" ; per toke.c
1628 "\\(BEGIN\\|UNITCHECK\\|CHECK\\|INIT\\|END\\|AUTOLOAD\\|DESTROY\\)" 1628 "\\(BEGIN\\|UNITCHECK\\|CHECK\\|INIT\\|END\\|AUTOLOAD\\|DESTROY\\)"
1629 "\\)" 1629 "\\)"
1630 cperl-maybe-white-and-comment-rex)) 1630 cperl-maybe-white-and-comment-rex))
1631 (set (make-local-variable 'comment-indent-function) #'cperl-comment-indent) 1631 (setq-local comment-indent-function #'cperl-comment-indent)
1632 (set (make-local-variable 'fill-paragraph-function) 1632 (setq-local fill-paragraph-function #'cperl-fill-paragraph)
1633 #'cperl-fill-paragraph) 1633 (setq-local parse-sexp-ignore-comments t)
1634 (set (make-local-variable 'parse-sexp-ignore-comments) t) 1634 (setq-local indent-region-function #'cperl-indent-region)
1635 (set (make-local-variable 'indent-region-function) #'cperl-indent-region)
1636 ;;(setq auto-fill-function #'cperl-do-auto-fill) ; Need to switch on and off! 1635 ;;(setq auto-fill-function #'cperl-do-auto-fill) ; Need to switch on and off!
1637 (set (make-local-variable 'imenu-create-index-function) 1636 (setq-local imenu-create-index-function #'cperl-imenu--create-perl-index)
1638 #'cperl-imenu--create-perl-index) 1637 (setq-local imenu-sort-function nil)
1639 (set (make-local-variable 'imenu-sort-function) nil) 1638 (setq-local vc-rcs-header cperl-vc-rcs-header)
1640 (set (make-local-variable 'vc-rcs-header) cperl-vc-rcs-header) 1639 (setq-local vc-sccs-header cperl-vc-sccs-header)
1641 (set (make-local-variable 'vc-sccs-header) cperl-vc-sccs-header)
1642 (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x 1640 (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x
1643 (set (make-local-variable 'compilation-error-regexp-alist-alist) 1641 (setq-local compilation-error-regexp-alist-alist
1644 (cons (cons 'cperl (car cperl-compilation-error-regexp-alist)) 1642 (cons (cons 'cperl (car cperl-compilation-error-regexp-alist))
1645 compilation-error-regexp-alist-alist)) 1643 compilation-error-regexp-alist-alist))
1646 (if (fboundp 'compilation-build-compilation-error-regexp-alist) 1644 (if (fboundp 'compilation-build-compilation-error-regexp-alist)
1647 (let ((f 'compilation-build-compilation-error-regexp-alist)) 1645 (let ((f 'compilation-build-compilation-error-regexp-alist))
1648 (funcall f)) 1646 (funcall f))
1649 (make-local-variable 'compilation-error-regexp-alist) 1647 (make-local-variable 'compilation-error-regexp-alist)
1650 (push 'cperl compilation-error-regexp-alist))) 1648 (push 'cperl compilation-error-regexp-alist)))
1651 ((boundp 'compilation-error-regexp-alist);; xemacs 19.x 1649 ((boundp 'compilation-error-regexp-alist);; xemacs 19.x
1652 (set (make-local-variable 'compilation-error-regexp-alist) 1650 (setq-local compilation-error-regexp-alist
1653 (append cperl-compilation-error-regexp-alist 1651 (append cperl-compilation-error-regexp-alist
1654 compilation-error-regexp-alist)))) 1652 compilation-error-regexp-alist))))
1655 (set (make-local-variable 'font-lock-defaults) 1653 (setq-local font-lock-defaults
1656 '((cperl-load-font-lock-keywords 1654 '((cperl-load-font-lock-keywords
1657 cperl-load-font-lock-keywords-1 1655 cperl-load-font-lock-keywords-1
1658 cperl-load-font-lock-keywords-2) nil nil ((?_ . "w")))) 1656 cperl-load-font-lock-keywords-2)
1657 nil nil ((?_ . "w"))))
1659 ;; Reset syntaxification cache. 1658 ;; Reset syntaxification cache.
1660 (set (make-local-variable 'cperl-syntax-state) nil) 1659 (setq-local cperl-syntax-state nil)
1661 (if cperl-use-syntax-table-text-property 1660 (if cperl-use-syntax-table-text-property
1662 (if (eval-when-compile (fboundp 'syntax-propertize-rules)) 1661 (if (eval-when-compile (fboundp 'syntax-propertize-rules))
1663 (progn 1662 (progn
1664 ;; Reset syntaxification cache. 1663 ;; Reset syntaxification cache.
1665 (set (make-local-variable 'cperl-syntax-done-to) nil) 1664 (setq-local cperl-syntax-done-to nil)
1666 (set (make-local-variable 'syntax-propertize-function) 1665 (setq-local syntax-propertize-function
1667 (lambda (start end) 1666 (lambda (start end)
1668 (goto-char start) 1667 (goto-char start)
1669 ;; Even if cperl-fontify-syntaxically has already gone 1668 ;; Even if cperl-fontify-syntaxically has already gone
1670 ;; beyond `start', syntax-propertize has just removed 1669 ;; beyond `start', syntax-propertize has just removed
1671 ;; syntax-table properties between start and end, so we have 1670 ;; syntax-table properties between start and end, so we have
1672 ;; to re-apply them. 1671 ;; to re-apply them.
1673 (setq cperl-syntax-done-to start) 1672 (setq cperl-syntax-done-to start)
1674 (cperl-fontify-syntaxically end)))) 1673 (cperl-fontify-syntaxically end))))
1675 ;; Do not introduce variable if not needed, we check it! 1674 ;; Do not introduce variable if not needed, we check it!
1676 (set (make-local-variable 'parse-sexp-lookup-properties) t) 1675 (setq-local parse-sexp-lookup-properties t)
1677 ;; Fix broken font-lock:
1678 (or (boundp 'font-lock-unfontify-region-function)
1679 (setq font-lock-unfontify-region-function
1680 #'font-lock-default-unfontify-region))
1681 ;; Our: just a plug for wrong font-lock 1676 ;; Our: just a plug for wrong font-lock
1682 (set (make-local-variable 'font-lock-unfontify-region-function) 1677 (setq-local font-lock-unfontify-region-function
1683 ;; not present with old Emacs 1678 ;; not present with old Emacs
1684 #'cperl-font-lock-unfontify-region-function) 1679 #'cperl-font-lock-unfontify-region-function)
1685 ;; Reset syntaxification cache. 1680 ;; Reset syntaxification cache.
1686 (set (make-local-variable 'cperl-syntax-done-to) nil) 1681 (setq-local cperl-syntax-done-to nil)
1687 (set (make-local-variable 'font-lock-syntactic-keywords) 1682 (setq-local font-lock-syntactic-keywords
1688 (if cperl-syntaxify-by-font-lock 1683 (if cperl-syntaxify-by-font-lock
1689 '((cperl-fontify-syntaxically)) 1684 '((cperl-fontify-syntaxically))
1690 ;; unless font-lock-syntactic-keywords, font-lock (pre-22.1) 1685 ;; unless font-lock-syntactic-keywords, font-lock (pre-22.1)
1691 ;; used to ignore syntax-table text-properties. (t) is a hack 1686 ;; used to ignore syntax-table text-properties. (t) is a hack
1692 ;; to make font-lock think that font-lock-syntactic-keywords 1687 ;; to make font-lock think that font-lock-syntactic-keywords
1693 ;; are defined. 1688 ;; are defined.
1694 '(t))))) 1689 '(t)))))
1695 (setq cperl-font-lock-multiline t) ; Not localized... 1690 (setq cperl-font-lock-multiline t) ; Not localized...
1696 (set (make-local-variable 'font-lock-multiline) t) 1691 (setq-local font-lock-multiline t)
1697 (set (make-local-variable 'font-lock-fontify-region-function) 1692 (setq-local font-lock-fontify-region-function
1698 #'cperl-font-lock-fontify-region-function) 1693 #'cperl-font-lock-fontify-region-function)
1699 (make-local-variable 'cperl-old-style) 1694 (make-local-variable 'cperl-old-style)
1700 (set (make-local-variable 'normal-auto-fill-function) 1695 (setq-local normal-auto-fill-function
1701 #'cperl-do-auto-fill) 1696 #'cperl-do-auto-fill)
1702 (if (cperl-val 'cperl-font-lock) 1697 (if (cperl-val 'cperl-font-lock)
1703 (progn (or cperl-faces-init (cperl-init-faces)) 1698 (progn (or cperl-faces-init (cperl-init-faces))
1704 (font-lock-mode 1))) 1699 (font-lock-mode 1)))
1705 (set (make-local-variable 'facemenu-add-face-function) 1700 (setq-local facemenu-add-face-function
1706 #'cperl-facemenu-add-face-function) ; XXXX What this guy is for??? 1701 #'cperl-facemenu-add-face-function) ; XXXX What this guy is for???
1707 (and (boundp 'msb-menu-cond) 1702 (and (boundp 'msb-menu-cond)
1708 (not cperl-msb-fixed) 1703 (not cperl-msb-fixed)
1709 (cperl-msb-fix)) 1704 (cperl-msb-fix))
@@ -3478,49 +3473,18 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3478 (font-lock-string-face (if (boundp 'font-lock-string-face) 3473 (font-lock-string-face (if (boundp 'font-lock-string-face)
3479 font-lock-string-face 3474 font-lock-string-face
3480 'font-lock-string-face)) 3475 'font-lock-string-face))
3481 (my-cperl-delimiters-face (if (boundp 'font-lock-constant-face) 3476 (my-cperl-delimiters-face
3482 font-lock-constant-face 3477 font-lock-constant-face)
3483 'font-lock-constant-face))
3484 (my-cperl-REx-spec-char-face ; [] ^.$ and wrapper-of ({}) 3478 (my-cperl-REx-spec-char-face ; [] ^.$ and wrapper-of ({})
3485 (if (boundp 'font-lock-function-name-face) 3479 font-lock-function-name-face)
3486 font-lock-function-name-face
3487 'font-lock-function-name-face))
3488 (font-lock-variable-name-face ; interpolated vars and ({})-code
3489 (if (boundp 'font-lock-variable-name-face)
3490 font-lock-variable-name-face
3491 'font-lock-variable-name-face))
3492 (font-lock-function-name-face ; used in `cperl-find-sub-attrs'
3493 (if (boundp 'font-lock-function-name-face)
3494 font-lock-function-name-face
3495 'font-lock-function-name-face))
3496 (font-lock-constant-face ; used in `cperl-find-sub-attrs'
3497 (if (boundp 'font-lock-constant-face)
3498 font-lock-constant-face
3499 'font-lock-constant-face))
3500 (my-cperl-REx-0length-face ; 0-length, (?:)etc, non-literal \ 3480 (my-cperl-REx-0length-face ; 0-length, (?:)etc, non-literal \
3501 (if (boundp 'font-lock-builtin-face) 3481 font-lock-builtin-face)
3502 font-lock-builtin-face
3503 'font-lock-builtin-face))
3504 (font-lock-comment-face
3505 (if (boundp 'font-lock-comment-face)
3506 font-lock-comment-face
3507 'font-lock-comment-face))
3508 (font-lock-warning-face
3509 (if (boundp 'font-lock-warning-face)
3510 font-lock-warning-face
3511 'font-lock-warning-face))
3512 (my-cperl-REx-ctl-face ; (|) 3482 (my-cperl-REx-ctl-face ; (|)
3513 (if (boundp 'font-lock-keyword-face) 3483 font-lock-keyword-face)
3514 font-lock-keyword-face
3515 'font-lock-keyword-face))
3516 (my-cperl-REx-modifiers-face ; //gims 3484 (my-cperl-REx-modifiers-face ; //gims
3517 (if (boundp 'cperl-nonoverridable-face) 3485 'cperl-nonoverridable-face)
3518 cperl-nonoverridable-face
3519 'cperl-nonoverridable-face))
3520 (my-cperl-REx-length1-face ; length=1 escaped chars, POSIX classes 3486 (my-cperl-REx-length1-face ; length=1 escaped chars, POSIX classes
3521 (if (boundp 'font-lock-type-face) 3487 font-lock-type-face)
3522 font-lock-type-face
3523 'font-lock-type-face))
3524 (stop-point (if ignore-max 3488 (stop-point (if ignore-max
3525 (point-max) 3489 (point-max)
3526 max)) 3490 max))
@@ -6107,7 +6071,7 @@ side-effect of memorizing only. Examples in `cperl-style-examples'."
6107 (set-buffer "*info-perl-tmp*") 6071 (set-buffer "*info-perl-tmp*")
6108 (rename-buffer "*info*") 6072 (rename-buffer "*info*")
6109 (set-buffer bname))) 6073 (set-buffer bname)))
6110 (set (make-local-variable 'window-min-height) 2) 6074 (setq-local window-min-height 2)
6111 (current-buffer))))) 6075 (current-buffer)))))
6112 6076
6113(defun cperl-word-at-point (&optional p) 6077(defun cperl-word-at-point (&optional p)
@@ -6425,7 +6389,7 @@ by CPerl."
6425 (if cperl-use-syntax-table-text-property-for-tags 6389 (if cperl-use-syntax-table-text-property-for-tags
6426 (progn 6390 (progn
6427 ;; Do not introduce variable if not needed, we check it! 6391 ;; Do not introduce variable if not needed, we check it!
6428 (set (make-local-variable 'parse-sexp-lookup-properties) t)))) 6392 (setq-local parse-sexp-lookup-properties t))))
6429 6393
6430;; Copied from imenu-example--name-and-position. 6394;; Copied from imenu-example--name-and-position.
6431(defvar imenu-use-markers) 6395(defvar imenu-use-markers)
@@ -8347,7 +8311,7 @@ may be used to debug problems with delayed incremental fontification."
8347 (goto-char pos) 8311 (goto-char pos)
8348 (normal-mode) 8312 (normal-mode)
8349 ;; Why needed??? With older font-locks??? 8313 ;; Why needed??? With older font-locks???
8350 (set (make-local-variable 'font-lock-cache-position) (make-marker)) 8314 (setq-local font-lock-cache-position (make-marker))
8351 (while (if (> window-size 0) 8315 (while (if (> window-size 0)
8352 (< pos (point-max)) 8316 (< pos (point-max))
8353 (> pos (point-min))) 8317 (> pos (point-min)))
diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el
index ca45795adc0..9bafd7aa42c 100644
--- a/lisp/progmodes/dcl-mode.el
+++ b/lisp/progmodes/dcl-mode.el
@@ -588,17 +588,17 @@ $
588 588
589There is some minimal font-lock support (see vars 589There is some minimal font-lock support (see vars
590`dcl-font-lock-defaults' and `dcl-font-lock-keywords')." 590`dcl-font-lock-defaults' and `dcl-font-lock-keywords')."
591 (set (make-local-variable 'indent-line-function) 'dcl-indent-line) 591 (setq-local indent-line-function 'dcl-indent-line)
592 (set (make-local-variable 'comment-start) "!") 592 (setq-local comment-start "!")
593 (set (make-local-variable 'comment-end) "") 593 (setq-local comment-end "")
594 (set (make-local-variable 'comment-multi-line) nil) 594 (setq-local comment-multi-line nil)
595 595
596 ;; This used to be "^\\$[ \t]*![ \t]*" which looks more correct. 596 ;; This used to be "^\\$[ \t]*![ \t]*" which looks more correct.
597 ;; The drawback was that you couldn't make empty comment lines by pressing 597 ;; The drawback was that you couldn't make empty comment lines by pressing
598 ;; C-M-j repeatedly - only the first line became a comment line. 598 ;; C-M-j repeatedly - only the first line became a comment line.
599 ;; This version has the drawback that the "$" can be anywhere in the line, 599 ;; This version has the drawback that the "$" can be anywhere in the line,
600 ;; and something inappropriate might be interpreted as a comment. 600 ;; and something inappropriate might be interpreted as a comment.
601 (set (make-local-variable 'comment-start-skip) "\\$[ \t]*![ \t]*") 601 (setq-local comment-start-skip "\\$[ \t]*![ \t]*")
602 602
603 (if (boundp 'imenu-generic-expression) 603 (if (boundp 'imenu-generic-expression)
604 (progn (setq imenu-generic-expression dcl-imenu-generic-expression) 604 (progn (setq imenu-generic-expression dcl-imenu-generic-expression)
@@ -619,7 +619,7 @@ There is some minimal font-lock support (see vars
619 (make-local-variable 'dcl-electric-reindent-regexps) 619 (make-local-variable 'dcl-electric-reindent-regexps)
620 620
621 ;; font lock 621 ;; font lock
622 (set (make-local-variable 'font-lock-defaults) dcl-font-lock-defaults) 622 (setq-local font-lock-defaults dcl-font-lock-defaults)
623 623
624 (tempo-use-tag-list 'dcl-tempo-tags)) 624 (tempo-use-tag-list 'dcl-tempo-tags))
625 625
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 13bba7f77a8..913f0c1af5f 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -38,9 +38,10 @@ It has `lisp-mode-abbrev-table' as its parent."
38 :parents (list lisp-mode-abbrev-table)) 38 :parents (list lisp-mode-abbrev-table))
39 39
40(defvar emacs-lisp-mode-syntax-table 40(defvar emacs-lisp-mode-syntax-table
41 (let ((table (make-syntax-table lisp--mode-syntax-table))) 41 (let ((table (make-syntax-table lisp-data-mode-syntax-table)))
42 (modify-syntax-entry ?\[ "(] " table) 42 ;; These are redundant, now.
43 (modify-syntax-entry ?\] ")[ " table) 43 ;;(modify-syntax-entry ?\[ "(] " table)
44 ;;(modify-syntax-entry ?\] ")[ " table)
44 table) 45 table)
45 "Syntax table used in `emacs-lisp-mode'.") 46 "Syntax table used in `emacs-lisp-mode'.")
46 47
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 104d889b8be..aadfb8150cf 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -258,9 +258,9 @@ One argument, the tag info returned by `snarf-tag-function'.")
258Return non-nil if it is a valid tags table, and 258Return non-nil if it is a valid tags table, and
259in that case, also make the tags table state variables 259in that case, also make the tags table state variables
260buffer-local and set them to nil." 260buffer-local and set them to nil."
261 (set (make-local-variable 'tags-table-files) nil) 261 (setq-local tags-table-files nil)
262 (set (make-local-variable 'tags-completion-table) nil) 262 (setq-local tags-completion-table nil)
263 (set (make-local-variable 'tags-included-tables) nil) 263 (setq-local tags-included-tables nil)
264 ;; We used to initialize find-tag-marker-ring and tags-location-ring 264 ;; We used to initialize find-tag-marker-ring and tags-location-ring
265 ;; here, to new empty rings. But that is wrong, because those 265 ;; here, to new empty rings. But that is wrong, because those
266 ;; are global. 266 ;; are global.
@@ -1234,34 +1234,29 @@ error message."
1234 "If `etags-verify-tags-table', make buffer-local format variables. 1234 "If `etags-verify-tags-table', make buffer-local format variables.
1235If current buffer is a valid etags TAGS file, then give it 1235If current buffer is a valid etags TAGS file, then give it
1236buffer-local values of tags table format variables." 1236buffer-local values of tags table format variables."
1237 (and (etags-verify-tags-table) 1237 (when (etags-verify-tags-table)
1238 ;; It is annoying to flash messages on the screen briefly, 1238 (setq-local file-of-tag-function 'etags-file-of-tag)
1239 ;; and this message is not useful. -- rms 1239 (setq-local tags-table-files-function 'etags-tags-table-files)
1240 ;; (message "%s is an `etags' TAGS file" buffer-file-name) 1240 (setq-local tags-completion-table-function 'etags-tags-completion-table)
1241 (mapc (lambda (elt) (set (make-local-variable (car elt)) (cdr elt))) 1241 (setq-local snarf-tag-function 'etags-snarf-tag)
1242 '((file-of-tag-function . etags-file-of-tag) 1242 (setq-local goto-tag-location-function 'etags-goto-tag-location)
1243 (tags-table-files-function . etags-tags-table-files) 1243 (setq-local find-tag-regexp-search-function 're-search-forward)
1244 (tags-completion-table-function . etags-tags-completion-table) 1244 (setq-local find-tag-regexp-tag-order '(tag-re-match-p))
1245 (snarf-tag-function . etags-snarf-tag) 1245 (setq-local find-tag-regexp-next-line-after-failure-p t)
1246 (goto-tag-location-function . etags-goto-tag-location) 1246 (setq-local find-tag-search-function 'search-forward)
1247 (find-tag-regexp-search-function . re-search-forward) 1247 (setq-local find-tag-tag-order '(tag-exact-file-name-match-p
1248 (find-tag-regexp-tag-order . (tag-re-match-p)) 1248 tag-file-name-match-p
1249 (find-tag-regexp-next-line-after-failure-p . t) 1249 tag-exact-match-p
1250 (find-tag-search-function . search-forward) 1250 tag-implicit-name-match-p
1251 (find-tag-tag-order . (tag-exact-file-name-match-p 1251 tag-symbol-match-p
1252 tag-file-name-match-p 1252 tag-word-match-p
1253 tag-exact-match-p 1253 tag-partial-file-name-match-p
1254 tag-implicit-name-match-p 1254 tag-any-match-p))
1255 tag-symbol-match-p 1255 (setq-local find-tag-next-line-after-failure-p nil)
1256 tag-word-match-p 1256 (setq-local list-tags-function 'etags-list-tags)
1257 tag-partial-file-name-match-p 1257 (setq-local tags-apropos-function 'etags-tags-apropos)
1258 tag-any-match-p)) 1258 (setq-local tags-included-tables-function 'etags-tags-included-tables)
1259 (find-tag-next-line-after-failure-p . nil) 1259 (setq-local verify-tags-table-function 'etags-verify-tags-table)))
1260 (list-tags-function . etags-list-tags)
1261 (tags-apropos-function . etags-tags-apropos)
1262 (tags-included-tables-function . etags-tags-included-tables)
1263 (verify-tags-table-function . etags-verify-tags-table)
1264 ))))
1265 1260
1266(defun etags-verify-tags-table () 1261(defun etags-verify-tags-table ()
1267 "Return non-nil if the current buffer is a valid etags TAGS file." 1262 "Return non-nil if the current buffer is a valid etags TAGS file."
@@ -1593,16 +1588,16 @@ hits the start of file."
1593 "Return non-nil if current buffer is empty. 1588 "Return non-nil if current buffer is empty.
1594If empty, make buffer-local values of the tags table format variables 1589If empty, make buffer-local values of the tags table format variables
1595that do nothing." 1590that do nothing."
1596 (and (zerop (buffer-size)) 1591 (when (zerop (buffer-size))
1597 (mapc (lambda (sym) (set (make-local-variable sym) 'ignore)) 1592 (setq-local tags-table-files-function #'ignore)
1598 '(tags-table-files-function 1593 (setq-local tags-completion-table-function #'ignore)
1599 tags-completion-table-function 1594 (setq-local find-tag-regexp-search-function #'ignore)
1600 find-tag-regexp-search-function 1595 (setq-local find-tag-search-function #'ignore)
1601 find-tag-search-function 1596 (setq-local tags-apropos-function #'ignore)
1602 tags-apropos-function 1597 (setq-local tags-included-tables-function #'ignore)
1603 tags-included-tables-function)) 1598 (setq-local verify-tags-table-function
1604 (set (make-local-variable 'verify-tags-table-function) 1599 (lambda () (zerop (buffer-size))))))
1605 (lambda () (zerop (buffer-size)))))) 1600
1606 1601
1607;; Match qualifier functions for tagnames. 1602;; Match qualifier functions for tagnames.
1608;; These functions assume the etags file format defined in etc/ETAGS.EBNF. 1603;; These functions assume the etags file format defined in etc/ETAGS.EBNF.
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index 3a0274c6090..1142c323dc3 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -1218,25 +1218,32 @@ Auto-indent does not happen if a numeric ARG is used."
1218;; Note that unlike the latter, we don't have to worry about nested 1218;; Note that unlike the latter, we don't have to worry about nested
1219;; subprograms (?). 1219;; subprograms (?).
1220;; FIXME push-mark? 1220;; FIXME push-mark?
1221(defun fortran-beginning-of-subprogram () 1221(defun fortran-beginning-of-subprogram (&optional arg)
1222 "Move point to the beginning of the current Fortran subprogram." 1222 "Move point to the beginning of the current Fortran subprogram.
1223If ARG is negative, and point is between subprograms, the
1224\"current\" subprogram is the next one."
1223 (interactive) 1225 (interactive)
1224 (let ((case-fold-search t)) 1226 (if (and arg
1225 ;; If called already at the start of subprogram, go to the previous. 1227 (< arg 0))
1226 (beginning-of-line (if (bolp) 0 1)) 1228 (progn
1227 (save-match-data 1229 (fortran-end-of-subprogram)
1228 (or (looking-at fortran-start-prog-re) 1230 (fortran-beginning-of-subprogram))
1229 ;; This leaves us at bob if before the first subprogram. 1231 (let ((case-fold-search t))
1230 (eq (fortran-previous-statement) 'first-statement) 1232 ;; If called already at the start of subprogram, go to the previous.
1231 (if (or (catch 'ok 1233 (beginning-of-line (if (bolp) 0 1))
1232 (while (re-search-backward fortran-end-prog-re nil 'move) 1234 (save-match-data
1233 (if (fortran-check-end-prog-re) (throw 'ok t)))) 1235 (or (looking-at fortran-start-prog-re)
1234 ;; If the search failed, must be at bob. 1236 ;; This leaves us at bob if before the first subprogram.
1235 ;; First code line is the start of the subprogram. 1237 (eq (fortran-previous-statement) 'first-statement)
1236 ;; FIXME use a more rigorous test, cf fortran-next-statement? 1238 (if (or (catch 'ok
1237 ;; Though that needs to handle continuations too. 1239 (while (re-search-backward fortran-end-prog-re nil 'move)
1238 (not (looking-at "^\\([ \t]*[0-9]\\|[ \t]+[^!#]\\)"))) 1240 (if (fortran-check-end-prog-re) (throw 'ok t))))
1239 (fortran-next-statement)))))) 1241 ;; If the search failed, must be at bob.
1242 ;; First code line is the start of the subprogram.
1243 ;; FIXME use a more rigorous test, cf fortran-next-statement?
1244 ;; Though that needs to handle continuations too.
1245 (not (looking-at "^\\([ \t]*[0-9]\\|[ \t]+[^!#]\\)")))
1246 (fortran-next-statement)))))))
1240 1247
1241;; This is simpler than f-beginning-of-s because the end of a 1248;; This is simpler than f-beginning-of-s because the end of a
1242;; subprogram is never implicit. 1249;; subprogram is never implicit.
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 903005610d7..4c248f771cd 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -744,7 +744,7 @@ NOARG must be t when this macro is used outside `gud-def'."
744 ;; Use the old gud-gbd filter, not because it works, but because it 744 ;; Use the old gud-gbd filter, not because it works, but because it
745 ;; will properly display GDB's answers rather than hanging waiting for 745 ;; will properly display GDB's answers rather than hanging waiting for
746 ;; answers that aren't coming. 746 ;; answers that aren't coming.
747 (set (make-local-variable 'gud-marker-filter) #'gud-gdb-marker-filter)) 747 (setq-local gud-marker-filter #'gud-gdb-marker-filter))
748 (funcall filter proc string))) 748 (funcall filter proc string)))
749 749
750(defvar gdb-control-level 0) 750(defvar gdb-control-level 0)
@@ -831,8 +831,8 @@ detailed description of this mode.
831 (let ((proc (get-buffer-process gud-comint-buffer))) 831 (let ((proc (get-buffer-process gud-comint-buffer)))
832 (add-function :around (process-filter proc) #'gdb--check-interpreter)) 832 (add-function :around (process-filter proc) #'gdb--check-interpreter))
833 833
834 (set (make-local-variable 'gud-minor-mode) 'gdbmi) 834 (setq-local gud-minor-mode 'gdbmi)
835 (set (make-local-variable 'gdb-control-level) 0) 835 (setq-local gdb-control-level 0)
836 (setq comint-input-sender 'gdb-send) 836 (setq comint-input-sender 'gdb-send)
837 (when (ring-empty-p comint-input-ring) ; cf shell-mode 837 (when (ring-empty-p comint-input-ring) ; cf shell-mode
838 (let ((hfile (expand-file-name (or (getenv "GDBHISTFILE") 838 (let ((hfile (expand-file-name (or (getenv "GDBHISTFILE")
@@ -861,9 +861,9 @@ detailed description of this mode.
861 (and (stringp hsize) 861 (and (stringp hsize)
862 (integerp (setq hsize (string-to-number hsize))) 862 (integerp (setq hsize (string-to-number hsize)))
863 (> hsize 0) 863 (> hsize 0)
864 (set (make-local-variable 'comint-input-ring-size) hsize)) 864 (setq-local comint-input-ring-size hsize))
865 (if (stringp hfile) 865 (if (stringp hfile)
866 (set (make-local-variable 'comint-input-ring-file-name) hfile)) 866 (setq-local comint-input-ring-file-name hfile))
867 (comint-read-input-ring t))) 867 (comint-read-input-ring t)))
868 (gud-def gud-tbreak "tbreak %f:%l" "\C-t" 868 (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
869 "Set temporary breakpoint at current line.") 869 "Set temporary breakpoint at current line.")
@@ -966,8 +966,7 @@ detailed description of this mode.
966 (define-key gud-minor-mode-map [left-margin C-mouse-3] 966 (define-key gud-minor-mode-map [left-margin C-mouse-3]
967 'gdb-mouse-jump) 967 'gdb-mouse-jump)
968 968
969 (set (make-local-variable 'gud-gdb-completion-function) 969 (setq-local gud-gdb-completion-function 'gud-gdbmi-completions)
970 'gud-gdbmi-completions)
971 970
972 (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point 971 (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
973 nil 'local) 972 nil 'local)
@@ -1141,8 +1140,8 @@ no input, and GDB is waiting for input."
1141 (lambda () (gdb-tooltip-print expr))))))) 1140 (lambda () (gdb-tooltip-print expr)))))))
1142 1141
1143(defun gdb-init-buffer () 1142(defun gdb-init-buffer ()
1144 (set (make-local-variable 'gud-minor-mode) 'gdbmi) 1143 (setq-local gud-minor-mode 'gdbmi)
1145 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 1144 (setq-local tool-bar-map gud-tool-bar-map)
1146 (when gud-tooltip-mode 1145 (when gud-tooltip-mode
1147 (make-local-variable 'gdb-define-alist) 1146 (make-local-variable 'gdb-define-alist)
1148 (gdb-create-define-alist) 1147 (gdb-create-define-alist)
@@ -1558,10 +1557,10 @@ this trigger is subscribed to `gdb-buf-publisher' and called with
1558 (when mode (funcall mode)) 1557 (when mode (funcall mode))
1559 (setq gdb-buffer-type buffer-type) 1558 (setq gdb-buffer-type buffer-type)
1560 (when thread 1559 (when thread
1561 (set (make-local-variable 'gdb-thread-number) thread)) 1560 (setq-local gdb-thread-number thread))
1562 (set (make-local-variable 'gud-minor-mode) 1561 (setq-local gud-minor-mode
1563 (buffer-local-value 'gud-minor-mode gud-comint-buffer)) 1562 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
1564 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 1563 (setq-local tool-bar-map gud-tool-bar-map)
1565 (rename-buffer (funcall (gdb-rules-name-maker rules))) 1564 (rename-buffer (funcall (gdb-rules-name-maker rules)))
1566 (when trigger 1565 (when trigger
1567 (gdb-add-subscriber gdb-buf-publisher 1566 (gdb-add-subscriber gdb-buf-publisher
@@ -3364,8 +3363,7 @@ corresponding to the mode line clicked."
3364 (setq gdb-thread-position (make-marker)) 3363 (setq gdb-thread-position (make-marker))
3365 (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position) 3364 (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position)
3366 (setq header-line-format gdb-threads-header) 3365 (setq header-line-format gdb-threads-header)
3367 (set (make-local-variable 'font-lock-defaults) 3366 (setq-local font-lock-defaults '(gdb-threads-font-lock-keywords))
3368 '(gdb-threads-font-lock-keywords))
3369 'gdb-invalidate-threads) 3367 'gdb-invalidate-threads)
3370 3368
3371(defun gdb-thread-list-handler-custom () 3369(defun gdb-thread-list-handler-custom ()
@@ -3920,8 +3918,7 @@ DOC is an optional documentation string."
3920(define-derived-mode gdb-memory-mode gdb-parent-mode "Memory" 3918(define-derived-mode gdb-memory-mode gdb-parent-mode "Memory"
3921 "Major mode for examining memory." 3919 "Major mode for examining memory."
3922 (setq header-line-format gdb-memory-header) 3920 (setq header-line-format gdb-memory-header)
3923 (set (make-local-variable 'font-lock-defaults) 3921 (setq-local font-lock-defaults '(gdb-memory-font-lock-keywords))
3924 '(gdb-memory-font-lock-keywords))
3925 'gdb-invalidate-memory) 3922 'gdb-invalidate-memory)
3926 3923
3927(defun gdb-memory-buffer-name () 3924(defun gdb-memory-buffer-name ()
@@ -4013,9 +4010,8 @@ DOC is an optional documentation string."
4013 ;; TODO Rename overlay variable for disassembly mode 4010 ;; TODO Rename overlay variable for disassembly mode
4014 (add-to-list 'overlay-arrow-variable-list 'gdb-disassembly-position) 4011 (add-to-list 'overlay-arrow-variable-list 'gdb-disassembly-position)
4015 (setq fringes-outside-margins t) 4012 (setq fringes-outside-margins t)
4016 (set (make-local-variable 'gdb-disassembly-position) (make-marker)) 4013 (setq-local gdb-disassembly-position (make-marker))
4017 (set (make-local-variable 'font-lock-defaults) 4014 (setq-local font-lock-defaults '(gdb-disassembly-font-lock-keywords))
4018 '(gdb-disassembly-font-lock-keywords))
4019 'gdb-invalidate-disassembly) 4015 'gdb-invalidate-disassembly)
4020 4016
4021(defun gdb-disassembly-handler-custom () 4017(defun gdb-disassembly-handler-custom ()
@@ -4222,8 +4218,7 @@ member."
4222 (setq gdb-stack-position (make-marker)) 4218 (setq gdb-stack-position (make-marker))
4223 (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position) 4219 (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
4224 (setq truncate-lines t) ;; Make it easier to see overlay arrow. 4220 (setq truncate-lines t) ;; Make it easier to see overlay arrow.
4225 (set (make-local-variable 'font-lock-defaults) 4221 (setq-local font-lock-defaults '(gdb-frames-font-lock-keywords))
4226 '(gdb-frames-font-lock-keywords))
4227 'gdb-invalidate-frames) 4222 'gdb-invalidate-frames)
4228 4223
4229(defun gdb-select-frame (&optional event) 4224(defun gdb-select-frame (&optional event)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index dafba22f777..5dc99cc7e93 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -100,7 +100,7 @@ To change the default value, use \\[customize] or call the function
100 :set #'grep-apply-setting 100 :set #'grep-apply-setting
101 :version "22.1") 101 :version "22.1")
102 102
103(defcustom grep-match-regexp "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m" 103(defcustom grep-match-regexp "\033\\[\\(?:0?1;\\)?31m\\(.*?\\)\033\\[[0-9]*m"
104 "Regular expression matching grep markers to highlight. 104 "Regular expression matching grep markers to highlight.
105It matches SGR ANSI escape sequences which are emitted by grep to 105It matches SGR ANSI escape sequences which are emitted by grep to
106color its output. This variable is used in `grep-filter'." 106color its output. This variable is used in `grep-filter'."
@@ -412,7 +412,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
412 (- mend beg)))))) 412 (- mend beg))))))
413 nil nil 413 nil nil
414 (3 '(face nil display ":"))) 414 (3 '(face nil display ":")))
415 ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) 415 ("^Binary file \\(.+\\) matches" 1 nil nil 0 1))
416 "Regexp used to match grep hits. 416 "Regexp used to match grep hits.
417See `compilation-error-regexp-alist' for format details.") 417See `compilation-error-regexp-alist' for format details.")
418 418
@@ -568,8 +568,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
568 ;; GREP_COLORS is used in GNU grep 2.5.2 and later versions 568 ;; GREP_COLORS is used in GNU grep 2.5.2 and later versions
569 (setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:sl=:cx=:ne")) 569 (setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:sl=:cx=:ne"))
570 (setq-local grep-num-matches-found 0) 570 (setq-local grep-num-matches-found 0)
571 (set (make-local-variable 'compilation-exit-message-function) 571 (setq-local compilation-exit-message-function #'grep-exit-message)
572 #'grep-exit-message)
573 (run-hooks 'grep-setup-hook)) 572 (run-hooks 'grep-setup-hook))
574 573
575(defun grep-exit-message (status code msg) 574(defun grep-exit-message (status code msg)
@@ -880,22 +879,22 @@ The value depends on `grep-command', `grep-template',
880(define-compilation-mode grep-mode "Grep" 879(define-compilation-mode grep-mode "Grep"
881 "Sets `grep-last-buffer' and `compilation-window-height'." 880 "Sets `grep-last-buffer' and `compilation-window-height'."
882 (setq grep-last-buffer (current-buffer)) 881 (setq grep-last-buffer (current-buffer))
883 (set (make-local-variable 'tool-bar-map) grep-mode-tool-bar-map) 882 (setq-local tool-bar-map grep-mode-tool-bar-map)
884 (set (make-local-variable 'compilation-error-face) 883 (setq-local compilation-error-face
885 grep-hit-face) 884 grep-hit-face)
886 (set (make-local-variable 'compilation-error-regexp-alist) 885 (setq-local compilation-error-regexp-alist
887 grep-regexp-alist) 886 grep-regexp-alist)
888 (set (make-local-variable 'compilation-mode-line-errors) 887 (setq-local compilation-mode-line-errors
889 grep-mode-line-matches) 888 grep-mode-line-matches)
890 ;; compilation-directory-matcher can't be nil, so we set it to a regexp that 889 ;; compilation-directory-matcher can't be nil, so we set it to a regexp that
891 ;; can never match. 890 ;; can never match.
892 (set (make-local-variable 'compilation-directory-matcher) 891 (setq-local compilation-directory-matcher
893 (list regexp-unmatchable)) 892 (list regexp-unmatchable))
894 (set (make-local-variable 'compilation-process-setup-function) 893 (setq-local compilation-process-setup-function
895 #'grep-process-setup) 894 #'grep-process-setup)
896 (set (make-local-variable 'compilation-disable-input) t) 895 (setq-local compilation-disable-input t)
897 (set (make-local-variable 'compilation-error-screen-columns) 896 (setq-local compilation-error-screen-columns
898 grep-error-screen-columns) 897 grep-error-screen-columns)
899 (add-hook 'compilation-filter-hook #'grep-filter nil t)) 898 (add-hook 'compilation-filter-hook #'grep-filter nil t))
900 899
901(defun grep--save-buffers () 900(defun grep--save-buffers ()
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 279a70b0d75..134c2fc5c97 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1683,7 +1683,7 @@ and source-file directory for your debugger."
1683 1683
1684;;;###autoload 1684;;;###autoload
1685(defun pdb (command-line) 1685(defun pdb (command-line)
1686 "Run COMMAND-LINE in the `*gud-FILE*' buffer. 1686 "Run COMMAND-LINE in the `*gud-FILE*' buffer to debug Python programs.
1687 1687
1688COMMAND-LINE should include the pdb executable 1688COMMAND-LINE should include the pdb executable
1689name (`gud-pdb-command-name') and the file to be debugged. 1689name (`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
2566commands. 2566commands.
2567 2567
2568Other commands for interacting with the debugger process are inherited from 2568Other commands for interacting with the debugger process are inherited from
2569comint mode, which see." 2569`comint-mode', which see.
2570
2571Commands:
2572
2573\\{gud-mode-map}"
2570 (setq mode-line-process '(":%s")) 2574 (setq mode-line-process '(":%s"))
2571 (define-key (current-local-map) "\C-c\C-l" 'gud-refresh) 2575 (define-key (current-local-map) "\C-c\C-l" 'gud-refresh)
2572 (setq-local gud-last-frame nil) 2576 (setq-local gud-last-frame nil)
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el
index 25e75235aa4..7cbc9708fce 100644
--- a/lisp/progmodes/hideif.el
+++ b/lisp/progmodes/hideif.el
@@ -302,17 +302,17 @@ Several variables affect how the hiding is done:
302 ;; We can still simulate the behavior of older hideif versions (i.e. 302 ;; We can still simulate the behavior of older hideif versions (i.e.
303 ;; `hide-ifdef-env' being buffer local) by clearing this variable 303 ;; `hide-ifdef-env' being buffer local) by clearing this variable
304 ;; (C-c @ C) every time before hiding current buffer. 304 ;; (C-c @ C) every time before hiding current buffer.
305;; (set (make-local-variable 'hide-ifdef-env) 305;; (setq-local hide-ifdef-env
306;; (default-value 'hide-ifdef-env)) 306;; (default-value 'hide-ifdef-env))
307 (set 'hide-ifdef-env (default-value 'hide-ifdef-env)) 307 (set 'hide-ifdef-env (default-value 'hide-ifdef-env))
308 ;; Some C/C++ headers might have other ways to prevent reinclusion and 308 ;; Some C/C++ headers might have other ways to prevent reinclusion and
309 ;; thus would like `hide-ifdef-expand-reinclusion-protection' to be nil. 309 ;; thus would like `hide-ifdef-expand-reinclusion-protection' to be nil.
310 (set (make-local-variable 'hide-ifdef-expand-reinclusion-protection) 310 (setq-local hide-ifdef-expand-reinclusion-protection
311 (default-value 'hide-ifdef-expand-reinclusion-protection)) 311 (default-value 'hide-ifdef-expand-reinclusion-protection))
312 (set (make-local-variable 'hide-ifdef-hiding) 312 (setq-local hide-ifdef-hiding
313 (default-value 'hide-ifdef-hiding)) 313 (default-value 'hide-ifdef-hiding))
314 (set (make-local-variable 'hif-outside-read-only) buffer-read-only) 314 (setq-local hif-outside-read-only buffer-read-only)
315 (set (make-local-variable 'line-move-ignore-invisible) t) 315 (setq-local line-move-ignore-invisible t)
316 (add-hook 'change-major-mode-hook 316 (add-hook 'change-major-mode-hook
317 (lambda () (hide-ifdef-mode -1)) nil t) 317 (lambda () (hide-ifdef-mode -1)) nil t)
318 318
@@ -1792,7 +1792,7 @@ It does not do the work that's pointless to redo on a recursive entry."
1792(defun hide-ifdef-toggle-shadowing () 1792(defun hide-ifdef-toggle-shadowing ()
1793 "Toggle shadowing." 1793 "Toggle shadowing."
1794 (interactive) 1794 (interactive)
1795 (set (make-local-variable 'hide-ifdef-shadow) (not hide-ifdef-shadow)) 1795 (setq-local hide-ifdef-shadow (not hide-ifdef-shadow))
1796 (message "Shadowing %s" (if hide-ifdef-shadow "ON" "OFF")) 1796 (message "Shadowing %s" (if hide-ifdef-shadow "ON" "OFF"))
1797 (save-restriction 1797 (save-restriction
1798 (widen) 1798 (widen)
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 59db646ff32..93d5d0fbcc2 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -124,9 +124,9 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword
124(define-key lisp-mode-map "\C-c\C-v" 'lisp-show-variable-documentation) 124(define-key lisp-mode-map "\C-c\C-v" 'lisp-show-variable-documentation)
125 125
126 126
127;;; This function exists for backwards compatibility. 127;; This function exists for backwards compatibility.
128;;; Previous versions of this package bound commands to C-c <letter> 128;; Previous versions of this package bound commands to C-c <letter>
129;;; bindings, which is not allowed by the Emacs standard. 129;; bindings, which is not allowed by the Emacs standard.
130 130
131;;; "This function binds many inferior-lisp commands to C-c <letter> bindings, 131;;; "This function binds many inferior-lisp commands to C-c <letter> bindings,
132;;;where they are more accessible. C-c <letter> bindings are reserved for the 132;;;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]
274to continue it." 274to continue it."
275 (setq comint-prompt-regexp inferior-lisp-prompt) 275 (setq comint-prompt-regexp inferior-lisp-prompt)
276 (setq mode-line-process '(":%s")) 276 (setq mode-line-process '(":%s"))
277 (lisp-mode-variables t) 277 (lisp-mode-variables)
278 (set-syntax-table lisp-mode-syntax-table)
278 (setq comint-get-old-input (function lisp-get-old-input)) 279 (setq comint-get-old-input (function lisp-get-old-input))
279 (setq comint-input-filter (function lisp-input-filter))) 280 (setq comint-input-filter (function lisp-input-filter)))
280 281
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el
index 87c20a2ee0e..e15ec721814 100644
--- a/lisp/progmodes/meta-mode.el
+++ b/lisp/progmodes/meta-mode.el
@@ -919,57 +919,55 @@ The environment marked is the one that contains point or follows point."
919(define-derived-mode meta-common-mode prog-mode "-Meta-common-" 919(define-derived-mode meta-common-mode prog-mode "-Meta-common-"
920 "Common initialization for Metafont or MetaPost mode." 920 "Common initialization for Metafont or MetaPost mode."
921 :abbrev-table meta-mode-abbrev-table 921 :abbrev-table meta-mode-abbrev-table
922 (set (make-local-variable 'paragraph-start) 922 (setq-local paragraph-start (concat page-delimiter "\\|$"))
923 (concat page-delimiter "\\|$")) 923 (setq-local paragraph-separate (concat page-delimiter "\\|$"))
924 (set (make-local-variable 'paragraph-separate)
925 (concat page-delimiter "\\|$"))
926 924
927 (set (make-local-variable 'paragraph-ignore-fill-prefix) t) 925 (setq-local paragraph-ignore-fill-prefix t)
928 926
929 (set (make-local-variable 'comment-start-skip) "%+[ \t\f]*") 927 (setq-local comment-start-skip "%+[ \t\f]*")
930 (set (make-local-variable 'comment-start) "%") 928 (setq-local comment-start "%")
931 (set (make-local-variable 'comment-end) "") 929 (setq-local comment-end "")
932 (set (make-local-variable 'comment-multi-line) nil) 930 (setq-local comment-multi-line nil)
933 931
934 ;; We use `back-to-indentation' but \f is no indentation sign. 932 ;; We use `back-to-indentation' but \f is no indentation sign.
935 (modify-syntax-entry ?\f "_ ") 933 (modify-syntax-entry ?\f "_ ")
936 934
937 (set (make-local-variable 'parse-sexp-ignore-comments) t) 935 (setq-local parse-sexp-ignore-comments t)
938 936
939 (add-hook 'completion-at-point-functions #'meta-completions-at-point nil t) 937 (add-hook 'completion-at-point-functions #'meta-completions-at-point nil t)
940 (set (make-local-variable 'comment-indent-function) #'meta-comment-indent) 938 (setq-local comment-indent-function #'meta-comment-indent)
941 (set (make-local-variable 'indent-line-function) #'meta-indent-line) 939 (setq-local indent-line-function #'meta-indent-line)
942 ;; No need to define a mode-specific 'indent-region-function. 940 ;; No need to define a mode-specific 'indent-region-function.
943 ;; Simply use the generic 'indent-region and 'comment-region. 941 ;; Simply use the generic 'indent-region and 'comment-region.
944 942
945 ;; Set defaults for font-lock mode. 943 ;; Set defaults for font-lock mode.
946 (set (make-local-variable 'font-lock-defaults) 944 (setq-local font-lock-defaults
947 '(meta-font-lock-keywords 945 '(meta-font-lock-keywords
948 nil nil ((?_ . "w")) nil 946 nil nil ((?_ . "w")) nil
949 (font-lock-comment-start-regexp . "%")))) 947 (font-lock-comment-start-regexp . "%"))))
950 948
951 949
952;;;###autoload 950;;;###autoload
953(define-derived-mode metafont-mode meta-common-mode "Metafont" 951(define-derived-mode metafont-mode meta-common-mode "Metafont"
954 "Major mode for editing Metafont sources." 952 "Major mode for editing Metafont sources."
955 ;; Set defaults for completion function. 953 ;; Set defaults for completion function.
956 (set (make-local-variable 'meta-symbol-list) nil) 954 (setq-local meta-symbol-list nil)
957 (set (make-local-variable 'meta-symbol-changed) nil) 955 (setq-local meta-symbol-changed nil)
958 (apply 'meta-add-symbols metafont-symbol-list) 956 (apply 'meta-add-symbols metafont-symbol-list)
959 (set (make-local-variable 'meta-complete-list) 957 (setq-local meta-complete-list
960 (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list) 958 (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list)
961 (list "" 'ispell-complete-word)))) 959 (list "" 'ispell-complete-word))))
962 960
963;;;###autoload 961;;;###autoload
964(define-derived-mode metapost-mode meta-common-mode "MetaPost" 962(define-derived-mode metapost-mode meta-common-mode "MetaPost"
965 "Major mode for editing MetaPost sources." 963 "Major mode for editing MetaPost sources."
966 ;; Set defaults for completion function. 964 ;; Set defaults for completion function.
967 (set (make-local-variable 'meta-symbol-list) nil) 965 (setq-local meta-symbol-list nil)
968 (set (make-local-variable 'meta-symbol-changed) nil) 966 (setq-local meta-symbol-changed nil)
969 (apply 'meta-add-symbols metapost-symbol-list) 967 (apply 'meta-add-symbols metapost-symbol-list)
970 (set (make-local-variable 'meta-complete-list) 968 (setq-local meta-complete-list
971 (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list) 969 (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list)
972 (list "" 'ispell-complete-word)))) 970 (list "" 'ispell-complete-word))))
973 971
974 972
975;;; Just in case ... 973;;; Just in case ...
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 449eadc3de7..98ad41487a1 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1275,13 +1275,15 @@ the menu entries in the dispatch menu.")
1275 " ")) 1275 " "))
1276 1276
1277;;;###autoload 1277;;;###autoload
1278(defun project-switch-project () 1278(defun project-switch-project (dir)
1279 "\"Switch\" to another project by running an Emacs command. 1279 "\"Switch\" to another project by running an Emacs command.
1280The available commands are presented as a dispatch menu 1280The available commands are presented as a dispatch menu
1281made from `project-switch-commands'." 1281made from `project-switch-commands'.
1282 (interactive) 1282
1283 (let ((dir (project-prompt-project-dir)) 1283When called in a program, it will use the project corresponding
1284 (choice nil)) 1284to directory DIR."
1285 (interactive (list (project-prompt-project-dir)))
1286 (let ((choice nil))
1285 (while (not choice) 1287 (while (not choice)
1286 (setq choice (assq (read-event (project--keymap-prompt)) 1288 (setq choice (assq (read-event (project--keymap-prompt))
1287 project-switch-commands))) 1289 project-switch-commands)))
diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el
index 6db7a14a241..bcf7bfdefc8 100644
--- a/lisp/progmodes/ps-mode.el
+++ b/lisp/progmodes/ps-mode.el
@@ -501,18 +501,18 @@ point to the corresponding spot in the PostScript window, if input
501to the interpreter was sent from that window. 501to the interpreter was sent from that window.
502Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number has the same effect." 502Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number has the same effect."
503 (setq-local syntax-propertize-function #'ps-mode-syntax-propertize) 503 (setq-local syntax-propertize-function #'ps-mode-syntax-propertize)
504 (set (make-local-variable 'font-lock-defaults) 504 (setq-local font-lock-defaults
505 '((ps-mode-font-lock-keywords 505 '((ps-mode-font-lock-keywords
506 ps-mode-font-lock-keywords-1 506 ps-mode-font-lock-keywords-1
507 ps-mode-font-lock-keywords-2 507 ps-mode-font-lock-keywords-2
508 ps-mode-font-lock-keywords-3) 508 ps-mode-font-lock-keywords-3)
509 nil)) 509 nil))
510 (smie-setup nil #'ps-mode-smie-rules) 510 (smie-setup nil #'ps-mode-smie-rules)
511 (setq-local electric-indent-chars 511 (setq-local electric-indent-chars
512 (append '(?> ?\] ?\}) electric-indent-chars)) 512 (append '(?> ?\] ?\}) electric-indent-chars))
513 (set (make-local-variable 'comment-start) "%") 513 (setq-local comment-start "%")
514 ;; NOTE: `\' has a special meaning in strings only 514 ;; NOTE: `\' has a special meaning in strings only
515 (set (make-local-variable 'comment-start-skip) "%+[ \t]*") 515 (setq-local comment-start-skip "%+[ \t]*")
516 ;; enable doc-view-minor-mode => C-c C-c starts viewing the current ps file 516 ;; enable doc-view-minor-mode => C-c C-c starts viewing the current ps file
517 ;; with doc-view-mode. 517 ;; with doc-view-mode.
518 (doc-view-minor-mode 1)) 518 (doc-view-minor-mode 1))
@@ -910,11 +910,11 @@ plus the usually uncoded characters inserted on positions 1 through 28."
910(define-derived-mode ps-run-mode comint-mode "Interactive PS" 910(define-derived-mode ps-run-mode comint-mode "Interactive PS"
911 "Major mode in interactive PostScript window. 911 "Major mode in interactive PostScript window.
912This mode is invoked from `ps-mode' and should not be called directly." 912This mode is invoked from `ps-mode' and should not be called directly."
913 (set (make-local-variable 'font-lock-defaults) 913 (setq-local font-lock-defaults
914 '((ps-run-font-lock-keywords 914 '((ps-run-font-lock-keywords
915 ps-run-font-lock-keywords-1 915 ps-run-font-lock-keywords-1
916 ps-run-font-lock-keywords-2) 916 ps-run-font-lock-keywords-2)
917 t)) 917 t))
918 (setq mode-line-process '(":%s"))) 918 (setq mode-line-process '(":%s")))
919 919
920(defun ps-run-running () 920(defun ps-run-running ()
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index e9c3b3986aa..d75944a702f 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -4,8 +4,8 @@
4 4
5;; Author: Fabián E. Gallina <fgallina@gnu.org> 5;; Author: Fabián E. Gallina <fgallina@gnu.org>
6;; URL: https://github.com/fgallina/python.el 6;; URL: https://github.com/fgallina/python.el
7;; Version: 0.27 7;; Version: 0.27.1
8;; Package-Requires: ((emacs "24.1") (cl-lib "1.0")) 8;; Package-Requires: ((emacs "24.2") (cl-lib "1.0"))
9;; Maintainer: emacs-devel@gnu.org 9;; Maintainer: emacs-devel@gnu.org
10;; Created: Jul 2010 10;; Created: Jul 2010
11;; Keywords: languages 11;; Keywords: languages
@@ -875,7 +875,7 @@ work on `python-indent-calculate-indentation' instead."
875 (python-util-forward-comment) 875 (python-util-forward-comment)
876 (current-indentation)))) 876 (current-indentation))))
877 (if (and indentation (not (zerop indentation))) 877 (if (and indentation (not (zerop indentation)))
878 (set (make-local-variable 'python-indent-offset) indentation) 878 (setq-local python-indent-offset indentation)
879 (when python-indent-guess-indent-offset-verbose 879 (when python-indent-guess-indent-offset-verbose
880 (message "Can't guess python-indent-offset, using defaults: %s" 880 (message "Can't guess python-indent-offset, using defaults: %s"
881 python-indent-offset)))))))) 881 python-indent-offset))))))))
@@ -2623,7 +2623,7 @@ also `with-current-buffer'."
2623 (set-buffer python-shell--font-lock-buffer) 2623 (set-buffer python-shell--font-lock-buffer)
2624 (when (not font-lock-mode) 2624 (when (not font-lock-mode)
2625 (font-lock-mode 1)) 2625 (font-lock-mode 1))
2626 (set (make-local-variable 'delay-mode-hooks) t) 2626 (setq-local delay-mode-hooks t)
2627 (let ((python-indent-guess-indent-offset nil)) 2627 (let ((python-indent-guess-indent-offset nil))
2628 (when (not (derived-mode-p 'python-mode)) 2628 (when (not (derived-mode-p 'python-mode))
2629 (python-mode)) 2629 (python-mode))
@@ -2702,7 +2702,7 @@ With argument MSG show activation message."
2702 (interactive "p") 2702 (interactive "p")
2703 (python-shell-with-shell-buffer 2703 (python-shell-with-shell-buffer
2704 (python-shell-font-lock-kill-buffer) 2704 (python-shell-font-lock-kill-buffer)
2705 (set (make-local-variable 'python-shell--font-lock-buffer) nil) 2705 (setq-local python-shell--font-lock-buffer nil)
2706 (add-hook 'post-command-hook 2706 (add-hook 'post-command-hook
2707 #'python-shell-font-lock-post-command-hook nil 'local) 2707 #'python-shell-font-lock-post-command-hook nil 'local)
2708 (add-hook 'kill-buffer-hook 2708 (add-hook 'kill-buffer-hook
@@ -2725,7 +2725,7 @@ With argument MSG show deactivation message."
2725 (cdr (python-util-comint-last-prompt)) 2725 (cdr (python-util-comint-last-prompt))
2726 (line-end-position) 2726 (line-end-position)
2727 '(face nil font-lock-face nil))) 2727 '(face nil font-lock-face nil)))
2728 (set (make-local-variable 'python-shell--font-lock-buffer) nil) 2728 (setq-local python-shell--font-lock-buffer nil)
2729 (remove-hook 'post-command-hook 2729 (remove-hook 'post-command-hook
2730 #'python-shell-font-lock-post-command-hook 'local) 2730 #'python-shell-font-lock-post-command-hook 'local)
2731 (remove-hook 'kill-buffer-hook 2731 (remove-hook 'kill-buffer-hook
@@ -2741,8 +2741,8 @@ With argument MSG show deactivation message."
2741With argument MSG show activation/deactivation message." 2741With argument MSG show activation/deactivation message."
2742 (interactive "p") 2742 (interactive "p")
2743 (python-shell-with-shell-buffer 2743 (python-shell-with-shell-buffer
2744 (set (make-local-variable 'python-shell-font-lock-enable) 2744 (setq-local python-shell-font-lock-enable
2745 (not python-shell-font-lock-enable)) 2745 (not python-shell-font-lock-enable))
2746 (if python-shell-font-lock-enable 2746 (if python-shell-font-lock-enable
2747 (python-shell-font-lock-turn-on msg) 2747 (python-shell-font-lock-turn-on msg)
2748 (python-shell-font-lock-turn-off msg)) 2748 (python-shell-font-lock-turn-off msg))
@@ -2765,9 +2765,9 @@ eventually provide a shell."
2765(defun python-shell-comint-watch-for-first-prompt-output-filter (output) 2765(defun python-shell-comint-watch-for-first-prompt-output-filter (output)
2766 "Run `python-shell-first-prompt-hook' when first prompt is found in OUTPUT." 2766 "Run `python-shell-first-prompt-hook' when first prompt is found in OUTPUT."
2767 (when (not python-shell--first-prompt-received) 2767 (when (not python-shell--first-prompt-received)
2768 (set (make-local-variable 'python-shell--first-prompt-received-output-buffer) 2768 (setq-local python-shell--first-prompt-received-output-buffer
2769 (concat python-shell--first-prompt-received-output-buffer 2769 (concat python-shell--first-prompt-received-output-buffer
2770 (ansi-color-filter-apply output))) 2770 (ansi-color-filter-apply output)))
2771 (when (python-shell-comint-end-of-output-p 2771 (when (python-shell-comint-end-of-output-p
2772 python-shell--first-prompt-received-output-buffer) 2772 python-shell--first-prompt-received-output-buffer)
2773 (if (string-match-p 2773 (if (string-match-p
@@ -2775,7 +2775,7 @@ eventually provide a shell."
2775 (or python-shell--first-prompt-received-output-buffer "")) 2775 (or python-shell--first-prompt-received-output-buffer ""))
2776 ;; Skip pdb prompts and reset the buffer. 2776 ;; Skip pdb prompts and reset the buffer.
2777 (setq python-shell--first-prompt-received-output-buffer nil) 2777 (setq python-shell--first-prompt-received-output-buffer nil)
2778 (set (make-local-variable 'python-shell--first-prompt-received) t) 2778 (setq-local python-shell--first-prompt-received t)
2779 (setq python-shell--first-prompt-received-output-buffer nil) 2779 (setq python-shell--first-prompt-received-output-buffer nil)
2780 (with-current-buffer (current-buffer) 2780 (with-current-buffer (current-buffer)
2781 (let ((inhibit-quit nil)) 2781 (let ((inhibit-quit nil))
@@ -2815,30 +2815,30 @@ variable.
2815\(Type \\[describe-mode] in the process buffer for a list of commands.)" 2815\(Type \\[describe-mode] in the process buffer for a list of commands.)"
2816 (when python-shell--parent-buffer 2816 (when python-shell--parent-buffer
2817 (python-util-clone-local-variables python-shell--parent-buffer)) 2817 (python-util-clone-local-variables python-shell--parent-buffer))
2818 (set (make-local-variable 'indent-tabs-mode) nil) 2818 (setq-local indent-tabs-mode nil)
2819 ;; Users can interactively override default values for 2819 ;; Users can interactively override default values for
2820 ;; `python-shell-interpreter' and `python-shell-interpreter-args' 2820 ;; `python-shell-interpreter' and `python-shell-interpreter-args'
2821 ;; when calling `run-python'. This ensures values let-bound in 2821 ;; when calling `run-python'. This ensures values let-bound in
2822 ;; `python-shell-make-comint' are locally set if needed. 2822 ;; `python-shell-make-comint' are locally set if needed.
2823 (set (make-local-variable 'python-shell-interpreter) 2823 (setq-local python-shell-interpreter
2824 (or python-shell--interpreter python-shell-interpreter)) 2824 (or python-shell--interpreter python-shell-interpreter))
2825 (set (make-local-variable 'python-shell-interpreter-args) 2825 (setq-local python-shell-interpreter-args
2826 (or python-shell--interpreter-args python-shell-interpreter-args)) 2826 (or python-shell--interpreter-args python-shell-interpreter-args))
2827 (set (make-local-variable 'python-shell--prompt-calculated-input-regexp) nil) 2827 (setq-local python-shell--prompt-calculated-input-regexp nil)
2828 (set (make-local-variable 'python-shell--block-prompt) nil) 2828 (setq-local python-shell--block-prompt nil)
2829 (set (make-local-variable 'python-shell--prompt-calculated-output-regexp) nil) 2829 (setq-local python-shell--prompt-calculated-output-regexp nil)
2830 (python-shell-prompt-set-calculated-regexps) 2830 (python-shell-prompt-set-calculated-regexps)
2831 (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp) 2831 (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp)
2832 (set (make-local-variable 'comint-prompt-read-only) t) 2832 (setq-local comint-prompt-read-only t)
2833 (setq mode-line-process '(":%s")) 2833 (setq mode-line-process '(":%s"))
2834 (set (make-local-variable 'comint-output-filter-functions) 2834 (setq-local comint-output-filter-functions
2835 '(ansi-color-process-output 2835 '(ansi-color-process-output
2836 python-shell-comint-watch-for-first-prompt-output-filter 2836 python-shell-comint-watch-for-first-prompt-output-filter
2837 python-comint-postoutput-scroll-to-bottom 2837 python-comint-postoutput-scroll-to-bottom
2838 comint-watch-for-password-prompt)) 2838 comint-watch-for-password-prompt))
2839 (setq-local comint-highlight-input nil) 2839 (setq-local comint-highlight-input nil)
2840 (set (make-local-variable 'compilation-error-regexp-alist) 2840 (setq-local compilation-error-regexp-alist
2841 python-shell-compilation-regexp-alist) 2841 python-shell-compilation-regexp-alist)
2842 (add-hook 'completion-at-point-functions 2842 (add-hook 'completion-at-point-functions
2843 #'python-shell-completion-at-point nil 'local) 2843 #'python-shell-completion-at-point nil 'local)
2844 (define-key inferior-python-mode-map "\t" 2844 (define-key inferior-python-mode-map "\t"
@@ -3605,7 +3605,7 @@ __PYTHON_EL_native_completion_setup()" process)
3605With argument MSG show deactivation message." 3605With argument MSG show deactivation message."
3606 (interactive "p") 3606 (interactive "p")
3607 (python-shell-with-shell-buffer 3607 (python-shell-with-shell-buffer
3608 (set (make-local-variable 'python-shell-completion-native-enable) nil) 3608 (setq-local python-shell-completion-native-enable nil)
3609 (when msg 3609 (when msg
3610 (message "Shell native completion is disabled, using fallback")))) 3610 (message "Shell native completion is disabled, using fallback"))))
3611 3611
@@ -3614,7 +3614,7 @@ With argument MSG show deactivation message."
3614With argument MSG show deactivation message." 3614With argument MSG show deactivation message."
3615 (interactive "p") 3615 (interactive "p")
3616 (python-shell-with-shell-buffer 3616 (python-shell-with-shell-buffer
3617 (set (make-local-variable 'python-shell-completion-native-enable) t) 3617 (setq-local python-shell-completion-native-enable t)
3618 (python-shell-completion-native-turn-on-maybe msg))) 3618 (python-shell-completion-native-turn-on-maybe msg)))
3619 3619
3620(defun python-shell-completion-native-turn-on-maybe (&optional msg) 3620(defun python-shell-completion-native-turn-on-maybe (&optional msg)
@@ -3994,7 +3994,7 @@ Argument OUTPUT is a string with the output from the comint process."
3994 (tracked-buffer-window (get-buffer-window tracked-buffer)) 3994 (tracked-buffer-window (get-buffer-window tracked-buffer))
3995 (tracked-buffer-line-pos)) 3995 (tracked-buffer-line-pos))
3996 (with-current-buffer tracked-buffer 3996 (with-current-buffer tracked-buffer
3997 (set (make-local-variable 'overlay-arrow-position) (make-marker)) 3997 (setq-local overlay-arrow-position (make-marker))
3998 (setq tracked-buffer-line-pos (progn 3998 (setq tracked-buffer-line-pos (progn
3999 (goto-char (point-min)) 3999 (goto-char (point-min))
4000 (forward-line (1- line-number)) 4000 (forward-line (1- line-number))
@@ -5535,48 +5535,43 @@ REPORT-FN is Flymake's callback function."
5535 "Major mode for editing Python files. 5535 "Major mode for editing Python files.
5536 5536
5537\\{python-mode-map}" 5537\\{python-mode-map}"
5538 (set (make-local-variable 'tab-width) 8) 5538 (setq-local tab-width 8)
5539 (set (make-local-variable 'indent-tabs-mode) nil) 5539 (setq-local indent-tabs-mode nil)
5540 5540
5541 (set (make-local-variable 'comment-start) "# ") 5541 (setq-local comment-start "# ")
5542 (set (make-local-variable 'comment-start-skip) "#+\\s-*") 5542 (setq-local comment-start-skip "#+\\s-*")
5543 5543
5544 (set (make-local-variable 'parse-sexp-lookup-properties) t) 5544 (setq-local parse-sexp-lookup-properties t)
5545 (set (make-local-variable 'parse-sexp-ignore-comments) t) 5545 (setq-local parse-sexp-ignore-comments t)
5546 5546
5547 (set (make-local-variable 'forward-sexp-function) 5547 (setq-local forward-sexp-function #'python-nav-forward-sexp)
5548 'python-nav-forward-sexp)
5549 5548
5550 (set (make-local-variable 'font-lock-defaults) 5549 (setq-local font-lock-defaults
5551 `(,python-font-lock-keywords 5550 `(,python-font-lock-keywords
5552 nil nil nil nil 5551 nil nil nil nil
5553 (font-lock-syntactic-face-function 5552 (font-lock-syntactic-face-function
5554 . python-font-lock-syntactic-face-function))) 5553 . python-font-lock-syntactic-face-function)))
5555 5554
5556 (set (make-local-variable 'syntax-propertize-function) 5555 (setq-local syntax-propertize-function
5557 python-syntax-propertize-function) 5556 python-syntax-propertize-function)
5558 5557
5559 (set (make-local-variable 'indent-line-function) 5558 (setq-local indent-line-function #'python-indent-line-function)
5560 #'python-indent-line-function) 5559 (setq-local indent-region-function #'python-indent-region)
5561 (set (make-local-variable 'indent-region-function) #'python-indent-region)
5562 ;; Because indentation is not redundant, we cannot safely reindent code. 5560 ;; Because indentation is not redundant, we cannot safely reindent code.
5563 (set (make-local-variable 'electric-indent-inhibit) t) 5561 (setq-local electric-indent-inhibit t)
5564 (set (make-local-variable 'electric-indent-chars) 5562 (setq-local electric-indent-chars
5565 (cons ?: electric-indent-chars)) 5563 (cons ?: electric-indent-chars))
5566 5564
5567 ;; Add """ ... """ pairing to electric-pair-mode. 5565 ;; Add """ ... """ pairing to electric-pair-mode.
5568 (add-hook 'post-self-insert-hook 5566 (add-hook 'post-self-insert-hook
5569 #'python-electric-pair-string-delimiter 'append t) 5567 #'python-electric-pair-string-delimiter 'append t)
5570 5568
5571 (set (make-local-variable 'paragraph-start) "\\s-*$") 5569 (setq-local paragraph-start "\\s-*$")
5572 (set (make-local-variable 'fill-paragraph-function) 5570 (setq-local fill-paragraph-function #'python-fill-paragraph)
5573 #'python-fill-paragraph) 5571 (setq-local normal-auto-fill-function #'python-do-auto-fill)
5574 (set (make-local-variable 'normal-auto-fill-function) #'python-do-auto-fill)
5575 5572
5576 (set (make-local-variable 'beginning-of-defun-function) 5573 (setq-local beginning-of-defun-function #'python-nav-beginning-of-defun)
5577 #'python-nav-beginning-of-defun) 5574 (setq-local end-of-defun-function #'python-nav-end-of-defun)
5578 (set (make-local-variable 'end-of-defun-function)
5579 #'python-nav-end-of-defun)
5580 5575
5581 (add-hook 'completion-at-point-functions 5576 (add-hook 'completion-at-point-functions
5582 #'python-completion-at-point nil 'local) 5577 #'python-completion-at-point nil 'local)
@@ -5584,26 +5579,25 @@ REPORT-FN is Flymake's callback function."
5584 (add-hook 'post-self-insert-hook 5579 (add-hook 'post-self-insert-hook
5585 #'python-indent-post-self-insert-function 'append 'local) 5580 #'python-indent-post-self-insert-function 'append 'local)
5586 5581
5587 (set (make-local-variable 'imenu-create-index-function) 5582 (setq-local imenu-create-index-function
5588 #'python-imenu-create-index) 5583 #'python-imenu-create-index)
5589 5584
5590 (set (make-local-variable 'add-log-current-defun-function) 5585 (setq-local add-log-current-defun-function
5591 #'python-info-current-defun) 5586 #'python-info-current-defun)
5592 5587
5593 (add-hook 'which-func-functions #'python-info-current-defun nil t) 5588 (add-hook 'which-func-functions #'python-info-current-defun nil t)
5594 5589
5595 (set (make-local-variable 'skeleton-further-elements) 5590 (setq-local skeleton-further-elements
5596 '((abbrev-mode nil) 5591 '((abbrev-mode nil)
5597 (< '(backward-delete-char-untabify (min python-indent-offset 5592 (< '(backward-delete-char-untabify (min python-indent-offset
5598 (current-column)))) 5593 (current-column))))
5599 (^ '(- (1+ (current-indentation)))))) 5594 (^ '(- (1+ (current-indentation))))))
5600 5595
5601 (with-no-warnings 5596 (with-no-warnings
5602 ;; suppress warnings about eldoc-documentation-function being obsolete 5597 ;; suppress warnings about eldoc-documentation-function being obsolete
5603 (if (null eldoc-documentation-function) 5598 (if (null eldoc-documentation-function)
5604 ;; Emacs<25 5599 ;; Emacs<25
5605 (set (make-local-variable 'eldoc-documentation-function) 5600 (setq-local eldoc-documentation-function #'python-eldoc-function)
5606 #'python-eldoc-function)
5607 (if (boundp 'eldoc-documentation-functions) 5601 (if (boundp 'eldoc-documentation-functions)
5608 (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil t) 5602 (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil t)
5609 (add-function :before-until (local 'eldoc-documentation-function) 5603 (add-function :before-until (local 'eldoc-documentation-function)
@@ -5620,16 +5614,14 @@ REPORT-FN is Flymake's callback function."
5620 python-hideshow-forward-sexp-function 5614 python-hideshow-forward-sexp-function
5621 nil)) 5615 nil))
5622 5616
5623 (set (make-local-variable 'outline-regexp) 5617 (setq-local outline-regexp (python-rx (* space) block-start))
5624 (python-rx (* space) block-start)) 5618 (setq-local outline-heading-end-regexp ":[^\n]*\n")
5625 (set (make-local-variable 'outline-heading-end-regexp) ":[^\n]*\n") 5619 (setq-local outline-level
5626 (set (make-local-variable 'outline-level) 5620 (lambda ()
5627 #'(lambda () 5621 "`outline-level' function for Python mode."
5628 "`outline-level' function for Python mode." 5622 (1+ (/ (current-indentation) python-indent-offset))))
5629 (1+ (/ (current-indentation) python-indent-offset))))
5630 5623
5631 (set (make-local-variable 'prettify-symbols-alist) 5624 (setq-local prettify-symbols-alist python-prettify-symbols-alist)
5632 python-prettify-symbols-alist)
5633 5625
5634 (python-skeleton-add-menu-items) 5626 (python-skeleton-add-menu-items)
5635 5627
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 0bf9a517aa6..78f8577ef99 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -6,7 +6,6 @@
6;; Maintainer: Michael Mauger <michael@mauger.com> 6;; Maintainer: Michael Mauger <michael@mauger.com>
7;; Version: 3.6 7;; Version: 3.6
8;; Keywords: comm languages processes 8;; Keywords: comm languages processes
9;; URL: https://savannah.gnu.org/projects/emacs/
10 9
11;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
12 11
@@ -1725,7 +1724,7 @@ to add functions and PL/SQL keywords.")
1725 "ORDER BY 2 DESC, 3 DESC, 4 DESC, 5 DESC, 6 DESC, 1;") 1724 "ORDER BY 2 DESC, 3 DESC, 4 DESC, 5 DESC, 6 DESC, 1;")
1726 nil nil) 1725 nil nil)
1727 (with-current-buffer b 1726 (with-current-buffer b
1728 (set (make-local-variable 'sql-product) 'oracle) 1727 (setq-local sql-product 'oracle)
1729 (sql-product-font-lock t nil) 1728 (sql-product-font-lock t nil)
1730 (font-lock-mode +1))))) 1729 (font-lock-mode +1)))))
1731 1730
@@ -2812,7 +2811,7 @@ configured."
2812 ((syntax-alist (sql-product-font-lock-syntax-alist))) 2811 ((syntax-alist (sql-product-font-lock-syntax-alist)))
2813 2812
2814 ;; Get the product-specific keywords. 2813 ;; Get the product-specific keywords.
2815 (set (make-local-variable 'sql-mode-font-lock-keywords) 2814 (setq-local sql-mode-font-lock-keywords
2816 (append 2815 (append
2817 (unless (eq sql-product 'ansi) 2816 (unless (eq sql-product 'ansi)
2818 (sql-get-product-feature sql-product :font-lock)) 2817 (sql-get-product-feature sql-product :font-lock))
@@ -2824,7 +2823,7 @@ configured."
2824 2823
2825 ;; Setup font-lock. Force re-parsing of `font-lock-defaults'. 2824 ;; Setup font-lock. Force re-parsing of `font-lock-defaults'.
2826 (kill-local-variable 'font-lock-set-defaults) 2825 (kill-local-variable 'font-lock-set-defaults)
2827 (set (make-local-variable 'font-lock-defaults) 2826 (setq-local font-lock-defaults
2828 (list 'sql-mode-font-lock-keywords 2827 (list 'sql-mode-font-lock-keywords
2829 keywords-only t syntax-alist)) 2828 keywords-only t syntax-alist))
2830 2829
@@ -4134,8 +4133,8 @@ details or extends the listing to include other schemas objects."
4134 (sql-execute-feature sqlbuf "*List All*" :list-all enhanced nil) 4133 (sql-execute-feature sqlbuf "*List All*" :list-all enhanced nil)
4135 (with-current-buffer sqlbuf 4134 (with-current-buffer sqlbuf
4136 ;; Contains the name of database objects 4135 ;; Contains the name of database objects
4137 (set (make-local-variable 'sql-contains-names) t) 4136 (setq-local sql-contains-names t)
4138 (set (make-local-variable 'sql-buffer) sqlbuf)))) 4137 (setq-local sql-buffer sqlbuf))))
4139 4138
4140(defun sql-list-table (name &optional enhanced) 4139(defun sql-list-table (name &optional enhanced)
4141 "List the details of a database table named NAME. 4140 "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:
4190 (easy-menu-add sql-mode-menu)) 4189 (easy-menu-add sql-mode-menu))
4191 4190
4192 ;; (smie-setup sql-smie-grammar #'sql-smie-rules) 4191 ;; (smie-setup sql-smie-grammar #'sql-smie-rules)
4193 (set (make-local-variable 'comment-start) "--") 4192 (setq-local comment-start "--")
4194 ;; Make each buffer in sql-mode remember the "current" SQLi buffer. 4193 ;; Make each buffer in sql-mode remember the "current" SQLi buffer.
4195 (make-local-variable 'sql-buffer) 4194 (make-local-variable 'sql-buffer)
4196 ;; Add imenu support for sql-mode. Note that imenu-generic-expression 4195 ;; 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:
4200 imenu-case-fold-search t) 4199 imenu-case-fold-search t)
4201 ;; Make `sql-send-paragraph' work on paragraphs that contain indented 4200 ;; Make `sql-send-paragraph' work on paragraphs that contain indented
4202 ;; lines. 4201 ;; lines.
4203 (set (make-local-variable 'paragraph-separate) "[\f]*$") 4202 (setq-local paragraph-separate "[\f]*$")
4204 (set (make-local-variable 'paragraph-start) "[\n\f]") 4203 (setq-local paragraph-start "[\n\f]")
4205 ;; Abbrevs 4204 ;; Abbrevs
4206 (setq-local abbrev-all-caps 1) 4205 (setq-local abbrev-all-caps 1)
4207 ;; Contains the name of database objects 4206 ;; Contains the name of database objects
4208 (set (make-local-variable 'sql-contains-names) t) 4207 (setq-local sql-contains-names t)
4209 (setq-local syntax-propertize-function 4208 (setq-local syntax-propertize-function
4210 (syntax-propertize-rules 4209 (syntax-propertize-rules
4211 ;; Handle escaped apostrophes within strings. 4210 ;; Handle escaped apostrophes within strings.
@@ -4304,9 +4303,8 @@ you entered, right above the output it created.
4304 :after-hook (sql--adjust-interactive-setup) 4303 :after-hook (sql--adjust-interactive-setup)
4305 4304
4306 ;; Get the `sql-product' for this interactive session. 4305 ;; Get the `sql-product' for this interactive session.
4307 (set (make-local-variable 'sql-product) 4306 (setq-local sql-product (or sql-interactive-product
4308 (or sql-interactive-product 4307 sql-product))
4309 sql-product))
4310 4308
4311 ;; Setup the mode. 4309 ;; Setup the mode.
4312 (setq mode-name 4310 (setq mode-name
@@ -4323,7 +4321,7 @@ you entered, right above the output it created.
4323 (sql-product-font-lock t nil) 4321 (sql-product-font-lock t nil)
4324 4322
4325 ;; Enable commenting and uncommenting of the region. 4323 ;; Enable commenting and uncommenting of the region.
4326 (set (make-local-variable 'comment-start) "--") 4324 (setq-local comment-start "--")
4327 ;; Abbreviation table init and case-insensitive. It is not activated 4325 ;; Abbreviation table init and case-insensitive. It is not activated
4328 ;; by default. 4326 ;; by default.
4329 (setq local-abbrev-table sql-mode-abbrev-table) 4327 (setq local-abbrev-table sql-mode-abbrev-table)
@@ -4332,27 +4330,27 @@ you entered, right above the output it created.
4332 (let ((proc (get-buffer-process (current-buffer)))) 4330 (let ((proc (get-buffer-process (current-buffer))))
4333 (when proc (set-process-sentinel proc #'sql-stop))) 4331 (when proc (set-process-sentinel proc #'sql-stop)))
4334 ;; Save the connection and login params 4332 ;; Save the connection and login params
4335 (set (make-local-variable 'sql-user) sql-user) 4333 (setq-local sql-user sql-user)
4336 (set (make-local-variable 'sql-database) sql-database) 4334 (setq-local sql-database sql-database)
4337 (set (make-local-variable 'sql-server) sql-server) 4335 (setq-local sql-server sql-server)
4338 (set (make-local-variable 'sql-port) sql-port) 4336 (setq-local sql-port sql-port)
4339 (set (make-local-variable 'sql-connection) sql-connection) 4337 (setq-local sql-connection sql-connection)
4340 (setq-default sql-connection nil) 4338 (setq-default sql-connection nil)
4341 ;; Contains the name of database objects 4339 ;; Contains the name of database objects
4342 (set (make-local-variable 'sql-contains-names) t) 4340 (setq-local sql-contains-names t)
4343 ;; Keep track of existing object names 4341 ;; Keep track of existing object names
4344 (set (make-local-variable 'sql-completion-object) nil) 4342 (setq-local sql-completion-object nil)
4345 (set (make-local-variable 'sql-completion-column) nil) 4343 (setq-local sql-completion-column nil)
4346 ;; Create a useful name for renaming this buffer later. 4344 ;; Create a useful name for renaming this buffer later.
4347 (set (make-local-variable 'sql-alternate-buffer-name) 4345 (setq-local sql-alternate-buffer-name
4348 (sql-make-alternate-buffer-name)) 4346 (sql-make-alternate-buffer-name))
4349 ;; User stuff. Initialize before the hook. 4347 ;; User stuff. Initialize before the hook.
4350 (set (make-local-variable 'sql-prompt-regexp) 4348 (setq-local sql-prompt-regexp
4351 (or (sql-get-product-feature sql-product :prompt-regexp) "^")) 4349 (or (sql-get-product-feature sql-product :prompt-regexp) "^"))
4352 (set (make-local-variable 'sql-prompt-length) 4350 (setq-local sql-prompt-length
4353 (sql-get-product-feature sql-product :prompt-length)) 4351 (sql-get-product-feature sql-product :prompt-length))
4354 (set (make-local-variable 'sql-prompt-cont-regexp) 4352 (setq-local sql-prompt-cont-regexp
4355 (sql-get-product-feature sql-product :prompt-cont-regexp)) 4353 (sql-get-product-feature sql-product :prompt-cont-regexp))
4356 (make-local-variable 'sql-output-newline-count) 4354 (make-local-variable 'sql-output-newline-count)
4357 (make-local-variable 'sql-preoutput-hold) 4355 (make-local-variable 'sql-preoutput-hold)
4358 (add-hook 'comint-preoutput-filter-functions 4356 (add-hook 'comint-preoutput-filter-functions
@@ -4370,7 +4368,7 @@ you entered, right above the output it created.
4370 sql-prompt-regexp)) 4368 sql-prompt-regexp))
4371 (setq left-margin (or sql-prompt-length 0)) 4369 (setq left-margin (or sql-prompt-length 0))
4372 ;; Install input sender 4370 ;; Install input sender
4373 (set (make-local-variable 'comint-input-sender) #'sql-input-sender) 4371 (setq-local comint-input-sender #'sql-input-sender)
4374 ;; People wanting a different history file for each 4372 ;; People wanting a different history file for each
4375 ;; buffer/process/client/whatever can change separator and file-name 4373 ;; buffer/process/client/whatever can change separator and file-name
4376 ;; on the sql-interactive-mode-hook. 4374 ;; on the sql-interactive-mode-hook.
@@ -4651,8 +4649,7 @@ the call to \\[sql-product-interactive] with
4651 4649
4652 ;; Set the new buffer name 4650 ;; Set the new buffer name
4653 (setq new-sqli-buffer (current-buffer)) 4651 (setq new-sqli-buffer (current-buffer))
4654 (set (make-local-variable 'sql-buffer) 4652 (setq-local sql-buffer (buffer-name new-sqli-buffer))
4655 (buffer-name new-sqli-buffer))
4656 4653
4657 ;; Set `sql-buffer' in the start buffer 4654 ;; Set `sql-buffer' in the start buffer
4658 (with-current-buffer start-buffer 4655 (with-current-buffer start-buffer
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index ff3fb9657d6..dbf6684b0e9 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -616,41 +616,39 @@ Turning on Tcl mode runs `tcl-mode-hook'. Read the documentation for
616`tcl-mode-hook' to see what kinds of interesting hook functions 616`tcl-mode-hook' to see what kinds of interesting hook functions
617already exist." 617already exist."
618 (unless (and (boundp 'filladapt-mode) filladapt-mode) 618 (unless (and (boundp 'filladapt-mode) filladapt-mode)
619 (set (make-local-variable 'paragraph-ignore-fill-prefix) t)) 619 (setq-local paragraph-ignore-fill-prefix t))
620 620
621 (set (make-local-variable 'indent-line-function) #'tcl-indent-line) 621 (setq-local indent-line-function #'tcl-indent-line)
622 (set (make-local-variable 'comment-indent-function) #'tcl-comment-indent) 622 (setq-local comment-indent-function #'tcl-comment-indent)
623 ;; Tcl doesn't require a final newline. 623 ;; Tcl doesn't require a final newline.
624 ;; (make-local-variable 'require-final-newline) 624 ;; (setq-local require-final-newline t)
625 ;; (setq require-final-newline t)
626 625
627 (set (make-local-variable 'comment-start) "# ") 626 (setq-local comment-start "# ")
628 (set (make-local-variable 'comment-start-skip) 627 (setq-local comment-start-skip
629 "\\(\\(^\\|[;{[]\\)\\s-*\\)#+ *") 628 "\\(\\(^\\|[;{[]\\)\\s-*\\)#+ *")
630 (set (make-local-variable 'comment-end) "") 629 (setq-local comment-end "")
631 630
632 (set (make-local-variable 'outline-regexp) ".") 631 (setq-local outline-regexp ".")
633 (set (make-local-variable 'outline-level) 'tcl-outline-level) 632 (setq-local outline-level 'tcl-outline-level)
634 633
635 (set (make-local-variable 'font-lock-defaults) 634 (setq-local font-lock-defaults
636 '(tcl-font-lock-keywords nil nil nil beginning-of-defun)) 635 '(tcl-font-lock-keywords nil nil nil beginning-of-defun))
637 (set (make-local-variable 'syntax-propertize-function) 636 (setq-local syntax-propertize-function
638 tcl-syntax-propertize-function) 637 tcl-syntax-propertize-function)
639 (add-hook 'syntax-propertize-extend-region-functions 638 (add-hook 'syntax-propertize-extend-region-functions
640 #'syntax-propertize-multiline 'append 'local) 639 #'syntax-propertize-multiline 'append 'local)
641 640
642 (set (make-local-variable 'imenu-generic-expression) 641 (setq-local imenu-generic-expression tcl-imenu-generic-expression)
643 tcl-imenu-generic-expression)
644 642
645 ;; Settings for new dabbrev code. 643 ;; Settings for new dabbrev code.
646 (set (make-local-variable 'dabbrev-case-fold-search) nil) 644 (setq-local dabbrev-case-fold-search nil)
647 (set (make-local-variable 'dabbrev-case-replace) nil) 645 (setq-local dabbrev-case-replace nil)
648 (set (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) "[$!]") 646 (setq-local dabbrev-abbrev-skip-leading-regexp "[$!]")
649 (set (make-local-variable 'dabbrev-abbrev-char-regexp) "\\sw\\|\\s_") 647 (setq-local dabbrev-abbrev-char-regexp "\\sw\\|\\s_")
650 648
651 (set (make-local-variable 'parse-sexp-ignore-comments) t) 649 (setq-local parse-sexp-ignore-comments t)
652 (set (make-local-variable 'defun-prompt-regexp) tcl-omit-ws-regexp) 650 (setq-local defun-prompt-regexp tcl-omit-ws-regexp)
653 (set (make-local-variable 'add-log-current-defun-function) 651 (setq-local add-log-current-defun-function
654 #'tcl-add-log-defun) 652 #'tcl-add-log-defun)
655 653
656 (setq-local beginning-of-defun-function #'tcl-beginning-of-defun-function) 654 (setq-local beginning-of-defun-function #'tcl-beginning-of-defun-function)
@@ -1201,14 +1199,14 @@ Variables controlling Inferior Tcl mode:
1201 1199
1202The following commands are available: 1200The following commands are available:
1203\\{inferior-tcl-mode-map}" 1201\\{inferior-tcl-mode-map}"
1204 (set (make-local-variable 'comint-prompt-regexp) 1202 (setq-local comint-prompt-regexp
1205 (or tcl-prompt-regexp 1203 (or tcl-prompt-regexp
1206 (concat "^" (regexp-quote tcl-application) ">"))) 1204 (concat "^" (regexp-quote tcl-application) ">")))
1207 (setq mode-line-process '(": %s")) 1205 (setq mode-line-process '(": %s"))
1208 (setq local-abbrev-table tcl-mode-abbrev-table) 1206 (setq local-abbrev-table tcl-mode-abbrev-table)
1209 (set-syntax-table tcl-mode-syntax-table) 1207 (set-syntax-table tcl-mode-syntax-table)
1210 (set (make-local-variable 'defun-prompt-regexp) tcl-omit-ws-regexp) 1208 (setq-local defun-prompt-regexp tcl-omit-ws-regexp)
1211 (set (make-local-variable 'inferior-tcl-delete-prompt-marker) (make-marker)) 1209 (setq-local inferior-tcl-delete-prompt-marker (make-marker))
1212 (set-process-filter (get-buffer-process (current-buffer)) 'tcl-filter)) 1210 (set-process-filter (get-buffer-process (current-buffer)) 'tcl-filter))
1213 1211
1214;;;###autoload 1212;;;###autoload
@@ -1229,7 +1227,7 @@ See documentation for function `inferior-tcl-mode' for more information."
1229 (unless (process-tty-name (inferior-tcl-proc)) 1227 (unless (process-tty-name (inferior-tcl-proc))
1230 (tcl-send-string (inferior-tcl-proc) 1228 (tcl-send-string (inferior-tcl-proc)
1231 "set ::tcl_interactive 1; concat\n"))) 1229 "set ::tcl_interactive 1; concat\n")))
1232 (set (make-local-variable 'tcl-application) cmd) 1230 (setq-local tcl-application cmd)
1233 (setq inferior-tcl-buffer "*inferior-tcl*") 1231 (setq inferior-tcl-buffer "*inferior-tcl*")
1234 (pop-to-buffer "*inferior-tcl*")) 1232 (pop-to-buffer "*inferior-tcl*"))
1235 1233
@@ -1493,7 +1491,7 @@ Prefix argument means switch to the Tcl buffer afterwards."
1493 (interactive "P") 1491 (interactive "P")
1494 (auto-fill-mode arg) 1492 (auto-fill-mode arg)
1495 (if auto-fill-function 1493 (if auto-fill-function
1496 (set (make-local-variable 'comment-auto-fill-only-comments) t) 1494 (setq-local comment-auto-fill-only-comments t)
1497 (kill-local-variable 'comment-auto-fill-only-comments))) 1495 (kill-local-variable 'comment-auto-fill-only-comments)))
1498 1496
1499(defun tcl-electric-hash (&optional count) 1497(defun tcl-electric-hash (&optional count)
@@ -1574,7 +1572,7 @@ The first line is assumed to look like \"#!.../program ...\"."
1574 (save-excursion 1572 (save-excursion
1575 (goto-char (point-min)) 1573 (goto-char (point-min))
1576 (if (looking-at "#![^ \t]*/\\([^ \t\n/]+\\)\\([ \t]\\|$\\)") 1574 (if (looking-at "#![^ \t]*/\\([^ \t\n/]+\\)\\([ \t]\\|$\\)")
1577 (set (make-local-variable 'tcl-application) (match-string 1))))) 1575 (setq-local tcl-application (match-string 1)))))
1578 1576
1579(defun tcl-popup-menu (_e) 1577(defun tcl-popup-menu (_e)
1580 "XEmacs menu support." 1578 "XEmacs menu support."
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 9f5fc57142b..6e99e9d8ace 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1,7 +1,7 @@
1;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*- 1;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*-
2 2
3;; Copyright (C) 2014-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
4;; Version: 1.0.3 4;; Version: 1.0.4
5;; Package-Requires: ((emacs "26.3")) 5;; Package-Requires: ((emacs "26.3"))
6 6
7;; This is a GNU ELPA :core package. Avoid functionality that is not 7;; This is a GNU ELPA :core package. Avoid functionality that is not
@@ -593,6 +593,25 @@ SELECT is `quit', also quit the *xref* window."
593 (xref--search-property 'xref-item t) 593 (xref--search-property 'xref-item t)
594 (xref-show-location-at-point)) 594 (xref-show-location-at-point))
595 595
596(defun xref-next-group ()
597 "Move to the first item of the next xref group and display its source."
598 (interactive)
599 (xref--search-property 'xref-group)
600 (xref--search-property 'xref-item)
601 (xref-show-location-at-point))
602
603(defun xref-prev-group ()
604 "Move to the first item of the previous xref group and display its source."
605 (interactive)
606 ;; Search for the xref group of the current item, provided that the
607 ;; point is not already in an xref group.
608 (unless (plist-member (text-properties-at (point)) 'xref-group)
609 (xref--search-property 'xref-group t))
610 ;; Search for the previous xref group.
611 (xref--search-property 'xref-group t)
612 (xref--search-property 'xref-item)
613 (xref-show-location-at-point))
614
596(defun xref--item-at-point () 615(defun xref--item-at-point ()
597 (save-excursion 616 (save-excursion
598 (back-to-indentation) 617 (back-to-indentation)
@@ -738,6 +757,8 @@ references displayed in the current *xref* buffer."
738 (let ((map (make-sparse-keymap))) 757 (let ((map (make-sparse-keymap)))
739 (define-key map (kbd "n") #'xref-next-line) 758 (define-key map (kbd "n") #'xref-next-line)
740 (define-key map (kbd "p") #'xref-prev-line) 759 (define-key map (kbd "p") #'xref-prev-line)
760 (define-key map (kbd "N") #'xref-next-group)
761 (define-key map (kbd "P") #'xref-prev-group)
741 (define-key map (kbd "r") #'xref-query-replace-in-results) 762 (define-key map (kbd "r") #'xref-query-replace-in-results)
742 (define-key map (kbd "RET") #'xref-goto-xref) 763 (define-key map (kbd "RET") #'xref-goto-xref)
743 (define-key map (kbd "TAB") #'xref-quit-and-goto-xref) 764 (define-key map (kbd "TAB") #'xref-quit-and-goto-xref)
@@ -1334,7 +1355,9 @@ The template should have the following fields:
1334 <R> for the regexp itself (in Extended format)" 1355 <R> for the regexp itself (in Extended format)"
1335 :type '(repeat 1356 :type '(repeat
1336 (cons (symbol :tag "Program identifier") 1357 (cons (symbol :tag "Program identifier")
1337 (string :tag "Command template")))) 1358 (string :tag "Command template")))
1359 :version "28.1"
1360 :package-version '(xref . "1.0.4"))
1338 1361
1339(defcustom xref-search-program 'grep 1362(defcustom xref-search-program 'grep
1340 "The program to use for regexp search inside files. 1363 "The program to use for regexp search inside files.
@@ -1343,7 +1366,9 @@ This must reference a corresponding entry in `xref-search-program-alist'."
1343 :type `(choice 1366 :type `(choice
1344 (const :tag "Use Grep" grep) 1367 (const :tag "Use Grep" grep)
1345 (const :tag "Use ripgrep" ripgrep) 1368 (const :tag "Use ripgrep" ripgrep)
1346 (symbol :tag "User defined"))) 1369 (symbol :tag "User defined"))
1370 :version "28.1"
1371 :package-version '(xref . "1.0.4"))
1347 1372
1348;;;###autoload 1373;;;###autoload
1349(defun xref-matches-in-files (regexp files) 1374(defun xref-matches-in-files (regexp files)
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el
index c6997862f7f..cdbafbaf897 100644
--- a/lisp/progmodes/xscheme.el
+++ b/lisp/progmodes/xscheme.el
@@ -173,7 +173,7 @@ With argument, asks for a command line."
173 (setq-default xscheme-process-command-line command-line) 173 (setq-default xscheme-process-command-line command-line)
174 (switch-to-buffer 174 (switch-to-buffer
175 (xscheme-start-process command-line process-name buffer-name)) 175 (xscheme-start-process command-line process-name buffer-name))
176 (set (make-local-variable 'xscheme-process-command-line) command-line)) 176 (setq-local xscheme-process-command-line command-line))
177 177
178(defun xscheme-read-command-line (arg) 178(defun xscheme-read-command-line (arg)
179 (let ((default 179 (let ((default
@@ -264,11 +264,11 @@ With argument, asks for a command line."
264 xscheme-buffer-name 264 xscheme-buffer-name
265 t))) 265 t)))
266 (let ((process-name (verify-xscheme-buffer buffer-name t))) 266 (let ((process-name (verify-xscheme-buffer buffer-name t)))
267 (set (make-local-variable 'xscheme-buffer-name) buffer-name) 267 (setq-local xscheme-buffer-name buffer-name)
268 (set (make-local-variable 'xscheme-process-name) process-name) 268 (setq-local xscheme-process-name process-name)
269 (set (make-local-variable 'xscheme-runlight) 269 (setq-local xscheme-runlight
270 (with-current-buffer buffer-name 270 (with-current-buffer buffer-name
271 xscheme-runlight)))) 271 xscheme-runlight))))
272 272
273(defun local-clear-scheme-interaction-buffer () 273(defun local-clear-scheme-interaction-buffer ()
274 "Make the current buffer use the default scheme interaction buffer." 274 "Make the current buffer use the default scheme interaction buffer."
@@ -375,10 +375,10 @@ Entry to this mode runs `scheme-mode-hook' and then
375 (kill-all-local-variables) 375 (kill-all-local-variables)
376 (make-local-variable 'xscheme-runlight-string) 376 (make-local-variable 'xscheme-runlight-string)
377 (make-local-variable 'xscheme-runlight) 377 (make-local-variable 'xscheme-runlight)
378 (set (make-local-variable 'xscheme-previous-mode) previous-mode) 378 (setq-local xscheme-previous-mode previous-mode)
379 (let ((buffer (current-buffer))) 379 (let ((buffer (current-buffer)))
380 (set (make-local-variable 'xscheme-buffer-name) (buffer-name buffer)) 380 (setq-local xscheme-buffer-name (buffer-name buffer))
381 (set (make-local-variable 'xscheme-last-input-end) (make-marker)) 381 (setq-local xscheme-last-input-end (make-marker))
382 (let ((process (get-buffer-process buffer))) 382 (let ((process (get-buffer-process buffer)))
383 (when process 383 (when process
384 (setq-local xscheme-process-name (process-name process)) 384 (setq-local xscheme-process-name (process-name process))
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 61c39de12b2..746363728b0 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1127,7 +1127,7 @@ IGNORE arguments."
1127 (unless recentf-list 1127 (unless recentf-list
1128 (error "The list of recent files is empty")) 1128 (error "The list of recent files is empty"))
1129 (recentf-dialog (format "*%s - Edit list*" recentf-menu-title) 1129 (recentf-dialog (format "*%s - Edit list*" recentf-menu-title)
1130 (set (make-local-variable 'recentf-edit-list) nil) 1130 (setq-local recentf-edit-list nil)
1131 (widget-insert 1131 (widget-insert
1132 (format-message 1132 (format-message
1133 "Click on OK to delete selected files from the recent list. 1133 "Click on OK to delete selected files from the recent list.
@@ -1196,8 +1196,8 @@ IGNORE other arguments."
1196 1196
1197(defun recentf-open-files-items (files) 1197(defun recentf-open-files-items (files)
1198 "Return a list of widgets to display FILES in a dialog buffer." 1198 "Return a list of widgets to display FILES in a dialog buffer."
1199 (set (make-local-variable 'recentf--files-with-key) 1199 (setq-local recentf--files-with-key
1200 (recentf-trunc-list files 10)) 1200 (recentf-trunc-list files 10))
1201 (mapcar 'recentf-open-files-item 1201 (mapcar 'recentf-open-files-item
1202 (append 1202 (append
1203 ;; When requested group the files with shortcuts together 1203 ;; When requested group the files with shortcuts together
diff --git a/lisp/replace.el b/lisp/replace.el
index 3a2ab1d24c8..5ebc5493012 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1706,7 +1706,7 @@ See also `multi-occur'."
1706 (buffer-undo-list t) 1706 (buffer-undo-list t)
1707 (occur--final-pos nil)) 1707 (occur--final-pos nil))
1708 (erase-buffer) 1708 (erase-buffer)
1709 (set (make-local-variable 'occur-highlight-regexp) regexp) 1709 (setq-local occur-highlight-regexp regexp)
1710 (let ((count 1710 (let ((count
1711 (if (stringp nlines) 1711 (if (stringp nlines)
1712 ;; Treat nlines as a regexp to collect. 1712 ;; Treat nlines as a regexp to collect.
diff --git a/lisp/reveal.el b/lisp/reveal.el
index f9e38646349..b4558e1bebb 100644
--- a/lisp/reveal.el
+++ b/lisp/reveal.el
@@ -233,7 +233,7 @@ Also see the `reveal-auto-hide' variable."
233 :keymap reveal-mode-map 233 :keymap reveal-mode-map
234 (if reveal-mode 234 (if reveal-mode
235 (progn 235 (progn
236 (set (make-local-variable 'search-invisible) t) 236 (setq-local search-invisible t)
237 (add-hook 'post-command-hook 'reveal-post-command nil t)) 237 (add-hook 'post-command-hook 'reveal-post-command nil t))
238 (kill-local-variable 'search-invisible) 238 (kill-local-variable 'search-invisible)
239 (remove-hook 'post-command-hook 'reveal-post-command t))) 239 (remove-hook 'post-command-hook 'reveal-post-command t)))
diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el
index 82e6178da14..d97abca9ee7 100644
--- a/lisp/ruler-mode.el
+++ b/lisp/ruler-mode.el
@@ -584,8 +584,8 @@ format first."
584 (when (and (not ruler-mode) 584 (when (and (not ruler-mode)
585 (local-variable-p 'header-line-format) 585 (local-variable-p 'header-line-format)
586 (not (local-variable-p 'ruler-mode-header-line-format-old))) 586 (not (local-variable-p 'ruler-mode-header-line-format-old)))
587 (set (make-local-variable 'ruler-mode-header-line-format-old) 587 (setq-local ruler-mode-header-line-format-old
588 header-line-format)) 588 header-line-format))
589 (setq header-line-format ruler-mode-header-line-format)) 589 (setq header-line-format ruler-mode-header-line-format))
590 590
591;;;###autoload 591;;;###autoload
diff --git a/lisp/scroll-lock.el b/lisp/scroll-lock.el
index f20ea1bcc87..31808be4372 100644
--- a/lisp/scroll-lock.el
+++ b/lisp/scroll-lock.el
@@ -64,7 +64,7 @@ MS-Windows systems if `w32-scroll-lock-modifier' is non-nil."
64 (progn 64 (progn
65 (setq scroll-lock-preserve-screen-pos-save 65 (setq scroll-lock-preserve-screen-pos-save
66 scroll-preserve-screen-position) 66 scroll-preserve-screen-position)
67 (set (make-local-variable 'scroll-preserve-screen-position) 'always)) 67 (setq-local scroll-preserve-screen-position 'always))
68 (setq scroll-preserve-screen-position 68 (setq scroll-preserve-screen-position
69 scroll-lock-preserve-screen-pos-save))) 69 scroll-lock-preserve-screen-pos-save)))
70 70
diff --git a/lisp/server.el b/lisp/server.el
index 2fd94552dda..cd55d66a975 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -268,6 +268,12 @@ the \"-f\" switch otherwise."
268 :type 'string 268 :type 'string
269 :version "23.1") 269 :version "23.1")
270 270
271(defcustom server-client-instructions t
272 "If non-nil, display instructions on how to exit the client on connection.
273If nil, no instructions are displayed."
274 :version "28.1"
275 :type 'boolean)
276
271;; We do not use `temporary-file-directory' here, because emacsclient 277;; We do not use `temporary-file-directory' here, because emacsclient
272;; does not read the init file. 278;; does not read the init file.
273(defvar server-socket-dir 279(defvar server-socket-dir
@@ -1328,6 +1334,8 @@ The following commands are accepted by the client:
1328 ;; inhibit-quit flag, which is good since `commands' (as well as 1334 ;; inhibit-quit flag, which is good since `commands' (as well as
1329 ;; find-file-noselect via the major-mode) can run arbitrary code, 1335 ;; find-file-noselect via the major-mode) can run arbitrary code,
1330 ;; including code that needs to wait. 1336 ;; including code that needs to wait.
1337 (when (and frame server-raise-frame)
1338 (select-frame-set-input-focus frame))
1331 (with-local-quit 1339 (with-local-quit
1332 (condition-case err 1340 (condition-case err
1333 (let ((buffers (server-visit-files files proc nowait))) 1341 (let ((buffers (server-visit-files files proc nowait)))
@@ -1360,8 +1368,10 @@ The following commands are accepted by the client:
1360 nil) 1368 nil)
1361 ((and frame (null buffers)) 1369 ((and frame (null buffers))
1362 (run-hooks 'server-after-make-frame-hook) 1370 (run-hooks 'server-after-make-frame-hook)
1363 (message "%s" (substitute-command-keys 1371 (when server-client-instructions
1364 "When done with this frame, type \\[delete-frame]"))) 1372 (message "%s"
1373 (substitute-command-keys
1374 "When done with this frame, type \\[delete-frame]"))))
1365 ((not (null buffers)) 1375 ((not (null buffers))
1366 (run-hooks 'server-after-make-frame-hook) 1376 (run-hooks 'server-after-make-frame-hook)
1367 (server-switch-buffer 1377 (server-switch-buffer
@@ -1372,9 +1382,11 @@ The following commands are accepted by the client:
1372 ;; where it may be displayed. 1382 ;; where it may be displayed.
1373 (plist-get (process-plist proc) 'frame)) 1383 (plist-get (process-plist proc) 'frame))
1374 (run-hooks 'server-switch-hook) 1384 (run-hooks 'server-switch-hook)
1375 (unless nowait 1385 (when (and (not nowait)
1376 (message "%s" (substitute-command-keys 1386 server-client-instructions)
1377 "When done with a buffer, type \\[server-edit]"))))) 1387 (message "%s"
1388 (substitute-command-keys
1389 "When done with a buffer, type \\[server-edit]")))))
1378 (when (and frame (null tty-name)) 1390 (when (and frame (null tty-name))
1379 (server-unselect-display frame))) 1391 (server-unselect-display frame)))
1380 ((quit error) 1392 ((quit error)
@@ -1676,9 +1688,7 @@ be a cons cell (LINENUMBER . COLUMNNUMBER)."
1676 (switch-to-buffer next-buffer)) 1688 (switch-to-buffer next-buffer))
1677 ;; After all the above, we might still have ended up with 1689 ;; After all the above, we might still have ended up with
1678 ;; a minibuffer/dedicated-window (if there's no other). 1690 ;; a minibuffer/dedicated-window (if there's no other).
1679 (error (pop-to-buffer next-buffer))))))) 1691 (error (pop-to-buffer next-buffer)))))))))
1680 (when server-raise-frame
1681 (select-frame-set-input-focus (window-frame)))))
1682 1692
1683;;;###autoload 1693;;;###autoload
1684(defun server-save-buffers-kill-terminal (arg) 1694(defun server-save-buffers-kill-terminal (arg)
diff --git a/lisp/shell.el b/lisp/shell.el
index 5fed6513b96..5cc9a189c72 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -471,32 +471,32 @@ Shell buffers. It implements `shell-completion-execonly' for
471 471
472(defun shell-completion-vars () 472(defun shell-completion-vars ()
473 "Setup completion vars for `shell-mode' and `read-shell-command'." 473 "Setup completion vars for `shell-mode' and `read-shell-command'."
474 (set (make-local-variable 'comint-completion-fignore) 474 (setq-local comint-completion-fignore
475 shell-completion-fignore) 475 shell-completion-fignore)
476 (set (make-local-variable 'comint-delimiter-argument-list) 476 (setq-local comint-delimiter-argument-list
477 shell-delimiter-argument-list) 477 shell-delimiter-argument-list)
478 (set (make-local-variable 'comint-file-name-chars) shell-file-name-chars) 478 (setq-local comint-file-name-chars shell-file-name-chars)
479 (set (make-local-variable 'comint-file-name-quote-list) 479 (setq-local comint-file-name-quote-list
480 shell-file-name-quote-list) 480 shell-file-name-quote-list)
481 (set (make-local-variable 'comint-file-name-prefix) 481 (setq-local comint-file-name-prefix
482 (or (file-remote-p default-directory) "")) 482 (or (file-remote-p default-directory) ""))
483 (set (make-local-variable 'comint-dynamic-complete-functions) 483 (setq-local comint-dynamic-complete-functions
484 shell-dynamic-complete-functions) 484 shell-dynamic-complete-functions)
485 (setq-local comint-unquote-function #'shell--unquote-argument) 485 (setq-local comint-unquote-function #'shell--unquote-argument)
486 (setq-local comint-requote-function #'shell--requote-argument) 486 (setq-local comint-requote-function #'shell--requote-argument)
487 (set (make-local-variable 'pcomplete-parse-arguments-function) 487 (setq-local pcomplete-parse-arguments-function
488 #'shell--parse-pcomplete-arguments) 488 #'shell--parse-pcomplete-arguments)
489 (set (make-local-variable 'pcomplete-termination-string) 489 (setq-local pcomplete-termination-string
490 (cond ((not comint-completion-addsuffix) "") 490 (cond ((not comint-completion-addsuffix) "")
491 ((stringp comint-completion-addsuffix) 491 ((stringp comint-completion-addsuffix)
492 comint-completion-addsuffix) 492 comint-completion-addsuffix)
493 ((not (consp comint-completion-addsuffix)) " ") 493 ((not (consp comint-completion-addsuffix)) " ")
494 (t (cdr comint-completion-addsuffix)))) 494 (t (cdr comint-completion-addsuffix))))
495 (set (make-local-variable 'pcomplete-command-completion-function) 495 (setq-local pcomplete-command-completion-function
496 #'shell-command-completion-function) 496 #'shell-command-completion-function)
497 ;; Don't use pcomplete's defaulting mechanism, rely on 497 ;; Don't use pcomplete's defaulting mechanism, rely on
498 ;; shell-dynamic-complete-functions instead. 498 ;; shell-dynamic-complete-functions instead.
499 (set (make-local-variable 'pcomplete-default-completion-function) #'ignore) 499 (setq-local pcomplete-default-completion-function #'ignore)
500 (setq-local comint-input-autoexpand shell-input-autoexpand) 500 (setq-local comint-input-autoexpand shell-input-autoexpand)
501 ;; Not needed in shell-mode because it's inherited from comint-mode, but 501 ;; Not needed in shell-mode because it's inherited from comint-mode, but
502 ;; placed here for read-shell-command. 502 ;; placed here for read-shell-command.
@@ -596,7 +596,7 @@ buffer."
596 (and (stringp hsize) 596 (and (stringp hsize)
597 (integerp (setq hsize (string-to-number hsize))) 597 (integerp (setq hsize (string-to-number hsize)))
598 (> hsize 0) 598 (> hsize 0)
599 (set (make-local-variable 'comint-input-ring-size) hsize)) 599 (setq-local comint-input-ring-size hsize))
600 (setq comint-input-ring-file-name 600 (setq comint-input-ring-file-name
601 (concat 601 (concat
602 remote 602 remote
diff --git a/lisp/simple.el b/lisp/simple.el
index 3c4f7562308..6059c23a14e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1922,7 +1922,7 @@ to get different commands to edit and resubmit."
1922 (setq execute-extended-command--last-typed 1922 (setq execute-extended-command--last-typed
1923 (minibuffer-contents))) 1923 (minibuffer-contents)))
1924 nil 'local) 1924 nil 'local)
1925 (set (make-local-variable 'minibuffer-default-add-function) 1925 (setq-local minibuffer-default-add-function
1926 (lambda () 1926 (lambda ()
1927 ;; Get a command name at point in the original buffer 1927 ;; Get a command name at point in the original buffer
1928 ;; to propose it after M-n. 1928 ;; to propose it after M-n.
@@ -2372,10 +2372,10 @@ negative number -N means the Nth entry of \"future history.\""
2372 (unless (memq last-command '(next-history-element 2372 (unless (memq last-command '(next-history-element
2373 previous-history-element)) 2373 previous-history-element))
2374 (let ((prompt-end (minibuffer-prompt-end))) 2374 (let ((prompt-end (minibuffer-prompt-end)))
2375 (set (make-local-variable 'minibuffer-temporary-goal-position) 2375 (setq-local minibuffer-temporary-goal-position
2376 (cond ((<= (point) prompt-end) prompt-end) 2376 (cond ((<= (point) prompt-end) prompt-end)
2377 ((eobp) nil) 2377 ((eobp) nil)
2378 (t (point)))))) 2378 (t (point))))))
2379 (goto-char (point-max)) 2379 (goto-char (point-max))
2380 (delete-minibuffer-contents) 2380 (delete-minibuffer-contents)
2381 (setq minibuffer-history-position nabs) 2381 (setq minibuffer-history-position nabs)
@@ -2548,14 +2548,14 @@ Return 0 if current buffer is not a minibuffer."
2548(defun minibuffer-history-isearch-setup () 2548(defun minibuffer-history-isearch-setup ()
2549 "Set up a minibuffer for using isearch to search the minibuffer history. 2549 "Set up a minibuffer for using isearch to search the minibuffer history.
2550Intended to be added to `minibuffer-setup-hook'." 2550Intended to be added to `minibuffer-setup-hook'."
2551 (set (make-local-variable 'isearch-search-fun-function) 2551 (setq-local isearch-search-fun-function
2552 'minibuffer-history-isearch-search) 2552 #'minibuffer-history-isearch-search)
2553 (set (make-local-variable 'isearch-message-function) 2553 (setq-local isearch-message-function
2554 'minibuffer-history-isearch-message) 2554 #'minibuffer-history-isearch-message)
2555 (set (make-local-variable 'isearch-wrap-function) 2555 (setq-local isearch-wrap-function
2556 'minibuffer-history-isearch-wrap) 2556 #'minibuffer-history-isearch-wrap)
2557 (set (make-local-variable 'isearch-push-state-function) 2557 (setq-local isearch-push-state-function
2558 'minibuffer-history-isearch-push-state) 2558 #'minibuffer-history-isearch-push-state)
2559 (add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t)) 2559 (add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t))
2560 2560
2561(defun minibuffer-history-isearch-end () 2561(defun minibuffer-history-isearch-end ()
@@ -3585,8 +3585,8 @@ to `shell-command-history'."
3585 (minibuffer-with-setup-hook 3585 (minibuffer-with-setup-hook
3586 (lambda () 3586 (lambda ()
3587 (shell-completion-vars) 3587 (shell-completion-vars)
3588 (set (make-local-variable 'minibuffer-default-add-function) 3588 (setq-local minibuffer-default-add-function
3589 'minibuffer-default-add-shell-commands)) 3589 #'minibuffer-default-add-shell-commands))
3590 (apply #'read-from-minibuffer prompt initial-contents 3590 (apply #'read-from-minibuffer prompt initial-contents
3591 minibuffer-local-shell-command-map 3591 minibuffer-local-shell-command-map
3592 nil 3592 nil
@@ -7202,6 +7202,12 @@ rests."
7202 "Move point to visible beginning of current logical line. 7202 "Move point to visible beginning of current logical line.
7203This disregards any invisible newline characters. 7203This disregards any invisible newline characters.
7204 7204
7205When moving from position that has no `field' property, this
7206command doesn't enter text which has non-nil `field' property.
7207In particular, when invoked in the minibuffer, the command will
7208stop short of entering the text of the minibuffer prompt.
7209See `inhibit-field-text-motion' for how to inhibit this.
7210
7205With argument ARG not nil or 1, move forward ARG - 1 lines first. 7211With argument ARG not nil or 1, move forward ARG - 1 lines first.
7206If point reaches the beginning or end of buffer, it stops there. 7212If point reaches the beginning or end of buffer, it stops there.
7207\(But if the buffer doesn't end in a newline, it stops at the 7213\(But if the buffer doesn't end in a newline, it stops at the
@@ -7431,8 +7437,8 @@ Mode' for details."
7431 (if (local-variable-p var) 7437 (if (local-variable-p var)
7432 (push (cons var (symbol-value var)) 7438 (push (cons var (symbol-value var))
7433 visual-line--saved-state)))) 7439 visual-line--saved-state))))
7434 (set (make-local-variable 'line-move-visual) t) 7440 (setq-local line-move-visual t)
7435 (set (make-local-variable 'truncate-partial-width-windows) nil) 7441 (setq-local truncate-partial-width-windows nil)
7436 (setq truncate-lines nil 7442 (setq truncate-lines nil
7437 word-wrap t 7443 word-wrap t
7438 fringe-indicator-alist 7444 fringe-indicator-alist
@@ -8825,10 +8831,9 @@ Called from `temp-buffer-show-hook'."
8825 (let ((base-position completion-base-position) 8831 (let ((base-position completion-base-position)
8826 (insert-fun completion-list-insert-choice-function)) 8832 (insert-fun completion-list-insert-choice-function))
8827 (completion-list-mode) 8833 (completion-list-mode)
8828 (set (make-local-variable 'completion-base-position) base-position) 8834 (setq-local completion-base-position base-position)
8829 (set (make-local-variable 'completion-list-insert-choice-function) 8835 (setq-local completion-list-insert-choice-function insert-fun))
8830 insert-fun)) 8836 (setq-local completion-reference-buffer mainbuf)
8831 (set (make-local-variable 'completion-reference-buffer) mainbuf)
8832 (if base-dir (setq default-directory base-dir)) 8837 (if base-dir (setq default-directory base-dir))
8833 (when completion-tab-width 8838 (when completion-tab-width
8834 (setq tab-width completion-tab-width)) 8839 (setq tab-width completion-tab-width))
@@ -9288,8 +9293,7 @@ to a non-nil value."
9288 (cond 9293 (cond
9289 ((and (not buffer-read-only) view-mode) 9294 ((and (not buffer-read-only) view-mode)
9290 (View-exit-and-edit) 9295 (View-exit-and-edit)
9291 (make-local-variable 'view-read-only) 9296 (setq-local view-read-only t)) ; Must leave view mode.
9292 (setq view-read-only t)) ; Must leave view mode.
9293 ((and buffer-read-only view-read-only 9297 ((and buffer-read-only view-read-only
9294 ;; If view-mode is already active, `view-mode-enter' is a nop. 9298 ;; If view-mode is already active, `view-mode-enter' is a nop.
9295 (not view-mode) 9299 (not view-mode)
@@ -9307,8 +9311,8 @@ and setting it to nil."
9307 (setq buffer-invisibility-spec vis-mode-saved-buffer-invisibility-spec) 9311 (setq buffer-invisibility-spec vis-mode-saved-buffer-invisibility-spec)
9308 (kill-local-variable 'vis-mode-saved-buffer-invisibility-spec)) 9312 (kill-local-variable 'vis-mode-saved-buffer-invisibility-spec))
9309 (when visible-mode 9313 (when visible-mode
9310 (set (make-local-variable 'vis-mode-saved-buffer-invisibility-spec) 9314 (setq-local vis-mode-saved-buffer-invisibility-spec
9311 buffer-invisibility-spec) 9315 buffer-invisibility-spec)
9312 (setq buffer-invisibility-spec nil))) 9316 (setq buffer-invisibility-spec nil)))
9313 9317
9314(defvar messages-buffer-mode-map 9318(defvar messages-buffer-mode-map
diff --git a/lisp/skeleton.el b/lisp/skeleton.el
index 6e2c10d9711..5578a937d76 100644
--- a/lisp/skeleton.el
+++ b/lisp/skeleton.el
@@ -312,10 +312,15 @@ automatically, and you are prompted to fill in the variable parts.")))
312 (save-excursion (insert "\n"))) 312 (save-excursion (insert "\n")))
313 (unwind-protect 313 (unwind-protect
314 (setq prompt (cond ((stringp prompt) 314 (setq prompt (cond ((stringp prompt)
315 (read-string (format prompt skeleton-subprompt) 315 ;; The user may issue commands to move
316 (setq initial-input 316 ;; around (like `C-M-v'). Ensure that we
317 (or initial-input 317 ;; insert the skeleton at the correct
318 (symbol-value 'input))))) 318 ;; (initial) point.
319 (save-excursion
320 (read-string (format prompt skeleton-subprompt)
321 (setq initial-input
322 (or initial-input
323 (symbol-value 'input))))))
319 ((functionp prompt) 324 ((functionp prompt)
320 (funcall prompt)) 325 (funcall prompt))
321 (t (eval prompt)))) 326 (t (eval prompt))))
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 34687805b57..e2cfe9861a5 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -979,10 +979,9 @@ supported at a time.
979 (speedbar-set-timer dframe-update-speed) 979 (speedbar-set-timer dframe-update-speed)
980 ) 980 )
981 ;; Frame modifications 981 ;; Frame modifications
982 (set (make-local-variable 'dframe-delete-frame-function) 982 (setq-local dframe-delete-frame-function 'speedbar-handle-delete-frame)
983 'speedbar-handle-delete-frame)
984 ;; hscroll 983 ;; hscroll
985 (set (make-local-variable 'auto-hscroll-mode) nil) 984 (setq-local auto-hscroll-mode nil)
986 ;; reset the selection variable 985 ;; reset the selection variable
987 (setq speedbar-last-selected-file nil)) 986 (setq speedbar-last-selected-file nil))
988 987
@@ -1075,9 +1074,8 @@ in the selected file.
1075 (save-excursion 1074 (save-excursion
1076 (setq font-lock-keywords nil) ;; no font-locking please 1075 (setq font-lock-keywords nil) ;; no font-locking please
1077 (setq truncate-lines t) 1076 (setq truncate-lines t)
1078 (make-local-variable 'frame-title-format) 1077 (setq-local frame-title-format "Speedbar")
1079 (setq frame-title-format "Speedbar" 1078 (setq case-fold-search nil
1080 case-fold-search nil
1081 buffer-read-only t) 1079 buffer-read-only t)
1082 (speedbar-set-mode-line-format) 1080 (speedbar-set-mode-line-format)
1083 ;; Add in our dframe hooks. 1081 ;; Add in our dframe hooks.
@@ -1814,16 +1812,13 @@ of the special mode functions."
1814 (setq v (intern-soft (concat ms "-speedbar-key-map"))) 1812 (setq v (intern-soft (concat ms "-speedbar-key-map")))
1815 (if (not v) 1813 (if (not v)
1816 nil ;; don't add special keymap 1814 nil ;; don't add special keymap
1817 (make-local-variable 'speedbar-special-mode-key-map) 1815 (setq-local speedbar-special-mode-key-map
1818 (setq speedbar-special-mode-key-map 1816 (symbol-value v)))
1819 (symbol-value v)))
1820 (setq v (intern-soft (concat ms "-speedbar-menu-items"))) 1817 (setq v (intern-soft (concat ms "-speedbar-menu-items")))
1821 (if (not v) 1818 (if (not v)
1822 nil ;; don't add special menus 1819 nil ;; don't add special menus
1823 (make-local-variable 'speedbar-easymenu-definition-special) 1820 (setq-local speedbar-easymenu-definition-special
1824 (setq speedbar-easymenu-definition-special 1821 (symbol-value v))))))))))
1825 (symbol-value v)))
1826 )))))))
1827 1822
1828(defun speedbar-remove-localized-speedbar-support (buffer) 1823(defun speedbar-remove-localized-speedbar-support (buffer)
1829 "Remove any traces that BUFFER supports speedbar in a specialized way." 1824 "Remove any traces that BUFFER supports speedbar in a specialized way."
diff --git a/lisp/startup.el b/lisp/startup.el
index f9de7fa94f6..77fd1dd6aad 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -641,7 +641,7 @@ It is the default value of the variable `top-level'."
641 (with-current-buffer "*Messages*" 641 (with-current-buffer "*Messages*"
642 (messages-buffer-mode) 642 (messages-buffer-mode)
643 ;; Make it easy to do like "tail -f". 643 ;; Make it easy to do like "tail -f".
644 (set (make-local-variable 'window-point-insertion-type) t) 644 (setq-local window-point-insertion-type t)
645 ;; Give *Messages* the same default-directory as *scratch*, 645 ;; Give *Messages* the same default-directory as *scratch*,
646 ;; just to keep things predictable. 646 ;; just to keep things predictable.
647 (setq default-directory (or dir (expand-file-name "~/"))))) 647 (setq default-directory (or dir (expand-file-name "~/")))))
@@ -2007,7 +2007,7 @@ splash screen in another window."
2007 (setq buffer-read-only nil) 2007 (setq buffer-read-only nil)
2008 (erase-buffer) 2008 (erase-buffer)
2009 (setq default-directory command-line-default-directory) 2009 (setq default-directory command-line-default-directory)
2010 (set (make-local-variable 'tab-width) 8) 2010 (setq-local tab-width 8)
2011 2011
2012 (if pure-space-overflow 2012 (if pure-space-overflow
2013 (insert pure-space-overflow-message)) 2013 (insert pure-space-overflow-message))
diff --git a/lisp/strokes.el b/lisp/strokes.el
index 11bc07a29cc..044872068f4 100644
--- a/lisp/strokes.el
+++ b/lisp/strokes.el
@@ -1231,8 +1231,8 @@ the stroke as a character in some language."
1231;; mode-popup-menu edit-strokes-menu) ; what about extent-specific stuff? 1231;; mode-popup-menu edit-strokes-menu) ; what about extent-specific stuff?
1232;; (and (featurep 'menubar) 1232;; (and (featurep 'menubar)
1233;; current-menubar 1233;; current-menubar
1234;; (set (make-local-variable 'current-menubar) 1234;; (setq-local current-menubar
1235;; (copy-sequence current-menubar)) 1235;; (copy-sequence current-menubar))
1236;; (add-submenu nil edit-strokes-menu))) 1236;; (add-submenu nil edit-strokes-menu)))
1237 1237
1238;;(let ((map edit-strokes-mode-map)) 1238;;(let ((map edit-strokes-mode-map))
@@ -1363,13 +1363,13 @@ If STROKES-MAP is not given, `strokes-global-map' will be used instead."
1363 finally do (unless (eobp) 1363 finally do (unless (eobp)
1364 (kill-region (1+ (point)) (point-max)))) 1364 (kill-region (1+ (point)) (point-max))))
1365 (view-buffer "*Strokes List*" nil) 1365 (view-buffer "*Strokes List*" nil)
1366 (set (make-local-variable 'view-mode-map) 1366 (setq-local view-mode-map
1367 (let ((map (copy-keymap view-mode-map))) 1367 (let ((map (copy-keymap view-mode-map)))
1368 (define-key map "q" `(lambda () 1368 (define-key map "q" `(lambda ()
1369 (interactive) 1369 (interactive)
1370 (View-quit) 1370 (View-quit)
1371 (set-window-configuration ,config))) 1371 (set-window-configuration ,config)))
1372 map)) 1372 map))
1373 (goto-char (point-min)))) 1373 (goto-char (point-min))))
1374 1374
1375(defun strokes-alphabetic-lessp (stroke1 stroke2) 1375(defun strokes-alphabetic-lessp (stroke1 stroke2)
diff --git a/lisp/subr.el b/lisp/subr.el
index 9f78471cf35..8f27cee15d1 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2750,20 +2750,22 @@ floating point support."
2750 "Insert the character you type in the minibuffer and exit. 2750 "Insert the character you type in the minibuffer and exit.
2751Discard all previous input before inserting and exiting the minibuffer." 2751Discard all previous input before inserting and exiting the minibuffer."
2752 (interactive) 2752 (interactive)
2753 (delete-minibuffer-contents) 2753 (when (minibufferp)
2754 (insert last-command-event) 2754 (delete-minibuffer-contents)
2755 (exit-minibuffer)) 2755 (insert last-command-event)
2756 (exit-minibuffer)))
2756 2757
2757(defun read-char-from-minibuffer-insert-other () 2758(defun read-char-from-minibuffer-insert-other ()
2758 "Handle inserting of a character other than allowed. 2759 "Handle inserting of a character other than allowed.
2759Display an error on trying to insert a disallowed character. 2760Display an error on trying to insert a disallowed character.
2760Also discard all previous input in the minibuffer." 2761Also discard all previous input in the minibuffer."
2761 (interactive) 2762 (interactive)
2762 (delete-minibuffer-contents) 2763 (when (minibufferp)
2763 (ding) 2764 (delete-minibuffer-contents)
2764 (discard-input) 2765 (ding)
2765 (minibuffer-message "Wrong answer") 2766 (discard-input)
2766 (sit-for 2)) 2767 (minibuffer-message "Wrong answer")
2768 (sit-for 2)))
2767 2769
2768(defvar empty-history) 2770(defvar empty-history)
2769 2771
@@ -2807,6 +2809,8 @@ There is no need to explicitly add `help-char' to CHARS;
2807 map read-char-from-minibuffer-map-hash) 2809 map read-char-from-minibuffer-map-hash)
2808 map)) 2810 map))
2809 read-char-from-minibuffer-map)) 2811 read-char-from-minibuffer-map))
2812 ;; Protect this-command when called from pre-command-hook (bug#45029)
2813 (this-command this-command)
2810 (result 2814 (result
2811 (read-from-minibuffer prompt nil map nil 2815 (read-from-minibuffer prompt nil map nil
2812 (or history 'empty-history))) 2816 (or history 'empty-history)))
@@ -2861,28 +2865,31 @@ There is no need to explicitly add `help-char' to CHARS;
2861 "Insert the answer \"y\" and exit the minibuffer of `y-or-n-p'. 2865 "Insert the answer \"y\" and exit the minibuffer of `y-or-n-p'.
2862Discard all previous input before inserting and exiting the minibuffer." 2866Discard all previous input before inserting and exiting the minibuffer."
2863 (interactive) 2867 (interactive)
2864 (delete-minibuffer-contents) 2868 (when (minibufferp)
2865 (insert "y") 2869 (delete-minibuffer-contents)
2866 (exit-minibuffer)) 2870 (insert "y")
2871 (exit-minibuffer)))
2867 2872
2868(defun y-or-n-p-insert-n () 2873(defun y-or-n-p-insert-n ()
2869 "Insert the answer \"n\" and exit the minibuffer of `y-or-n-p'. 2874 "Insert the answer \"n\" and exit the minibuffer of `y-or-n-p'.
2870Discard all previous input before inserting and exiting the minibuffer." 2875Discard all previous input before inserting and exiting the minibuffer."
2871 (interactive) 2876 (interactive)
2872 (delete-minibuffer-contents) 2877 (when (minibufferp)
2873 (insert "n") 2878 (delete-minibuffer-contents)
2874 (exit-minibuffer)) 2879 (insert "n")
2880 (exit-minibuffer)))
2875 2881
2876(defun y-or-n-p-insert-other () 2882(defun y-or-n-p-insert-other ()
2877 "Handle inserting of other answers in the minibuffer of `y-or-n-p'. 2883 "Handle inserting of other answers in the minibuffer of `y-or-n-p'.
2878Display an error on trying to insert a disallowed character. 2884Display an error on trying to insert a disallowed character.
2879Also discard all previous input in the minibuffer." 2885Also discard all previous input in the minibuffer."
2880 (interactive) 2886 (interactive)
2881 (delete-minibuffer-contents) 2887 (when (minibufferp)
2882 (ding) 2888 (delete-minibuffer-contents)
2883 (discard-input) 2889 (ding)
2884 (minibuffer-message "Please answer y or n") 2890 (discard-input)
2885 (sit-for 2)) 2891 (minibuffer-message "Please answer y or n")
2892 (sit-for 2)))
2886 2893
2887(defvar empty-history) 2894(defvar empty-history)
2888 2895
@@ -2960,6 +2967,8 @@ is nil and `use-dialog-box' is non-nil."
2960 (let ((help-form msg)) ; lexically bound msg 2967 (let ((help-form msg)) ; lexically bound msg
2961 (help-form-show))))) 2968 (help-form-show)))))
2962 map)) 2969 map))
2970 ;; Protect this-command when called from pre-command-hook (bug#45029)
2971 (this-command this-command)
2963 (str (read-from-minibuffer 2972 (str (read-from-minibuffer
2964 prompt nil keymap nil 2973 prompt nil keymap nil
2965 (or y-or-n-p-history-variable 'empty-history)))) 2974 (or y-or-n-p-history-variable 'empty-history))))
@@ -5905,4 +5914,22 @@ returned list are in the same order as in TREE.
5905(defconst regexp-unmatchable "\\`a\\`" 5914(defconst regexp-unmatchable "\\`a\\`"
5906 "Standard regexp guaranteed not to match any string at all.") 5915 "Standard regexp guaranteed not to match any string at all.")
5907 5916
5917(defun run-hook-query-error-with-timeout (hook)
5918 "Run HOOK, catching errors, and querying the user about whether to continue.
5919If a function in HOOK signals an error, the user will be prompted
5920whether to continue or not. If the user doesn't respond,
5921evaluation will continue if the user doesn't respond within five
5922seconds."
5923 (run-hook-wrapped
5924 hook
5925 (lambda (fun)
5926 (condition-case err
5927 (funcall fun)
5928 (error
5929 (unless (y-or-n-p-with-timeout (format "Error %s; continue?" err)
5930 5 t)
5931 (error err))))
5932 ;; Continue running.
5933 nil)))
5934
5908;;; subr.el ends here 5935;;; subr.el ends here
diff --git a/lisp/svg.el b/lisp/svg.el
index eeb945f53b5..1ca59658aa7 100644
--- a/lisp/svg.el
+++ b/lisp/svg.el
@@ -184,6 +184,19 @@ otherwise. IMAGE-TYPE should be a MIME image type, like
184 `((xlink:href . ,(svg--image-data image image-type datap)) 184 `((xlink:href . ,(svg--image-data image image-type datap))
185 ,@(svg--arguments svg args))))) 185 ,@(svg--arguments svg args)))))
186 186
187(defun svg-embed-base-uri-image (svg relative-filename &rest args)
188 "Insert image placed at RELATIVE-FILENAME into the SVG structure.
189RELATIVE-FILENAME will be searched in `file-name-directory' of the
190image's `:base-uri' property. If `:base-uri' is not specified for the
191image, then embedding won't work. Embedding large images using this
192function is much faster than `svg-embed'."
193 (svg--append
194 svg
195 (dom-node
196 'image
197 `((xlink:href . ,relative-filename)
198 ,@(svg--arguments svg args)))))
199
187(defun svg-text (svg text &rest args) 200(defun svg-text (svg text &rest args)
188 "Add TEXT to SVG." 201 "Add TEXT to SVG."
189 (svg--append 202 (svg--append
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 26049552242..1327bde9088 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -762,6 +762,8 @@ After the tab is created, the hooks in
762 (from-tab (tab-bar--tab))) 762 (from-tab (tab-bar--tab)))
763 763
764 (when tab-bar-new-tab-choice 764 (when tab-bar-new-tab-choice
765 (when (minibuffer-selected-window)
766 (select-window (minibuffer-selected-window)))
765 (delete-other-windows) 767 (delete-other-windows)
766 ;; Create a new window to get rid of old window parameters 768 ;; Create a new window to get rid of old window parameters
767 ;; (e.g. prev/next buffers) of old window. 769 ;; (e.g. prev/next buffers) of old window.
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index d460c8a4f73..608d997863b 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -588,7 +588,7 @@ For instance, if mode is #o700, then it produces `rwx------'."
588 (setq pos (tar-header-data-end descriptor)) 588 (setq pos (tar-header-data-end descriptor))
589 (progress-reporter-update progress-reporter pos))) 589 (progress-reporter-update progress-reporter pos)))
590 590
591 (set (make-local-variable 'tar-parse-info) (nreverse result)) 591 (setq-local tar-parse-info (nreverse result))
592 ;; A tar file should end with a block or two of nulls, 592 ;; A tar file should end with a block or two of nulls,
593 ;; but let's not get a fatal error if it doesn't. 593 ;; but let's not get a fatal error if it doesn't.
594 (if (null descriptor) 594 (if (null descriptor)
@@ -718,21 +718,21 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
718 (file-writable-p buffer-file-name) 718 (file-writable-p buffer-file-name)
719 (setq buffer-read-only nil)) ; undo what `special-mode' did 719 (setq buffer-read-only nil)) ; undo what `special-mode' did
720 (make-local-variable 'tar-parse-info) 720 (make-local-variable 'tar-parse-info)
721 (set (make-local-variable 'require-final-newline) nil) ; binary data, dude... 721 (setq-local require-final-newline nil) ; binary data, dude...
722 (set (make-local-variable 'local-enable-local-variables) nil) 722 (setq-local local-enable-local-variables nil)
723 (set (make-local-variable 'next-line-add-newlines) nil) 723 (setq-local next-line-add-newlines nil)
724 (set (make-local-variable 'tar-file-name-coding-system) 724 (setq-local tar-file-name-coding-system
725 (or file-name-coding-system 725 (or file-name-coding-system
726 default-file-name-coding-system 726 default-file-name-coding-system
727 locale-coding-system)) 727 locale-coding-system))
728 ;; Prevent loss of data when saving the file. 728 ;; Prevent loss of data when saving the file.
729 (set (make-local-variable 'file-precious-flag) t) 729 (setq-local file-precious-flag t)
730 (buffer-disable-undo) 730 (buffer-disable-undo)
731 (widen) 731 (widen)
732 ;; Now move the Tar data into an auxiliary buffer, so we can use the main 732 ;; Now move the Tar data into an auxiliary buffer, so we can use the main
733 ;; buffer for the summary. 733 ;; buffer for the summary.
734 (cl-assert (not (tar-data-swapped-p))) 734 (cl-assert (not (tar-data-swapped-p)))
735 (set (make-local-variable 'revert-buffer-function) #'tar-mode-revert) 735 (setq-local revert-buffer-function #'tar-mode-revert)
736 ;; We started using write-contents-functions, but this hook is not 736 ;; We started using write-contents-functions, but this hook is not
737 ;; used during auto-save, so we now use 737 ;; used during auto-save, so we now use
738 ;; write-region-annotate-functions which hooks at a lower-level. 738 ;; write-region-annotate-functions which hooks at a lower-level.
@@ -741,10 +741,10 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
741 (add-hook 'change-major-mode-hook #'tar-change-major-mode-hook nil t) 741 (add-hook 'change-major-mode-hook #'tar-change-major-mode-hook nil t)
742 ;; Tar data is made of bytes, not chars. 742 ;; Tar data is made of bytes, not chars.
743 (set-buffer-multibyte nil) ;Hopefully a no-op. 743 (set-buffer-multibyte nil) ;Hopefully a no-op.
744 (set (make-local-variable 'tar-data-buffer) 744 (setq-local tar-data-buffer (generate-new-buffer
745 (generate-new-buffer (format " *tar-data %s*" 745 (format " *tar-data %s*"
746 (file-name-nondirectory 746 (file-name-nondirectory
747 (or buffer-file-name (buffer-name)))))) 747 (or buffer-file-name (buffer-name))))))
748 (condition-case err 748 (condition-case err
749 (progn 749 (progn
750 (tar-swap-data) 750 (tar-swap-data)
@@ -1004,8 +1004,8 @@ return nil. Otherwise point is returned."
1004 default-directory)) 1004 default-directory))
1005 (set-buffer-modified-p nil) 1005 (set-buffer-modified-p nil)
1006 (normal-mode) ; pick a mode. 1006 (normal-mode) ; pick a mode.
1007 (set (make-local-variable 'tar-superior-buffer) tar-buffer) 1007 (setq-local tar-superior-buffer tar-buffer)
1008 (set (make-local-variable 'tar-superior-descriptor) descriptor) 1008 (setq-local tar-superior-descriptor descriptor)
1009 (setq buffer-read-only read-only-p) 1009 (setq buffer-read-only read-only-p)
1010 (tar-subfile-mode 1))) 1010 (tar-subfile-mode 1)))
1011 (cond 1011 (cond
diff --git a/lisp/term.el b/lisp/term.el
index 34dc2870f21..2e69af0735b 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -264,7 +264,7 @@
264;; M-p term-previous-input Cycle backwards in input history 264;; M-p term-previous-input Cycle backwards in input history
265;; M-n term-next-input Cycle forwards 265;; M-n term-next-input Cycle forwards
266;; M-r term-previous-matching-input Previous input matching a regexp 266;; M-r term-previous-matching-input Previous input matching a regexp
267;; M-s comint-next-matching-input Next input that matches 267;; M-s term-next-matching-input Next input that matches
268;; return term-send-input 268;; return term-send-input
269;; C-c C-a term-bol Beginning of line; skip prompt. 269;; C-c C-a term-bol Beginning of line; skip prompt.
270;; C-d term-delchar-or-maybe-eof Delete char unless at end of buff. 270;; C-d term-delchar-or-maybe-eof Delete char unless at end of buff.
@@ -1005,12 +1005,12 @@ Entry to this mode runs the hooks on `term-mode-hook'."
1005 ;; we do not want indent to sneak in any tabs 1005 ;; we do not want indent to sneak in any tabs
1006 (setq indent-tabs-mode nil) 1006 (setq indent-tabs-mode nil)
1007 (setq buffer-display-table term-display-table) 1007 (setq buffer-display-table term-display-table)
1008 (set (make-local-variable 'term-home-marker) (copy-marker 0)) 1008 (setq-local term-home-marker (copy-marker 0))
1009 (set (make-local-variable 'term-height) (floor (window-screen-lines))) 1009 (setq-local term-height (floor (window-screen-lines)))
1010 (set (make-local-variable 'term-width) (window-max-chars-per-line)) 1010 (setq-local term-width (window-max-chars-per-line))
1011 (set (make-local-variable 'term-last-input-start) (make-marker)) 1011 (setq-local term-last-input-start (make-marker))
1012 (set (make-local-variable 'term-last-input-end) (make-marker)) 1012 (setq-local term-last-input-end (make-marker))
1013 (set (make-local-variable 'term-last-input-match) "") 1013 (setq-local term-last-input-match "")
1014 1014
1015 ;; These local variables are set to their local values: 1015 ;; These local variables are set to their local values:
1016 (make-local-variable 'term-saved-home-marker) 1016 (make-local-variable 'term-saved-home-marker)
@@ -1028,9 +1028,9 @@ Entry to this mode runs the hooks on `term-mode-hook'."
1028 ;; a properly configured ange-ftp, I've decided to be conservative 1028 ;; a properly configured ange-ftp, I've decided to be conservative
1029 ;; and put them in. -mm 1029 ;; and put them in. -mm
1030 1030
1031 (set (make-local-variable 'term-ansi-at-host) (system-name)) 1031 (setq-local term-ansi-at-host (system-name))
1032 (set (make-local-variable 'term-ansi-at-dir) default-directory) 1032 (setq-local term-ansi-at-dir default-directory)
1033 (set (make-local-variable 'term-ansi-at-message) nil) 1033 (setq-local term-ansi-at-message nil)
1034 1034
1035 ;; For user tracking purposes -mm 1035 ;; For user tracking purposes -mm
1036 (make-local-variable 'ange-ftp-default-user) 1036 (make-local-variable 'ange-ftp-default-user)
@@ -1073,15 +1073,15 @@ Entry to this mode runs the hooks on `term-mode-hook'."
1073 (make-local-variable 'term-scroll-to-bottom-on-output) 1073 (make-local-variable 'term-scroll-to-bottom-on-output)
1074 (make-local-variable 'term-scroll-show-maximum-output) 1074 (make-local-variable 'term-scroll-show-maximum-output)
1075 (make-local-variable 'term-ptyp) 1075 (make-local-variable 'term-ptyp)
1076 (set (make-local-variable 'term-vertical-motion) 'vertical-motion) 1076 (setq-local term-vertical-motion 'vertical-motion)
1077 (set (make-local-variable 'term-pending-delete-marker) (make-marker)) 1077 (setq-local term-pending-delete-marker (make-marker))
1078 (make-local-variable 'term-current-face) 1078 (make-local-variable 'term-current-face)
1079 (term-ansi-reset) 1079 (term-ansi-reset)
1080 (set (make-local-variable 'term-pending-frame) nil) 1080 (setq-local term-pending-frame nil)
1081 ;; Cua-mode's keybindings interfere with the term keybindings, disable it. 1081 ;; Cua-mode's keybindings interfere with the term keybindings, disable it.
1082 (set (make-local-variable 'cua-mode) nil) 1082 (setq-local cua-mode nil)
1083 1083
1084 (set (make-local-variable 'font-lock-defaults) '(nil t)) 1084 (setq-local font-lock-defaults '(nil t))
1085 1085
1086 (add-function :filter-return 1086 (add-function :filter-return
1087 (local 'filter-buffer-substring-function) 1087 (local 'filter-buffer-substring-function)
@@ -1423,8 +1423,7 @@ buffer. The hook `term-exec-hook' is run after each exec."
1423 (when proc (delete-process proc))) 1423 (when proc (delete-process proc)))
1424 ;; Crank up a new process 1424 ;; Crank up a new process
1425 (let ((proc (term-exec-1 name buffer command switches))) 1425 (let ((proc (term-exec-1 name buffer command switches)))
1426 (make-local-variable 'term-ptyp) 1426 (setq-local term-ptyp process-connection-type) ; t if pty, nil if pipe.
1427 (setq term-ptyp process-connection-type) ; t if pty, nil if pipe.
1428 ;; Jump to the end, and set the process mark. 1427 ;; Jump to the end, and set the process mark.
1429 (goto-char (point-max)) 1428 (goto-char (point-max))
1430 (set-marker (process-mark proc) (point)) 1429 (set-marker (process-mark proc) (point))
@@ -3067,8 +3066,7 @@ See `term-prompt-regexp'."
3067 (aset term-terminal-undecoded-bytes 0 ?\r)) 3066 (aset term-terminal-undecoded-bytes 0 ?\r))
3068 (goto-char (point-max))) 3067 (goto-char (point-max)))
3069 ;; FIXME: Use (add-function :override (process-filter proc) 3068 ;; FIXME: Use (add-function :override (process-filter proc)
3070 (make-local-variable 'term-pager-old-filter) 3069 (setq-local term-pager-old-filter (process-filter proc))
3071 (setq term-pager-old-filter (process-filter proc))
3072 ;; FIXME: Where is `term-pager-filter' set to a function?! 3070 ;; FIXME: Where is `term-pager-filter' set to a function?!
3073 (set-process-filter proc term-pager-filter) 3071 (set-process-filter proc term-pager-filter)
3074 (setq i str-length)) 3072 (setq i str-length))
@@ -3537,8 +3535,7 @@ The top-most line is line 0."
3537 ;; (stop-process process)) 3535 ;; (stop-process process))
3538 (setq term-pager-old-local-map (current-local-map)) 3536 (setq term-pager-old-local-map (current-local-map))
3539 (use-local-map term-pager-break-map) 3537 (use-local-map term-pager-break-map)
3540 (make-local-variable 'term-old-mode-line-format) 3538 (setq-local term-old-mode-line-format mode-line-format)
3541 (setq term-old-mode-line-format mode-line-format)
3542 (setq mode-line-format 3539 (setq mode-line-format
3543 (list "-- **MORE** " 3540 (list "-- **MORE** "
3544 mode-line-buffer-identification 3541 mode-line-buffer-identification
diff --git a/lisp/textmodes/bibtex-style.el b/lisp/textmodes/bibtex-style.el
index 952b81621e9..41650eb4371 100644
--- a/lisp/textmodes/bibtex-style.el
+++ b/lisp/textmodes/bibtex-style.el
@@ -66,12 +66,12 @@
66;;;###autoload 66;;;###autoload
67(define-derived-mode bibtex-style-mode nil "BibStyle" 67(define-derived-mode bibtex-style-mode nil "BibStyle"
68 "Major mode for editing BibTeX style files." 68 "Major mode for editing BibTeX style files."
69 (set (make-local-variable 'comment-start) "%") 69 (setq-local comment-start "%")
70 (set (make-local-variable 'outline-regexp) "^[a-z]") 70 (setq-local outline-regexp "^[a-z]")
71 (set (make-local-variable 'imenu-generic-expression) 71 (setq-local imenu-generic-expression
72 '((nil "\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}" 2))) 72 '((nil "\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}" 2)))
73 (set (make-local-variable 'indent-line-function) 'bibtex-style-indent-line) 73 (setq-local indent-line-function 'bibtex-style-indent-line)
74 (set (make-local-variable 'parse-sexp-ignore-comments) t) 74 (setq-local parse-sexp-ignore-comments t)
75 (setq font-lock-defaults 75 (setq font-lock-defaults
76 '(bibtex-style-font-lock-keywords nil t 76 '(bibtex-style-font-lock-keywords nil t
77 ((?. . "w"))))) 77 ((?. . "w")))))
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 0a0a58244d0..a78219e3f69 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -40,6 +40,8 @@
40 40
41;;; Code: 41;;; Code:
42 42
43(require 'iso8601)
44
43 45
44;; User Options: 46;; User Options:
45 47
@@ -2761,12 +2763,16 @@ and `bibtex-autokey-names-stretch'."
2761 2763
2762(defun bibtex-autokey-get-year () 2764(defun bibtex-autokey-get-year ()
2763 "Return year field contents as a string obeying `bibtex-autokey-year-length'." 2765 "Return year field contents as a string obeying `bibtex-autokey-year-length'."
2764 (let ((yearfield (bibtex-autokey-get-field '("year" "date")))) 2766 (let* ((str (bibtex-autokey-get-field '("date" "year"))) ; possibly ""
2765 ;; biblatex date field has format yyyy-mm-dd 2767 (year (or (and (iso8601-valid-p str)
2766 (if (< 4 (length yearfield)) 2768 (let ((year (decoded-time-year (iso8601-parse str))))
2767 (setq yearfield (substring yearfield 0 4))) 2769 (and year (number-to-string year))))
2768 (substring yearfield (max 0 (- (length yearfield) 2770 ;; BibTeX permits a year field "(about 1984)", where only
2769 bibtex-autokey-year-length))))) 2771 ;; the last four nonpunctuation characters must be numerals.
2772 (and (string-match "\\([0-9][0-9][0-9][0-9]\\)[^[:alnum:]]*\\'" str)
2773 (match-string 1 str))
2774 (user-error "Year or date field `%s' invalid" str))))
2775 (substring year (max 0 (- (length year) bibtex-autokey-year-length)))))
2770 2776
2771(defun bibtex-autokey-get-title () 2777(defun bibtex-autokey-get-title ()
2772 "Get title field contents up to a terminator. 2778 "Get title field contents up to a terminator.
@@ -2849,12 +2855,12 @@ The name part:
2849 2855
2850The year part: 2856The year part:
2851 1. Build the year part of the key by truncating the content of the year 2857 1. Build the year part of the key by truncating the content of the year
2852 field to the rightmost `bibtex-autokey-year-length' digits (useful 2858 component of the date or year field to the rightmost
2853 values are 2 and 4). 2859 `bibtex-autokey-year-length' digits (useful values are 2 and 4).
2854 2. If the year field (or any other field required to generate the key) 2860 2. If both the year and date fields are absent, but the entry has a
2855 is absent, but the entry has a valid crossref field and 2861 valid crossref field and `bibtex-autokey-use-crossref' is
2856 `bibtex-autokey-use-crossref' is non-nil, use the field of the 2862 non-nil, use the date or year field of the crossreferenced entry
2857 crossreferenced entry instead. 2863 instead.
2858 2864
2859The title part 2865The title part
2860 1. Change the content of the title field according to 2866 1. Change the content of the title field according to
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index 984cc08de85..e42615e5158 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -4073,10 +4073,12 @@ cache buffer into the designated cell in the table buffer."
4073 (set-buffer table-cell-buffer) 4073 (set-buffer table-cell-buffer)
4074 (let ((cache-buffer (get-buffer-create table-cache-buffer-name)) 4074 (let ((cache-buffer (get-buffer-create table-cache-buffer-name))
4075 (org-coord (table--get-coordinate)) 4075 (org-coord (table--get-coordinate))
4076 (fixed table-fixed-width-mode)
4076 (in-cell (equal (table--cell-to-coord (table--probe-cell)) 4077 (in-cell (equal (table--cell-to-coord (table--probe-cell))
4077 (cons table-cell-info-lu-coordinate table-cell-info-rb-coordinate))) 4078 (cons table-cell-info-lu-coordinate table-cell-info-rb-coordinate)))
4078 rectangle) 4079 rectangle)
4079 (set-buffer cache-buffer) 4080 (set-buffer cache-buffer)
4081 (setq-local table-fixed-width-mode fixed)
4080 (setq rectangle 4082 (setq rectangle
4081 (extract-rectangle 4083 (extract-rectangle
4082 1 4084 1
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 37ab11ad89f..59238452a4d 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -2331,9 +2331,14 @@ FILE is typically the output DVI or PDF file."
2331 :version "23.1" 2331 :version "23.1"
2332 :group 'tex-run) 2332 :group 'tex-run)
2333 2333
2334(defun tex--quote-spec (fspec)
2335 (cl-loop for (char . file) in fspec
2336 collect (cons char (shell-quote-argument file))))
2337
2334(defun tex-format-cmd (format fspec) 2338(defun tex-format-cmd (format fspec)
2335 "Like `format-spec' but adds user-specified args to the command. 2339 "Like `format-spec' but adds user-specified args to the command.
2336Only applies the FSPEC to the args part of FORMAT." 2340Only applies the FSPEC to the args part of FORMAT."
2341 (setq fspec (tex--quote-spec fspec))
2337 (if (not (string-match "\\([^ /\\]+\\) " format)) 2342 (if (not (string-match "\\([^ /\\]+\\) " format))
2338 (format-spec format fspec) 2343 (format-spec format fspec)
2339 (let* ((prefix (substring format 0 (match-beginning 0))) 2344 (let* ((prefix (substring format 0 (match-beginning 0)))
@@ -2430,8 +2435,8 @@ Only applies the FSPEC to the args part of FORMAT."
2430 (prog1 (file-name-directory (expand-file-name file)) 2435 (prog1 (file-name-directory (expand-file-name file))
2431 (setq file (file-name-nondirectory file)))) 2436 (setq file (file-name-nondirectory file))))
2432 (root (file-name-sans-extension file)) 2437 (root (file-name-sans-extension file))
2433 (fspec (list (cons ?r (shell-quote-argument root)) 2438 (fspec (list (cons ?r root)
2434 (cons ?f (shell-quote-argument file)))) 2439 (cons ?f file)))
2435 (default (tex-compile-default fspec))) 2440 (default (tex-compile-default fspec)))
2436 (list default-directory 2441 (list default-directory
2437 (completing-read 2442 (completing-read
diff --git a/lisp/thumbs.el b/lisp/thumbs.el
index 3aa7ff0836b..93b7c08d62f 100644
--- a/lisp/thumbs.el
+++ b/lisp/thumbs.el
@@ -347,8 +347,7 @@ If MARKED is non-nil, the image is marked."
347 :conversion ,(if marked 'disabled) 347 :conversion ,(if marked 'disabled)
348 :margin ,thumbs-margin))) 348 :margin ,thumbs-margin)))
349 (insert-image i) 349 (insert-image i)
350 (set (make-local-variable 'thumbs-current-image-size) 350 (setq-local thumbs-current-image-size (image-size i t))))
351 (image-size i t))))
352 351
353(defun thumbs-insert-thumb (img &optional marked) 352(defun thumbs-insert-thumb (img &optional marked)
354 "Insert the thumbnail for IMG at point. 353 "Insert the thumbnail for IMG at point.
@@ -387,7 +386,7 @@ If MARKED is non-nil, the image is marked."
387 (if dir (setq default-directory dir)) 386 (if dir (setq default-directory dir))
388 (thumbs-do-thumbs-insertion list) 387 (thumbs-do-thumbs-insertion list)
389 (goto-char (point-min)) 388 (goto-char (point-min))
390 (set (make-local-variable 'thumbs-current-dir) default-directory))) 389 (setq-local thumbs-current-dir default-directory)))
391 390
392;;;###autoload 391;;;###autoload
393(defun thumbs-show-from-dir (dir &optional reg same-window) 392(defun thumbs-show-from-dir (dir &optional reg same-window)
diff --git a/lisp/timezone.el b/lisp/timezone.el
index 8ba70f17fde..1b5e4226e2e 100644
--- a/lisp/timezone.el
+++ b/lisp/timezone.el
@@ -1,4 +1,4 @@
1;;; timezone.el --- time zone package for GNU Emacs -- lexical-binding: t -*- 1;;; timezone.el --- time zone package for GNU Emacs -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1990-1993, 1996, 1999, 2001-2020 Free Software 3;; Copyright (C) 1990-1993, 1996, 1999, 2001-2020 Free Software
4;; Foundation, Inc. 4;; Foundation, Inc.
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 84562164300..37f42be3f4d 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -159,7 +159,8 @@ To define items in any other map, use `tool-bar-local-item'."
159 ((< (display-color-cells) 256) 159 ((< (display-color-cells) 256)
160 ',(list xpm-lo-spec xpm-spec pbm-spec xbm-spec)) 160 ',(list xpm-lo-spec xpm-spec pbm-spec xbm-spec))
161 (t 161 (t
162 ',(list xpm-spec pbm-spec xbm-spec)))))) 162 ',(list xpm-spec pbm-spec xbm-spec)))
163 t)))
163 164
164;;;###autoload 165;;;###autoload
165(defun tool-bar-local-item (icon def key map &rest props) 166(defun tool-bar-local-item (icon def key map &rest props)
diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el
index 45d3f28ea07..e8a71a38df6 100644
--- a/lisp/tree-widget.el
+++ b/lisp/tree-widget.el
@@ -260,10 +260,9 @@ Typically it should contain something like this:
260 \\='(:ascent center :mask (heuristic t)))" 260 \\='(:ascent center :mask (heuristic t)))"
261 (or name (setq name (or tree-widget-theme "default"))) 261 (or name (setq name (or tree-widget-theme "default")))
262 (unless (string-equal name (tree-widget-theme-name)) 262 (unless (string-equal name (tree-widget-theme-name))
263 (set (make-local-variable 'tree-widget--theme) 263 (setq-local tree-widget--theme (make-vector 4 nil))
264 (make-vector 4 nil)) 264 (tree-widget-set-parent-theme name)
265 (tree-widget-set-parent-theme name) 265 (tree-widget-set-parent-theme "default")))
266 (tree-widget-set-parent-theme "default")))
267 266
268(defun tree-widget--locate-sub-directory (name path) 267(defun tree-widget--locate-sub-directory (name path)
269 "Locate all occurrences of the sub-directory NAME in PATH. 268 "Locate all occurrences of the sub-directory NAME in PATH.
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
index d07737e3332..ca84f86f289 100644
--- a/lisp/tutorial.el
+++ b/lisp/tutorial.el
@@ -50,6 +50,9 @@
50 "Tutorial language.") 50 "Tutorial language.")
51(make-variable-buffer-local 'tutorial--lang) 51(make-variable-buffer-local 'tutorial--lang)
52 52
53(defvar tutorial--buffer nil
54 "The selected tutorial buffer.")
55
53(defun tutorial--describe-nonstandard-key (value) 56(defun tutorial--describe-nonstandard-key (value)
54 "Give more information about a changed key binding. 57 "Give more information about a changed key binding.
55This is used in `help-with-tutorial'. The information includes 58This is used in `help-with-tutorial'. The information includes
@@ -655,6 +658,15 @@ with some explanatory links."
655 (unless (eq prop-val 'key-sequence) 658 (unless (eq prop-val 'key-sequence)
656 (delete-region prop-start prop-end)))))) 659 (delete-region prop-start prop-end))))))
657 660
661(defun tutorial--save-on-kill ()
662 "Query the user about saving the tutorial when killing Emacs."
663 (when (buffer-live-p tutorial--buffer)
664 (with-current-buffer tutorial--buffer
665 (if (y-or-n-p "Save your position in the tutorial? ")
666 (tutorial--save-tutorial-to (tutorial--saved-file))
667 (message "Tutorial position not saved"))))
668 t)
669
658(defun tutorial--save-tutorial () 670(defun tutorial--save-tutorial ()
659 "Save the tutorial buffer. 671 "Save the tutorial buffer.
660This saves the part of the tutorial before and after the area 672This saves the part of the tutorial before and after the area
@@ -802,6 +814,7 @@ Run the Viper tutorial? "))
802 ;; (Re)build the tutorial buffer if it is not ok 814 ;; (Re)build the tutorial buffer if it is not ok
803 (unless old-tut-is-ok 815 (unless old-tut-is-ok
804 (switch-to-buffer (get-buffer-create tut-buf-name)) 816 (switch-to-buffer (get-buffer-create tut-buf-name))
817 (setq tutorial--buffer (current-buffer))
805 ;; (unless old-tut-buf (text-mode)) 818 ;; (unless old-tut-buf (text-mode))
806 (unless lang (error "Variable lang is nil")) 819 (unless lang (error "Variable lang is nil"))
807 (setq tutorial--lang lang) 820 (setq tutorial--lang lang)
@@ -814,6 +827,7 @@ Run the Viper tutorial? "))
814 ;; a hook to save it when the buffer is killed. 827 ;; a hook to save it when the buffer is killed.
815 (setq buffer-auto-save-file-name nil) 828 (setq buffer-auto-save-file-name nil)
816 (add-hook 'kill-buffer-hook 'tutorial--save-tutorial nil t) 829 (add-hook 'kill-buffer-hook 'tutorial--save-tutorial nil t)
830 (add-hook 'kill-emacs-query-functions 'tutorial--save-on-kill)
817 831
818 ;; Insert the tutorial. First offer to resume last tutorial 832 ;; Insert the tutorial. First offer to resume last tutorial
819 ;; editing session. 833 ;; editing session.
diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el
index 08640fcece9..580d48880bd 100644
--- a/lisp/vc/ediff-ptch.el
+++ b/lisp/vc/ediff-ptch.el
@@ -465,6 +465,9 @@ are two possible targets for this %spatch. However, these files do not exist."
465 file1 file2 (if multi-patch-p "multi-" "")))) 465 file1 file2 (if multi-patch-p "multi-" ""))))
466 (princ " 466 (princ "
467\nPlease enter an alternative patch target ...\n")) 467\nPlease enter an alternative patch target ...\n"))
468 (when (and (string= file1 file2)
469 (y-or-n-p (format "Create %s?" file1)))
470 (write-region (point-min) (point-min) file1))
468 (let ((directory t) 471 (let ((directory t)
469 target) 472 target)
470 (while directory 473 (while directory
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 0da4509670a..84c964e7f52 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -72,7 +72,7 @@
72;; by git, so it's probably 72;; by git, so it's probably
73;; not a good idea. 73;; not a good idea.
74;; - merge-news (file) see `merge-file' 74;; - merge-news (file) see `merge-file'
75;; - mark-resolved (file) OK 75;; - mark-resolved (files) OK
76;; - steal-lock (file &optional revision) NOT NEEDED 76;; - steal-lock (file &optional revision) NOT NEEDED
77;; HISTORY FUNCTIONS 77;; HISTORY FUNCTIONS
78;; * print-log (files buffer &optional shortlog start-revision limit) OK 78;; * print-log (files buffer &optional shortlog start-revision limit) OK
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index e7f67e90eef..c8a80d75ec1 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -276,13 +276,12 @@ If `ask', you will be prompted for a branch type."
276 ((eq state ?C) 'up-to-date) ;; Older mercurial versions use this. 276 ((eq state ?C) 'up-to-date) ;; Older mercurial versions use this.
277 (t 'up-to-date)))))) 277 (t 'up-to-date))))))
278 278
279(defun vc-hg-working-revision (file) 279(defun vc-hg-working-revision (_file)
280 "Hg-specific version of `vc-working-revision'." 280 "Hg-specific version of `vc-working-revision'."
281 (or (ignore-errors 281 (ignore-errors
282 (with-output-to-string 282 (with-output-to-string
283 (vc-hg-command standard-output 0 file 283 (vc-hg-command standard-output 0 nil
284 "parent" "--template" "{rev}"))) 284 "log" "-r" "." "--template" "{rev}"))))
285 "0"))
286 285
287(defcustom vc-hg-symbolic-revision-styles 286(defcustom vc-hg-symbolic-revision-styles
288 '(builtin-active-bookmark 287 '(builtin-active-bookmark
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index f268f912fe7..b3b05839662 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -201,7 +201,7 @@
201;; 201;;
202;; STATE-CHANGING FUNCTIONS 202;; STATE-CHANGING FUNCTIONS
203;; 203;;
204;; * create-repo (backend) 204;; * create-repo ()
205;; 205;;
206;; Create an empty repository in the current directory and initialize 206;; Create an empty repository in the current directory and initialize
207;; it so VC mode can add files to it. For file-oriented systems, this 207;; it so VC mode can add files to it. For file-oriented systems, this
@@ -275,7 +275,7 @@
275;; If FILE is in the `added' state it should be returned to the 275;; If FILE is in the `added' state it should be returned to the
276;; `unregistered' state. 276;; `unregistered' state.
277;; 277;;
278;; - merge-file (file rev1 rev2) 278;; - merge-file (file &optional rev1 rev2)
279;; 279;;
280;; Merge the changes between REV1 and REV2 into the current working 280;; Merge the changes between REV1 and REV2 into the current working
281;; file (for non-distributed VCS). It is expected that with an 281;; file (for non-distributed VCS). It is expected that with an
@@ -333,19 +333,19 @@
333;; the case). Not all backends support this. At present, this is 333;; the case). Not all backends support this. At present, this is
334;; only ever used with LIMIT = 1 (by vc-annotate-show-log-revision-at-line). 334;; only ever used with LIMIT = 1 (by vc-annotate-show-log-revision-at-line).
335;; 335;;
336;; * log-outgoing (backend remote-location) 336;; * log-outgoing (buffer remote-location)
337;; 337;;
338;; Insert in BUFFER the revision log for the changes that will be 338;; Insert in BUFFER the revision log for the changes that will be
339;; sent when performing a push operation to REMOTE-LOCATION. 339;; sent when performing a push operation to REMOTE-LOCATION.
340;; 340;;
341;; * log-incoming (backend remote-location) 341;; * log-incoming (buffer remote-location)
342;; 342;;
343;; Insert in BUFFER the revision log for the changes that will be 343;; Insert in BUFFER the revision log for the changes that will be
344;; received when performing a pull operation from REMOTE-LOCATION. 344;; received when performing a pull operation from REMOTE-LOCATION.
345;; 345;;
346;; - log-search (pattern) 346;; - log-search (buffer pattern)
347;; 347;;
348;; Search for PATTERN in the revision log. 348;; Search for PATTERN in the revision log and output results into BUFFER.
349;; 349;;
350;; - log-view-mode () 350;; - log-view-mode ()
351;; 351;;
@@ -478,7 +478,7 @@
478;; 478;;
479;; Return the root of the VC controlled hierarchy for file. 479;; Return the root of the VC controlled hierarchy for file.
480;; 480;;
481;; - ignore (file &optional directory) 481;; - ignore (file &optional directory remove)
482;; 482;;
483;; Ignore FILE under DIRECTORY (default is 'default-directory'). 483;; Ignore FILE under DIRECTORY (default is 'default-directory').
484;; FILE is a file wildcard relative to DIRECTORY. 484;; FILE is a file wildcard relative to DIRECTORY.
@@ -487,7 +487,7 @@
487;; When called from Lisp code, if DIRECTORY is non-nil, the 487;; When called from Lisp code, if DIRECTORY is non-nil, the
488;; repository to use will be deduced by DIRECTORY. 488;; repository to use will be deduced by DIRECTORY.
489;; 489;;
490;; - ignore-completion-table 490;; - ignore-completion-table (directory)
491;; 491;;
492;; Return the completion table for files ignored by the current 492;; Return the completion table for files ignored by the current
493;; version control system, e.g., the entries in `.gitignore' and 493;; version control system, e.g., the entries in `.gitignore' and
diff --git a/lisp/wdired.el b/lisp/wdired.el
index ebe19613943..b7dd4ee9496 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -242,12 +242,12 @@ See `wdired-mode'."
242 (interactive) 242 (interactive)
243 (unless (derived-mode-p 'dired-mode) 243 (unless (derived-mode-p 'dired-mode)
244 (error "Not a Dired buffer")) 244 (error "Not a Dired buffer"))
245 (set (make-local-variable 'wdired-old-content) 245 (setq-local wdired-old-content
246 (buffer-substring (point-min) (point-max))) 246 (buffer-substring (point-min) (point-max)))
247 (set (make-local-variable 'wdired-old-marks) 247 (setq-local wdired-old-marks
248 (dired-remember-marks (point-min) (point-max))) 248 (dired-remember-marks (point-min) (point-max)))
249 (set (make-local-variable 'wdired-old-point) (point)) 249 (setq-local wdired-old-point (point))
250 (set (make-local-variable 'query-replace-skip-read-only) t) 250 (setq-local query-replace-skip-read-only t)
251 (add-function :after-while (local 'isearch-filter-predicate) 251 (add-function :after-while (local 'isearch-filter-predicate)
252 #'wdired-isearch-filter-read-only) 252 #'wdired-isearch-filter-read-only)
253 (use-local-map wdired-mode-map) 253 (use-local-map wdired-mode-map)
@@ -390,7 +390,7 @@ non-nil means return old filename."
390 (dired-advertise) 390 (dired-advertise)
391 (remove-hook 'kill-buffer-hook 'wdired-check-kill-buffer t) 391 (remove-hook 'kill-buffer-hook 'wdired-check-kill-buffer t)
392 (remove-hook 'after-change-functions 'wdired--restore-properties t) 392 (remove-hook 'after-change-functions 'wdired--restore-properties t)
393 (set (make-local-variable 'revert-buffer-function) 'dired-revert)) 393 (setq-local revert-buffer-function 'dired-revert))
394 394
395 395
396(defun wdired-abort-changes () 396(defun wdired-abort-changes ()
@@ -834,7 +834,7 @@ Like original function but it skips read-only words."
834;; original name and permissions as a property 834;; original name and permissions as a property
835(defun wdired-preprocess-perms () 835(defun wdired-preprocess-perms ()
836 (let ((inhibit-read-only t)) 836 (let ((inhibit-read-only t))
837 (set (make-local-variable 'wdired-col-perm) nil) 837 (setq-local wdired-col-perm nil)
838 (save-excursion 838 (save-excursion
839 (goto-char (point-min)) 839 (goto-char (point-min))
840 (while (not (eobp)) 840 (while (not (eobp))
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 02ee7bcf7fd..814f3e5a5f6 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -1986,13 +1986,13 @@ resultant list will be returned."
1986 ;; prepare local hooks 1986 ;; prepare local hooks
1987 (add-hook 'write-file-functions 'whitespace-write-file-hook nil t) 1987 (add-hook 'write-file-functions 'whitespace-write-file-hook nil t)
1988 ;; create whitespace local buffer environment 1988 ;; create whitespace local buffer environment
1989 (set (make-local-variable 'whitespace-font-lock-keywords) nil) 1989 (setq-local whitespace-font-lock-keywords nil)
1990 (set (make-local-variable 'whitespace-display-table) nil) 1990 (setq-local whitespace-display-table nil)
1991 (set (make-local-variable 'whitespace-display-table-was-local) nil) 1991 (setq-local whitespace-display-table-was-local nil)
1992 (set (make-local-variable 'whitespace-active-style) 1992 (setq-local whitespace-active-style
1993 (if (listp whitespace-style) 1993 (if (listp whitespace-style)
1994 whitespace-style 1994 whitespace-style
1995 (list whitespace-style))) 1995 (list whitespace-style)))
1996 ;; turn on whitespace 1996 ;; turn on whitespace
1997 (when whitespace-active-style 1997 (when whitespace-active-style
1998 (whitespace-color-on) 1998 (whitespace-color-on)
@@ -2034,19 +2034,14 @@ resultant list will be returned."
2034 "Turn on color visualization." 2034 "Turn on color visualization."
2035 (when (whitespace-style-face-p) 2035 (when (whitespace-style-face-p)
2036 ;; save current point and refontify when necessary 2036 ;; save current point and refontify when necessary
2037 (set (make-local-variable 'whitespace-point) 2037 (setq-local whitespace-point (point))
2038 (point))
2039 (setq whitespace-point--used 2038 (setq whitespace-point--used
2040 (let ((ol (make-overlay (point) (point) nil nil t))) 2039 (let ((ol (make-overlay (point) (point) nil nil t)))
2041 (delete-overlay ol) ol)) 2040 (delete-overlay ol) ol))
2042 (set (make-local-variable 'whitespace-font-lock-refontify) 2041 (setq-local whitespace-font-lock-refontify 0)
2043 0) 2042 (setq-local whitespace-bob-marker (point-min-marker))
2044 (set (make-local-variable 'whitespace-bob-marker) 2043 (setq-local whitespace-eob-marker (point-max-marker))
2045 (point-min-marker)) 2044 (setq-local whitespace-buffer-changed nil)
2046 (set (make-local-variable 'whitespace-eob-marker)
2047 (point-max-marker))
2048 (set (make-local-variable 'whitespace-buffer-changed)
2049 nil)
2050 (add-hook 'post-command-hook #'whitespace-post-command-hook nil t) 2045 (add-hook 'post-command-hook #'whitespace-post-command-hook nil t)
2051 (add-hook 'before-change-functions #'whitespace-buffer-changed nil t) 2046 (add-hook 'before-change-functions #'whitespace-buffer-changed nil t)
2052 ;; Add whitespace-mode color into font lock. 2047 ;; Add whitespace-mode color into font lock.
diff --git a/lisp/window.el b/lisp/window.el
index daa5c67df8b..67c3992c3f9 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -8390,9 +8390,9 @@ from the list of completions and default values."
8390 ;; here manually. 8390 ;; here manually.
8391 (if (and (boundp 'icomplete-with-completion-tables) 8391 (if (and (boundp 'icomplete-with-completion-tables)
8392 (listp icomplete-with-completion-tables)) 8392 (listp icomplete-with-completion-tables))
8393 (set (make-local-variable 'icomplete-with-completion-tables) 8393 (setq-local icomplete-with-completion-tables
8394 (cons rbts-completion-table 8394 (cons rbts-completion-table
8395 icomplete-with-completion-tables)))) 8395 icomplete-with-completion-tables))))
8396 (read-buffer prompt (other-buffer (current-buffer)) 8396 (read-buffer prompt (other-buffer (current-buffer))
8397 (confirm-nonexistent-file-or-buffer))))) 8397 (confirm-nonexistent-file-or-buffer)))))
8398 8398
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index caf57ae43fe..9d502d772bd 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -451,7 +451,7 @@ function findactiveelement(doc){
451XW is the xwidget identifier, TEXT is retrieved from the webkit." 451XW is the xwidget identifier, TEXT is retrieved from the webkit."
452 (switch-to-buffer 452 (switch-to-buffer
453 (generate-new-buffer "textarea")) 453 (generate-new-buffer "textarea"))
454 (set (make-local-variable 'xwidget-xwbl) xw) 454 (setq-local xwidget-xwbl xw)
455 (insert text)) 455 (insert text))
456 456
457(defun xwidget-webkit-end-edit-textarea () 457(defun xwidget-webkit-end-edit-textarea ()
diff --git a/lwlib/lwlib-utils.c b/lwlib/lwlib-utils.c
index f15cb603a80..2b3aa55c3e6 100644
--- a/lwlib/lwlib-utils.c
+++ b/lwlib/lwlib-utils.c
@@ -148,6 +148,7 @@ XftFont *
148crxft_font_open_name (Display *dpy, int screen, const char *name) 148crxft_font_open_name (Display *dpy, int screen, const char *name)
149{ 149{
150 XftFont *pub = NULL; 150 XftFont *pub = NULL;
151 FcPattern *match = NULL;
151 FcPattern *pattern = FcNameParse ((FcChar8 *) name); 152 FcPattern *pattern = FcNameParse ((FcChar8 *) name);
152 if (pattern) 153 if (pattern)
153 { 154 {
@@ -162,12 +163,18 @@ crxft_font_open_name (Display *dpy, int screen, const char *name)
162 FcPatternAddDouble (pattern, FC_DPI, dpi); 163 FcPatternAddDouble (pattern, FC_DPI, dpi);
163 } 164 }
164 FcDefaultSubstitute (pattern); 165 FcDefaultSubstitute (pattern);
166 FcResult result;
167 match = FcFontMatch (NULL, pattern, &result);
168 FcPatternDestroy (pattern);
169 }
170 if (match)
171 {
165 cairo_font_face_t *font_face 172 cairo_font_face_t *font_face
166 = cairo_ft_font_face_create_for_pattern (pattern); 173 = cairo_ft_font_face_create_for_pattern (match);
167 if (font_face) 174 if (font_face)
168 { 175 {
169 double pixel_size; 176 double pixel_size;
170 if ((FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &pixel_size) 177 if ((FcPatternGetDouble (match, FC_PIXEL_SIZE, 0, &pixel_size)
171 != FcResultMatch) 178 != FcResultMatch)
172 || pixel_size < 1) 179 || pixel_size < 1)
173 pixel_size = 10; 180 pixel_size = 10;
@@ -177,7 +184,7 @@ crxft_font_open_name (Display *dpy, int screen, const char *name)
177 cairo_matrix_init_scale (&font_matrix, pixel_size, pixel_size); 184 cairo_matrix_init_scale (&font_matrix, pixel_size, pixel_size);
178 cairo_matrix_init_identity (&ctm); 185 cairo_matrix_init_identity (&ctm);
179 cairo_font_options_t *options = cairo_font_options_create (); 186 cairo_font_options_t *options = cairo_font_options_create ();
180 cairo_ft_font_options_substitute (options, pattern); 187 cairo_ft_font_options_substitute (options, match);
181 pub->scaled_font = cairo_scaled_font_create (font_face, &font_matrix, 188 pub->scaled_font = cairo_scaled_font_create (font_face, &font_matrix,
182 &ctm, options); 189 &ctm, options);
183 cairo_font_face_destroy (font_face); 190 cairo_font_face_destroy (font_face);
@@ -190,7 +197,7 @@ crxft_font_open_name (Display *dpy, int screen, const char *name)
190 pub->height = lround (extents.height); 197 pub->height = lround (extents.height);
191 pub->max_advance_width = lround (extents.max_x_advance); 198 pub->max_advance_width = lround (extents.max_x_advance);
192 } 199 }
193 FcPatternDestroy (pattern); 200 FcPatternDestroy (match);
194 } 201 }
195 if (pub && pub->height <= 0) 202 if (pub && pub->height <= 0)
196 { 203 {
diff --git a/src/charset.c b/src/charset.c
index 520dd3a9605..f6b5173fad4 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -800,7 +800,9 @@ RANGE is a cons (FROM . TO), where FROM and TO indicate a range of
800characters contained in CHARSET. 800characters contained in CHARSET.
801 801
802The optional 4th and 5th arguments FROM-CODE and TO-CODE specify the 802The optional 4th and 5th arguments FROM-CODE and TO-CODE specify the
803range of code points (in CHARSET) of target characters. */) 803range of code points (in CHARSET) of target characters. Note that
804these are not character codes, but code points in CHARSET; for the
805difference see `decode-char' and `list-charset-chars'. */)
804 (Lisp_Object function, Lisp_Object charset, Lisp_Object arg, Lisp_Object from_code, Lisp_Object to_code) 806 (Lisp_Object function, Lisp_Object charset, Lisp_Object arg, Lisp_Object from_code, Lisp_Object to_code)
805{ 807{
806 struct charset *cs; 808 struct charset *cs;
diff --git a/src/chartab.c b/src/chartab.c
index cb2ced568d9..331e8595ebe 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),
1000 "mapping table" or a "deunifier table" of a certain charset. 1000 "mapping table" or a "deunifier table" of a certain charset.
1001 1001
1002 If CHARSET is not NULL (this is the case that `map-charset-chars' 1002 If CHARSET is not NULL (this is the case that `map-charset-chars'
1003 is called with non-nil FROM-CODE and TO-CODE), it is a charset who 1003 is called with non-nil FROM-CODE and TO-CODE), it is a charset that
1004 owns TABLE, and the function is called only on a character in the 1004 owns TABLE, and the function is called only for characters in the
1005 range FROM and TO. FROM and TO are not character codes, but code 1005 range FROM and TO. FROM and TO are not character codes, but code
1006 points of a character in CHARSET. 1006 points of characters in CHARSET (see 'decode-char').
1007 1007
1008 This function is called in these two cases: 1008 This function is called in these two cases:
1009 1009
diff --git a/src/data.c b/src/data.c
index fea39867c99..544b20d50cc 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1700,8 +1700,9 @@ default_value (Lisp_Object symbol)
1700 1700
1701DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0, 1701DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0,
1702 doc: /* Return t if SYMBOL has a non-void default value. 1702 doc: /* Return t if SYMBOL has a non-void default value.
1703This is the value that is seen in buffers that do not have their own values 1703A variable may have a buffer-local or a `let'-bound local value. This
1704for this variable. */) 1704function says whether the variable has a non-void value outside of the
1705current context. Also see `default-value'. */)
1705 (Lisp_Object symbol) 1706 (Lisp_Object symbol)
1706{ 1707{
1707 register Lisp_Object value; 1708 register Lisp_Object value;
diff --git a/src/emacs.c b/src/emacs.c
index afcdb667821..afdfcade777 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2398,10 +2398,13 @@ all of which are called before Emacs is actually killed. */
2398 /* Fsignal calls emacs_abort () if it sees that waiting_for_input is 2398 /* Fsignal calls emacs_abort () if it sees that waiting_for_input is
2399 set. */ 2399 set. */
2400 waiting_for_input = 0; 2400 waiting_for_input = 0;
2401 if (noninteractive) 2401 if (!NILP (find_symbol_value (Qkill_emacs_hook)))
2402 safe_run_hooks (Qkill_emacs_hook); 2402 {
2403 else 2403 if (noninteractive)
2404 run_hook (Qkill_emacs_hook); 2404 safe_run_hooks (Qkill_emacs_hook);
2405 else
2406 call1 (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook);
2407 }
2405 2408
2406#ifdef HAVE_X_WINDOWS 2409#ifdef HAVE_X_WINDOWS
2407 /* Transfer any clipboards we own to the clipboard manager. */ 2410 /* Transfer any clipboards we own to the clipboard manager. */
@@ -2927,6 +2930,8 @@ syms_of_emacs (void)
2927 DEFSYM (Qrisky_local_variable, "risky-local-variable"); 2930 DEFSYM (Qrisky_local_variable, "risky-local-variable");
2928 DEFSYM (Qkill_emacs, "kill-emacs"); 2931 DEFSYM (Qkill_emacs, "kill-emacs");
2929 DEFSYM (Qkill_emacs_hook, "kill-emacs-hook"); 2932 DEFSYM (Qkill_emacs_hook, "kill-emacs-hook");
2933 DEFSYM (Qrun_hook_query_error_with_timeout,
2934 "run-hook-query-error-with-timeout");
2930 2935
2931#ifdef HAVE_UNEXEC 2936#ifdef HAVE_UNEXEC
2932 defsubr (&Sdump_emacs); 2937 defsubr (&Sdump_emacs);
diff --git a/src/eval.c b/src/eval.c
index fb747c58838..2b31b91175b 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1799,7 +1799,8 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool keyboard_quit)
1799 debugging. Make sure to use `debug' unconditionally to not interfere with 1799 debugging. Make sure to use `debug' unconditionally to not interfere with
1800 ERT or other packages that install custom debuggers. */ 1800 ERT or other packages that install custom debuggers. */
1801 if (!debugger_called && !NILP (error_symbol) 1801 if (!debugger_called && !NILP (error_symbol)
1802 && (NILP (clause) || EQ (h->tag_or_ch, Qerror)) && noninteractive) 1802 && (NILP (clause) || EQ (h->tag_or_ch, Qerror)) && noninteractive
1803 && backtrace_on_error_noninteractive)
1803 { 1804 {
1804 ptrdiff_t count = SPECPDL_INDEX (); 1805 ptrdiff_t count = SPECPDL_INDEX ();
1805 specbind (Vdebugger, Qdebug); 1806 specbind (Vdebugger, Qdebug);
@@ -4344,6 +4345,14 @@ Note that `debug-on-error', `debug-on-quit' and friends
4344still determine whether to handle the particular condition. */); 4345still determine whether to handle the particular condition. */);
4345 Vdebug_on_signal = Qnil; 4346 Vdebug_on_signal = Qnil;
4346 4347
4348 DEFVAR_BOOL ("backtrace-on-error-noninteractive",
4349 backtrace_on_error_noninteractive,
4350 doc: /* Non-nil means print backtrace on error in batch mode.
4351If this is nil, errors in batch mode will just print the error
4352message upon encountering an unhandled error, without showing
4353the Lisp backtrace. */);
4354 backtrace_on_error_noninteractive = true;
4355
4347 /* The value of num_nonmacro_input_events as of the last time we 4356 /* The value of num_nonmacro_input_events as of the last time we
4348 started to enter the debugger. If we decide to enter the debugger 4357 started to enter the debugger. If we decide to enter the debugger
4349 again when this is still equal to num_nonmacro_input_events, then we 4358 again when this is still equal to num_nonmacro_input_events, then we
diff --git a/src/fileio.c b/src/fileio.c
index 283813ff89e..702c1438283 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3757,9 +3757,10 @@ characters in the buffer. If VISIT is non-nil, BEG and END must be nil.
3757If optional fifth argument REPLACE is non-nil, replace the current 3757If optional fifth argument REPLACE is non-nil, replace the current
3758buffer contents (in the accessible portion) with the file contents. 3758buffer contents (in the accessible portion) with the file contents.
3759This is better than simply deleting and inserting the whole thing 3759This is better than simply deleting and inserting the whole thing
3760because (1) it preserves some marker positions and (2) it puts less data 3760because (1) it preserves some marker positions (in unchanged portions
3761in the undo list. When REPLACE is non-nil, the second return value is 3761at the start and end of the buffer) and (2) it puts less data in the
3762the number of characters that replace previous buffer contents. 3762undo list. When REPLACE is non-nil, the second return value is the
3763number of characters that replace previous buffer contents.
3763 3764
3764This function does code conversion according to the value of 3765This function does code conversion according to the value of
3765`coding-system-for-read' or `file-coding-system-alist', and sets the 3766`coding-system-for-read' or `file-coding-system-alist', and sets the
diff --git a/src/fns.c b/src/fns.c
index e4c9acc3163..f77092972ab 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4525,18 +4525,40 @@ sweep_weak_table (struct Lisp_Hash_Table *h, bool remove_entries_p)
4525EMACS_UINT 4525EMACS_UINT
4526hash_string (char const *ptr, ptrdiff_t len) 4526hash_string (char const *ptr, ptrdiff_t len)
4527{ 4527{
4528 char const *p = ptr; 4528 if (len < 16)
4529 char const *end = p + len;
4530 unsigned char c;
4531 EMACS_UINT hash = 0;
4532
4533 while (p != end)
4534 { 4529 {
4535 c = *p++; 4530 char const *p = ptr;
4536 hash = sxhash_combine (hash, c); 4531 char const *end = p + len;
4532 EMACS_UINT hash = len;
4533
4534 while (p < end)
4535 {
4536 unsigned char c = *p++;
4537 hash = sxhash_combine (hash, c);
4538 }
4539
4540 return hash;
4537 } 4541 }
4542 else
4543 {
4544 EMACS_UINT const *p = (EMACS_UINT const *) ptr;
4545 EMACS_UINT const *end = (EMACS_UINT const *) (ptr + len);
4546 EMACS_UINT hash = len;
4547 /* At most 8 steps. We could reuse SXHASH_MAX_LEN, of course,
4548 * but dividing by 8 is cheaper. */
4549 ptrdiff_t step = max (1, (end - p) >> 3);
4550
4551 /* Beware: `end` might be unaligned, so `p < end` is not always the same
4552 * as `p <= end - 1`. */
4553 while (p <= end - 1)
4554 {
4555 EMACS_UINT c = *p;
4556 p += step;
4557 hash = sxhash_combine (hash, c);
4558 }
4538 4559
4539 return hash; 4560 return hash;
4561 }
4540} 4562}
4541 4563
4542/* Return a hash for string PTR which has length LEN. The hash 4564/* Return a hash for string PTR which has length LEN. The hash
@@ -5418,7 +5440,8 @@ disregarding any coding systems. If nil, use the current buffer.
5418 5440
5419This function is useful for comparing two buffers running in the same 5441This function is useful for comparing two buffers running in the same
5420Emacs, but is not guaranteed to return the same hash between different 5442Emacs, but is not guaranteed to return the same hash between different
5421Emacs versions. 5443Emacs versions. It should be somewhat more efficient on larger
5444buffers than `secure-hash' is, and should not allocate more memory.
5422 5445
5423It should not be used for anything security-related. See 5446It should not be used for anything security-related. See
5424`secure-hash' for these applications. */ ) 5447`secure-hash' for these applications. */ )
@@ -5551,6 +5574,40 @@ Case is always significant and text properties are ignored. */)
5551 5574
5552 return make_int (string_byte_to_char (haystack, res - SSDATA (haystack))); 5575 return make_int (string_byte_to_char (haystack, res - SSDATA (haystack)));
5553} 5576}
5577
5578static void
5579collect_interval (INTERVAL interval, Lisp_Object collector)
5580{
5581 nconc2 (collector,
5582 list1(list3 (make_fixnum (interval->position),
5583 make_fixnum (interval->position + LENGTH (interval)),
5584 interval->plist)));
5585}
5586
5587DEFUN ("object-intervals", Fobject_intervals, Sobject_intervals, 1, 1, 0,
5588 doc: /* Return a copy of the text properties of OBJECT.
5589OBJECT must be a buffer or a string.
5590
5591Altering this copy does not change the layout of the text properties
5592in OBJECT. */)
5593 (register Lisp_Object object)
5594{
5595 Lisp_Object collector = Fcons (Qnil, Qnil);
5596 INTERVAL intervals;
5597
5598 if (STRINGP (object))
5599 intervals = string_intervals (object);
5600 else if (BUFFERP (object))
5601 intervals = buffer_intervals (XBUFFER (object));
5602 else
5603 wrong_type_argument (Qbuffer_or_string_p, object);
5604
5605 if (! intervals)
5606 return Qnil;
5607
5608 traverse_intervals (intervals, 0, collect_interval, collector);
5609 return CDR (collector);
5610}
5554 5611
5555 5612
5556void 5613void
@@ -5592,6 +5649,7 @@ syms_of_fns (void)
5592 defsubr (&Smaphash); 5649 defsubr (&Smaphash);
5593 defsubr (&Sdefine_hash_table_test); 5650 defsubr (&Sdefine_hash_table_test);
5594 defsubr (&Sstring_search); 5651 defsubr (&Sstring_search);
5652 defsubr (&Sobject_intervals);
5595 5653
5596 /* Crypto and hashing stuff. */ 5654 /* Crypto and hashing stuff. */
5597 DEFSYM (Qiv_auto, "iv-auto"); 5655 DEFSYM (Qiv_auto, "iv-auto");
diff --git a/src/frame.c b/src/frame.c
index 17ec455d2d6..164c05cae85 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3577,7 +3577,9 @@ window managers may refuse to honor a HEIGHT that is not an integer
3577multiple of the default frame font height. 3577multiple of the default frame font height.
3578 3578
3579When called interactively, HEIGHT is the numeric prefix and the 3579When called interactively, HEIGHT is the numeric prefix and the
3580currently selected frame will be set to this height. */) 3580currently selected frame will be set to this height.
3581
3582If FRAME is nil, it defaults to the selected frame. */)
3581 (Lisp_Object frame, Lisp_Object height, Lisp_Object pretend, Lisp_Object pixelwise) 3583 (Lisp_Object frame, Lisp_Object height, Lisp_Object pretend, Lisp_Object pixelwise)
3582{ 3584{
3583 struct frame *f = decode_live_frame (frame); 3585 struct frame *f = decode_live_frame (frame);
@@ -3600,7 +3602,9 @@ window managers may refuse to honor a WIDTH that is not an integer
3600multiple of the default frame font width. 3602multiple of the default frame font width.
3601 3603
3602When called interactively, WIDTH is the numeric prefix and the 3604When called interactively, WIDTH is the numeric prefix and the
3603currently selected frame will be set to this width. */) 3605currently selected frame will be set to this width.
3606
3607If FRAME is nil, it defaults to the selected frame. */)
3604 (Lisp_Object frame, Lisp_Object width, Lisp_Object pretend, Lisp_Object pixelwise) 3608 (Lisp_Object frame, Lisp_Object width, Lisp_Object pretend, Lisp_Object pixelwise)
3605{ 3609{
3606 struct frame *f = decode_live_frame (frame); 3610 struct frame *f = decode_live_frame (frame);
@@ -3616,7 +3620,9 @@ Optional argument PIXELWISE non-nil means to measure in pixels. Note:
3616When `frame-resize-pixelwise' is nil, some window managers may refuse to 3620When `frame-resize-pixelwise' is nil, some window managers may refuse to
3617honor a WIDTH that is not an integer multiple of the default frame font 3621honor a WIDTH that is not an integer multiple of the default frame font
3618width or a HEIGHT that is not an integer multiple of the default frame 3622width or a HEIGHT that is not an integer multiple of the default frame
3619font height. */) 3623font height.
3624
3625If FRAME is nil, it defaults to the selected frame. */)
3620 (Lisp_Object frame, Lisp_Object width, Lisp_Object height, Lisp_Object pixelwise) 3626 (Lisp_Object frame, Lisp_Object width, Lisp_Object height, Lisp_Object pixelwise)
3621{ 3627{
3622 struct frame *f = decode_live_frame (frame); 3628 struct frame *f = decode_live_frame (frame);
diff --git a/src/image.c b/src/image.c
index 5eb41322950..6b85ab78f61 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1592,17 +1592,6 @@ make_image_cache (void)
1592 return c; 1592 return c;
1593} 1593}
1594 1594
1595/* Compare two lists (one of which must be proper), comparing each
1596 element with `eq'. */
1597static bool
1598equal_lists (Lisp_Object a, Lisp_Object b)
1599{
1600 while (CONSP (a) && CONSP (b) && EQ (XCAR (a), XCAR (b)))
1601 a = XCDR (a), b = XCDR (b);
1602
1603 return EQ (a, b);
1604}
1605
1606/* Find an image matching SPEC in the cache, and return it. If no 1595/* Find an image matching SPEC in the cache, and return it. If no
1607 image is found, return NULL. */ 1596 image is found, return NULL. */
1608static struct image * 1597static struct image *
@@ -1630,7 +1619,7 @@ search_image_cache (struct frame *f, Lisp_Object spec, EMACS_UINT hash,
1630 1619
1631 for (img = c->buckets[i]; img; img = img->next) 1620 for (img = c->buckets[i]; img; img = img->next)
1632 if (img->hash == hash 1621 if (img->hash == hash
1633 && equal_lists (img->spec, spec) 1622 && !NILP (Fequal (img->spec, spec))
1634 && (ignore_colors || (img->face_foreground == foreground 1623 && (ignore_colors || (img->face_foreground == foreground
1635 && img->face_background == background))) 1624 && img->face_background == background)))
1636 break; 1625 break;
@@ -1644,12 +1633,13 @@ static void
1644uncache_image (struct frame *f, Lisp_Object spec) 1633uncache_image (struct frame *f, Lisp_Object spec)
1645{ 1634{
1646 struct image *img; 1635 struct image *img;
1636 EMACS_UINT hash = sxhash (spec);
1647 1637
1648 /* Because the background colors are based on the current face, we 1638 /* Because the background colors are based on the current face, we
1649 can have multiple copies of an image with the same spec. We want 1639 can have multiple copies of an image with the same spec. We want
1650 to remove them all to ensure the user doesn't see an old version 1640 to remove them all to ensure the user doesn't see an old version
1651 of the image when the face changes. */ 1641 of the image when the face changes. */
1652 while ((img = search_image_cache (f, spec, sxhash (spec), 0, 0, true))) 1642 while ((img = search_image_cache (f, spec, hash, 0, 0, true)))
1653 { 1643 {
1654 free_image (f, img); 1644 free_image (f, img);
1655 /* As display glyphs may still be referring to the image ID, we 1645 /* As display glyphs may still be referring to the image ID, we
@@ -1802,6 +1792,55 @@ which is then usually a filename. */)
1802 return Qnil; 1792 return Qnil;
1803} 1793}
1804 1794
1795static size_t
1796image_frame_cache_size (struct frame *f)
1797{
1798 size_t total = 0;
1799#if defined USE_CAIRO
1800 struct image_cache *c = FRAME_IMAGE_CACHE (f);
1801
1802 if (!c)
1803 return 0;
1804
1805 for (ptrdiff_t i = 0; i < c->used; ++i)
1806 {
1807 struct image *img = c->images[i];
1808
1809 if (img && img->pixmap && img->pixmap != NO_PIXMAP)
1810 total += img->pixmap->width * img->pixmap->height *
1811 img->pixmap->bits_per_pixel / 8;
1812 }
1813#elif defined HAVE_NTGUI
1814 struct image_cache *c = FRAME_IMAGE_CACHE (f);
1815
1816 if (!c)
1817 return 0;
1818
1819 for (ptrdiff_t i = 0; i < c->used; ++i)
1820 {
1821 struct image *img = c->images[i];
1822
1823 if (img && img->pixmap && img->pixmap != NO_PIXMAP)
1824 total += w32_image_size (img);
1825 }
1826#endif
1827 return total;
1828}
1829
1830DEFUN ("image-cache-size", Fimage_cache_size, Simage_cache_size, 0, 0, 0,
1831 doc: /* Return the size of the image cache. */)
1832 (void)
1833{
1834 Lisp_Object tail, frame;
1835 size_t total = 0;
1836
1837 FOR_EACH_FRAME (tail, frame)
1838 if (FRAME_WINDOW_P (XFRAME (frame)))
1839 total += image_frame_cache_size (XFRAME (frame));
1840
1841 return make_int (total);
1842}
1843
1805 1844
1806DEFUN ("image-flush", Fimage_flush, Simage_flush, 1845DEFUN ("image-flush", Fimage_flush, Simage_flush,
1807 1, 2, 0, 1846 1, 2, 0,
@@ -9453,6 +9492,7 @@ enum svg_keyword_index
9453 SVG_TYPE, 9492 SVG_TYPE,
9454 SVG_DATA, 9493 SVG_DATA,
9455 SVG_FILE, 9494 SVG_FILE,
9495 SVG_BASE_URI,
9456 SVG_ASCENT, 9496 SVG_ASCENT,
9457 SVG_MARGIN, 9497 SVG_MARGIN,
9458 SVG_RELIEF, 9498 SVG_RELIEF,
@@ -9472,6 +9512,7 @@ static const struct image_keyword svg_format[SVG_LAST] =
9472 {":type", IMAGE_SYMBOL_VALUE, 1}, 9512 {":type", IMAGE_SYMBOL_VALUE, 1},
9473 {":data", IMAGE_STRING_VALUE, 0}, 9513 {":data", IMAGE_STRING_VALUE, 0},
9474 {":file", IMAGE_STRING_VALUE, 0}, 9514 {":file", IMAGE_STRING_VALUE, 0},
9515 {":base-uri", IMAGE_STRING_VALUE, 0},
9475 {":ascent", IMAGE_ASCENT_VALUE, 0}, 9516 {":ascent", IMAGE_ASCENT_VALUE, 0},
9476 {":margin", IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR, 0}, 9517 {":margin", IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR, 0},
9477 {":relief", IMAGE_INTEGER_VALUE, 0}, 9518 {":relief", IMAGE_INTEGER_VALUE, 0},
@@ -9544,6 +9585,9 @@ DEF_DLL_FN (gboolean, rsvg_handle_write,
9544DEF_DLL_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **)); 9585DEF_DLL_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **));
9545# endif 9586# endif
9546 9587
9588DEF_DLL_FN (void, rsvg_handle_set_dpi_x_y,
9589 (RsvgHandle * handle, double dpi_x, double dpi_y));
9590
9547# if LIBRSVG_CHECK_VERSION (2, 46, 0) 9591# if LIBRSVG_CHECK_VERSION (2, 46, 0)
9548DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions, 9592DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions,
9549 (RsvgHandle *, gboolean *, RsvgLength *, gboolean *, 9593 (RsvgHandle *, gboolean *, RsvgLength *, gboolean *,
@@ -9600,6 +9644,7 @@ init_svg_functions (void)
9600 LOAD_DLL_FN (library, rsvg_handle_write); 9644 LOAD_DLL_FN (library, rsvg_handle_write);
9601 LOAD_DLL_FN (library, rsvg_handle_close); 9645 LOAD_DLL_FN (library, rsvg_handle_close);
9602#endif 9646#endif
9647 LOAD_DLL_FN (library, rsvg_handle_set_dpi_x_y);
9603#if LIBRSVG_CHECK_VERSION (2, 46, 0) 9648#if LIBRSVG_CHECK_VERSION (2, 46, 0)
9604 LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions); 9649 LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions);
9605 LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer); 9650 LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer);
@@ -9655,6 +9700,7 @@ init_svg_functions (void)
9655# undef rsvg_handle_set_base_uri 9700# undef rsvg_handle_set_base_uri
9656# undef rsvg_handle_write 9701# undef rsvg_handle_write
9657# endif 9702# endif
9703# undef rsvg_handle_set_dpi_x_y
9658 9704
9659# define gdk_pixbuf_get_bits_per_sample fn_gdk_pixbuf_get_bits_per_sample 9705# define gdk_pixbuf_get_bits_per_sample fn_gdk_pixbuf_get_bits_per_sample
9660# define gdk_pixbuf_get_colorspace fn_gdk_pixbuf_get_colorspace 9706# define gdk_pixbuf_get_colorspace fn_gdk_pixbuf_get_colorspace
@@ -9688,6 +9734,7 @@ init_svg_functions (void)
9688# define rsvg_handle_set_base_uri fn_rsvg_handle_set_base_uri 9734# define rsvg_handle_set_base_uri fn_rsvg_handle_set_base_uri
9689# define rsvg_handle_write fn_rsvg_handle_write 9735# define rsvg_handle_write fn_rsvg_handle_write
9690# endif 9736# endif
9737# define rsvg_handle_set_dpi_x_y fn_rsvg_handle_set_dpi_x_y
9691 9738
9692# endif /* !WINDOWSNT */ 9739# endif /* !WINDOWSNT */
9693 9740
@@ -9698,10 +9745,11 @@ static bool
9698svg_load (struct frame *f, struct image *img) 9745svg_load (struct frame *f, struct image *img)
9699{ 9746{
9700 bool success_p = 0; 9747 bool success_p = 0;
9701 Lisp_Object file_name; 9748 Lisp_Object file_name, base_uri;
9702 9749
9703 /* If IMG->spec specifies a file name, create a non-file spec from it. */ 9750 /* If IMG->spec specifies a file name, create a non-file spec from it. */
9704 file_name = image_spec_value (img->spec, QCfile, NULL); 9751 file_name = image_spec_value (img->spec, QCfile, NULL);
9752 base_uri = image_spec_value (img->spec, QCbase_uri, NULL);
9705 if (STRINGP (file_name)) 9753 if (STRINGP (file_name))
9706 { 9754 {
9707 int fd; 9755 int fd;
@@ -9721,15 +9769,16 @@ svg_load (struct frame *f, struct image *img)
9721 return 0; 9769 return 0;
9722 } 9770 }
9723 /* If the file was slurped into memory properly, parse it. */ 9771 /* If the file was slurped into memory properly, parse it. */
9724 success_p = svg_load_image (f, img, contents, size, 9772 if (!STRINGP (base_uri))
9725 SSDATA (ENCODE_FILE (file))); 9773 base_uri = ENCODE_FILE (file);
9774 success_p = svg_load_image (f, img, contents, size, SSDATA (base_uri));
9726 xfree (contents); 9775 xfree (contents);
9727 } 9776 }
9728 /* Else it's not a file, it's a Lisp object. Load the image from a 9777 /* Else it's not a file, it's a Lisp object. Load the image from a
9729 Lisp object rather than a file. */ 9778 Lisp object rather than a file. */
9730 else 9779 else
9731 { 9780 {
9732 Lisp_Object data, original_filename; 9781 Lisp_Object data;
9733 9782
9734 data = image_spec_value (img->spec, QCdata, NULL); 9783 data = image_spec_value (img->spec, QCdata, NULL);
9735 if (!STRINGP (data)) 9784 if (!STRINGP (data))
@@ -9737,10 +9786,10 @@ svg_load (struct frame *f, struct image *img)
9737 image_error ("Invalid image data `%s'", data); 9786 image_error ("Invalid image data `%s'", data);
9738 return 0; 9787 return 0;
9739 } 9788 }
9740 original_filename = BVAR (current_buffer, filename); 9789 if (!STRINGP (base_uri))
9790 base_uri = BVAR (current_buffer, filename);
9741 success_p = svg_load_image (f, img, SSDATA (data), SBYTES (data), 9791 success_p = svg_load_image (f, img, SSDATA (data), SBYTES (data),
9742 (NILP (original_filename) ? NULL 9792 (NILP (base_uri) ? NULL : SSDATA (base_uri)));
9743 : SSDATA (original_filename)));
9744 } 9793 }
9745 9794
9746 return success_p; 9795 return success_p;
@@ -9748,11 +9797,8 @@ svg_load (struct frame *f, struct image *img)
9748 9797
9749#if LIBRSVG_CHECK_VERSION (2, 46, 0) 9798#if LIBRSVG_CHECK_VERSION (2, 46, 0)
9750static double 9799static double
9751svg_css_length_to_pixels (RsvgLength length) 9800svg_css_length_to_pixels (RsvgLength length, double dpi)
9752{ 9801{
9753 /* FIXME: 96 appears to be a pretty standard DPI but we should
9754 probably use the real DPI if we can get it. */
9755 double dpi = 96;
9756 double value = length.length; 9802 double value = length.length;
9757 9803
9758 switch (length.unit) 9804 switch (length.unit)
@@ -9826,6 +9872,9 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
9826 rsvg_handle = rsvg_handle_new_from_stream_sync (input_stream, base_file, 9872 rsvg_handle = rsvg_handle_new_from_stream_sync (input_stream, base_file,
9827 RSVG_HANDLE_FLAGS_NONE, 9873 RSVG_HANDLE_FLAGS_NONE,
9828 NULL, &err); 9874 NULL, &err);
9875 rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
9876 FRAME_DISPLAY_INFO (f)->resy);
9877
9829 if (base_file) 9878 if (base_file)
9830 g_object_unref (base_file); 9879 g_object_unref (base_file);
9831 g_object_unref (input_stream); 9880 g_object_unref (input_stream);
@@ -9837,7 +9886,11 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
9837 rsvg_handle = rsvg_handle_new (); 9886 rsvg_handle = rsvg_handle_new ();
9838 eassume (rsvg_handle); 9887 eassume (rsvg_handle);
9839 9888
9889 rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
9890 FRAME_DISPLAY_INFO (f)->resy);
9891
9840 /* Set base_uri for properly handling referenced images (via 'href'). 9892 /* Set base_uri for properly handling referenced images (via 'href').
9893 Can be explicitly specified using `:base_uri' image property.
9841 See rsvg bug 596114 - "image refs are relative to curdir, not .svg file" 9894 See rsvg bug 596114 - "image refs are relative to curdir, not .svg file"
9842 <https://gitlab.gnome.org/GNOME/librsvg/issues/33>. */ 9895 <https://gitlab.gnome.org/GNOME/librsvg/issues/33>. */
9843 if (filename) 9896 if (filename)
@@ -9860,6 +9913,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
9860 /* Try the instrinsic dimensions first. */ 9913 /* Try the instrinsic dimensions first. */
9861 gboolean has_width, has_height, has_viewbox; 9914 gboolean has_width, has_height, has_viewbox;
9862 RsvgLength iwidth, iheight; 9915 RsvgLength iwidth, iheight;
9916 double dpi = FRAME_DISPLAY_INFO (f)->resx;
9863 9917
9864 rsvg_handle_get_intrinsic_dimensions (rsvg_handle, 9918 rsvg_handle_get_intrinsic_dimensions (rsvg_handle,
9865 &has_width, &iwidth, 9919 &has_width, &iwidth,
@@ -9869,19 +9923,19 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
9869 if (has_width && has_height) 9923 if (has_width && has_height)
9870 { 9924 {
9871 /* Success! We can use these values directly. */ 9925 /* Success! We can use these values directly. */
9872 viewbox_width = svg_css_length_to_pixels (iwidth); 9926 viewbox_width = svg_css_length_to_pixels (iwidth, dpi);
9873 viewbox_height = svg_css_length_to_pixels (iheight); 9927 viewbox_height = svg_css_length_to_pixels (iheight, dpi);
9874 } 9928 }
9875 else if (has_width && has_viewbox) 9929 else if (has_width && has_viewbox)
9876 { 9930 {
9877 viewbox_width = svg_css_length_to_pixels (iwidth); 9931 viewbox_width = svg_css_length_to_pixels (iwidth, dpi);
9878 viewbox_height = svg_css_length_to_pixels (iwidth) 9932 viewbox_height = svg_css_length_to_pixels (iwidth, dpi)
9879 * viewbox.width / viewbox.height; 9933 * viewbox.width / viewbox.height;
9880 } 9934 }
9881 else if (has_height && has_viewbox) 9935 else if (has_height && has_viewbox)
9882 { 9936 {
9883 viewbox_height = svg_css_length_to_pixels (iheight); 9937 viewbox_height = svg_css_length_to_pixels (iheight, dpi);
9884 viewbox_width = svg_css_length_to_pixels (iheight) 9938 viewbox_width = svg_css_length_to_pixels (iheight, dpi)
9885 * viewbox.height / viewbox.width; 9939 * viewbox.height / viewbox.width;
9886 } 9940 }
9887 else if (has_viewbox) 9941 else if (has_viewbox)
@@ -9990,6 +10044,10 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
9990 rsvg_handle = rsvg_handle_new_from_stream_sync (input_stream, base_file, 10044 rsvg_handle = rsvg_handle_new_from_stream_sync (input_stream, base_file,
9991 RSVG_HANDLE_FLAGS_NONE, 10045 RSVG_HANDLE_FLAGS_NONE,
9992 NULL, &err); 10046 NULL, &err);
10047
10048 rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
10049 FRAME_DISPLAY_INFO (f)->resy);
10050
9993 if (base_file) 10051 if (base_file)
9994 g_object_unref (base_file); 10052 g_object_unref (base_file);
9995 g_object_unref (input_stream); 10053 g_object_unref (input_stream);
@@ -10001,7 +10059,11 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
10001 rsvg_handle = rsvg_handle_new (); 10059 rsvg_handle = rsvg_handle_new ();
10002 eassume (rsvg_handle); 10060 eassume (rsvg_handle);
10003 10061
10062 rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
10063 FRAME_DISPLAY_INFO (f)->resy);
10064
10004 /* Set base_uri for properly handling referenced images (via 'href'). 10065 /* Set base_uri for properly handling referenced images (via 'href').
10066 Can be explicitly specified using `:base_uri' image property.
10005 See rsvg bug 596114 - "image refs are relative to curdir, not .svg file" 10067 See rsvg bug 596114 - "image refs are relative to curdir, not .svg file"
10006 <https://gitlab.gnome.org/GNOME/librsvg/issues/33>. */ 10068 <https://gitlab.gnome.org/GNOME/librsvg/issues/33>. */
10007 if (filename) 10069 if (filename)
@@ -10684,6 +10746,7 @@ non-numeric, there is no explicit limit on the size of images. */);
10684 10746
10685#if defined (HAVE_RSVG) 10747#if defined (HAVE_RSVG)
10686 DEFSYM (Qsvg, "svg"); 10748 DEFSYM (Qsvg, "svg");
10749 DEFSYM (QCbase_uri, ":base-uri");
10687 add_image_type (Qsvg); 10750 add_image_type (Qsvg);
10688#ifdef HAVE_NTGUI 10751#ifdef HAVE_NTGUI
10689 /* Other libraries used directly by svg code. */ 10752 /* Other libraries used directly by svg code. */
@@ -10713,6 +10776,7 @@ non-numeric, there is no explicit limit on the size of images. */);
10713 defsubr (&Simage_size); 10776 defsubr (&Simage_size);
10714 defsubr (&Simage_mask_p); 10777 defsubr (&Simage_mask_p);
10715 defsubr (&Simage_metadata); 10778 defsubr (&Simage_metadata);
10779 defsubr (&Simage_cache_size);
10716 10780
10717#ifdef GLYPH_DEBUG 10781#ifdef GLYPH_DEBUG
10718 defsubr (&Simagep); 10782 defsubr (&Simagep);
diff --git a/src/lisp.h b/src/lisp.h
index a5a90cce1b4..5900b8d25e4 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1900,16 +1900,17 @@ ASCII_CHAR_P (intmax_t c)
1900 return 0 <= c && c < 0x80; 1900 return 0 <= c && c < 0x80;
1901} 1901}
1902 1902
1903/* A char-table is a kind of vectorlike, with contents are like a 1903/* A char-table is a kind of vectorlike, with contents like a vector,
1904 vector but with a few other slots. For some purposes, it makes 1904 but with a few additional slots. For some purposes, it makes sense
1905 sense to handle a char-table with type struct Lisp_Vector. An 1905 to handle a char-table as type 'struct Lisp_Vector'. An element of
1906 element of a char table can be any Lisp objects, but if it is a sub 1906 a char-table can be any Lisp object, but if it is a sub-char-table,
1907 char-table, we treat it a table that contains information of a 1907 we treat it as a table that contains information of a specific
1908 specific range of characters. A sub char-table is like a vector but 1908 range of characters. A sub-char-table is like a vector, but with
1909 with two integer fields between the header and Lisp data, which means 1909 two integer fields between the header and Lisp data, which means
1910 that it has to be marked with some precautions (see mark_char_table 1910 that it has to be marked with some precautions (see mark_char_table
1911 in alloc.c). A sub char-table appears only in an element of a char-table, 1911 in alloc.c). A sub-char-table appears only in an element of a
1912 and there's no way to access it directly from Emacs Lisp program. */ 1912 char-table, and there's no way to access it directly from a Lisp
1913 program. */
1913 1914
1914enum CHARTAB_SIZE_BITS 1915enum CHARTAB_SIZE_BITS
1915 { 1916 {
@@ -1929,11 +1930,11 @@ struct Lisp_Char_Table
1929 contents, and extras slots. */ 1930 contents, and extras slots. */
1930 union vectorlike_header header; 1931 union vectorlike_header header;
1931 1932
1932 /* This holds a default value, 1933 /* This holds the default value, which is used whenever the value
1933 which is used whenever the value for a specific character is nil. */ 1934 for a specific character is nil. */
1934 Lisp_Object defalt; 1935 Lisp_Object defalt;
1935 1936
1936 /* This points to another char table, which we inherit from when the 1937 /* This points to another char table, from which we inherit when the
1937 value for a specific character is nil. The `defalt' slot takes 1938 value for a specific character is nil. The `defalt' slot takes
1938 precedence over this. */ 1939 precedence over this. */
1939 Lisp_Object parent; 1940 Lisp_Object parent;
@@ -1942,8 +1943,8 @@ struct Lisp_Char_Table
1942 meant for. */ 1943 meant for. */
1943 Lisp_Object purpose; 1944 Lisp_Object purpose;
1944 1945
1945 /* The bottom sub char-table for characters of the range 0..127. It 1946 /* The bottom sub char-table for characters in the range 0..127. It
1946 is nil if none of ASCII character has a specific value. */ 1947 is nil if no ASCII character has a specific value. */
1947 Lisp_Object ascii; 1948 Lisp_Object ascii;
1948 1949
1949 Lisp_Object contents[(1 << CHARTAB_SIZE_BITS_0)]; 1950 Lisp_Object contents[(1 << CHARTAB_SIZE_BITS_0)];
@@ -2018,7 +2019,7 @@ CHAR_TABLE_REF_ASCII (Lisp_Object ct, ptrdiff_t idx)
2018} 2019}
2019 2020
2020/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII 2021/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII
2021 characters. Do not check validity of CT. */ 2022 characters. Does not check validity of CT. */
2022INLINE Lisp_Object 2023INLINE Lisp_Object
2023CHAR_TABLE_REF (Lisp_Object ct, int idx) 2024CHAR_TABLE_REF (Lisp_Object ct, int idx)
2024{ 2025{
@@ -2028,7 +2029,7 @@ CHAR_TABLE_REF (Lisp_Object ct, int idx)
2028} 2029}
2029 2030
2030/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and 2031/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and
2031 8-bit European characters. Do not check validity of CT. */ 2032 8-bit European characters. Does not check validity of CT. */
2032INLINE void 2033INLINE void
2033CHAR_TABLE_SET (Lisp_Object ct, int idx, Lisp_Object val) 2034CHAR_TABLE_SET (Lisp_Object ct, int idx, Lisp_Object val)
2034{ 2035{
diff --git a/src/nsterm.m b/src/nsterm.m
index 0729c961bdf..7972fa4dabb 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1166,7 +1166,6 @@ ns_update_end (struct frame *f)
1166 { 1166 {
1167#endif 1167#endif
1168 [NSGraphicsContext setCurrentContext:nil]; 1168 [NSGraphicsContext setCurrentContext:nil];
1169 [view setNeedsDisplay:YES];
1170#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400 1169#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
1171 } 1170 }
1172 else 1171 else
@@ -3056,7 +3055,7 @@ ns_clear_under_internal_border (struct frame *f)
3056 if (!face) 3055 if (!face)
3057 return; 3056 return;
3058 3057
3059 ns_focus (f, &frame_rect, 1); 3058 ns_focus (f, NULL, 1);
3060 [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set]; 3059 [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set];
3061 for (int i = 0; i < 4 ; i++) 3060 for (int i = 0; i < 4 ; i++)
3062 { 3061 {
@@ -4987,8 +4986,8 @@ ns_set_vertical_scroll_bar (struct window *window,
4987 [bar removeFromSuperview]; 4986 [bar removeFromSuperview];
4988 wset_vertical_scroll_bar (window, Qnil); 4987 wset_vertical_scroll_bar (window, Qnil);
4989 [bar release]; 4988 [bar release];
4989 ns_clear_frame_area (f, left, top, width, height);
4990 } 4990 }
4991 ns_clear_frame_area (f, left, top, width, height);
4992 unblock_input (); 4991 unblock_input ();
4993 return; 4992 return;
4994 } 4993 }
@@ -5010,7 +5009,7 @@ ns_set_vertical_scroll_bar (struct window *window,
5010 r.size.width = oldRect.size.width; 5009 r.size.width = oldRect.size.width;
5011 if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r)) 5010 if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r))
5012 { 5011 {
5013 if (oldRect.origin.x != r.origin.x) 5012 if (! NSEqualRects (oldRect, r))
5014 ns_clear_frame_area (f, left, top, width, height); 5013 ns_clear_frame_area (f, left, top, width, height);
5015 [bar setFrame: r]; 5014 [bar setFrame: r];
5016 } 5015 }
@@ -5088,8 +5087,7 @@ ns_set_horizontal_scroll_bar (struct window *window,
5088 oldRect = [bar frame]; 5087 oldRect = [bar frame];
5089 if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r)) 5088 if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r))
5090 { 5089 {
5091 if (oldRect.origin.y != r.origin.y) 5090 ns_clear_frame_area (f, left, top, width, height);
5092 ns_clear_frame_area (f, left, top, width, height);
5093 [bar setFrame: r]; 5091 [bar setFrame: r];
5094 update_p = YES; 5092 update_p = YES;
5095 } 5093 }
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 971a5f63749..904ca0c7b95 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -3575,9 +3575,11 @@ skip_noops (re_char *p, re_char *pend)
3575 opcode. When the function finishes, *PP will be advanced past that opcode. 3575 opcode. When the function finishes, *PP will be advanced past that opcode.
3576 C is character to test (possibly after translations) and CORIG is original 3576 C is character to test (possibly after translations) and CORIG is original
3577 character (i.e. without any translations). UNIBYTE denotes whether c is 3577 character (i.e. without any translations). UNIBYTE denotes whether c is
3578 unibyte or multibyte character. */ 3578 unibyte or multibyte character.
3579 CANON_TABLE is the canonicalisation table for case folding or Qnil. */
3579static bool 3580static bool
3580execute_charset (re_char **pp, int c, int corig, bool unibyte) 3581execute_charset (re_char **pp, int c, int corig, bool unibyte,
3582 Lisp_Object canon_table)
3581{ 3583{
3582 eassume (0 <= c && 0 <= corig); 3584 eassume (0 <= c && 0 <= corig);
3583 re_char *p = *pp, *rtp = NULL; 3585 re_char *p = *pp, *rtp = NULL;
@@ -3617,11 +3619,9 @@ execute_charset (re_char **pp, int c, int corig, bool unibyte)
3617 (class_bits & BIT_BLANK && ISBLANK (c)) || 3619 (class_bits & BIT_BLANK && ISBLANK (c)) ||
3618 (class_bits & BIT_WORD && ISWORD (c)) || 3620 (class_bits & BIT_WORD && ISWORD (c)) ||
3619 ((class_bits & BIT_UPPER) && 3621 ((class_bits & BIT_UPPER) &&
3620 (ISUPPER (c) || (corig != c && 3622 (ISUPPER (corig) || (!NILP (canon_table) && ISLOWER (corig)))) ||
3621 c == downcase (corig) && ISLOWER (c)))) ||
3622 ((class_bits & BIT_LOWER) && 3623 ((class_bits & BIT_LOWER) &&
3623 (ISLOWER (c) || (corig != c && 3624 (ISLOWER (corig) || (!NILP (canon_table) && ISUPPER (corig)))) ||
3624 c == upcase (corig) && ISUPPER(c)))) ||
3625 (class_bits & BIT_PUNCT && ISPUNCT (c)) || 3625 (class_bits & BIT_PUNCT && ISPUNCT (c)) ||
3626 (class_bits & BIT_GRAPH && ISGRAPH (c)) || 3626 (class_bits & BIT_GRAPH && ISGRAPH (c)) ||
3627 (class_bits & BIT_PRINT && ISPRINT (c))) 3627 (class_bits & BIT_PRINT && ISPRINT (c)))
@@ -3696,7 +3696,8 @@ mutually_exclusive_p (struct re_pattern_buffer *bufp, re_char *p1,
3696 else if ((re_opcode_t) *p1 == charset 3696 else if ((re_opcode_t) *p1 == charset
3697 || (re_opcode_t) *p1 == charset_not) 3697 || (re_opcode_t) *p1 == charset_not)
3698 { 3698 {
3699 if (!execute_charset (&p1, c, c, !multibyte || ASCII_CHAR_P (c))) 3699 if (!execute_charset (&p1, c, c, !multibyte || ASCII_CHAR_P (c),
3700 Qnil))
3700 { 3701 {
3701 DEBUG_PRINT (" No match => fast loop.\n"); 3702 DEBUG_PRINT (" No match => fast loop.\n");
3702 return true; 3703 return true;
@@ -4367,7 +4368,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp,
4367 } 4368 }
4368 4369
4369 p -= 1; 4370 p -= 1;
4370 if (!execute_charset (&p, c, corig, unibyte_char)) 4371 if (!execute_charset (&p, c, corig, unibyte_char, translate))
4371 goto fail; 4372 goto fail;
4372 4373
4373 d += len; 4374 d += len;
diff --git a/src/w32gui.h b/src/w32gui.h
index dfec1f08617..fc8131130fb 100644
--- a/src/w32gui.h
+++ b/src/w32gui.h
@@ -46,6 +46,7 @@ extern int w32_load_image (struct frame *f, struct image *img,
46 Lisp_Object spec_file, Lisp_Object spec_data); 46 Lisp_Object spec_file, Lisp_Object spec_data);
47extern bool w32_can_use_native_image_api (Lisp_Object); 47extern bool w32_can_use_native_image_api (Lisp_Object);
48extern void w32_gdiplus_shutdown (void); 48extern void w32_gdiplus_shutdown (void);
49extern size_t w32_image_size (struct image *);
49 50
50#define FACE_DEFAULT (~0) 51#define FACE_DEFAULT (~0)
51 52
diff --git a/src/w32term.c b/src/w32term.c
index 23cb380040b..dc5cd1f6997 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1991,6 +1991,17 @@ w32_draw_image_foreground (struct glyph_string *s)
1991 RestoreDC (s->hdc ,-1); 1991 RestoreDC (s->hdc ,-1);
1992} 1992}
1993 1993
1994size_t
1995w32_image_size (struct image *img)
1996{
1997 BITMAP bm_info;
1998 size_t rv = 0;
1999
2000 if (GetObject (img->pixmap, sizeof (BITMAP), &bm_info))
2001 rv = bm_info.bmWidth * bm_info.bmHeight * bm_info.bmBitsPixel / 8;
2002 return rv;
2003}
2004
1994 2005
1995/* Draw a relief around the image glyph string S. */ 2006/* Draw a relief around the image glyph string S. */
1996 2007
diff --git a/src/window.c b/src/window.c
index 6cd3122b43b..8e75e460b2b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5669,7 +5669,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
5669 if (whole) 5669 if (whole)
5670 { 5670 {
5671 ptrdiff_t start_pos = IT_CHARPOS (it); 5671 ptrdiff_t start_pos = IT_CHARPOS (it);
5672 int dy = frame_line_height; 5672 int flh = frame_line_height;
5673 int ht = window_box_height (w); 5673 int ht = window_box_height (w);
5674 int nscls = sanitize_next_screen_context_lines (); 5674 int nscls = sanitize_next_screen_context_lines ();
5675 /* In the below we divide the window box height by the frame's 5675 /* In the below we divide the window box height by the frame's
@@ -5677,14 +5677,37 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
5677 box is not an integral multiple of the line height. This is 5677 box is not an integral multiple of the line height. This is
5678 important to ensure we get back to the same position when 5678 important to ensure we get back to the same position when
5679 scrolling up, then down. */ 5679 scrolling up, then down. */
5680 dy = n * max (dy, (ht / dy - nscls) * dy); 5680 int dy = n * max (flh, (ht / flh - nscls) * flh);
5681 int goal_y;
5682 void *it_data;
5681 5683
5682 /* Note that move_it_vertically always moves the iterator to the 5684 /* Note that move_it_vertically always moves the iterator to the
5683 start of a line. So, if the last line doesn't have a newline, 5685 start of a line. So, if the last line doesn't have a newline,
5684 we would end up at the start of the line ending at ZV. */ 5686 we would end up at the start of the line ending at ZV. */
5685 if (dy <= 0) 5687 if (dy <= 0)
5686 { 5688 {
5689 goal_y = it.current_y - dy;
5687 move_it_vertically_backward (&it, -dy); 5690 move_it_vertically_backward (&it, -dy);
5691 /* Extra precision for people who want us to preserve the
5692 screen position of the cursor: effectively round DY to the
5693 nearest screen line, instead of rounding to zero; the latter
5694 causes point to move by one line after C-v followed by M-v,
5695 if the buffer has lines of different height. */
5696 if (!NILP (Vscroll_preserve_screen_position)
5697 && it.current_y - goal_y > 0.5 * flh)
5698 {
5699 it_data = bidi_shelve_cache ();
5700 struct it it2 = it;
5701
5702 move_it_by_lines (&it, -1);
5703 if (it.current_y < goal_y - 0.5 * flh)
5704 {
5705 it = it2;
5706 bidi_unshelve_cache (it_data, false);
5707 }
5708 else
5709 bidi_unshelve_cache (it_data, true);
5710 }
5688 /* Ensure we actually do move, e.g. in case we are currently 5711 /* Ensure we actually do move, e.g. in case we are currently
5689 looking at an image that is taller that the window height. */ 5712 looking at an image that is taller that the window height. */
5690 while (start_pos == IT_CHARPOS (it) 5713 while (start_pos == IT_CHARPOS (it)
@@ -5693,8 +5716,25 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
5693 } 5716 }
5694 else if (dy > 0) 5717 else if (dy > 0)
5695 { 5718 {
5696 move_it_to (&it, ZV, -1, it.current_y + dy, -1, 5719 goal_y = it.current_y + dy;
5697 MOVE_TO_POS | MOVE_TO_Y); 5720 move_it_to (&it, ZV, -1, goal_y, -1, MOVE_TO_POS | MOVE_TO_Y);
5721 /* See the comment above, for the reasons of this
5722 extra-precision. */
5723 if (!NILP (Vscroll_preserve_screen_position)
5724 && goal_y - it.current_y > 0.5 * flh)
5725 {
5726 it_data = bidi_shelve_cache ();
5727 struct it it2 = it;
5728
5729 move_it_by_lines (&it, 1);
5730 if (it.current_y > goal_y + 0.5 * flh)
5731 {
5732 it = it2;
5733 bidi_unshelve_cache (it_data, false);
5734 }
5735 else
5736 bidi_unshelve_cache (it_data, true);
5737 }
5698 /* Ensure we actually do move, e.g. in case we are currently 5738 /* Ensure we actually do move, e.g. in case we are currently
5699 looking at an image that is taller that the window height. */ 5739 looking at an image that is taller that the window height. */
5700 while (start_pos == IT_CHARPOS (it) 5740 while (start_pos == IT_CHARPOS (it)
@@ -8206,11 +8246,17 @@ is displayed in the `mode-line' face. */);
8206 DEFVAR_LISP ("scroll-preserve-screen-position", 8246 DEFVAR_LISP ("scroll-preserve-screen-position",
8207 Vscroll_preserve_screen_position, 8247 Vscroll_preserve_screen_position,
8208 doc: /* Controls if scroll commands move point to keep its screen position unchanged. 8248 doc: /* Controls if scroll commands move point to keep its screen position unchanged.
8249
8209A value of nil means point does not keep its screen position except 8250A value of nil means point does not keep its screen position except
8210at the scroll margin or window boundary respectively. 8251at the scroll margin or window boundary respectively.
8252
8211A value of t means point keeps its screen position if the scroll 8253A value of t means point keeps its screen position if the scroll
8212command moved it vertically out of the window, e.g. when scrolling 8254command moved it vertically out of the window, e.g. when scrolling
8213by full screens. 8255by full screens. If point is within `next-screen-context-lines' lines
8256from the edges of the window, point will typically not keep its screen
8257position when doing commands like `scroll-up-command'/`scroll-down-command'
8258and the like.
8259
8214Any other value means point always keeps its screen position. 8260Any other value means point always keeps its screen position.
8215Scroll commands should have the `scroll-command' property 8261Scroll commands should have the `scroll-command' property
8216on their symbols to be controlled by this variable. */); 8262on their symbols to be controlled by this variable. */);
diff --git a/src/xdisp.c b/src/xdisp.c
index ed1d4761b95..689b87df421 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1925,12 +1925,12 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
1925 /* If it3_moved stays false after the 'while' loop 1925 /* If it3_moved stays false after the 'while' loop
1926 below, that means we already were at a newline 1926 below, that means we already were at a newline
1927 before the loop (e.g., the display string begins 1927 before the loop (e.g., the display string begins
1928 with a newline), so we don't need to (and cannot) 1928 with a newline), so we don't need to return to
1929 inspect the glyphs of it3.glyph_row, because 1929 the last position before the display string,
1930 PRODUCE_GLYPHS will not produce anything for a 1930 because PRODUCE_GLYPHS will not produce anything
1931 newline, and thus it3.glyph_row stays at its 1931 for a newline. */
1932 stale content it got at top of the window. */
1933 bool it3_moved = false; 1932 bool it3_moved = false;
1933 int top_x_before_string = it3.current_x;
1934 /* Finally, advance the iterator until we hit the 1934 /* Finally, advance the iterator until we hit the
1935 first display element whose character position is 1935 first display element whose character position is
1936 CHARPOS, or until the first newline from the 1936 CHARPOS, or until the first newline from the
@@ -1938,6 +1938,8 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
1938 display line. */ 1938 display line. */
1939 while (get_next_display_element (&it3)) 1939 while (get_next_display_element (&it3))
1940 { 1940 {
1941 if (!EQ (it3.object, string))
1942 top_x_before_string = it3.current_x;
1941 PRODUCE_GLYPHS (&it3); 1943 PRODUCE_GLYPHS (&it3);
1942 if (IT_CHARPOS (it3) == charpos 1944 if (IT_CHARPOS (it3) == charpos
1943 || ITERATOR_AT_END_OF_LINE_P (&it3)) 1945 || ITERATOR_AT_END_OF_LINE_P (&it3))
@@ -1952,32 +1954,26 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
1952 if (!it3.line_number_produced_p) 1954 if (!it3.line_number_produced_p)
1953 { 1955 {
1954 if (it3.lnum_pixel_width > 0) 1956 if (it3.lnum_pixel_width > 0)
1955 top_x += it3.lnum_pixel_width; 1957 {
1958 top_x += it3.lnum_pixel_width;
1959 top_x_before_string += it3.lnum_pixel_width;
1960 }
1956 else if (it.line_number_produced_p) 1961 else if (it.line_number_produced_p)
1957 top_x += it.lnum_pixel_width; 1962 {
1963 top_x += it.lnum_pixel_width;
1964 top_x_before_string += it3.lnum_pixel_width;
1965 }
1958 } 1966 }
1959 /* Normally, we would exit the above loop because we 1967 /* Normally, we would exit the above loop because we
1960 found the display element whose character 1968 found the display element whose character
1961 position is CHARPOS. For the contingency that we 1969 position is CHARPOS. For the contingency that we
1962 didn't, and stopped at the first newline from the 1970 didn't, and stopped at the first newline from the
1963 display string, move back over the glyphs 1971 display string, reset top_x to the coordinate of
1964 produced from the string, until we find the 1972 the rightmost glyph not from the string. */
1965 rightmost glyph not from the string. */
1966 if (it3_moved 1973 if (it3_moved
1967 && newline_in_string 1974 && newline_in_string
1968 && IT_CHARPOS (it3) != charpos && EQ (it3.object, string)) 1975 && IT_CHARPOS (it3) != charpos && EQ (it3.object, string))
1969 { 1976 top_x = top_x_before_string;
1970 struct glyph *g = it3.glyph_row->glyphs[TEXT_AREA]
1971 + it3.glyph_row->used[TEXT_AREA];
1972
1973 while (EQ ((g - 1)->object, string))
1974 {
1975 --g;
1976 top_x -= g->pixel_width;
1977 }
1978 eassert (g < it3.glyph_row->glyphs[TEXT_AREA]
1979 + it3.glyph_row->used[TEXT_AREA]);
1980 }
1981 } 1977 }
1982 } 1978 }
1983 1979
diff --git a/test/README b/test/README
index d0da89d1c2c..3365f18cf7e 100644
--- a/test/README
+++ b/test/README
@@ -113,7 +113,8 @@ $EMACS_HYDRA_CI indicates the hydra environment, and $EMACS_EMBA_CI
113indicates the emba environment, respectively. 113indicates the emba environment, respectively.
114 114
115 115
116(Also, see etc/compilation.txt for compilation mode font lock tests.) 116(Also, see etc/compilation.txt for compilation mode font lock tests
117and etc/grep.txt for grep mode font lock tests.)
117 118
118 119
119This file is part of GNU Emacs. 120This file is part of GNU Emacs.
diff --git a/test/lisp/abbrev-tests.el b/test/lisp/abbrev-tests.el
index aaf1d4a5b5c..288ea1ae987 100644
--- a/test/lisp/abbrev-tests.el
+++ b/test/lisp/abbrev-tests.el
@@ -69,8 +69,9 @@
69 (define-abbrev ert-test-abbrevs "sys" "system abbrev" nil :system t) 69 (define-abbrev ert-test-abbrevs "sys" "system abbrev" nil :system t)
70 (should (equal (mapcar #'symbol-name (abbrev--table-symbols 'ert-test-abbrevs)) 70 (should (equal (mapcar #'symbol-name (abbrev--table-symbols 'ert-test-abbrevs))
71 '("a-e-t"))) 71 '("a-e-t")))
72 (should (equal (mapcar #'symbol-name (abbrev--table-symbols 'ert-test-abbrevs t)) 72 (let ((syms (abbrev--table-symbols 'ert-test-abbrevs t)))
73 '("a-e-t" "sys"))))) 73 (should (equal (sort (mapcar #'symbol-name syms) #'string<)
74 '("a-e-t" "sys"))))))
74 75
75(ert-deftest abbrev-table-get-put-test () 76(ert-deftest abbrev-table-get-put-test ()
76 (let ((table (make-abbrev-table))) 77 (let ((table (make-abbrev-table)))
diff --git a/test/lisp/allout-tests.el b/test/lisp/allout-tests.el
index f7cd6db9cd4..c979d085c89 100644
--- a/test/lisp/allout-tests.el
+++ b/test/lisp/allout-tests.el
@@ -74,7 +74,7 @@
74 "Ensure that prior local value is resumed." 74 "Ensure that prior local value is resumed."
75 (with-temp-buffer 75 (with-temp-buffer
76 (allout-tests-obliterate-variable 'allout-tests-locally-true) 76 (allout-tests-obliterate-variable 'allout-tests-locally-true)
77 (set (make-local-variable 'allout-tests-locally-true) t) 77 (setq-local allout-tests-locally-true t)
78 (cl-assert (not (default-boundp 'allout-tests-locally-true)) 78 (cl-assert (not (default-boundp 'allout-tests-locally-true))
79 nil (concat "Test setup mistake -- variable supposed to" 79 nil (concat "Test setup mistake -- variable supposed to"
80 " not have global binding, but it does.")) 80 " not have global binding, but it does."))
@@ -98,7 +98,7 @@
98 (allout-tests-obliterate-variable 'allout-tests-globally-true) 98 (allout-tests-obliterate-variable 'allout-tests-globally-true)
99 (setq allout-tests-globally-true t) 99 (setq allout-tests-globally-true t)
100 (allout-tests-obliterate-variable 'allout-tests-locally-true) 100 (allout-tests-obliterate-variable 'allout-tests-locally-true)
101 (set (make-local-variable 'allout-tests-locally-true) t) 101 (setq-local allout-tests-locally-true t)
102 (allout-add-resumptions '(allout-tests-globally-unbound t) 102 (allout-add-resumptions '(allout-tests-globally-unbound t)
103 '(allout-tests-globally-true nil) 103 '(allout-tests-globally-true nil)
104 '(allout-tests-locally-true nil)) 104 '(allout-tests-locally-true nil))
@@ -135,7 +135,7 @@
135 (allout-tests-obliterate-variable 'allout-tests-globally-true) 135 (allout-tests-obliterate-variable 'allout-tests-globally-true)
136 (setq allout-tests-globally-true t) 136 (setq allout-tests-globally-true t)
137 (allout-tests-obliterate-variable 'allout-tests-locally-true) 137 (allout-tests-obliterate-variable 'allout-tests-locally-true)
138 (set (make-local-variable 'allout-tests-locally-true) t) 138 (setq-local allout-tests-locally-true t)
139 (allout-add-resumptions '(allout-tests-globally-unbound t) 139 (allout-add-resumptions '(allout-tests-globally-unbound t)
140 '(allout-tests-globally-true nil) 140 '(allout-tests-globally-true nil)
141 '(allout-tests-locally-true nil)) 141 '(allout-tests-locally-true nil))
diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el
index 8aae26a1aca..2c340c44408 100644
--- a/test/lisp/emacs-lisp/edebug-tests.el
+++ b/test/lisp/emacs-lisp/edebug-tests.el
@@ -97,7 +97,10 @@ back to the top level.")
97 97
98 ;; sit-on interferes with keyboard macros. 98 ;; sit-on interferes with keyboard macros.
99 (edebug-sit-on-break nil) 99 (edebug-sit-on-break nil)
100 (edebug-continue-kbd-macro t)) 100 (edebug-continue-kbd-macro t)
101
102 ;; don't print backtraces, otherwise error messages don't match
103 (backtrace-on-error-noninteractive nil))
101 ,@body)) 104 ,@body))
102 105
103(defmacro edebug-tests-with-normal-env (&rest body) 106(defmacro edebug-tests-with-normal-env (&rest body)
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el
index 1f54c8d07e4..a0c56be0cb0 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -806,6 +806,16 @@ This macro is used to test if macroexpansion in `should' works."
806 :expected-result :failed ;; FIXME! Bug#11218 806 :expected-result :failed ;; FIXME! Bug#11218
807 (should-not (with-demoted-errors (error "Foo")))) 807 (should-not (with-demoted-errors (error "Foo"))))
808 808
809(ert-deftest ert-test-fail-inside-should ()
810 "Check that `ert-fail' inside `should' works correctly."
811 (let ((result (ert-run-test
812 (make-ert-test
813 :name 'test-1
814 :body (lambda () (should (integerp (ert-fail "Boo"))))))))
815 (should (ert-test-failed-p result))
816 (should (equal (ert-test-failed-condition result)
817 '(ert-test-failed ("Boo"))))))
818
809 819
810(provide 'ert-tests) 820(provide 'ert-tests)
811 821
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 c77f2dc4990..6e9d50fc38f 100644
--- a/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el
+++ b/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el
@@ -67,8 +67,8 @@ If `prog-mode' is defined, inherit from it."
67 67
68(faceup-test-define-prog-mode faceup-test-mode "faceup-test" 68(faceup-test-define-prog-mode faceup-test-mode "faceup-test"
69 "Dummy major mode for testing `faceup', a test system for font-lock." 69 "Dummy major mode for testing `faceup', a test system for font-lock."
70 (set (make-local-variable 'syntax-propertize-function) 70 (setq-local syntax-propertize-function
71 #'faceup-test-syntax-propertize) 71 #'faceup-test-syntax-propertize)
72 (setq font-lock-defaults '(faceup-test-font-lock-keywords nil))) 72 (setq font-lock-defaults '(faceup-test-font-lock-keywords nil)))
73 73
74(provide 'faceup-test-mode) 74(provide 'faceup-test-mode)
diff --git a/test/lisp/emacs-lisp/gv-tests.el b/test/lisp/emacs-lisp/gv-tests.el
index 29e4273b478..8fc6b514692 100644
--- a/test/lisp/emacs-lisp/gv-tests.el
+++ b/test/lisp/emacs-lisp/gv-tests.el
@@ -83,7 +83,10 @@
83 (with-temp-buffer 83 (with-temp-buffer
84 (call-process (concat invocation-directory invocation-name) 84 (call-process (concat invocation-directory invocation-name)
85 nil '(t t) nil 85 nil '(t t) nil
86 "-Q" "-batch" "--eval" (prin1-to-string `(byte-compile-file ,el)) 86 "-Q" "-batch"
87 "--eval" (prin1-to-string
88 `(let ((backtrace-on-error-noninteractive nil))
89 (byte-compile-file ,el)))
87 "-l" elc) 90 "-l" elc)
88 (should (equal (buffer-string) 91 (should (equal (buffer-string)
89 "Symbol's function definition is void: \\(setf\\ gv-test-foo\\)\n"))))) 92 "Symbol's function definition is void: \\(setf\\ gv-test-foo\\)\n")))))
@@ -133,8 +136,10 @@
133 "-Q" "-batch" "--eval" (prin1-to-string `(byte-compile-file ,el)) 136 "-Q" "-batch" "--eval" (prin1-to-string `(byte-compile-file ,el))
134 "-l" elc 137 "-l" elc
135 "--eval" 138 "--eval"
136 (prin1-to-string '(progn (setf (gv-test-foo gv-test-pair) 99) 139 (prin1-to-string
137 (message "%d" (car gv-test-pair))))) 140 '(let ((backtrace-on-error-noninteractive nil))
141 (setf (gv-test-foo gv-test-pair) 99)
142 (message "%d" (car gv-test-pair)))))
138 (should (string-match 143 (should (string-match
139 "\\`Symbol.s function definition is void: \\\\(setf\\\\ gv-test-foo\\\\)\n\\'" 144 "\\`Symbol.s function definition is void: \\\\(setf\\\\ gv-test-foo\\\\)\n\\'"
140 (buffer-string)))))) 145 (buffer-string))))))
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 00000000000..b67ec6c0103
--- /dev/null
+++ b/test/lisp/emacs-lisp/memory-report-tests.el
@@ -0,0 +1,57 @@
1;;; memory-report-tests.el --- tests for memory-report.el -*- lexical-binding: t -*-
2
3;; Copyright (C) 2020 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20(require 'ert)
21(require 'memory-report)
22
23(defun setup-memory-report-tests ()
24 ;; Set the sizes on things based on a 64-bit architecture. (We're
25 ;; hard-coding this to be able to write simple tests that'll work on
26 ;; all architectures.)
27 (memory-report--set-size
28 '((conses 16 499173 99889)
29 (symbols 48 22244 3)
30 (strings 32 92719 4559)
31 (string-bytes 1 40402011)
32 (vectors 16 31919)
33 (vector-slots 8 385148 149240)
34 (floats 8 434 4519)
35 (intervals 56 24499 997)
36 (buffers 984 33))))
37
38(ert-deftest memory-report-sizes ()
39 (setup-memory-report-tests)
40 (should (equal (memory-report-object-size (cons nil nil)) 16))
41 (should (equal (memory-report-object-size (cons 1 2)) 16))
42
43 (should (equal (memory-report-object-size (list 1 2)) 32))
44 (should (equal (memory-report-object-size (list 1)) 16))
45
46 (should (equal (memory-report-object-size (list 'foo)) 16))
47
48 (should (equal (memory-report-object-size (vector 1 2 3 4)) 80))
49
50 (should (equal (memory-report-object-size "") 32))
51 (should (equal (memory-report-object-size "a") 33))
52 (should (equal (memory-report-object-size (propertize "a" 'face 'foo))
53 81)))
54
55(provide 'memory-report-tests)
56
57;;; memory-report-tests.el ends here
diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el
index c9c92f529be..87d19e8b294 100644
--- a/test/lisp/epg-tests.el
+++ b/test/lisp/epg-tests.el
@@ -96,8 +96,7 @@
96 context 96 context
97 (ert-resource-file "seckey.asc"))) 97 (ert-resource-file "seckey.asc")))
98 (with-temp-buffer 98 (with-temp-buffer
99 (make-local-variable 'epg-tests-context) 99 (setq-local epg-tests-context context)
100 (setq epg-tests-context context)
101 ,@body)) 100 ,@body))
102 (when (file-directory-p epg-tests-home-directory) 101 (when (file-directory-p epg-tests-home-directory)
103 (delete-directory epg-tests-home-directory t))))) 102 (delete-directory epg-tests-home-directory t)))))
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index 268c3185bc6..25017dd3261 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -108,11 +108,8 @@ There are different timeouts for local and remote file notification libraries."
108 ;; gio/gpollfilemonitor.c declares POLL_TIME_SECS 5. So we must 108 ;; gio/gpollfilemonitor.c declares POLL_TIME_SECS 5. So we must
109 ;; wait at least this time in the GPollFileMonitor case. A 109 ;; wait at least this time in the GPollFileMonitor case. A
110 ;; similar timeout seems to be needed in the GFamFileMonitor case, 110 ;; similar timeout seems to be needed in the GFamFileMonitor case,
111 ;; at least on Cygwin. 111 ;; at least on cygwin.
112 ((and (string-equal (file-notify--test-library) "gfilenotify") 112 ((memq (file-notify--test-monitor) '(GFamFileMonitor GPollFileMonitor)) 7)
113 (memq (file-notify--test-monitor)
114 '(GFamFileMonitor GPollFileMonitor)))
115 7)
116 ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe") 1) 113 ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe") 1)
117 ((file-remote-p temporary-file-directory) 0.1) 114 ((file-remote-p temporary-file-directory) 0.1)
118 (t 0.01)))) 115 (t 0.01))))
@@ -264,13 +261,19 @@ This returns only for the local case and gfilenotify; otherwise it is nil.
264 ;; We cache the result, because after `file-notify-rm-watch', 261 ;; We cache the result, because after `file-notify-rm-watch',
265 ;; `gfile-monitor-name' does not return a proper result anymore. 262 ;; `gfile-monitor-name' does not return a proper result anymore.
266 ;; But we still need this information. 263 ;; But we still need this information.
267 (unless (file-remote-p temporary-file-directory) 264 ;; So far, we know the monitors GFamFileMonitor, GFenFileMonitor,
268 (or (cdr (assq file-notify--test-desc file-notify--test-monitors)) 265 ;; GInotifyFileMonitor, GKqueueFileMonitor and GPollFileMonitor.
269 (when (functionp 'gfile-monitor-name) 266 (or (cdr (assq file-notify--test-desc file-notify--test-monitors))
270 (add-to-list 'file-notify--test-monitors 267 (progn
271 (cons file-notify--test-desc 268 (add-to-list
272 (gfile-monitor-name file-notify--test-desc))) 269 'file-notify--test-monitors
273 (cdr (assq file-notify--test-desc file-notify--test-monitors)))))) 270 (cons file-notify--test-desc
271 (if (file-remote-p temporary-file-directory)
272 (tramp-get-connection-property
273 file-notify--test-desc "gio-file-monitor" nil)
274 (and (functionp 'gfile-monitor-name)
275 (gfile-monitor-name file-notify--test-desc)))))
276 (cdr (assq file-notify--test-desc file-notify--test-monitors)))))
274 277
275(defmacro file-notify--deftest-remote (test docstring &optional unstable) 278(defmacro file-notify--deftest-remote (test docstring &optional unstable)
276 "Define ert `TEST-remote' for remote files. 279 "Define ert `TEST-remote' for remote files.
@@ -457,7 +460,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
457 460
458 (unwind-protect 461 (unwind-protect
459 ;; Check, that removing watch descriptors out of order do not 462 ;; Check, that removing watch descriptors out of order do not
460 ;; harm. This fails on Cygwin because of timing issues unless a 463 ;; harm. This fails on cygwin because of timing issues unless a
461 ;; long `sit-for' is added before the call to 464 ;; long `sit-for' is added before the call to
462 ;; `file-notify--test-read-event'. 465 ;; `file-notify--test-read-event'.
463 (unless (eq system-type 'cygwin) 466 (unless (eq system-type 'cygwin)
@@ -631,13 +634,15 @@ delivered."
631 (cond 634 (cond
632 ;; gvfs-monitor-dir on cygwin does not detect the 635 ;; gvfs-monitor-dir on cygwin does not detect the
633 ;; `created' event reliably. 636 ;; `created' event reliably.
634 ((string-equal 637 ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe")
635 (file-notify--test-library) "gvfs-monitor-dir.exe")
636 '((deleted stopped) 638 '((deleted stopped)
637 (created deleted stopped))) 639 (created deleted stopped)))
638 ;; cygwin does not raise a `changed' event. 640 ;; cygwin does not raise a `changed' event.
639 ((eq system-type 'cygwin) 641 ((eq system-type 'cygwin)
640 '(created deleted stopped)) 642 '(created deleted stopped))
643 ;; GKqueueFileMonitor does not report the `changed' event.
644 ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
645 '(created deleted stopped))
641 (t '(created changed deleted stopped))) 646 (t '(created changed deleted stopped)))
642 (write-region 647 (write-region
643 "another text" nil file-notify--test-tmpfile nil 'no-message) 648 "another text" nil file-notify--test-tmpfile nil 'no-message)
@@ -668,6 +673,9 @@ delivered."
668 ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe") 673 ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe")
669 '((deleted stopped) 674 '((deleted stopped)
670 (changed deleted stopped))) 675 (changed deleted stopped)))
676 ;; GKqueueFileMonitor does not report the `changed' event.
677 ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
678 '(deleted stopped))
671 ;; There could be one or two `changed' events. 679 ;; There could be one or two `changed' events.
672 (t '((changed deleted stopped) 680 (t '((changed deleted stopped)
673 (changed changed deleted stopped)))) 681 (changed changed deleted stopped))))
@@ -718,6 +726,9 @@ delivered."
718 '(created deleted stopped)) 726 '(created deleted stopped))
719 ((string-equal (file-notify--test-library) "kqueue") 727 ((string-equal (file-notify--test-library) "kqueue")
720 '(created changed deleted stopped)) 728 '(created changed deleted stopped))
729 ;; GKqueueFileMonitor does not report the `changed' event.
730 ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
731 '(created deleted deleted stopped))
721 (t '(created changed deleted deleted stopped))) 732 (t '(created changed deleted deleted stopped)))
722 (write-region 733 (write-region
723 "any text" nil file-notify--test-tmpfile nil 'no-message) 734 "any text" nil file-notify--test-tmpfile nil 'no-message)
@@ -767,6 +778,9 @@ delivered."
767 ;; directory are not detected. 778 ;; directory are not detected.
768 ((getenv "EMACS_EMBA_CI") 779 ((getenv "EMACS_EMBA_CI")
769 '(created changed created changed deleted deleted)) 780 '(created changed created changed deleted deleted))
781 ;; GKqueueFileMonitor does not report the `changed' event.
782 ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
783 '(created created deleted deleted deleted stopped))
770 (t '(created changed created changed 784 (t '(created changed created changed
771 deleted deleted deleted stopped))) 785 deleted deleted deleted stopped)))
772 (write-region 786 (write-region
@@ -823,6 +837,9 @@ delivered."
823 '(created created deleted deleted stopped)) 837 '(created created deleted deleted stopped))
824 ((string-equal (file-notify--test-library) "kqueue") 838 ((string-equal (file-notify--test-library) "kqueue")
825 '(created changed renamed deleted stopped)) 839 '(created changed renamed deleted stopped))
840 ;; GKqueueFileMonitor does not report the `changed' event.
841 ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
842 '(created renamed deleted deleted stopped))
826 (t '(created changed renamed deleted deleted stopped))) 843 (t '(created changed renamed deleted deleted stopped)))
827 (write-region 844 (write-region
828 "any text" nil file-notify--test-tmpfile nil 'no-message) 845 "any text" nil file-notify--test-tmpfile nil 'no-message)
@@ -859,6 +876,8 @@ delivered."
859 ((string-equal (file-notify--test-library) "w32notify") 876 ((string-equal (file-notify--test-library) "w32notify")
860 '((changed changed) 877 '((changed changed)
861 (changed changed changed changed))) 878 (changed changed changed changed)))
879 ;; GKqueueFileMonitor does not report the `attribute-changed' event.
880 ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) nil)
862 ;; For kqueue and in the remote case, `write-region' 881 ;; For kqueue and in the remote case, `write-region'
863 ;; raises also an `attribute-changed' event. 882 ;; raises also an `attribute-changed' event.
864 ((or (string-equal (file-notify--test-library) "kqueue") 883 ((or (string-equal (file-notify--test-library) "kqueue")
@@ -925,6 +944,10 @@ delivered."
925 ;; timeouts. 944 ;; timeouts.
926 (setq file-notify--test-desc auto-revert-notify-watch-descriptor) 945 (setq file-notify--test-desc auto-revert-notify-watch-descriptor)
927 946
947 ;; GKqueueFileMonitor does not report the `changed' event.
948 (skip-unless
949 (not (equal (file-notify--test-monitor) 'GKqueueFileMonitor)))
950
928 ;; Check, that file notification has been used. 951 ;; Check, that file notification has been used.
929 (should auto-revert-mode) 952 (should auto-revert-mode)
930 (should auto-revert-use-notify) 953 (should auto-revert-use-notify)
@@ -956,7 +979,7 @@ delivered."
956 979
957 ;; Modify file. We wait for two seconds, in order to 980 ;; Modify file. We wait for two seconds, in order to
958 ;; have another timestamp. One second seems to be too 981 ;; have another timestamp. One second seems to be too
959 ;; short. And Cygwin sporadically requires more than two. 982 ;; short. And cygwin sporadically requires more than two.
960 (ert-with-message-capture captured-messages 983 (ert-with-message-capture captured-messages
961 (let ((inhibit-message t)) 984 (let ((inhibit-message t))
962 (sleep-for (if (eq system-type 'cygwin) 3 2)) 985 (sleep-for (if (eq system-type 'cygwin) 3 2))
@@ -1028,6 +1051,9 @@ delivered."
1028 ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe") 1051 ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe")
1029 '((deleted stopped) 1052 '((deleted stopped)
1030 (changed deleted stopped))) 1053 (changed deleted stopped)))
1054 ;; GKqueueFileMonitor does not report the `changed' event.
1055 ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
1056 '(deleted stopped))
1031 ;; There could be one or two `changed' events. 1057 ;; There could be one or two `changed' events.
1032 (t '((changed deleted stopped) 1058 (t '((changed deleted stopped)
1033 (changed changed deleted stopped)))) 1059 (changed changed deleted stopped))))
@@ -1077,6 +1103,9 @@ delivered."
1077 '(created deleted stopped)) 1103 '(created deleted stopped))
1078 ((string-equal (file-notify--test-library) "kqueue") 1104 ((string-equal (file-notify--test-library) "kqueue")
1079 '(created changed deleted stopped)) 1105 '(created changed deleted stopped))
1106 ;; GKqueueFileMonitor does not report the `changed' event.
1107 ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
1108 '(created deleted deleted stopped))
1080 (t '(created changed deleted deleted stopped))) 1109 (t '(created changed deleted deleted stopped)))
1081 (write-region 1110 (write-region
1082 "any text" nil file-notify--test-tmpfile nil 'no-message) 1111 "any text" nil file-notify--test-tmpfile nil 'no-message)
@@ -1254,9 +1283,12 @@ delivered."
1254 '(change) #'file-notify--test-event-handler))) 1283 '(change) #'file-notify--test-event-handler)))
1255 (should (file-notify-valid-p file-notify--test-desc)) 1284 (should (file-notify-valid-p file-notify--test-desc))
1256 (file-notify--test-with-actions 1285 (file-notify--test-with-actions
1257 ;; There could be one or two `changed' events. 1286 (cond
1258 '((changed) 1287 ;; GKqueueFileMonitor does not report the `changed' event.
1259 (changed changed)) 1288 ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) nil)
1289 ;; There could be one or two `changed' events.
1290 (t '((changed)
1291 (changed changed))))
1260 ;; There shouldn't be any problem, because the file is kept. 1292 ;; There shouldn't be any problem, because the file is kept.
1261 (with-temp-buffer 1293 (with-temp-buffer
1262 (let ((buffer-file-name file-notify--test-tmpfile) 1294 (let ((buffer-file-name file-notify--test-tmpfile)
@@ -1294,6 +1326,9 @@ delivered."
1294 ;; On cygwin we only get the `changed' event. 1326 ;; On cygwin we only get the `changed' event.
1295 ((eq system-type 'cygwin) 1327 ((eq system-type 'cygwin)
1296 '(changed)) 1328 '(changed))
1329 ;; GKqueueFileMonitor does not report the `changed' event.
1330 ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
1331 '(renamed created))
1297 (t '(renamed created changed))) 1332 (t '(renamed created changed)))
1298 ;; The file is renamed when creating a backup. It shall 1333 ;; The file is renamed when creating a backup. It shall
1299 ;; still be watched. 1334 ;; still be watched.
@@ -1391,7 +1426,12 @@ the file watch."
1391 (make-list (/ n 2) 'changed) 1426 (make-list (/ n 2) 'changed)
1392 ;; Just the directory monitor. 1427 ;; Just the directory monitor.
1393 (make-list (/ n 2) 'created) 1428 (make-list (/ n 2) 'created)
1394 (make-list (/ n 2) 'changed))) 1429 (make-list (/ n 2) 'changed))
1430 (append
1431 '(:random)
1432 ;; Just the directory monitor. GKqueueFileMonitor
1433 ;; does not report the `changed' event.
1434 (make-list (/ n 2) 'created)))
1395 (dotimes (i n) 1435 (dotimes (i n)
1396 (file-notify--test-read-event) 1436 (file-notify--test-read-event)
1397 (if (zerop (mod i 2)) 1437 (if (zerop (mod i 2))
diff --git a/test/lisp/net/rcirc-tests.el b/test/lisp/net/rcirc-tests.el
index 285926af9d2..cbd1c2be830 100644
--- a/test/lisp/net/rcirc-tests.el
+++ b/test/lisp/net/rcirc-tests.el
@@ -51,4 +51,16 @@
51 "MODE #cchan +kl :a:b" 51 "MODE #cchan +kl :a:b"
52 nil "MODE" '("#cchan" "+kl" "a:b"))) 52 nil "MODE" '("#cchan" "+kl" "a:b")))
53 53
54(ert-deftest rcirc-rename-nicks ()
55 (should (equal (rcirc--make-new-nick "foo" 16)
56 "foo`"))
57 (should (equal (rcirc--make-new-nick "123456789012345" 16)
58 "123456789012345`"))
59 (should (equal (rcirc--make-new-nick "1234567890123456" 16)
60 "123456789012345`"))
61 (should (equal (rcirc--make-new-nick "123456789012345`" 16)
62 "12345678901234``"))
63 (should (equal (rcirc--make-new-nick "123456789012````" 16)
64 "12345678901`````")))
65
54;;; rcirc-tests.el ends here 66;;; rcirc-tests.el ends here
diff --git a/test/src/casefiddle-tests.el b/test/src/casefiddle-tests.el
index 7abb79eadde..3eba4cfd78b 100644
--- a/test/src/casefiddle-tests.el
+++ b/test/src/casefiddle-tests.el
@@ -247,7 +247,8 @@
247 ;; input upcase downcase [titlecase] 247 ;; input upcase downcase [titlecase]
248 (dolist (test '((?a ?A ?a) (?A ?A ?a) 248 (dolist (test '((?a ?A ?a) (?A ?A ?a)
249 (?ł ?Ł ?ł) (?Ł ?Ł ?ł) 249 (?ł ?Ł ?ł) (?Ł ?Ł ?ł)
250 (?ß ?ß ?ß) (?ẞ ?ẞ ?ß) 250 ;; We char-upcase ß to ẞ; see bug #11309.
251 (?ß ?ẞ ?ß) (?ẞ ?ẞ ?ß)
251 (?ⅷ ?Ⅷ ?ⅷ) (?Ⅷ ?Ⅷ ?ⅷ) 252 (?ⅷ ?Ⅷ ?ⅷ) (?Ⅷ ?Ⅷ ?ⅷ)
252 (?DŽ ?DŽ ?dž ?Dž) (?Dž ?DŽ ?dž ?Dž) (?dž ?DŽ ?dž ?Dž))) 253 (?DŽ ?DŽ ?dž ?Dž) (?Dž ?DŽ ?dž ?Dž) (?dž ?DŽ ?dž ?Dž)))
253 (let ((ch (car test)) 254 (let ((ch (car test))
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 1312683c848..c5fc3eaa11a 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -324,7 +324,7 @@ comparing the subr with a much slower lisp implementation."
324 324
325(defvar binding-test-some-local 'some) 325(defvar binding-test-some-local 'some)
326(with-current-buffer binding-test-buffer-A 326(with-current-buffer binding-test-buffer-A
327 (set (make-local-variable 'binding-test-some-local) 'local)) 327 (setq-local binding-test-some-local 'local))
328 328
329(ert-deftest binding-test-manual () 329(ert-deftest binding-test-manual ()
330 "A test case from the elisp manual." 330 "A test case from the elisp manual."
diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el
index 4125573dc6a..297db81f5ab 100644
--- a/test/src/eval-tests.el
+++ b/test/src/eval-tests.el
@@ -195,6 +195,23 @@ expressions works for identifiers starting with period."
195 (search-forward " foo()") 195 (search-forward " foo()")
196 (search-forward " normal-top-level()"))))) 196 (search-forward " normal-top-level()")))))
197 197
198(ert-deftest eval-tests/backtrace-in-batch-mode/inhibit ()
199 (let ((emacs (expand-file-name invocation-name invocation-directory)))
200 (skip-unless (file-executable-p emacs))
201 (with-temp-buffer
202 (let ((status (call-process
203 emacs nil t nil
204 "--quick" "--batch"
205 (concat "--eval="
206 (prin1-to-string
207 '(progn
208 (defun foo () (error "Boo"))
209 (let ((backtrace-on-error-noninteractive nil))
210 (foo))))))))
211 (should (natnump status))
212 (should-not (eql status 0)))
213 (should (equal (string-trim (buffer-string)) "Boo")))))
214
198(ert-deftest eval-tests/backtrace-in-batch-mode/demoted-errors () 215(ert-deftest eval-tests/backtrace-in-batch-mode/demoted-errors ()
199 (let ((emacs (expand-file-name invocation-name invocation-directory))) 216 (let ((emacs (expand-file-name invocation-name invocation-directory)))
200 (skip-unless (file-executable-p emacs)) 217 (skip-unless (file-executable-p emacs))
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 86b8d655d26..eaa569e0d95 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -983,3 +983,19 @@
983 (should (equal (string-search (string-to-multibyte "o\303\270") "foo\303\270") 983 (should (equal (string-search (string-to-multibyte "o\303\270") "foo\303\270")
984 2)) 984 2))
985 (should (equal (string-search "\303\270" "foo\303\270") 3))) 985 (should (equal (string-search "\303\270" "foo\303\270") 3)))
986
987(ert-deftest object-intervals ()
988 (should (equal (object-intervals (propertize "foo" 'bar 'zot))
989 '((0 3 (bar zot)))))
990 (should (equal (object-intervals (concat (propertize "foo" 'bar 'zot)
991 (propertize "foo" 'gazonk "gazonk")))
992 '((0 3 (bar zot)) (3 6 (gazonk "gazonk")))))
993 (should (equal
994 (with-temp-buffer
995 (insert "foobar")
996 (put-text-property 1 3 'foo 1)
997 (put-text-property 3 6 'bar 2)
998 (put-text-property 2 5 'zot 3)
999 (object-intervals (current-buffer)))
1000 '((0 1 (foo 1)) (1 2 (zot 3 foo 1)) (2 4 (zot 3 bar 2))
1001 (4 5 (bar 2)) (5 6 nil)))))
diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el
index f9372e37b11..34d4067db47 100644
--- a/test/src/regex-emacs-tests.el
+++ b/test/src/regex-emacs-tests.el
@@ -803,4 +803,68 @@ This evaluates the TESTS test cases from glibc."
803 (should-not (string-match "å" "\xe5")) 803 (should-not (string-match "å" "\xe5"))
804 (should-not (string-match "[å]" "\xe5"))) 804 (should-not (string-match "[å]" "\xe5")))
805 805
806(ert-deftest regexp-case-fold ()
807 "Test case-sensitive and case-insensitive matching."
808 (let ((case-fold-search nil))
809 (should (equal (string-match "aB" "ABaB") 2))
810 (should (equal (string-match "åÄ" "ÅäåäÅÄåÄ") 6))
811 (should (equal (string-match "λΛ" "lΛλλΛ") 3))
812 (should (equal (string-match "шШ" "zШшшШ") 3))
813 (should (equal (string-match "[[:alpha:]]+" ".3aBåÄßλΛшШ中﷽") 2))
814 (should (equal (match-end 0) 12))
815 (should (equal (string-match "[[:alnum:]]+" ".3aBåÄßλΛшШ中﷽") 1))
816 (should (equal (match-end 0) 12))
817 (should (equal (string-match "[[:upper:]]+" ".3aåλшBÄΛШ中﷽") 6))
818 (should (equal (match-end 0) 10))
819 (should (equal (string-match "[[:lower:]]+" ".3BÄΛШaåλш中﷽") 6))
820 (should (equal (match-end 0) 10)))
821 (let ((case-fold-search t))
822 (should (equal (string-match "aB" "ABaB") 0))
823 (should (equal (string-match "åÄ" "ÅäåäÅÄåÄ") 0))
824 (should (equal (string-match "λΛ" "lΛλλΛ") 1))
825 (should (equal (string-match "шШ" "zШшшШ") 1))
826 (should (equal (string-match "[[:alpha:]]+" ".3aBåÄßλΛшШ中﷽") 2))
827 (should (equal (match-end 0) 12))
828 (should (equal (string-match "[[:alnum:]]+" ".3aBåÄßλΛшШ中﷽") 1))
829 (should (equal (match-end 0) 12))
830 (should (equal (string-match "[[:upper:]]+" ".3aåλшBÄΛШ中﷽") 2))
831 (should (equal (match-end 0) 10))
832 (should (equal (string-match "[[:lower:]]+" ".3BÄΛШaåλш中﷽") 2))
833 (should (equal (match-end 0) 10))))
834
835(ert-deftest regexp-eszett ()
836 "Test matching of ß and ẞ."
837 ;; Sanity checks.
838 (should (equal (upcase "ß") "SS"))
839 (should (equal (downcase "ß") "ß"))
840 (should (equal (capitalize "ß") "Ss")) ; undeutsch...
841 (should (equal (upcase "ẞ") "ẞ"))
842 (should (equal (downcase "ẞ") "ß"))
843 (should (equal (capitalize "ẞ") "ẞ"))
844 ;; ß is a lower-case letter (Ll); ẞ is an upper-case letter (Lu).
845 (let ((case-fold-search nil))
846 (should (equal (string-match "ß" "ß") 0))
847 (should (equal (string-match "ß" "ẞ") nil))
848 (should (equal (string-match "ẞ" "ß") nil))
849 (should (equal (string-match "ẞ" "ẞ") 0))
850 (should (equal (string-match "[[:alpha:]]" "ß") 0))
851 ;; bug#11309
852 (should (equal (string-match "[[:lower:]]" "ß") 0))
853 (should (equal (string-match "[[:upper:]]" "ß") nil))
854 (should (equal (string-match "[[:alpha:]]" "ẞ") 0))
855 (should (equal (string-match "[[:lower:]]" "ẞ") nil))
856 (should (equal (string-match "[[:upper:]]" "ẞ") 0)))
857 (let ((case-fold-search t))
858 (should (equal (string-match "ß" "ß") 0))
859 (should (equal (string-match "ß" "ẞ") 0))
860 (should (equal (string-match "ẞ" "ß") 0))
861 (should (equal (string-match "ẞ" "ẞ") 0))
862 (should (equal (string-match "[[:alpha:]]" "ß") 0))
863 ;; bug#11309
864 (should (equal (string-match "[[:lower:]]" "ß") 0))
865 (should (equal (string-match "[[:upper:]]" "ß") 0))
866 (should (equal (string-match "[[:alpha:]]" "ẞ") 0))
867 (should (equal (string-match "[[:lower:]]" "ẞ") 0))
868 (should (equal (string-match "[[:upper:]]" "ẞ") 0))))
869
806;;; regex-emacs-tests.el ends here 870;;; regex-emacs-tests.el ends here