emacs-diffs
[Top][All Lists]
Advanced

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

feature/android bf3bea44604: Merge remote-tracking branch 'origin/master


From: Po Lu
Subject: feature/android bf3bea44604: Merge remote-tracking branch 'origin/master' into feature/android
Date: Sat, 17 Jun 2023 05:19:07 -0400 (EDT)

branch: feature/android
commit bf3bea4460418b82c6de4668659447118fb2de2b
Merge: 797c30b7abc b51be64a715
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Merge remote-tracking branch 'origin/master' into feature/android
---
 doc/emacs/indent.texi                |   6 +-
 doc/emacs/macos.texi                 |  12 +-
 doc/emacs/programs.texi              |  19 ++-
 doc/lispintro/emacs-lisp-intro.texi  |   7 +-
 doc/lispref/control.texi             |   2 +-
 doc/lispref/debugging.texi           |   2 +-
 doc/lispref/display.texi             |  12 +-
 doc/lispref/functions.texi           |  16 +-
 doc/lispref/internals.texi           |   2 +-
 doc/lispref/modes.texi               | 124 ++++++++------
 doc/lispref/parsing.texi             | 303 +++++++++++++++++------------------
 doc/lispref/positions.texi           |  21 ++-
 doc/lispref/processes.texi           |   4 +-
 doc/lispref/searching.texi           |   2 +-
 doc/lispref/text.texi                |   4 +-
 doc/lispref/windows.texi             |   2 +-
 doc/misc/calc.texi                   |  24 +--
 doc/misc/cc-mode.texi                |  18 +--
 doc/misc/dbus.texi                   |  20 ++-
 doc/misc/ede.texi                    |  18 +--
 doc/misc/ert.texi                    |  14 +-
 doc/misc/eudc.texi                   |  16 +-
 doc/misc/eww.texi                    |   4 +-
 doc/misc/flymake.texi                |  32 ++--
 doc/misc/gnus.texi                   |  58 +++----
 doc/misc/tramp.texi                  |   2 +-
 doc/misc/use-package.texi            |   2 +-
 lisp/apropos.el                      |   3 +-
 lisp/dired.el                        |  11 +-
 lisp/minibuffer.el                   |   6 +-
 lisp/newcomment.el                   |   9 +-
 lisp/nxml/xmltok.el                  |   2 +-
 lisp/progmodes/c-ts-mode.el          |   2 +-
 lisp/progmodes/cmake-ts-mode.el      |   3 +-
 lisp/progmodes/java-ts-mode.el       |   4 +-
 lisp/progmodes/js.el                 |   4 +-
 lisp/progmodes/python.el             |   2 +-
 lisp/progmodes/rust-ts-mode.el       |  12 +-
 lisp/progmodes/sh-script.el          |   2 +-
 lisp/progmodes/typescript-ts-mode.el |   4 +-
 lisp/simple.el                       |   5 +-
 lisp/subr.el                         |   2 +-
 lisp/textmodes/tex-mode.el           |   6 +-
 lisp/treesit.el                      |  56 ++++---
 lisp/window.el                       |   8 +
 src/dbusbind.c                       |   2 +-
 src/lread.c                          |   2 +-
 src/xdisp.c                          |   2 +-
 test/lisp/minibuffer-tests.el        |  15 +-
 test/src/treesit-tests.el            |   4 +-
 50 files changed, 515 insertions(+), 397 deletions(-)

diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi
index 95ad726828d..17b663d22e1 100644
--- a/doc/emacs/indent.texi
+++ b/doc/emacs/indent.texi
@@ -127,10 +127,10 @@ that column number.
 @kindex C-x TAB
 @findex indent-rigidly
 @cindex remove indentation
-This command is used to change the indentation of all lines that begin
-in the region, moving the affected lines as a rigid unit.
+Indent all lines that begin in the region, moving the affected lines
+as a rigid unit (@code{indent-rigidly}).
 
-If called with no argument, the command activates a transient mode for
+If called with no argument, this command activates a transient mode for
 adjusting the indentation of the affected lines interactively.  While
 this transient mode is active, typing @kbd{@key{LEFT}} or
 @kbd{@key{RIGHT}} indents leftward and rightward, respectively, by one
diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi
index 9f2c4721cab..18811291a9e 100644
--- a/doc/emacs/macos.texi
+++ b/doc/emacs/macos.texi
@@ -177,10 +177,10 @@ These variables only apply to macOS 10.7 (Lion) and above.
 @vindex ns-use-mwheel-acceleration
 @item ns-use-mwheel-acceleration
 This variable controls whether Emacs ignores the system mousewheel
-acceleration.  When nil each `click' of the mousewheel will correspond
-exactly with one mousewheel event.  When non-@code{nil}, the default, each
-`click' may correspond with more than one mousewheel event, depending
-on the user's input.
+acceleration.  When @code{nil} each `click' of the mousewheel will
+correspond exactly with one mousewheel event.  When non-@code{nil},
+the default, each `click' may correspond with more than one mousewheel
+event, depending on the user's input.
 
 @vindex ns-use-mwheel-momentum
 @item ns-use-mwheel-momentum
@@ -194,8 +194,8 @@ while after the user has lifted their fingers off the 
trackpad.
 This variable controls the sensitivity of scrolling with the trackpad.
 Apple trackpads scroll by pixels, not lines, so Emacs converts the
 system's pixel values into lines.  When set to a number, this variable
-sets the number of pixels Emacs will consider as one line.  When nil
-or a non-number the default line height is used.
+sets the number of pixels Emacs will consider as one line.  When
+@code{nil} or a non-number the default line height is used.
 
 Setting a lower number makes the trackpad more sensitive, and a higher
 number makes the trackpad less sensitive.
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 62df88a731e..953de2e4786 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1174,14 +1174,17 @@ were negated.
 
 @findex comment-kill
 @kindex C-u M-;
-  @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) kills any
-comment on the current line, along with the whitespace before it.
-Since the comment is saved to the kill ring, you can reinsert it on
-another line by moving to the end of that line, doing @kbd{C-y}, and
-then @kbd{M-;} to realign the comment.  You can achieve the same
-effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill}
-(@code{comment-dwim} actually calls @code{comment-kill} as a
-subroutine when it is given a prefix argument).
+  @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) when the
+region is not active kills any comment on the current line, along with
+the whitespace before it.  Since the comment is saved to the kill
+ring, you can reinsert it on another line by moving to the end of that
+line, doing @kbd{C-y}, and then @kbd{M-;} to realign the comment.  You
+can achieve the same effect as @kbd{C-u M-;} by typing @kbd{M-x
+comment-kill} (@code{comment-dwim} actually calls @code{comment-kill}
+as a subroutine when it is given a prefix argument).  Invoking
+@code{comment-dwim} with a prefix numeric argument, as in @w{@kbd{C-u
+@var{n} M-;}}, when there's no active region, tells
+@code{comment-kill} to kill comments on @var{n} lines.
 
 @kindex C-c C-c @r{(C mode)}
 @findex comment-region
diff --git a/doc/lispintro/emacs-lisp-intro.texi 
b/doc/lispintro/emacs-lisp-intro.texi
index 6447ff74bc9..37ef6133fb4 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -8115,10 +8115,9 @@ than one error handler.  When an error occurs, the first 
applicable
 handler is run.
 
 Lastly, the first argument to the @code{condition-case} expression,
-the @var{var} argument, is sometimes bound to a variable that
-contains information about the error.  However, if that argument is
-nil, as is the case in @code{kill-region}, that information is
-discarded.
+the @var{var} argument, is sometimes bound to a variable that contains
+information about the error.  However, if that argument is @code{nil},
+as is the case in @code{kill-region}, that information is discarded.
 
 @need 1200
 In brief, in the @code{kill-region} function, the code
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index e621a28acda..3aee9dd80e4 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -694,7 +694,7 @@ contain the following constructs:
 @item (let @var{ref} @var{rx-expr}@dots{})
 Bind the symbol @var{ref} to a submatch that matches
 @var{rx-expr}@enddots{}.  @var{ref} is bound in @var{body-forms} to
-the string of the submatch or nil, but can also be used in
+the string of the submatch or @code{nil}, but can also be used in
 @code{backref}.
 
 @item (backref @var{ref})
diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi
index d2e4f687f64..ea11d2d8d9c 100644
--- a/doc/lispref/debugging.texi
+++ b/doc/lispref/debugging.texi
@@ -740,7 +740,7 @@ of @code{debug} (@pxref{Invoking the Debugger}).
 @cindex call stack
 This function prints a trace of Lisp function calls currently active.
 The trace is identical to the one that @code{debug} would show in the
-@file{*Backtrace*} buffer.  The return value is always nil.
+@file{*Backtrace*} buffer.  The return value is always @code{nil}.
 
 In the following example, a Lisp expression calls @code{backtrace}
 explicitly.  This prints the backtrace to the stream
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index f91a2715bca..e44b4aeb235 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6531,7 +6531,7 @@ specified, draw a polyline.
 @deffn Command horizontal-lineto x-coordinates
 Draw a horizontal line from the current point to the first element in
 @var{x-coordinates}.  Specifying multiple coordinates is possible,
-although usually this doesn’t make sense.
+although this usually doesn't make sense.
 
 @lisp
 (svg-path svg '((moveto ((100 . 200)))
@@ -6555,7 +6555,7 @@ Using the first element in @var{coordinate-sets}, draw a 
cubic Bézier
 curve from the current point.  If there are multiple coordinate sets,
 draw a polybezier.  Each coordinate set is a list of the form
 @code{(@var{x1} @var{y1} @var{x2} @var{y2} @var{x} @var{y})}, where
-@w{(@var{x}, @var{y})} is the curve’s end point.  @w{(@var{x1},
+@w{(@var{x}, @var{y})} is the curve's end point.  @w{(@var{x1},
 @var{y1})} and @w{(@var{x2}, @var{y2})} are control points at the
 beginning and at the end, respectively.
 
@@ -6572,7 +6572,7 @@ Using the first element in @var{coordinate-sets}, draw a 
cubic Bézier
 curve from the current point.  If there are multiple coordinate sets,
 draw a polybezier.  Each coordinate set is a list of the form
 @code{(@var{x2} @var{y2} @var{x} @var{y})}, where @w{(@var{x},
-@var{y})} is the curve’s end point and @w{(@var{x2}, @var{y2})} is the
+@var{y})} is the curve's end point and @w{(@var{x2}, @var{y2})} is the
 corresponding control point.  The first control point is the
 reflection of the second control point of the previous command
 relative to the current point, if that command was @command{curveto}
@@ -6592,7 +6592,7 @@ Using the first element in @var{coordinate-sets}, draw a 
quadratic
 Bézier curve from the current point.  If there are multiple coordinate
 sets, draw a polybezier.  Each coordinate set is a list of the form
 @code{(@var{x1} @var{y1} @var{x} @var{y})}, where @w{(@var{x},
-@var{y})} is the curve’s end point and @w{(@var{x1}, @var{y1})} is the
+@var{y})} is the curve's end point and @w{(@var{x1}, @var{y1})} is the
 control point.
 
 @lisp
@@ -6609,7 +6609,7 @@ control point.
 Using the first element in @var{coordinate-sets}, draw a quadratic
 Bézier curve from the current point.  If there are multiple coordinate
 sets, draw a polybezier.  Each coordinate set is a list of the form
-@code{(@var{x} @var{y})}, where @w{(@var{x}, @var{y})} is the curve’s
+@code{(@var{x} @var{y})}, where @w{(@var{x}, @var{y})} is the curve's
 end point.  The control point is the reflection of the control point
 of the previous command relative to the current point, if that command
 was @command{quadratic-bezier-curveto} or
@@ -7270,7 +7270,7 @@ window.
 @item :width
 This is only valid for @code{image} icons, and can be either a number
 (which specifies the width in pixels), or the symbol @code{font},
-which will use the width in pixels of the current buffer’s default
+which will use the width in pixels of the current buffer's default
 face font.
 @end table
 
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index a94fdee1d82..af116f62973 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -2614,14 +2614,18 @@ be passed to @code{gv-define-setter}.
 
 @item (completion @var{completion-predicate})
 Declare @var{completion-predicate} as a function to determine whether
-to include the symbol in the list of functions when asking for
-completions in @kbd{M-x}.  @var{completion-predicate} is called with
-two parameters: The first parameter is the symbol, and the second is
-the current buffer.
+to include a function's symbol in the list of functions when asking
+for completions in @kbd{M-x}.  This predicate function will only be
+called when @code{read-extended-command-predicate} is customized to
+@code{command-completion-default-include-p}; by default the value of
+@code{read-extended-command-predicate} is nil (@pxref{Interactive
+Call, execute-extended-command}).  The predicate
+@var{completion-predicate} is called with two arguments: the
+function's symbol and the current buffer.
 
 @item (modes @var{modes})
-Specify that this command is meant to be applicable for @var{modes}
-only.
+Specify that this command is meant to be applicable only to specified
+@var{modes}.  @xref{Command Modes}.
 
 @item (interactive-args @var{arg} ...)
 Specify the arguments that should be stored for @code{repeat-command}.
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 9928361f7b2..0951e60433a 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -248,7 +248,7 @@ time it took to restore the Emacs state.  The value is an 
alist
 where @var{file} is the name of the dump file, and @var{time} is the
 time in seconds it took to restore the state from the dump file.
 If the current session was not restored from a dump file, the
-value is nil.
+value is @code{nil}.
 @end defun
 
 @node Pure Storage
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index d2a05fe29e4..3bb3ae9b939 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2931,13 +2931,13 @@ nodes that belong to @var{category}.  @var{pred} should 
be either
 return non-@code{nil} if the node is a valid node for @var{category},
 or @code{nil} if not.
 
-@var{category} could also be @code{nil}.  In which case the entries
+@var{category} could also be @code{nil}, in which case the entries
 matched by @var{regexp} and @var{pred} are not grouped under
 @var{category}.
 
