emacs-diffs
[Top][All Lists]
Advanced

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

feature/android 3504c7550d9 2/2: Merge remote-tracking branch 'origin/ma


From: Po Lu
Subject: feature/android 3504c7550d9 2/2: Merge remote-tracking branch 'origin/master' into feature/android
Date: Wed, 15 Mar 2023 06:29:35 -0400 (EDT)

branch: feature/android
commit 3504c7550d9e2eeeabfe71b5819506ebc7c045b4
Merge: f57c64925bc fe58837bbec
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Merge remote-tracking branch 'origin/master' into feature/android
---
 doc/emacs/macos.texi                      |   7 -
 doc/lispref/internals.texi                |   9 +-
 doc/lispref/objects.texi                  |   7 -
 doc/misc/eglot.texi                       | 352 ++++++++++++++------
 etc/EGLOT-NEWS                            | 513 ++++++++++++++++++++++++++++++
 etc/NEWS                                  |   8 +-
 etc/NEWS.29                               |   9 +-
 lisp/arc-mode.el                          |  25 +-
 lisp/epa-ks.el                            |  10 +-
 lisp/files-x.el                           |   8 +-
 lisp/jsonrpc.el                           |  14 +-
 lisp/ldefs-boot.el                        |  34 +-
 lisp/net/tramp-adb.el                     |   2 +-
 lisp/net/tramp-gvfs.el                    |   2 +-
 lisp/net/tramp-sh.el                      |  14 +-
 lisp/net/tramp-smb.el                     |   6 +-
 lisp/net/tramp-sudoedit.el                |   2 +-
 lisp/net/tramp.el                         |  33 +-
 lisp/novice.el                            |  20 +-
 lisp/progmodes/c-ts-mode.el               |   6 +-
 lisp/progmodes/eglot.el                   |  23 +-
 lisp/progmodes/java-ts-mode.el            |  15 +-
 lisp/progmodes/python.el                  |  32 +-
 lisp/progmodes/ruby-ts-mode.el            |   6 +-
 lisp/progmodes/rust-ts-mode.el            |   2 +
 lisp/progmodes/xref.el                    |  16 +-
 lisp/server.el                            |   8 +-
 src/emacs.c                               |   2 +-
 test/lisp/files-x-tests.el                |  66 +++-
 test/lisp/jsonrpc-tests.el                |   2 +-
 test/lisp/net/tramp-tests.el              |  28 +-
 test/lisp/progmodes/eglot-tests.el        | 105 +++---
 test/lisp/progmodes/python-tests.el       |  73 +++++
 test/lisp/progmodes/ruby-ts-mode-tests.el |  16 +
 34 files changed, 1209 insertions(+), 266 deletions(-)

diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi
index 6b9ae196704..9f2c4721cab 100644
--- a/doc/emacs/macos.texi
+++ b/doc/emacs/macos.texi
@@ -201,13 +201,6 @@ Setting a lower number makes the trackpad more sensitive, 
and a higher
 number makes the trackpad less sensitive.
 @end table
 
-@subsection Font Panel
-
-@findex ns-popup-font-panel
-The standard Mac / GNUstep font panel is accessible with @kbd{M-x
-ns-popup-font-panel} and will set the default font in the frame most
-recently used or clicked on.
-
 @c  To make the setting permanent, use @samp{Save Options} in the
 @c Options menu, or run @code{menu-bar-options-save}.
 
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 55f07e86f76..9928361f7b2 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -558,12 +558,15 @@ The initial threshold value is 
@code{GC_DEFAULT_THRESHOLD}, defined in
 value is 400,000 for the default 32-bit configuration and 800,000 for
 the 64-bit one.  If you specify a larger value, garbage collection
 will happen less often.  This reduces the amount of time spent garbage
-collecting, but increases total memory use.  You may want to do this
-when running a program that creates lots of Lisp data.  However, we
+collecting (so Lisp programs will run faster between cycles of garbage
+collection that happen more rarely), but increases total memory use.
+You may want to do this when running a program that creates lots of
+Lisp data, especially if you need it to run faster.  However, we
 recommend against increasing the threshold for prolonged periods of
 time, and advise that you never set it higher than needed for the
 program to run in reasonable time.  Using thresholds higher than
-necessary could potentially cause system-wide memory pressure, and
+necessary could potentially cause higher system-wide memory pressure,
+and also make each garbage-collection cycle take much more time, and
 should therefore be avoided.
 
 You can make collections more frequent by specifying a smaller value, down
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index 99a3c073971..2fe7e6db560 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -1007,13 +1007,6 @@ It looks like this:
 @end example
 @end ifnottex
 
-  As a somewhat peculiar side effect of @code{(a b . c)} and
-@code{(a . (b . c))} being equivalent, for consistency this means
-that if you replace @code{b} here with the empty sequence, then it
-follows that @code{(a . c)} and @code{(a . ( . c))} are equivalent,
-too.  This also means that @code{( .  c)} is equivalent to @code{c},
-but this is seldom used.
-
 @node Association List Type
 @subsubsection Association List Type
 
diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi
index eed9744b9f0..735da5f0163 100644
--- a/doc/misc/eglot.texi
+++ b/doc/misc/eglot.texi
@@ -98,6 +98,7 @@ This manual documents how to configure, use, and customize 
Eglot.
 * Eglot and LSP Servers::       How to work with language servers.
 * Using Eglot::                 Important Eglot commands and variables.
 * Customizing Eglot::           Eglot customization and advanced features.
+* Advanced server configuration::  Fine-tune a specific language server
 * Troubleshooting Eglot::       Troubleshooting and reporting bugs.
 * GNU Free Documentation License::  The license for this manual.
 * Index::
@@ -226,11 +227,10 @@ This says to invoke @var{program} with zero or more 
arguments
 standard input and standard output streams.
 
 @item (@var{program} @var{args}@dots{} :initializationOptions 
@var{options}@dots{})
-Like above, but with @var{options} specifying the options to be
-used for constructing the @samp{initializationOptions} JSON object for
-the server.  @var{options} can also be a function of one argument, in
-which case it will be called with the server instance as the argument,
-and should return the JSON object to use for initialization.
+@var{program} is invoked with @var{args} but @var{options} specifies
+how to construct the @samp{:initializationOptions} JSON object to pass
+the server on during the LSP handshake (@pxref{Advanced server
+configuration}).
 
 @item (@var{host} @var{port} @var{args}@dots{})
 Here @var{host} is a string and @var{port} is a positive integer
@@ -970,139 +970,307 @@ mechanism.
 Set this variable to true if you'd like progress notifications coming
 from the LSP server to be handled as Emacs's progress reporting
 facilities.
+@end table
+
+@node Advanced server configuration
+@chapter Advanced server configuration
+
+Though many language servers work well out-of-the-box, most allow
+fine-grained control of their operation via specific configuration
+options that vary from server to server.  A small number of servers
+require such special configuration to work acceptably, or even to work
+at all.
+
+After having setup a server executable program in
+@code{eglot-server-programs} (@pxref{Setting Up LSP Servers}) and
+ensuring Eglot can invoke it, you may want to take advantage of some
+of these options.  You should first distinguish two main kinds of
+server configuration:
+
+@itemize @bullet
+@item
+Project-specific, applying to a specific project;
+
+@item
+User-specific, applying to all projects the server is used for.
+@end itemize
+
+When you have decided which kind you need, the following sections
+teach how Eglot's user variables can be used to achieve it:
+
+@menu
+* Project-specific configuration::
+* User-specific configuration::
+* JSONRPC objects in Elisp::
+@end menu
 
+It's important to note that not all servers allow both kinds of
+configuration, nor is it guaranteed that user options can be copied
+over to project options, and vice-versa.  When in doubt, consult your
+language server's documentation.
+
+It's also worth noting that some language servers can read these
+settings from configuration files in the user's @code{HOME} directory
+or in a project's directory.  For example, the @command{pylsp} Python
+server reads the file @file{~/.config/pycodestyle} for user
+configuration.  The @command{clangd} C/C++ server reads both
+@file{~/.config/clangd/config.yaml} for user configuration and
+@file{.clangd} for project configuration.  It may be advantageous to
+use these mechanisms instead of Eglot's, as the latter have the
+advantage of working with other LSP clients.
+
+@node Project-specific configuration
+@section Project-specific configuration
 @vindex eglot-workspace-configuration
-@cindex server workspace configuration
-@item eglot-workspace-configuration
-This variable is meant to be set in the @file{.dir-locals.el} file, to
-provide per-project settings, as described below in more detail.
-@end table
+@cindex workspace configuration
+
+To set project-specific settings, which the LSP specification calls
+@dfn{workspace configuration}, the variable
+@code{eglot-workspace-configuration} may be used.
 
-Some language servers need to know project-specific settings, which
-the LSP calls @dfn{workspace configuration}.  Eglot allows such fine
-tuning of per-project settings via the variable
-@code{eglot-workspace-configuration}.  Eglot sends the settings in
-this variable to each server, and each server applies the portion of the
-settings relevant to it and ignores the rest.  These settings are
-communicated to the server initially (upon establishing the
-connection) or when the settings are changed, or in response to a
-configuration request from the server.
-
-In many cases, servers can be configured globally using a
-configuration file in the user's home directory or in the project
-directory, which the language server reads.  For example, the
-@command{pylsp} server for Python reads the file
-@file{~/.config/pycodestyle} and the @command{clangd} server reads the
-file @file{.clangd} anywhere in the current project's directory tree.
-If possible, we recommend using those configuration files that are
-independent of Eglot and Emacs; they have the advantage that they will
-work with other LSP clients as well.
-
-If you do need to provide Emacs-specific configuration for a language
-server, we recommend defining the appropriate value in the
-@file{.dir-locals.el} file in the project's directory.  The value of
-this variable should be a property list of the following format:
+This variable is a directory-local variable (@pxref{Directory
+Variables, , Per-directory Local Variables, emacs, The GNU Emacs
+Manual}).  It's important to recognize that this variable really only
+makes sense when set directory-locally.  It usually does not make
+sense to set it file-locally or in a major-mode hook.
+
+The most common way to set @code{eglot-workspace-configuration } is
+using a @file{.dir-locals.el} file in the root of your project.  If
+you can't do that, you may also set it from Elisp code via the
+@code{dir-locals-set-class-variables} function.  (@pxref{Directory
+Local Variables,,, elisp, GNU Emacs Lisp Reference Manual}).
+
+However you choose to set it, the variable's value is a plist
+(@pxref{Property Lists,,, elisp, GNU Emacs Lisp Reference Manual}) with
+the following format:
 
 @lisp
- (:@var{server} @var{plist}@dots{})
+ (@var{:server1} @var{plist1} @var{:server2} @var{plist2} @dots{})
 @end lisp
 
 @noindent
-Here @code{:@var{server}} identifies a particular language server and
-@var{plist} is the corresponding keyword-value property list of one or
-more parameter settings for that server, serialized by Eglot as a JSON
-object.  @var{plist} may be arbitrarily complex, generally containing
-other keyword-value property sublists corresponding to JSON subobjects.
-The JSON values @code{true}, @code{false}, @code{null} and @code{@{@}}
-are represented by the Lisp values @code{t}, @code{:json-false},
-@code{nil}, and @code{eglot-@{@}}, respectively.
+Here, @var{:server1} and @var{:server2} are keywords whose names
+identify the LSP language servers to target.  Consult server
+documentation to find out what name to use.  @var{plist1} and
+@var{plist2} are plists of options, possibly nesting other plists.
 
 @findex eglot-show-workspace-configuration
 When experimenting with workspace settings, you can use the command
 @kbd{M-x eglot-show-workspace-configuration} to inspect and debug the
-JSON value to be sent to the server.  This helper command works even
-before actually connecting to the server.
+value of this variable in its final JSON form, ready to be sent to the
+server (@pxref{JSONRPC objects in Elisp}).  This helper command works
+even before actually connecting to the server.
+
+These variable's value doesn't take effect immediately.  That happens
+upon establishing the connection, in response to an explicit query
+from the server, or when issuing the command @kbd{M-x
+eglot-signal-didChangeConfiguration} which notifies the server during
+an ongoing Eglot session.
+
+@subsection Examples
+
+For some users, setting @code{eglot-workspace-configuration} is a
+somewhat daunting task.  One of the reasons is having to manage the
+general Elisp syntax of per-mode directory-local variables, which uses
+alists (@pxref{Association Lists,,, elisp, GNU Emacs Lisp Reference
+Manual}), and the specific syntax of Eglot's variable, which uses
+plists.  Some examples are useful.
+
+Let's say you want to configure two language servers to be used in a
+project written in a combination of the Python and Go languages.  You
+want to use the @command{pylsp} and @command{gopls} LSP servers. In
+the documentation of the servers in question (or in some other editor's
+configuration file, or in some blog article), you find the following
+configuration options in informal dotted-notation syntax:
+
+@example
+pylsp.plugins.jedi_completion.include_params: true
+pylsp.plugins.jedi_completion.fuzzy: true
+pylsp.pylint.enabled: false
+gopls.usePlaceholders: true
+@end example
+
+To apply this to Eglot, and assuming you chose the
+@file{.dir-locals.el} file method, the contents of that file could be:
 
