Merge from origin/emacs-29

a475165738 * doc/man/emacsclient.1: Fix --tramp option.
1e5357d3d1 * doc/man/emacsclient.1: Add missing sections (bug#66598)
fba7b9db39 Add explanation for extra parentheses in ELisp Introduction
7723282682 Add sample code to the "let*" section in "forward-paragraph"
7a00ca92c1 Fix treesit test (bug#67117)
d220893216 Fix c++-ts-mode indentation (bug#67975)
d386a8aa43 Recommend customizing eglot for python-base-mode
bd0c758971 Improve documentation of new native-compilation commands
1ad126c0f2 ; Fix typo
77678244b8 doc/lispintro: Don't mention `set` (bug#67734)
cb3684e9df Fix script for some characters
2922d683b7 ; * src/treesit.c (treesit_traverse_child_helper): Fix co...
7b315e8a5c Fix an issue when searching subtree backward (bug#67117)
03625c2fef Fix passive mode for tnftp client in ange-ftp.el.
b6429b1c1c ; Improve documentation of ispell.el's dictionary database
75cc159341 ; * etc/PROBLEMS: Update the "GnuPG hangs" entry.
67d9af1c07 Fix using disabled command without a docstring
f68f350023 Improve documentation of text properties handling when ya...
06c399914f Eglot: Add Uiua language server
This commit is contained in:
Eli Zaretskii 2023-12-23 06:30:40 -05:00
commit 1be6204473
16 changed files with 239 additions and 118 deletions

View file

@ -60,6 +60,7 @@ BEGIN {
alias["cjk strokes"] = "cjk-misc"
alias["cjk symbols and punctuation"] = "cjk-misc"
alias["halfwidth and fullwidth forms"] = "cjk-misc"
alias["yijing hexagram symbols"] = "cjk-misc"
alias["common indic number forms"] = "north-indic-number"
tohex["a"] = 10
@ -94,7 +95,7 @@ function name2alias(name , w, w2) {
if (alias[name]) return alias[name]
else if (name ~ /for symbols/) return "symbol"
else if (name ~ /latin|combining .* marks|spacing modifier|tone letters|alphabetic presentation/) return "latin"
else if (name ~ /cjk|yijing|enclosed ideograph|kangxi/) return "han"
else if (name ~ /cjk|enclosed ideograph|kangxi/) return "han"
else if (name ~ /arabic/) return "arabic"
else if (name ~ /^greek/) return "greek"
else if (name ~ /^coptic/) return "coptic"

View file

@ -317,7 +317,7 @@ List Processing
* Evaluation:: Running a program.
* Variables:: Returning a value from a variable.
* Arguments:: Passing information to a function.
* set & setq:: Setting the value of a variable.
* setq:: Setting the value of a variable.
* Summary:: The major points.
* Error Message Exercises::
@ -358,7 +358,6 @@ Arguments
Setting the Value of a Variable
* Using set:: Setting values.
* Using setq:: Setting a quoted value.
* Counting:: Using @code{setq} to count.
@ -1060,7 +1059,7 @@ of Lisp.
* Evaluation:: Running a program.
* Variables:: Returning a value from a variable.
* Arguments:: Passing information to a function.
* set & setq:: Setting the value of a variable.
* setq:: Setting the value of a variable.
* Summary:: The major points.
* Error Message Exercises::
@end menu
@ -1782,7 +1781,7 @@ A symbol can have any value attached to it or, to use the jargon, we can
string, @code{"such as this"}; to a list, such as @code{(spruce pine
oak)}; we can even bind a variable to a function definition.
A symbol can be bound to a value in several ways. @xref{set & setq, ,
A symbol can be bound to a value in several ways. @xref{setq, ,
Setting the Value of a Variable}, for information about one way to do
this.
@ -2273,52 +2272,52 @@ When your fill column is 70 and you evaluate the expression, the
message @code{"He saw 38 red foxes leaping."} appears in your echo
area.
@node set & setq
@node setq
@section Setting the Value of a Variable
@cindex Variable, setting value
@cindex Setting value of variable
@cindex @samp{bind} defined
There are several ways by which a variable can be given a value. One of
the ways is to use either the function @code{set} or the special form
@code{setq}. Another way is to use @code{let} (@pxref{let}). (The
jargon for this process is to @dfn{bind} a variable to a value.)
There are several ways by which a variable can be given a value.
One of the ways is to use the special form @code{setq}. Another way
is to use @code{let} (@pxref{let}). (The jargon for this process is
to @dfn{bind} a variable to a value.)
The following sections not only describe how @code{set} and @code{setq}
work but also illustrate how arguments are passed.
The following sections not only describe how @code{setq} works but
also illustrate how arguments are passed.
@menu
* Using set:: Setting values.
* Using setq:: Setting a quoted value.
* Using setq:: Setting variables.
* Counting:: Using @code{setq} to count.
@end menu
@node Using set
@subsection Using @code{set}
@node Using setq
@subsection Using @code{setq}
@findex set
To set the value of the symbol @code{flowers} to the list @code{'(rose
To set the value of the symbol @code{flowers} to the list @code{(rose
violet daisy buttercup)}, evaluate the following expression by
positioning the cursor after the expression and typing @kbd{C-x C-e}.
@smallexample
(set 'flowers '(rose violet daisy buttercup))
(setq flowers '(rose violet daisy buttercup))
@end smallexample
@noindent
The list @code{(rose violet daisy buttercup)} will appear in the echo
area. This is what is @emph{returned} by the @code{set} function. As a
side effect, the symbol @code{flowers} is bound to the list; that is,
the symbol @code{flowers}, which can be viewed as a variable, is given
the list as its value. (This process, by the way, illustrates how a
side effect to the Lisp interpreter, setting the value, can be the
primary effect that we humans are interested in. This is because every
Lisp function must return a value if it does not get an error, but it
will only have a side effect if it is designed to have one.)
area. This is what is @emph{returned} by the @code{setq} special
form. As a side effect, the symbol @code{flowers} is bound to the
list; that is, the symbol @code{flowers}, which can be viewed as
a variable, is given the list as its value. (This process, by the
way, illustrates how a side effect to the Lisp interpreter, setting
the value, can be the primary effect that we humans are interested in.
This is because every Lisp function must return a value if it does not
get an error, but it will only have a side effect if it is designed to
have one.)
After evaluating the @code{set} expression, you can evaluate the symbol
@code{flowers} and it will return the value you just set. Here is the
symbol. Place your cursor after it and type @kbd{C-x C-e}.
After evaluating the @code{setq} expression, you can evaluate the
symbol @code{flowers} and it will return the value you just set.
Here is the symbol. Place your cursor after it and type @kbd{C-x C-e}.
@smallexample
flowers
@ -2336,30 +2335,8 @@ in front of it, what you will see in the echo area is the symbol itself,
'flowers
@end smallexample
Note also, that when you use @code{set}, you need to quote both
arguments to @code{set}, unless you want them evaluated. Since we do
not want either argument evaluated, neither the variable
@code{flowers} nor the list @code{(rose violet daisy buttercup)}, both
are quoted. (When you use @code{set} without quoting its first
argument, the first argument is evaluated before anything else is
done. If you did this and @code{flowers} did not have a value
already, you would get an error message that the @samp{Symbol's value
as variable is void}; on the other hand, if @code{flowers} did return
a value after it was evaluated, the @code{set} would attempt to set
the value that was returned. There are situations where this is the
right thing for the function to do; but such situations are rare.)
@node Using setq
@subsection Using @code{setq}
@findex setq
As a practical matter, you almost always quote the first argument to
@code{set}. The combination of @code{set} and a quoted first argument
is so common that it has its own name: the special form @code{setq}.
This special form is just like @code{set} except that the first argument
is quoted automatically, so you don't need to type the quote mark
yourself. Also, as an added convenience, @code{setq} permits you to set
several different variables to different values, all in one expression.
Also, as an added convenience, @code{setq} permits you to set several
different variables to different values, all in one expression.
To set the value of the variable @code{carnivores} to the list
@code{'(lion tiger leopard)} using @code{setq}, the following expression
@ -2369,18 +2346,6 @@ is used:
(setq carnivores '(lion tiger leopard))
@end smallexample
@noindent
This is exactly the same as using @code{set} except the first argument
is automatically quoted by @code{setq}. (The @samp{q} in @code{setq}
means @code{quote}.)
@need 1250
With @code{set}, the expression would look like this:
@smallexample
(set 'carnivores '(lion tiger leopard))
@end smallexample
Also, @code{setq} can be used to assign different values to
different variables. The first argument is bound to the value
of the second argument, the third argument is bound to the value of the
@ -2400,14 +2365,14 @@ to the symbol @code{herbivores}:
not have fit on a page; and humans find it easier to read nicely
formatted lists.)
Although I have been using the term ``assign'', there is another way of
thinking about the workings of @code{set} and @code{setq}; and that is to
say that @code{set} and @code{setq} make the symbol @emph{point} to the
list. This latter way of thinking is very common and in forthcoming
chapters we shall come upon at least one symbol that has ``pointer'' as
part of its name. The name is chosen because the symbol has a value,
specifically a list, attached to it; or, expressed another way,
the symbol is set to point to the list.
Although I have been using the term ``assign'', there is another way
of thinking about the workings of @code{setq}; and that is to say that
@code{setq} makes the symbol @emph{point} to the list. This latter
way of thinking is very common and in forthcoming chapters we shall
come upon at least one symbol that has ``pointer'' as part of its
name. The name is chosen because the symbol has a value, specifically
a list, attached to it; or, expressed another way, the symbol is set
to point to the list.
@node Counting
@subsection Counting
@ -3598,6 +3563,8 @@ and the two are not intended to refer to the same value. The
@unnumberedsubsec @code{let} Prevents Confusion
@end ifnottex
@c FIXME!! lexbind!!
@cindex @samp{local variable} defined
@cindex @samp{variable, local}, defined
The @code{let} special form prevents confusion. @code{let} creates a
@ -4471,9 +4438,7 @@ number; it will be printed as the character with that @sc{ascii} code.
The @code{setq} special form sets the value of its first argument to the
value of the second argument. The first argument is automatically
quoted by @code{setq}. It does the same for succeeding pairs of
arguments. Another function, @code{set}, takes only two arguments and
evaluates both of them before setting the value returned by its first
argument to the value returned by its second argument.
arguments.
@item buffer-name
Without an argument, return the name of the buffer, as a string.
@ -12882,7 +12847,40 @@ The next line of the @code{forward-paragraph} function begins a
introduced}), in which Emacs binds a total of seven variables:
@code{opoint}, @code{fill-prefix-regexp}, @code{parstart},
@code{parsep}, @code{sp-parstart}, @code{start}, and
@code{found-start}.
@code{found-start}. The first part of the @code{let*} expression
looks like below:
@smallexample
@group
(let* ((opoint (point))
(fill-prefix-regexp
(and fill-prefix (not (equal fill-prefix ""))
(not paragraph-ignore-fill-prefix)
(regexp-quote fill-prefix)))
;; Remove ^ from paragraph-start and paragraph-sep if they are there.
;; These regexps shouldn't be anchored, because we look for them
;; starting at the left-margin. This allows paragraph commands to
;; work normally with indented text.
;; This hack will not find problem cases like "whatever\\|^something".
(parstart (if (and (not (equal "" paragraph-start))
(equal ?^ (aref paragraph-start 0)))
(substring paragraph-start 1)
paragraph-start))
(parsep (if (and (not (equal "" paragraph-separate))
(equal ?^ (aref paragraph-separate 0)))
(substring paragraph-separate 1)
paragraph-separate))
(parsep
(if fill-prefix-regexp
(concat parsep "\\|"
fill-prefix-regexp "[ \t]*$")
parsep))
;; This is used for searching.
(sp-parstart (concat "^[ \t]*\\(?:" parstart "\\|" parsep "\\)"))
start found-start)
...)
@end group
@end smallexample
The variable @code{parsep} appears twice, first, to remove instances
of @samp{^}, and second, to handle fill prefixes.
@ -13250,6 +13248,10 @@ The last expression when there is no fill prefix is
@end smallexample
@noindent
(Note that this code snippet is copied verbatim from the original code,
so the two extra ending parentheses are matching the previous @code{if}
and @code{while}.)
This says that if there is no fill prefix and if we are not at the
end, point should move to the beginning of whatever was found by the
regular expression search for @code{sp-parstart}.
@ -16949,15 +16951,15 @@ Here is the line again; how does it work?
@noindent
This line is a short, but complete Emacs Lisp expression.
We are already familiar with @code{setq}. It sets the following variable,
@code{major-mode}, to the subsequent value, which is @code{text-mode}.
The single-quote before @code{text-mode} tells Emacs to deal directly
with the @code{text-mode} symbol, not with whatever it might stand for.
@xref{set & setq, , Setting the Value of a Variable},
for a reminder of how @code{setq} works.
The main point is that there is no difference between the procedure you
use to set a value in your @file{.emacs} file and the procedure you use
anywhere else in Emacs.
We are already familiar with @code{setq}. It sets the following
variable, @code{major-mode}, to the subsequent value, which is
@code{text-mode}. The single-quote before @code{text-mode} tells
Emacs to deal directly with the @code{text-mode} symbol, not with
whatever it might stand for. @xref{setq, , Setting the Value of
a Variable}, for a reminder of how @code{setq} works. The main point
is that there is no difference between the procedure you use to set
a value in your @file{.emacs} file and the procedure you use anywhere
else in Emacs.
@need 800
Here is the next line:

View file

@ -878,8 +878,7 @@ well.
You can natively-compile either a single function or macro
definition, or a whole file of Lisp code, with the
@code{native-compile} function. Natively-compiling a file will
produce both the corresponding @file{.elc} file with byte code and the
@file{.eln} file with native code.
produce the @file{.eln} file with native code.
@findex native-comp-limple-mode
@vindex native-comp-verbose
@ -971,6 +970,18 @@ compilation subprocesses in parallel, under the control of
Variables}).
@end defun
@deffn Command emacs-lisp-native-compile
This command compiles the file visited by the current buffer into
native code, if the file was changed since the last time it was
natively-compiled.
@end deffn
@deffn Command emacs-lisp-native-compile-and-load
This command compiles the file visited by the current buffer into
native code, like @code{emacs-lisp-native-compile}, but it also loads
the native code when the compilation finishes.
@end deffn
The following function allows Lisp programs to test whether
native-compilation is available at runtime.

View file

@ -2945,7 +2945,10 @@ character.
Copying text between strings and buffers preserves the properties
along with the characters; this includes such diverse functions as
@code{substring}, @code{insert}, and @code{buffer-substring}.
@code{substring}, @code{insert}, and @code{buffer-substring}. Killing
and then yanking text (@pxref{The Kill Ring}) also preserves the
properties, except that some properties are handled specially and
might be removed when text is yanked; @pxref{Yanking}.
@menu
* Examining Properties:: Looking at the properties of one character.

View file

@ -1,5 +1,5 @@
.\" See section COPYING for conditions for redistribution.
.TH EMACSCLIENT 1 "2023-10-25" "GNU Emacs" "GNU"
.TH EMACSCLIENT 1 "2023-12-23" "GNU Emacs" "GNU"
.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
.\" other params are allowed: see man(7), man(1)
.SH NAME
@ -62,9 +62,11 @@ This option applies only to the next file specified.
.TP
.B \-a, \-\-alternate-editor=COMMAND
If the Emacs server is not running, run the specified shell command instead.
This can also be specified via the ALTERNATE_EDITOR environment variable.
If the value of ALTERNATE_EDITOR is the empty string, run "emacs \-\-daemon" to
If the empty string is specified, run "emacs \-\-daemon" to
start Emacs in daemon mode, and try to connect to it.
See also the ALTERNATE_EDITOR environment variable, over which this
option takes precedence.
.TP
.B -c, \-\-create-frame
Create a new frame instead of trying to use the current Emacs frame.
@ -84,7 +86,11 @@ Lisp expressions.
.TP
.B \-f, \-\-server-file=FILENAME
Use TCP configuration file FILENAME for communication.
This can also be specified via the EMACS_SERVER_FILE environment variable.
Relative filenames are relative to "~/.emacs.d/server/" or
"$XDG_CONFIG_HOME/emacs/server/", and the default is "server".
See also the EMACS_SERVER_FILE environment variable, over which this
option takes precedence.
.TP
.B \-n, \-\-no-wait
Return immediately without waiting for you to "finish" the buffer in
@ -114,7 +120,10 @@ side-effect rather than result.
.TP
.B \-s, \-\-socket-name=FILENAME
Use socket named FILENAME for communication.
This can also be specified via the EMACS_SOCKET_NAME environment variable.
Relative filenames are relative to "$XDG_RUNTIME_DIR/emacs/" or "$TMPDIR/".
See also the EMACS_SOCKET_NAME environment variable, over which this
option takes precedence.
.TP
.B \-nw, \-t, \-\-tty
Open a new Emacs frame on the current terminal.
@ -122,8 +131,11 @@ Open a new Emacs frame on the current terminal.
.B \-T, \-\-tramp=PREFIX
Set PREFIX to add to filenames for Emacs to locate files on remote
machines using TRAMP. This is mostly useful in combination with using
the Emacs server over TCP with --server-file. This can also be
specified via the EMACSCLIENT_TRAMP environment variable.
the Emacs server on a remote host (either using TCP with
--server-file, or a socket forwarded over SSH).
See also the EMACSCLIENT_TRAMP environment variable, over which this
option takes precedence.
.TP
.B \-V, \-\-version
Print version information and exit.
@ -133,10 +145,46 @@ Print this usage information message and exit.
.SH "EXIT STATUS"
Normally, the exit status is 0. If emacsclient shuts down due to
Emacs signaling an error, the exit status is 1.
.SH ENVIRONMENT
.TP
.B ALTERNATE_EDITOR
If the Emacs server is not running, run the shell command in this
environment variable instead. If set to the empty string, run
"emacs \-\-daemon" to start Emacs in daemon mode, and try to connect
to it. Will be overridden by the
.B \-\-alternate-editor
option, if present.
.TP
.B EMACSCLIENT_TRAMP
A prefix to add to filenames, intended to allow Emacs to locate files
on remote machines using TRAMP. Will be overridden by the
.B \-\-tramp
option, if present.
.TP
.B EMACS_SERVER_FILE
Look in this file to discover where to find a TCP Emacs server.
Relative filenames are relative to "~/.emacs.d/server/" or
"$XDG_CONFIG_HOME/emacs/server/", and the
default is "server". Will be overridden by the
.B \-\-server-file
option, if present.
.TP
.B EMACS_SOCKET_NAME
The filename of the socket to use for communication with the Emacs server.
Relative filenames are relative to "$XDG_RUNTIME_DIR/emacs/" or "$TMPDIR/".
Will be overridden by the
.B \-\-socket-name
option, if present.
.SH "SEE ALSO"
The program is documented fully in
.IR "Using Emacs as a Server"
available via the Info system.
The XDG_ environment variables are described in detail in the
.UR https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
XDG Base Directory Specification
.UE .
.SH AUTHOR
This manual page was originally written by Stephane Bortzmeyer
<bortzmeyer@debian.org>, for the Debian GNU/Linux system, but is not

View file

@ -1107,8 +1107,8 @@ To apply this to Eglot, and assuming you chose the
:fuzzy t)
:pylint (:enabled :json-false)))
:gopls (:usePlaceholders t)))))
(python-mode . ((indent-tabs-mode . nil)))
(go-mode . ((indent-tabs-mode . t))))
(python-base-mode . ((indent-tabs-mode . nil)))
(go-mode . ((indent-tabs-mode . t))))
@end lisp
@noindent
@ -1123,7 +1123,7 @@ plists are used inside the value of
This following form may also be used:
@lisp
((python-mode
((python-base-mode
. ((eglot-workspace-configuration
. (:pylsp (:plugins (:jedi_completion (:include_params t
:fuzzy t)
@ -1138,7 +1138,7 @@ This following form may also be used:
@noindent
This sets up the value of @code{eglot-workspace-configuration}
separately depending on the major mode of each of that project's
buffers. @code{python-mode} buffers will have the variable set to
buffers. @code{python-base-mode} buffers will have the variable set to
@code{(:pylsp (:plugins ...))}. @code{go-mode} buffers will have the
variable set to @code{(:gopls (:usePlaceholders t))}.
@ -1149,7 +1149,7 @@ want to set a different option for @code{gopls.usePlaceholders} , you
may use something like:
@lisp
((python-mode
((python-base-mode
. ((eglot-workspace-configuration
. (:pylsp (:plugins (:jedi_completion (:include_params t
:fuzzy t)

View file

@ -532,7 +532,9 @@ The solution is to use gawk (GNU awk).
This is known to happen with GnuPG v2.4.1. The only known workaround
is to downgrade to a version of GnuPG older than 2.4.1 (or, in the
future, upgrade to a newer version which solves the problem, when such
a fixed version becomes available).
a fixed version becomes available). Note that GnuPG v2.2.42 and later
also has this problem, so you should also avoid those later 2.2.4x
versions; v2.2.41 is reported to work fine.
*** EasyPG loopback pinentry does not work with gpgsm.

View file

@ -1696,6 +1696,9 @@ Setup `char-width-table' appropriate for non-CJK language environment."
;; Fix some exceptions that blocks.awk/Blocks.txt couldn't get right.
(set-char-table-range char-script-table '(#x2ea . #x2eb) 'bopomofo)
(set-char-table-range char-script-table #xab65 'greek)
(set-char-table-range char-script-table #x16fe0 'tangut)
(set-char-table-range char-script-table #x16fe1 'nushu)
;;; Setting unicode-category-table.

View file

@ -2164,7 +2164,7 @@ Create a new process if needed."
proc)))
(defun ange-ftp-passive-mode (proc on-or-off)
(if (string-match (concat "Passive mode " on-or-off)
(if (string-match (concat "Passive mode:? " on-or-off)
(cdr (ange-ftp-raw-send-cmd
proc (concat "passive " on-or-off)
"Trying passive mode..." nil)))

View file

@ -67,9 +67,10 @@ If nil, the feature is disabled, i.e., all commands work normally.")
"Here's the first part of its description:\n\n")
;; Keep only the first paragraph of the documentation.
(with-temp-buffer
(insert (condition-case ()
(documentation cmd)
(error "<< not documented >>")))
(insert (or (condition-case ()
(documentation cmd)
(error nil))
"<< not documented >>"))
(goto-char (point-min))
(when (search-forward "\n\n" nil t)
(delete-region (match-beginning 0) (point-max)))

View file

@ -438,7 +438,7 @@ MODE is either `c' or `cpp'."
((parent-is "function_definition") parent-bol 0)
((parent-is "pointer_declarator") parent-bol 0)
((parent-is "declaration") parent-bol 0)
((parent-is ,(rx bos "declaration" eos)) parent-bol 0)
((parent-is "conditional_expression") first-sibling 0)
((parent-is "assignment_expression") parent-bol c-ts-mode-indent-offset)
((parent-is "concatenated_string") first-sibling 0)

View file

@ -293,7 +293,8 @@ chosen (interactively or automatically)."
'(("marksman" "server")
("vscode-markdown-language-server" "--stdio"))))
(graphviz-dot-mode . ("dot-language-server" "--stdio"))
(terraform-mode . ("terraform-ls" "serve")))
(terraform-mode . ("terraform-ls" "serve"))
((uiua-ts-mode uiua-mode) . ("uiua" "lsp")))
"How the command `eglot' guesses the server to start.
An association list of (MAJOR-MODE . CONTACT) pairs. MAJOR-MODE
identifies the buffers that are to be managed by a specific

View file

@ -85,10 +85,10 @@ All commands in `lisp-mode-shared-map' are inherited by this map."
["Byte-recompile Directory..." byte-recompile-directory
:help "Recompile every `.el' file in DIRECTORY that needs recompilation"]
["Native-compile This File" emacs-lisp-native-compile
:help "Compile the current file containing the current buffer to native code"
:help "Compile this buffer's file to native code"
:active (native-comp-available-p)]
["Native-compile and Load" emacs-lisp-native-compile-and-load
:help "Compile the current file to native code, then load compiled native code"
:help "Compile this buffer's file to native code, then load compiled native code"
:active (native-comp-available-p)]
["Disassemble Byte Compiled Object..." disassemble
:help "Print disassembled code for OBJECT in a buffer"]
@ -224,7 +224,9 @@ All commands in `lisp-mode-shared-map' are inherited by this map."
(declare-function comp-write-bytecode-file "comp")
(defun emacs-lisp-native-compile ()
"Native-compile synchronously the current file (if it has changed)."
"Native-compile the current buffer's file (if it has changed).
This invokes a synchronous native-compilation of the file that is
visited by the current buffer."
(interactive nil emacs-lisp-mode)
(emacs-lisp--before-compile-buffer)
(let* ((byte+native-compile t)
@ -234,12 +236,14 @@ All commands in `lisp-mode-shared-map' are inherited by this map."
(comp-write-bytecode-file eln))))
(defun emacs-lisp-native-compile-and-load ()
"Native-compile synchronously the current file (if it has changed).
Load the compiled code when finished.
"Native-compile the current buffer's file (if it has changed), then load it.
This invokes a synchronous native-compilation of the file that is
visited by the current buffer, then loads the compiled native code
when the compilation is finished.
Use `emacs-lisp-byte-compile-and-load' in combination with
`native-comp-jit-compilation' set to t to achieve asynchronous
native compilation."
native compilation of the current buffer's file."
(interactive nil emacs-lisp-mode)
(when-let ((byte-file (emacs-lisp-native-compile)))
(load (file-name-sans-extension byte-file))))

View file

@ -522,7 +522,12 @@ re-start Emacs."
"[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
"[']" nil ("-C") "~list" iso-8859-1)
("hebrew" "[\340\341\342\343\344\345\346\347\350\351\353\352\354\356\355\360\357\361\362\364\363\367\366\365\370\371\372]" "[^\340\341\342\343\344\345\346\347\350\351\353\352\354\356\355\360\357\361\362\364\363\367\366\365\370\371\372]" "" nil ("-B") nil cp1255))
"Base value for `ispell-dictionary-alist'.")
"Base value for `ispell-dictionary-alist'.
Note that when the speller program is \"aspell\" or \"hunspell\",
some parts of the database, notably OTHERCHARS, will be overridden
by parsing the dictionary data files, see `ispell-aspell-find-dictionary'
and `ispell-parse-hunspell-affix-file'.")
(defvar ispell-dictionary-alist nil
"An alist of dictionaries and their associated parameters.
@ -577,7 +582,11 @@ when the language uses non-ASCII characters.
Note that with \"ispell\" as the speller, the CASECHARS and
OTHERCHARS slots of the alist should contain the same character
set as casechars and otherchars in the LANGUAGE.aff file \(e.g.,
english.aff). Aspell and Hunspell don't have this limitation.")
english.aff). Aspell and Hunspell don't have this limitation.
Also, when the speller program is \"aspell\" or \"hunspell\",
some parts of the database, notably OTHERCHARS, will be determined
by parsing the dictionary data files, see `ispell-aspell-find-dictionary'
and `ispell-parse-hunspell-affix-file'.")
(defvar ispell-really-aspell nil
"Non-nil if we can use Aspell extensions.")

View file

@ -3246,9 +3246,9 @@ treesit_traverse_child_helper (TSTreeCursor *cursor,
/* First go to the last child. */
while (ts_tree_cursor_goto_next_sibling (cursor));
if (!named)
if (!named || (named && ts_node_is_named (ts_tree_cursor_current_node(cursor))))
return true;
/* Else named... */
/* Else named is required and last child is not named node. */
if (treesit_traverse_sibling_helper(cursor, false, true))
return true;
else

View file

@ -1167,6 +1167,42 @@ This tests bug#60355."
treesit--ert-defun-navigation-top-level-master
'top-level))
(ert-deftest treesit-search-subtree-forward-1 ()
"Test search subtree forward."
(skip-unless (treesit-language-available-p 'python))
(require 'python)
(python-ts-mode)
(insert "Temp(1, 2)")
(goto-char (point-min))
(pcase-let* ((`((,_ . ,call-node))
(treesit-query-capture (treesit-buffer-root-node)
'((call) @c)))
(node (treesit-search-subtree
call-node
(lambda (n) (equal (treesit-node-type n) "integer")))))
(should node)
(should (equal (treesit-node-text node) "1"))))
(ert-deftest treesit-search-subtree-backward-1 ()
"Test search subtree with backward=t."
(skip-unless (treesit-language-available-p 'python))
(require 'python)
(python-ts-mode)
(insert "Temp(1, 2)")
(goto-char (point-min))
(pcase-let* ((`((,_ . ,call-node))
(treesit-query-capture (treesit-buffer-root-node)
'((call) @c)))
(node (treesit-search-subtree
call-node
(lambda (n) (equal (treesit-node-type n) "integer"))
t)))
(should node)
(should (equal (treesit-node-text node) "2"))))
;; TODO
;; - Functions in treesit.el
;; - treesit-load-name-override-list