-@var{name-fn} should be either @var{nil} or a function that takes a
+@var{name-fn} should be either @code{nil} or a function that takes a
 defun node and returns the name of that defun, e.g., the function name
-for a function definition.  If @var{name-fn} is @var{nil},
+for a function definition.  If @var{name-fn} is @code{nil},
 @code{treesit-defun-name} (@pxref{Tree-sitter Major Modes}) is used
 instead.
 
@@ -3456,7 +3456,7 @@ This condition matches any element of Font Lock keywords 
for which
 non-@code{nil}.
 
 @item @code{(not @var{condition})}
-This matches if @var{condition} doesn’t.
+This matches if @var{condition} doesn't.
 
 @item @code{(and @var{condition} @dots{})}
 This matches if each of the @var{condition}s matches.
@@ -4079,7 +4079,7 @@ Source}) for this purpose.
 
 Parser-based font lock and other font lock mechanisms are not mutually
 exclusive.  By default, if enabled, parser-based font lock runs first,
-replacing syntactic font lock, then the regexp-based font lock.
+replacing syntactic font lock, followed by regexp-based font lock.
 
 Although parser-based font lock doesn't share the same customization
 variables with regexp-based font lock, it uses similar customization
@@ -4112,7 +4112,7 @@ would be highlighted in @code{font-lock-keyword} face.
 For more information about queries, patterns, and capture names, see
 @ref{Pattern Matching}.
 
-To setup tree-sitter fontification, a major mode should first set
+To set up tree-sitter fontification, a major mode should first set
 @code{treesit-font-lock-settings} with the output of
 @code{treesit-font-lock-rules}, then call
 @code{treesit-major-mode-setup}.
@@ -4139,15 +4139,15 @@ example:
 
 This function takes a series of @var{query-spec}s, where each
 @var{query-spec} is a @var{query} preceded by one or more
-@var{:keyword}/@var{value} pairs.  Each @var{query} is a
-tree-sitter query in either the string, s-expression or compiled form.
+@var{keyword}/@var{value} pairs.  Each @var{query} is a tree-sitter
+query in either the string, s-expression, or compiled form.
 
 @c FIXME: Cross-ref treesit-font-lock-level to user manual.
-For each @var{query}, the @var{:keyword}/@var{value} pairs that
-precede it add meta information to it.  The @code{:language} keyword
-declares @var{query}'s language.  The @code{:feature} keyword sets the
-feature name of @var{query}.  Users can control which features are
-enabled with @code{treesit-font-lock-level} and
+For each @var{query}, the @var{keyword}/@var{value} pairs that precede
+it add meta information to it.  The @code{:language} keyword declares
+@var{query}'s language.  The @code{:feature} keyword sets the feature
+name of @var{query}.  Users can control which features are enabled
+with @code{treesit-font-lock-level} and
 @code{treesit-font-lock-feature-list} (described below).  These two
 keywords are mandatory.
 
@@ -4155,9 +4155,9 @@ Other keywords are optional:
 
 @multitable @columnfractions .15 .15 .6
 @headitem Keyword @tab Value @tab Description
-@item @code{:override} @tab nil
+@item @code{:override} @tab @code{nil}
 @tab If the region already has a face, discard the new face
-@item @tab t @tab Always apply the new face
+@item @tab @code{t} @tab Always apply the new face
 @item @tab @code{append} @tab Append the new face to existing ones
 @item @tab @code{prepend} @tab Prepend the new face to existing ones
 @item @tab @code{keep} @tab Fill-in regions without an existing face
@@ -4171,11 +4171,11 @@ fontification, capture names in @var{query} should be 
face names like
 with that face.
 
 @findex treesit-fontify-with-override
-Capture names can also be function names, in which case the function
+A capture name can also be a function name, in which case the function
 is called with 4 arguments: @var{node} and @var{override}, @var{start}
 and @var{end}, where @var{node} is the node itself, @var{override} is
-the override property of the rule which captured this node, and
-@var{start} and @var{end} limits the region in which this function
+the @code{:override} property of the rule which captured this node,
+and @var{start} and @var{end} limit the region which this function
 should fontify.  (If this function wants to respect the @var{override}
 argument, it can use @code{treesit-fontify-with-override}.)
 
@@ -4211,9 +4211,9 @@ Some of these features warrant some explanation: 
@code{definition}
 highlights whatever is being defined, e.g., the function name in a
 function definition, the struct name in a struct definition, the
 variable name in a variable definition; @code{assignment} highlights
-the whatever is being assigned to, e.g., the variable or field in an
+whatever is being assigned to, e.g., the variable or field in an
 assignment statement; @code{key} highlights keys in key-value pairs,
-e.g., keys in a JSON object, or a Python dictionary; @code{doc}
+e.g., keys in a JSON object or Python dictionary; @code{doc}
 highlights docstrings or doc-comments.
 
 For example, the value of this variable could be:
@@ -4987,7 +4987,7 @@ source indentation commands.  For maximum flexibility, it 
is possible
 to write a custom indentation function that queries the syntax tree
 and indents accordingly for each language, but that is a lot of work.
 It is more convenient to use the simple indentation engine described
-below: then the major mode needs only to write some indentation rules
+below: then the major mode needs only write some indentation rules,
 and the engine takes care of the rest.
 
 To enable the parser-based indentation engine, either set
@@ -5006,10 +5006,11 @@ more complex indentation engines.
 @cindex indentation rules, for parser-based indentation
 
 @defvar treesit-simple-indent-rules
-This local variable stores indentation rules for every language.  It is
-a list of the form: @w{@code{(@var{language} . @var{rules})}}, where
-@var{language} is a language symbol, and @var{rules} is a list of the
-form @w{@code{(@var{matcher} @var{anchor} @var{offset})}}.
+This local variable stores indentation rules for every language.  It
+is an alist with elements of the form @w{@code{(@var{language}
+. @var{rules})}}, where @var{language} is a language symbol, and
+@var{rules} is a list with elements of the form
+@w{@code{(@var{matcher} @var{anchor} @var{offset})}}.
 
 First, Emacs passes the smallest tree-sitter node at the beginning of
 the current line to @var{matcher}; if it returns non-@code{nil}, this
@@ -5043,14 +5044,14 @@ anchors.
 
 @defvar treesit-simple-indent-presets
 This is a list of defaults for @var{matcher}s and @var{anchor}s in
-@code{treesit-simple-indent-rules}.  Each of them represents a function
-that takes 3 arguments: @var{node}, @var{parent} and @var{bol}.  The
-available default functions are:
+@code{treesit-simple-indent-rules}.  Each of them represents a
+function that takes 3 arguments: @var{node}, @var{parent}, and
+@var{bol}.  The available default functions are:
 
 @ftable @code
 @item no-node
 This matcher is a function that is called with 3 arguments:
-@var{node}, @var{parent}, and @var{bol}, and returns non-@code{nil},
+@var{node}, @var{parent}, and @var{bol}.  It returns non-@code{nil},
 indicating a match, if @var{node} is @code{nil}, i.e., there is no
 node that starts at @var{bol}.  This is the case when @var{bol} is on
 an empty line or inside a multi-line string, etc.
@@ -5067,6 +5068,12 @@ function that is called with 3 arguments: @var{node}, 
@var{parent},
 and @var{bol}, and returns non-@code{nil} if @var{node}'s type matches
 regexp @var{type}.
 
+@item field-is
+This matcher is a function of one argument, @var{name}; it returns a
+function that is called with 3 arguments: @var{node}, @var{parent},
+and @var{bol}, and returns non-@code{nil} if @var{node}'s field name
+in @var{parent} matches regexp @var{name}.
+
 @item query
 This matcher is a function of one argument, @var{query}; it returns a
 function that is called with 3 arguments: @var{node}, @var{parent},
@@ -5107,30 +5114,53 @@ of @var{node-type}, @var{parent-type}, and 
@var{grandparent-type} is
 @item comment-end
 This matcher is a function that is called with 3 arguments:
 @var{node}, @var{parent}, and @var{bol}, and returns non-@code{nil} if
-point is before a comment ending token.  Comment ending tokens are
-defined by regular expression @code{comment-end-skip}
+point is before a comment-ending token.  Comment-ending tokens are
+defined by regexp @code{comment-end-skip}.
+
+@item catch-all
+This matcher is a function that is called with 3 arguments:
+@var{node}, @var{parent}, and @var{bol}.  It always returns
+non-@code{nil}, indicating a match.
 
 @item first-sibling
 This anchor is a function that is called with 3 arguments: @var{node},
 @var{parent}, and @var{bol}, and returns the start of the first child
 of @var{parent}.
 
+@item nth-sibling
+This anchor is a function of two arguments: @var{n}, and an optional
+argument @var{named}.  It returns a function that is called with 3
+arguments: @var{node}, @var{parent}, and @var{bol}, and returns the
+start of the @var{n}th child of @var{parent}.  If @var{named} is
+non-@code{nil}, only named children are counted (@pxref{tree-sitter
+named node, named node}).
+
 @item parent
 This anchor is a function that is called with 3 arguments: @var{node},
 @var{parent}, and @var{bol}, and returns the start of @var{parent}.
 
+@item grand-parent
+This anchor is a function that is called with 3 arguments: @var{node},
+@var{parent}, and @var{bol}, and returns the start of @var{parent}'s
+parent.
+
+@item great-grand-parent
+This anchor is a function that is called with 3 arguments: @var{node},
+@var{parent}, and @var{bol}, and returns the start of @var{parent}'s
+parent's parent.
+
 @item parent-bol
 This anchor is a function that is called with 3 arguments: @var{node},
 @var{parent}, and @var{bol}, and returns the first non-space character
 on the line which @var{parent}'s start is on.
 
-@item parent-bol
+@item standalone-parent
 This anchor is a function that is called with 3 arguments: @var{node},
 @var{parent}, and @var{bol}.  It finds the first ancestor node
-(parent, grandparent, etc) of @var{node} that starts on its own line,
-and return the start of that node.  ``Starting on its own line'' means
-there is only whitespace character before the node on the line which
-the node's start is on.
+(parent, grandparent, etc.@:) of @var{node} that starts on its own
+line, and return the start of that node.  ``Starting on its own line''
+means there is only whitespace character before the node on the line
+which the node's start is on.
 
 @item prev-sibling
 This anchor is a function that is called with 3 arguments: @var{node},
@@ -5160,14 +5190,14 @@ expression @code{comment-start-skip}.  This function 
assumes
 
 @item prev-adaptive-prefix
 This anchor is a function that is called with 3 arguments: @var{node},
-@var{parent}, and @var{bol}.  It tries to go to the beginning of the
-previous non-empty line, and matches @code{adaptive-fill-regexp}.  If
-there is a match, this function returns the end of the match,
-otherwise it returns nil.  However, if the current line begins with a
-prefix (e.g., ``-''), return the beginning of the prefix of the
-previous line instead, so that the two prefixes aligns.  This anchor
-is useful for a @code{indent-relative}-like indent behavior for block
-comments.
+@var{parent}, and @var{bol}.  It tries to match
+@code{adaptive-fill-regexp} to the text at the beginning of the
+previous non-empty line.  If there is a match, this function returns
+the end of the match, otherwise it returns @code{nil}.  However, if
+the current line begins with a prefix (e.g., @samp{-}), return the
+beginning of the prefix of the previous line instead, so that the two
+prefixes align.  This anchor is useful for an
+@code{indent-relative}-like indent behavior for block comments.
 
 @end ftable
 @end defvar
@@ -5178,14 +5208,14 @@ comments.
 Here are some utility functions that can help writing parser-based
 indentation rules.
 
-@defun treesit-check-indent mode
-This function checks the current buffer's indentation against major
+@deffn Command treesit-check-indent mode
+This command checks the current buffer's indentation against major
 mode @var{mode}.  It indents the current buffer according to
 @var{mode} and compares the results with the current indentation.
 Then it pops up a buffer showing the differences.  Correct
 indentation (target) is shown in green color, current indentation is
 shown in red color.  @c Are colors customizable? faces?
-@end defun
+@end deffn
 
 It is also helpful to use @code{treesit-inspect-mode} (@pxref{Language
 Grammar}) when writing indentation rules.
diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi
index b0824faaaa2..1ec985f6d70 100644
--- a/doc/lispref/parsing.texi
+++ b/doc/lispref/parsing.texi
@@ -9,7 +9,7 @@
 Emacs provides various ways to parse program source text and produce a
 @dfn{syntax tree}.  In a syntax tree, text is no longer considered a
 one-dimensional stream of characters, but a structured tree of nodes,
-where each node representing a piece of text.  Thus, a syntax tree can
+where each node represents a piece of text.  Thus, a syntax tree can
 enable interesting features like precise fontification, indentation,
 navigation, structured editing, etc.
 
@@ -19,8 +19,8 @@ generic navigation and indentation (@pxref{SMIE}).
 
 In addition to those, Emacs also provides integration with
 @uref{https://tree-sitter.github.io/tree-sitter, the tree-sitter
-library}) if support for it was compiled in.  The tree-sitter library
-implements an incremental parser and has support from a wide range of
+library} if support for it was compiled in.  The tree-sitter library
+implements an incremental parser and has support for a wide range of
 programming languages.
 
 @defun treesit-available-p
@@ -65,10 +65,10 @@ For example, the C language grammar is represented as the 
symbol
 
 @vindex treesit-extra-load-path
 @vindex treesit-load-language-error
-Tree-sitter language grammar are distributed as dynamic libraries.
+Tree-sitter language grammars are distributed as dynamic libraries.
 In order to use a language grammar in Emacs, you need to make sure
 that the dynamic library is installed on the system.  Emacs looks for
-language grammar in several places, in the following order:
+language grammars in several places, in the following order:
 
 @itemize @bullet
 @item