-Here's an example of defining the workspace-configuration settings for
-a project that uses two different language servers, one for Python,
-the other one for Go (presumably, the project is written in a
-combination of these two languages).  The server for Python in this
-case is @command{pylsp}, the server for Go is @command{gopls}.  The
-value of @code{eglot-workspace-configuration} in this case should be:
+@lisp
+((nil
+  . ((eglot-workspace-configuration
+      . (:pylsp (:plugins (:jedi_completion (:include_params t
+                                             :fuzzy t)
+                           :pylint (:enabled :json-false)))
+         :gopls (:usePlaceholders t)))))
+ (python-mode . ((indent-tabs-mode . nil)))
+ (go-mode     . ((indent-tabs-mode . t))))
+@end lisp
+
+@noindent
+This sets the value of @code{eglot-workspace-configuration} in all the
+buffers inside the project; each server will use only the section of
+the parameters intended for that server, and ignore the rest.  Note
+how alists are used for associating Emacs mode names with alists
+associating variable names with variable values.  Then notice how
+plists are used inside the value of
+@code{eglot-workspace-configuration}.
+
+This following form may also be used:
 
 @lisp
 ((python-mode
   . ((eglot-workspace-configuration
       . (:pylsp (:plugins (:jedi_completion (:include_params t
                                              :fuzzy t)
-                           :pylint (:enabled :json-false)))))))
+                           :pylint (:enabled :json-false)))))
+     (indent-tabs-mode . nil)))
  (go-mode
   . ((eglot-workspace-configuration
-      . (:gopls (:usePlaceholders t))))))
+      . (:gopls (:usePlaceholders t)))
+     (indent-tabs-mode . t))))
 @end lisp
 
 @noindent
-This should go into the @file{.dir-locals.el} file in the project's
-root directory.  It sets up the value of
-@code{eglot-workspace-configuration} separately for each major mode.
-
-Alternatively, the same configuration could be defined as follows:
+This sets up the value of @code{eglot-workspace-configuration}
+separately depending on the major mode of each of that project's
+buffers.  @code{python-mode} buffers will have the variable set to
+@code{(:pylsp (:plugins ...))}.  @code{go-mode} buffers will have the
+variable set to @code{(:gopls (:usePlaceholders t))}.
+
+Some servers will issue workspace configuration for specific files
+inside your project.  For example, if you know @code{gopls} is asking
+about specific files in the @code{src/imported} subdirectory and you
+want to set a different option for @code{gopls.usePlaceholders} , you
+may use something like:
 
 @lisp
-((nil
+((python-mode
   . ((eglot-workspace-configuration
       . (:pylsp (:plugins (:jedi_completion (:include_params t
                                              :fuzzy t)
-                           :pylint (:enabled :json-false)))
-         :gopls (:usePlaceholders t))))))
+                           :pylint (:enabled :json-false)))))
+     (indent-tabs-mode nil)))
+ (go-mode
+  . ((eglot-workspace-configuration
+      . (:gopls (:usePlaceholders t)))
+     (indent-tabs-mode t)))
+ ("src/imported"
+   . ((eglot-workspace-configuration
+      . (:gopls (:usePlaceholders nil))))))
 @end lisp
 
-This is an equivalent setup which sets the value for all the
-major-modes inside the project; each server will use only the section
-of the parameters intended for that server, and ignore the rest.
-
-As yet another alternative, you can set the value of
-@code{eglot-workspace-configuration} programmatically, via the
-@code{dir-locals-set-class-variables} function, @pxref{Directory Local
-Variables,,, elisp, GNU Emacs Lisp Reference Manual}.
-
 Finally, if one needs to determine the workspace configuration based
 on some dynamic context, @code{eglot-workspace-configuration} can be
 set to a function.  The function is called with the
 @code{eglot-lsp-server} instance of the connected server (if any) and
 with @code{default-directory} set to the root of the project.  The
-function should return a value of the form described above.
+function should return a plist suitable for use as the variable's
+value.
+
+@node User-specific configuration
+@section User-specific configuration
+@cindex initializationOptions
+@cindex command-line arguments
 
-Some servers need special hand-holding to operate correctly.  If your
-server has some quirks or non-conformity, it's possible to extend
-Eglot via Elisp to adapt to it, by defining a suitable
-@code{eglot-initialization-options} method via @code{cl-defmethod}
-(@pxref{Generic Functions,,, elisp, GNU Emacs Lisp Reference Manual}).
+This kind of configuration applies to all projects the server is used
+for.  Here, there are a number of ways to do this inside Eglot.
 
-Here's an example:
+A common way is to pass command-line options to the server invocation
+via @code{eglot-server-programs}.  Let's say we want to configure
+where the @command{clangd} server reads its
+@code{compile_commands.json} from.  This can be done like so:
 
 @lisp
-(require 'eglot)
+(with-eval-after-load 'eglot
+  (add-to-list 'eglot-server-programs
+               `(c++-mode . ("clangd" "--compile-commands-dir=/tmp"))))
 
-(add-to-list 'eglot-server-programs
-             '((c++-mode c-mode) . (eglot-cquery "cquery")))
+@end lisp
 
-(defclass eglot-cquery (eglot-lsp-server) ()
-  :documentation "A custom class for cquery's C/C++ langserver.")
+@noindent
+Another way is to have Eglot pass a JSON object to the server during
+the LSP handshake.  This is done using the
+@code{:initializationOptions} syntax of @code{eglot-server-programs}:
 
-(cl-defmethod eglot-initialization-options ((server eglot-cquery))
-  "Passes through required cquery initialization options"
-  (let* ((root (car (project-roots (eglot--project server))))
-         (cache (expand-file-name ".cquery_cached_index/" root)))
-    (list :cacheDirectory (file-name-as-directory cache)
-          :progressReportFrequencyMs -1)))
+@lisp
+(with-eval-after-load 'eglot
+  (add-to-list 'eglot-server-programs
+               `(c++-mode . ("clangd" :initializationOptions
+                                      (:compilationDatabasePath "/tmp")))))
 @end lisp
 
 @noindent
-See the doc string of @code{eglot-initialization-options} for more
-details.
-@c FIXME: The doc string of eglot-initialization-options should be
-@c enhanced and extended.
+The argument @code{(:compilationDatabasePath "/tmp")} is Emacs's
+representation in plist format of a simple JSON object
+@code{@{"compilationDatabasePath": "/tmp"@}}.  To learn how to
+represent more deeply nested options in this format, @xref{JSONRPC
+objects in Elisp}.
+
+In this case, the two examples achieve exactly the same, but notice
+how the option's name has changed between them.
+
+@vindex eglot-workspace-configuration
+Finally there is another way to do user-specific configuration of
+language servers, which may be used if the methods above are not
+supported.  It consists of @emph{globally} setting
+@code{eglot-workspace-configuration}, a variable originally intended
+for project-specific configuration.  This has the same effect as
+giving all your projects a certain default configuration, as described
+in @xref{Project-specific configuration}.  Here is an example.
+
+@lisp
+(setq-default eglot-workspace-configuration
+              '(:pylsp (:plugins (:jedi_completion (:include_params t
+                                                    :fuzzy t)
+                                  :pylint (:enabled :json-false)))
+                :gopls (:usePlaceholders t)))
+@end lisp
+
+Note that the global value of @code{eglot-workspace-configuration} is
+always overriden if a directory-local value is detected.
+
+@node JSONRPC objects in Elisp
+@section JSONRPC objects in Elisp
+
+Emacs's preferred way of representing JSON is via Lisp lists.  In
+Eglot, the syntax of this list is the simplest possible (the one with
+fewer parenthesis), a plist (@pxref{Property Lists,,, elisp, GNU Emacs
+Lisp Reference Manual}).
+
+The plist may be arbitrarily complex, and generally containing other
+keyword-value property sub-plists corresponding to JSON sub-objects.
+
+For representing the JSON leaf values @code{true}, @code{false},
+@code{null} and @code{@{@}}, you can use the Lisp values @code{t},
+@code{:json-false}, @code{nil}, and @code{eglot-@{@}}, respectively.
+
+For example, this plist:
+
+@lisp
+(:pylsp (:plugins (:jedi_completion (:include_params t
+                                             :fuzzy t)
+                           :pylint (:enabled :json-false)))
+ :gopls (:usePlaceholders t))
+@end lisp
+
+Is serialized by Eglot to the following JSON text:
+
+@example
+@{
+  "pylsp": @{
+    "plugins": @{
+      "jedi_completion": @{
+        "include_params": true,
+        "fuzzy": true
+      @},
+      "pylint": @{
+        "enabled": false
+      @}
+    @}
+  @},
+  "gopls": @{
+    "usePlaceholders":true
+  @},
+@}
+@end example
 
 @node Troubleshooting Eglot
 @chapter Troubleshooting Eglot