@@ -95,8 +95,8 @@ This means that Emacs could not find the language grammar 
library.
 This means that Emacs could not find in the library the expected function
 that every language grammar library should export.
 @item (version-mismatch @var{error-msg})
-This means that the version of language grammar library is incompatible
-with that of the tree-sitter library.
+This means that the version of the language grammar library is
+incompatible with that of the tree-sitter library.
 @end table
 
 @noindent
@@ -105,7 +105,7 @@ details about the failure.
 
 @defun treesit-language-available-p language &optional detail
 This function returns non-@code{nil} if the language grammar for
-@var{language} exist and can be loaded.
+@var{language} exists and can be loaded.
 
 If @var{detail} is non-@code{nil}, return @code{(t . nil)} when
 @var{language} is available, and @code{(nil . @var{data})} when it's
@@ -126,7 +126,7 @@ doesn't follow this convention, you should add an entry
 @end example
 
 to the list in the variable @code{treesit-load-name-override-list}, where
-@var{library-base-name} is the basename of the dynamic library's file name,
+@var{library-base-name} is the basename of the dynamic library's file name
 (usually, @file{libtree-sitter-@var{language}}), and
 @var{function-name} is the function provided by the library
 (usually, @code{tree_sitter_@var{language}}).  For example,
@@ -146,7 +146,7 @@ Application Binary Interface (@acronym{ABI}) supported by 
the
 tree-sitter library.  By default, it returns the latest ABI version
 supported by the library, but if @var{min-compatible} is
 non-@code{nil}, it returns the oldest ABI version which the library
-still can support.  language grammar libraries must be built for
+still can support.  Language grammar libraries must be built for
 ABI versions between the oldest and the latest versions supported by
 the tree-sitter library, otherwise the library will be unable to load
 them.
@@ -232,11 +232,11 @@ assign @dfn{field names} to child nodes.  For example, a
 @cindex explore tree-sitter syntax tree
 @cindex inspection of tree-sitter parse tree nodes
 
-To aid in understanding the syntax of a language and in debugging of
-Lisp program that use the syntax tree, Emacs provides an ``explore''
-mode, which displays the syntax tree of the source in the current
-buffer in real time.  Emacs also comes with an ``inspect mode'', which
-displays information of the nodes at point in the mode-line.
+To aid in understanding the syntax of a language and in debugging Lisp
+programs that use the syntax tree, Emacs provides an ``explore'' mode,
+which displays the syntax tree of the source in the current buffer in
+real time.  Emacs also comes with an ``inspect mode'', which displays
+information of the nodes at point in the mode-line.
 
 @deffn Command treesit-explore-mode
 This mode pops up a window displaying the syntax tree of the source in
@@ -271,7 +271,7 @@ parser in @code{(treesit-parser-list)} (@pxref{Using 
Parser}).
 @heading Reading the grammar definition
 @cindex reading grammar definition, tree-sitter
 
-Authors of language grammar define the @dfn{grammar} of a
+Authors of language grammars define the @dfn{grammar} of a
 programming language, which determines how a parser constructs a
 concrete syntax tree out of the program text.  In order to use the
 syntax tree effectively, you need to consult the @dfn{grammar file}.
@@ -283,7 +283,7 @@ home page can be found on
 homepage}.
 
 The grammar definition is written in JavaScript.  For example, the
-rule matching a @code{function_definition} node looks like
+rule matching a @code{function_definition} node may look like
 
 @example
 @group
@@ -331,13 +331,13 @@ matches each rule one after another.
 @item choice(@var{rule1}, @var{rule2}, @dots{})
 matches one of the rules in its arguments.
 @item repeat(@var{rule})
-matches @var{rule} for @emph{zero or more} times.
+matches @var{rule} @emph{zero or more} times.
 This is like the @samp{*} operator in regular expressions.
 @item repeat1(@var{rule})
-matches @var{rule} for @emph{one or more} times.
+matches @var{rule} @emph{one or more} times.
 This is like the @samp{+} operator in regular expressions.
 @item optional(@var{rule})
-matches @var{rule} for @emph{zero or one} time.
+matches @var{rule} @emph{zero or one} times.
 This is like the @samp{?} operator in regular expressions.
 @item field(@var{name}, @var{rule})
 assigns field name @var{name} to the child node matched by @var{rule}.
@@ -366,7 +366,7 @@ Nodes}.
 @item token.immediate(@var{rule})
 Normally, grammar rules ignore preceding whitespace; this
 changes @var{rule} to match only when there is no preceding
-whitespaces.
+whitespace.
 @item prec(@var{n}, @var{rule})
 gives @var{rule} the level-@var{n} precedence.
 @item prec.left([@var{n},] @var{rule})
@@ -412,7 +412,7 @@ non-@code{nil}, this function always creates a new parser.
 If that buffer is an indirect buffer, its base buffer is used instead.
 That is, indirect buffers use their base buffer's parsers.  If the
 base buffer is narrowed, an indirect buffer might not be able to
-retrieve information of the portion of the buffer text that are
+retrieve information of the portion of the buffer text that is
 invisible in the base buffer.  Lisp programs should widen as necessary
 should they want to use a parser in an indirect buffer.
 @end defun
@@ -441,7 +441,7 @@ change is made in the buffer, a parser doesn't re-parse 
immediately.
 
 @vindex treesit-buffer-too-large
 When a parser does parse, it checks for the size of the buffer.
-Tree-sitter can only handle buffer no larger than about 4GB.  If the
+Tree-sitter can only handle buffers no larger than about 4GB@.  If the
 size exceeds that, Emacs signals the @code{treesit-buffer-too-large}
 error with signal data being the buffer size.
 
@@ -500,13 +500,12 @@ converts text before that token into a comment.  Even
 though the text is not directly edited, it is deemed to be ``changed''
 nevertheless.
 
-Emacs lets a Lisp program to register callback functions
-(a.k.a.@: @dfn{notifiers}) for this kind of changes.  A notifier
-function takes two arguments: @var{ranges} and @var{parser}.
-@var{ranges} is a list of cons cells of the form @w{@code{(@var{start}
-. @var{end})}}, where @var{start} and @var{end} mark the start and the
-end positions of a range.  @var{parser} is the parser issuing the
-notification.
+Emacs lets a Lisp program register callback functions (a.k.a.@:
+@dfn{notifiers}) for these kinds of changes.  A notifier function
+takes two arguments: @var{ranges} and @var{parser}.  @var{ranges} is a
+list of cons cells of the form @w{@code{(@var{start} . @var{end})}},
+where @var{start} and @var{end} mark the start and the end positions
+of a range.  @var{parser} is the parser issuing the notification.
 
 Every time a parser reparses a buffer, it compares the old and new
 parse-tree, computes the ranges in which nodes have changed, and
@@ -537,7 +536,7 @@ This function returns the list of @var{parser}'s notifier 
functions.
 @cindex get node, tree-sitter
 
 @cindex terminology, for tree-sitter functions
-Here's some terminology and conventions we use when documenting
+Here are some terms and conventions we use when documenting
 tree-sitter functions.
 
 A node in a syntax tree spans some portion of the program text in the
@@ -571,8 +570,8 @@ This function returns a @dfn{leaf} node at buffer position 
@var{pos}.
 A leaf node is a node that doesn't have any child nodes.
 
 This function tries to return a node whose span covers @var{pos}: the
-node's beginning position is less or equal to @var{pos}, and the
-node's end position is greater or equal to @var{pos}.
+node's beginning position is less than or equal to @var{pos}, and the
+node's end position is greater than or equal to @var{pos}.
 
 If no leaf node's span covers @var{pos} (e.g., @var{pos} is in the
 whitespace between two leaf nodes), this function returns the first
@@ -612,7 +611,7 @@ start of the node is before or at @var{beg}, and the end of 
the node
 is at or after @var{end}.
 
 @emph{Beware:} calling this function on an empty line that is not
-inside any top-level construct (function definition, etc.) most
+inside any top-level construct (function definition, etc.@:) most
 probably will give you the root node, because the root node is the
 smallest node that covers that empty line.  Most of the time, you want
 to use @code{treesit-node-at} instead.
@@ -656,7 +655,7 @@ it, or query for information about this node.
 This function returns the immediate parent of @var{node}.
 
 If @var{node} is more than 1000 levels deep in a parse tree, the
-return value is undefined.  Currently it returns @var{nil}, but that
+return value is undefined.  Currently it returns @code{nil}, but that
 could change in the future.
 @end defun
 
@@ -672,7 +671,7 @@ first child is the opening quote @code{"}, and the first 
named child
 is the string text.
 
 This function returns @code{nil} if there is no @var{n}'th child.
-@var{n} could be negative, e.g., @code{-1} represents the last child.
+@var{n} could be negative, e.g., @minus{}1 represents the last child.
 @end defun
 
 @defun treesit-node-children node &optional named
@@ -694,7 +693,7 @@ This function finds the previous sibling of @var{node}.  If
 @cindex nodes, by field name
 @cindex syntax tree nodes, by field name
 
-To make the syntax tree easier to analyze, many language grammar
+To make the syntax tree easier to analyze, many language grammars
 assign @dfn{field names} to child nodes (@pxref{tree-sitter node field
 name, field name}).  For example, a @code{function_definition} node
 could have a @code{declarator} node and a @code{body} node.
@@ -729,7 +728,7 @@ first named child (@pxref{tree-sitter named node, named 
node}).
 This function finds the @emph{smallest} descendant node of @var{node}
 that spans the region of text between positions @var{beg} and
 @var{end}.  It is similar to @code{treesit-node-at}.  If @var{named}
-is non-@code{nil}, it looks for smallest named child.
+is non-@code{nil}, it looks for the smallest named child.
 @end defun
 
 @heading Searching for node
@@ -755,8 +754,8 @@ defaults to 1000.
 Like @code{treesit-search-subtree}, this function also traverses the
 parse tree and matches each node with @var{predicate} (except for
 @var{start}), where @var{predicate} can be a regexp or a function.
-For a tree like the below where @var{start} is marked S, this function
-traverses as numbered from 1 to 12:
+For a tree like the one below where @var{start} is marked @samp{S},
+this function traverses as numbered from 1 to 12:
 
 @example
 @group
@@ -773,7 +772,7 @@ o  o                +-+-+   +--+--+
 @end example
 
 Note that this function doesn't traverse the subtree of @var{start},
-and it always traverse leaf nodes first, then upwards.
+and it always traverses leaf nodes first, before moving upwards.
 
 Like @code{treesit-search-subtree}, this function only searches for
 named nodes by default, but if @var{all} is non-@code{nil}, it
@@ -786,10 +785,10 @@ that comes after it in the buffer position order, i.e., 
nodes with
 start positions greater than the end position of @var{start}.
 
 In the tree shown above, @code{treesit-search-subtree} traverses node
-S (@var{start}) and nodes marked with @code{o}, where this function
-traverses the nodes marked with numbers.  This function is useful for
-answering questions like ``what is the first node after @var{start} in
-the buffer that satisfies some condition?''
+@samp{S} (@var{start}) and nodes marked with @code{o}, where this
+function traverses the nodes marked with numbers.  This function is
+useful for answering questions like ``what is the first node after
+@var{start} in the buffer that satisfies some condition?''
 @end defun
 
 @defun treesit-search-forward-goto node predicate &optional start backward all
@@ -801,7 +800,7 @@ This function guarantees that the matched node it returns 
makes
 progress in terms of buffer position: the start/end position of the
 returned node is always greater than that of @var{node}.
 
-Arguments @var{predicate}, @var{backward} and @var{all} are the same
+Arguments @var{predicate}, @var{backward}, and @var{all} are the same
 as in @code{treesit-search-forward}.
 @end defun
 
@@ -811,12 +810,12 @@ This function creates a sparse tree from @var{root}'s 
subtree.
 It takes the subtree under @var{root}, and combs it so only the nodes
 that match @var{predicate} are left.  Like previous functions, the
 @var{predicate} can be a regexp string that matches against each
-node's type, or a function that takes a node and return non-@code{nil}
-if it matches.
+node's type, or a function that takes a node and returns
+non-@code{nil} if it matches.
 
-For example, for a subtree on the left that consist of both numbers
-and letters, if @var{predicate} is ``letter only'', the returned tree
-is the one on the right.
+For example, given the subtree on the left that consists of both
+numbers and letters, if @var{predicate} is ``letter only'', the
+returned tree is the one on the right.
 
 @example
 @group
@@ -836,13 +835,13 @@ b   1   2         b   |   |      b   c   d
 
 If @var{process-fn} is non-@code{nil}, instead of returning the
 matched nodes, this function passes each node to @var{process-fn} and
-uses the returned value instead.  If non-@code{nil}, @var{depth} is
-the number of levels to go down from @var{root}.  If @var{depth} is
-@code{nil}, it defaults to 1000.
+uses the returned value instead.  If non-@code{nil}, @var{depth}
+limits the number of levels to go down from @var{root}.  If
+@var{depth} is @code{nil}, it defaults to 1000.
 
 Each node in the returned tree looks like
 @w{@code{(@var{tree-sitter-node} . (@var{child} @dots{}))}}.  The
-@var{tree-sitter-node} of the root of this tree will be nil if
+@var{tree-sitter-node} of the root of this tree will be @code{nil} if
 @var{root} doesn't match @var{predicate}.  If no node matches
 @var{predicate}, the function returns @code{nil}.
 @end defun
@@ -900,30 +899,30 @@ omitted, unlike in their original functions.
 This function finds immediate children of @var{node} that satisfy
 @var{predicate}.
 
-The @var{predicate} function takes a node as the argument and should
+The @var{predicate} function takes a node as argument and should
 return non-@code{nil} to indicate that the node should be kept.  If
-@var{named} is non-@code{nil}, this function only examines the named
+@var{named} is non-@code{nil}, this function only examines named
 nodes.
 @end defun
 
 @defun treesit-parent-until node predicate &optional include-node
 This function repeatedly finds the parents of @var{node}, and returns
 the parent that satisfies @var{pred}, a function that takes a node as
-the argument and returns a boolean that indicates a match.  If no
-parent satisfies @var{pred}, this function returns @code{nil}.
+argument and returns a boolean that indicates a match.  If no parent
+satisfies @var{pred}, this function returns @code{nil}.
 
 Normally this function only looks at the parents of @var{node} but not
-@var{node} itself. But if @var{include-node} is non-@var{nil}, this
+@var{node} itself.  But if @var{include-node} is non-@code{nil}, this
 function returns @var{node} if @var{node} satisfies @var{pred}.
 @end defun
 
 @defun treesit-parent-while node pred
 This function goes up the tree starting from @var{node}, and keeps
 doing so as long as the nodes satisfy @var{pred}, a function that
-takes a node as the argument.  That is, this function returns the
-highest parent of @var{node} that still satisfies @var{pred}.  Note
-that if @var{node} satisfies @var{pred} but its immediate parent
-doesn't, @var{node} itself is returned.
+takes a node as argument.  That is, this function returns the highest
+parent of @var{node} that still satisfies @var{pred}.  Note that if
+@var{node} satisfies @var{pred} but its immediate parent doesn't,
+@var{node} itself is returned.
 @end defun
 
 @defun treesit-node-top-level node &optional type
@@ -1026,7 +1025,7 @@ has an error.
 @cindex tree-sitter, live parsing node
 @cindex live node, tree-sitter
 A node is considered @dfn{live} if its parser is not deleted, and the
-buffer to which it belongs to is a live buffer (@pxref{Killing Buffers}).
+buffer to which it belongs is a live buffer (@pxref{Killing Buffers}).
 
 @defun treesit-node-check node property
 This function returns non-@code{nil} if @var{node} has the specified
@@ -1063,12 +1062,12 @@ This function returns the field name of the @var{n}'th 
child of
 @var{node}.  It returns @code{nil} if there is no @var{n}'th child, or
 the @var{n}'th child doesn't have a field name.
 
-Note that @var{n} counts both named and anonymous child.  And @var{n}
-could be negative, e.g., @code{-1} represents the last child.
+Note that @var{n} counts both named and anonymous children, and
+@var{n} can be negative, e.g., @minus{}1 represents the last child.
 @end defun
 
 @defun treesit-node-child-count node &optional named
-This function finds the number of children of @var{node}.  If
+This function returns the number of children of @var{node}.  If
 @var{named} is non-@code{nil}, it only counts named children
 (@pxref{tree-sitter named node, named node}).
 @end defun
@@ -1095,7 +1094,7 @@ finally the more advanced pattern syntax.
 @cindex query, tree-sitter
 A @dfn{query} consists of multiple @dfn{patterns}.  Each pattern is an
 s-expression that matches a certain node in the syntax node.  A
-pattern has the form @w{@code{(@var{type} (@var{child}@dots{}))}}
+pattern has the form @w{@code{(@var{type} (@var{child}@dots{}))}}.
 
 For example, a pattern that matches a @code{binary_expression} node that
 contains @code{number_literal} child nodes would look like
@@ -1131,25 +1130,26 @@ example, the capture name @code{biexp}:
 Now we can introduce the @dfn{query functions}.
 
 @defun treesit-query-capture node query &optional beg end node-only
-This function matches patterns in @var{query} within @var{node}.
-The argument @var{query} can be either a string, a s-expression, or a
+This function matches patterns in @var{query} within @var{node}.  The
+argument @var{query} can be either a string, an s-expression, or a
 compiled query object.  For now, we focus on the string syntax;
-s-expression syntax and compiled query are described at the end of the
-section.
+s-expression syntax and compiled queries are described at the end of
+the section.
 
 The argument @var{node} can also be a parser or a language symbol.  A
-parser means using its root node, a language symbol means find or
-create a parser for that language in the current buffer, and use the
-root node.
-
-The function returns all the captured nodes in a list of the form
-@w{@code{(@var{capture_name} . @var{node})}}.  If @var{node-only} is
-non-@code{nil}, it returns the list of nodes instead.  By default the
-entire text of @var{node} is searched, but if @var{beg} and @var{end}
-are both non-@code{nil}, they specify the region of buffer text where
-this function should match nodes.  Any matching node whose span
-overlaps with the region between @var{beg} and @var{end} are captured,
-it doesn't have to be completely in the region.
+parser means use its root node, a language symbol means find or create
+a parser for that language in the current buffer, and use the root
+node.
+
+The function returns all the captured nodes in an alist with elements
+of the form @w{@code{(@var{capture_name} . @var{node})}}.  If
+@var{node-only} is non-@code{nil}, it returns the list of @var{node}s
+instead.  By default the entire text of @var{node} is searched, but if
+@var{beg} and @var{end} are both non-@code{nil}, they specify the
+region of buffer text where this function should match nodes.  Any
+matching node whose span overlaps with the region between @var{beg}
+and @var{end} is captured; it doesn't have to be completely contained
+in the region.
 
 @vindex treesit-query-error
 @findex treesit-query-validate
@@ -1193,13 +1193,13 @@ For example, it could have two top-level patterns:
 @end example
 
 @defun treesit-query-string string query language
-This function parses @var{string} with @var{language}, matches its
-root node with @var{query}, and returns the result.
+This function parses @var{string} as @var{language}, matches its root
+node with @var{query}, and returns the result.
 @end defun
 
 @heading More query syntax
 
-Besides node type and capture, tree-sitter's pattern syntax can
+Besides node type and capture name, tree-sitter's pattern syntax can
 express anonymous node, field name, wildcard, quantification,
 grouping, alternation, anchor, and predicate.
 
@@ -1215,11 +1215,11 @@ pattern matching (and capturing) keyword @code{return} 
would be
 @subheading Wild card
 
 In a pattern, @samp{(_)} matches any named node, and @samp{_} matches
-any named and anonymous node.  For example, to capture any named child
+any named or anonymous node.  For example, to capture any named child
 of a @code{binary_expression} node, the pattern would be
 
 @example
-(binary_expression (_) @@in_biexp)
+(binary_expression (_) @@in-biexp)
 @end example
 
 @subheading Field name
@@ -1237,7 +1237,7 @@ names, indicated by the colon following them.
 @end example
 
 It is also possible to capture a node that doesn't have a certain
-field, say, a @code{function_definition} without a @code{body} field.
+field, say, a @code{function_definition} without a @code{body} field:
 
 @example
 (function_definition !body) @@func-no-body
@@ -1246,20 +1246,20 @@ field, say, a @code{function_definition} without a 
@code{body} field.
 @subheading Quantify node
 
 @cindex quantify node, tree-sitter
-Tree-sitter recognizes quantification operators @samp{*}, @samp{+} and
-@samp{?}.  Their meanings are the same as in regular expressions:
+Tree-sitter recognizes quantification operators @samp{*}, @samp{+},
+and @samp{?}.  Their meanings are the same as in regular expressions:
 @samp{*} matches the preceding pattern zero or more times, @samp{+}
-matches one or more times, and @samp{?} matches zero or one time.
+matches one or more times, and @samp{?} matches zero or one times.
 
 For example, the following pattern matches @code{type_declaration}
-nodes that has @emph{zero or more} @code{long} keyword.
+nodes that have @emph{zero or more} @code{long} keywords.
 
 @example
 (type_declaration "long"*) @@long-type
 @end example
 
-The following pattern matches a type declaration that has zero or one
-@code{long} keyword:
+The following pattern matches a type declaration that may or may not
+have a @code{long} keyword:
 
 @example
 (type_declaration "long"?) @@long-type
@@ -1267,9 +1267,9 @@ The following pattern matches a type declaration that has 
zero or one
 
 @subheading Grouping
 
-Similar to groups in regular expression, we can bundle patterns into
+Similar to groups in regular expressions, we can bundle patterns into
 groups and apply quantification operators to them.  For example, to
-express a comma separated list of identifiers, one could write
+express a comma-separated list of identifiers, one could write
 
 @example
 (identifier) ("," (identifier))*
@@ -1277,10 +1277,10 @@ express a comma separated list of identifiers, one 
could write
 
 @subheading Alternation
 
-Again, similar to regular expressions, we can express ``match anyone
-from this group of patterns'' in a pattern.  The syntax is a list of
-patterns enclosed in square brackets.  For example, to capture some
-keywords in C, the pattern would be
+Again, similar to regular expressions, we can express ``match any one
+of these patterns'' in a pattern.  The syntax is a list of patterns
+enclosed in square brackets.  For example, to capture some keywords in
+C, the pattern would be
 
 @example
 @group
@@ -1339,14 +1339,14 @@ example, with the following pattern:
 @end example
 
 @noindent
-tree-sitter only matches arrays where the first element equals to the
-last element.  To attach a predicate to a pattern, we need to group
-them together.  A predicate always starts with a @samp{#}.  Currently
-there are three predicates, @code{#equal}, @code{#match}, and
-@code{#pred}.
+tree-sitter only matches arrays where the first element is equal to
+the last element.  To attach a predicate to a pattern, we need to
+group them together.  A predicate always starts with a @samp{#}.
+Currently there are three predicates: @code{#equal}, @code{#match},
+and @code{#pred}.
 
 @deffn Predicate equal arg1 arg2
-Matches if @var{arg1} equals to @var{arg2}.  Arguments can be either
+Matches if @var{arg1} is equal to @var{arg2}.  Arguments can be either
 strings or capture names.  Capture names represent the text that the
 captured node spans in the buffer.
 @end deffn
@@ -1370,7 +1370,7 @@ names in other patterns.
 
 @cindex tree-sitter patterns as sexps
 @cindex patterns, tree-sitter, in sexp form
-Besides strings, Emacs provides a s-expression based syntax for
+Besides strings, Emacs provides an s-expression based syntax for
 tree-sitter patterns.  It largely resembles the string-based syntax.
 For example, the following query
 
@@ -1402,7 +1402,7 @@ is equivalent to
 @end example
 
 Most patterns can be written directly as strange but nevertheless
-valid s-expressions.  Only a few of them needs modification:
+valid s-expressions.  Only a few of them need modification:
 
 @itemize
 @item
@@ -1430,7 +1430,7 @@ For example,
 @end example
 
 @noindent
-is written in s-expression as
+is written in s-expression syntax as
 
 @example
 @group
@@ -1488,8 +1488,8 @@ example.  In that case, text segments written in 
different languages
 need to be assigned different parsers.  Traditionally, this is
 achieved by using narrowing.  While tree-sitter works with narrowing
 (@pxref{tree-sitter narrowing, narrowing}), the recommended way is
-instead to set regions of buffer text (i.e., ranges) in which a parser
-will operate.  This section describes functions for setting and
+instead to specify regions of buffer text (i.e., ranges) in which a
+parser will operate.  This section describes functions for setting and
 getting ranges for a parser.
 
 Lisp programs should call @code{treesit-update-ranges} to make sure
@@ -1507,7 +1507,7 @@ end of the section.
 @defun treesit-parser-set-included-ranges parser ranges
 This function sets up @var{parser} to operate on @var{ranges}.  The
 @var{parser} will only read the text of the specified ranges.  Each
-range in @var{ranges} is a list of the form @w{@code{(@var{beg}
+range in @var{ranges} is a pair of the form @w{@code{(@var{beg}
 . @var{end})}}.
 
 The ranges in @var{ranges} must come in order and must not overlap.
@@ -1581,7 +1581,7 @@ Like other query functions, this function raises the
 @heading Supporting multiple languages in Lisp programs
 
 It should suffice for general Lisp programs to call the following two
-functions in order to support program sources that mixes multiple
+functions in order to support program sources that mix multiple
 languages.
 
 @defun treesit-update-ranges &optional beg end
@@ -1617,13 +1617,13 @@ language's parser, retrieves some information, sets 
ranges for the
 embedded languages with that information, and then parses the embedded
 languages.
 
-Take a buffer containing @acronym{HTML}, @acronym{CSS} and JavaScript
+Take a buffer containing @acronym{HTML}, @acronym{CSS}, and JavaScript
 as an example.  A Lisp program will first parse the whole buffer with
 an @acronym{HTML} parser, then query the parser for
-@code{style_element} and @code{script_element} nodes, which
-correspond to @acronym{CSS} and JavaScript text, respectively.  Then
-it sets the range of the @acronym{CSS} and JavaScript parser to the
-ranges in which their corresponding nodes span.
+@code{style_element} and @code{script_element} nodes, which correspond
+to @acronym{CSS} and JavaScript text, respectively.  Then it sets the
+range of the @acronym{CSS} and JavaScript parsers to the range which
+their corresponding nodes span.
 
 Given a simple @acronym{HTML} document:
 
@@ -1677,17 +1677,17 @@ directly translate into operations shown above.
 
 @example
 @group
-(setq-local treesit-range-settings
-            (treesit-range-rules
-             :embed 'javascript
-             :host 'html
-             '((script_element (raw_text) @@capture))
+(setq treesit-range-settings
+      (treesit-range-rules
+       :embed 'javascript
+       :host 'html
+       '((script_element (raw_text) @@capture))
 @end group
 
 @group
-             :embed 'css
-             :host 'html
-             '((style_element (raw_text) @@capture))))
+       :embed 'css
+       :host 'html
+       '((style_element (raw_text) @@capture))))
 @end group
 @end example
 
@@ -1698,21 +1698,21 @@ value that @code{treesit-range-settings} can have.
 
 It takes a series of @var{query-spec}s, where each @var{query-spec} is
 a @var{query} preceded by zero or more @var{keyword}/@var{value}
-pairs.  Each @var{query} is a tree-sitter query in either the
-string, s-expression or compiled form, or a function.
+pairs.  Each @var{query} is a tree-sitter query in either the string,
+s-expression, or compiled form, or a function.
 
 If @var{query} is a tree-sitter query, it should be preceded by two
-@var{:keyword}/@var{value} pairs, where the @code{:embed} keyword
+@var{keyword}/@var{value} pairs, where the @code{:embed} keyword
 specifies the embedded language, and the @code{:host} keyword
-specified the host language.
+specifies the host language.
 
 @code{treesit-update-ranges} uses @var{query} to figure out how to set
 the ranges for parsers for the embedded language.  It queries
-@var{query} in a host language parser, computes the ranges in which
-the captured nodes span, and applies these ranges to embedded
-language parsers.
+@var{query} in a host language parser, computes the ranges which the
+captured nodes span, and applies these ranges to embedded language
+parsers.
 
-If @var{query} is a function, it doesn't need any @var{:keyword} and
+If @var{query} is a function, it doesn't need any @var{keyword} and
 @var{value} pair.  It should be a function that takes 2 arguments,
 @var{start} and @var{end}, and sets the ranges for parsers in the
 current buffer in the region between @var{start} and @var{end}.  It is
@@ -1765,8 +1765,8 @@ this pattern:
 @code{treesit-ready-p} automatically emits a warning if conditions for
 enabling tree-sitter aren't met.
 
-If a tree-sitter major mode shares setup with their ``native''
-counterpart, they can create a ``base mode'' that contains the common
+If a tree-sitter major mode shares setup with its ``native''
+counterpart, one can create a ``base mode'' that contains the common
 setup, like this:
 
 @example
@@ -1797,9 +1797,9 @@ setup, like this:
 @defun treesit-ready-p language &optional quiet
 This function checks for conditions for activating tree-sitter.  It
 checks whether Emacs was built with tree-sitter, whether the buffer's
-size is not too large for tree-sitter to handle it, and whether the
-language grammar for @var{language} is available on the system
-(@pxref{Language Grammar}).
+size is not too large for tree-sitter to handle, and whether the
+grammar for @var{language} is available on the system (@pxref{Language
+Grammar}).
 
 This function emits a warning if tree-sitter cannot be activated.  If
 @var{quiet} is @code{message}, the warning is turned into a message;
@@ -1837,7 +1837,7 @@ non-@code{nil}, it sets up Imenu.
 @end itemize
 @end defun
 
-For more information of these built-in tree-sitter features,
+For more information on these built-in tree-sitter features,
 @pxref{Parser-based Font Lock}, @pxref{Parser-based Indentation}, and
 @pxref{List Motion}.
 
@@ -1876,28 +1876,17 @@ always returns @code{nil}.
 @defvar treesit-defun-name-function
 If non-@code{nil}, this variable's value should be a function that is
 called with a node as its argument, and returns the defun name of the
-node.  The function should have the same semantic as
+node.  The function should have the same semantics as
 @code{treesit-defun-name}: if the node is not a defun node, or the
 node is a defun node but doesn't have a name, or the node is
 @code{nil}, it should return @code{nil}.
 @end defvar
 
-@defvar treesit-defun-type-regexp
-This variable determines which nodes are considered defuns by Emacs.
-It can be a regexp that matches the type of defun nodes.
-
-Sometimes not all nodes matched by the regexp are valid defuns.
-Therefore, this variable can also be a cons cell of the form
-@w{(@var{regexp} . @var{pred})}, where @var{pred} should be a function
-that takes a node as its argument, and returns @code{t} if the node is
-valid defun, or @code{nil} if it is not valid.
-@end defvar
-
 @node Tree-sitter C API
 @section Tree-sitter C API Correspondence
 
 Emacs' tree-sitter integration doesn't expose every feature
-provided by tree-sitter's C API.  Missing features include:
+provided by tree-sitter's C API@.  Missing features include:
 
 @itemize
 @item
@@ -1928,7 +1917,7 @@ convenient and idiomatic:
 Instead of using byte positions, the Emacs Lisp API uses character
 positions.
 @item
-Null nodes are converted to nil.
+Null nodes are converted to @code{nil}.
 @end itemize
 
 Below is the correspondence between all C API functions and their
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi
index 1305daa7a2e..a308f2dfc4e 100644
--- a/doc/lispref/positions.texi
+++ b/doc/lispref/positions.texi
@@ -844,18 +844,25 @@ the mode can get navigation-by-defun functionality for 
free, by using
 @code{treesit-beginning-of-defun} and @code{treesit-end-of-defun}.
 
 @defvar treesit-defun-type-regexp
-The value of this variable is a regexp matching the node type of defun
-nodes.  (For ``node'' and ``node type'', @pxref{Parsing Program Source}.)
+This variable determines which nodes are considered defuns by Emacs.
+It can be a regexp that matches the type of defun nodes.  (For
+``node'' and ``node type'', @pxref{Parsing Program Source}.)
 
 For example, @code{python-mode} sets this variable to a regexp that
-matches either @code{"function_definition"} or @code{"class_definition"}.
+matches either @samp{function_definition} or @samp{class_definition}.
+
+Sometimes not all nodes matched by the regexp are valid defuns.
+Therefore, this variable can also be a cons cell of the form
+@w{(@var{regexp} . @var{pred})}, where @var{pred} should be a function
+that takes a node as its argument, and returns non-@code{nil} if the
+node is a valid defun, or @code{nil} if it is not valid.
 @end defvar
 
 @defvar treesit-defun-tactic
-This variable determines how Emacs treats nested defuns.  If the
-value is @code{top-level}, navigation functions only move across
-top-level defuns, if the value is @code{nested}, navigation functions
-recognize nested defuns.
+This variable determines how Emacs treats nested defuns.  If the value
+is @code{top-level}, navigation functions only move across top-level
+defuns.  If the value is @code{nested}, navigation functions recognize
+nested defuns.
 @end defvar
 
 @defvar treesit-sentence-type-regexp
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 7cbe87240c9..adab9eb0d0c 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -2680,7 +2680,7 @@ naming the certificate key file and certificate file 
itself, or
 Library}).  Only used for @acronym{TLS} or @acronym{STARTTLS}.  To
 enable automatic queries of @code{auth-source} when
 @code{:client-certificate} is not specified customize
-@code{network-stream-use-client-certificates} to t.
+@code{network-stream-use-client-certificates} to @code{t}.
 
 @item :return-list @var{cons-or-nil}
 The return value of this function.  If omitted or @code{nil}, return a
@@ -3593,7 +3593,7 @@ and @code{#x1c} @code{#x28} to @w{@code{(3 5 10 11 12)}}.
 @item fill @var{len}
 @var{len} bytes used as a mere filler.  In packing, these bytes are
 left unchanged, which normally means they remain zero.
-When unpacking, this just returns nil.
+When unpacking, this just returns @code{nil}.
 
 @item align @var{len}
 Same as @code{fill} except the number of bytes is that needed to skip
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 06b3556c855..b8d9094b28d 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -1568,7 +1568,7 @@ used, a Lisp expression that evaluates to a string.  
Example:
 
 @defun rx-to-string rx-expr &optional no-group
 Translate @var{rx-expr} to a string regexp which is returned.
-If @var{no-group} is absent or nil, bracket the result in a
+If @var{no-group} is absent or @code{nil}, bracket the result in a
 non-capturing group, @samp{\(?:@dots{}\)}, if necessary to ensure that
 a postfix operator appended to it will apply to the whole expression.
 Example:
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index dac8d0d8ce9..08e64980ee0 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -4764,9 +4764,9 @@ and exceeded, it will fall back to @code{delete-region} 
and
 the actual costs exceed this limit, heuristics are used to provide a
 faster but suboptimal solution.  The default value is 1000000.
 
-@code{replace-buffer-contents} returns t if a non-destructive
+@code{replace-buffer-contents} returns @code{t} if a non-destructive
 replacement could be performed.  Otherwise, i.e., if @var{max-secs}
-was exceeded, it returns nil.
+was exceeded, it returns @code{nil}.
 @end deffn
 
 @defun replace-region-contents beg end replace-fn &optional max-secs max-costs
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 0196ed0e813..a49e63e49de 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -5569,7 +5569,7 @@ non-@code{nil}, this function may redraw the frame, 
according to the
 value of @code{recenter-redisplay}.  Thus, omitting the second
 argument can be used to countermand the effect of
 @code{recenter-redisplay} being non-@code{nil}.  Interactive calls
-pass non-‘nil’ for @var{redisplay}.
+pass non-@code{nil} for @var{redisplay}.
 
 When @code{recenter} is called interactively, @var{count} is the raw
 prefix argument.  Thus, typing @kbd{C-u} as the prefix sets the
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index f5f4dff0e18..00c0fa6001a 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -18617,8 +18617,8 @@ gamma function.  For positive integer arguments, this 
is related to the
 factorial function:  @samp{gamma(n+1) = fact(n)}.  For general complex
 arguments the gamma function can be defined by the following definite
 integral:
-@texline @math{\Gamma(a) = \int_0^\infty t^{a-1} e^t dt}.
-@infoline @expr{gamma(a) = integ(t^(a-1) exp(t), t, 0, inf)}.
+@texline @math{\Gamma(a) = \int_0^\infty t^{a-1} e^{-t} dt}.
+@infoline @expr{gamma(a) = integ(t^(a-1) exp(-t), t, 0, inf)}.
 (The actual implementation uses far more efficient computational methods.)
 
 @kindex f G
@@ -18709,7 +18709,7 @@ un-normalized version [@code{betaB}].
 The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the
 error function
 @texline @math{\hbox{erf}(x) = {2 \over \sqrt{\pi}} \int_0^x e^{-t^2} dt}.
-@infoline @expr{erf(x) = 2 integ(exp(-(t^2)), t, 0, x) / sqrt(pi)}.
+@infoline @expr{erf(x) = 2 integ(exp(-(t^(2))), t, 0, x) / sqrt(pi)}.
 The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}]
 is the corresponding integral from @samp{x} to infinity; the sum
 @texline @math{\hbox{erf}(x) + \hbox{erfc}(x) = 1}.
@@ -28475,13 +28475,13 @@ B and
 @c flat and @expr{B}.
 the octave numbered 0 was chosen to correspond to the lowest
 audible frequency.  Using this system, middle C (about 261.625 Hz)
-corresponds to the note @expr{C} in octave 4 and is denoted
-@expr{C_4}.  Any frequency can be described by giving a note plus an
+corresponds to the note @slanted{C} in octave 4 and is denoted
+@slanted{C@sub{4}}.  Any frequency can be described by giving a note plus an
 offset in cents (where a cent is a ratio of frequencies so that a
 semitone consists of 100 cents).
 
 The midi note number system assigns numbers to notes so that
-@expr{C_(-1)} corresponds to the midi note number 0 and @expr{G_9}
+@slanted{C@sub{-1}} corresponds to the midi note number 0 and 
@slanted{G@sub{9}}
 corresponds to the midi note number 127.   A midi controller can have
 up to 128 keys and each midi note number from  0 to 127 corresponds to
 a possible key.
@@ -29880,10 +29880,10 @@ with no argument copies only the number itself into 
the kill ring, whereas
 @kbd{C-k} with a prefix argument of 1 copies the number with its trailing
 newline.
 
-You can customize @code{calc-kill-line-numbering} to nil to exclude
-line numbering from kills and copies made by @code{calc-kill} and
-@code{calc-copy-as-kill}.  This option does not affect calc kill and
-copy commands which operate on the region, as that would not make
+You can customize @code{calc-kill-line-numbering} to @code{nil} to
+exclude line numbering from kills and copies made by @code{calc-kill}
+and @code{calc-copy-as-kill}.  This option does not affect calc kill
+and copy commands which operate on the region, as that would not make
 sense.
 
 @node Yanking Into Stack
@@ -35595,11 +35595,11 @@ The default value of @code{calc-note-threshold} is 1.
 See @ref{Displaying Selections}.@*
 The variable @code{calc-highlight-selections-with-faces}
 determines how selected sub-formulas are distinguished.
-If @code{calc-highlight-selections-with-faces} is nil, then
+If @code{calc-highlight-selections-with-faces} is @code{nil}, then
 a selected sub-formula is distinguished either by changing every
 character not part of the sub-formula with a dot or by changing every
 character in the sub-formula with a @samp{#} sign.
-If @code{calc-highlight-selections-with-faces} is t,
+If @code{calc-highlight-selections-with-faces} is @code{t},
 then a selected sub-formula is distinguished either by displaying the
 non-selected portion of the formula with @code{calc-nonselected-face}
 or by displaying the selected sub-formula with
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index 71bf3fcee4a..4ac9cc3ca2d 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -2192,10 +2192,10 @@ foo& bar
 
 @defvar c-asymmetry-fontification-flag
 @vindex asymmetry-fontification-flag @r{(c-)}
-When @code{c-asymmetry-fontification-flag} is non-@code{nil} (which it is by
-default), code like the above, with white space either before or after
-the operator, but not both, is fontified as a declaration.  When the
-variable is nil, such a construct gets the default face.
+When @code{c-asymmetry-fontification-flag} is non-@code{nil} (which it
+is by default), code like the above, with white space either before or
+after the operator, but not both, is fontified as a declaration.  When
+the variable is @code{nil}, such a construct gets the default face.
 @end defvar
 
 When the construct is an expression there will often be white space
@@ -6036,7 +6036,7 @@ three syntactic symbols, @code{arglist-cont-nonempty},
 List Symbols}).
 
 This function is intended for use in a list.  If the construct being
-analyzed isn't like the preceding, the function returns nil.
+analyzed isn't like the preceding, the function returns @code{nil}.
 Otherwise it returns the function
 @code{c-lineup-arglist-intro-after-paren}, which the caller then uses
 to perform indentation.
@@ -6080,8 +6080,8 @@ also has a syntactic element with the symbol 
@code{brace-list-entry}
 (@pxref{Brace List Symbols}).
 
 This function is intended for use in a list.  If the above structure
-isn't present, the function returns nil, allowing a different offset
-specification to indent the line.
+isn't present, the function returns @code{nil}, allowing a different
+offset specification to indent the line.
 
 @workswith{} @code{brace-list-intro}.
 @end defun
@@ -6123,8 +6123,8 @@ returning the symbol 
@code{c-lineup-arglist-intro-after-paren}, which
 the caller then uses to perform the indentation.
 
 This function is intended for use in a list.  If the above structure
-isn't present, the function returns nil, allowing a different offset
-specification to indent the line.
+isn't present, the function returns @code{nil}, allowing a different
+offset specification to indent the line.
 
 @workswith{} @code{brace-list-intro}.
 @end defun
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi
index 97a0f39ea13..2bd6b9556c8 100644
--- a/doc/misc/dbus.texi
+++ b/doc/misc/dbus.texi
@@ -1847,8 +1847,24 @@ This function establishes the connection to D-Bus 
@var{bus}.
 corresponding bus.  For the system and session buses, this function is
 called when loading @file{dbus.el}, there is no need to call it again.
 
-The function returns the number of connections this Emacs session has
-established to the @var{bus} under the same unique name
+If Emacs was invoked when there was no D-Bus session bus available
+yet, you can set the environment variable
+@env{DBUS_SESSION_BUS_ADDRESS} once the session bus daemon is running
+and offering the address.  Calling @code{dbus-init-bus} initializes
+the connection to the session bus.
+
+@lisp
+(setenv "DBUS_SESSION_BUS_ADDRESS" "unix:path=/run/user/1000/bus")
+
+@result{} "unix:path=/run/user/1000/bus"
+
+(dbus-init-bus :session)
+
+@result{} 2
+@end lisp
+
+@code{dbus-init-bus} returns the number of connections this Emacs
+session has established to the @var{bus} under the same unique name
 (@pxref{dbus-get-unique-name}).  It depends on the libraries Emacs is
 linked with, and on the environment Emacs is running.  For example, if
 Emacs is linked with the GTK+ toolkit, and it runs in a GTK+-aware
diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi
index e4ec72af5cd..d49d2296aa7 100644
--- a/doc/misc/ede.texi
+++ b/doc/misc/ede.texi
@@ -1896,19 +1896,19 @@ Make sure the @code{:file} is fully expanded.
 @end deffn
 
 @deffn Method ede-preprocessor-map :AFTER this
-Get the pre-processor map for project @var{THIS}.
+Get the pre-processor map for project @var{this}.
 @end deffn
 
 @deffn Method ede-cpp-root-header-file-p :AFTER proj name
-Non @code{nil} if in @var{PROJ} the filename @var{NAME} is a header.
+Non-@code{nil} if in @var{proj} the filename @var{name} is a header.
 @end deffn
 
 @deffn Method ede-system-include-path :AFTER this
-Get the system include path used by project @var{THIS}.
+Get the system include path used by project @var{this}.
 @end deffn
 
 @deffn Method ede-expand-filename-impl :AFTER proj name
-Within this project @var{PROJ}, find the file @var{NAME}.
+Within this project @var{proj}, find the file @var{name}.
 This knows details about or source tree.
 @end deffn
 
@@ -2796,7 +2796,7 @@ File name of generated Makefile.
 Type: @code{boolean} @*
 Default Value: @code{t}
 
-Non @code{nil} means the rule created is part of the all target.
+Non-@code{nil} means the rule created is part of the all target.
 Setting this to @code{nil} creates the rule to build this item, but does not
 include it in the @code{all:} rule.
 
@@ -3888,10 +3888,10 @@ themselves.
 Type: @code{boolean} @*
 Default Value: @code{nil}
 
-Non @code{nil} if this sourcecode type uses subdirectores.
-If sourcecode always lives near the target creating it, this should be nil.
-If sourcecode can, or typically lives in a subdirectory of the owning
-target, set this to t.
+Non-@code{nil} if this sourcecode type uses subdirectores.  If
+sourcecode always lives near the target creating it, this should be
+@code{nil}.  If sourcecode can, or typically lives in a subdirectory
+of the owning target, set this to @code{t}.
 
 @item :garbagepattern
 Type: @code{list} @*
diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index fd96fcf8b8c..a6b62a058f2 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -409,13 +409,13 @@ emacs -batch -l ert -l my-tests.el \
 @end example
 
 @vindex ert-batch-backtrace-line-length
-Even modest settings for @code{print-level} and @code{print-length} can
-produce extremely long lines in backtraces, however, with attendant
-pauses in execution progress.  Set
-@code{ert-batch-backtrace-line-length} to t to use the value of
-@code{backtrace-line-length}, @code{nil} to stop any limitations on backtrace
-line lengths (that is, to get full backtraces), or a positive integer to
-limit backtrace line length to that number.
+Even modest settings for @code{print-level} and @code{print-length}
+can produce extremely long lines in backtraces, however, with
+attendant pauses in execution progress.  Set
+@code{ert-batch-backtrace-line-length} to @code{t} to use the value of
+@code{backtrace-line-length}, @code{nil} to stop any limitations on
+backtrace line lengths (that is, to get full backtraces), or a
+positive integer to limit backtrace line length to that number.
 
 @vindex ert-quiet
 By default, ERT in batch mode is quite verbose, printing a line with
diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi
index 743d7da946b..d82dec971cd 100644
--- a/doc/misc/eudc.texi
+++ b/doc/misc/eudc.texi
@@ -374,7 +374,7 @@ LDAP:
 Specifying the function @code{ldap-password-read} for @code{passwd}
 will cause Emacs to prompt interactively for the password.  The
 password will then be validated and cached, unless
-@code{password-cache} is nil.  You can customize
+@code{password-cache} is @code{nil}.  You can customize
 @code{password-cache-expiry} to control the duration for which the
 password is cached.  If you want to clear the cache, call
 @code{password-reset}.
@@ -1023,9 +1023,9 @@ current server to the list with the command @kbd{M-x
 eudc-bookmark-current-server}.  The list is contained in the variable
 @code{eudc-server-hotlist} which is stored in and retrieved from the
 file designated by @code{eudc-options-file}, or normal Emacs
-initialization if @code{eudc-ignore-options-file} is non-nil.  EUDC
-also provides a facility to edit the hotlist interactively (@pxref{The
-Hotlist Edit Buffer}).
+initialization if @code{eudc-ignore-options-file} is non-@code{nil}.
+EUDC also provides a facility to edit the hotlist interactively
+(@pxref{The Hotlist Edit Buffer}).
 
 The hotlist is also used to make queries on multiple servers
 successively (@pxref{Multi-server Queries}).  The order in which the
@@ -1041,18 +1041,18 @@ Add the current server to the hotlist of servers
 @end deffn
 
 @defvar eudc-ignore-options-file
-If non-nil, then EUDC ignores @code{eudc-options-file} and warns or
+If non-@code{nil}, EUDC ignores @code{eudc-options-file} and warns or
 issues an error when an attempt is made to use it.  Most users should
 set this, and keep their EUDC configuration in the main Emacs
-initialization file instead.  The separate eudc-options file has
-created confusion for users in the past.
+initialization file instead.  The separate @file{eudc-options} file
+has created confusion for users in the past.
 @end defvar
 
 @defvar eudc-options-file
 The name of a file where EUDC stores its internal variables (the
 hotlist and the current server).  EUDC will try to load that file upon
 initialization so, if you choose a file name different from the
-defaults @file{~/.emacs.d/eudc-options}, be sure to set this variable
+default @file{~/.emacs.d/eudc-options}, be sure to set this variable
 to the appropriate value @emph{before} EUDC is itself loaded.
 @end defvar
 
diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi
index 836eb38503e..c02e9db11c9 100644
--- a/doc/misc/eww.texi
+++ b/doc/misc/eww.texi
@@ -368,8 +368,8 @@ point positions or the actual Web page contents.
 The latter, however, tend to be overly large to preserve in the
 desktop file, so they get omitted, thus rendering the respective
 entries entirely equivalent.  By default, such duplicate entries are
-not saved.  Setting @code{eww-desktop-remove-duplicates} to nil will
-force EWW to save them anyway.
+not saved.  Setting @code{eww-desktop-remove-duplicates} to @code{nil}
+will force EWW to save them anyway.
 
 @vindex eww-restore-desktop
   Restoring EWW buffers' contents may prove to take too long to
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index b6a540a6ea3..237f0702778 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -115,11 +115,11 @@ Syntax checks happen ``on-the-fly''.  Each check is 
started whenever:
 @itemize @bullet
 @item
 @code{flymake-mode} is started, unless
-@code{flymake-start-on-flymake-mode} is nil;
+@code{flymake-start-on-flymake-mode} is @code{nil};
 
 @item
 the buffer is saved, unless @code{flymake-start-on-save-buffer} is
-nil;
+@code{nil};
 
 @item
 some changes were made to the buffer more than @code{0.5} seconds ago
@@ -771,9 +771,13 @@ The following code needs lexical binding (@pxref{Using 
Lexical
 Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active.
 
 @example
+@group
 ;;; ruby-flymake.el --- A ruby Flymake backend  -*- lexical-binding: t; -*-
+(require 'cl-lib)
 (defvar-local ruby--flymake-proc nil)
+@end group
 
+@group
 (defun ruby-flymake (report-fn &rest _args)
   ;; Not having a ruby interpreter is a serious problem which should cause
   ;; the backend to disable itself, so an @code{error} is signaled.
@@ -787,7 +791,9 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be 
active.
   ;;
   (when (process-live-p ruby--flymake-proc)
     (kill-process ruby--flymake-proc))
+@end group
 
+@group
   ;; Save the current buffer, the narrowing restriction, remove any
   ;; narrowing restriction.
   ;;
@@ -853,11 +859,14 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be 
active.
       ;;
       (process-send-region ruby--flymake-proc (point-min) (point-max))
       (process-send-eof ruby--flymake-proc))))
+@end group
 
+@group
 (defun ruby-setup-flymake-backend ()
   (add-hook 'flymake-diagnostic-functions 'ruby-flymake nil t))
 
 (add-hook 'ruby-mode-hook 'ruby-setup-flymake-backend)
+@end group
 @end example
 
 @node The legacy Proc backend
@@ -909,13 +918,18 @@ Patterns for error/warning messages in the form 
@code{(regexp file-idx
 line-idx col-idx err-text-idx)}.  @xref{Parsing the output}.
 
 @item flymake-proc-diagnostic-type-pred
-A function to classify a diagnostic text as particular type of error.
-Should be a function taking an error text and returning a diagnostic
-symbol (@pxref{Flymake error types}).  If non-@code{nil} is returned but
-there is no such symbol in that table, a warning is assumed.  If nil
-is returned, an error is assumed.  Can also be a regular expression
-that should match only warnings.  This variable replaces the old
-@code{flymake-warning-re} and @code{flymake-warning-predicate}.
+A function to classify a diagnostic text as a particular type of
+error.  The value of this variable should be a function taking an
+error text and returning a diagnostic symbol (@pxref{Flymake error
+types}).  If it returns a non-@code{nil} value but there is no such
+symbol in that table, the text is interpreted as a warning.  If the
+function returns @code{nil}, the text is assumed to be an error.
+
+The value of this variable can alternatively be a regular expression
+that should match only warnings.
+
+This variable replaces the old @code{flymake-warning-re} and
+@code{flymake-warning-predicate}.
 
 @item flymake-proc-compilation-prevents-syntax-check
 A flag indicating whether compilation and syntax check of the same
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index e08a5587962..8d25e868c8a 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -5014,14 +5014,14 @@ the @code{a} spec.
 @item L
 Number of lines in the article.
 @item Z
-Retrieval Score Value (RSV) of the article; nil if not in an nnselect
-group.
+Retrieval Score Value (RSV) of the article; @code{nil} if not in an
+nnselect group.
 @item G
-Originating group name of the article; nil if not in an nnselect
-group.
+Originating group name of the article; @code{nil} if not in an
+nnselect group.
 @item g
-Short form of the originating group name of the article; nil if not in
-an nnselect group.
+Short form of the originating group name of the article; @code{nil} if
+not in an nnselect group.
 @item c
 Number of characters in the article.  This specifier is not supported
 in some methods (like nnfolder).
@@ -14571,18 +14571,20 @@ requires using the @file{oauth2.el} library.)
 @vindex nnimap-expunge
 @item nnimap-expunge
 When to expunge deleted messages.  If @code{never}, deleted articles
-are marked with the IMAP @code{\\Delete} flag but not automatically
-expunged. If @code{immediately}, deleted articles are immediately expunged
-(this requires the server to support the UID EXPUNGE command). If
-@code{on-exit}, deleted articles are flagged, and all flagged articles are
-expunged when the group is closed.
-
-For backwards compatibility, this variable may also be set to t
-or nil. If the server supports UID EXPUNGE, both t and nil are
-equivalent to @code{immediately}. If the server does not support UID
-EXPUNGE nil is equivalent to @code{never}, while t will immediately
-expunge ALL articles that are currently flagged as deleted
-(i.e., potentially not only the article that was just deleted).
+are marked with the @acronym{IMAP} @code{\\Delete} flag but not
+automatically expunged.  If @code{immediately}, deleted articles are
+immediately expunged (this requires the server to support the
+@code{UID EXPUNGE} command).  If @code{on-exit}, deleted articles are
+flagged, and all flagged articles are expunged when the group is
+closed.
+
+For backwards compatibility, this variable may also be set to @code{t}
+or @code{nil}.  If the server supports @code{UID EXPUNGE}, both
+@code{t} and @code{nil} are equivalent to @code{immediately}.  If the
+server does not support @code{UID EXPUNGE}, @code{nil} is equivalent
+to @code{never}, while @code{t} will immediately expunge @emph{all}
+articles that are currently flagged as deleted (i.e., potentially not
+only the article that was just deleted).
 
 @vindex nnimap-streaming
 @item nnimap-streaming
@@ -15299,9 +15301,9 @@ Two example maildir mail sources:
 @end lisp
 
 @item imap
-Get mail from a @acronym{IMAP} server.  If you don't want to use
+Get mail from an @acronym{IMAP} server.  If you don't want to use
 @acronym{IMAP} as intended, as a network mail reading protocol (i.e.,
-with nnimap), for some reason or other, Gnus let you treat it similar
+with nnimap), for some reason or other, Gnus lets you treat it similar
 to a @acronym{POP} server and fetches articles from a given
 @acronym{IMAP} mailbox.  @xref{Using IMAP}, for more information.
 
@@ -19407,7 +19409,7 @@ If you so desire, you can configure the agent (see 
@code{gnus-agent-cache}
 @pxref{Agent Variables}) to always download headers and articles while
 plugged.  Gnus will almost certainly be slower, but it will be kept
 synchronized with the server.  That last point probably won't make any
-sense if you are using a nntp or nnimap back end.
+sense if you are using an nntp or nnimap back end.
 
 @node Agent Expiry
 @subsection Agent Expiry
@@ -26372,7 +26374,7 @@ If this option is non-@code{nil}, the registry will 
register all messages, as
 you see them.  This is important to making split-to-parent and
 Message-ID references work correctly, as the registry needs to know
 where all messages are, but it can slow down group opening and the
-saving of Gnus.  If this option is nil, entries must be created
+saving of Gnus.  If this option is @code{nil}, entries must be created
 manually, for instance by storing a custom flag or keyword for the
 message.
 @end defvar
@@ -26394,8 +26396,8 @@ This option specifies how registry entries are sorted 
during pruning.
 If a function is given, it should sort least valuable entries first,
 as pruning starts from the beginning of the list.  The default value
 is @code{gnus-registry-sort-by-creation-time}, which proposes the
-oldest entries for pruning.  Set to nil to perform no sorting, which
-will speed up the pruning process.
+oldest entries for pruning.  Set to @code{nil} to perform no sorting,
+which will speed up the pruning process.
 @end defvar
 
 @defvar gnus-registry-cache-file
@@ -26468,10 +26470,10 @@ have to put a rule like this:
 
 in your fancy split setup.
 
-If @code{gnus-registry-register-all} is non-@code{nil} (the default), the
-registry will perform splitting for all messages.  If it is nil,
-splitting will only happen for children of messages you've explicitly
-registered.
+If @code{gnus-registry-register-all} is non-@code{nil} (the default),
+the registry will perform splitting for all messages.  If it is
+@code{nil}, splitting will only happen for children of messages you've
+explicitly registered.
 
 In addition, you may want to customize the following variables.
 
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 43792c4e9e3..a854c15f2b3 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -3589,7 +3589,7 @@ completion lists.  If you want to suppress this 
completion because
 there are invalid entries in the persistency file, for example if the
 host configuration changes often, or if you plug your laptop to
 different networks frequently, you can set the user option
-@code{tramp-completion-use-cache} to nil.
+@code{tramp-completion-use-cache} to @code{nil}.
 
 After remote host name completion comes completion of file names on
 the remote host.  It works the same as with local host file completion
diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi
index d75cb67e089..55e56f7ce4e 100644
--- a/doc/misc/use-package.texi
+++ b/doc/misc/use-package.texi
@@ -790,7 +790,7 @@ possible, and put as much as you can get away with into the
 Emacs start as quickly as possible.
 
 @node Best practices
-@subheading When to use @code{:preface}, @code{:config} and @code{:init}?
+@subsection When to use @code{:preface}, @code{:config} and @code{:init}?
 @cindex tips for using @code{:preface}, @code{:config}, @code{:init}
 
 Where possible, it is better to avoid @code{:preface}, @code{:config}
diff --git a/lisp/apropos.el b/lisp/apropos.el
index e95f45f1804..0e286f3069d 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -899,7 +899,8 @@ Optional arg BUFFER (default: current buffer) is the buffer 
to check."
     ;; state of the `obarray' when we dumped, which we may also be able to
     ;; use in `bytecomp' to provide a clean initial environment?)
     (dolist (x load-history)
-      (when (string-match preloaded-regexp (car x))
+      (when (let ((elt (car x)))
+              (and (stringp elt) (string-match preloaded-regexp elt)))
         (dolist (def (cdr x))
           (cond
            ((symbolp def) (funcall f def))
diff --git a/lisp/dired.el b/lisp/dired.el
index e70467ca53b..914d0a0e783 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2780,10 +2780,11 @@ This kills the Dired buffer, then visits the current 
line's file or directory."
 The optional arguments FIND-FILE-FUNC and FIND-DIR-FUNC specify
 functions to visit the file and directory, respectively.  If
 omitted or nil, these arguments default to `find-file' and `dired',
-respectively."
+respectively.  If `dired-kill-when-opening-new-dired-buffer' is
+non-nil, FIND-DIR-FUNC defaults to `find-alternate-file' instead,
+so that the original Dired buffer is not kept."
   (interactive "e")
   (or find-file-func (setq find-file-func 'find-file))
-  (or find-dir-func (setq find-dir-func 'dired))
   (let (window pos file)
     (save-excursion
       (setq window (posn-window (event-end event))
@@ -2791,6 +2792,12 @@ respectively."
       (if (not (windowp window))
          (error "No file chosen"))
       (set-buffer (window-buffer window))
+      (unless find-dir-func
+        (setq find-dir-func
+              (if (and dired-kill-when-opening-new-dired-buffer
+                       (< (length (get-buffer-window-list)) 2))
+                  'find-alternate-file
+                'dired)))
       (goto-char pos)
       (setq file (dired-get-file-for-visit)))
     (if (file-directory-p file)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index a1ee5a0396e..01d30e153e0 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -4402,9 +4402,9 @@ after the end of the prompt, move to the end of the 
prompt.
 Otherwise move to the start of the buffer."
   (declare (interactive-only "use `(goto-char (point-min))' instead."))
   (interactive "^P")
-  (when (or (consp arg)
-            (region-active-p))
-    (push-mark))
+  (or (consp arg)
+      (region-active-p)
+      (push-mark))
   (goto-char (cond
               ;; We want to go N/10th of the way from the beginning.
               ((and arg (not (consp arg)))
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 022bf3059be..9ae7de70a0e 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -1356,10 +1356,15 @@ is passed on to the respective function."
   "Call the comment command you want (Do What I Mean).
 If the region is active and `transient-mark-mode' is on, call
 `comment-region' (unless it only consists of comments, in which
-case it calls `uncomment-region').
+case it calls `uncomment-region'); in this case, prefix numeric
+argument ARG specifies how many characters to remove from each
+comment delimiter (so don't specify a prefix argument whose value
+is greater than the total length of the comment delimiters).
 Else, if the current line is empty, call `comment-insert-comment-function'
 if it is defined, otherwise insert a comment and indent it.
-Else if a prefix ARG is specified, call `comment-kill'.
+Else, if a prefix ARG is specified, call `comment-kill'; in this
+case, prefix numeric argument ARG specifies on how many lines to kill
+the comments.
 Else, call `comment-indent'.
 You can configure `comment-style' to change the way regions are commented."
   (interactive "*P")
diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el
index 6f9df554da0..78fa91b5cdc 100644
--- a/lisp/nxml/xmltok.el
+++ b/lisp/nxml/xmltok.el
@@ -738,7 +738,7 @@ and VALUE-END, otherwise a STRING giving the value."
                      ;; avoid slowdowns due to the quadratic
                      ;; complexity of the regexp.  See bug#61514.
                      (when (with-restriction
-                             (point) (min (+ (point) 10000) (point-max))
+                               (point) (min (+ (point) 10000) (point-max))
                              (looking-at (concat "[^<>\n]+?"
                                                  (xmltok-attribute regexp))))
                        (unless recovering
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index 4b83c6733a2..b99388a4074 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -701,7 +701,7 @@ MODE is either `c' or `cpp'."
    `(((call_expression
        (call_expression function: (identifier) @fn)
        @c-ts-mode--fontify-DEFUN)
-      (:match "^DEFUN$" @fn))
+      (:match "\\`DEFUN\\'" @fn))
 
      ((function_definition type: (_) @for-each-tail)
       @c-ts-mode--fontify-for-each-tail
diff --git a/lisp/progmodes/cmake-ts-mode.el b/lisp/progmodes/cmake-ts-mode.el
index d83a956af21..9d35d8077bd 100644
--- a/lisp/progmodes/cmake-ts-mode.el
+++ b/lisp/progmodes/cmake-ts-mode.el
@@ -134,7 +134,8 @@
    :language 'cmake
    :feature 'number
    '(((unquoted_argument) @font-lock-number-face
-      (:match "^[[:digit:]]*\\.?[[:digit:]]*\\.?[[:digit:]]+$" 
@font-lock-number-face)))
+      (:match "\\`[[:digit:]]*\\.?[[:digit:]]*\\.?[[:digit:]]+\\'"
+              @font-lock-number-face)))
 
    :language 'cmake
    :feature 'string
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index 8a396a8c977..d7fb833d72b 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -168,7 +168,7 @@ the available version of Tree-sitter for java."
    :override t
    :feature 'constant
    `(((identifier) @font-lock-constant-face
-      (:match "^[A-Z_][A-Z_\\d]*$" @font-lock-constant-face))
+      (:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face))
      [(true) (false)] @font-lock-constant-face)
    :language 'java
    :override t
@@ -237,7 +237,7 @@ the available version of Tree-sitter for java."
      (scoped_identifier (identifier) @font-lock-constant-face)
 
      ((scoped_identifier name: (identifier) @font-lock-type-face)
-      (:match "^[A-Z]" @font-lock-type-face))
+      (:match "\\`[A-Z]" @font-lock-type-face))
 
      (type_identifier) @font-lock-type-face
 
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index f68ecb6fa6c..0aeea163b31 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3493,7 +3493,7 @@ This function is intended for use in 
`after-change-functions'."
    :language 'javascript
    :feature 'constant
    '(((identifier) @font-lock-constant-face
-      (:match "^[A-Z_][A-Z_\\d]*$" @font-lock-constant-face))
+      (:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face))
 
      [(true) (false) (null)] @font-lock-constant-face)
 
@@ -3612,7 +3612,7 @@ This function is intended for use in 
`after-change-functions'."
    :feature 'number
    '((number) @font-lock-number-face
      ((identifier) @font-lock-number-face
-      (:match "^\\(:?NaN\\|Infinity\\)$" @font-lock-number-face)))
+      (:match "\\`\\(:?NaN\\|Infinity\\)\\'" @font-lock-number-face)))
 
    :language 'javascript
    :feature 'operator
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 86bbf51dab7..26dafde7591 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1106,7 +1106,7 @@ fontified."
    :language 'python
    `([,@python--treesit-keywords] @font-lock-keyword-face
      ((identifier) @font-lock-keyword-face
-      (:match "^self$" @font-lock-keyword-face)))
+      (:match "\\`self\\'" @font-lock-keyword-face)))
 
    :feature 'definition
    :language 'python
diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el
index c3cf8d0cf44..b55af0b49e3 100644
--- a/lisp/progmodes/rust-ts-mode.el
+++ b/lisp/progmodes/rust-ts-mode.el
@@ -143,7 +143,7 @@
                               eol))
                       @font-lock-builtin-face)))
      ((identifier) @font-lock-type-face
-      (:match "^\\(:?Err\\|Ok\\|None\\|Some\\)$" @font-lock-type-face)))
+      (:match "\\`\\(:?Err\\|Ok\\|None\\|Some\\)\\'" @font-lock-type-face)))
 
    :language 'rust
    :feature 'comment
@@ -212,11 +212,11 @@
      (scoped_use_list path: (scoped_identifier
                              name: (identifier) @font-lock-constant-face))
      ((use_as_clause alias: (identifier) @font-lock-type-face)
-      (:match "^[A-Z]" @font-lock-type-face))
+      (:match "\\`[A-Z]" @font-lock-type-face))
      ((use_as_clause path: (identifier) @font-lock-type-face)
-      (:match "^[A-Z]" @font-lock-type-face))
+      (:match "\\`[A-Z]" @font-lock-type-face))
      ((use_list (identifier) @font-lock-type-face)
-      (:match "^[A-Z]" @font-lock-type-face))
+      (:match "\\`[A-Z]" @font-lock-type-face))
      (use_wildcard [(identifier) @rust-ts-mode--fontify-scope
                     (scoped_identifier
                      name: (identifier) @rust-ts-mode--fontify-scope)])
@@ -233,7 +233,7 @@
      ((scoped_identifier name: (identifier) @rust-ts-mode--fontify-tail))
      ((scoped_identifier path: (identifier) @font-lock-type-face)
       (:match
-       
"^\\(u8\\|u16\\|u32\\|u64\\|u128\\|usize\\|i8\\|i16\\|i32\\|i64\\|i128\\|isize\\|char\\|str\\)$"
+       
"\\`\\(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))
@@ -249,7 +249,7 @@
    :feature 'constant
    `((boolean_literal) @font-lock-constant-face
      ((identifier) @font-lock-constant-face
-      (:match "^[A-Z][A-Z\\d_]*$" @font-lock-constant-face)))
+      (:match "\\`[A-Z][A-Z\\d_]*\\'" @font-lock-constant-face)))
 
    :language 'rust
    :feature 'variable
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 0cde1f387e0..6beff9f41e9 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -3374,7 +3374,7 @@ See `sh-mode--treesit-other-keywords' and
    :feature 'number
    :language 'bash
    `(((word) @font-lock-number-face
-      (:match "^[0-9]+$" @font-lock-number-face)))
+      (:match "\\`[0-9]+\\'" @font-lock-number-face)))
 
    :feature 'bracket
    :language 'bash
diff --git a/lisp/progmodes/typescript-ts-mode.el 
b/lisp/progmodes/typescript-ts-mode.el
index 3ba2f86bee8..684f69b3567 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -153,7 +153,7 @@ Argument LANGUAGE is either `typescript' or `tsx'."
    :language language
    :feature 'constant
    `(((identifier) @font-lock-constant-face
-      (:match "^[A-Z_][A-Z_\\d]*$" @font-lock-constant-face))
+      (:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face))
      [(true) (false) (null)] @font-lock-constant-face)
 
    :language language
@@ -311,7 +311,7 @@ Argument LANGUAGE is either `typescript' or `tsx'."
    :feature 'number
    `((number) @font-lock-number-face
      ((identifier) @font-lock-number-face
-      (:match "^\\(:?NaN\\|Infinity\\)$" @font-lock-number-face)))
+      (:match "\\`\\(:?NaN\\|Infinity\\)\\'" @font-lock-number-face)))
 
    :language language
    :feature 'operator
diff --git a/lisp/simple.el b/lisp/simple.el
index 3757f91d11a..6d5ec9ecea9 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2226,7 +2226,10 @@ are available:
          This excludes from completion candidates those commands
          which have been marked specific to modes other than the
          current buffer's mode.  Commands that are not specific
-         to any mode are included.
+         to any mode are included.  If a command has a
+         `(declare completion...' form which specifies a predicate,
+         that predicate will be called to determine whether to
+         include the command in the completion candidates.
 
   `command-completion-using-modes-p'
          This includes in completion candidates only commands
diff --git a/lisp/subr.el b/lisp/subr.el
index f270bff1aa4..a353bee89a9 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4106,7 +4106,7 @@ to other portions of the buffer, use 
`without-restriction' with the
 same LABEL argument.
 
 \(fn START END [:label LABEL] BODY)"
-  (declare (indent 0) (debug t))
+  (declare (indent 2) (debug t))
   (if (eq (car rest) :label)
       `(internal--with-restriction ,start ,end (lambda () ,@(cddr rest))
                                  ,(cadr rest))
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index fcb01fb6c08..294c9792f39 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -2025,7 +2025,7 @@ In the tex shell buffer this command behaves like 
`comint-send-input'."
 
 (defun tex-display-shell ()
   "Make the TeX shell buffer visible in a window."
-  (display-buffer (tex-shell-buf) display-comint-buffer-action)
+  (display-buffer (tex-shell-buf) display-tex-shell-buffer-action)
   (tex-recenter-output-buffer nil))
 
 (defun tex-shell-sentinel (proc _msg)
@@ -2426,7 +2426,7 @@ Only applies the FSPEC to the args part of FORMAT."
        (if cmds (tex-format-cmd (caar cmds) fspec))))))
 
 (defun tex-cmd-doc-view (file)
-  (pop-to-buffer (find-file-noselect file) display-comint-buffer-action))
+  (pop-to-buffer (find-file-noselect file)))
 
 (defun tex-compile (dir cmd)
   "Run a command CMD on current TeX buffer's file in DIR."
@@ -2681,7 +2681,7 @@ line LINE of the window, or centered if LINE is nil."
        (window))
     (if (null tex-shell)
        (message "No TeX output buffer")
-      (setq window (display-buffer tex-shell display-comint-buffer-action))
+      (setq window (display-buffer tex-shell display-tex-shell-buffer-action))
       (with-selected-window window
        (bury-buffer tex-shell)
        (goto-char (point-max))
diff --git a/lisp/treesit.el b/lisp/treesit.el
index d79e7732387..df13dd9f424 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1210,7 +1210,6 @@ See `treesit-simple-indent-presets'.")
                              (save-excursion
                                (goto-char bol)
                                (looking-at-p comment-end-skip))))
-        ;; TODO: Document.
         (cons 'catch-all (lambda (&rest _) t))
 
         (cons 'query (lambda (pattern)
@@ -1224,7 +1223,6 @@ See `treesit-simple-indent-presets'.")
         (cons 'first-sibling (lambda (_n parent &rest _)
                                (treesit-node-start
                                 (treesit-node-child parent 0))))
-        ;; TODO: Document.
         (cons 'nth-sibling (lambda (n &optional named)
                              (lambda (_n parent &rest _)
                                (treesit-node-start
@@ -1266,7 +1264,6 @@ See `treesit-simple-indent-presets'.")
                          (or (and this-line-has-prefix
                                   (match-beginning 1))
                              (match-end 0)))))))
-        ;; TODO: Document.
         (cons 'grand-parent
               (lambda (_n parent &rest _)
                 (treesit-node-start (treesit-node-parent parent))))
@@ -1337,10 +1334,10 @@ See `treesit-simple-indent-presets'.")
                         (mapcar (lambda (fn)
                                   (funcall fn node parent bol))
                                 fns)))))
-  "A list of presets.
-These presets that can be used as MATHER and ANCHOR in
-`treesit-simple-indent-rules'.  MACHTERs and ANCHORs are
-functions that take 3 arguments: NODE, PARENT and BOL.
+  "A list of indent rule presets.
+These presets can be used as MATCHER and ANCHOR values in
+`treesit-simple-indent-rules'.  MATCHERs and ANCHORs are
+functions that take 3 arguments: NODE, PARENT, and BOL.
 
 MATCHER:
 
@@ -1371,6 +1368,10 @@ no-node
 
     Checks that NODE's type matches regexp TYPE.
 
+\(field-is NAME)
+
+    Checks that NODE's field name in PARENT matches regexp NAME.
+
 \(n-p-gp NODE-TYPE PARENT-TYPE GRANDPARENT-TYPE)
 
     Checks for NODE's, its parent's, and its grandparent's type.
@@ -1384,16 +1385,33 @@ comment-end
 
     Matches if text after point matches `treesit-comment-end'.
 
+catch-all
+
+    Always matches.
+
 ANCHOR:
 
 first-sibling
 
     Returns the start of the first child of PARENT.
 
+\(nth-sibling N &optional NAMED)
+
+    Returns the start of the Nth child of PARENT.
+    NAMED non-nil means count only named nodes.
+
 parent
 
     Returns the start of PARENT.
 
+grand-parent
+
+    Returns the start of PARENT's parent.
+
+great-grand-parent
+
+    Returns the start of PARENT's parent's parent.
+
 parent-bol
 
     Returns the beginning of non-space characters on the line where
@@ -1401,8 +1419,8 @@ parent-bol
 
 standalone-parent
 
-    Finds the first ancestor node (parent, grandparent, etc) that
-    starts on its own line, and return the start of that node.
+    Finds the first ancestor node (parent, grandparent, etc.) that
+    starts on its own line, and returns the start of that node.
 
 prev-sibling
 
@@ -1433,7 +1451,7 @@ prev-adaptive-prefix
     end of the match, otherwise return nil.  However, if the
     current line begins with a prefix, return the beginning of
     the prefix of the previous line instead, so that the two
-    prefixes aligns.  This is useful for a `indent-relative'-like
+    prefixes aligns.  This is useful for an `indent-relative'-like
     indent behavior for block comments.")
 
 (defun treesit--simple-indent-eval (exp)
@@ -2472,24 +2490,24 @@ instead of emitting a warning."
 (defun treesit-major-mode-setup ()
   "Activate tree-sitter to power major-mode features.
 
-If `treesit-font-lock-settings' is non-nil, setup fontification and
-enable `font-lock-mode'.
+If `treesit-font-lock-settings' is non-nil, set up fontification
+and enable `font-lock-mode'.
 
-If `treesit-simple-indent-rules' is non-nil, setup indentation.
+If `treesit-simple-indent-rules' is non-nil, set up indentation.
 
-If `treesit-defun-type-regexp' is non-nil, setup
-`beginning/end-of-defun' functions.
+If `treesit-defun-type-regexp' is non-nil, set up
+`beginning-of-defun-function' and `end-of-defun-function'.
 
-If `treesit-defun-name-function' is non-nil, setup
+If `treesit-defun-name-function' is non-nil, set up
 `add-log-current-defun'.
 
-If `treesit-simple-imenu-settings' is non-nil, setup Imenu.
+If `treesit-simple-imenu-settings' is non-nil, set up Imenu.
 
 Make sure necessary parsers are created for the current buffer
 before calling this function."
   ;; Font-lock.
   (when treesit-font-lock-settings
-    ;; `font-lock-mode' wouldn't setup properly if
+    ;; `font-lock-mode' wouldn't set up properly if
     ;; `font-lock-defaults' is nil, see `font-lock-specified-p'.
     (setq-local font-lock-defaults
                 '( nil nil nil nil
@@ -2949,7 +2967,7 @@ window."
           (display-buffer treesit--explorer-buffer
                           (cons nil '((inhibit-same-window . t))))
           (treesit--explorer-refresh)
-          ;; Setup variables and hooks.
+          ;; Set up variables and hooks.
           (add-hook 'post-command-hook
                     #'treesit--explorer-post-command 0 t)
           (add-hook 'kill-buffer-hook
diff --git a/lisp/window.el b/lisp/window.el
index ab7dd5ced12..5964fe37ee6 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -8785,6 +8785,14 @@ another window."
   :group 'windows
   :group 'comint)
 
+(defcustom display-tex-shell-buffer-action '(display-buffer-in-previous-window)
+  "`display-buffer' action for displaying TeX shell buffers."
+  :type display-buffer--action-custom-type
+  :risky t
+  :version "29.1"
+  :group 'windows
+  :group 'tex-run)
+
 (defun read-buffer-to-switch (prompt)
   "Read the name of a buffer to switch to, prompting with PROMPT.
 Return the name of the buffer as a string.
diff --git a/src/dbusbind.c b/src/dbusbind.c
index d96b735c79a..97094e407d7 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -276,7 +276,7 @@ XD_OBJECT_TO_STRING (Lisp_Object object)
 
 #define XD_DBUS_VALIDATE_BUS_ADDRESS(bus)                              \
   do {                                                                 \
-    char const *session_bus_address = getenv ("DBUS_SESSION_BUS_ADDRESS"); \
+    char const *session_bus_address = egetenv ("DBUS_SESSION_BUS_ADDRESS"); \
     if (STRINGP (bus))                                                 \
       {                                                                        
\
        DBusAddressEntry **entries;                                     \
diff --git a/src/lread.c b/src/lread.c
index eb52329f5a8..c3829d2a3a3 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3532,7 +3532,7 @@ bytecode_from_rev_list (Lisp_Object elems, Lisp_Object 
readcharfun)
             Convert them back to the original unibyte form.  */
          vec[COMPILED_BYTECODE] = Fstring_as_unibyte (vec[COMPILED_BYTECODE]);
        }
-      // Bytecode must be immovable.
+      /* Bytecode must be immovable.  */
       pin_string (vec[COMPILED_BYTECODE]);
     }
 
diff --git a/src/xdisp.c b/src/xdisp.c
index bec3f143b1f..d0b0720b005 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -37289,7 +37289,7 @@ shown in a window.  Absolute line numbers count from 
the beginning of
 the current narrowing, or from buffer beginning.  The variable
 `display-line-numbers-offset', if non-zero, is a signed offset added
 to each absolute line number; it also forces line numbers to be counted
-from the beginning of the buffer, as if `display-line-numbers-wide'
+from the beginning of the buffer, as if `display-line-numbers-widen'
 were non-nil.  It has no effect when line numbers are not absolute.
 
 If the value is `relative', display for each line not containing the
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index 1de8e56cbd4..a67fc555772 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -353,12 +353,23 @@
             '("a" "ab" "ac")
           (execute-kbd-macro (kbd "a TAB TAB"))
           (should (equal (car messages) "Complete, but not unique"))
-          (should-not (get-buffer-window "*Completions*" 0))))
+          (should-not (get-buffer-window "*Completions*" 0))
+          (execute-kbd-macro (kbd "b TAB"))
+          (should (equal (car messages) "Sole completion"))))
       (let ((completion-auto-help t))
         (completing-read-with-minibuffer-setup
             '("a" "ab" "ac")
           (execute-kbd-macro (kbd "a TAB TAB"))
-          (should (get-buffer-window "*Completions*" 0)))))))
+          (should (get-buffer-window "*Completions*" 0))
+          (execute-kbd-macro (kbd "b TAB"))
+          (should (equal (car messages) "Sole completion"))))
+      (let ((completion-auto-help 'visible))
+        (completing-read-with-minibuffer-setup
+         '("a" "ab" "ac" "achoo")
+         (execute-kbd-macro (kbd "a TAB TAB"))
+         (should (get-buffer-window "*Completions*" 0))
+         (execute-kbd-macro (kbd "ch TAB"))
+         (should (equal (car messages) "Sole completion")))))))
 
 (ert-deftest completion-auto-select-test ()
   (let ((completion-auto-select t))
diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el
index 04aa91ddca6..6e7d0fc48d2 100644
--- a/test/src/treesit-tests.el
+++ b/test/src/treesit-tests.el
@@ -425,14 +425,14 @@ BODY is the test body."
                ;; String query.
                '("(string) @string
 (pair key: (_) @keyword)
-((_) @bob (#match \"^B.b$\" @bob))
+((_) @bob (#match \"\\\\`B.b\\\\'\" @bob))
 (number) @number
 ((number) @n3 (#equal \"3\" @n3))
 ((number) @n3p (#pred treesit--ert-pred-last-sibling @n3p))"
                  ;; Sexp query.
                  ((string) @string
                   (pair key: (_) @keyword)
-                  ((_) @bob (:match "^B.b$" @bob))
+                  ((_) @bob (:match "\\`B.b\\'" @bob))
                   (number) @number
                   ((number) @n3 (:equal "3" @n3))
                   ((number) @n3p (:pred treesit--ert-pred-last-sibling



reply via email to

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