diff --git a/etc/EGLOT-NEWS b/etc/EGLOT-NEWS
new file mode 100644
index 00000000000..dc77e4fe624
--- /dev/null
+++ b/etc/EGLOT-NEWS
@@ -0,0 +1,513 @@
+Eglot NEWS                                                     -*- outline -*-
+
+Copyright (C) 2018-2023 Free Software Foundation, Inc.
+See the end of the file for license conditions.
+
+Please send Eglot bug reports to 'bug-gnu-emacs@gnu.org', and Cc (or
+X-Debbugs-CC) the maintainer 'joaotavora@gmail.com' as well.  Please
+read the chapter titled "Troubleshooting" in the Eglot manual,
+available https://joaotavora.github.io/eglot/#Troubleshooting-Eglot
+
+This file is about changes in Eglot, the Emacs client for LSP
+(Language Server Protocol) distributed with GNU Emacs since Emacs
+version 29.1 and with GNU ELPA since 2018.
+
+Note: references to Eglot issues are presented as "github#nnnn".
+This refers to https://github.com/joaotavora/eglot/issues/.
+That is, to look up issue github#1234, go to
+https://github.com/joaotavora/eglot/issues/1234.
+
+
+* Changes in Eglot 1.12 (13/03/2023)
+
+** LSP inlay hints are now supported.
+Inlay hints are small text annotations not unlike diagnostics, but
+designed to help readability instead of indicating problems.  For
+example, a C++ LSP server can serve hints about positional parameter
+names in function calls and a variable's automatically deduced type.
+Emacs can display these hints using overlays, helping the user
+remember those types and parameter names.
+
+** Longstanding Tramp instability issues solved.
+The solution involves a Tramp-specific workaround in Eglot.  Future
+Tramp versions will have this problem solved at the origin.  The
+workaround will then be removed.  Emacs bug#61350 has more details.
+
+(github#859, github#1020, github#883)
+
+** LSP's 'positionEncoding' capability is now supported.
+The position-encoding scheme (UTF-8, UTF-16 or UTF-32) can now
+be negotiated with the server.
+
+** More of the user's Eldoc configuration is respected.
+This change addresses the problems reported in many Elglot reports
+dating back to early 2021 at least.
+
+(github#646, github#894, github#920, github#1031, github#1171).
+
+This is unfinished work, as 'eldoc-documentation-strategy' is still
+set by Eglot during its tenure over a buffer.  The default value for
+it cannot work reasonably with Eglot's additions to
+'eldoc-documentation-functions'.
+
+** Completion labels are correctly displayed in servers like clangd.
+
+(github#1141)
+
+** Assorted bugfixes.
+
+(bug#61312, bug#61478, bug#61532, bug#61726, bug#61866, bug#61748)
+
+
+* Changes in Eglot 1.11 (27/1/2023)
+
+** New server vscode-json-languageserver added to 'eglot-server-programs'.
+
+(bug#60198)
+
+** Assorted bugfixes.
+
+(bug#60379, bug#60557, (bug#61048)
+
+
+* Changes in Eglot 1.10 (16/12/2022)
+
+** Emacs progress reporters are used for LSP progress notifications.
+(bug#59149)
+
+** LSP reported URIs other than file:// are passed on to Emacs.
+This change allows other URI handlers, such as a 'jar:' handling
+package, to cooperate with Eglot and find files inside compressed file
+systems (bug#58790).
+
+** Eglot now shows in the menu bar.
+
+** Tree-sitter modes added to 'eglot-server-programs'.
+These modes are usually handled by the same server that handles the
+"classical mode".
+
+** New servers chsharp-ls and texlab added to 'eglot-server-programs'.
+
+** Assorted bugfixes.
+(bug#59824, bug#59338)
+
+
+* Changes in Eglot 1.9 (8/10/2022)
+
+This is the last release before integration into Emacs's core.
+
+** New 'M-x eglot-list-connections' command.
+Probably not very useful for now.  More keybindings and clickable
+shortcuts to connection-specific commands to be added later.
+
+** Manual temporarily lives in separate MANUAL.md file.
+The manual has been rewritten mostly from scratch.  It is structured
+hierarchically and is more complete.  After the merge into Emacs, the
+Eglot Texinfo manual bundled with Emacs used this temporary manual as
+a starting point.
+
+** Support for "single server, multiple modes".
+Previously, if an entry such as '((c++-mode c-mode) . ("clangd)")' was
+found in 'eglot-server-programs', it meant that '.cpp' files '.c'
+files would lead to two 'clangd' instances for managing them, even if
+these files were in the same project.  Now only one is created.  It is
+assumed that most, if not all, servers configured in
+'eglot-server-programs' handle this correctly.
+
+(github#681)
+
+** 'eglot-imenu' no longer uses problematic "special elements".
+Though Eglot's 'eglot-imenu' returned a fully compliant 'imenu'
+structure, that object was not understood by many other frontends
+other than 'M-x imenu' itself.  Since the special functionality it
+enabled wasn't being used anyway, it was decided to remove it to fix
+these longstanding problems.
+
+(github#758, github#536, github#535)
+
+** 'eglot-workspace-configuration' has been overhauled.
+This variable and its uses are now more thoroughly documented.  It can
+be set to a function for dynamic calculation of the configuration.
+The preferred format is a plist, though the earlier alist format is
+still supported.
+
+(github#967, github#590, github#790)
+
+** 'C-u M-.' lists and completes arbitrary workspace symbols.
+A very old request, now made possible by a relatively recent change to
+the 'workspace/symbol' RPC method.
+
+(github#131)
+
+** Reworked mode-line menus.
+New menus help discover Eglot's features and show which of them are
+supported by the current server.  Menus can be customized away via
+'eglot-menu-string', making space in mode-line.
+
+(github#792)
+
+** Easier to use LSP 'initialize.initializationOptions'.
+In 'eglot-server-programs' a plist may be appended to the usual list
+of strings passed as command line arguments.  The value of its
+':initializationOptions' key constructs the corresponding LSP JSON
+object.  This may be easier than creating a 'defclass' for a specific
+server and specializing 'eglot-initialization-options' to that class.
+
+(github#901, github#845, github#940)
+
+** LSP on-type formatting is now supported.
+This is the 'documentOnTypeFormattingProvider' LSP capability, which
+may be disabled via 'eglot-ignored-server-capabilities'
+
+(github#899)
+
+** Basic LSP "workspace folders" support added.
+Eglot now advertises 'project-root' and 'project-external-roots' as
+workspace-folders.  (Configuring 'project-vc-external-roots-function'
+via Elisp or 'tags-table-list' via Custtomize are two ways to set the
+external roots of a simple git project.)
+
+(github#893)
+
+** Eglot can now show project wide diagnosics via Flymake.
+Some LSP servers report diagnostics for all files in the current
+workspace.  Flymake has (as of version 1.2.1) the option to show
+diagnostics from buffers other than the currently visited one.  The
+command 'M-x flymake-show-project-diagnostics' will now show all the
+diagnostics relevant to a workspace.
+
+(github#810)
+
+** Support LSP completion tags.
+An LSP completion tag can be used to tell the editor how to render a
+completion.  Presently, one kind of tag exists, denoting its
+corresponding completion as obsolete.
+
+(github#797)
+
+** Support LSP optional diagnostic tags.
+A diagnostic tag can indicate either "unused or unnecessary code" or
+"deprecated or obsolete code".  Following the rendering suggestions in
+the protocol, we fade out unnecessary code and strike-through
+deprecated code.
+
+(github#794)
+
+** The Rust language server is now rust-analyzer by default.
+Eglot will now prefer starting "rust-analyzer" to "rls" when it is
+available.  The special support code for RLS has been removed.
+
+(github#803)
+
+** New servers have been added to 'eglot-server-programs'.
+- clojure-lsp (github#813)
+- racket-langserver (github#694)
+- futhark lsp (github#922)
+- purescript-language-server (github#905)
+- Perl::LanguageServer (github#952)
+- marksman (github#1013)
+- jedi-language-server ([#994](github#994))
+
+
+* Changes in Eglot 1.8 (12/1/2022)
+
+** Alternate servers supported out-of-box for the same major mode.
+In practice, this removes the need for Eglot to "officially" bless one
+server over another.
+
+Do not confuse this feature with another missing feature which
+consists of supporting multiple servers simultaneously managing a
+major mode within a project.
+
+(github#688)
+
+** TRAMP support added.
+There are no variables to customize: visit a remote file, ensure the
+server also exists in the remote, and type "M-x eglot".
+
+(github#637, github#463, github#84)
+
+** 'eglot-ignored-server-capabilities' is now correctly spelled.
+This user-visible variable used to be spelled
+'eglot-ignored-server-capabilites', which is still a valid but
+obsolete name.
+
+(github#724)
+
+** Eglot can manage cross-referenced files outside project.
+This is activated by a new customization option
+'eglot-extend-to-xref', which defaults to nil.
+
+(github#76, github#686, github#695)
+
+** Code action shortcuts can be added by the user.
+'M-x eglot-code-actions' accepts an optional 'action-kind' argument,
+specified interactively with 'C-u'.  Other shortcuts call specific
+actions directly ('eglot-code-action-inline',
+'eglot-code-action-extract', 'eglot-code-action-rewrite',
+'eglot-code-action-organize-imports' and
+'eglot-code-action-quickfix').  One can create one's own shortcuts for
+code actions with specific a kind by calling 'eglot-code-actions' from
+Lisp.
+
+(github#411)
+
+** New command 'eglot-shutdown-all added.
+This disconnects all the Eglot connections in the user's session.
+
+(github#643)
+
+** New variable 'eglot-withhold-process-id' added.
+If non-nil, Eglot will not send the Emacs process ID to the language
+server.  This can be useful when using docker to run a language
+server.
+
+(github#722)
+
+** Several new servers have been added to 'eglot-server-programs'.
+- cmake-language-server (github#787)
+- css-languageserver (github#204, github#769)
+- fortls (github#603)
+- html-languageserver (github#204, github#769)
+- json-languageserver (github#204, github#769)
+- lua-lsp (github#721)
+- mint ls (github#750)
+- pyright (github#742)
+- vim-language-server (github#787)
+- yaml-language-server (github#751)
+- zls (github#646)
+
+
+* Changes in Eglot 1.7 (16/12/2020)
+
+** Hierarchical symbols are supported in Imenu.
+(github#303).
+
+** Multiple "documentation at point" sources are supported.
+Such sources include as LSP's signature, hover and also the Flymake
+diagnostic messages.  They can all be presented in the echo area
+(space permitting), or via 'C-h .'.  For now, composition of different
+sources can be customized using 'eldoc-documentation-strategy',
+'eldoc-echo-area-use-multiline-p' and 'eldoc-prefer-doc-buffer'.
+
+The variables 'eglot-put-doc-in-help-buffer' and
+'eglot-auto-display-help-buffer' have been removed.
+
+(github#439, github#494, github#481, github#454)
+
+
+* Changes in Eglot 1.6 (16/04/2020)
+
+** Column offset calculation is now LSP-conformant.
+It seems the majority of servers now comply with the language server
+specification when it comes to handling non-ASCII texts.  Therefore
+the default values of 'eglot-move-to-column-function' and
+'eglot-current-column-function' have been changed.  Consult the
+documentation of these variables for how to restore the old behavior.
+
+(github#361)
+
+** LSP workspace/configuration requests are supported.
+Also a new section "Per-project server configuration" in the README.md
+should answer some FAQ's in this regard.
+
+(github#326)
+
+
+* Changes in Eglot 1.5 (20/10/2019)
+
+** Eglot takes over Company configuration.
+Similar to what was already the case with Flymake, Eldoc and Xref, use
+just the backend that can do something useful in Eglot,
+'company-capf'.  See 'eglot-stay-out-of' to opt out of this.
+
+(github#324)
+
+** New option 'eglot-autoshutdown' added.
+This disconnects the server after last managed buffer is killed.
+
+(github#217, github#270)
+
+** Completion support support has been fixed.
+Among other things, consider LSP's "filterText" cookies, which enable
+a kind of poor-man's flex-matching for some backends.
+
+(github#235, github#313, github#311, github#279)
+
+** Supports LSP's "goto declaration/implementation/typeDefinition".
+
+(github#302)
+
+** New option 'eglot-send-changes-idle-time' added.
+
+(github#258)
+
+** Eglot's Eldoc no longer flickers when moving around.
+
+(github#198)
+
+** Large docs shown in help buffer instead of echo area by default.
+Also add two new customization variables
+'eglot-put-doc-in-help-buffer' and 'eglot-auto-display-help-buffer'.
+
+(github#198)
+
+** Built-in support for Go, Elixir and Ada added.
+
+(github#304, github#264, github#316)
+
+
+* Changes in Eglot 1.4 (5/1/2019)
+
+** Parameter highlighting in the first line of signature corrected.
+
+** Markdown documentation strings are rendered with faces.
+Eglot uses 'gfm-view-mode' for this.
+
+** Hard dependencies on Flymake have been removed.
+The user can turn Flymake off now in buffers managed by Eglot.
+
+** Connection hooks are run with proper directory local variables.
+This fixes issues with suspiciously empty 'didChangeConfiguration'
+messages that are supposed to communicate parameters from a
+directory-set 'eglot-workspace-configuration'.
+
+(github#196)
+
+** Completion sorting has been fixed.
+If the server returns completions in some sensible order, Eglot will
+keep it.
+
+(github#190)
+
+** Flymake and Eldoc taken over completely while managing buffers.
+No longer try to add Eglot's facilities to existing facilities in
+these two domains.
+
+
+* Changes in Eglot 1.3 (10/12/2018)
+
+** Provide strict checking of incoming LSP messagesp.
+
+(github#144, github#156)
+
+** Add brief context after 'xref-find-references' when available.
+
+(github#52)
+
+** Support 'completionContext' to help servers like 'ccls'.
+
+** Use Flymake from GNU ELPA.
+
+(github#178)
+
+
+* Changes in Eglot 1.2 (23/11/2018)
+
+** Support snippet completions.
+Eglot uses 'yasnippet.el' for this, if it is installed.
+
+(github#50)
+
+** 'workspace/didChangeConfiguration' implemented.
+
+(github#29)
+
+** Handle experimental/unknown server methods gracefully.
+
+(github#39)
+
+** Accept functions as entries in 'eglot-server-programs'.
+'CONTACT' in the '(MAJOR-MODE . CONTACT)' association in
+'eglot-server-programs' can now be a function of no arguments
+producing any value previously valid for a contact.  Functions can be
+interactive or non-interactive.
+
+(github#63)
+
+** Improve completion to be snappier and don't hinder typing.
+
+(github#61)
+
+** Consider ':triggerCharacters' in company completion.
+
+(github#80)
+
+** Add support for LSP 'TextEdit' objects in completion.
+
+** Prefer ccls over cquery for C/C++
+
+(github#94)
+
+** 'eglot-ignored-server-capabilites' is more user-friendly.
+
+(github#126)
+
+** Supports asynchronous connections.
+If a connection to the server is taking too long, is will continue in
+the background.  A new defcustom 'eglot-sync-connect' controls this
+feature.
+
+(github#68)
+
+** The 'eglot-shutdown' command prompts for the server to shutdown.
+
+(github#73)
+
+** Add support for the Eclipse JDT language server.
+
+(github#63)
+
+** Add out-of-the-box support for Haskell, Kotlin, Go, Ocaml, R.
+
+** Add the ability to move to LSP-precise columns.
+Some servers like 'clangd' follow the UTF-16-based spec very closely
+here.
+
+(github#124)
+
+** Fix a potential security issue fontifying LSP doc.
+
+(github#154)
+
+** Fix many, many bugs
+
+(github#44, github#48, github#54, github#58, github#64, github#74,
+ github#81, github#82, github#86, github#87, github#83, github#93,
+ github#100, github#115, github#120, github#121, github#126,
+ github#138, github#144, github#158, github#160, github#167)
+
+
+* Changes in Eglot 1.1 (9/7/2018)
+
+** Implement TCP autostart/autoconnect (and support Ruby's Solargraph).
+The ':autoport' symbol in the server incovation is replaced
+dynamically by a local port believed to be vacant, so that the ensuing
+TCP connection finds a listening server.
+
+** Eglot now depends on Emacs library 'jsonrpc.el'.
+
+
+----------------------------------------------------------------------
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+
+Local Variables:
+bug-reference-bug-regexp: "\\(\\(github\\|bug\\)#\\([0-9]+\\)\\)"
+bug-reference-url-format: eglot--debbugs-or-github-bug-uri
+paragraph-separate: "[  ]"
+End:
+
diff --git a/etc/NEWS b/etc/NEWS
index bd7d9522ad7..5915ca7e74a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -250,8 +250,8 @@ from the available shortdoc information.
 This function inserts into the current buffer examples of use of a
 given Emacs Lisp function, which it gleans from the shortdoc
 information.  If you want 'describe-function' ('C-h f') to insert
-examples of using the function into regular *Help* buffers, add the
-following to you init file:
+examples of using the function into regular "*Help*" buffers, add the
+following to your init file:
 
     (add-hook 'help-fns-describe-function-functions
               #'shortdoc-help-fns-examples-function)
@@ -267,11 +267,11 @@ An optional major mode based on the tree-sitter library 
for editing
 HTML files.
 
 ---
-*** New major mode heex-ts-mode'.
+*** New major mode 'heex-ts-mode'.
 A major mode based on the tree-sitter library for editing HEEx files.
 
 ---
-*** New major mode elixir-ts-mode'.
+*** New major mode 'elixir-ts-mode'.
 A major mode based on the tree-sitter library for editing Elixir
 files.
 
diff --git a/etc/NEWS.29 b/etc/NEWS.29
index 01ab4b8a1db..a5f9f8c6ec1 100644
--- a/etc/NEWS.29
+++ b/etc/NEWS.29
@@ -3214,7 +3214,8 @@ Imenu now lists the members directly nested in R6RS 
Scheme libraries
 Emacs now comes with the Eglot package, which enhances various Emacs
 features, such as completion, documentation, error detection, etc.,
 based on data provided by language servers using the Language Server
-Protocol (LSP).  See the new Info manual "(eglot) Top" for more.
+Protocol (LSP).  See the new Info manual "(eglot) Top" for more.  Also
+see "etc/EGLOT-NEWS".
 
 +++
 ** use-package: Declarative package configuration.
@@ -4884,6 +4885,12 @@ two buttons: "Yes" and "No".
 ---
 *** 'process-attributes' is now implemented.
 
+** macOS
+
++++
+*** The 'ns-popup-font-panel' command has been removed.
+Use the general command 'M-x menu-set-font' instead.
+
 
 ----------------------------------------------------------------------
 This file is part of GNU Emacs.
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 6f3e922880d..5e696c091b2 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -1093,7 +1093,9 @@ NEW-NAME."
               (with-temp-buffer
                 (set-buffer-multibyte nil)
                 (archive--extract-file extractor copy ename)
-                (write-region (point-min) (point-max) write-to))
+                (let ((coding-system-for-write
+                       (or coding-system-for-write 'no-conversion)))
+                  (write-region (point-min) (point-max) write-to)))
             (unless (equal copy archive)
               (delete-file copy))))))))
 
@@ -1954,10 +1956,21 @@ This doesn't recover lost files, it just undoes changes 
in the buffer itself."
 ;; -------------------------------------------------------------------------
 ;;; Section: Zip Archives
 
+(declare-function w32-get-console-codepage "w32proc.c")
 (defun archive-zip-summarize ()
   (goto-char (- (point-max) (- 22 18)))
   (search-backward-regexp "[P]K\005\006")
   (let ((p (archive-l-e (+ (point) 16) 4))
+        (w32-fname-encoding
+         ;; On MS-Windows, both InfoZip's Zip and the system's
+         ;; built-in File Explorer use the console codepage for
+         ;; encoding file names.  Problem: the codepage of the system
+         ;; where the zip file was created cannot be known; we assume
+         ;; it is the same as the one of the current system.  Also,
+         ;; the zip file doesn't tell us the OS where the file was
+         ;; created, it only tells the filesystem.
+         (if (eq system-type 'windows-nt)
+             (intern (format "cp%d" (w32-get-console-codepage)))))
         files)
     (when (or (= p #xffffffff) (= p -1))
       ;; If the offset of end-of-central-directory is 0xFFFFFFFF, this
@@ -1987,7 +2000,15 @@ This doesn't recover lost files, it just undoes changes 
in the buffer itself."
              ;; (lheader (archive-l-e (+ p 42) 4))
              (efnname (let ((str (buffer-substring (+ p 46) (+ p 46 fnlen))))
                        (decode-coding-string
-                        str archive-file-name-coding-system)))
+                        str
+                         (or (if (and w32-fname-encoding
+                                      (memq creator
+                                            ;; This should be just 10 and
+                                            ;; 14, but InfoZip uses 0 and
+                                            ;; File Explorer uses 11(??).
+                                            '(0 10 11 14)))
+                                 w32-fname-encoding)
+                             archive-file-name-coding-system))))
              (ucsize  (if (and (or (= ucsize #xffffffff) (= ucsize -1))
                                (> exlen 0))
                           ;; APPNOTE.TXT, para 4.5.3: the Extra Field
diff --git a/lisp/epa-ks.el b/lisp/epa-ks.el
index 77d896fa438..015bf910ac6 100644
--- a/lisp/epa-ks.el
+++ b/lisp/epa-ks.el
@@ -140,8 +140,8 @@ Keys are marked using `epa-ks-mark-key-to-fetch'."
           (epa-ks--fetch-key id)))))
   (tabulated-list-clear-all-tags))
 
-(defun epa-ks--query-url (query exact)
-  "Return URL for QUERY.
+(defun epa-ks--query-url (query exact &optional operation)
+  "Return URL for QUERY and OPERATION (defaults to \"index\").
 If EXACT is non-nil, don't accept approximate matches."
   (format "https://%s/pks/lookup?%s";
           (cond ((null epa-keyserver)
@@ -154,13 +154,13 @@ If EXACT is non-nil, don't accept approximate matches."
           (url-build-query-string
            (append `(("search" ,query)
                      ("options" "mr")
-                     ("op" "index"))
+                     ("op" ,(or operation "index")))
                    (and exact '(("exact" "on")))))))
 
 (defun epa-ks--fetch-key (id)
   "Send request to import key with specified ID."
   (url-retrieve
-   (epa-ks--query-url (concat "0x" (url-hexify-string id)) t)
+   (epa-ks--query-url (concat "0x" (url-hexify-string id)) t "get")
    (lambda (status)
      (when (plist-get status :error)
        (error "Request failed: %s"
@@ -236,7 +236,7 @@ enough, since keyservers have strict timeout settings."
         (erase-buffer))
       (epa-ks-search-mode))
     (url-retrieve
-     (epa-ks--query-url query exact)
+     (epa-ks--query-url query exact "index")
      (lambda (status)
        (when (plist-get status :error)
          (when buf
diff --git a/lisp/files-x.el b/lisp/files-x.el
index 5fa0129e9d0..548d9efc193 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -681,8 +681,8 @@ variables for a connection profile are defined using
       (setq connection-local-criteria-alist
             (cons (cons criteria (delete-dups profiles))
                  connection-local-criteria-alist))))
-  (customize-set-variable
-   'connection-local-criteria-alist connection-local-criteria-alist))
+  (custom-set-variables
+   `(connection-local-criteria-alist ',connection-local-criteria-alist now)))
 
 (defsubst connection-local-get-profile-variables (profile)
   "Return the connection-local variable list for PROFILE."
@@ -702,8 +702,8 @@ variables are set in the server's process buffer according 
to the
 VARIABLES list of the connection profile.  The list is processed
 in order."
   (setf (alist-get profile connection-local-profile-alist) variables)
-  (customize-set-variable
-   'connection-local-profile-alist connection-local-profile-alist))
+  (custom-set-variables
+   `(connection-local-profile-alist ',connection-local-profile-alist now)))
 
 ;;;###autoload
 (defun connection-local-update-profile-variables (profile variables)
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index f583d116d20..3965d38bc3e 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -4,7 +4,7 @@
 
 ;; Author: João Távora <joaotavora@gmail.com>
 ;; Keywords: processes, languages, extensions
-;; Version: 1.0.16
+;; Version: 1.0.17
 ;; Package-Requires: ((emacs "25.2"))
 
 ;; This is a GNU ELPA :core package.  Avoid functionality that is not
@@ -43,7 +43,6 @@
 (eval-when-compile (require 'subr-x))
 (require 'warnings)
 (require 'pcase)
-(require 'ert) ; to escape a `condition-case-unless-debug'
 
 
 ;;; Public API
@@ -154,6 +153,14 @@ immediately."
   "Stop waiting for responses from the current JSONRPC CONNECTION."
   (clrhash (jsonrpc--request-continuations connection)))
 
+(defvar jsonrpc-inhibit-debug-on-error nil
+  "Inhibit `debug-on-error' when answering requests.
+Some extensions, notably ert.el, set `debug-on-error' to non-nil,
+which makes it hard to test the behaviour of catching the Elisp
+error and replying to the endpoint with an JSONRPC-error.  This
+variable can be set around calls like `jsonrpc-request' to
+circumvent that.")
+
 (defun jsonrpc-connection-receive (connection message)
   "Process MESSAGE just received from CONNECTION.
 This function will destructure MESSAGE and call the appropriate
@@ -166,7 +173,8 @@ dispatcher in CONNECTION."
       (cond
        (;; A remote request
         (and method id)
-        (let* ((debug-on-error (and debug-on-error (not (ert-running-test))))
+        (let* ((debug-on-error (and debug-on-error
+                                    (not jsonrpc-inhibit-debug-on-error)))
                (reply
                 (condition-case-unless-debug _ignore
                     (condition-case oops
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index 65b990682c1..fe46b220da5 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -3781,6 +3781,12 @@ and exists only for compatibility reasons.
 
 (put 'c-basic-offset 'safe-local-variable 'integerp)
 (put 'c-backslash-column 'safe-local-variable 'integerp)
+ (put 'c-font-lock-extra-types 'safe-local-variable #'c-list-of-strings)
+ (put 'c++-font-lock-extra-types 'safe-local-variable #'c-list-of-strings)
+ (put 'objc-font-lock-extra-types 'safe-local-variable #'c-list-of-strings)
+ (put 'java-font-lock-extra-types 'safe-local-variable #'c-list-of-strings)
+ (put 'idl-font-lock-extra-types 'safe-local-variable #'c-list-of-strings)
+ (put 'pike-font-lock-extra-types 'safe-local-variable #'c-list-of-strings)
 (put 'c-file-style 'safe-local-variable 'string-or-null-p)
 (register-definition-prefixes "cc-vars" '("awk-mode-hook" "c++-" "c-" 
"defcustom-c-stylevar" "idl-" "java-" "objc-" "pike-"))
 
@@ -9212,7 +9218,7 @@ Turn on EDT Emulation." t)
 
 ;;; Generated autoloads from progmodes/eglot.el
 
-(push (purecopy '(eglot 1 11)) package--builtin-versions)
+(push (purecopy '(eglot 1 12)) package--builtin-versions)
 (autoload 'eglot "eglot" "\
 Start LSP server in support of PROJECT's buffers under MANAGED-MAJOR-MODE.
 
@@ -9256,6 +9262,8 @@ INTERACTIVE is ignored and provided for backward 
compatibility.
 (autoload 'eglot-ensure "eglot" "\
 Start Eglot session for current buffer if there isn't one.")
 (put 'eglot-workspace-configuration 'safe-local-variable 'listp)
+(put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t)
+(defun eglot--debbugs-or-github-bug-uri nil (format (if (string= (match-string 
2) "github") "https://github.com/joaotavora/eglot/issues/%s"; 
"https://debbugs.gnu.org/%s";) (match-string 3)))
 (register-definition-prefixes "eglot" '("eglot-"))
 
 
@@ -9507,6 +9515,15 @@ optional prefix argument REINIT is non-nil.
 (register-definition-prefixes "elint" '("elint-"))
 
 
+;;; Generated autoloads from progmodes/elixir-ts-mode.el
+
+(autoload 'elixir-ts-mode "elixir-ts-mode" "\
+Major mode for editing Elixir, powered by tree-sitter.
+
+(fn)" t)
+(register-definition-prefixes "elixir-ts-mode" '("elixir-ts-"))
+
+
 ;;; Generated autoloads from emacs-lisp/elp.el
 
 (autoload 'elp-instrument-function "elp" "\
@@ -10178,7 +10195,7 @@ Look at CONFIG and try to expand GROUP.
 
 ;;; Generated autoloads from erc/erc.el
 
-(push (purecopy '(erc 5 4 1)) package--builtin-versions)
+(push (purecopy '(erc 5 5)) package--builtin-versions)
 (autoload 'erc-select-read-args "erc" "\
 Prompt the user for values of nick, server, port, and password.")
 (autoload 'erc "erc" "\
@@ -15099,6 +15116,15 @@ Prefix arg sets default accept amount temporarily.
 (register-definition-prefixes "hashcash" '("hashcash-"))
 
 
+;;; Generated autoloads from progmodes/heex-ts-mode.el
+
+(autoload 'heex-ts-mode "heex-ts-mode" "\
+Major mode for editing HEEx, powered by tree-sitter.
+
+(fn)" t)
+(register-definition-prefixes "heex-ts-mode" '("heex-ts-"))
+
+
 ;;; Generated autoloads from help-at-pt.el
 
 (autoload 'help-at-pt-string "help-at-pt" "\
@@ -18740,7 +18766,7 @@ Major mode for editing JSON, powered by tree-sitter.
 
 ;;; Generated autoloads from jsonrpc.el
 
-(push (purecopy '(jsonrpc 1 0 16)) package--builtin-versions)
+(push (purecopy '(jsonrpc 1 0 17)) package--builtin-versions)
 (register-definition-prefixes "jsonrpc" '("jsonrpc-"))
 
 
@@ -36942,7 +36968,7 @@ If LIMIT is non-nil, then do not consider characters 
beyond LIMIT.
 
 ;;; Generated autoloads from progmodes/xref.el
 
-(push (purecopy '(xref 1 6 2)) package--builtin-versions)
+(push (purecopy '(xref 1 6 3)) package--builtin-versions)
 (autoload 'xref-find-backend "xref")
 (define-obsolete-function-alias 'xref-pop-marker-stack #'xref-go-back "29.1")
 (autoload 'xref-go-back "xref" "\
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 64f45e7958d..d338201ab72 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -990,7 +990,7 @@ implementation will be used."
                                  (progn
                                    (goto-char (point-min))
                                    (not (search-forward "\n" nil t)))
-                               (tramp-accept-process-output p 0))
+                               (tramp-accept-process-output p))
                              (delete-region (point-min) (point)))
                            ;; Provide error buffer.  This shows only
                            ;; initial error messages; messages
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 266724c587f..c1ad37de1d2 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1469,7 +1469,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
        (set-process-sentinel p #'tramp-file-notify-process-sentinel)
        ;; There might be an error if the monitor is not supported.
        ;; Give the filter a chance to read the output.
-       (while (tramp-accept-process-output p 0))
+       (while (tramp-accept-process-output p))
        (unless (process-live-p p)
          (tramp-error
           p 'file-notify-error "Monitoring not supported for `%s'" file-name))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index a854ff42b0d..5227897fbec 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2424,6 +2424,10 @@ The method used must be an out-of-band method."
                      copy-program copy-args)))
                (tramp-message v 6 "%s" (string-join (process-command p) " "))
                (process-put p 'vector v)
+               ;; This is neded for ssh or PuTTY based processes, and
+               ;; only if the respective options are set.  Perhaps,
+               ;; the setting could be more fine-grained.
+               (process-put p 'shared-socket t)
                (process-put p 'adjust-window-size-function #'ignore)
                (set-process-query-on-exit-flag p nil)
 
@@ -3753,6 +3757,10 @@ Fall back to normal file name handler if no Tramp 
handler exists."
           (string-join sequence " "))
        (tramp-message v 6 "Run `%s', %S" (string-join sequence " ") p)
        (process-put p 'vector v)
+       ;; This is neded for ssh or PuTTY based processes, and only if
+       ;; the respective options are set.  Perhaps, the setting could
+       ;; be more fine-grained.
+       (process-put p 'shared-socket t)
        ;; Needed for process filter.
        (process-put p 'events events)
        (process-put p 'watch-name localname)
@@ -3761,7 +3769,7 @@ Fall back to normal file name handler if no Tramp handler 
exists."
        (set-process-sentinel p #'tramp-file-notify-process-sentinel)
        ;; There might be an error if the monitor is not supported.
        ;; Give the filter a chance to read the output.
-       (while (tramp-accept-process-output p 0))
+       (while (tramp-accept-process-output p))
        (unless (process-live-p p)
          (tramp-error
           p 'file-notify-error "Monitoring not supported for `%s'" file-name))
@@ -5116,6 +5124,10 @@ connection if a previous connection has died for some 
reason."
                ;; Set sentinel and query flag.  Initialize variables.
                (set-process-sentinel p #'tramp-process-sentinel)
                (process-put p 'vector vec)
+               ;; This is neded for ssh or PuTTY based processes, and
+               ;; only if the respective options are set.  Perhaps,
+               ;; the setting could be more fine-grained.
+               (process-put p 'shared-socket t)
                (process-put p 'adjust-window-size-function #'ignore)
                (set-process-query-on-exit-flag p nil)
                (setq tramp-current-connection (cons vec (current-time)))
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 1aa4520eeb6..bb4ab9e3057 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -757,7 +757,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
   "Read ACL data from connection buffer."
   (unless (process-live-p proc)
     ;; Accept pending output.
-    (while (tramp-accept-process-output proc 0))
+    (while (tramp-accept-process-output proc))
     (with-current-buffer (tramp-get-connection-buffer vec)
       ;; There might be a hidden password prompt.
       (widen)
@@ -1363,7 +1363,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
   "Set ACL data."
   (unless (process-live-p proc)
     ;; Accept pending output.
-    (while (tramp-accept-process-output proc 0))
+    (while (tramp-accept-process-output proc))
     (tramp-message
      vec 10 "\n%s" (tramp-get-buffer-string (tramp-get-connection-buffer vec)))
     (throw 'tramp-action 'ok)))
@@ -2023,7 +2023,7 @@ Removes smb prompt.  Returns nil if an error message has 
appeared."
 
       ;; Read pending output.
       (while (not (re-search-forward tramp-smb-prompt nil t))
-       (while (tramp-accept-process-output p 0))
+       (while (tramp-accept-process-output p))
        (goto-char (point-min)))
       (tramp-message vec 6 "\n%s" (buffer-string))
 
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index abb9afc570b..3cacde2468c 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -692,7 +692,7 @@ ID-FORMAT valid values are `string' and `integer'."
   "Check, whether a sudo process has finished.  Remove unneeded output."
   ;; There might be pending output for the exit status.
   (unless (process-live-p proc)
-    (while (tramp-accept-process-output proc 0))
+    (while (tramp-accept-process-output proc))
     ;; Delete narrowed region, it would be in the way reading a Lisp form.
     (goto-char (point-min))
     (widen)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 47173b95bea..b6e985db6b1 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -5087,6 +5087,11 @@ substitution.  SPEC-LIST is a list of char/value pairs 
used for
            ;; t.  See Bug#51177.
            (when filter
              (set-process-filter p filter))
+           (process-put p 'vector v)
+           ;; This is neded for ssh or PuTTY based processes, and
+           ;; only if the respective options are set.  Perhaps, the
+           ;; setting could be more fine-grained.
+           (process-put p 'shared-socket t)
            (process-put p 'remote-command orig-command)
            (tramp-set-connection-property p "remote-command" orig-command)
 
@@ -5489,7 +5494,7 @@ of."
   ;; There might be pending output.  Avoid problems with reentrant
   ;; call of Tramp.
   (ignore-errors
-    (while (tramp-accept-process-output proc 0)))
+    (while (tramp-accept-process-output proc)))
   (tramp-message proc 6 "Kill %S" proc)
   (delete-process proc))
 
@@ -5641,13 +5646,13 @@ Wait, until the connection buffer changes."
   "Check, whether a process has finished."
   (unless (process-live-p proc)
     ;; There might be pending output.
-    (while (tramp-accept-process-output proc 0))
+    (while (tramp-accept-process-output proc))
     (throw 'tramp-action 'process-died)))
 
 (defun tramp-action-out-of-band (proc vec)
   "Check, whether an out-of-band copy has finished."
   ;; There might be pending output for the exit status.
-  (while (tramp-accept-process-output proc 0))
+  (while (tramp-accept-process-output proc))
   (cond ((and (not (process-live-p proc))
              (zerop (process-exit-status proc)))
         (tramp-message vec 3 "Process has finished.")
@@ -5678,7 +5683,7 @@ See `tramp-process-actions' for the format of ACTIONS."
     (while (not found)
       ;; Reread output once all actions have been performed.
       ;; Obviously, the output was not complete.
-      (while (tramp-accept-process-output proc 0))
+      (while (tramp-accept-process-output proc))
       (setq todo actions)
       (while todo
        (setq item (pop todo)
@@ -5795,11 +5800,21 @@ Mostly useful to protect BODY from being interrupted by 
timers."
           ,@body)
        (tramp-flush-connection-property ,proc "locked"))))
 
-(defun tramp-accept-process-output (proc &optional timeout)
+(defun tramp-accept-process-output (proc &optional _timeout)
   "Like `accept-process-output' for Tramp processes.
 This is needed in order to hide `last-coding-system-used', which is set
 for process communication also.
 If the user quits via `C-g', it is propagated up to `tramp-file-name-handler'."
+  (declare (advertised-calling-convention (proc) "29.2"))
+  ;; There could be other processes which use the same socket for
+  ;; communication.  This could block the output for the current
+  ;; process.  Read such output first.  (Bug#61350)
+  (when-let (((process-get proc 'shared-socket))
+            (v (process-get proc 'vector)))
+    (dolist (p (delq proc (process-list)))
+      (when (tramp-file-name-equal-p v (process-get p 'vector))
+       (accept-process-output p 0 nil t))))
+
   (with-current-buffer (process-buffer proc)
     (let ((inhibit-read-only t)
          last-coding-system-used
@@ -5809,10 +5824,10 @@ If the user quits via `C-g', it is propagated up to 
`tramp-file-name-handler'."
        ;; JUST-THIS-ONE is set due to Bug#12145.  `with-local-quit'
        ;; returns t in order to report success.
        (if (with-local-quit
-             (setq result (accept-process-output proc timeout nil t)) t)
+             (setq result (accept-process-output proc 0 nil t)) t)
            (tramp-message
-            proc 10 "%s %s %s %s\n%s"
-            proc timeout (process-status proc) result (buffer-string))
+            proc 10 "%s %s %s\n%s"
+            proc (process-status proc) result (buffer-string))
          ;; Propagate quit.
          (keyboard-quit)))
       result)))
@@ -6825,7 +6840,7 @@ name of a process or buffer, or nil to default to the 
current buffer."
                  (tramp-get-remote-null-device (process-get proc 'vector))))
        ;; Wait, until the process has disappeared.  If it doesn't,
        ;; fall back to the default implementation.
-        (while (tramp-accept-process-output proc 0))
+        (while (tramp-accept-process-output proc))
        (not (process-live-p proc))))))
 
 (add-hook 'interrupt-process-functions #'tramp-interrupt-process)
diff --git a/lisp/novice.el b/lisp/novice.el
index c3549acef3e..05e4bfc91c9 100644
--- a/lisp/novice.el
+++ b/lisp/novice.el
@@ -79,16 +79,22 @@ If nil, the feature is disabled, i.e., all commands work 
normally.")
 Do you want to use this command anyway?
 
 You can now type:
- \\`y'    to try it and enable it (no questions if you use it again).
- \\`n'    to cancel--don't try the command, and it remains disabled.
+ \\`n'    (also C-g) to cancel--don't try the command; it remains disabled.
+ \\`y'    to enable the command (no questions if you use it again).
  \\`SPC'  to try the command just this once, but leave it disabled.
- \\`!'    to try it, and enable all disabled commands for this session 
only.")))
+ \\`!'    to enable it and all the disabled commands for this session.")))
          (char
+          ;; Note: the prompt produced from the choices below must not
+          ;; overflow a single screen line, because otherwise it will
+          ;; cause the mini-window to resize, which will in turn hide
+          ;; the last line of the help text above: the code which fits
+          ;; the window to the size of the help text does not expect
+          ;; the mini-window to become taller.
           (car (read-multiple-choice "Use this command?"
-                                     '((?y "yes")
-                                       (?n "no")
-                                       (?! "yes; enable for session")
-                                       (?\s "(space bar) yes; once"))
+                                     '((?n "no")
+                                       (?y "yes")
+                                       (?\s "(space bar) only once")
+                                       (?! "use and enable all"))
                                      help-string
                                      "*Disabled Command*"))))
     (pcase char
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index 8c44647ec3e..209b44824e4 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -961,9 +961,9 @@ the semicolon.  This function skips the semicolon."
   ;; Imenu.
   (setq-local treesit-simple-imenu-settings
               (let ((pred #'c-ts-mode--defun-valid-p))
-                `(("Struct" ,(rx bos (or "struct" "enum" "union")
-                                 "_specifier" eos)
-                   ,pred nil)
+                `(("Enum" "\\`enum_specifier\\'" ,pred nil)
+                  ("Struct" "\\`struct_specifier\\'" ,pred nil)
+                  ("Union" "\\`union_specifier\\'" ,pred nil)
                   ("Variable" ,(rx bos "declaration" eos) ,pred nil)
                   ("Function" "\\`function_definition\\'" ,pred nil)
                   ("Class" ,(rx bos (or "class_specifier"
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 7b2341f3f49..037cc87148f 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2,12 +2,12 @@
 
 ;; Copyright (C) 2018-2023 Free Software Foundation, Inc.
 
-;; Version: 1.11
+;; Version: 1.12
 ;; Author: João Távora <joaotavora@gmail.com>
 ;; Maintainer: João Távora <joaotavora@gmail.com>
 ;; URL: https://github.com/joaotavora/eglot
 ;; Keywords: convenience, languages
-;; Package-Requires: ((emacs "26.3") (jsonrpc "1.0.16") (flymake "1.2.1") 
(project "0.9.3") (xref "1.4.0") (eldoc "1.11.0") (seq "2.23") 
(external-completion "0.1"))
+;; Package-Requires: ((emacs "26.3") (jsonrpc "1.0.16") (flymake "1.2.1") 
(project "0.9.8") (xref "1.6.2") (eldoc "1.11.0") (seq "2.23") 
(external-completion "0.1"))
 
 ;; This is a GNU ELPA :core package.  Avoid adding functionality
 ;; that is not available in the version of Emacs recorded above or any
@@ -1155,12 +1155,12 @@ INTERACTIVE is t if called interactively."
     (cl-labels
         ((maybe-connect
            ()
-           (remove-hook 'post-command-hook #'maybe-connect nil)
            (eglot--when-live-buffer buffer
+             (remove-hook 'post-command-hook #'maybe-connect t)
              (unless eglot--managed-mode
                (apply #'eglot--connect (eglot--guess-contact))))))
       (when buffer-file-name
-        (add-hook 'post-command-hook #'maybe-connect 'append nil)))))
+        (add-hook 'post-command-hook #'maybe-connect 'append t)))))
 
 (defun eglot-events-buffer (server)
   "Display events buffer for SERVER.
@@ -3666,13 +3666,14 @@ If NOERROR, return predicate, else erroring function."
 
 ;;; Misc
 ;;;
-(defun eglot--debbugs-or-github-bug-uri ()
-  (format (if (string= (match-string 2) "github")
-              "https://github.com/joaotavora/eglot/issues/%s";
-            "https://debbugs.gnu.org/%s";)
-          (match-string 3)))
-(put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t)
-
+;;;###autoload
+(progn
+  (put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t)
+  (defun eglot--debbugs-or-github-bug-uri ()
+    (format (if (string= (match-string 2) "github")
+                "https://github.com/joaotavora/eglot/issues/%s";
+              "https://debbugs.gnu.org/%s";)
+            (match-string 3))))
 ;;; Obsolete
 ;;;
 
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index 1115eadde7f..47d87112ffb 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -36,6 +36,8 @@
 (declare-function treesit-node-start "treesit.c")
 (declare-function treesit-node-type "treesit.c")
 (declare-function treesit-node-child-by-field-name "treesit.c")
+(declare-function treesit-node-child-by-field-name "treesit.c")
+(declare-function treesit-query-capture "treesit.c")
 
 (defcustom java-ts-mode-indent-offset 4
   "Number of spaces for each indentation step in `java-ts-mode'."
@@ -145,6 +147,16 @@
     "|=" "~" ">>" ">>>" "<<" "::" "?" "&=")
   "Java operators for tree-sitter font-locking.")
 
+(defun java-ts-mode--string-highlight-helper ()
+"Returns, for strings, a query based on what is supported by
+the available version of Tree-sitter for java."
+  (condition-case nil
+      (progn (treesit-query-capture 'java '((text_block) 
@font-lock-string-face))
+            `((string_literal) @font-lock-string-face
+              (text_block) @font-lock-string-face))
+    (error
+     `((string_literal) @font-lock-string-face))))
+
 (defvar java-ts-mode--font-lock-settings
   (treesit-font-lock-rules
    :language 'java
@@ -182,8 +194,7 @@
    :language 'java
    :override t
    :feature 'string
-   `((string_literal) @font-lock-string-face
-     (text_block) @font-lock-string-face)
+   (java-ts-mode--string-highlight-helper)
    :language 'java
    :override t
    :feature 'literal
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 630250c15c3..8793fdc6458 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -426,7 +426,7 @@ This variant of `rx' supports common Python named REGEXPS."
                                              (or "def" "for" "with")))
                                     symbol-end))
             (dedenter          (seq symbol-start
-                                    (or "elif" "else" "except" "finally")
+                                    (or "elif" "else" "except" "finally" 
"case")
                                     symbol-end))
             (block-ender       (seq symbol-start
                                     (or
@@ -2062,10 +2062,6 @@ of the statement."
                        ;; are somehow out of whack.  This has been
                        ;; observed when using `syntax-ppss' during
                        ;; narrowing.
-                       ;; It can also fail in cases where the buffer is in
-                       ;; the process of being modified, e.g. when creating
-                       ;; a string with `electric-pair-mode' disabled such
-                       ;; that there can be an unmatched single quote
                        (when (>= string-start last-string-end)
                          (goto-char string-start)
                          (if (python-syntax-context 'paren)
@@ -2076,10 +2072,16 @@ of the statement."
                            (goto-char (+ (point)
                                          (python-syntax-count-quotes
                                           (char-after (point)) (point))))
-                           (setq last-string-end
-                                 (or (re-search-forward
-                                      (rx (syntax string-delimiter)) nil t)
-                                     (goto-char (point-max)))))))
+                           (setq
+                            last-string-end
+                            (or (if (eq t (nth 3 (syntax-ppss)))
+                                    (re-search-forward
+                                     (rx (syntax string-delimiter)) nil t)
+                                  (ignore-error scan-error
+                                    (goto-char string-start)
+                                    (python-nav--lisp-forward-sexp)
+                                    (point)))
+                                (goto-char (point-max)))))))
                       ((python-syntax-context 'paren)
                        ;; The statement won't end before we've escaped
                        ;; at least one level of parenthesis.
@@ -2148,10 +2150,7 @@ backward to previous statement."
       (while (and (forward-line 1)
                   (not (eobp))
                   (or (and (> (current-indentation) block-indentation)
-                           (let ((start (point)))
-                             (python-nav-end-of-statement)
-                             ;; must move forward otherwise infinite loop
-                             (> (point) start)))
+                           (or (python-nav-end-of-statement) t))
                       (python-info-current-line-comment-p)
                       (python-info-current-line-empty-p))))
       (python-util-forward-comment -1)
@@ -5784,7 +5783,8 @@ likely an invalid python file."
                (pairs '(("elif" "elif" "if")
                         ("else" "if" "elif" "except" "for" "while")
                         ("except" "except" "try")
-                        ("finally" "else" "except" "try")))
+                        ("finally" "else" "except" "try")
+                        ("case" "case")))
                (dedenter (match-string-no-properties 0))
                (possible-opening-blocks (cdr (assoc-string dedenter pairs)))
                (collected-indentations)
@@ -5793,7 +5793,9 @@ likely an invalid python file."
             (while (python-nav--syntactically
                     (lambda ()
                       (cl-loop while (re-search-backward (python-rx 
block-start) nil t)
-                               if (memq (char-before) '(nil ?\s ?\t ?\n))
+                               if (save-match-data
+                                    (looking-back (rx line-start (* 
whitespace))
+                                                  (line-beginning-position)))
                                return t))
                     #'<)
               (let ((indentation (current-indentation)))
diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el
index b2842c33d29..d077c43ba52 100644
--- a/lisp/progmodes/ruby-ts-mode.el
+++ b/lisp/progmodes/ruby-ts-mode.el
@@ -1026,7 +1026,7 @@ leading double colon is not added."
                               (:match "\\`?[#\"'`:?]" @char))
                              ;; Symbols like :+, :<=> or :foo=.
                              ((simple_symbol) @symbol
-                              (:match "[[:punct:]]" @symbol))
+                              (:match "\\s." @symbol))
                              ;; Method calls with name ending with ? or !.
                              ((call method: (identifier) @ident)
                               (:match "[?!]\\'" @ident))
@@ -1058,7 +1058,9 @@ leading double colon is not added."
          (put-text-property (1- (treesit-node-end node)) (treesit-node-end 
node)
                             'syntax-table (string-to-syntax "_")))
         ('symbol
-         (put-text-property (1+ (treesit-node-start node)) (treesit-node-end 
node)
+         (goto-char (treesit-node-end node))
+         (skip-syntax-backward "." (treesit-node-start node))
+         (put-text-property (point) (treesit-node-end node)
                             'syntax-table (string-to-syntax "_")))
         ('heredoc
          (put-text-property (treesit-node-start node) (1+ (treesit-node-start 
node))
diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el
index 696c2633231..be06acde3e3 100644
--- a/lisp/progmodes/rust-ts-mode.el
+++ b/lisp/progmodes/rust-ts-mode.el
@@ -91,6 +91,7 @@
      ((parent-is "let_declaration") parent-bol rust-ts-mode-indent-offset)
      ((parent-is "macro_definition") parent-bol rust-ts-mode-indent-offset)
      ((parent-is "parameters") parent-bol rust-ts-mode-indent-offset)
+     ((parent-is "struct_pattern") parent-bol rust-ts-mode-indent-offset)
      ((parent-is "token_tree") parent-bol rust-ts-mode-indent-offset)
      ((parent-is "use_list") parent-bol rust-ts-mode-indent-offset)))
   "Tree-sitter indent rules for `rust-ts-mode'.")
@@ -235,6 +236,7 @@
        
"^\\(u8\\|u16\\|u32\\|u64\\|u128\\|usize\\|i8\\|i16\\|i32\\|i64\\|i128\\|isize\\|char\\|str\\)$"
        @font-lock-type-face))
      ((scoped_identifier path: (identifier) @rust-ts-mode--fontify-scope))
+     ((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope))
      (type_identifier) @font-lock-type-face)
 
    :language 'rust
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 38c424402a0..d4e34f7e55a 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1,7 +1,7 @@
 ;;; xref.el --- Cross-referencing commands              -*-lexical-binding:t-*-
 
 ;; Copyright (C) 2014-2023 Free Software Foundation, Inc.
-;; Version: 1.6.2
+;; Version: 1.6.3
 ;; Package-Requires: ((emacs "26.1"))
 
 ;; This is a GNU ELPA :core package.  Avoid functionality that is not
@@ -981,7 +981,7 @@ point."
     map))
 
 (declare-function outline-search-text-property "outline"
-                 (property &optional value bound move backward looking-at))
+                  (property &optional value bound move backward looking-at))
 
 (define-derived-mode xref--xref-buffer-mode special-mode "XREF"
   "Mode for displaying cross-references."
@@ -993,14 +993,14 @@ point."
   (setq imenu-extract-index-name-function
         #'xref--imenu-extract-index-name)
   (setq-local add-log-current-defun-function
-             #'xref--add-log-current-defun)
-  (setq-local outline-minor-mode-cycle t
-              outline-minor-mode-use-buttons 'insert
-              outline-search-function
+              #'xref--add-log-current-defun)
+  (setq-local outline-minor-mode-cycle t)
+  (setq-local outline-minor-mode-use-buttons 'insert)
+  (setq-local outline-search-function
               (lambda (&optional bound move backward looking-at)
                 (outline-search-text-property
-                 'xref-group nil bound move backward looking-at))
-              outline-level (lambda () 1)))
+                 'xref-group nil bound move backward looking-at)))
+  (setq-local outline-level (lambda () 1)))
 
 (defvar xref--transient-buffer-mode-map
   (let ((map (make-sparse-keymap)))
diff --git a/lisp/server.el b/lisp/server.el
index 89aedc72d52..608e5df3a5b 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1941,10 +1941,10 @@ returns the process ID of the Emacs instance running 
\"server\".
 
 This function signals `error' if it could not contact the server.
 
-This function signals `server-return-invalid-read-syntax' if it
-couldn't read the result of evaluation printed by the server.
-This will occur whenever the result of evaluating FORM is something
-not readably printable."
+This function signals `server-return-invalid-read-syntax' if
+`read' fails on the result returned by the server.
+This will occur whenever the result of evaluating FORM is
+something that cannot be printed readably."
   (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))
          (server-file (expand-file-name server server-dir))
          (coding-system-for-read 'binary)
diff --git a/src/emacs.c b/src/emacs.c
index 3df98e6fae2..d75a83ab9d8 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2024,7 +2024,7 @@ Using an Emacs configured with --with-x-toolkit=lucid 
does not have this problem
   /* Do less garbage collection in batch mode (since these tend to be
      more short-lived, and the memory is returned to the OS on exit
      anyway).  */
-  Vgc_cons_percentage = make_float (noninteractive? 1.0: 0.1);
+  Vgc_cons_percentage = make_float (noninteractive && initialized ? 1.0 : 0.1);
 
   no_loadup
     = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
diff --git a/test/lisp/files-x-tests.el b/test/lisp/files-x-tests.el
index f79118fd564..4e14ae68fb8 100644
--- a/test/lisp/files-x-tests.el
+++ b/test/lisp/files-x-tests.el
@@ -66,7 +66,9 @@
   "Test setting connection-local profile variables."
 
   ;; Declare (PROFILE VARIABLES) objects.
-  (let (connection-local-profile-alist connection-local-criteria-alist)
+  (let ((clpa connection-local-profile-alist)
+       (clca connection-local-criteria-alist)
+        connection-local-profile-alist connection-local-criteria-alist)
     (connection-local-set-profile-variables
      'remote-bash files-x-test--variables1)
     (should
@@ -94,13 +96,20 @@
     (should
      (equal
       (connection-local-get-profile-variables 'remote-nullfile)
-      files-x-test--variables4))))
+      files-x-test--variables4))
+
+    ;; Cleanup.
+    (custom-set-variables
+     `(connection-local-profile-alist ',clpa now)
+     `(connection-local-criteria-alist ',clca now))))
 
 (ert-deftest files-x-test-connection-local-update-profile-variables ()
   "Test updating connection-local profile variables."
 
   ;; Declare (PROFILE VARIABLES) objects.
-  (let (connection-local-profile-alist connection-local-criteria-alist)
+  (let ((clpa connection-local-profile-alist)
+       (clca connection-local-criteria-alist)
+        connection-local-profile-alist connection-local-criteria-alist)
     (connection-local-set-profile-variables
      'remote-bash (copy-alist files-x-test--variables1))
     (should
@@ -116,13 +125,20 @@
      (equal
       (connection-local-get-profile-variables 'remote-bash)
       (cons (car files-x-test--variables2)
-            (cdr files-x-test--variables1))))))
+            (cdr files-x-test--variables1))))
+
+    ;; Cleanup.
+    (custom-set-variables
+     `(connection-local-profile-alist ',clpa now)
+     `(connection-local-criteria-alist ',clca now))))
 
 (ert-deftest files-x-test-connection-local-set-profiles ()
   "Test setting connection-local profiles."
 
   ;; Declare (CRITERIA PROFILES) objects.
-  (let (connection-local-profile-alist connection-local-criteria-alist)
+  (let ((clpa connection-local-profile-alist)
+       (clca connection-local-criteria-alist)
+        connection-local-profile-alist connection-local-criteria-alist)
     (connection-local-set-profile-variables
      'remote-bash files-x-test--variables1)
     (connection-local-set-profile-variables
@@ -205,12 +221,19 @@
       '(remote-bash remote-ksh remote-nullfile)))
 
     ;; A criteria other than plist is wrong.
-    (should-error (connection-local-set-profiles 'dummy))))
+    (should-error (connection-local-set-profiles 'dummy))
+
+    ;; Cleanup.
+    (custom-set-variables
+     `(connection-local-profile-alist ',clpa now)
+     `(connection-local-criteria-alist ',clca now))))
 
 (ert-deftest files-x-test-hack-connection-local-variables-apply ()
   "Test setting connection-local variables."
 
-  (let (connection-local-profile-alist connection-local-criteria-alist)
+  (let ((clpa connection-local-profile-alist)
+       (clca connection-local-criteria-alist)
+        connection-local-profile-alist connection-local-criteria-alist)
 
     (connection-local-set-profile-variables
      'remote-bash files-x-test--variables1)
@@ -302,13 +325,18 @@
         (hack-connection-local-variables-apply nil)
         (should-not connection-local-variables-alist)
         (should-not (local-variable-p 'remote-shell-file-name))
-        (should-not (boundp 'remote-shell-file-name))))))
+        (should-not (boundp 'remote-shell-file-name))))
+
+    ;; Cleanup.
+    (custom-set-variables
+     `(connection-local-profile-alist ',clpa now)
+     `(connection-local-criteria-alist ',clca now))))
 
 (ert-deftest files-x-test-with-connection-local-variables ()
   "Test setting connection-local variables."
 
-  (let ((connection-local-profile-alist connection-local-profile-alist)
-        (connection-local-criteria-alist connection-local-criteria-alist))
+  (let ((clpa connection-local-profile-alist)
+       (clca connection-local-criteria-alist))
     (connection-local-set-profile-variables
      'remote-bash files-x-test--variables1)
     (connection-local-set-profile-variables
@@ -385,7 +413,12 @@
        (should-not (local-variable-p 'remote-null-device))
        ;; The variable values are reset.
        (should-not (boundp 'remote-shell-file-name))
-       (should (string-equal (symbol-value 'remote-null-device) "null"))))))
+       (should (string-equal (symbol-value 'remote-null-device) "null"))))
+
+    ;; Cleanup.
+    (custom-set-variables
+     `(connection-local-profile-alist ',clpa now)
+     `(connection-local-criteria-alist ',clca now))))
 
 (defun files-x-test--get-lazy-var ()
   "Get the connection-local value of `remote-lazy-var'.
@@ -405,7 +438,9 @@ If it's not initialized yet, initialize it."
 
 (ert-deftest files-x-test-setq-connection-local ()
   "Test dynamically setting connection local variables."
-  (let (connection-local-profile-alist connection-local-criteria-alist)
+  (let ((clpa connection-local-profile-alist)
+       (clca connection-local-criteria-alist)
+        connection-local-profile-alist connection-local-criteria-alist)
     (connection-local-set-profile-variables
      'remote-lazy files-x-test--variables5)
     (connection-local-set-profiles
@@ -440,7 +475,12 @@ If it's not initialized yet, initialize it."
       (should (equal (files-x-test--get-lazy-var) "there"))
       (with-connection-local-application-variables
           (cadr files-x-test--application)
-        (should (equal remote-null-device "null"))))))
+        (should (equal remote-null-device "null"))))
+
+    ;; Cleanup.
+    (custom-set-variables
+     `(connection-local-profile-alist ',clpa now)
+     `(connection-local-criteria-alist ',clca now))))
 
 (provide 'files-x-tests)
 ;;; files-x-tests.el ends here
diff --git a/test/lisp/jsonrpc-tests.el b/test/lisp/jsonrpc-tests.el
index a595167d130..85ac96a931c 100644
--- a/test/lisp/jsonrpc-tests.el
+++ b/test/lisp/jsonrpc-tests.el
@@ -124,7 +124,7 @@
   "Signals an -32603 JSONRPC error."
   (jsonrpc--with-emacsrpc-fixture (conn)
     (condition-case err
-        (progn
+        (let ((jsonrpc-inhibit-debug-on-error t))
           (jsonrpc-request conn '+ ["a" 2])
           (ert-fail "A `jsonrpc-error' should have been signaled!"))
       (jsonrpc-error
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index b6ad2e2f219..677dd35d796 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4592,9 +4592,11 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
              (should-not (file-name-completion "a" tmp-name))
              ;; `file-name-completion' should not err out if
              ;; directory does not exist.  (Bug#61890)
-             (should-not
-              (file-name-completion
-               "a" (tramp-compat-file-name-concat tmp-name "fuzz")))
+             ;; Ange-FTP does not support this.
+             (unless (tramp--test-ange-ftp-p)
+               (should-not
+                (file-name-completion
+                 "a" (tramp-compat-file-name-concat tmp-name "fuzz"))))
              ;; Ange-FTP does not support predicates.
              (unless (tramp--test-ange-ftp-p)
                (should
@@ -5971,6 +5973,8 @@ INPUT, if non-nil, is a string sent to the process."
         (enable-remote-dir-locals t)
          (inhibit-message t)
         kill-buffer-query-functions
+        (clpa connection-local-profile-alist)
+        (clca connection-local-criteria-alist)
         connection-local-profile-alist connection-local-criteria-alist)
     (unwind-protect
        (progn
@@ -6019,6 +6023,9 @@ INPUT, if non-nil, is a string sent to the process."
            (kill-buffer (current-buffer))))
 
       ;; Cleanup.
+      (custom-set-variables
+       `(connection-local-profile-alist ',clpa now)
+       `(connection-local-criteria-alist ',clca now))
       (ignore-errors (delete-directory tmp-name1 'recursive)))))
 
 (ert-deftest tramp-test34-explicit-shell-file-name ()
@@ -6029,6 +6036,8 @@ INPUT, if non-nil, is a string sent to the process."
 
   (let ((default-directory ert-remote-temporary-file-directory)
        explicit-shell-file-name kill-buffer-query-functions
+       (clpa connection-local-profile-alist)
+       (clca connection-local-criteria-alist)
        connection-local-profile-alist connection-local-criteria-alist)
     (unwind-protect
        (progn
@@ -6060,6 +6069,9 @@ INPUT, if non-nil, is a string sent to the process."
 
       ;; Cleanup.
       (put 'explicit-shell-file-name 'permanent-local nil)
+      (custom-set-variables
+       `(connection-local-profile-alist ',clpa now)
+       `(connection-local-criteria-alist ',clca now))
       (kill-buffer "*shell*"))))
 
 (ert-deftest tramp-test35-exec-path ()
@@ -7387,10 +7399,12 @@ This is needed in timer functions as well as process 
filters and sentinels."
   "Check parallel asynchronous requests.
 Such requests could arrive from timers, process filters and
 process sentinels.  They shall not disturb each other."
-  :tags (append '(:expensive-test :tramp-asynchronous-processes)
-               (and (or (getenv "EMACS_HYDRA_CI")
-                         (getenv "EMACS_EMBA_CI"))
-                     '(:unstable)))
+  ;; :tags (append '(:expensive-test :tramp-asynchronous-processes)
+  ;;           (and (or (getenv "EMACS_HYDRA_CI")
+  ;;                        (getenv "EMACS_EMBA_CI"))
+  ;;                    '(:unstable)))
+  ;; It doesn't work sufficiently.
+  :tags '(:expensive-test :tramp-asynchronous-processes :unstable)
   (skip-unless (tramp--test-enabled))
   (skip-unless (tramp--test-supports-processes-p))
   (skip-unless (not (tramp--test-container-p)))
diff --git a/test/lisp/progmodes/eglot-tests.el 
b/test/lisp/progmodes/eglot-tests.el
index 7a90d68d213..b95e527c510 100644
--- a/test/lisp/progmodes/eglot-tests.el
+++ b/test/lisp/progmodes/eglot-tests.el
@@ -59,6 +59,11 @@
 
 ;;; Helpers
 
+(defun eglot--test-message (format &rest args)
+  "Message out with FORMAT with ARGS."
+  (message "[eglot-tests] %s"
+           (apply #'format format args)))
+
 (defmacro eglot--with-fixture (fixture &rest body)
   "Setup FIXTURE, call BODY, teardown FIXTURE.
 FIXTURE is a list.  Its elements are of the form (FILE . CONTENT)
@@ -102,6 +107,7 @@ then restored."
              (push (cons (car spec) (symbol-value (car spec))) syms-to-restore)
              (set (car spec) (cadr spec)))
             ((stringp (car spec)) (push spec file-specs))))
+    (eglot--test-message "[%s]: test start" (ert-test-name (ert-running-test)))
     (unwind-protect
         (let* ((process-environment
                 (append
@@ -126,8 +132,8 @@ then restored."
           (setq created-files (mapcan #'eglot--make-file-or-dir file-specs))
           (prog1 (funcall fn)
             (setq test-body-successful-p t)))
-      (eglot--message
-       "Test body was %s" (if test-body-successful-p "OK" "A FAILURE"))
+      (eglot--test-message "[%s]: %s" (ert-test-name (ert-running-test))
+                           (if test-body-successful-p "OK" "FAILED"))
       (unwind-protect
           (let ((eglot-autoreconnect nil))
             (dolist (server new-servers)
@@ -136,8 +142,7 @@ then restored."
                     (eglot-shutdown
                      server nil 3 (not test-body-successful-p))
                   (error
-                   (eglot--message "Non-critical shutdown error after test: %S"
-                                   oops))))
+                   (eglot--test-message "Non-critical cleanup error: %S" 
oops))))
               (when (not test-body-successful-p)
                 ;; We want to do this after the sockets have
                 ;; shut down such that any pending data has been
@@ -150,21 +155,21 @@ then restored."
                                           (jsonrpc-events-buffer server)))))
                   (cond (noninteractive
                          (dolist (buffer buffers)
-                           (eglot--message "%s:" (buffer-name buffer))
+                           (eglot--test-message "contents of `%s':" 
(buffer-name buffer))
                            (princ (with-current-buffer buffer (buffer-string))
                                   'external-debugging-output)))
                         (t
-                         (eglot--message "Preserved for inspection: %s"
-                                         (mapconcat #'buffer-name buffers ", 
"))))))))
+                         (eglot--test-message "Preserved for inspection: %s"
+                                              (mapconcat #'buffer-name buffers 
", "))))))))
         (eglot--cleanup-after-test fixture-directory created-files 
syms-to-restore)))))
 
 (defun eglot--cleanup-after-test (fixture-directory created-files 
syms-to-restore)
   (let ((buffers-to-delete
          (delete nil (mapcar #'find-buffer-visiting created-files))))
-    (eglot--message "Killing %s, wiping %s, restoring %s"
-                    buffers-to-delete
-                    fixture-directory
-                    (mapcar #'car syms-to-restore))
+    (eglot--test-message "Killing %s, wiping %s, restoring %s"
+                         buffers-to-delete
+                         fixture-directory
+                         (mapcar #'car syms-to-restore))
     (cl-loop for (sym . val) in syms-to-restore
              do (set sym val))
     (dolist (buf buffers-to-delete) ;; have to save otherwise will get prompted
@@ -252,12 +257,12 @@ then restored."
        (advice-remove #'jsonrpc--log-event ',log-event-ad-sym))))
 
 (cl-defmacro eglot--wait-for ((events-sym &optional (timeout 1) message) args 
&body body)
-  "Spin until FN match in EVENTS-SYM, flush events after it.
-Pass TIMEOUT to `eglot--with-timeout'."
   (declare (indent 2) (debug (sexp sexp sexp &rest form)))
   `(eglot--with-timeout '(,timeout ,(or message
                                         (format "waiting for:\n%s" 
(pp-to-string body))))
-     (let ((event
+     (eglot--test-message "waiting for `%s'" (with-output-to-string
+                                               (mapc #'princ ',body)))
+     (let ((events
             (cl-loop thereis (cl-loop for json in ,events-sym
                                       for method = (plist-get json :method)
                                       when (keywordp method)
@@ -271,16 +276,21 @@ Pass TIMEOUT to `eglot--with-timeout'."
                                       collect json into before)
                      for i from 0
                      when (zerop (mod i 5))
-                     ;; do (eglot--message "still struggling to find in %s"
-                     ;;                    ,events-sym)
+                     ;; do (eglot--test-message "still struggling to find in 
%s"
+                     ;;                         ,events-sym)
                      do
                      ;; `read-event' is essential to have the file
                      ;; watchers come through.
-                     (read-event "[eglot] Waiting a bit..." nil 0.1)
+                     (cond ((fboundp 'flush-standard-output)
+                            (read-event nil nil 0.1) (princ ".")
+                            (flush-standard-output))
+                           (t
+                            (read-event "." nil 0.1)))
                      (accept-process-output nil 0.1))))
-       (setq ,events-sym (cdr event))
-       (eglot--message "Event detected:\n%s"
-                       (pp-to-string (car event))))))
+       (setq ,events-sym (cdr events))
+       (cl-destructuring-bind (&key method id &allow-other-keys) (car events)
+         (eglot--test-message "detected: %s"
+                              (or method (and id (format "id=%s" id))))))))
 
 ;; `rust-mode' is not a part of Emacs, so we define these two shims
 ;; which should be more than enough for testing.
@@ -407,7 +417,7 @@ Pass TIMEOUT to `eglot--with-timeout'."
                           )
           (should (eglot--tests-connect))
           (let (register-id)
-            (eglot--wait-for (s-requests 1)
+            (eglot--wait-for (s-requests 3)
                 (&key id method &allow-other-keys)
               (setq register-id id)
               (string= method "client/registerCapability"))
@@ -434,7 +444,7 @@ Pass TIMEOUT to `eglot--with-timeout'."
         (eglot--find-file-noselect "diag-project/main.c")
       (eglot--sniffing (:server-notifications s-notifs)
         (eglot--tests-connect)
-        (eglot--wait-for (s-notifs 2)
+        (eglot--wait-for (s-notifs 10)
             (&key _id method &allow-other-keys)
           (string= method "textDocument/publishDiagnostics"))
         (flymake-start)
@@ -444,16 +454,19 @@ Pass TIMEOUT to `eglot--with-timeout'."
 
 (ert-deftest eglot-test-diagnostic-tags-unnecessary-code ()
   "Test rendering of diagnostics tagged \"unnecessary\"."
-  (skip-unless (executable-find "rust-analyzer"))
-  (skip-unless (executable-find "cargo"))
+  (skip-unless (executable-find "clangd"))
   (eglot--with-fixture
-      '(("diagnostic-tag-project" .
-         (("main.rs" .
-           "fn main() -> () { let test=3; }"))))
+      `(("diag-project" .
+         (("main.cpp" . "int main(){float a = 42.2; return 0;}"))))
     (with-current-buffer
-        (eglot--find-file-noselect "diagnostic-tag-project/main.rs")
-      (let ((eglot-server-programs '((rust-mode . ("rust-analyzer")))))
-        (should (zerop (shell-command "cargo init")))
+        (eglot--find-file-noselect "diag-project/main.cpp")
+      (eglot--make-file-or-dir '(".git"))
+      (eglot--make-file-or-dir
+       `("compile_commands.json" .
+         ,(json-serialize
+           `[(:directory ,default-directory :command "/usr/bin/c++ -Wall -c 
main.cpp"
+                         :file ,(expand-file-name "main.cpp"))])))
+      (let ((eglot-server-programs '((c++-mode . ("clangd")))))
         (eglot--sniffing (:server-notifications s-notifs)
           (eglot--tests-connect)
           (eglot--wait-for (s-notifs 10)
@@ -800,30 +813,32 @@ pylsp prefers autopep over yafp, despite its README 
stating the contrary."
   "Test diagnostics through multiple files in a TypeScript LSP."
   (skip-unless (executable-find "rust-analyzer"))
   (skip-unless (executable-find "cargo"))
+  (skip-unless (executable-find "git"))
   (eglot--with-fixture
       '(("project" .
          (("main.rs" .
-           "fn main() -> () { let test=3; }")
+           "fn main() -> i32 { return 42.2;}")
           ("other-file.rs" .
            "fn foo() -> () { let hi=3; }"))))
-    (eglot--make-file-or-dir '(".git"))
     (let ((eglot-server-programs '((rust-mode . ("rust-analyzer")))))
-      ;; Open other-file, and see diagnostics arrive for main.rs
+      ;; Open other-file.rs, and see diagnostics arrive for main.rs,
+      ;; which we didn't open.
       (with-current-buffer (eglot--find-file-noselect "project/other-file.rs")
+        (should (zerop (shell-command "git init")))
         (should (zerop (shell-command "cargo init")))
         (eglot--sniffing (:server-notifications s-notifs)
           (eglot--tests-connect)
           (flymake-start)
-          (eglot--wait-for (s-notifs 10)
-              (&key _id method &allow-other-keys)
-            (string= method "textDocument/publishDiagnostics"))
-          (let ((diags (flymake--project-diagnostics)))
-            (should (= 2 (length diags)))
-            ;; Check that we really get a diagnostic from main.rs, and
-            ;; not from other-file.rs
-            (should (string-suffix-p
-                     "main.rs"
-                     (flymake-diagnostic-buffer (car diags))))))))))
+          (eglot--wait-for (s-notifs 15)
+              (&key _id method params &allow-other-keys)
+            (and (string= method "textDocument/publishDiagnostics")
+                 (string-suffix-p "main.rs" (plist-get params :uri))))
+          (let* ((diags (flymake--project-diagnostics)))
+            (should (cl-some (lambda (diag)
+                               (let ((locus (flymake-diagnostic-buffer diag)))
+                                 (and (stringp (flymake-diagnostic-buffer 
diag))
+                                      (string-suffix-p "main.rs" locus))))
+                             diags))))))))
 
 (ert-deftest eglot-test-json-basic ()
   "Test basic autocompletion in vscode-json-languageserver."
@@ -1262,7 +1277,9 @@ macro will assume it exists."
   (let* ((tramp-remote-path (cons 'tramp-own-remote-path tramp-remote-path))
          (tramp-histfile-override t)
          (tramp-verbose 1)
-         (temporary-file-directory ert-remote-temporary-file-directory)
+         (temporary-file-directory
+          (or (bound-and-true-p ert-remote-temporary-file-directory)
+              temporary-file-directory))
          (default-directory temporary-file-directory))
     ;; We must check the remote LSP server.  So far, just "clangd" is used.
     (unless (executable-find "clangd" 'remote)
diff --git a/test/lisp/progmodes/python-tests.el 
b/test/lisp/progmodes/python-tests.el
index 6928e313dc4..e5a9d128bc5 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1658,6 +1658,21 @@ a == 4):
    (python-indent-line t)
    (should (= (python-indent-calculate-indentation t) 6))))
 
+(ert-deftest python-indent-dedenters-9 ()
+  "Test de-indentation for the case keyword."
+  (python-tests-with-temp-buffer
+   "
+match a:
+    case 1:
+        print(1)
+        case 2
+"
+   (python-tests-look-at "case 2")
+   (should (eq (car (python-indent-context)) :at-dedenter-block-start))
+   (should (= (python-indent-calculate-indentation) 4))
+   (python-indent-line t)
+   (should (= (python-indent-calculate-indentation t) 4))))
+
 (ert-deftest python-indent-inside-string-1 ()
   "Test indentation for strings."
   (python-tests-with-temp-buffer
@@ -1994,6 +2009,20 @@ def test_re(string):
    (python-tests-look-at "else:")
    (should (= (python-indent-calculate-indentation) 4))))
 
+(ert-deftest python-indent-after-bare-match ()
+  "Test BUG 62031 regression."
+  (python-tests-with-temp-buffer
+   "
+from re import match
+
+def test_re(string):
+    if match('^[a-c]+$', string):
+        print('yes')
+    else:
+    "
+   (python-tests-look-at "else:")
+   (should (= (python-indent-calculate-indentation) 4))))
+
 
 ;;; Filling
 
@@ -2955,6 +2984,36 @@ string
    "'\n''\n"
    (python-nav-end-of-statement)))
 
+(ert-deftest python-nav-end-of-statement-3 ()
+  "Test unmatched quotes (Bug#58780)."
+  (python-tests-with-temp-buffer
+   "
+' \"\"\"
+v = 1
+"
+   (python-tests-look-at "v =")
+   (should (= (save-excursion
+                (python-nav-end-of-statement)
+                (point))
+              (save-excursion
+                (point-max))))))
+
+(ert-deftest python-nav-end-of-statement-4 ()
+  (python-tests-with-temp-buffer
+   "
+abc = 'a\\
+b\\
+c'
+d = '''d'''
+"
+   (python-tests-look-at "b\\")
+   (should (= (save-excursion
+                (python-nav-end-of-statement)
+                (point))
+              (save-excursion
+                (python-tests-look-at "c'")
+                (pos-eol))))))
+
 (ert-deftest python-nav-forward-statement-1 ()
   (python-tests-with-temp-buffer
    "
@@ -5221,6 +5280,20 @@ def decoratorFunctionWithArguments(arg1, arg2, arg3):
    (should (string= (python-info-current-defun t)
                     "def decoratorFunctionWithArguments"))))
 
+(ert-deftest python-info-current-defun-4 ()
+  "Ensure unmatched quotes do not cause hang (Bug#58780)."
+  (python-tests-with-temp-buffer
+   "
+def func():
+    ' \"\"\"
+    v = 1
+"
+   (python-tests-look-at "v = 1")
+   (should (string= (python-info-current-defun)
+                    "func"))
+   (should (string= (python-info-current-defun t)
+                    "def func"))))
+
 (ert-deftest python-info-current-symbol-1 ()
   (python-tests-with-temp-buffer
    "
diff --git a/test/lisp/progmodes/ruby-ts-mode-tests.el 
b/test/lisp/progmodes/ruby-ts-mode-tests.el
index c99e1a43063..e0d9f1b5c50 100644
--- a/test/lisp/progmodes/ruby-ts-mode-tests.el
+++ b/test/lisp/progmodes/ruby-ts-mode-tests.el
@@ -258,6 +258,22 @@ The whitespace before and including \"|\" on each line is 
removed."
     (delete-char 1)
     (should (string= (ruby-ts-add-log-current-function) "M::C#foo"))))
 
+(ert-deftest ruby-ts-syntax-propertize-symbol ()
+  (skip-unless (treesit-ready-p 'ruby t))
+  (pcase-dolist (`(,str . ,expected)
+                 '((":abc" . ":abc")
+                   (":foo?" . #(":foo?" 4 5 (syntax-table (3))))
+                   (":<=>" . #(":<=>" 1 4 (syntax-table (3))))))
+    (ruby-ts-with-temp-buffer str
+      (syntax-propertize (point-max))
+      (let ((text (buffer-string)))
+        (remove-text-properties 0 (1- (point-max))
+                                '(fontified)
+                                text)
+        (should (equal-including-properties
+                 text
+                 expected))))))
+
 (defmacro ruby-ts-resource-file (file)
   `(when-let ((testfile ,(or (macroexp-file-name)
                              buffer-file-name)))



reply via email to

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