1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Merge remote-tracking branch 'origin/master' into scratch/split-package.el

This commit is contained in:
Philip Kaludercic 2025-09-02 16:10:30 +02:00
commit b549268a00
154 changed files with 7330 additions and 1131 deletions

View file

@ -96,6 +96,10 @@ Dmitry Gutov
test/indent/ruby.rb
lisp/progmodes/xref.el
lisp/progmodes/project.el
lisp/thread.el
src/thread.c
Thread-related code in src/process.c
Ulf Jasper
Newsticker
@ -323,12 +327,14 @@ Michael Albinus
lisp/autorevert.el
lisp/eshell/em-tramp.el
lisp/files.el (file-name-non-special)
lisp/files-x.el (connection-local variables)
lisp/net/ange-ftp.el
lisp/notifications.el
lisp/shadowfile.el
test/infra/*
test/lisp/autorevert-tests.el
test/lisp/files-tests.el (file-name-non-special)
test/lisp/files-x-tests.el (connection-local variables)
test/lisp/shadowfile-tests.el
test/src/inotify-test.el
@ -381,6 +387,10 @@ Harald Jörg
Spencer Baugh
lisp/progmodes/flymake.el
lisp/thread.el
src/thread.c
Thread-related code in src/process.c
Yuan Fu
lisp/progmodes/c-ts-mode.el

View file

@ -380,12 +380,14 @@ As soon as possible after a release, the Emacs web pages at
<https://www.gnu.org/software/emacs/> should be updated.
(See admin/notes/www for general information.)
The pages to update are:
The pages and files to update are:
emacs.html (for a new major release, a more thorough update is needed)
history.html
add the new NEWS file as news/NEWS.xx.y
Copy new etc/MACHINES to MACHINES and CONTRIBUTE to CONTRIBUTE
. emacs.html (see below; for a new major release, a more thorough
update is needed)
. history.html (add a line for the new release)
. add the new NEWS file as news/NEWS.xx.y
. copy new etc/MACHINES to MACHINES and CONTRIBUTE to CONTRIBUTE
. possibly/rarely also download.html (see below)
For every new release, a banner is displayed on top of the emacs.html
page. Uncomment the release banner in emacs.html. Keep it on the page

View file

@ -316,7 +316,7 @@ Return non-nil if all queries are valid, nil otherwise."
;; TODO: A more generic way to find all queries.
(let ((c-ts-mode-enable-doxygen t)
(c-ts-mode-enable-doxygen t)
(java-ts-mode-enabel-doxygen t))
(java-ts-mode-enable-doxygen t))
(funcall mode))
(font-lock-mode -1)
treesit-font-lock-settings)))

View file

@ -2232,9 +2232,9 @@ AC_CACHE_CHECK([for flag to work around GCC union bugs],
[/* Work around GCC bugs 117423 and 119085 re holes in unions:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117423
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119085
These are fixed in GCC 15.2.
These are fixed in GCC 14.4 and 15.2.
Working wround them also works around GCC bug 58416
Working around them also works around GCC bug 58416
with double in unions on x86, where the generated insns
copy non-floating-point data via fldl/fstpl instruction pairs.
This can misbehave if the data's bit pattern looks like a NaN.

View file

@ -702,14 +702,14 @@ the directory.
@kindex touchscreen-hold @r{(Dired)}
@findex dired-click-to-select-mode
@findex dired-enable-click-to-select-mode
Enter a ``click to select'' mode, where using the mouse button
@kbd{mouse-2} on a file name will cause its mark to be toggled. This
mode is useful when performing file management using a touch screen
device.
Enter a ``click to select'' mode (@code{dired-click-to-select-mode}),
where using the mouse button @kbd{mouse-2} on a file name will cause its
mark to be toggled. This mode is useful when performing file management
using a touch screen device.
It is enabled when a ``hold'' gesture (@pxref{Touchscreens}) is
detected over a file name, and is automatically disabled once a Dired
command operates on the marked files.
It is enabled when a ``hold'' gesture (@pxref{Touchscreens}) is detected
over a file name, and is automatically disabled once a Dired command
that operates on the marked files finishes.
@end table
@node Operating on Files

View file

@ -868,6 +868,8 @@ Miscellaneous Commands and Features of VC
* Change Logs and VC:: Generating a change log file from log entries.
* VC Delete/Rename:: Deleting and renaming version-controlled files.
* Revision Tags:: Symbolic names for revisions.
* Merge Bases:: The most recent revision existing on both branches.
* Outgoing Base Diffs:: Diffs including all outstanding changes on a branch.
* Other Working Trees:: Multiple sets of workfiles.
* Version Headers:: Inserting version control headers into working files.
* Editing VC Commands:: Editing the VC shell commands that Emacs will run.

View file

@ -516,7 +516,7 @@ following subsections. You can use @kbd{C-x v v} either in a
file-visiting buffer, in a Dired buffer, or in a VC Directory buffer;
in the latter two cases the command operates on the fileset consisting
of the marked files. You can also use @kbd{C-x v v}, in a buffer with
patches under Diff Mode (@pxref{Diff Mode}), in which case the command
patches under Diff mode (@pxref{Diff Mode}), in which case the command
operates on the files whose diffs are shown in the buffer.
Note that VC filesets are distinct from the named filesets used
@ -1070,11 +1070,18 @@ non-@code{nil}, @kbd{C-x v I} becomes a prefix key, and
@code{vc-log-incoming} becomes bound to @kbd{C-x v I L}.
@item M-x vc-root-diff-incoming
Display a diff of the changes that a pull operation will retrieve.
Display a diff of all changes that a pull operation will retrieve.
If you customize @code{vc-use-incoming-outgoing-prefixes} to
non-@code{nil}, this command becomes available on @kbd{C-x v I D}.
@item M-x vc-diff-incoming
Display a diff of changes that a pull operation will retrieve, but
limited to the current fileset.
If you customize @code{vc-use-incoming-outgoing-prefixes} to
non-@code{nil}, this command becomes available on @kbd{C-x v I =}.
@item C-x v O
Display log entries for the changes that will be sent by the next
``push'' operation (@code{vc-log-outgoing}).
@ -1084,12 +1091,19 @@ non-@code{nil}, @kbd{C-x v O} becomes a prefix key, and
@code{vc-log-outgoing} becomes bound to @kbd{C-x v O L}.
@item M-x vc-root-diff-outgoing
Display a diff of the changes that will be sent by the next push
Display a diff of all changes that will be sent by the next push
operation.
If you customize @code{vc-use-incoming-outgoing-prefixes} to
non-@code{nil}, this command is bound to @kbd{C-x v O D}.
@item M-x vc-diff-outgoing
Display a diff of changes that will be sent by the next push operation,
but limited to the current fileset.
If you customize @code{vc-use-incoming-outgoing-prefixes} to
non-@code{nil}, this command becomes available on @kbd{C-x v O =}.
@item C-x v h
Display the history of changes made in the region of file visited by
the current buffer (@code{vc-region-history}).
@ -1176,13 +1190,21 @@ version control system can be a branch name.
@findex vc-root-diff-outgoing
The closely related commands @code{vc-root-diff-incoming} and
@code{vc-root-diff-outgoing} are the diff analogues of
@code{vc-log-incoming} and @code{vc-log-outgoing}. These display a diff
buffer reporting the changes that would be pulled or pushed. You can
@code{vc-log-incoming} and @code{vc-log-outgoing}. These display diff
buffers reporting the changes that would be pulled or pushed. You can
use a prefix argument here too to specify a particular remote location.
@code{vc-root-diff-outgoing} is useful as a way to preview your push and
quickly check that all and only the changes you intended to include were
committed and will be pushed.
@findex vc-diff-incoming
@findex vc-diff-outgoing
The commands @code{vc-diff-incoming} and @code{vc-diff-outgoing} are
very similar. They also display changes that would be pulled or pushed.
The difference is that the diffs reported are limited to the current
fileset. Don't forget that actual pull and push operations always
affect the whole working tree, not just the current fileset.
@cindex VC log buffer, commands in
@cindex vc-log buffer
In the @file{*vc-change-log*} buffer, you can use the following keys
@ -1793,7 +1815,7 @@ and so on, depending on the number of existing branches at that point.
@kindex C-x v b c
@findex vc-create-branch
This procedure will not work for distributed version control systems
like git or Mercurial. For those systems you should use the command
like Git or Mercurial. For those systems you should use the command
@code{vc-create-branch} (@w{@kbd{C-x v b c @var{branch-name} @key{RET}}})
instead.

View file

@ -507,6 +507,25 @@ predictable behavior, we recommend that you always customize
this variable overrides any remapping that Emacs might decide to perform
internally.
@vindex treesit-enabled-modes
As a convenience feature for enabling major modes based on the
tree-sitter library (@pxref{Parsing Program Source,,, elisp, The Emacs
Lisp Reference Manual}), you can customize the user option
@code{treesit-enabled-modes} to selectively enable or disable
tree-sitter based modes: if the value is @code{t}, that enables all the
available tree-sitter based modes; if it is a list of mode names, that
enables only those modes. Customizing this option adds the
corresponding mappings to @code{major-mode-remap-alist} such as
remapping from @code{c-mode} to @code{c-ts-mode} (if you enable the
latter). By default, this option's value is @code{nil}, so no
tree-sitter based modes are enabled.
Enabling a tree-stter based mode means that visiting files in the
corresponding programming language will automatically turn on that mode,
instead of any non-tree-sitter based modes for the same language. For
example, if you enable @code{c-ts-mode}, visiting C source files will
turn on @code{c-ts-mode} instead of @code{c-mode}.
@findex normal-mode
If you have changed the major mode of a buffer, you can return to
the major mode Emacs would have chosen automatically, by typing

View file

@ -234,7 +234,7 @@ current buffer is on a remote machine, @samp{@@} is displayed instead.
@var{d} appears if the window is dedicated to its current buffer.
It appears as @samp{D} for strong dedication and @samp{d} for other
forms of dedication. If the window is not dedicated, @var{d} does not
appear. @xref{Dedicated Windows,, elisp, The Emacs Lisp Reference
appear. @xref{Dedicated Windows,,, elisp, The Emacs Lisp Reference
Manual}.
@var{fr} gives the selected frame name (@pxref{Frames}). It appears

View file

@ -14,6 +14,8 @@
* Change Logs and VC:: Generating a change log file from log entries.
* VC Delete/Rename:: Deleting and renaming version-controlled files.
* Revision Tags:: Symbolic names for revisions.
* Merge Bases:: The most recent revision existing on both branches.
* Outgoing Base Diffs:: Diffs including all outstanding changes on a branch.
* Other Working Trees:: Multiple sets of workfiles.
* Version Headers:: Inserting version control headers into working files.
* Editing VC Commands:: Editing the VC shell commands that Emacs will run.
@ -227,6 +229,153 @@ an old tag, the renamed file is retrieved under its new name, which is
not the name that the makefile expects. So the program won't really
work as retrieved.
@node Merge Bases
@subsubsection Merge Bases
@cindex merge bases
@table @kbd
@item C-x v M D
Report diffs of changes on a branch since it diverged from another
(@code{vc-diff-mergebase}).
@item C-x v M L
Display log messages for revisions on a branch since it diverged from
another (@code{vc-log-mergebase}).
@end table
@c This definition is possibly dVCS-specific -- can revisions exist on
@c more than one branch for older VCS? This needs thinking through if
@c any of our centalized VCS gain support for these commands.
The @dfn{merge base} of two branches is the most recent revision that
exists on both branches. If neither of the branches was ever merged
into the other (@pxref{Merging}), then the merge base is the revision
that the older of the two branches was at when the newer branch was
created from it (@pxref{Creating Branches}). If one of the branches was
ever merged into the other, then the merge base is the most recent merge
point.
The commands described in this section are currently implemented only
for decentralized version control systems (@pxref{VCS Repositories}).
@kindex C-x v M D
@findex vc-diff-mergebase
@kindex C-x v M L
@findex vc-log-mergebase
Merge bases are useful to make certain comparisons between branches, and
Emacs provides two commands for doing so. Each of @kbd{C-x v M D}
(@code{vc-diff-mergebase}) and @kbd{C-x v M L} (@code{vc-log-mergebase})
prompts for two branches, finds their merge base, and then compares that
merge base with the second of the two branches. The commands report
diffs and display change history, respectively.
The typical use case for these commands is when one of the branches was
originally created from the other and you or a collaborator have made
merges of one of the branches into the other at least once. Then you
can use these commands to see what changes on one branch have not yet
been merged into the other.
Call the branch which has the changes you are interested in the ``source
branch'' and the branch into which these changes have not yet been
merged the ``target branch''. Specify the target branch when prompted
for the ``older revision'' and the source branch when prompted for the
``newer revision''.@footnote{The concept of merge bases generalizes from
branches to any two revisions. The merge base of two revisions is the
most recent revision that can be found in the revision history of both
of the two revisions. @kbd{C-x v M D} and @kbd{C-x v M L} accept any
two revisions, not just branches. Comparing two branches is the same as
comparing the revisions at the ends of the branches.
(In fact the concept generalizes to any number of revisions, but Emacs's
commands for merge bases work with only two, so we limit ourselves to
that.)} Then @kbd{C-x v M D} shows you a preview of what would change
on the target branch if you were to merge the source branch into it, and
@kbd{C-x v M L} shows you a log of the changes on the source branch not
yet merged into the target branch.
@node Outgoing Base Diffs
@subsubsection Commands for diffs including all outstanding changes
@cindex outstanding changes
@table @kbd
@item C-x v B =
Display diffs of changes to the VC fileset since the merge base of this
branch and its upstream counterpart (@code{vc-diff-outgoing-base}).
@item C-x v B D
Display all changes since the merge base of this branch and its upstream
counterpart (@code{vc-root-diff-outgoing-base}).
@end table
For decentralized version control systems (@pxref{VCS Repositories}),
these commands provide specialized versions of @kbd{C-x v M D} (see
@pxref{Merge Bases}) which also take into account the state of upstream
repositories. These commands are useful both when working on a single
branch and when developing features on a separate branch
(@pxref{Branches}). These two cases involve using the commands
differently, and so we will describe them separately.
First, consider working on a single branch. @dfn{Outstanding changes}
are those which you haven't yet pushed upstream. This includes both
unpushed commits and uncommitted changes in your working tree. In many
cases the reason these changes are not pushed yet is that they are not
finished: the changes committed so far don't make sense in isolation.
@kindex C-x v B =
@findex vc-diff-outgoing-base
@kindex C-x v B D
@findex vc-root-diff-outgoing-base
Type @kbd{C-x v B D} (@code{vc-root-diff-outgoing-base}) to display a
summary of all these changes, committed and uncommitted. This summary
is in the form of a diff of what committing and pushing (@pxref{Pulling
/ Pushing}) all these changes would do to the upstream repository. You
can use @kbd{C-x v B =} (@code{vc-diff-outgoing-base}) instead to limit
the display of changes to the current VC fileset. (The difference
between @w{@kbd{C-x v B D}} and @w{@kbd{C-x v B =}} is like the
difference between @kbd{C-x v D} and @kbd{C-x v =} (@pxref{Old
Revisions}).)@footnote{Another point of comparison is that these
commands are like @w{@kbd{C-x v O =}} (@code{vc-fileset-diff-outgoing})
and @kbd{C-x v O D} (@code{vc-root-diff-outgoing}) except that they
include uncommitted changes in the reported diffs. Like those other
commands, you can use a prefix argument to specify a particular upstream
location.}
Second, consider developing a feature on a separate branch. Call this
the @dfn{feature branch},@footnote{Many version control workflows
involve developing new features on isolated branches. However, the term
``feature branch'' is usually reserved for a particular kind of isolated
branch, one that other branches are repeatedly merged into.
That doesn't matter to this explanation, so we use ``feature branch'' to
refer to the separate branch used for developing the feature even though
whether it is really a feature branch depends on other aspects of the
branching workflow in use.} and call the branch from which the feature
branch was originally created the @dfn{trunk} or @dfn{development
trunk}.
In this case, outstanding changes is a more specific notion than just
unpushed and uncommitted changes on the feature branch. You're not
finished sharing changes with your collaborators until they have been
merged into the trunk, and pushed. Therefore, in this example,
outstanding changes are those which haven't yet been integrated into the
upstream repository's development trunk. That means committed changes
on the feature branch that haven't yet been merged into the trunk, plus
uncommitted changes.
@cindex outgoing base, version control
The @dfn{outgoing base} is the upstream location for which the changes
are destined once they are no longer outstanding. In this case, that's
the upstream version of the trunk, to which you and your collaborators
push finished work.
To display a summary of outgoing changes in this multi-branch example,
supply a prefix argument, by typing @w{@kbd{C-u C-x v B =}} or
@w{@kbd{C-u C-x v B D}}. When prompted, enter the outgoing base.
Exactly what you must supply here depends on the name of your
development trunk and the version control system in use. For example,
with Git, usually you will enter @kbd{origin/master}. We hope to
improve these commands such that no prefix argument is required in the
multi-branch case, too.
@node Other Working Trees
@subsubsection Multiple Working Trees for One Repository
@ -324,6 +473,16 @@ do and do not exist. In other words, the file or directory the current
buffer visits probably exists in other working trees too, and this
command lets you switch to those versions of the file.
@kbd{C-x v w w} also works in Diff mode (@pxref{Diff Mode}). Instead of
switching to a different buffer, the command changes the default
directory of the Diff mode buffer to the corresponding directory under
another working tree. This is useful with Diff mode buffers generated
by VC commands, such as @kbd{C-x v =} and @kbd{C-x v D} (@pxref{Old
Revisions}). You can use @kbd{C-x v w w} and then standard Diff mode
commands like @w{@kbd{C-c C-a}} (@code{diff-apply-hunk}) and @kbd{C-c
RET C-a} (@code{diff-apply-buffer}) to apply hunks from one working tree
to another.
@kindex C-x v w s
@findex vc-working-tree-switch-project
An alternative way to switch between working trees is @kbd{C-x v w s}

View file

@ -1489,8 +1489,8 @@ Each clause normally has the form @w{@code{(@var{condition}
@findex bind*
@code{(bind* @var{bindings}@dots{})} means to bind @var{bindings} (like
the bindings list in @code{let*}, @pxref{Local Variables}) for the body
of the clause. As a condition, it counts as true if the first binding's
value is non-@code{nil}.
of the clause, and all subsequent clauses. As a condition, it counts as
true if the first binding's value is non-@code{nil}.
@findex match*
@findex pcase*

View file

@ -256,38 +256,47 @@ commands; all except for @kbd{S} resume execution of the program, at
least for a certain distance.
@table @kbd
@findex edebug-stop
@item S
Stop: don't execute any more of the program, but wait for more
Edebug commands (@code{edebug-stop}).
@c FIXME Does not work. https://debbugs.gnu.org/9764
@findex edebug-step-mode
@item @key{SPC}
Step: stop at the next stop point encountered (@code{edebug-step-mode}).
@findex edebug-next-mode
@item n
Next: stop at the next stop point encountered after an expression
(@code{edebug-next-mode}). Also see @code{edebug-forward-sexp} in
@ref{Jumping}.
@findex edebug-trace-mode
@item t
Trace: pause (normally one second) at each Edebug stop point
(@code{edebug-trace-mode}).
@findex edebug-Trace-fast-mode
@item T
Rapid trace: update the display at each stop point, but don't actually
pause (@code{edebug-Trace-fast-mode}).
@findex edebug-go-mode
@item g
Go: run until the next breakpoint (@code{edebug-go-mode}). @xref{Breakpoints}.
@findex edebug-continue-mode
@item c
Continue: pause one second at each breakpoint, and then continue
(@code{edebug-continue-mode}).
@findex edebug-Continue-fast-mode
@item C
Rapid continue: move point to each breakpoint, but don't pause
(@code{edebug-Continue-fast-mode}).
@findex edebug-Go-nonstop-mode
@item G
Go non-stop: ignore breakpoints (@code{edebug-Go-nonstop-mode}). You
can still stop the program by typing @kbd{S}, or any editing command.
@ -345,25 +354,30 @@ in trace mode or continue mode. The default is 1 second.
The commands described in this section execute until they reach a
specified location. All except @kbd{i} make a temporary breakpoint to
establish the place to stop, then switch to go mode. Any other
breakpoint reached before the intended stop point will also stop
execution. @xref{Breakpoints}, for the details on breakpoints.
establish the place to stop, then switch to go mode (@pxref{Edebug
Execution Modes}). Any other breakpoint reached before the intended
stop point will also stop execution. @xref{Breakpoints}, for the
details on breakpoints.
These commands may fail to work as expected in case of nonlocal exit,
as that can bypass the temporary breakpoint where you expected the
program to stop.
@table @kbd
@findex edebug-goto-here
@item h
Proceed to the stop point near where point is (@code{edebug-goto-here}).
@findex edebug-forward-sexp
@item f
Run the program for one expression
(@code{edebug-forward-sexp}).
@findex edebug-step-out
@item o
Run the program until the end of the containing sexp (@code{edebug-step-out}).
@findex edebug-step-in
@item i
Step into the function or macro called by the form after point
(@code{edebug-step-in}).
@ -397,7 +411,7 @@ containing sexp is a function definition itself, @kbd{o} continues until
just before the last sexp in the definition. If that is where you are
now, it returns from the function and then stops. In other words, this
command does not exit the currently executing function unless you are
positioned after the last sexp.
positioned after the last sexp of that function.
Normally, the @kbd{h}, @kbd{f}, and @kbd{o} commands display ``Break''
and pause for @code{edebug-sit-for-seconds} before showing the result
@ -421,14 +435,17 @@ arrange to deinstrument it.
Some miscellaneous Edebug commands are described here.
@table @kbd
@findex edebug-help
@item ?
Display the help message for Edebug (@code{edebug-help}).
@findex abort-recursive-edit @r{(Edebug)}
@item a
@itemx C-]
Abort one level back to the previous command level
(@code{abort-recursive-edit}).
(@code{abort-recursive-edit}). @xref{Recursive Editing}.
@findex top-level @r{(Edebug)}
@item q
Return to the top level editor command loop (@code{top-level}). This
exits all recursive editing levels, including all levels of Edebug
@ -436,14 +453,17 @@ activity. However, instrumented code protected with
@code{unwind-protect} or @code{condition-case} forms may resume
debugging.
@findex edebug-top-level-nonstop
@item Q
Like @kbd{q}, but don't stop even for protected code
(@code{edebug-top-level-nonstop}).
@findex edebug-previous-result
@item r
Redisplay the most recently known expression result in the echo area
(@code{edebug-previous-result}).
@findex edebug-pop-to-backtrace
@item d
Display a backtrace, excluding Edebug's own functions for clarity
(@code{edebug-pop-to-backtrace}).
@ -473,9 +493,10 @@ display a backtrace of all the pending evaluations with @kbd{d}.
@node Breaks
@subsection Breaks
Edebug's step mode stops execution when the next stop point is reached.
There are three other ways to stop Edebug execution once it has started:
breakpoints, the global break condition, and source breakpoints.
Edebug's step mode (@pxref{Edebug Execution Modes}) stops execution when
the next stop point is reached. There are three other ways to stop
Edebug execution once it has started: breakpoints, the global break
condition, and source breakpoints.
@menu
* Breakpoints:: Breakpoints at stop points.
@ -495,6 +516,9 @@ the first one at or after point in the source code buffer. Here are the
Edebug commands for breakpoints:
@table @kbd
@findex edebug-set-breakpoint
@vindex edebug-enabled-breakpoint @r{(face)}
@vindex edebug-disabled-breakpoint @r{(face)}
@item b
Set a breakpoint at the stop point at or after point
(@code{edebug-set-breakpoint}). If you use a prefix argument, the
@ -502,26 +526,34 @@ breakpoint is temporary---it turns off the first time it stops the
program. An overlay with the @code{edebug-enabled-breakpoint} or
@code{edebug-disabled-breakpoint} faces is put at the breakpoint.
@findex edebug-unset-breakpoint
@item u
Unset the breakpoint (if any) at the stop point at or after
point (@code{edebug-unset-breakpoint}).
@findex edebug-unset-breakpoints
@item U
Unset any breakpoints in the current form
(@code{edebug-unset-breakpoints}).
@findex edebug-toggle-disable-breakpoint
@item D
Toggle whether to disable the breakpoint near point
(@code{edebug-toggle-disable-breakpoint}). This command is mostly
useful if the breakpoint is conditional and it would take some work to
recreate the condition.
@findex edebug-set-conditional-breakpoint
@item x @var{condition} @key{RET}
Set a conditional breakpoint which stops the program only if
evaluating @var{condition} produces a non-@code{nil} value
(@code{edebug-set-conditional-breakpoint}). With a prefix argument,
the breakpoint is temporary.
@item X @var{condition} @key{RET}
Set @code{edebug-global-break-condition} to @var{condition}.
@findex edebug-next-breakpoint
@item B
Move point to the next breakpoint in the current definition
(@code{edebug-next-breakpoint}).
@ -542,6 +574,8 @@ conditional breakpoint, use @kbd{x}, and specify the condition
expression in the minibuffer. Setting a conditional breakpoint at a
stop point that has a previously established conditional breakpoint puts
the previous condition expression in the minibuffer so you can edit it.
(You can also use @kbd{X} to set the global break condition, to be
evaluated at every stop point, @pxref{Global Break Condition}.)
You can make a conditional or unconditional breakpoint
@dfn{temporary} by using a prefix argument with the command to set the
@ -566,8 +600,9 @@ point in the buffer.
condition is satisfied, no matter where that may occur. Edebug
evaluates the global break condition at every stop point; if it
evaluates to a non-@code{nil} value, then execution stops or pauses
depending on the execution mode, as if a breakpoint had been hit. If
evaluating the condition gets an error, execution does not stop.
depending on the execution mode (@pxref{Edebug Execution Modes}), as if
a breakpoint had been hit. If evaluating the condition gets an error,
execution does not stop.
@findex edebug-set-global-break-condition
The condition expression is stored in
@ -603,7 +638,8 @@ argument reaches zero:
When the @code{fac} definition is instrumented and the function is
called, the call to @code{edebug} acts as a breakpoint. Depending on
the execution mode, Edebug stops or pauses there.
the execution mode (@pxref{Edebug Execution Modes}), Edebug stops or
pauses there.
If no instrumented code is being executed when @code{edebug} is called,
that function calls @code{debug}.
@ -640,17 +676,27 @@ configuration is the collection of windows and contents that were in
effect outside of Edebug.
@table @kbd
@item P
@itemx v
@findex edebug-view-outside
@item v
Switch to viewing the outside window configuration
(@code{edebug-view-outside}). Type @kbd{C-x X w} to return to Edebug.
@findex edebug-bounce-point
@item p
Temporarily display the outside current buffer with point at its
outside position (@code{edebug-bounce-point}), pausing for one second
before returning to Edebug. With a prefix argument @var{n}, pause for
@var{n} seconds instead.
@findex edebug-bounce-to-previous-value
@item P
Temporarily display the outside current buffer with the outside point
corresponding to the previously-evaluated value
(@code{edebug-bounce-to-previous-value}), pausing for one second
before returning to Edebug. With a prefix argument @var{n}, pause for
@var{n} seconds instead.
@findex edebug-where
@item w
Move point back to the current stop point in the source code buffer
(@code{edebug-where}).
@ -659,6 +705,7 @@ If you use this command in a different window displaying the same
buffer, that window will be used instead to display the current
definition in the future.
@findex edebug-toggle-save-windows
@item W
@c Its function is not simply to forget the saved configuration -- dan
Toggle whether Edebug saves and restores the outside window
@ -673,6 +720,23 @@ source code buffer, you must use @kbd{C-x X W} from the global keymap.
bounce to the point in the current buffer with @kbd{p}, even if
it is not normally displayed.
You can also bounce to buffer positions other than the current point.
Suppose you are debugging the form
@example
(make-overlay beg end)
@end example
@noindent
and you would like to know where @code{beg} and @code{end} are located
in the outside buffer. Then you could either evaluate these, for
example, with @kbd{C-x C-e}, or step over them with @kbd{n}, and
immediately after that press @kbd{P}, to bounce to the position you have
previously evaluated. The previous value for the purpose of the @kbd{P}
command is what Edebug has evaluated before its last stop point or what
you have evaluated in the context outside of Edebug, for example, with
@kbd{C-x C-e}.
After moving point, you may wish to jump back to the stop point.
You can do that with @kbd{w} from a source code buffer. You can jump
back to the stop point in the source code buffer from any buffer using
@ -697,6 +761,7 @@ explicitly saves and restores. @xref{The Outside Context}, for details
on this process.
@table @kbd
@findex edebug-eval-expression
@item e @var{exp} @key{RET}
Evaluate expression @var{exp} in the context outside of Edebug
(@code{edebug-eval-expression}). That is, Edebug tries to minimize
@ -707,30 +772,47 @@ pretty-print the result there.
By default, this command
suppresses the debugger during evaluation, so that an error in the
evaluated expression won't add a new error on top of the existing one.
Set the @code{debug-allow-recursive-debug} user option to a
non-@code{nil} value to override this.
Set the @code{debug-allow-recursive-debug} user option (@pxref{Error
Debugging}) to a non-@code{nil} value to override this.
@findex eval-expression @r{(Edebug)}
@item M-: @var{exp} @key{RET}
Evaluate expression @var{exp} in the context of Edebug itself
(@code{eval-expression}).
@findex edebug-eval-last-sexp
@item C-x C-e
Evaluate the expression before point, in the context outside of Edebug
(@code{edebug-eval-last-sexp}). With the prefix argument of zero
(@kbd{C-u 0 C-x C-e}), don't shorten long items (like strings and
lists). Any other prefix will result in the value being
pretty-printed in a separate buffer.
(@code{edebug-eval-last-sexp}) and show the value in the minibuffer.
With the prefix argument of zero (@kbd{C-u 0 C-x C-e}), don't shorten
long items (like strings and lists) when showing the value, due to
@code{edebug-print-length} and @code{edebug-print-level}
(@pxref{Printing in Edebug}). Any other prefix will result in the value
being pretty-printed in a separate buffer instead of the minibuffer.
@end table
@xref{Eval List}, for additional Edebug features related to evaluating
lists of expressions interactively.
@cindex lexical binding (Edebug)
@findex cl-macrolet @r{(Edebug)}
@findex cl-symbol-macrolet @r{(Edebug)}
Edebug supports evaluation of expressions containing references to
lexically bound symbols created by the following constructs in
@file{cl-lib.el}: @code{cl-macrolet} and @code{cl-symbol-macrolet}.
@c FIXME? What about lexical-binding = t?
@node Eval List
@subsection Evaluation List Buffer
@cindex evaluation list buffer
You can use the @dfn{evaluation list buffer}, called @file{*edebug*}, to
evaluate expressions interactively. You can also set up the
@dfn{evaluation list} of expressions to be evaluated automatically each
time Edebug updates the display.
@table @kbd
@findex edebug-visit-eval-list
@item E
Switch to the evaluation list buffer @file{*edebug*}
(@code{edebug-visit-eval-list}).
@ -741,20 +823,25 @@ Interaction mode (@pxref{Lisp Interaction,,, emacs, The GNU Emacs
Manual}) as well as these special commands:
@table @kbd
@findex edebug-eval-print-last-sexp
@item C-j
Evaluate the expression before point, in the outside context, and
insert the value in the buffer (@code{edebug-eval-print-last-sexp}).
With prefix argument of zero (@kbd{C-u 0 C-j}), don't shorten long
items (like strings and lists).
items (like strings and lists) due to @code{edebug-print-length} and
@code{edebug-print-level} (@pxref{Printing in Edebug}).
@findex edebug-eval-last-sexp
@item C-x C-e
Evaluate the expression before point, in the context outside of Edebug
(@code{edebug-eval-last-sexp}).
@findex edebug-update-eval-list
@item C-c C-u
Build a new evaluation list from the contents of the buffer
(@code{edebug-update-eval-list}).
@findex edebug-delete-eval-item
@item C-c C-d
Delete the evaluation list group that point is in
(@code{edebug-delete-eval-item}).
@ -797,24 +884,36 @@ not interrupt your debugging.
several expressions have been added to it:
@smallexample
@group
(current-buffer)
#<buffer *scratch*>
;---------------------------------------------------------------
@end group
@group
(selected-window)
#<window 16 on *scratch*>
;---------------------------------------------------------------
@end group
@group
(point)
196
;---------------------------------------------------------------
@end group
@group
bad-var
"Symbol's value as variable is void: bad-var"
;---------------------------------------------------------------
@end group
@group
(recursion-depth)
0
;---------------------------------------------------------------
@end group
@group
this-command
eval-last-sexp
;---------------------------------------------------------------
@end group
@end smallexample
To delete a group, move point into it and type @kbd{C-c C-d}, or simply
@ -825,8 +924,9 @@ the expression at a suitable place, insert a new comment line, then type
contents don't matter.
After selecting @file{*edebug*}, you can return to the source code
buffer with @kbd{C-c C-w}. The @file{*edebug*} buffer is killed when
you continue execution, and recreated next time it is needed.
buffer with @kbd{C-c C-w} (@pxref{Edebug Views}). The @file{*edebug*}
buffer is killed when you continue execution, and recreated next time it
is needed.
@node Printing in Edebug
@subsection Printing in Edebug
@ -860,8 +960,10 @@ to a non-@code{nil} value.
Here is an example of code that creates a circular structure:
@example
@group
(setq a (list 'x 'y))
(setcar a a)
@end group
@end example
@noindent
@ -883,11 +985,14 @@ printing results. The default value is @code{t}.
@node Trace Buffer
@subsection Trace Buffer
@cindex trace buffer
@cindex Edebug trace buffer
@cindex tracing in Edebug
Edebug can record an execution trace, storing it in a buffer named
@file{*edebug-trace*}. This is a log of function calls and returns,
showing the function names and their arguments and values. To enable
trace recording, set @code{edebug-trace} to a non-@code{nil} value.
trace recording, set @code{edebug-trace} to a non-@code{nil} value
(@pxref{Edebug Options}).
Making a trace buffer is not the same thing as using trace execution
mode (@pxref{Edebug Execution Modes}).
@ -918,7 +1023,7 @@ value of the last form in @var{body}.
@defun edebug-trace format-string &rest format-args
This function inserts text in the trace buffer. It computes the text
with @code{(apply 'format @var{format-string} @var{format-args})}.
with @w{@code{(apply 'format @var{format-string} @var{format-args})}}.
It also appends a newline to separate entries.
@end defun
@ -945,10 +1050,10 @@ correctly; Edebug will tell you when you have tried enough different
conditions that each form has returned two different values.
Coverage testing makes execution slower, so it is only done if
@code{edebug-test-coverage} is non-@code{nil}. Frequency counting is
performed for all executions of an instrumented function, even if the
execution mode is Go-nonstop, and regardless of whether coverage testing
is enabled.
@code{edebug-test-coverage} is non-@code{nil} (@pxref{Edebug Options}).
Frequency counting is performed for all executions of an instrumented
function, even if the execution mode is Go-nonstop, and regardless of
whether coverage testing is enabled.
@kindex C-x X =
@findex edebug-temp-display-freq-count
@ -981,6 +1086,7 @@ breakpoint, and setting @code{edebug-test-coverage} to @code{t}, when
the breakpoint is reached, the frequency data looks like this:
@example
@group
(defun fac (n)
(if (= n 0) (edebug))
;#6 1 = =5
@ -989,7 +1095,8 @@ the breakpoint is reached, the frequency data looks like this:
(* n (fac (1- n)))
;# 5 0
1))
;# 0
a;# 0
@end group
@end example
The comment lines show that @code{fac} was called 6 times. The
@ -1030,15 +1137,19 @@ using Edebug. You can also enlarge the value of
@code{edebug-max-depth} if Edebug reaches the limit of recursion depth
instrumenting code that contains very large quoted lists.
@vindex executing-kbd-macro @r{(Edebug)}
@item
The state of keyboard macro execution is saved and restored. While
Edebug is active, @code{executing-kbd-macro} is bound to @code{nil}
unless @code{edebug-continue-kbd-macro} is non-@code{nil}.
unless @code{edebug-continue-kbd-macro} is non-@code{nil} (@pxref{Edebug
Options}).
@end itemize
@node Edebug Display Update
@subsubsection Edebug Display Update
@cindex Edebug and display updates
@cindex display updates, and Edebug
@c This paragraph is not filled, because LaLiberte's conversion script
@c needs an xref to be on just one line.
@ -1059,13 +1170,13 @@ following data (though some of them are deliberately not restored if an
error or quit signal occurs).
@itemize @bullet
@item
@cindex current buffer point and mark (Edebug)
@item
Which buffer is current, and the positions of point and the mark in the
current buffer, are saved and restored.
@item
@cindex window configuration (Edebug)
@item
The outside window configuration is saved and restored if
@code{edebug-save-windows} is non-@code{nil} (@pxref{Edebug Options}).
If the value of @code{edebug-save-windows} is a list, only the listed
@ -1079,7 +1190,7 @@ The window start and horizontal scrolling of the source code buffer are
not restored, however, so that the display remains coherent within Edebug.
@cindex buffer point changed by Edebug
@cindex edebug overwrites buffer point position
@cindex Edebug overwrites buffer point position
Saving and restoring the outside window configuration can sometimes
change the positions of point in the buffers on which the Lisp program
you are debugging operates, especially if your program moves point.
@ -1091,11 +1202,14 @@ set @code{edebug-save-windows} to @code{nil}
The value of point in each displayed buffer is saved and restored if
@code{edebug-save-displayed-buffer-points} is non-@code{nil}.
@vindex overlay-arrow-position @r{(Edebug)}
@vindex overlay-arrow-string @r{(Edebug)}
@item
The variables @code{overlay-arrow-position} and
@code{overlay-arrow-string} are saved and restored, so you can safely
invoke Edebug from the recursive edit elsewhere in the same buffer.
@vindex cursor-in-echo-area @r{(Edebug)}
@item
@code{cursor-in-echo-area} is locally bound to @code{nil} so that
the cursor shows up in the window.
@ -1103,6 +1217,8 @@ the cursor shows up in the window.
@node Edebug Recursive Edit
@subsubsection Edebug Recursive Edit
@cindex Edebug and recursive edit
@cindex recursive edit, and Edebug
When Edebug is entered and actually reads commands from the user, it
saves (and later restores) these additional data:
@ -1149,6 +1265,8 @@ Edebug is active, @code{defining-kbd-macro} is bound to
@node Edebug and Macros
@subsection Edebug and Macros
@cindex Edebug and macros
@cindex macros, debugging with Edebug
To make Edebug properly instrument expressions that call macros, some
extra care is needed. This subsection explains the details.
@ -1172,23 +1290,26 @@ time later.)
Therefore, you must define an Edebug specification for each macro
that Edebug will encounter, to explain the format of calls to that
macro. To do this, add a @code{debug} declaration to the macro
definition. Here is a simple example that shows the specification for
the @code{for} example macro (@pxref{Argument Evaluation}).
macro. To do this, add a @code{debug} declaration (@pxref{Declare
Form}) to the macro definition. Here is a simple example that shows the
specification for the @code{for} example macro (@pxref{Argument
Evaluation}).
@smallexample
@group
(defmacro for (var from init to final do &rest body)
"Execute a simple \"for\" loop.
For example, (for i from 1 to 10 do (print i))."
(declare (debug (symbolp "from" form "to" form "do" &rest form)))
...)
@end group
@end smallexample
The Edebug specification says which parts of a call to the macro are
forms to be evaluated. For simple macros, the specification
often looks very similar to the formal argument list of the macro
definition, but specifications are much more general than macro
arguments. @xref{Defining Macros}, for more explanation of
arguments. @xref{Declare Form}, for more details about
the @code{declare} form.
@c See, e.g., https://debbugs.gnu.org/10577
@ -1252,6 +1373,7 @@ are instrumented.
@subsubsection Specification List
@cindex Edebug specification list
@cindex specification list, Edebug
A @dfn{specification list} is required for an Edebug specification if
some arguments of a macro call are evaluated while others are not. Some
elements in a specification list match one or more arguments, but others
@ -1358,8 +1480,8 @@ This is successful when there are no more arguments to match at the
current argument list level; otherwise it fails. See sublist
specifications and the backquote example.
@cindex preventing backtracking, in Edebug specification list
@item gate
@cindex preventing backtracking
No argument is matched but backtracking through the gate is disabled
while matching the remainder of the specifications at this level. This
is primarily used to generate more specific syntax error messages.
@ -1385,8 +1507,8 @@ sexps whose first element is a symbol and then lets
with that head symbol according to @code{pcase--match-pat-args} and
pass them to the @var{pf} it received as argument.
@item @var{other-symbol}
@cindex indirect specifications
@item @var{other-symbol}
Any other symbol in a specification list may be a predicate or an
indirect specification.
@ -1408,8 +1530,8 @@ specification fails and the argument is not instrumented.
Some suitable predicates include @code{symbolp}, @code{integerp},
@code{stringp}, @code{vectorp}, and @code{atom}.
@item [@var{elements}@dots{}]
@cindex [@dots{}] (Edebug)
@item [@var{elements}@dots{}]
A vector of elements groups the elements into a single @dfn{group
specification}. Its meaning has nothing to do with vectors.
@ -1470,8 +1592,8 @@ The argument, a symbol, is the name of an argument of the defining form.
However, lambda-list keywords (symbols starting with @samp{&})
are not allowed.
@item lambda-list
@cindex lambda-list (Edebug)
@item lambda-list
This matches a lambda list---the argument list of a lambda expression.
@item def-body
@ -1791,6 +1913,7 @@ a breakpoint. Set to @code{nil} to prevent the pause, non-@code{nil}
to allow it.
@end defopt
@cindex Edebug, changing behavior with instrumented code
@defopt edebug-behavior-alist
By default, this alist contains one entry with the key @code{edebug}
and a list of three functions, which are the default implementations
@ -1798,6 +1921,7 @@ of the functions inserted in instrumented code: @code{edebug-enter},
@code{edebug-before} and @code{edebug-after}. To change Edebug's
behavior globally, modify the default entry.
@vindex edebug-behavior, symbol property
Edebug's behavior may also be changed on a per-definition basis by
adding an entry to this alist, with a key of your choice and three
functions. Then set the @code{edebug-behavior} symbol property of an

View file

@ -1934,6 +1934,19 @@ Nested association lists is supported:
Nesting @code{let-alist} inside each other is allowed, but the code in
the inner @code{let-alist} can't access the variables bound by the
outer @code{let-alist}.
Indexing into lists is also supported:
@lisp
(setq colors '((rose . red) (lily . (yellow pink))))
(let-alist colors .lily.1)
@result{} pink
@end lisp
Note that forms like @samp{.0} or @samp{.3} are interpreted as numbers
rather than as symbols, so they won't be bound to the corresponding
values in ALIST.
@end defmac
@node Property Lists

View file

@ -690,7 +690,7 @@ and @code{define-overloadable-function} (see the commentary in
(@pxref{Top,Autotyping,,autotype,Autotyping}),
@code{transient-define-prefix}, @code{transient-define-suffix},
@code{transient-define-infix}, @code{transient-define-argument}, and
@code{transient-define-group} (@pxref{TOP,Transient,,transient,Transient
@code{transient-define-group} (@pxref{Top,Transient,,transient,Transient
User and Developer Manual}).
@end table

View file

@ -1289,10 +1289,11 @@ the Tabulated List buffer. Its value should be either a list or a
function.
If the value is a list, each list element corresponds to one group, and
should have the form @w{@code{(@var{group-name} @var{entries})}}, where
should have the form
@w{@code{(@var{group-name} @var{entry1} @var{entry2} @dots{})}}, where
@var{group-name} is a string inserted before all group entries, and
@var{entries} have the same format as @code{tabulated-list-entries}
(see above).
@var{entry1}, @var{entry2} and so on each have the same format as an
element of @code{tabulated-list-entries} (see above).
Otherwise, the value should be a function which returns a list of the
above form when called with no arguments.

View file

@ -1441,8 +1441,8 @@ x
The @var{array} should be mutable. @xref{Mutability}.
If @var{array} is a string and @var{object} is not a character, a
@code{wrong-type-argument} error results. The function converts a
unibyte string to multibyte if necessary to insert a character.
@code{wrong-type-argument} error results. For more information about
string mutation, @pxref{Modifying Strings}.
@end defun
@defun fillarray array object

View file

@ -467,12 +467,10 @@ described in this section. @xref{Mutability}.
The most basic way to alter the contents of an existing string is with
@code{aset} (@pxref{Array Functions}). @w{@code{(aset @var{string}
@var{idx} @var{char})}} stores @var{char} into @var{string} at character
index @var{idx}. It will automatically convert a pure-@acronym{ASCII}
@var{string} to a multibyte string (@pxref{Text Representations}) if
needed, but we recommend to always make sure @var{string} is multibyte
(e.g., by using @code{string-to-multibyte}, @pxref{Converting
Representations}), if @var{char} is a non-@acronym{ASCII} character, not
a raw byte.
index @var{idx}. When @var{string} is a unibyte string (@pxref{Text
Representations}), @var{char} must be a single byte (0--255); when
@var{string} is multibyte, both @var{char} and the previous character at
@var{idx} must be ASCII (0--127).
To clear out a string that contained a password, use
@code{clear-string}:

View file

@ -4641,6 +4641,8 @@ with @var{tochar} in @var{string}. By default, substitution occurs in
a copy of @var{string}, but if the optional argument @var{inplace} is
non-@code{nil}, the function modifies the @var{string} itself. In any
case, the function returns the resulting string.
For restrictions when altering an existing string, @pxref{Modifying Strings}.
@end defun
@deffn Command translate-region start end table

View file

@ -35714,6 +35714,14 @@ The default value of @code{calc-string-maximum-character} is @code{0xFF}
or 255.
@end defvar
@defvar calc-inhibit-startup-message
The variable @code{calc-inhibit-startup-message} controls display of a
welcome message when starting Calc. If it is @code{nil} (the default),
Calc will print a brief message listing key bindings to get help or to
quit. If it is non-@code{nil}, Calc will start without printing
anything.
@end defvar
@node Reporting Bugs
@appendix Reporting Bugs

View file

@ -913,6 +913,7 @@ The doc string contains a list of the system sounds you can use.
* Multilingual fonts::
* Font menu::
* Line ends::
* UTF-8 encoding::
@end menu
@node Font names
@ -1191,6 +1192,69 @@ recent versions of Emacs, this is seldom useful for existing files,
but can still be used to influence the choice of line ends for newly
created files.
@node UTF-8 encoding
@section Can I use UTF-8 as default encoding on MS-Windows?
@cindex UTF-8 as default encoding on Windows
@cindex codepage 65001 support in Emacs
Recent versions of MS-Windows (Windows 10 since build 1803, and Windows
11 or later versions) allow to use UTF-8 (a.k.a.@: ``codepage 65001'')
as the default system codepage. As of this writing, this is still an
experimental feature, even in Windows 11, and is disabled by default.
On Windows 11 you can enable it as follows:
@enumerate
@item
Open Settings.
@item
Select ``Time & Language'', then ``Language & region''.
@item
Click on ``Administrative language settings''.
@item
On the dialog that pops up click ``Change system locale...''
@item
In the ``Region Settings'' dialog that pops up, check the check-box
labeled ``Beta: Use Unicode UTF-8 for worldwide language support'', then
confirm by clicking ``OK'' to both dialogs.
@end enumerate
@cindex UCRT runtime library
@cindex MSVCRT runtime library
Emacs supports this feature starting from version 30.2, but only when
running on the versions of Windows that provide this feature, and only
if the Emacs executable was linked against the @samp{UCRT} library as
the Windows C runtime, not against the older @samp{MSVCRT}. This is
because the C functions that deal with non-ASCII characters, as
implemented by @samp{MSVCRT}, don't support UTF-8 as the multibyte
encoding of non-ASCII characters. (Which runtime to link against is
determined by the person who built your Emacs binary. Note that using
Emacs linked against @samp{UCRT} needs all of the libraries loaded by
Emacs dynamically, such as GnuTLS, image libraries like @samp{rsvg},
Tree-sitter, and all the others, to be also linked against @samp{UCRT},
otherwise subtle problems could happen when dealing with non-ASCII
characters and strings.)
If you have an Emacs linked against @samp{UCRT}, and you turned on the
UTF-8 support in Windows as described above, you can customize Emacs to
use UTF-8 as your default encoding, e.g., by adding
@lisp
(prefer-coding-system 'utf-8)
@end lisp
@noindent
to your init file, or by using the @samp{UTF-8} language environment
(@pxref{Language Environments,,, emacs, The GNU Emacs Manual}) in your
Emacs sessions.
Please be aware that, since this feature of Windows is still in beta,
there could be some subtle issues with it. So we do not yet recommend
to turn this on, unless you feel adventurous.
@c ------------------------------------------------------------
@node Printing
@chapter Printing

View file

@ -881,7 +881,7 @@ help with this a plethora of predicates have been created.
@anchor{find-class}
Return the class that @var{symbol} represents.
If there is no class, @code{nil} is returned if @var{errorp} is @code{nil}.
If @var{errorp} is non-@code{nil}, @code{wrong-argument-type} is signaled.
If @var{errorp} is non-@code{nil}, @code{wrong-type-argument} is signaled.
@end defun
@defun class-p class

View file

@ -2042,8 +2042,8 @@ Matches zero or more copies of the glob pattern @var{x}. For example,
@item @var{x}##
Matches one or more copies of the glob pattern @var{x}. Thus,
@samp{fo#.el} matches @file{fo.el}, @file{foo.el}, @file{fooo.el},
etc.
@samp{fo##.el} matches @file{fo.el}, @file{foo.el}, @file{fooo.el},
etc, but not @file{f.el}.
@item @var{x}~@var{y}
Matches anything that matches the pattern @var{x} but not @var{y}. For

View file

@ -152,7 +152,7 @@ variables})
@cindex next and previous diagnostic
If the diagnostics are outside the visible region of the buffer,
@code{flymake-goto-next-error} and @code{flymake-goto-prev-error} are
@code{flymake-goto-next-error} and @code{flymake-goto-prev-error}
let you navigate to the next/previous erroneous regions,
respectively. It might be a good idea to map them to @kbd{M-n} and
@kbd{M-p} in @code{flymake-mode}, by adding to your init file:
@ -316,10 +316,8 @@ reported.
The indicator type which Flymake should use to indicate lines with
errors or warnings.
Depending on your preference, this can either use @code{fringes} or
@code{margins} for indicating errors.
If set to @code{fringes} (the default), it will automatically fall back
to using margins in windows or frames without fringes, such as text
terminals.
@code{margins} for indicating errors. On text terminals, only
@code{margins} is available.
@item flymake-error-bitmap
A bitmap used in the fringe to mark lines for which an error has

View file

@ -4507,7 +4507,7 @@ The keymap which is active in the labels selection process
@defopt reftex-bibfile-ignore-regexps
List of regular expressions to exclude files in
@code{\\bibliography@{..@}}. File names matched by any of these regexps
@code{\bibliography@{..@}}. File names matched by any of these regexps
will not be parsed. Intended for files which contain only
@code{@@string} macro definitions and the like, which are ignored by
@RefTeX{} anyway.
@ -4605,7 +4605,7 @@ return the string to insert into the buffer.
@defopt reftex-cite-prompt-optional-args
Non-@code{nil} means, prompt for empty optional arguments in cite macros.
When an entry in @code{reftex-cite-format} is given with square brackets to
indicate optional arguments (for example @samp{\\cite[][]@{%l@}}), RefTeX can
indicate optional arguments (for example @samp{\cite[][]@{%l@}}), RefTeX can
prompt for values. Possible values are:
@example
nil @r{Never prompt for optional arguments}
@ -4658,7 +4658,7 @@ The keymap which is active in the citation-key selection process
@end deffn
@defopt reftex-cite-key-separator
String used to separate several keys in a single @samp{\\cite} macro.
String used to separate several keys in a single @samp{\cite} macro.
Per default this is @samp{","} but if you often have to deal with a lot
of entries and need to break the macro across several lines you might
want to change it to @samp{", "}.

View file

@ -2376,9 +2376,11 @@ value is @t{"-l"}, but some shells, like @command{ksh}, prefer
All @file{tramp-sh.el} based methods accept the property
@t{"session-timeout"}. This is the time (in seconds) after a
connection is disabled for security reasons, and must be
reestablished. A value of @code{nil} disables this feature. Most of
the methods do not set this property except the @option{sudo},
@option{doas} and @option{run0} methods, which use predefined values.
reestablished@footnote{If there is a modified buffer, or a buffer
under @code{auto-revert}, this is suppressed.}. A value of @code{nil}
disables this feature. Most of the methods do not set this property
except the @option{sudo}, @option{doas} and @option{run0} methods,
which use predefined values.
@item @t{"~"}@*
@t{"~user"}
@ -3659,6 +3661,8 @@ behavior: @file{@trampfn{method,user@@host,path/to/file}}.
For specifying port numbers, affix @file{#<port>} to the host
name. For example: @file{@trampfn{ssh,daniel@@melancholia#42,.emacs}}.
If the host is an IPv6 address, the port is appended like this:
@file{@trampfn{ssh,@value{ipv6prefix}::1@value{ipv6postfix}#42,.emacs}}.
All method, user name, host name, port number and local name parts are
optional, @xref{Default Method}, @xref{Default User}, @xref{Default Host}.
@ -5474,12 +5478,12 @@ Disable excessive traces. Set @code{tramp-verbose} to 3 or lower,
default being 3. Increase trace levels temporarily when hunting for
bugs.
@item
Use a package with @value{tramp} specific implementation of high-level
operations. For example, the GNU ELPA package @file{tramp-hlo}
implements specialized versions of @code{dir-locals--all-files},
@code{locate-dominating-file} and @code{dir-locals-find-file} for
@value{tramp}'s @code{tramp-sh} backend (@pxref{New operations}).
@c @item
@c Use a package with @value{tramp} specific implementation of high-level
@c operations. For example, the GNU ELPA package @file{tramp-hlo}
@c implements specialized versions of @code{dir-locals--all-files},
@c @code{locate-dominating-file} and @code{dir-locals-find-file} for
@c @value{tramp}'s @code{tramp-sh} backend (@pxref{New operations}).
@end itemize
@ -6834,7 +6838,8 @@ they are kept. Example:
@value{tramp} messages are raised with verbosity levels ranging from 0
to 10. @value{tramp} does not display all messages; only those with a
verbosity level less than or equal to @code{tramp-verbose}.
verbosity level less than or equal to 3, when @code{tramp-verbose}
permits.
@noindent
The verbosity levels are
@ -6921,7 +6926,7 @@ maintainers, analyzing the remote commands for performance analysis.
The debug buffer can be very large, if @code{tramp-verbose} is high,
and @value{tramp} runs for a long time. If the buffer size exceeds
@code{tramp-debug-buffer-limit} (3GB by default), a warning will be
@code{tramp-debug-buffer-limit} (100MB by default), a warning will be
raised. This user option can be adapted to your needs; a value of 0
means that there is no limit (no warning).

View file

@ -36,6 +36,10 @@ The command 'erc-fill-wrap-cycle-visual-movement' was mistakenly given
the key binding "C-c a" in an inadvertent holdover from development. It
has been removed.
** The 'fill-wrap' module no longer depends on 'scrolltobottom'.
This change also affects the option 'erc-fill-function' when it's set to
'erc-fill-wrap'.
** Updated defaults for the 'track' module's face-list options.
The default values of options 'erc-track-faces-priority-list' and
'erc-track-faces-normal-list' have both gained a face for buttonized

143
etc/NEWS
View file

@ -183,6 +183,14 @@ different completion categories by customizing
be updated as you type, or nil to suppress this always. Note that for
large or inefficient completion tables this can slow down typing.
---
*** RET chooses the completion selected with M-<up>/M-<down>
If a completion candidate is selected with M-<up> or M-<down>, hitting
RET will exit completion with that as the result. This works both in
minibuffer completion and in-buffer completion. This supersedes
'minibuffer-completion-auto-choose', which previously provided similar
behavior; that variable is now nil by default.
+++
*** New user option 'completion-pcm-leading-wildcard'.
This option configures how the partial-completion style does completion.
@ -426,6 +434,12 @@ docstring for arguments passed to a help-text function.
When non-nil, it truncates the tab bar, and therefore prevents
wrapping and resizing the tab bar to more than one line.
---
*** New user option 'tab-line-define-keys'.
When t, the default, it redefines window buffer switching keys
such as 'C-x <left>' and 'C-x <right>' to tab-line specific variants
for switching tabs.
---
*** New command 'tab-line-move-tab-forward' ('C-x M-<right>').
Together with the new command 'tab-line-move-tab-backward'
@ -504,12 +518,13 @@ This user option controls the automatic deletion of projects from
'project-list-file' that cannot be accessed when prompting for a
project.
The value can be a predicate which takes one argument and should return
non-nil if the project should be removed. If set to nil, all the
inaccessible projects will not be removed automatically.
The value must be an alist where each element must be in the form:
By default this is set to 'project-prune-zombies-default' function
which removes all non-remote projects.
(WHEN . PREDICATE)
where WHEN specifies where the deletion will be performed, and PREDICATE
a function which takes one argument, and must return non-nil if the
project should be removed.
---
*** New command 'project-save-some-buffers' bound to 'C-x p C-x s'.
@ -524,6 +539,16 @@ shell sessions. For example, 'C-2 C-x p s' switches to or creates a
buffer named "*name-of-project-shell<2>*". By comparison, a plain
universal argument as in 'C-u C-x p s' always creates a new session.
---
*** 'project-switch-buffer' re-uniquifies buffer names while prompting.
When 'uniquify-buffer-name-style' is non-nil, 'project-switch-buffer'
changes the buffer names to only make them unique within the given
project, during completion. That makes some items shorter.
*** 'project-switch-buffer' uses 'project-buffer' as completion category.
The category defaults are the same as for 'buffer' but any user
customizations would need to be re-added.
** Registers
*** New functions 'buffer-to-register' and 'file-to-register'.
@ -595,6 +620,14 @@ To use the ':foreground' or current text color ensure the 'fill' attribute
in the SVG is set to 'currentcolor', or set the image spec's ':css'
value to 'svg {fill: currentcolor;}'.
---
** Errors signaled by 'emacsclient' connections can now enter the debugger.
If 'debug-on-error' is non-nil, errors signaled by Lisp programs
executed due to 'emacsclient' connections will now enter the Lisp
debugger and show the backtrace. If 'debug-on-error' is nil, these
errors will be sent to 'emacsclient', as before, and will be displayed
on the terminal from which 'emacsclient' was invoked.
* Editing Changes in Emacs 31.1
@ -708,6 +741,15 @@ to the value 'fill-region-as-paragraph-semlf' to enable functions like
'fill-paragraph' and 'fill-region' to fill text using "semantic
linefeeds".
---
** Temporary files are named differently when 'file-precious-flag' is set.
When the user option 'file-precious-flag' is set to a non-nil value,
Emacs now names the temporary file it creates while saving buffers using
the original file name with ".tmp" appended to it. Thus, if saving the
buffer fails for some reason, and the temporary file is not renamed back
to the original file's name, you can easily identify which file's saving
failed.
+++
** 'C-u C-x .' clears the fill prefix.
You can now use 'C-u C-x .' to clear the fill prefix, similarly to how
@ -733,6 +775,7 @@ the default UI you get, i.e., when 'register-use-preview' is 'traditional'.
** Tree-sitter
+++
*** New user option 'treesit-enabled-modes'.
You can customize it either to t to enable all available ts-modes,
or to select a list of ts-modes to enable. Depending on customization,
@ -1458,9 +1501,10 @@ replies.
---
*** 'imap-authenticate' can now use PLAIN authentication.
"AUTH=PLAIN" support is auto-enabled if the IMAP server supports it. Pass
a specific authentication type to 'imap-authenticate' or remove 'plain'
from 'imap-authenticators' if you do not wish to use "AUTH=PLAIN".
"AUTH=PLAIN" support is auto-enabled if the IMAP server supports it. If
you do not wish to use "AUTH=PLAIN", pass a specific authentication type
to 'imap-open' for 'imap-authenticate' to use, or remove 'plain' from
'imap-authenticators'.
** Rmail
@ -2131,15 +2175,27 @@ relevant buffers before generating the contents of a VC Directory buffer
(like the third-party package Magit does with its status buffer).
+++
*** New commands 'vc-root-diff-incoming' and 'vc-root-diff-outgoing'.
These commands report diffs of all the changes that would be pulled and
would be pushed, respectively. They are the diff analogues of the
existing commands 'vc-log-incoming' and 'vc-log-outgoing'.
*** New commands to report incoming and outgoing diffs.
'vc-root-diff-incoming' and 'vc-root-diff-outgoing' report diffs of all
the changes that would be pulled and would be pushed, respectively.
They are the diff analogues of the existing commands 'vc-log-incoming'
and 'vc-log-outgoing'.
In particular, 'vc-root-diff-outgoing' is useful as a way to preview
your push and ensure that all and only the changes you intended to
include were committed and will be pushed.
'vc-diff-incoming' and 'vc-diff-outgoing' are similar but limited to the
current VC fileset.
+++
*** New commands to report diffs of outstanding changes.
'C-x v B =' ('vc-diff-outgoing-base') and 'C-x v B D'
('vc-root-diff-outgoing-base') report diffs of changes since the merge
base with the remote branch, including uncommitted changes.
They are useful to view all outstanding (unmerged, unpushed) changes on
the current branch.
+++
*** New user option 'vc-use-incoming-outgoing-prefixes'.
If this is customized to non-nil, 'C-x v I' and 'C-x v O' become prefix
@ -2499,14 +2555,21 @@ If non-nil, FFAP always finds remote files in buffers with remote
'default-directory'. If nil, FFAP finds local files first for absolute
file names in above buffers. The default is nil.
** Debugging
+++
*** New command 'edebug-bounce-to-previous-value' (bound to 'P')
This command temporarily displays the outside current buffer with the
outside point corresponding to the previous value, where the previous
value is what Edebug has evaluated before its last stop point or what
the user has evaluated in the context outside of Edebug.
This replaces the binding of command 'edebug-view-outside' to 'P', which
is still available on 'v'.
---
** Flymake
*** Windows without fringes now automatically use margin indicators.
When 'flymake-indicator-type' is set to 'fringes', as is now the default,
flymake will automatically fall back to using margin indicators in
windows without fringes, including any window on a text terminal.
*** Enhanced 'flymake-show-diagnostics-at-end-of-line'
The new value 'fancy' allowed for this user option will attempt to
layout diagnostics below the affected line using unicode graphics to
@ -2534,6 +2597,13 @@ The tabulated listings produced by 'flymake-show-buffer-diagnostics' and
'flymake-show-project-diagnostics' now automatically adjust their column
widths based on content, optimizing display space and readability.
*** New user option 'elisp-flymake-byte-compile-executable'.
This allows customizing the Emacs executable used for Flymake byte
compilation in emacs-lisp-mode. This option should be set when editing
Lisp code which will run with a different Emacs version than the running
Emacs, such as code from an older or newer version of Emacs. This will
provide more accurate warnings from byte compilation.
** SQLite
+++
@ -2588,6 +2658,11 @@ Latin-1 range 0-255. This hard-coded maximum is replaced by
the display of matching vectors as Unicode strings. The default value
is 0xFF or 255 to preserve the existing behavior.
+++
*** New user option 'calc-inhibit-startup-message'.
If it is non-nil, inhibit Calc from printing its startup message. The
default value is nil to preserve the existing behavior.
** Time
*** New user option 'world-clock-sort-order'.
@ -2669,9 +2744,32 @@ A major mode based on the tree-sitter library for editing "go.work"
files. If tree-sitter is properly set-up by the user, it can be
enabled for files named "go.work".
** New package 'lua-mode'.
The 'lua-mode' package from NonGNU ELPA is now included in Emacs.
** New library 'timeout'.
This library provides functions to throttle or debounce Emacs Lisp
functions. This is useful for corralling overeager code that is slow
and blocks Emacs, or does not provide ways to limit how often it runs.
* Incompatible Lisp Changes in Emacs 31.1
+++
** String mutation has been restricted further.
'aset' on unibyte strings now requires the new character to be a single
byte (0-255). On multibyte strings the new character and the character
being replaced must both be ASCII (0-127).
These rules ensure that mutation will never transform a unibyte string
to multibyte, and that the size of a string in bytes (as reported by
'string-bytes') never changes. They also allow strings to be
represented more efficiently in the future.
Other functions that use 'aset' to modify string data, such as
'subst-char-in-string' with a non-nil INPLACE argument, will signal an
error if called with arguments that would violate these rules.
** Nested backquotes are not supported any more in Pcase patterns.
---
@ -2794,6 +2892,12 @@ function 'load-path-filter-cache-directory-files', calling 'load' will
cache the directories it scans and their files, and the following
lookups should be faster.
+++
** 'let-alist' supports indexing into lists.
The macro 'let-alist' now interprets symbols containing numbers as list
indices. For example, '.key.0' looks up 'key' in the alist and then
returns its first element.
** Lexical binding
---
@ -3017,6 +3121,11 @@ a remote host. It must be used in conjunction with the function
+++
** 'read-directory-name' now accepts an optional PREDICATE argument.
---
** JSON parse error line and column are now obsolete.
The column number is no longer available; the line number will be
removed in next Emacs release.
* Changes in Emacs 31.1 on Non-Free Operating Systems

View file

@ -9,6 +9,8 @@
;; TYPE being `fun' or `var'.
(
("30.1" fun dired-click-to-select-mode)
("30.1" var dired-click-to-select-mode)
("29.1" fun plistp)
("29.1" fun help-key)
("28.1" fun always)

View file

@ -212,7 +212,8 @@ autoloads-force:
$(MAKE) autoloads
ldefs-boot.el: autoloads-force
sed '/^;; Local Variables:/a ;; no-byte-compile: t'\
sed '/^;; Local Variables:/a\
;; no-byte-compile: t'\
< $(lisp)/loaddefs.el > $(lisp)/ldefs-boot.el
# This is required by the bootstrap-emacs target in ../src/Makefile, so

View file

@ -1067,8 +1067,19 @@ using `make-temp-file', and the generated name is returned."
(setq coding
(coding-system-change-text-conversion coding 'raw-text)))
(unless (memq coding '(nil no-conversion))
;; If CODING specifies a certain EOL conversion, reset that, to
;; force 'decode-coding-region' below determine EOL conversion
;; from the file's data...
(if (numberp (coding-system-eol-type coding))
(setq coding (coding-system-change-eol-conversion coding nil)))
(decode-coding-region (point-min) (point-max) coding)
(setq last-coding-system-used coding))
;; ...then augment CODING with the actual EOL conversion
;; determined from the file's data.
(let ((eol-type (coding-system-eol-type last-coding-system-used)))
(if (numberp eol-type)
(setq last-coding-system-used
(coding-system-change-eol-conversion coding eol-type))
(setq last-coding-system-used coding))))
(set-buffer-modified-p nil)
(kill-local-variable 'buffer-file-coding-system)
(after-insert-file-set-coding (- (point-max) (point-min))))))

View file

@ -1468,11 +1468,17 @@ commands given here will actually operate on the *Calculator* stack."
(calc-mode))
(setq max-lisp-eval-depth (max max-lisp-eval-depth 1000))
(when calc-always-load-extensions
(require 'calc-ext))
(require 'calc-ext)
(calc-load-everything))
(when calc-language
(require 'calc-ext)
(calc-set-language calc-language calc-language-option t)))
(defcustom calc-inhibit-startup-message nil
"If non-nil, inhibit the Calc startup message."
:version "31.1"
:type 'boolean)
(defcustom calc-make-windows-dedicated nil
"If non-nil, windows displaying Calc buffers will be marked dedicated.
See `window-dedicated-p' for what that means."
@ -1524,9 +1530,10 @@ See `window-dedicated-p' for what that means."
(with-current-buffer (calc-trail-buffer)
(and calc-display-trail
(calc-trail-display 1 t)))
(unless calc-inhibit-startup-message
(message (substitute-command-keys
(concat "Welcome to the GNU Emacs Calculator! \\<calc-mode-map>"
"Press \\[calc-help] or \\[calc-help-prefix] for help, \\[calc-quit] to quit")))
"Press \\[calc-help] or \\[calc-help-prefix] for help, \\[calc-quit] to quit"))))
(run-hooks 'calc-start-hook)
(and (windowp full-display)
(window-point full-display)
@ -1534,10 +1541,11 @@ See `window-dedicated-p' for what that means."
(and calc-make-windows-dedicated
(set-window-dedicated-p nil t))
(calc-check-defines)
(unless calc-inhibit-startup-message
(when (and calc-said-hello interactive)
(sit-for 2)
(message ""))
(setq calc-said-hello t)))))
(setq calc-said-hello t))))))
;;;###autoload
(defun full-calc (&optional interactive)
@ -3515,11 +3523,6 @@ See Info node `(calc)Defining Functions'."
(defcalcmodevar math-half-2-word-size 2147483648
"One-half of two to the power of `calc-word-size'.")
(when calc-always-load-extensions
(require 'calc-ext)
(calc-load-everything))
(run-hooks 'calc-load-hook)
(provide 'calc)

View file

@ -1197,7 +1197,7 @@ This function makes `comint-dynamic-list-input-ring' obsolete."
(ring-elements comint-input-ring)
(user-error "No history available")))
(completion-in-region-mode-predicate
(lambda () (get-buffer-window "*Completions*" 0))))
(lambda () (minibuffer--completions-visible))))
(completion-in-region
(comint-line-beginning-position) (point-max)
(completion-table-with-metadata
@ -3521,7 +3521,7 @@ The optional argument COMMON-SUBSTRING, if non-nil, should be a string
specifying a common substring for adding the faces
`completions-first-difference' and `completions-common-part' to
the completions."
(let ((window (get-buffer-window "*Completions*" 0)))
(let ((window (minibuffer--completions-visible)))
(setq completions (sort completions #'string-lessp))
(if (and (eq last-command this-command)
window (window-live-p window) (window-buffer window)

View file

@ -77,10 +77,10 @@
(const box) integer)
(const :tag "Hollow cursor" hollow)
(const :tag "Vertical bar" bar)
(cons :tag "Vertical bar with specified height"
(cons :tag "Vertical bar with specified width"
(const bar) integer)
(const :tag "Horizontal bar" hbar)
(cons :tag "Horizontal bar with specified width"
(cons :tag "Horizontal bar with specified height"
(const hbar) integer)
(const :tag "None "nil))))
(pcase-dolist

View file

@ -333,11 +333,10 @@ only in the active region if `dired-mark-region' is non-nil."
(defaults (dired-dwim-target-defaults nil target-dir)))
(minibuffer-with-setup-hook
(lambda ()
(setq-local minibuffer-default-add-function nil)
(setq minibuffer-default defaults))
(setq-local minibuffer-default-add-function nil))
(read-directory-name (format "Compare %s with: "
(dired-current-directory))
target-dir target-dir t)))
target-dir defaults t)))
(read-from-minibuffer "Mark if (lisp expr or RET): " nil nil t nil "nil"))
dired-mode)
(let* ((dir1 (dired-current-directory))
@ -2668,17 +2667,12 @@ Optional arg HOW-TO determines how to treat the target.
(dired-one-file ; fluid variable inside dired-create-files
(and (consp fn-list) (null (cdr fn-list)) (car fn-list)))
(target-dir (dired-dwim-target-directory))
(default (and dired-one-file
(not dired-dwim-target) ; Bug#25609
(expand-file-name (file-name-nondirectory
(car fn-list))
target-dir)))
(defaults (dired-dwim-target-defaults fn-list target-dir))
(target (expand-file-name ; fluid variable inside dired-create-files
(minibuffer-with-setup-hook
(lambda ()
(setq-local minibuffer-default-add-function nil)
(setq minibuffer-default defaults))
;; Don't run `read-file-name--defaults'
(setq-local minibuffer-default-add-function nil))
(dired-mark-read-file-name
(format "%s %%s %s: "
(if dired-one-file op1 operation)
@ -2688,7 +2682,7 @@ Optional arg HOW-TO determines how to treat the target.
;; other operations copy (etc) to the
;; prompted file name.
"from" "to"))
target-dir op-symbol arg rfn-list default))))
target-dir op-symbol arg rfn-list defaults))))
(into-dir
(progn
(when
@ -2813,28 +2807,26 @@ Optional arg HOW-TO determines how to treat the target.
this-dir)))
(defun dired-dwim-target-defaults (fn-list target-dir)
;; Return a list of default values for file-reading functions in Dired.
;; This list may contain directories from Dired buffers in other windows.
;; `fn-list' is a list of file names used to build a list of defaults.
;; When nil or more than one element, a list of defaults will
;; contain only directory names. `target-dir' is a directory name
;; to exclude from the returned list, for the case when this
;; directory name is already presented in initial input.
;; For Dired operations that support `dired-dwim-target',
;; the argument `target-dir' should have the value returned
;; from `dired-dwim-target-directory'.
"Return a list of default values for file-reading functions in Dired.
This list may contain directories from Dired buffers in other windows.
FN-LIST is a list of file names used to build a list of defaults.
When nil or more than one element, a list of defaults will
contain only directory names.
TARGET-DIR should be the initial input in the minibuffer for the
file-reading function. For Dired operations that support
`dired-dwim-target', TARGET-DIR should have the value returned from
`dired-dwim-target-directory'."
(let ((dired-one-file
(and (consp fn-list) (null (cdr fn-list)) (car fn-list)))
(current-dir (and (eq major-mode 'dired-mode)
(dired-current-directory)))
;; Get a list of directories of visible buffers in dired-mode.
(dired-dirs (dired-dwim-target-directories)))
;; Force the current dir to be the first in the list.
;; Force TARGET-DIR then CURRENT-DIR to be first in the list.
(setq dired-dirs
(delete-dups (delq nil (cons current-dir dired-dirs))))
;; Remove the target dir (if specified) or the current dir from
;; default values, because it should be already in initial input.
(setq dired-dirs (delete (or target-dir current-dir) dired-dirs))
(delete-dups (delq nil (cons target-dir (cons current-dir dired-dirs)))))
;; Return a list of default values.
(if dired-one-file
;; For one file operation, provide a list that contains
@ -2847,10 +2839,7 @@ Optional arg HOW-TO determines how to treat the target.
(mapcar (lambda (dir)
(expand-file-name
(file-name-nondirectory (car fn-list)) dir))
(reverse dired-dirs))
(list (expand-file-name
(file-name-nondirectory (car fn-list))
(or target-dir current-dir))))
(reverse dired-dirs)))
;; For multi-file operation, return only a list of other directories.
dired-dirs)))

View file

@ -4057,7 +4057,10 @@ non-empty directories is allowed."
(message "(No deletions requested)")))))
(defun dired-post-do-command ()
"Disable `dired-click-to-select-mode' after an operation."
"Disable `dired-click-to-select-mode' if enabled..
This is called after Dired finishes an operation on marked files, and it
disables `dired-click-to-select-mode' that is automatically enabled
by the \"hold\" touch-screen gestures."
(when dired-click-to-select-mode
(dired-click-to-select-mode -1)))
@ -5381,12 +5384,14 @@ When this minor mode is enabled, using `mouse-2' on a file name
within a Dired buffer will toggle its mark instead of going to it
within another window.
Disabling this minor mode will unmark all files within the Dired
buffer.
`dired-click-to-select-mode' is automatically disabled after any
Dired operation (command whose name starts with `dired-do')
completes."
This minor mode is intended to be used when performing file management
using a touch-screen device. The mode is automatically enabled when a
\"hold\" gesture over a file name is received, and is therefore
automatically disabled after any Dired operation on the marked
files (any command whose name starts with \"dired-do-\" and which
performs some operation on the marked files) completes. When the mode
is automatically disabled, it unmarks all the marked files in the Dired
buffer."
:group 'dired
:lighter " Click-To-Select"
(unless (derived-mode-p '(dired-mode wdired-mode))

View file

@ -433,7 +433,7 @@ will select it.)"
(substitute-key-definition 'describe-syntax 'electric-describe-syntax map)
map))
;;;###(autoload 'ehelp-command "ehelp" "Prefix command for ehelp." t 'keymap)
;;;###autoload (autoload 'ehelp-command "ehelp" "Prefix command for ehelp." t 'keymap)
(defalias 'ehelp-command ehelp-map)
(put 'ehelp-command 'documentation "Prefix command for ehelp.")

View file

@ -3591,6 +3591,7 @@ This assumes the function has the `important-return-value' property."
(cl-nset-exclusive-or 1 2)
(cl-nreconc 1)
(cl-sort 1) (cl-stable-sort 1) (cl-merge 2 3)
(cl-fill 1) (cl-replace 1)
)))
(dolist (entry mutating-fns)
(put (car entry) 'mutates-arguments (cdr entry))))
@ -5880,11 +5881,11 @@ and corresponding effects."
;;; Core compiler macros.
(put 'featurep 'compiler-macro
(lambda (form feature &rest _ignore)
(lambda (form feature &rest rest)
;; Emacs-21's byte-code doesn't run under XEmacs or SXEmacs anyway, so
;; we can safely optimize away this test.
(if (member feature '('xemacs 'sxemacs 'emacs))
(eval form)
(if (and (member feature '('xemacs 'sxemacs 'emacs)) (not rest))
(featurep (cadr feature))
form)))
;; Report comma operator used outside of backquote.

View file

@ -2617,7 +2617,11 @@ when edebug becomes active."
(defvar edebug-eval-list nil) ;; List of expressions to evaluate.
(defvar edebug-previous-result nil) ;; Last result returned.
;; Last value seen while single-stepping or evaluating in the outside
;; environment.
(defvar edebug-previous-value nil)
;; Last value seen while single-stepping, converted to a string.
(defvar edebug-previous-result nil)
(defun edebug--display (value offset-index arg-mode)
;; edebug--display-1 is too big, we should split it. This function
@ -3113,6 +3117,37 @@ before returning. The default is one second."
(sit-for arg)
(edebug-pop-to-buffer edebug-buffer (car edebug-window-data)))))
(defun edebug-bounce-to-previous-value (arg)
"Bounce point to previous value in the outside current buffer.
The previous value is what Edebug has evaluated before its last stop
point or what you have evaluated in the context outside of Edebug, for
example, by calling function `edebug-eval-expression', whatever comes
later.
If prefix argument ARG is supplied, sit for that many seconds before
returning. The default is one second."
(interactive "p")
(if (not edebug-active)
(error "Edebug is not active"))
(if (not (integer-or-marker-p edebug-previous-value))
(error "Previous value not a number or marker"))
(save-excursion
;; If the buffer's currently displayed, avoid set-window-configuration.
(save-window-excursion
(let ((point-info ""))
(edebug-pop-to-buffer edebug-outside-buffer)
(cond
((< edebug-previous-value (point-min))
(setq point-info (format " (< Point min: %s)" (point-min))))
((> edebug-previous-value (point-max))
(setq point-info (format " (> Point max: %s)" (point-max))))
((invisible-p edebug-previous-value)
(setq point-info (format " (invisible)"))))
(goto-char edebug-previous-value)
(message "Current buffer: %s Point: %s%s"
(current-buffer) edebug-previous-value point-info)
(sit-for arg)
(edebug-pop-to-buffer edebug-buffer (car edebug-window-data))))))
;; Joe Wells, here is a start at your idea of adding a buffer to the internal
;; display list. Still need to use this list in edebug--display.
@ -3743,7 +3778,8 @@ Return the result of the last expression."
(if edebug-unwrap-results
(setq previous-value
(edebug-unwrap* previous-value)))
(setq edebug-previous-result
(setq edebug-previous-value previous-value
edebug-previous-result
(concat "Result: "
(edebug-safe-prin1-to-string previous-value)
(eval-expression-print-format previous-value))))
@ -3785,6 +3821,8 @@ this is the prefix key.)"
(values--store-value value)
(concat (edebug-safe-prin1-to-string value)
(eval-expression-print-format value)))))
;; Provide a defined previous value also in case of an error.
(setq edebug-previous-value (if errored nil value))
(cond
(errored
(message "Error: %s" errored))
@ -3901,9 +3939,9 @@ be installed in `emacs-lisp-mode-map'.")
;; views
"w" #'edebug-where
"v" #'edebug-view-outside ; maybe obsolete??
"v" #'edebug-view-outside
"p" #'edebug-bounce-point
"P" #'edebug-view-outside ; same as v
"P" #'edebug-bounce-to-previous-value
"W" #'edebug-toggle-save-windows
;; misc
@ -4517,6 +4555,7 @@ It is removed when you hit any char."
("Views"
["Where am I?" edebug-where t]
["Bounce to Current Point" edebug-bounce-point t]
["Bounce to Previous Value" edebug-bounce-to-previous-value t]
["View Outside Windows" edebug-view-outside t]
["Previous Result" edebug-previous-result t]
["Show Backtrace" edebug-pop-to-backtrace t]

View file

@ -593,7 +593,7 @@ OBJECT can be an instance or a class."
(defun find-class (symbol &optional errorp)
"Return the class that SYMBOL represents.
If there is no class, nil is returned if ERRORP is nil.
If ERRORP is non-nil, `wrong-argument-type' is signaled."
If ERRORP is non-nil, `wrong-type-argument' is signaled."
(let ((class (cl--find-class symbol)))
(cond
((eieio--class-p class) class)

View file

@ -813,7 +813,7 @@ This mainly sets up debugger-related bindings."
(letrec ((debugfun (lambda (err)
(ert--run-test-debugger test-execution-info
err debugfun))))
(handler-bind (((error quit) debugfun))
(handler-bind ((t debugfun))
(funcall (ert-test-body (ert--test-execution-info-test
test-execution-info))))))))
(ert-pass))

View file

@ -350,7 +350,8 @@ The default implementation delegates to `map-apply'."
(cl-defgeneric map-filter (pred map)
"Return an alist of key/val pairs for which (PRED key val) is non-nil in MAP.
The default implementation delegates to `map-apply'."
The default implementation delegates to `map-apply'.
This does not modify MAP."
(delq nil (map-apply (lambda (key val)
(and (funcall pred key val)
(cons key val)))
@ -358,7 +359,8 @@ The default implementation delegates to `map-apply'."
(cl-defgeneric map-remove (pred map)
"Return an alist of the key/val pairs for which (PRED key val) is nil in MAP.
The default implementation delegates to `map-filter'."
The default implementation delegates to `map-filter'.
This does not modify MAP."
(map-filter (lambda (key val) (not (funcall pred key val)))
map))
@ -457,7 +459,8 @@ MAP may be of a type other than TYPE."
(defun map-merge (type &rest maps)
"Merge into a map of TYPE all the key/value pairs in MAPS.
See `map-into' for all supported values of TYPE."
See `map-into' for all supported values of TYPE.
This does not modify any of the MAPS."
(apply #'map--merge
(lambda (result key value)
(setf (map-elt result key) value)
@ -469,7 +472,8 @@ See `map-into' for all supported values of TYPE."
When two maps contain the same key, call FUNCTION on the two
values and use the value FUNCTION returns.
Each of MAPS can be an alist, plist, hash-table, or array.
See `map-into' for all supported values of TYPE."
See `map-into' for all supported values of TYPE.
This does not modify any of the MAPS."
(let ((not-found (list nil)))
(apply #'map--merge
(lambda (result key value)

View file

@ -140,7 +140,7 @@ usually more efficient than that of a simplified version:
(open (cond ((stringp paren) paren) (paren "\\(")))
(re (if strings
(regexp-opt-group
(delete-dups (sort (copy-sequence strings) 'string-lessp))
(delete-dups (sort strings))
(or open t) (not open))
;; No strings: return an unmatchable regexp.
(concat (or open "\\(?:") regexp-unmatchable "\\)"))))
@ -250,7 +250,7 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher."
(prefixes
;; Sorting is necessary in cases such as ("ad" "d").
(sort (mapcar (lambda (s) (substring s 0 n)) strings)
'string-lessp)))
:in-place t)))
(concat open-group
(regexp-opt-group prefixes t t)
(regexp-quote (nreverse xiffus))

View file

@ -581,7 +581,7 @@ a list of named character classes in the order they occur in BODY."
(cons (rx--condense-intervals
(sort (append conses
(mapcan #'rx--string-to-intervals strings))
#'car-less-than-car))
:key #'car :in-place t))
(nreverse classes))))
(defun rx--generate-alt (negated intervals classes)

View file

@ -274,7 +274,8 @@ Value is a sequence of the same type as SEQUENCE."
(cl-defgeneric seq-sort (pred sequence)
"Sort SEQUENCE using PRED as the sorting comparison function.
The result is a sequence of the same type as SEQUENCE."
The result is a sequence of the same type as SEQUENCE. The sort
operates on a copy of SEQUENCE and does not modify SEQUENCE."
(let ((result (seq-sort pred (append sequence nil))))
(seq-into result (type-of sequence))))
@ -285,7 +286,8 @@ The result is a sequence of the same type as SEQUENCE."
(defun seq-sort-by (function pred sequence)
"Sort SEQUENCE transformed by FUNCTION using PRED as the comparison function.
Elements of SEQUENCE are transformed by FUNCTION before being
sorted. FUNCTION must be a function of one argument."
sorted. FUNCTION must be a function of one argument. The sort
operates on a copy of SEQUENCE and does not modify SEQUENCE."
(seq-sort (lambda (a b)
(funcall pred
(funcall function a)
@ -293,7 +295,8 @@ sorted. FUNCTION must be a function of one argument."
sequence))
(cl-defgeneric seq-reverse (sequence)
"Return a sequence with elements of SEQUENCE in reverse order."
"Return a sequence with elements of SEQUENCE in reverse order.
This does not modify SEQUENCE."
(let ((result '()))
(seq-map (lambda (elt)
(push elt result))
@ -307,6 +310,7 @@ sorted. FUNCTION must be a function of one argument."
(cl-defgeneric seq-concatenate (type &rest sequences)
"Concatenate SEQUENCES into a single sequence of type TYPE.
TYPE must be one of following symbols: `vector', `string' or `list'.
This does not modify any of the SEQUENCES.
\n(fn TYPE SEQUENCE...)"
(setq sequences (mapcar #'seq-into-sequence sequences))
@ -321,7 +325,9 @@ TYPE must be one of following symbols: `vector', `string' or `list'.
The default implementation is to signal an error if SEQUENCE is not a
sequence, specific functions should be implemented for new types
of sequence."
of sequence.
This does not modify SEQUENCE."
(unless (sequencep sequence)
(error "Cannot convert %S into a sequence" sequence))
sequence)
@ -329,7 +335,7 @@ of sequence."
(cl-defgeneric seq-into (sequence type)
"Concatenate the elements of SEQUENCE into a sequence of type TYPE.
TYPE can be one of the following symbols: `vector', `string' or
`list'."
`list'. This does not modify SEQUENCE."
(pcase type
(`vector (seq--into-vector sequence))
(`string (seq--into-string sequence))
@ -338,7 +344,8 @@ TYPE can be one of the following symbols: `vector', `string' or
;;;###autoload
(cl-defgeneric seq-filter (pred sequence)
"Return a list of all the elements in SEQUENCE for which PRED returns non-nil."
"Return a list of all the elements in SEQUENCE for which PRED returns non-nil.
This does not modify SEQUENCE."
(let ((exclude (make-symbol "exclude")))
(delq exclude (seq-map (lambda (elt)
(if (funcall pred elt)
@ -348,7 +355,8 @@ TYPE can be one of the following symbols: `vector', `string' or
;;;###autoload
(cl-defgeneric seq-remove (pred sequence)
"Return a list of all the elements in SEQUENCE for which PRED returns nil."
"Return a list of all the elements in SEQUENCE for which PRED returns nil.
This does not modify SEQUENCE."
(seq-filter (lambda (elt) (not (funcall pred elt)))
sequence))
@ -359,7 +367,8 @@ TYPE can be one of the following symbols: `vector', `string' or
N is the (zero-based) index of the element that should not be in
the result.
The result is a sequence of the same type as SEQUENCE."
The result is a sequence of the same type as SEQUENCE.
This does not modify SEQUENCE."
(seq-concatenate
(if (listp sequence) 'list (type-of sequence))
(seq-subseq sequence 0 n)
@ -376,7 +385,9 @@ third element of SEQUENCE, etc. FUNCTION will be called with
INITIAL-VALUE (and then the accumulated value) as the first
argument, and the elements from SEQUENCE as the second argument.
If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called."
If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called.
This does not modify SEQUENCE."
(if (seq-empty-p sequence)
initial-value
(let ((acc initial-value))
@ -411,7 +422,9 @@ If no such element is found, return DEFAULT.
Note that `seq-find' has an ambiguity if the found element is
identical to DEFAULT, as in that case it is impossible to know
whether an element was found or not."
whether an element was found or not.
This does not modify SEQUENCE."
(catch 'seq--break
(seq-doseq (elt sequence)
(when (funcall pred elt)
@ -485,7 +498,8 @@ The result is a list of (zero-based) indices."
;;;###autoload
(cl-defgeneric seq-uniq (sequence &optional testfn)
"Return a list of the elements of SEQUENCE with duplicates removed.
TESTFN is used to compare elements, and defaults to `equal'."
TESTFN is used to compare elements, and defaults to `equal'.
This does not modify SEQUENCE."
(let ((result '()))
(seq-doseq (elt sequence)
(unless (seq-contains-p result elt testfn)
@ -521,14 +535,16 @@ TESTFN is used to compare elements, and defaults to `equal'."
(cl-defgeneric seq-mapcat (function sequence &optional type)
"Concatenate the results of applying FUNCTION to each element of SEQUENCE.
The result is a sequence of type TYPE; TYPE defaults to `list'."
The result is a sequence of type TYPE; TYPE defaults to `list'.
This does not modify SEQUENCE."
(apply #'seq-concatenate (or type 'list)
(seq-map function sequence)))
(cl-defgeneric seq-partition (sequence n)
"Return list of elements of SEQUENCE grouped into sub-sequences of length N.
The last sequence may contain less than N elements. If N is a
negative integer or 0, the function returns nil."
negative integer or 0, the function returns nil.
This does not modify SEQUENCE."
(unless (< n 1)
(let ((result '()))
(while (not (seq-empty-p sequence))
@ -540,7 +556,8 @@ negative integer or 0, the function returns nil."
(cl-defgeneric seq-union (sequence1 sequence2 &optional testfn)
"Return a list of all the elements that appear in either SEQUENCE1 or SEQUENCE2.
\"Equality\" of elements is defined by the function TESTFN, which
defaults to `equal'."
defaults to `equal'.
This does not modify SEQUENCE1 or SEQUENCE2."
(let* ((accum (lambda (acc elt)
(if (seq-contains-p acc elt testfn)
acc
@ -553,7 +570,8 @@ defaults to `equal'."
(cl-defgeneric seq-intersection (sequence1 sequence2 &optional testfn)
"Return a list of all the elements that appear in both SEQUENCE1 and SEQUENCE2.
\"Equality\" of elements is defined by the function TESTFN, which
defaults to `equal'."
defaults to `equal'.
This does not modify SEQUENCE1 or SEQUENCE2."
(seq-reduce (lambda (acc elt)
(if (seq-contains-p sequence2 elt testfn)
(cons elt acc)
@ -564,7 +582,8 @@ defaults to `equal'."
(cl-defgeneric seq-difference (sequence1 sequence2 &optional testfn)
"Return list of all the elements that appear in SEQUENCE1 but not in SEQUENCE2.
\"Equality\" of elements is defined by the function TESTFN, which
defaults to `equal'."
defaults to `equal'.
This does not modify SEQUENCE1 or SEQUENCE2."
(seq-reduce (lambda (acc elt)
(if (seq-contains-p sequence2 elt testfn)
acc
@ -576,7 +595,7 @@ defaults to `equal'."
(cl-defgeneric seq-group-by (function sequence)
"Apply FUNCTION to each element of SEQUENCE.
Separate the elements of SEQUENCE into an alist using the results as
keys. Keys are compared using `equal'."
keys. Keys are compared using `equal'. This does not modify SEQUENCE."
(seq-reduce
(lambda (acc elt)
(let* ((key (funcall function elt))
@ -692,7 +711,7 @@ Signal an error if SEQUENCE is empty."
(defun seq-split (sequence length)
"Split SEQUENCE into a list of sub-sequences of at most LENGTH elements.
All the sub-sequences will be LENGTH long, except the last one,
which may be shorter."
which may be shorter. This does not modify SEQUENCE."
(when (< length 1)
(error "Sub-sequence length must be larger than zero"))
(let ((result nil)
@ -705,7 +724,8 @@ which may be shorter."
(nreverse result)))
(defun seq-keep (function sequence)
"Apply FUNCTION to SEQUENCE and return the list of all the non-nil results."
"Apply FUNCTION to SEQUENCE and return the list of all the non-nil results.
This does not modify SEQUENCE."
(delq nil (seq-map function sequence)))
(provide 'seq)

View file

@ -142,13 +142,14 @@ arguments and must return a list of the above form.")
(defvar-local tabulated-list-groups nil
"Groups displayed in the current Tabulated List buffer.
This should be either a function, or a list.
If a list, each element has the form (GROUP-NAME ENTRIES),
If a list, each element has the form (GROUP-NAME ENTRY1 ENTRY2 ...),
where:
- GROUP-NAME is a group name as a string, which is displayed
at the top line of each group.
- ENTRIES is a list described in `tabulated-list-entries'.
- ENTRY1, ENTRY2 and so on each have the same format as an element
of `tabulated-list-entries'.
If `tabulated-list-groups' is a function, it is called with no
arguments and must return a list of the above form.")

243
lisp/emacs-lisp/timeout.el Normal file
View file

@ -0,0 +1,243 @@
;;; timeout.el --- Throttle or debounce Elisp functions -*- lexical-binding: t; -*-
;; Copyright (C) 2023-2025 Free Software Foundation, Inc.
;; Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
;; Maintainer: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
;; Keywords: convenience, extensions
;; Version: 2.0
;; Package-Requires: ((emacs "24.4"))
;; URL: https://github.com/karthink/timeout
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; timeout is a small Elisp library that provides higher order functions to
;; throttle or debounce Elisp functions. This is useful for corralling
;; over-eager code that:
;; (i) is slow and blocks Emacs, and
;; (ii) does not provide customization options to limit how often it runs,
;;
;; To throttle a function FUNC to run no more than once every 2 seconds, run
;; (timeout-throttle 'func 2.0)
;;
;; To debounce a function FUNC to run after a delay of 0.3 seconds, run
;; (timeout-debounce 'func 0.3)
;;
;; To create a new throttled or debounced version of FUNC instead, run
;;
;; (timeout-throttled-func 'func 2.0)
;; (timeout-debounced-func 'func 0.3)
;;
;; You can bind this via `defalias':
;;
;; (defalias 'throttled-func (timeout-throttled-func 'func 2.0))
;;
;; The interactive spec and documentation of FUNC is carried over to the new
;; function.
;;; Code:
(require 'nadvice)
(defun timeout--throttle-advice (&optional timeout)
"Return a function that throttles its argument function.
TIMEOUT defaults to 1 second.
When FUNC does not run because of the throttle, the result from the
previous successful call is returned.
This is intended for use as function advice."
(let ((throttle-timer)
(timeout (or timeout 1.0))
(result))
(lambda (orig-fn &rest args)
"Throttle calls to this function."
(prog1 result
(unless (and throttle-timer (timerp throttle-timer))
(setq result (apply orig-fn args))
(setq throttle-timer
(run-with-timer
timeout nil
(lambda ()
(cancel-timer throttle-timer)
(setq throttle-timer nil)))))))))
(defun timeout--debounce-advice (&optional delay default)
"Return a function that debounces its argument function.
DELAY defaults to 0.50 seconds. The function returns immediately with
value DEFAULT when called the first time. On future invocations, the
result from the previous call is returned.
This is intended for use as function advice."
(let ((debounce-timer nil)
(delay (or delay 0.50)))
(lambda (orig-fn &rest args)
"Debounce calls to this function."
(prog1 default
(if (timerp debounce-timer)
(timer-set-idle-time debounce-timer delay)
(setq debounce-timer
(run-with-idle-timer
delay nil
(lambda (buf)
(cancel-timer debounce-timer)
(setq debounce-timer nil)
(setq default
(if (buffer-live-p buf)
(with-current-buffer buf
(apply orig-fn args))
(apply orig-fn args))))
(current-buffer))))))))
(defun timeout-debounce (func &optional delay default)
"Debounce FUNC by making it run DELAY seconds after it is called.
This advises FUNC, when called (interactively or from code), to
run after DELAY seconds. If FUNC is called again within this time,
the timer is reset.
DELAY defaults to 0.5 seconds. Using a delay of 0 removes any
debounce advice.
The function returns immediately with value DEFAULT when called the
first time. On future invocations, the result from the previous call is
returned."
(if (and delay (= delay 0))
(advice-remove func 'debounce)
(advice-add func :around (timeout--debounce-advice delay default)
'((name . debounce)
(depth . -99)))))
(defun timeout-throttle (func &optional throttle)
"Make FUNC run no more frequently than once every THROTTLE seconds.
THROTTLE defaults to 1 second. Using a throttle of 0 removes any
throttle advice.
When FUNC does not run because of the throttle, the result from the
previous successful call is returned."
(if (and throttle (= throttle 0))
(advice-remove func 'throttle)
(advice-add func :around (timeout--throttle-advice throttle)
'((name . throttle)
(depth . -98)))))
(defun timeout-throttled-func (func &optional throttle)
"Return a throttled version of function FUNC.
The throttled function runs no more frequently than once every THROTTLE
seconds. THROTTLE defaults to 1 second.
When FUNC does not run because of the throttle, the result from the
previous successful call is returned."
(let ((throttle-timer nil)
(throttle (or throttle 1))
(result))
(if (commandp func)
;; INTERACTIVE version
(lambda (&rest args)
(:documentation
(concat
(documentation func)
(format "\n\nThrottle calls to this function by %f seconds" throttle)))
(interactive (advice-eval-interactive-spec
(cadr (interactive-form func))))
(prog1 result
(unless (and throttle-timer (timerp throttle-timer))
(setq result (apply func args))
(setq throttle-timer
(run-with-timer
throttle nil
(lambda ()
(cancel-timer throttle-timer)
(setq throttle-timer nil)))))))
;; NON-INTERACTIVE version
(lambda (&rest args)
(:documentation
(concat
(documentation func)
(format "\n\nThrottle calls to this function by %f seconds" throttle)))
(prog1 result
(unless (and throttle-timer (timerp throttle-timer))
(setq result (apply func args))
(setq throttle-timer
(run-with-timer
throttle nil
(lambda ()
(cancel-timer throttle-timer)
(setq throttle-timer nil))))))))))
(defun timeout-debounced-func (func &optional delay default)
"Return a debounced version of function FUNC.
The debounced function runs DELAY seconds after it is called. DELAY
defaults to 0.5 seconds.
The function returns immediately with value DEFAULT when called the
first time. On future invocations, the result from the previous call is
returned."
(let ((debounce-timer nil)
(delay (or delay 0.50)))
(if (commandp func)
;; INTERACTIVE version
(lambda (&rest args)
(:documentation
(concat
(documentation func)
(format "\n\nDebounce calls to this function by %f seconds" delay)))
(interactive (advice-eval-interactive-spec
(cadr (interactive-form func))))
(prog1 default
(if (timerp debounce-timer)
(timer-set-idle-time debounce-timer delay)
(setq debounce-timer
(run-with-idle-timer
delay nil
(lambda (buf)
(cancel-timer debounce-timer)
(setq debounce-timer nil)
(setq default
(if (buffer-live-p buf)
(with-current-buffer buf
(apply func args))
(apply func args))))
(current-buffer))))))
;; NON-INTERACTIVE version
(lambda (&rest args)
(:documentation
(concat
(documentation func)
(format "\n\nDebounce calls to this function by %f seconds" delay)))
(prog1 default
(if (timerp debounce-timer)
(timer-set-idle-time debounce-timer delay)
(setq debounce-timer
(run-with-idle-timer
delay nil
(lambda (buf)
(cancel-timer debounce-timer)
(setq debounce-timer nil)
(setq default
(if (buffer-live-p buf)
(with-current-buffer buf
(apply func args))
(apply func args))))
(current-buffer)))))))))
(provide 'timeout)
;;; timeout.el ends here

View file

@ -417,11 +417,8 @@ is 0, reset to value of `erc-fill-wrap-visual-keys'."
"<remap> <erc-bol>" #'erc-fill--wrap-beginning-of-line)
(defvar erc-button-mode)
(defvar erc-scrolltobottom-mode)
(defvar erc-legacy-invisible-bounds-p)
(defvar erc-fill--wrap-scrolltobottom-exempt-p nil)
(defun erc-fill--wrap-ensure-dependencies ()
(with-suppressed-warnings ((obsolete erc-legacy-invisible-bounds-p))
(when erc-legacy-invisible-bounds-p
@ -434,10 +431,6 @@ is 0, reset to value of `erc-fill-wrap-visual-keys'."
(unless erc-fill-mode
(push 'fill missing-deps)
(erc-fill-mode +1))
(unless (or erc-scrolltobottom-mode erc-fill--wrap-scrolltobottom-exempt-p
(memq 'scrolltobottom erc-modules))
(push 'scrolltobottom missing-deps)
(erc-scrolltobottom-mode +1))
(when erc-fill-wrap-merge
(require 'erc-button)
(unless erc-button-mode
@ -515,11 +508,10 @@ This normally poses at most a minor inconvenience. Users of the
logged messages and instead prepends them to every line.
A so-called \"local\" module, `fill-wrap' depends on the global
modules `fill', `stamp', `button', and `scrolltobottom'. It
activates them as needed when initializing and leaves them
enabled when shutting down. To opt out of `scrolltobottom'
specifically, disable its minor mode, `erc-scrolltobottom-mode',
via `erc-fill-wrap-mode-hook'."
modules `fill', `stamp', `button'. It therefore activates them
as needed when initializing and leaves them enabled when shutting
down. Users may also find the `scrolltobottom' module a
necessary addition for this fill style."
((erc-fill--wrap-ensure-dependencies)
(when erc-fill-wrap-merge-indicator
(erc-fill--wrap-massage-legacy-indicator-type))
@ -618,14 +610,20 @@ message has been marked `erc--ephemeral'."
Ignore any `invisible' props that may be present when figuring.
Expect the target region to be free of `line-prefix' and
`wrap-prefix' properties, and expect `display-line-numbers-mode'
to be disabled."
to be disabled. On Emacs 28 and below, return END minus BEG."
;; Rely on `buffer-text-pixel-size' here even for buffers displayed in
;; another window because temporarily selecting such windows via
;; `with-selected-window' seems to interfere with the implementation
;; of `erc-scrolltobottom-all' in ERC 5.6, which needs improvement.
(if (fboundp 'buffer-text-pixel-size)
;; `buffer-text-pixel-size' can move point!
(save-excursion
(save-restriction
(narrow-to-region beg end)
(let* ((buffer-invisibility-spec)
(rv (car (buffer-text-pixel-size))))
(rv (car (if (eq (selected-window) (get-buffer-window))
(window-text-pixel-size)
(buffer-text-pixel-size)))))
(if erc-fill-wrap-use-pixels
(if (zerop rv) 0 (list rv))
(/ rv (frame-char-width))))))

View file

@ -186,13 +186,13 @@ If NO-CREATION is non-nil, the window is not created."
erc-status-sidebar--singular-p)))
(unless (or sidebar-window no-creation)
(with-current-buffer (erc-status-sidebar-get-buffer)
(setq-local vertical-scroll-bar nil))
(setq vertical-scroll-bar nil
cursor-type nil))
(setq sidebar-window (erc-status-sidebar-display-window))
(set-window-dedicated-p sidebar-window t)
(set-window-parameter sidebar-window 'no-delete-other-windows t)
;; Don't cycle to this window with `other-window'.
(set-window-parameter sidebar-window 'no-other-window t)
(setq cursor-type nil)
(set-window-fringes sidebar-window 0 0)
;; Set a custom display table so the window doesn't show a
;; truncation symbol when a channel name is too big.

View file

@ -9372,8 +9372,13 @@ If BUFFER is nil, update the mode line in all ERC buffers."
(report-emacs-bug
(format "ERC %s: %s" erc-version subject))
(save-excursion
(if (and (>= emacs-major-version 30)
(search-backward "X-Debbugs-CC: " nil t)
(goto-char (pos-eol))
(eq (char-before) ?\s))
(insert "emacs-erc@gnu.org")
(goto-char (point-min))
(insert "X-Debbugs-CC: emacs-erc@gnu.org\n")))
(insert "X-Debbugs-CC: emacs-erc@gnu.org\n"))))
(defconst erc--news-url
"https://git.savannah.gnu.org/cgit/emacs.git/plain/etc/ERC-NEWS")

View file

@ -500,7 +500,8 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'."
(maphash
(lambda (key _value)
(file-notify-rm-watch key))
file-notify-descriptors))
file-notify-descriptors)
(setq file-notify-descriptors (clrhash file-notify-descriptors)))
(defun file-notify-valid-p (descriptor)
"Check a watch specified by its DESCRIPTOR.

View file

@ -555,9 +555,13 @@ if different users access the same file, using different lock file settings;
if accessing files on a shared file system from different hosts,
using a transform that puts the lock files on a local file system."
:group 'files
:type '(repeat (list (regexp :tag "Regexp")
:type `(repeat (list (regexp :tag "Regexp")
(string :tag "Replacement")
(boolean :tag "Uniquify")))
(choice
(const :tag "Uniquify" t)
,@(mapcar (lambda (algo)
(list 'const algo))
(secure-hash-algorithms)))))
:version "28.1")
(defcustom remote-file-name-inhibit-locks nil
@ -6245,7 +6249,13 @@ Before and after saving the buffer, this function runs
;; for saving the buffer.
(setq tempname
(make-temp-file
(expand-file-name "tmp" dir)))
;; The MSDOS 8+3 restricted namespace cannot be
;; relied upon to produce a different file name
;; if we append ".tmp".
(if (and (eq system-type 'ms-dos)
(not (msdos-long-file-names)))
(expand-file-name "tmp" dir)
(concat buffer-file-name ".tmp"))))
;; Pass in nil&nil rather than point-min&max
;; cause we're saving the whole buffer.
;; write-region-annotate-functions may use it.

View file

@ -207,7 +207,6 @@
;;; Code:
(require 'syntax)
(eval-when-compile (require 'cl-lib))
(eval-when-compile (require 'subr-x))
;; Define core `font-lock' group.

View file

@ -448,13 +448,14 @@ during splitting, which may be slow."
(defun nnimap-open-connection (buffer)
;; Be backwards-compatible -- the earlier value of nnimap-stream was
;; `ssl' when nnimap-server-port was nil. Sort of.
;; `ssl' when nnimap-server-port was nil. Sort of. But it's `tls'
;; now, because we're post the Great 2025 Spelling Reform.
(when (and nnimap-server-port
(eq nnimap-stream 'undecided))
(setq nnimap-stream 'ssl))
(setq nnimap-stream 'tls))
(let ((stream
(if (eq nnimap-stream 'undecided)
(cl-loop for type in '(ssl network)
(cl-loop for type in '(tls network)
for stream = (let ((nnimap-stream type))
(nnimap-open-connection-1 buffer))
while (eq stream 'no-connect)
@ -493,7 +494,7 @@ during splitting, which may be slow."
(nnheader-message 7 "Opening connection to %s via shell..."
nnimap-address)
'("imap"))
((memq nnimap-stream '(ssl tls))
((memq nnimap-stream '(tls ssl))
(nnheader-message 7 "Opening connection to %s via tls..."
nnimap-address)
'("imaps" "imap" "993" "143"))

View file

@ -624,6 +624,7 @@ With argument, display info only for the selected version."
(t (format "NEWS.%d" vn))))
res)
(find-file (expand-file-name file data-directory))
(widen) ; In case we already are visiting that NEWS file
(emacs-news-view-mode)
(goto-char (point-min))
(when (stringp version)

View file

@ -334,11 +334,12 @@ undoes the expansion."
(defun he-capitalize-first (str)
(save-match-data
(if (string-match "\\Sw*\\(\\sw\\).*" str)
(let ((res (downcase str))
(no (match-beginning 1)))
(aset res no (upcase (aref str no)))
res)
(if (string-match "\\Sw*\\(\\sw\\)" str)
(let ((b (match-beginning 1))
(e (match-end 1)))
(concat (substring str 0 b)
(upcase (substring str b e))
(downcase (substring str e))))
str)))
(defun he-ordinary-case-p (str)

View file

@ -2135,10 +2135,14 @@ minibuffer and the selected frame has no other windows)."
(let ((guidance (quail-guidance)))
(if (listp guidance)
;; We must replace the typed key with the specified PROMPT-KEY.
(dotimes (i (length str))
(let ((prompt-key (cdr (assoc (aref str i) guidance))))
(setq str (apply #'string
(mapcar
(lambda (c)
(let ((prompt-key (assq c guidance)))
(if prompt-key
(aset str i (aref prompt-key 0)))))))
(aref (cdr prompt-key) 0)
c)))
str)))))
;; Show followable keys.
(if (and (> (length quail-current-key) 0) (cdr map))

View file

@ -6,7 +6,8 @@
;;; Commentary:
;; This file will be copied to ldefs-boot.el and checked in
;; periodically.
;; periodically. Note: When checking in ldefs-boot.el, don't include
;; changes to any other files in the commit.
;;; Code:
@ -1563,6 +1564,8 @@ disabled.
;;; Generated autoloads from autorevert.el
(defvar auto-revert-buffer-in-progress nil "\
Non-nil if a `auto-revert-buffer' operation is in progress, nil otherwise.")
(autoload 'auto-revert-mode "autorevert" "\
Toggle reverting buffer when the file changes (Auto-Revert Mode).
@ -2982,6 +2985,7 @@ This function attempts to use file contents to determine whether
the code is C or C++, and based on that chooses whether to enable
`c-ts-mode' or `c++-ts-mode'." t)
(make-obsolete 'c-or-c++-ts-mode 'c-or-c++-mode "30.1")
(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(c-mode . c-ts-mode)) (add-to-list 'treesit-major-mode-remap-alist '(c++-mode . c++-ts-mode)) (add-to-list 'treesit-major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode)))
(register-definition-prefixes "c-ts-mode" '("c-ts-"))
@ -4699,6 +4703,11 @@ For use inside Lisp programs, see also `c-macro-expansion'.
Major mode for editing CMake files, powered by tree-sitter.
(fn)" t)
(autoload 'cmake-ts-mode-maybe "cmake-ts-mode" "\
Enable `cmake-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\(?:CMakeLists\\.txt\\|\\.cmake\\)\\'" . cmake-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(cmake-mode . cmake-ts-mode)))
(register-definition-prefixes "cmake-ts-mode" '("cmake-ts-mode-"))
@ -5923,6 +5932,7 @@ Key bindings:
Major mode for editing C# code.
(fn)" t)
(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(csharp-mode . csharp-ts-mode)))
(register-definition-prefixes "csharp-mode" '("codedoc-font-lock-" "csharp-"))
@ -5952,6 +5962,7 @@ can also be used to fill comments.
\\{css-mode-map}
(fn)" t)
(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(css-mode . css-ts-mode)))
(autoload 'css-mode "css-mode" "\
Major mode to edit Cascading Style Sheets (CSS).
\\<css-mode-map>
@ -8385,6 +8396,11 @@ disabled.
Major mode for editing Dockerfiles, powered by tree-sitter.
(fn)" t)
(autoload 'dockerfile-ts-mode-maybe "dockerfile-ts-mode" "\
Enable `dockerfile-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\(?:Dockerfile\\(?:\\..*\\)?\\|\\.[Dd]ockerfile\\)\\'" . dockerfile-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(dockerfile-mode . dockerfile-ts-mode)))
(register-definition-prefixes "dockerfile-ts-mode" '("dockerfile-ts-mode--"))
@ -8534,6 +8550,7 @@ INIT-VALUE LIGHTER KEYMAP.
(fn MODE DOC [KEYWORD VAL ... &rest BODY])" nil t)
(function-put 'define-minor-mode 'doc-string-elt 2)
(function-put 'define-minor-mode 'lisp-indent-function 'defun)
(function-put 'define-minor-mode 'autoload-macro 'expand)
(autoload 'define-globalized-minor-mode "easy-mmode" "\
Make a global mode GLOBAL-MODE corresponding to buffer-local minor MODE.
TURN-ON is a function that will be called with no args in every buffer
@ -8577,6 +8594,7 @@ on if the hook has explicitly disabled it.
(fn GLOBAL-MODE MODE TURN-ON [KEY VALUE]... BODY...)" nil t)
(function-put 'define-globalized-minor-mode 'doc-string-elt 2)
(function-put 'define-globalized-minor-mode 'lisp-indent-function 'defun)
(function-put 'define-globalized-minor-mode 'autoload-macro 'expand)
(autoload 'easy-mmode-define-keymap "easy-mmode" "\
Return a keymap built from bindings BS.
BS must be a list of (KEY . BINDING) where
@ -8925,7 +8943,7 @@ A second call of this function without changing point inserts the next match.
A call with prefix PREFIX reads the symbol to insert from the minibuffer with
completion.
(fn PREFIX)" '("P"))
(fn PREFIX)" t)
(autoload 'ebrowse-tags-loop-continue "ebrowse" "\
Repeat last operation on files in tree.
FIRST-TIME non-nil means this is not a repetition, but the first time.
@ -9953,6 +9971,11 @@ mode hooks.
Major mode for editing Elixir, powered by tree-sitter.
(fn)" t)
(autoload 'elixir-ts-mode-maybe "elixir-ts-mode" "\
Enable `elixir-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.elixir\\'" . elixir-ts-mode-maybe)) (add-to-list 'auto-mode-alist '("\\.ex\\'" . elixir-ts-mode-maybe)) (add-to-list 'auto-mode-alist '("\\.exs\\'" . elixir-ts-mode-maybe)) (add-to-list 'auto-mode-alist '("mix\\.lock" . elixir-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(elixir-mode . elixir-ts-mode)))
(register-definition-prefixes "elixir-ts-mode" '("elixir-ts-"))
@ -10691,7 +10714,7 @@ ERC assigns SERVER and FULL-NAME the associated keyword values
and defers to `erc-compute-port', `erc-compute-user', and
`erc-compute-nick' for those respective parameters.
(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME ID)" '((let ((erc--display-context `((erc-interactive-display . erc) ,@erc--display-context))) (erc-select-read-args))))
(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME ID)" t)
(defalias 'erc-select #'erc)
(autoload 'erc-tls "erc" "\
Connect to an IRC server over a TLS-encrypted connection.
@ -10714,7 +10737,7 @@ See the alternative entry-point command `erc' as well as Info
node `(erc) Connecting' for a fuller description of the various
parameters, like ID.
(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME CLIENT-CERTIFICATE ID)" '((let ((erc-default-port erc-default-port-tls) (erc--display-context `((erc-interactive-display . erc-tls) ,@erc--display-context))) (erc-select-read-args))))
(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME CLIENT-CERTIFICATE ID)" t)
(autoload 'erc-handle-irc-url "erc" "\
Use ERC to IRC on HOST:PORT in CHANNEL.
If ERC is already connected to HOST:PORT, simply /join CHANNEL.
@ -15112,15 +15135,29 @@ Major mode for editing Go, powered by tree-sitter.
\\{go-ts-mode-map}
(fn)" t)
(autoload 'go-ts-mode-maybe "go-ts-mode" "\
Enable `go-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.go\\'" . go-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(go-mode . go-ts-mode)))
(autoload 'go-mod-ts-mode "go-ts-mode" "\
Major mode for editing go.mod files, powered by tree-sitter.
(fn)" t)
(autoload 'go-mod-ts-mode-maybe "go-ts-mode" "\
Enable `go-mod-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(go-mod-mode . go-mod-ts-mode)))
(autoload 'go-work-ts-mode "go-ts-mode" "\
Major mode for editing go.work files, powered by tree-sitter.
(fn)" t)
(add-to-list 'auto-mode-alist '("/go\\.work\\'" . go-work-ts-mode))
(autoload 'go-work-ts-mode-maybe "go-ts-mode" "\
Enable `go-work-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("/go\\.work\\'" . go-work-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(go-work-mode . go-work-ts-mode)))
(register-definition-prefixes "go-ts-mode" '("go-"))
@ -15793,6 +15830,11 @@ Like `hanoi-unix', but with a 64-bit clock." t)
Major mode for editing HEEx, powered by tree-sitter.
(fn)" t)
(autoload 'heex-ts-mode-maybe "heex-ts-mode" "\
Enable `heex-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.[hl]?eex\\'" . heex-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(heex-mode . heex-ts-mode)))
(register-definition-prefixes "heex-ts-mode" '("heex-ts-"))
@ -18851,6 +18893,7 @@ See Info node `(elisp)Defining Functions' for more details.
(fn NAME ARGS &rest BODY)" nil t)
(function-put 'define-inline 'lisp-indent-function 'defun)
(function-put 'define-inline 'doc-string-elt 3)
(function-put 'define-inline 'autoload-macro 'expand)
(register-definition-prefixes "inline" '("inline-"))
@ -19295,6 +19338,7 @@ Return the string read from the minibuffer.
Major mode for editing Java, powered by tree-sitter.
(fn)" t)
(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(java-mode . java-ts-mode)))
(register-definition-prefixes "java-ts-mode" '("java-ts-mode-"))
@ -19341,6 +19385,7 @@ Major mode for editing JavaScript.
\\<js-ts-mode-map>
(fn)" t)
(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(javascript-mode . js-ts-mode)))
(autoload 'js-json-mode "js" "\
@ -19376,6 +19421,7 @@ one of the aforementioned options instead of using this mode.
Major mode for editing JSON, powered by tree-sitter.
(fn)" t)
(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(js-json-mode . json-ts-mode)))
(register-definition-prefixes "json-ts-mode" '("json-ts-"))
@ -19874,7 +19920,7 @@ The first element on the command line should be the (main)
loaddefs.el output file, and the rest are the directories to
use.")
(load "theme-loaddefs.el" t)
(register-definition-prefixes "loaddefs-gen" '("autoload-" "generated-autoload-" "loaddefs-generate--" "no-update-autoloads"))
(register-definition-prefixes "loaddefs-gen" '("autoload-" "generated-autoload-" "loaddefs-" "no-update-autoloads"))
;;; Generated autoloads from loadhist.el
@ -20105,6 +20151,11 @@ Major mode for editing Lua files, powered by tree-sitter.
\\{lua-ts-mode-map}
(fn)" t)
(autoload 'lua-ts-mode-maybe "lua-ts-mode" "\
Enable `lua-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-ts-mode-maybe)) (add-to-list 'interpreter-mode-alist '("\\<lua\\(?:jit\\)?" . lua-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(lua-mode . lua-ts-mode)))
(register-definition-prefixes "lua-ts-mode" '("lua-ts-"))
@ -20693,6 +20744,11 @@ Populate MENU with commands that open a man page at point.
Major mode for editing Markdown using tree-sitter grammar.
(fn)" t)
(autoload 'markdown-ts-mode-maybe "markdown-ts-mode" "\
Enable `markdown-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(markdown-mode . markdown-ts-mode)))
(register-definition-prefixes "markdown-ts-mode" '("markdown-ts-"))
@ -21198,6 +21254,7 @@ Major mode for editing HTML with embedded JavaScript and CSS.
Powered by tree-sitter.
(fn)" t)
(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(mhtml-mode . mhtml-ts-mode)))
(register-definition-prefixes "mhtml-ts-mode" '("mhtml-ts-mode-"))
@ -24614,6 +24671,7 @@ for the result of evaluating EXP (first arg to `pcase').
(fn NAME ARGS [DOC] &rest BODY...)" nil t)
(function-put 'pcase-defmacro 'lisp-indent-function 2)
(function-put 'pcase-defmacro 'doc-string-elt 3)
(function-put 'pcase-defmacro 'autoload-macro 'expand)
(register-definition-prefixes "pcase" '("pcase-"))
@ -25142,6 +25200,11 @@ Prompt for CMD if `php-ts-mode-php-executable' is nil.
Optional CONFIG, if supplied, is the php.ini file to use.
(fn &optional CMD CONFIG)" t)
(autoload 'php-ts-mode-maybe "php-ts-mode" "\
Enable `php-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.\\(?:php[s345]?\\|phtml\\)\\'" . php-ts-mode-maybe)) (add-to-list 'auto-mode-alist '("\\.\\(?:php\\|inc\\|stub\\)\\'" . php-ts-mode-maybe)) (add-to-list 'auto-mode-alist '("/\\.php_cs\\(?:\\.dist\\)?\\'" . php-ts-mode-maybe)) (add-to-list 'interpreter-mode-alist (cons "php\\(?:-?[34578]\\(?:\\.[0-9]+\\)*\\)?" 'php-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(php-mode . php-ts-mode)))
(register-definition-prefixes "php-ts-mode" '("inferior-php-ts-mode" "php-ts-"))
@ -26091,13 +26154,19 @@ interactively, include all files under the project root, except
for VCS directories listed in `vc-directory-exclusion-list'.
(fn &optional INCLUDE-ALL)" t)
(autoload 'project-find-matching-file "project" "\
Visit the file that matches the current one, in another project.
It will skip to the same line number as well.
A matching file has the same file name relative to the project root.
(autoload 'project-find-matching-buffer "project" "\
Switch to a matching buffer in another project.
For most file-visiting buffers, the matching buffer is one visiting a
file in the other project which has the same file name relative to the
project root. See `project-find-matching-file' for details.
Non-file-visiting major modes may configure a different notion of
matching buffer; see `project-find-matching-buffer-function'.
When called during switching to another project, this command will
detect it and use the override. Otherwise, it prompts for the project
to use from the known list." t)
detect that, and use the override. Otherwise, it prompts for the
project to use from the list of known projects.
When calling from Lisp, bind `project-current-directory-override' to a
directory under the target project to preempt this prompting." t)
(autoload 'project-find-dir "project" "\
Start Dired in a directory inside the current project.
@ -26114,13 +26183,17 @@ Start an inferior shell in the current project's root directory.
If a buffer already exists for running a shell in the project's root,
switch to it. Otherwise, create a new shell buffer.
With \\[universal-argument] prefix arg, create a new inferior shell buffer even
if one already exists." t)
if one already exists.
With numeric prefix arg, switch to the session with that number, or
create it if it doesn't already exist." t)
(autoload 'project-eshell "project" "\
Start Eshell in the current project's root directory.
If a buffer already exists for running Eshell in the project's root,
switch to it. Otherwise, create a new Eshell buffer.
With \\[universal-argument] prefix arg, create a new Eshell buffer even
if one already exists." t)
if one already exists.
With numeric prefix arg, switch to the session with that number, or
create it if it doesn't already exist." t)
(autoload 'project-async-shell-command "project" "\
Run `async-shell-command' in the current project's root directory." t)
(function-put 'project-async-shell-command 'interactive-only 'async-shell-command)
@ -26217,9 +26290,13 @@ Like `save-some-buffers', but only for this project's buffers.
Add project PR to the front of the project list.
If project PR satisfies `project-list-exclude', then nothing is done.
Save the result in `project-list-file' if the list of projects
has changed, and NO-WRITE is nil.
has changed.
When called from Lisp, optional argument NO-WRITE non-nil means to
suppress saving `project-list-file'.
Optional argument STABLE means don't move PR to the front of the project
list if it's already present further down the project list.
(fn PR &optional NO-WRITE)" t)
(fn PR &optional NO-WRITE STABLE)" t)
(autoload 'project-forget-project "project" "\
Remove directory PROJECT-ROOT from the project list.
PROJECT-ROOT is the root directory of a known project listed in
@ -28356,6 +28433,7 @@ Major mode for editing Ruby code.
Major mode for editing Ruby, powered by tree-sitter.
(fn)" t)
(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(ruby-mode . ruby-ts-mode)))
(register-definition-prefixes "ruby-ts-mode" '("ruby-ts-"))
@ -28391,6 +28469,11 @@ disabled.
Major mode for editing Rust, powered by tree-sitter.
(fn)" t)
(autoload 'rust-ts-mode-maybe "rust-ts-mode" "\
Enable `rust-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(rust-mode . rust-ts-mode)))
(register-definition-prefixes "rust-ts-mode" '("rust-ts-"))
@ -29491,6 +29574,7 @@ This mode automatically falls back to `sh-mode' if the buffer is
not written in Bash or sh.
(fn)" t)
(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(sh-mode . bash-ts-mode)))
(register-definition-prefixes "sh-script" '("sh-"))
@ -33624,6 +33708,7 @@ Mode for displaying and reprioritizing top priority Todo.
Major mode for editing TOML, powered by tree-sitter.
(fn)" t)
(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(conf-toml-mode . toml-ts-mode)))
(register-definition-prefixes "toml-ts-mode" '("toml-ts-mode-"))
@ -34042,7 +34127,7 @@ Interactively, with a prefix argument, prompt for a different method." t)
;;; Generated autoloads from transient.el
(push '(transient 0 9 3) package--builtin-versions)
(push '(transient 0 9 4) package--builtin-versions)
(autoload 'transient-insert-suffix "transient" "\
Insert a SUFFIX into PREFIX before LOC.
PREFIX is a prefix command, a symbol.
@ -34136,6 +34221,11 @@ nil, the grammar is installed to the standard location, the
\"tree-sitter\" directory under `user-emacs-directory'.
(fn LANG &optional OUT-DIR)" t)
(defvar treesit-enabled-modes nil "\
Specify what treesit modes to enable by default.
The value can be either a list of ts-modes to enable,
or t to enable all ts-modes.")
(custom-autoload 'treesit-enabled-modes "treesit" nil)
(register-definition-prefixes "treesit" '("treesit-"))
@ -34443,6 +34533,11 @@ This mode is intended to be inherited by concrete major modes.
Major mode for editing TypeScript.
(fn)" t)
(autoload 'typescript-ts-mode-maybe "typescript-ts-mode" "\
Enable `typescript-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(typescript-mode . typescript-ts-mode)))
(autoload 'tsx-ts-mode "typescript-ts-mode" "\
Major mode for editing TSX and JSX documents.
@ -34455,6 +34550,11 @@ The JSX-specific faces are used when `treesit-font-lock-level' is
at least 3 (which is the default value).
(fn)" t)
(autoload 'tsx-ts-mode-maybe "typescript-ts-mode" "\
Enable `tsx-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(tsx-mode . tsx-ts-mode)))
(register-definition-prefixes "typescript-ts-mode" '("tsx-ts-" "typescript-ts-"))
@ -35613,6 +35713,17 @@ See `vc-use-incoming-outgoing-prefixes' regarding giving this command a
global binding.
(fn &optional REMOTE-LOCATION)" t)
(autoload 'vc-diff-incoming "vc" "\
Report changes to VC fileset that would be pulled from REMOTE-LOCATION.
When unspecified REMOTE-LOCATION is the place \\[vc-update] would pull from.
When called interactively with a prefix argument, prompt for REMOTE-LOCATION.
In some version control systems REMOTE-LOCATION can be a remote branch name.
When called from Lisp optional argument FILESET overrides the VC fileset.
See `vc-use-incoming-outgoing-prefixes' regarding giving this command a
global binding.
(fn &optional REMOTE-LOCATION FILESET)" t)
(autoload 'vc-root-diff-outgoing "vc" "\
Report diff of all changes that would be pushed to REMOTE-LOCATION.
When unspecified REMOTE-LOCATION is the place \\[vc-push] would push to.
@ -35623,6 +35734,17 @@ See `vc-use-incoming-outgoing-prefixes' regarding giving this command a
global binding.
(fn &optional REMOTE-LOCATION)" t)
(autoload 'vc-diff-outgoing "vc" "\
Report changes to VC fileset that would be pushed to REMOTE-LOCATION.
When unspecified REMOTE-LOCATION is the place \\[vc-push] would push to.
When called interactively with a prefix argument, prompt for REMOTE-LOCATION.
In some version control systems REMOTE-LOCATION can be a remote branch name.
When called from Lisp optional argument FILESET overrides the VC fileset.
See `vc-use-incoming-outgoing-prefixes' regarding giving this command a
global binding.
(fn &optional REMOTE-LOCATION FILESET)" t)
(autoload 'vc-version-ediff "vc" "\
Show differences between REV1 and REV2 of FILES using ediff.
This compares two revisions of the files in FILES. Currently,
@ -35937,30 +36059,40 @@ marked revisions, use those.
(fn ADDRESSEE SUBJECT REVISIONS)" t)
(autoload 'vc-add-working-tree "vc" "\
Create working tree DIRECTORY with same backing repository as this tree.
See Info node `(emacs)Other Working Trees' regarding VCS repositories
with multiple working trees.
Must be called from within an existing VC working tree.
When called interactively, prompts for DIRECTORY.
When called from Lisp, BACKEND is the VC backend.
(fn BACKEND DIRECTORY)" t)
(autoload 'vc-switch-working-tree "vc" "\
Switch to this file or directory's analogue in working tree DIRECTORY.
This command switches to the file or directory which has the same path
relative to DIRECTORY that this buffer's file or directory has relative
Switch to the version of this file in working tree under DIRECTORY.
Must be called from within an existing VC working tree.
When called interactively, prompts for DIRECTORY.
This command switches to the file which has the same file
name relative to DIRECTORY that this buffer's file has relative
to the root of this working tree.
DIRECTORY names another working tree with the same backing repository as
this tree; see Info node `(emacs)Other Working Trees' for general
information regarding VCS repositories with multiple working trees.
(fn DIRECTORY)" t)
(autoload 'vc-working-tree-switch-project "vc" "\
Like \\[project-switch-project] but limited to projects with the same backing repository.
Must be called from within an existing VC working tree.
Prompts for the directory file name of the other working tree.
(fn DIR)" t)
(function-put 'vc-working-tree-switch-project 'interactive-only 'project-switch-project)
(autoload 'vc-delete-working-tree "vc" "\
Delete working tree DIRECTORY with same backing repository as this tree.
See Info node `(emacs)Other Working Trees' regarding VCS repositories
with multiple working trees.
Must be called from within an existing VC working tree.
When called interactively, prompts for DIRECTORY.
BACKEND is the VC backend.
(fn BACKEND DIRECTORY)" t)
(autoload 'vc-move-working-tree "vc" "\
Relocate a working tree from FROM to TO.
See Info node `(emacs)Other Working Trees' regarding VCS repositories
with multiple working trees.
Relocate a working tree from FROM to TO, two directory file names.
Must be called from within an existing VC working tree.
When called interactively, prompts for the directory file names of each
of the other working trees FROM and TO.
BACKEND is the VC backend.
(fn BACKEND FROM TO)" t)
(register-definition-prefixes "vc" '("log-view-vc-prev-" "vc-" "with-vc-properties"))
@ -37756,6 +37888,25 @@ evaluate the variable `whitespace-newline-mode'.
The mode's hook is called both when the mode is enabled and when it is
disabled.
(fn &optional ARG)" t)
(autoload 'whitespace-page-delimiters-mode "whitespace" "\
Display page-break delimiter characters as horizontal lines.
This is a minor mode. If called interactively, toggle the
`Whitespace-Page-Delimiters mode' mode. If the prefix argument is
positive, enable the mode, and if it is zero or negative, disable the
mode.
If called from Lisp, toggle the mode if ARG is `toggle'. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate the variable `whitespace-page-delimiters-mode'.
The mode's hook is called both when the mode is enabled and when it is
disabled.
(fn &optional ARG)" t)
(put 'global-whitespace-mode 'globalized-minor-mode t)
(defvar global-whitespace-mode nil "\
@ -37832,6 +37983,7 @@ Interactively, it reads one of the following chars:
t toggle TAB visualization
s toggle SPACE and HARD SPACE visualization
r toggle trailing blanks visualization
p toggle page delimiters visualization
l toggle \"long lines\" visualization
L toggle \"long lines\" tail visualization
n toggle NEWLINE visualization
@ -37862,6 +38014,7 @@ The valid symbols are:
tabs toggle TAB visualization
spaces toggle SPACE and HARD SPACE visualization
trailing toggle trailing blanks visualization
page-delimiters toggle page delimiters visualization
lines toggle \"long lines\" visualization
lines-tail toggle \"long lines\" tail visualization
newline toggle NEWLINE visualization
@ -37903,6 +38056,7 @@ Interactively, it accepts one of the following chars:
t toggle TAB visualization
s toggle SPACE and HARD SPACE visualization
r toggle trailing blanks visualization
p toggle page delimiters visualization
l toggle \"long lines\" visualization
L toggle \"long lines\" tail visualization
C-l toggle \"long lines\" one character visualization
@ -37934,6 +38088,7 @@ The valid symbols are:
tabs toggle TAB visualization
spaces toggle SPACE and HARD SPACE visualization
trailing toggle trailing blanks visualization
page-delimiters toggle page delimiters visualization
lines toggle \"long lines\" visualization
lines-tail toggle \"long lines\" tail visualization
lines-char toggle \"long lines\" one character visualization
@ -38936,6 +39091,11 @@ a new xwidget-webkit session, otherwise use an existing session.
Major mode for editing YAML, powered by tree-sitter.
(fn)" t)
(autoload 'yaml-ts-mode-maybe "yaml-ts-mode" "\
Enable `yaml-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name.")
(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.ya?ml\\'" . yaml-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(yaml-mode . yaml-ts-mode)))
(register-definition-prefixes "yaml-ts-mode" '("yaml-ts-mode--"))

View file

@ -587,7 +587,7 @@ Message buffer where you can explain more about the patch."
(message-goto-body)
(insert "\n\n\n")
(emacs-build-description)
(mml-attach-file file "text/patch" nil "attachment")
(mml-attach-file file "text/x-patch" nil "attachment")
(message-goto-body)
(message "Write a description of the patch and use %s to send it"
(substitute-command-keys "\\[message-send-and-exit]"))

View file

@ -4515,6 +4515,11 @@ TEXT and INDENT are not used."
;; to "prying eyes." Obviously, this encoding isn't "real security,"
;; nor is it meant to be.
(defvar rmail--remote-password-host nil
"Last recorded value of the HOST argument to `rmail-get-remote-password'.")
(defvar rmail--remote-password-user nil
"Last recorded value of the USER argument to `rmail-get-remote-password'.")
;;;###autoload
(defun rmail-set-remote-password (password)
"Set PASSWORD to be used for retrieving mail from a POP or IMAP server."
@ -4535,7 +4540,12 @@ machine mymachine login myloginname password mypassword
If auth-source search yields no result, prompt the user for the
password."
(when (not rmail-encoded-remote-password)
(when (or (not rmail-encoded-remote-password)
(not (equal user rmail--remote-password-user))
(not (equal host rmail--remote-password-host)))
;; Record the values we will be using from now on.
(setq rmail--remote-password-host host
rmail--remote-password-user user)
(if (not rmail-remote-password)
(setq rmail-remote-password
(let ((found (nth 0 (auth-source-search

View file

@ -99,12 +99,15 @@ don't define this value."
"Type of SMTP connections to use.
This may be either nil (upgrade with STARTTLS if possible),
`starttls' (refuse to send if STARTTLS isn't available),
`plain' (never use STARTTLS), or `ssl' (to use TLS/SSL)."
`plain' (never use STARTTLS), or `tls' (to use TLS/SSL).
`ssl' is accepted as a backwards-compatible equivalent
to `tls'"
:version "24.1"
:type '(choice (const :tag "Possibly upgrade to STARTTLS" nil)
(const :tag "Always use STARTTLS" starttls)
(const :tag "Never use STARTTLS" plain)
(const :tag "Use TLS/SSL" ssl)))
(const :tag "Use TLS/SSL" tls)
(const :tag "Use TLS/SSL (old name)" ssl)))
(defcustom smtpmail-sendto-domain nil
"Local domain name without a host name.

View file

@ -1215,6 +1215,7 @@ styles for specific categories, such as files, buffers, etc."
;; A new style that combines substring and pcm might be better,
;; e.g. one that does not anchor to bos.
(project-file (styles . (substring)))
(project-buffer (styles . (basic substring)))
(xref-location (styles . (substring)))
(info-menu (styles . (basic substring)))
(symbol-help (styles . (basic shorthand substring))))
@ -1616,7 +1617,7 @@ when the buffer's text is already an exact match."
(completed
(cond
((pcase completion-auto-help
('visible (get-buffer-window "*Completions*" 0))
('visible (minibuffer--completions-visible))
('always t))
(minibuffer-completion-help beg end))
(t (minibuffer-hide-completions)
@ -1982,12 +1983,17 @@ DONT-CYCLE tells the function not to setup cycling."
(defvar minibuffer--original-buffer nil
"Buffer that was current when `completing-read' was called.")
(defun minibuffer-complete-and-exit ()
(defun minibuffer-complete-and-exit (&optional no-exit)
"Exit if the minibuffer contains a valid completion.
Otherwise, try to complete the minibuffer contents. If
completion leads to a valid completion, a repetition of this
command will exit.
If a completion candidate is selected in the *Completions* buffer, it
will be inserted in the minibuffer first. If NO-EXIT is non-nil, don't
actually exit the minibuffer, just insert the selected completion if
any.
If `minibuffer-completion-confirm' is `confirm', do not try to
complete; instead, ask for confirmation and accept any input if
confirmed.
@ -1996,9 +2002,12 @@ If `minibuffer-completion-confirm' is `confirm-after-completion',
preceding minibuffer command was a member of
`minibuffer-confirm-exit-commands', and accept the input
otherwise."
(interactive)
(interactive "P")
(when (completion--selected-candidate)
(minibuffer-choose-completion t t))
(unless no-exit
(completion-complete-and-exit (minibuffer--completion-prompt-end) (point-max)
#'exit-minibuffer))
#'exit-minibuffer)))
(defun completion-complete-and-exit (beg end exit-function)
(completion--complete-and-exit
@ -2677,13 +2686,13 @@ so that the update is less likely to interfere with user typing."
(defun completions--post-command-update ()
"Update displayed *Completions* buffer after command, once."
(remove-hook 'post-command-hook #'completions--post-command-update)
(when (and completion-eager-update (get-buffer-window "*Completions*" 0))
(when (and completion-eager-update (minibuffer--completions-visible))
(completions--background-update)))
(defun completions--after-change (_start _end _old-len)
"Update displayed *Completions* buffer after change in buffer contents."
(when (or completion-auto-deselect completion-eager-update)
(when-let* ((window (get-buffer-window "*Completions*" 0)))
(when-let* ((window (minibuffer--completions-visible)))
(when completion-auto-deselect
(with-selected-window window
(completions--deselect)))
@ -2885,7 +2894,7 @@ so that the update is less likely to interfere with user typing."
;; FIXME: We could/should use minibuffer-scroll-window here, but it
;; can also point to the minibuffer-parent-window, so it's a bit tricky.
(interactive)
(when-let* ((win (get-buffer-window "*Completions*" 0)))
(when-let* ((win (minibuffer--completions-visible)))
(with-selected-window win
;; Move point off any completions, so we don't move point there
;; again the next time `minibuffer-completion-help' is called.
@ -3009,6 +3018,11 @@ Also respects the obsolete wrapper hook `completion-in-region-functions'.
;; completion-at-point called directly.
"M-?" #'completion-help-at-point
"TAB" #'completion-at-point
;; If a completion is selected, RET will choose it.
"RET" `(menu-item "" minibuffer-choose-completion :filter
,(lambda (cmd)
(when (completion--selected-candidate)
cmd)))
"M-<up>" #'minibuffer-previous-completion
"M-<down>" #'minibuffer-next-completion
"M-RET" #'minibuffer-choose-completion)
@ -3215,6 +3229,17 @@ The completion method is determined by `completion-at-point-functions'."
(define-key map "\n" 'exit-minibuffer)
(define-key map "\r" 'exit-minibuffer))
(defun minibuffer-completion-exit (&optional no-exit)
"Call `exit-minibuffer', inserting the selected completion first if any.
If NO-EXIT is non-nil, don't `exit-minibuffer', just insert the selected
completion."
(interactive "P")
(when (completion--selected-candidate)
(minibuffer-choose-completion t t))
(unless no-exit
(exit-minibuffer)))
(defvar-keymap minibuffer-local-completion-map
:doc "Local keymap for minibuffer input with completion."
:parent minibuffer-local-map
@ -3224,6 +3249,7 @@ The completion method is determined by `completion-at-point-functions'."
;; another binding for it.
;; "M-TAB" #'minibuffer-force-complete
"SPC" #'minibuffer-complete-word
"RET" #'minibuffer-completion-exit
"?" #'minibuffer-completion-help
"<prior>" #'switch-to-completions
"M-v" #'switch-to-completions
@ -3332,19 +3358,29 @@ and `RET' accepts the input typed into the minibuffer."
(defvar minibuffer-visible-completions--always-bind nil
"If non-nil, force the `minibuffer-visible-completions' bindings on.")
(defun minibuffer--completions-visible ()
"Return the window where the current *Completions* buffer is visible, if any."
(when-let* ((window (get-buffer-window "*Completions*" 0)))
(when (eq (buffer-local-value 'completion-reference-buffer
(window-buffer window))
;; If there's no active minibuffer, we call
;; `window-buffer' on nil, assuming that completion is
;; happening in the selected window.
(window-buffer (active-minibuffer-window)))
window)))
(defun completion--selected-candidate ()
"Return the selected completion candidate if any."
(when-let* ((window (minibuffer--completions-visible)))
(with-current-buffer (window-buffer window)
(get-text-property (point) 'completion--string))))
(defun minibuffer-visible-completions--filter (cmd)
"Return CMD if `minibuffer-visible-completions' bindings should be active."
(if minibuffer-visible-completions--always-bind
cmd
(when-let* ((window (get-buffer-window "*Completions*" 0)))
(when (and (eq (buffer-local-value 'completion-reference-buffer
(window-buffer window))
(window-buffer (active-minibuffer-window)))
(if (eq cmd #'minibuffer-choose-completion-or-exit)
(with-current-buffer (window-buffer window)
(get-text-property (point) 'completion--string))
t))
cmd))))
(when-let* ((window (minibuffer--completions-visible)))
cmd)))
(defun minibuffer-visible-completions--bind (binding)
"Use BINDING when completions are visible.
@ -3360,7 +3396,6 @@ displaying the *Completions* buffer exists."
"<right>" (minibuffer-visible-completions--bind #'minibuffer-next-completion)
"<up>" (minibuffer-visible-completions--bind #'minibuffer-previous-line-completion)
"<down>" (minibuffer-visible-completions--bind #'minibuffer-next-line-completion)
"RET" (minibuffer-visible-completions--bind #'minibuffer-choose-completion-or-exit)
"C-g" (minibuffer-visible-completions--bind #'minibuffer-hide-completions))
;;; Completion tables.
@ -3487,7 +3522,11 @@ same as `substitute-in-file-name'."
(unless (memq pred '(nil file-exists-p))
(let ((comp ())
(pred
(if (eq pred 'file-directory-p)
(if (and (eq pred 'file-directory-p)
;; File-name-handlers don't necessarily follow
;; that convention (bug#79236).
(not (find-file-name-handler
realdir 'file-name-all-completions)))
;; Brute-force speed up for directory checking:
;; Discard strings which don't end in a slash.
(lambda (s)
@ -4117,7 +4156,7 @@ style."
"Split STRING into a pattern.
A pattern is a list where each element is either a string
or a symbol, see `completion-pcm--merge-completions'."
(if (and point (< point (length string)))
(if (and point (<= point (length string)))
(let ((prefix (substring string 0 point))
(suffix (substring string point)))
(append (completion-pcm--string->pattern prefix)
@ -4178,12 +4217,6 @@ or a symbol, see `completion-pcm--merge-completions'."
(pcase p
(`(,(or 'any 'any-delim) ,(or 'any 'point) . ,_)
(setq p (cdr p)))
;; This is not just a performance improvement: it turns a
;; terminating `point' into an implicit `any', which affects
;; the final position of point (because `point' gets turned
;; into a non-greedy ".*?" regexp whereas we need it to be
;; greedy when it's at the end, see bug#38458).
(`(point) (setq p nil)) ;Implicit terminating `any'.
(_ (push (pop p) n))))
(nreverse n)))
@ -4634,10 +4667,19 @@ the same set of elements."
;; different capitalizations in different parts.
;; In practice, it doesn't seem to make any difference.
(setq ccs (nreverse ccs))
;; FIXED is a prefix of all of COMPS. Try to grow that prefix.
(let* ((prefix (try-completion fixed comps))
(unique (or (and (eq prefix t) (setq prefix fixed))
(and (stringp prefix)
(eq t (try-completion prefix comps))))))
;; If PREFIX is equal to all of COMPS,
;; then PREFIX is a unique completion.
(seq-every-p
;; PREFIX is still a prefix of all of
;; COMPS, so if COMP is the same length,
;; they're equal.
(lambda (comp)
(= (length prefix) (length comp)))
comps)))))
;; If there's only one completion, `elem' is not useful
;; any more: it can only match the empty string.
;; FIXME: in some cases, it may be necessary to turn an
@ -5113,22 +5155,22 @@ the minibuffer was activated, and execute the forms."
When used in a minibuffer window, select the window with completions,
and execute the forms."
(declare (indent 0) (debug t))
`(let ((window (or (get-buffer-window "*Completions*" 0)
`(let ((window (or (minibuffer--completions-visible)
;; Make sure we have a completions window.
(progn (minibuffer-completion-help)
(get-buffer-window "*Completions*" 0)))))
(minibuffer--completions-visible)))))
(when window
(with-selected-window window
(completion--lazy-insert-strings)
,@body))))
(defcustom minibuffer-completion-auto-choose t
(defcustom minibuffer-completion-auto-choose nil
"Non-nil means to automatically insert completions to the minibuffer.
When non-nil, then `minibuffer-next-completion' and
`minibuffer-previous-completion' will insert the completion
selected by these commands to the minibuffer."
:type 'boolean
:version "29.1")
:version "31.1")
(defun minibuffer-next-completion (&optional n vertical)
"Move to the next item in its completions window from the minibuffer.
@ -5211,7 +5253,7 @@ inputs for the prompting command, instead of the default completion table."
(user-error "No history available"))))
;; FIXME: Can we make it work for CRM?
(let ((completion-in-region-mode-predicate
(lambda () (get-buffer-window "*Completions*" 0))))
(lambda () (minibuffer--completions-visible))))
(completion-in-region
(minibuffer--completion-prompt-end) (point-max)
(completion-table-with-metadata
@ -5229,7 +5271,7 @@ provided by the prompting command, instead of the completion table."
minibuffer-default (funcall minibuffer-default-add-function)))
(let ((completions (ensure-list minibuffer-default))
(completion-in-region-mode-predicate
(lambda () (get-buffer-window "*Completions*" 0))))
(lambda () (minibuffer--completions-visible))))
(completion-in-region
(minibuffer--completion-prompt-end) (point-max)
(completion-table-with-metadata

View file

@ -1356,7 +1356,6 @@ This consults the entries in `eww-readable-urls' (which see)."
"<mouse-9>" #'eww-forward-url
:menu '("Eww"
["Exit" quit-window t]
["Close browser" quit-window t]
["Reload" eww-reload t]
["Follow URL in new buffer" eww-open-in-new-buffer]

View file

@ -647,7 +647,8 @@ your laptop to different networks frequently."
"Return a list of (user host) tuples allowed to access for METHOD.
This function is added always in `tramp-get-completion-function'
for all methods. Resulting data are derived from connection history."
(mapcar
(delete-dups
(tramp-compat-seq-keep
(lambda (key)
(let ((tramp-verbose 0))
(and (tramp-file-name-p key)
@ -657,7 +658,7 @@ for all methods. Resulting data are derived from connection history."
key 'tramp-completion-use-cache tramp-completion-use-cache)
(list (tramp-file-name-user key)
(tramp-file-name-host key)))))
(hash-table-keys tramp-cache-data)))
(hash-table-keys tramp-cache-data))))
;; When "emacs -Q" has been called, both variables are nil. We do not
;; load the persistency file then, in order to have a clean test environment.

View file

@ -29,7 +29,7 @@
;;; Code:
(require 'tramp-loaddefs)
(require 'tramp-loaddefs nil t) ; guard against load during autoload gen
(require 'ansi-color)
(require 'auth-source)
(require 'format-spec)
@ -251,7 +251,7 @@ value is the default binding of the variable."
;;
;; * Use `ensure-list'.
;;
;; * Starting with Emacs 29.1, use `buffer-match-p'.
;; * Starting with Emacs 29.1, use `buffer-match-p' and `match-buffers'.
;;
;; * Starting with Emacs 29.1, use `string-split'.
;;

View file

@ -2557,7 +2557,7 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
(shell-command-to-string (format "avahi-browse -trkp %s" service))
(rx (+ (any "\r\n"))) 'omit (rx bol "+;" (* nonl) eol)))))
(delete-dups
(mapcar
(tramp-compat-seq-keep
(lambda (x)
(ignore-errors
(let* ((list (split-string x ";"))

View file

@ -94,7 +94,7 @@ This increases `tramp-verbose' to 6 if necessary."
:type 'boolean
:link '(info-link :tag "Tramp manual" "(tramp) Traces and Profiles"))
(defcustom tramp-debug-buffer-limit (* 3 1024 1024 1024) ;3GB
(defcustom tramp-debug-buffer-limit (* 100 1024 1024) ;100MB
"The upper limit of a Tramp debug buffer.
If the size of a debug buffer exceeds this limit, a warning is raised.
Set it to 0 if there is no limit."

View file

@ -5154,17 +5154,41 @@ Goes through the list `tramp-inline-compress-commands'."
;;;###tramp-autoload
(defun tramp-timeout-session (vec)
"Close the connection VEC after a session timeout.
If there is just some editing, retry it after 5 seconds."
(if (and (tramp-get-connection-property
If there is just some editing, retry it after 5 seconds.
If there is a modified buffer, retry it after 60 seconds."
(cond
;; Tramp is locked. Try it, again.
((and (tramp-get-connection-property
(tramp-get-connection-process vec) "locked")
(tramp-file-name-equal-p vec (car tramp-current-connection)))
(progn
(tramp-message
vec 5 "Cannot timeout session, trying it again in %s seconds." 5)
(run-at-time 5 nil #'tramp-timeout-session vec))
;; There's a modified buffer. Try it, again.
((seq-some
(lambda (buf)
(and-let* (((or (buffer-modified-p buf)
(with-current-buffer buf
;; We don't know whether autorevert.el has
;; been loaded alreaddy.
(tramp-compat-funcall 'auto-revert-active-p))))
(bfn (buffer-file-name buf))
(v (tramp-ensure-dissected-file-name bfn))
((tramp-file-name-equal-p vec v)))))
(tramp-list-remote-buffers))
(tramp-message
vec 5
(concat
"Cannot timeout session (modified buffer), "
"trying it again in %s seconds.")
(tramp-get-method-parameter vec 'tramp-session-timeout))
(run-at-time
(tramp-get-method-parameter vec 'tramp-session-timeout) nil
#'tramp-timeout-session vec))
;; Do it.
(t (tramp-message
vec 3 "Timeout session %s" (tramp-make-tramp-file-name vec 'noloc))
(tramp-cleanup-connection vec 'keep-debug nil 'keep-processes)))
(tramp-cleanup-connection vec 'keep-debug nil 'keep-processes))))
(defun tramp-maybe-open-connection (vec)
"Maybe open a connection VEC.

View file

@ -103,8 +103,15 @@
(put 'tramp--startup-hook 'tramp-suppress-trace t)
;; TODO: Once (autoload-macro expand) is available in all supported
;; Emacs versions (Emacs 31.1+), this can be eliminated:
;; Backward compatibility for autoload-macro declare form.
(unless (assq 'autoload-macro macro-declarations-alist)
(push '(autoload-macro ignore) macro-declarations-alist))
(defmacro tramp--with-startup (&rest body)
"Schedule BODY to be executed at the end of tramp.el."
(declare (autoload-macro expand))
`(add-hook 'tramp--startup-hook (lambda () ,@body)))
(eval-and-compile
@ -1040,7 +1047,7 @@ Used in `tramp-make-tramp-file-name'.")
"Regexp matching delimiter between method and user or host names.
Derived from `tramp-postfix-method-format'.")
(defconst tramp-user-regexp (rx (+ (not (any "/:|" blank))))
(defconst tramp-user-regexp (rx (+ (not (any "/:|[]" blank))))
"Regexp matching user names.")
(defconst tramp-prefix-domain-format "%"
@ -1994,10 +2001,21 @@ necessary only. This function will be used in file name completion."
(concat user tramp-postfix-user-format))
(unless (tramp-string-empty-or-nil-p host)
(concat
(if (string-match-p tramp-ipv6-regexp host)
(concat
tramp-prefix-ipv6-format host tramp-postfix-ipv6-format)
(cond
(;; ipv6#port -> [ipv6]#port
(string-match
(rx (group (regexp tramp-ipv6-regexp))
(group (regexp tramp-prefix-port-regexp)
(regexp tramp-port-regexp)))
host)
(concat
tramp-prefix-ipv6-format (match-string 1 host)
tramp-postfix-ipv6-format (match-string 2 host)))
(;; ipv6 -> [ipv6]
(string-match-p tramp-ipv6-regexp host)
(concat
tramp-prefix-ipv6-format host tramp-postfix-ipv6-format))
(t host))
tramp-postfix-host-format))
localname))
@ -2903,31 +2921,6 @@ not in completion mode."
;; We need special handling only when a method is needed. Then we
;; regard all files "/method:" or "/[method/" as existent, if
;; "method" is a valid Tramp method.
(or (string-equal filename "/")
(and ;; Is it a valid method?
(not (string-empty-p tramp-postfix-method-format))
(string-match
(rx
(regexp tramp-prefix-regexp)
(* (regexp tramp-remote-file-name-spec-regexp)
(regexp tramp-postfix-hop-regexp))
(group-n 9 (regexp tramp-method-regexp))
(? (regexp tramp-postfix-method-regexp))
eos)
filename)
(assoc (match-string 9 filename) tramp-methods)
t)
(tramp-run-real-handler #'file-directory-p (list filename))))
(defun tramp-completion-handle-file-exists-p (filename)
"Like `file-exists-p' for partial Tramp files."
;; We need special handling only when a method is needed. Then we
;; regard all files "/method:" or "/[method/" as existent, if
;; "method" is a valid Tramp method. And we regard all files
;; "/method:user@", "/user@" or "/[method/user@" as existent, if
;; "user@" is a valid file name completion. Host completion is
;; performed in the respective backend operation.
(or (and (cond
;; Completion styles like `flex' and `substring' check for
;; the file name "/". This does exist.
@ -2940,28 +2933,37 @@ not in completion mode."
(* (regexp tramp-remote-file-name-spec-regexp)
(regexp tramp-postfix-hop-regexp))
(group-n 9 (regexp tramp-method-regexp))
(? (regexp tramp-postfix-method-regexp))
eos)
(| (regexp tramp-postfix-method-regexp) eos))
filename))
(assoc (match-string 9 filename) tramp-methods))
;; Is it a valid user?
((string-match
;; Is it a completion file name?
((string-match-p tramp-completion-file-name-regexp filename)))
t)
(tramp-run-real-handler #'file-directory-p (list filename))))
(defun tramp-completion-handle-file-exists-p (filename)
"Like `file-exists-p' for partial Tramp files."
;; We need special handling only when a method is needed. Then we
;; regard all files "/method:" or "/[method/" as existent, if
;; "method" is a valid Tramp method.
(or (and (cond
;; Completion styles like `flex' and `substring' check for
;; the file name "/". This does exist.
((string-equal filename "/"))
;; Is it a valid method?
((and (not (string-empty-p tramp-postfix-method-format))
(string-match
(rx
(regexp tramp-prefix-regexp)
(* (regexp tramp-remote-file-name-spec-regexp)
(regexp tramp-postfix-hop-regexp))
(group-n 10
(regexp tramp-method-regexp)
(regexp tramp-postfix-method-regexp))
(group-n 11
(regexp tramp-user-regexp)
(regexp tramp-postfix-user-regexp))
eos)
filename)
(member
(match-string 11 filename)
(file-name-all-completions
"" (concat tramp-prefix-format (match-string 10 filename))))))
(group-n 9 (regexp tramp-method-regexp))
(| (regexp tramp-postfix-method-regexp) eos))
filename))
(assoc (match-string 9 filename) tramp-methods))
;; Is it a completion file name?
((string-match-p tramp-completion-file-name-regexp filename)))
t)
(tramp-run-real-handler #'file-exists-p (list filename))))
@ -3076,15 +3078,14 @@ BODY is the backend specific code."
;; Method, host name and user name completion for a file.
(defun tramp-completion-handle-file-name-completion
(filename directory &optional predicate)
"Like `file-name-completion' for partial Tramp files."
(filename directory &optional _predicate)
"Like `file-name-completion' for partial Tramp files.
It ignores PREDICATE, because there's no meaningful result."
;; Suppress eager completion on not connected hosts.
(let ((non-essential t))
(try-completion
filename
(mapcar #'list (file-name-all-completions filename directory))
(when (and predicate (tramp-connectable-p directory))
(lambda (x) (funcall predicate (expand-file-name (car x) directory)))))))
(mapcar #'list (file-name-all-completions filename directory)))))
;; I misuse a little bit the `tramp-file-name' structure in order to
;; handle completion possibilities for partial methods / user names /
@ -3106,7 +3107,15 @@ BODY is the backend specific code."
(defun tramp-completion-dissect-file-name (name)
"Return a list of `tramp-file-name' structures for NAME.
They are collected by `tramp-completion-dissect-file-name1'."
(let (;; "/method" "/[method"
;; We don't need a special handling for "user%domain", because "%"
;; is also hit by `tramp-user-regexp'. "host#port" is normalized
;; for IPv6 hosts.
(let ((internal-name
(replace-regexp-in-string
(rx (regexp tramp-postfix-ipv6-regexp)
(regexp tramp-prefix-port-regexp))
tramp-prefix-port-format name))
;; "/method" "/[method"
(tramp-completion-file-name-structure1
(list
(rx
@ -3163,16 +3172,75 @@ They are collected by `tramp-completion-dissect-file-name1'."
(regexp tramp-postfix-user-regexp)
(regexp tramp-prefix-ipv6-regexp)
(group (? (regexp tramp-ipv6-regexp))) eol)
1 2 3 nil))
;; "/method:host#port" "/[method/host#port"
(tramp-completion-file-name-structure7
(list
(rx
(regexp tramp-prefix-regexp)
(group (regexp tramp-method-regexp))
(regexp tramp-postfix-method-regexp)
(group (regexp tramp-host-regexp)
(regexp tramp-prefix-port-regexp)
(? (regexp tramp-port-regexp)))
eol)
1 nil 2 nil))
;; "/method:[ipv6]#port" "/[method/ipv6#port"
(tramp-completion-file-name-structure8
(list
(rx
(regexp tramp-prefix-regexp)
(group (regexp tramp-method-regexp))
(regexp tramp-postfix-method-regexp)
(regexp tramp-prefix-ipv6-regexp)
(group (regexp tramp-ipv6-regexp)
(regexp tramp-prefix-port-regexp)
(? (regexp tramp-port-regexp)))
eol)
1 nil 2 nil))
;; "/method:user@host#port" "/[method/user@host#port"
(tramp-completion-file-name-structure9
(list
(rx
(regexp tramp-prefix-regexp)
(group (regexp tramp-method-regexp))
(regexp tramp-postfix-method-regexp)
(group (regexp tramp-user-regexp))
(regexp tramp-postfix-user-regexp)
(group (regexp tramp-host-regexp)
(regexp tramp-prefix-port-regexp)
(? (regexp tramp-port-regexp)))
eol)
1 2 3 nil))
;; "/method:user@[ipv6]#port" "/[method/user@ipv6#port"
(tramp-completion-file-name-structure10
(list
(rx
(regexp tramp-prefix-regexp)
(group (regexp tramp-method-regexp))
(regexp tramp-postfix-method-regexp)
(group (regexp tramp-user-regexp))
(regexp tramp-postfix-user-regexp)
(regexp tramp-prefix-ipv6-regexp)
(group (regexp tramp-ipv6-regexp)
(regexp tramp-prefix-port-regexp)
(? (regexp tramp-port-regexp)))
eol)
1 2 3 nil)))
(tramp-compat-seq-keep
(lambda (structure) (tramp-completion-dissect-file-name1 structure name))
(lambda (structure)
(tramp-completion-dissect-file-name1 structure internal-name))
(list
tramp-completion-file-name-structure1
tramp-completion-file-name-structure2
tramp-completion-file-name-structure3
tramp-completion-file-name-structure4
tramp-completion-file-name-structure5
tramp-completion-file-name-structure6))))
tramp-completion-file-name-structure6
tramp-completion-file-name-structure7
tramp-completion-file-name-structure8
tramp-completion-file-name-structure9
tramp-completion-file-name-structure10))))
(defun tramp-completion-dissect-file-name1 (structure name)
"Return a `tramp-file-name' structure for NAME matching STRUCTURE.
@ -3193,7 +3261,7 @@ remote host and localname (filename on remote host)."
(defun tramp-get-completion-methods (partial-method &optional multi-hop)
"Return all method completions for PARTIAL-METHOD.
If MULTI-HOP is non-nil, return only multi-hop capable methods."
(mapcar
(tramp-compat-seq-keep
(lambda (method)
(and method (string-prefix-p (or partial-method "") method)
(or (not multi-hop)
@ -3274,7 +3342,10 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST."
"Return a list of (user host) tuples allowed to access for METHOD.
This function is added always in `tramp-get-completion-function'
for all methods. Resulting data are derived from default settings."
`((,(tramp-find-user method nil nil) ,(tramp-find-host method nil nil))))
(let ((user (tramp-find-user method nil nil))
(host (tramp-find-host method nil nil)))
(when (or user host)
`((,user ,host)))))
;;;###tramp-autoload
(defcustom tramp-completion-multi-hop-methods nil
@ -3296,10 +3367,11 @@ as for \"~/.authinfo.gpg\"."
This function is added always in `tramp-get-completion-function'
for all methods. Resulting data are derived from default settings."
(and tramp-completion-use-auth-sources
(mapcar
(delete-dups
(tramp-compat-seq-keep
(lambda (x) `(,(plist-get x :user) ,(plist-get x :host)))
(auth-source-search
:port method :require '(:port) :max most-positive-fixnum))))
:port method :require '(:port) :max most-positive-fixnum)))))
;; Generic function.
(defun tramp-parse-group (regexp match-level skip-chars)
@ -3324,7 +3396,8 @@ User is always nil."
(with-temp-buffer
(insert-file-contents-literally filename)
(goto-char (point-min))
(cl-loop while (not (eobp)) collect (funcall function))))))
(delete-dups (delq nil
(cl-loop while (not (eobp)) collect (funcall function))))))))
(defun tramp-parse-rhosts (filename)
"Return a list of (user host) tuples allowed to access.
@ -3352,7 +3425,9 @@ User is always nil."
(defun tramp-parse-shosts-group ()
"Return a (user host) tuple allowed to access.
User is always nil."
(tramp-parse-group (rx bol (group (regexp tramp-host-regexp))) 1 ","))
(tramp-parse-group
(rx bol (group (| (regexp tramp-ipv6-regexp) (regexp tramp-host-regexp))))
1 ","))
(defun tramp-parse-sconfig (filename)
"Return a list of (user host) tuples allowed to access.
@ -3458,11 +3533,12 @@ Host is always \"localhost\"."
(defun tramp-parse-netrc (filename)
"Return a list of (user host) tuples allowed to access.
User may be nil."
(mapcar
(delete-dups
(tramp-compat-seq-keep
(lambda (item)
(and (assoc "machine" item)
`(,(cdr (assoc "login" item)) ,(cdr (assoc "machine" item)))))
(tramp-compat-auth-source-netrc-parse-all filename)))
(tramp-compat-auth-source-netrc-parse-all filename))))
(defun tramp-parse-putty (registry-or-dirname)
"Return a list of (user host) tuples allowed to access.
@ -4263,10 +4339,18 @@ Let-bind it when necessary.")
(defun tramp-handle-file-directory-p (filename)
"Like `file-directory-p' for Tramp files."
;; `file-truename' could raise an error, for example due to a cyclic
;; symlink.
(or
;; `file-directory-p' is used as predicate for file name
;; completion. Sometimes, when a connection is not established
;; yet, it is desirable to return t immediately for "/method:foo:"
;; or "/method:foo:/". It can be expected that this is always a
;; directory.
(tramp-string-empty-or-nil-p (tramp-file-local-name filename))
(string-equal (tramp-file-local-name filename) "/")
;; `file-truename' could raise an error, for example due to a
;; cyclic symlink.
(ignore-errors
(eq (file-attribute-type (file-attributes (file-truename filename))) t)))
(eq (file-attribute-type (file-attributes (file-truename filename))) t))))
(defun tramp-handle-file-equal-p (filename1 filename2)
"Like `file-equal-p' for Tramp files."

View file

@ -333,7 +333,8 @@ current time."
(start (time-to-days starting))
(now (time-to-days current))
(end (time-to-days ending))
(graph (make-string (1+ (- end start)) ?\s))
(graph (make-vector (1+ (- end start)) ?\s))
(props nil)
(index 0)
last-done-date)
(while (and done-dates (< (car done-dates) start))
@ -411,17 +412,20 @@ current time."
(not (eq face 'org-habit-overdue-face))
(not markedp))
(setq face (cdr faces)))
(put-text-property index (1+ index) 'face face graph)
(put-text-property index (1+ index)
(push (list index (1+ index) 'face face) props)
(push (list index (1+ index)
'help-echo
(concat (format-time-string
(org-time-stamp-format)
(time-add starting (days-to-time (- start (time-to-days starting)))))
(if donep " DONE" ""))
graph))
(if donep " DONE" "")))
props))
(setq start (1+ start)
index (1+ index)))
graph))
(let ((graph-str (concat graph)))
(dolist (p props)
(put-text-property (nth 0 p) (nth 1 p) (nth 2 p) (nth 3 p) graph-str))
graph-str)))
(defun org-habit-insert-consistency-graphs (&optional line)
"Insert consistency graph for any habitual tasks."

View file

@ -607,7 +607,9 @@ directory."
(set-visited-file-name file)
(set-buffer-modified-p nil)
(when (string-match "\\.tar\\'" file) (tar-mode)))
(package-install-from-buffer)))
(unwind-protect
(package-install-from-buffer)
(fundamental-mode))))
@ -872,6 +874,8 @@ The return result is a `package-desc'."
This uses `tar-untar-buffer' from Tar mode. All files should
untar into a directory named DIR; otherwise, signal an error."
(tar-mode)
(unwind-protect
(progn
;; Make sure everything extracts into DIR.
(let ((regexp (concat "\\`" (regexp-quote (expand-file-name dir)) "/"))
(case-fold-search (file-name-case-insensitive-p dir)))
@ -882,8 +886,10 @@ untar into a directory named DIR; otherwise, signal an error."
;; directories with a trailing slash (Bug#13136).
(and (string-equal (expand-file-name dir) name)
(eq (tar-header-link-type tar-data) 5))
(error "Package does not untar cleanly into directory %s/" dir)))))
(error "Package does not untar cleanly into directory %s/"
dir)))))
(tar-untar-buffer))
(fundamental-mode)))
(declare-function dired-get-marked-files "dired")

View file

@ -1150,7 +1150,7 @@ Typing SPC flushes the help buffer."
((or (eq event 'tab)
;; Needed on a terminal
(eq event 9))
(let ((win (or (get-buffer-window "*Completions*" 0)
(let ((win (or (minibuffer--completions-visible)
(display-buffer "*Completions*"
'not-this-window))))
(with-selected-window win

View file

@ -589,6 +589,7 @@ reads the sentence before point, and prints the Doctor's answer."
(doctor-put-meaning pc 'mach)
(doctor-put-meaning gnu 'mach)
(doctor-put-meaning linux 'mach)
(doctor-put-meaning llm 'mach)
(doctor-put-meaning bitching 'foul)
(doctor-put-meaning shit 'foul)
(doctor-put-meaning bastard 'foul)

View file

@ -433,8 +433,9 @@ run a specific program. The program must be a member of
(defsubst zone-replace-char (count del-count char-as-string new-value)
(delete-char (or del-count (- count)))
(aset char-as-string 0 new-value)
(dotimes (_ count) (insert char-as-string)))
(let ((s (apply #'propertize (string new-value)
(text-properties-at 0 char-as-string))))
(dotimes (_ count) (insert s))))
(defsubst zone-park/sit-for (pos seconds)
(let ((p (point)))

View file

@ -393,7 +393,12 @@ applicable."
(ignore-errors
(vc-call-backend backend 'repository-url
file-or-dir remote)))
'("upstream" nil))))
;; Try likely names for the remote which
;; probably hosts the bug tracker. The nil
;; value refers to the default remote name
;; of the concrete VCS which is "origin"
;; for Git or "default" for mercurial.
'("upstream" "origin" nil))))
(seq-some (lambda (config)
(apply #'bug-reference-maybe-setup-from-vc url config))
(append bug-reference-setup-from-vc-alist

View file

@ -1675,6 +1675,7 @@ the code is C or C++, and based on that chooses whether to enable
;;;###autoload
(when (treesit-available-p)
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(c-mode . c-ts-mode))
(add-to-list 'treesit-major-mode-remap-alist

View file

@ -257,7 +257,10 @@ Return nil if there is no name or if NODE is not a defun node."
;;;###autoload
(defun cmake-ts-mode-maybe ()
"Enable `cmake-ts-mode' when its grammar is available."
"Enable `cmake-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'cmake)
(eq treesit-enabled-modes t)
(memq 'cmake-ts-mode treesit-enabled-modes))
@ -269,6 +272,7 @@ Return nil if there is no name or if NODE is not a defun node."
(add-to-list 'auto-mode-alist
'("\\(?:CMakeLists\\.txt\\|\\.cmake\\)\\'" . cmake-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(cmake-mode . cmake-ts-mode)))

View file

@ -2726,6 +2726,7 @@ PARSE-DATA is used to save status between calls in a loop."
(if (listp indent) (setq indent (car indent)))
(cond ((and (looking-at (rx (sequence (eval cperl--label-rx)
(not (in ":")))))
(null (get-text-property (point) 'syntax-type))
(not (looking-at (rx (eval cperl--false-label-rx)))))
(and (> indent 0)
(setq indent (max cperl-min-label-indent
@ -2766,7 +2767,7 @@ PARSE-DATA is used to save status between calls in a loop."
START is a good place to start parsing, or equal to
PARSE-START if preset.
STATE is what is returned by `parse-partial-sexp'.
DEPTH is true is we are immediately after end of block
DEPTH is true if we are immediately after end of block
which contains START.
PRESTART is the position basing on which START was found.
START-STATE should be a good guess for the start of a function."
@ -2775,7 +2776,7 @@ START-STATE should be a good guess for the start of a function."
(if (and parse-start
(<= parse-start start-point))
(goto-char parse-start)
(beginning-of-defun)
(beginning-of-defun-raw)
(when (cperl-declaration-header-p (point))
(goto-char (cperl-beginning-of-property (point) 'syntax-type))
(beginning-of-line))
@ -5064,7 +5065,7 @@ recursive calls in starting lines of here-documents."
(cperl-postpone-fontification
(- (point) 2) (- (point) 1) 'face
(if (memq qtag
(append "ghijkmoqvFHIJKMORTVY" nil))
(append "gijkmoqFIJKMOTY" nil))
'font-lock-warning-face
my-cperl-REx-0length-face))
(if (and (eq (char-after b) qtag)
@ -6374,9 +6375,7 @@ functions (which they are not). Inherits from `default'.")
(sequence (eval cperl--signature-rx)
(eval cperl--ws*-rx))
;; ... or the start of a "sloppy" signature
(sequence (eval cperl--sloppy-signature-rx)
;; arbitrarily continue "a few lines"
(repeat 0 200 (not (in "{"))))
(sequence (eval cperl--sloppy-signature-rx))
;; make sure we have a reasonably
;; short match for an incomplete sub
(not (in ";{("))
@ -6392,7 +6391,13 @@ functions (which they are not). Inherits from `default'.")
(group (eval cperl--basic-variable-rx))))
(progn
(goto-char (match-beginning 2)) ; pre-match: Back to sig
(match-end 2))
;; While typing, forward-sexp might fail with a scan error.
;; If so, stop looking for declarations at (match-end 2)
(condition-case nil
(save-excursion
(forward-sexp)
(point))
(error (match-end 2))))
nil
(1 font-lock-variable-name-face)))
;; -------- flow control

View file

@ -1225,6 +1225,7 @@ Key bindings:
;;;###autoload
(when (treesit-available-p)
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(csharp-mode . csharp-ts-mode)))

View file

@ -204,7 +204,10 @@ Return nil if there is no name or if NODE is not a stage node."
;;;###autoload
(defun dockerfile-ts-mode-maybe ()
"Enable `dockerfile-ts-mode' when its grammar is available."
"Enable `dockerfile-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'dockerfile)
(eq treesit-enabled-modes t)
(memq 'dockerfile-ts-mode treesit-enabled-modes))
@ -218,6 +221,7 @@ Return nil if there is no name or if NODE is not a stage node."
'("\\(?:Dockerfile\\(?:\\..*\\)?\\|\\.[Dd]ockerfile\\)\\'"
. dockerfile-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(dockerfile-mode . dockerfile-ts-mode)))

View file

@ -675,6 +675,7 @@ This can be useful when using docker to run a language server.")
(defconst eglot--uri-path-allowed-chars
(let ((vec (copy-sequence url-path-allowed-chars)))
(aset vec ?: nil) ;; see github#639
(aset vec ?% nil) ;; see bug#78984
vec)
"Like `url-path-allowed-chars' but more restrictive.")
@ -2008,12 +2009,6 @@ If optional MARKER, return a marker instead"
;;; More helpers
(defconst eglot--uri-path-allowed-chars
(let ((vec (copy-sequence url-path-allowed-chars)))
(aset vec ?: nil) ;; see github#639
vec)
"Like `url-path-allowed-chars' but more restrictive.")
(defun eglot--snippet-expansion-fn ()
"Compute a function to expand snippets.
Doubles as an indicator of snippet support."
@ -2242,7 +2237,7 @@ Use `eglot-managed-p' to determine if current buffer is managed.")
(when (and eglot-autoshutdown
(null (eglot--managed-buffers server))
;; Don't shutdown if up again soon.
(not revert-buffer-in-progress-p))
(with-no-warnings (not revert-buffer-in-progress-p)))
(eglot-shutdown server)))))))
(defun eglot--managed-mode-off ()
@ -3723,7 +3718,7 @@ for which LSP on-type-formatting should be requested."
(let ((case-fold-search nil))
(and (search-forward parlabel (line-end-position) t)
(list (match-beginning 0) (match-end 0))))
(mapcar #'1+ (append parlabel nil)))))
(list (aref parlabel 0) (aref parlabel 1)))))
(if (and beg end)
(add-face-text-property
beg end

View file

@ -2281,6 +2281,38 @@ directory of the buffer being compiled, and nothing else.")
(defvar bytecomp--inhibit-lexical-cookie-warning)
(defcustom elisp-flymake-byte-compile-executable nil
"The Emacs executable to use for Flymake byte compilation.
If non-nil, this should be an absolute or relative file name of an Emacs
executable to use for byte compilation by Flymake. If it's a relative
file name, it should be relative to the root directory of the project
containing the file being compiled, as determined by `project-current'.
If nil, or if the file named by this does not exist, Flymake will
use the same executable as the running Emacs, as specified by the
variables `invocation-name' and `invocation-directory'."
:type 'file
:group 'lisp
:version "31.1")
(declare-function project-root "project" (project))
(defun elisp-flymake-byte-compile--executable ()
"Return absolute file name of the Emacs executable for flymake byte-compilation."
(let ((filename
(cond
((file-name-absolute-p elisp-flymake-byte-compile-executable)
elisp-flymake-byte-compile-executable)
((stringp elisp-flymake-byte-compile-executable)
(when-let* ((pr (project-current)))
(file-name-concat (project-root pr)
elisp-flymake-byte-compile-executable))))))
(if (file-executable-p filename)
filename
(when elisp-flymake-byte-compile-executable
(message "No such elisp-flymake-byte-compile-executable %s" filename))
(expand-file-name invocation-name invocation-directory))))
;;;###autoload
(defun elisp-flymake-byte-compile (report-fn &rest _args)
"A Flymake backend for elisp byte compilation.
@ -2316,7 +2348,7 @@ current buffer state and calls REPORT-FN when done."
(make-process
:name "elisp-flymake-byte-compile"
:buffer output-buffer
:command `(,(expand-file-name invocation-name invocation-directory)
:command `(,(elisp-flymake-byte-compile--executable)
"-Q"
"--batch"
;; "--eval" "(setq load-prefer-newer t)" ; for testing

View file

@ -808,7 +808,10 @@ Return nil if NODE is not a defun node or doesn't have a name."
;;;###autoload
(defun elixir-ts-mode-maybe ()
"Enable `elixir-ts-mode' when its grammar is available."
"Enable `elixir-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'elixir)
(eq treesit-enabled-modes t)
(memq 'elixir-ts-mode treesit-enabled-modes))
@ -822,6 +825,7 @@ Return nil if NODE is not a defun node or doesn't have a name."
(add-to-list 'auto-mode-alist '("\\.exs\\'" . elixir-ts-mode-maybe))
(add-to-list 'auto-mode-alist '("mix\\.lock" . elixir-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(elixir-mode . elixir-ts-mode)))

View file

@ -195,8 +195,6 @@ margins).
Difference between fringes and margin is that fringes support displaying
bitmaps on graphical displays and margins display text in a blank area
from current buffer that works in both graphical and text displays.
Thus, even when `fringes' is selected, margins will still be used on
text displays and also when fringes are disabled.
See Info node `Fringes' and Info node `(elisp)Display Margins'."
:version "31.1"
@ -1172,6 +1170,13 @@ report applies to that region."
(flymake--state-foreign-diags state))
(clrhash (flymake--state-foreign-diags state)))
(defun flymake--clear-state (state)
(cl-loop for diag in (flymake--state-diags state)
for ov = (flymake--diag-overlay diag)
when ov do (flymake--delete-overlay ov))
(setf (flymake--state-diags state) nil)
(flymake--clear-foreign-diags state))
(defvar-local flymake-mode nil)
(defvar-local flymake--mode-line-counter-cache nil
@ -1189,7 +1194,7 @@ and other buffers."
;;
(cond
(;; If there is a `region' arg, only affect the diagnostics whose
;; overlays are in a certain region. Discard "foreign"
;; overlays are in a certain region. Ignore "foreign"
;; diagnostics.
region
(cl-loop for diag in (flymake--state-diags state)
@ -1202,16 +1207,9 @@ and other buffers."
else collect diag into surviving
finally (setf (flymake--state-diags state)
surviving)))
(;; Else, if this is the first report, zero all lists and delete
;; all associated overlays.
(;; Else, if this is the first report, fully clear this state.
(not (flymake--state-reported-p state))
(cl-loop for diag in (flymake--state-diags state)
for ov = (flymake--diag-overlay diag)
when ov do (flymake--delete-overlay ov))
(setf (flymake--state-diags state) nil)
;; Also clear all overlays for `foreign-diags' in all other
;; buffers.
(flymake--clear-foreign-diags state))
(flymake--clear-state state))
(;; If this is not the first report, do no cleanup.
t))
@ -1415,16 +1413,7 @@ Interactively, with a prefix arg, FORCE is t."
;; See bug#78862
(maphash (lambda (backend state)
(unless (memq backend flymake-diagnostic-functions)
;; Delete all overlays
(dolist (diag (flymake--state-diags state))
(let ((ov (flymake--diag-overlay diag)))
(flymake--delete-overlay ov)))
;; Set the list of diagnostics to nil to
;; avoid trying to delete them again.
;; We keep the state object itself around in
;; case there's still diagnostics in flight,
;; so we don't break things.
(setf (flymake--state-diags state) nil)))
(flymake--clear-state state)))
flymake--state)
(run-hook-wrapped
'flymake-diagnostic-functions
@ -1505,13 +1494,6 @@ special *Flymake log* buffer." :group 'flymake :lighter
(add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t)
(add-hook 'eldoc-documentation-functions 'flymake-eldoc-function t t)
(when (and (eq flymake-indicator-type 'fringes)
(not (cl-case flymake-fringe-indicator-position
(left-fringe (< 0 (nth 0 (window-fringes))))
(right-fringe (< 0 (nth 1 (window-fringes)))))))
;; There are no fringes in the buffer, fallback to margins.
(setq-local flymake-indicator-type 'margins))
;; AutoResize margins.
(flymake--resize-margins)

View file

@ -361,7 +361,10 @@
;;;###autoload
(defun go-ts-mode-maybe ()
"Enable `go-ts-mode' when its grammar is available."
"Enable `go-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'go)
(eq treesit-enabled-modes t)
(memq 'go-ts-mode treesit-enabled-modes))
@ -372,6 +375,7 @@
(when (treesit-available-p)
(add-to-list 'auto-mode-alist '("\\.go\\'" . go-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(go-mode . go-ts-mode)))
@ -635,7 +639,10 @@ what the parent of the node would be if it were a node."
;;;###autoload
(defun go-mod-ts-mode-maybe ()
"Enable `go-mod-ts-mode' when its grammar is available."
"Enable `go-mod-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'gomod)
(eq treesit-enabled-modes t)
(memq 'go-mod-ts-mode treesit-enabled-modes))
@ -646,6 +653,7 @@ what the parent of the node would be if it were a node."
(when (treesit-available-p)
(add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(go-mod-mode . go-mod-ts-mode)))
@ -736,7 +744,10 @@ what the parent of the node would be if it were a node."
;;;###autoload
(defun go-work-ts-mode-maybe ()
"Enable `go-work-ts-mode' when its grammar is available."
"Enable `go-work-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'gowork)
(eq treesit-enabled-modes t)
(memq 'go-work-ts-mode treesit-enabled-modes))
@ -747,6 +758,7 @@ what the parent of the node would be if it were a node."
(when (treesit-available-p)
(add-to-list 'auto-mode-alist '("/go\\.work\\'" . go-work-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(go-work-mode . go-work-ts-mode)))

View file

@ -267,7 +267,10 @@ Return nil if NODE is not a defun node or doesn't have a name."
;;;###autoload
(defun heex-ts-mode-maybe ()
"Enable `heex-ts-mode' when its grammar is available."
"Enable `heex-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'heex)
(eq treesit-enabled-modes t)
(memq 'heex-ts-mode treesit-enabled-modes))
@ -280,6 +283,7 @@ Return nil if NODE is not a defun node or doesn't have a name."
;; with the tree-sitter-heex grammar.
(add-to-list 'auto-mode-alist '("\\.[hl]?eex\\'" . heex-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(heex-mode . heex-ts-mode)))

View file

@ -526,6 +526,7 @@ Return nil if there is no name or if NODE is not a defun node."
;;;###autoload
(when (treesit-available-p)
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(java-mode . java-ts-mode)))

View file

@ -4111,6 +4111,7 @@ See `treesit-thing-settings' for more information.")
;;;###autoload
(when (treesit-available-p)
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(javascript-mode . js-ts-mode)))

View file

@ -183,6 +183,7 @@ Return nil if there is no name or if NODE is not a defun node."
;;;###autoload
(when (treesit-available-p)
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(js-json-mode . json-ts-mode)))

2131
lisp/progmodes/lua-mode.el Normal file

File diff suppressed because it is too large Load diff

View file

@ -168,10 +168,13 @@ values of OVERRIDE."
(let* ((node-start (treesit-node-start node))
(node-end (treesit-node-end node))
(node-text (treesit-node-text node t))
(delimiter-end (+ 2 node-start)))
(delimiter-end (progn
(goto-char node-start)
(while (looking-at-p "-") (forward-char))
(point))))
(when (and (>= node-start start)
(<= delimiter-end end)
(string-match "\\`--" node-text))
(string-match "\\`---*" node-text))
(treesit-fontify-with-override node-start
delimiter-end
'font-lock-comment-delimiter-face
@ -769,20 +772,9 @@ Calls REPORT-FN directly."
(derived-mode-add-parents 'lua-ts-mode '(lua-mode))
;;;###autoload
(defun lua-ts-mode-maybe ()
"Enable `lua-ts-mode' when its grammar is available."
(if (or (treesit-language-available-p 'lua)
(eq treesit-enabled-modes t)
(memq 'lua-ts-mode treesit-enabled-modes))
(lua-ts-mode)
(fundamental-mode)))
;;;###autoload
(when (treesit-available-p)
(add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-ts-mode-maybe))
(add-to-list 'interpreter-mode-alist '("\\<lua\\(?:jit\\)?" . lua-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(lua-mode . lua-ts-mode)))

View file

@ -1924,7 +1924,10 @@ file to use."
;;;###autoload
(defun php-ts-mode-maybe ()
"Enable `php-ts-mode' when its grammar is available."
"Enable `php-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'php)
(eq treesit-enabled-modes t)
(memq 'php-ts-mode treesit-enabled-modes))
@ -1943,6 +1946,7 @@ file to use."
'interpreter-mode-alist
(cons "php\\(?:-?[34578]\\(?:\\.[0-9]+\\)*\\)?" 'php-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(php-mode . php-ts-mode)))

View file

@ -1650,16 +1650,28 @@ general form of conditions."
:group 'project
:package-version '(project . "0.8.2"))
(defcustom project-prune-zombie-projects #'project-prune-zombies-default
"Remove automatically from project list all the projects that were removed.
The value can be a predicate function which takes one argument, and
should return non-nil if the project should be removed.
If set to nil, all the inaccessible projects will not be removed automatically."
:type '(choice (const :tag "Default (remove non-remote projects)"
project-prune-zombies-default)
(const :tag "Remove any project" identity)
(function :tag "Custom function")
(const :tag "Disable auto-deletion" nil))
(defcustom project-prune-zombie-projects
'((prompt . project-prune-zombies-default))
"Remove automatically from project list the projects that were removed.
Each element of this alist must be in the form:
(WHEN . PREDICATE)
where WHEN specifies where the deletion will be performed,
the value can be:
`list-first-read' - delete on the first reading of the list.
`list-write' - delete after saving project list to `project-list-file'.
`prompt' - delete before every prompting.
`interactively' - delete only when `project-forget-zombie-projects'
is called interactively.
PREDICATE must be a function which takes one argument, and should return
non-nil if the project must be removed."
:type 'alist
:options '((list-first-read function)
(list-write function)
(prompt function)
(interactively function))
:version "31.1"
:group 'project)
@ -1668,11 +1680,26 @@ If set to nil, all the inaccessible projects will not be removed automatically."
Return non-nil if PROJECT is not a remote project."
(not (file-remote-p project)))
(defun project--buffers-completion-table (buffers)
(lambda (string pred action)
(cond
((eq action 'metadata)
'(metadata . ((category . project-buffer)
(cycle-sort-function . identity))))
((and (eq action t)
(equal string "")) ;Pcm completion or empty prefix.
(let* ((all (complete-with-action action buffers string pred))
(non-internal (cl-remove-if (lambda (b) (= (aref b 0) ?\s)) all)))
(if (null non-internal)
all
non-internal)))
(t
(complete-with-action action buffers string pred)))))
(defun project--read-project-buffer ()
(let* ((pr (project-current t))
(current-buffer (current-buffer))
(other-buffer (other-buffer current-buffer))
(other-name (buffer-name other-buffer))
(buffers (project-buffers pr))
(predicate
(lambda (buffer)
@ -1681,35 +1708,35 @@ Return non-nil if PROJECT is not a remote project."
(not
(project--buffer-check
buffer project-ignore-buffer-conditions)))))
(buffer
(completion-ignore-case read-buffer-completion-ignore-case)
(buffers-alist
(if (and (fboundp 'uniquify-get-unique-names)
uniquify-buffer-name-style)
;; Forgo the use of `buffer-read-function' (often nil) in
;; favor of uniquifying the buffers better.
(let* ((unique-names
(mapcar
(lambda (name)
(cons name
(get-text-property 0 'uniquify-orig-buffer
(or name ""))))
(uniquify-get-unique-names buffers)))
(other-name (when (funcall predicate (cons other-name other-buffer))
(car (rassoc other-buffer unique-names))))
(result (completing-read
"Switch to buffer: "
(project--completion-table-with-category
unique-names
'buffer)
predicate
nil nil nil
other-name)))
(assoc-default result unique-names #'equal result))
(read-buffer
"Switch to buffer: "
(when (funcall predicate (cons other-name other-buffer))
other-name)
nil
predicate))))
(uniquify-get-unique-names buffers))
(mapcar
(lambda (buf) (cons (buffer-name buf) buf))
buffers)))
(other-name
(when (funcall predicate (cons nil other-buffer))
(car (rassoc other-buffer buffers-alist))))
(prompt
(if (fboundp 'format-prompt)
(format-prompt "Switch to buffer" other-name)
"Switch to buffer: "))
;; Forgo the use of `buffer-read-function' (often nil) in
;; favor of showing shorter buffer names with uniquify.
(result
(completing-read
prompt
(project--buffers-completion-table buffers-alist)
predicate nil nil nil
other-name))
(buffer (assoc-default result buffers-alist #'equal result)))
;; XXX: This check hardcodes the default buffer-belonging relation
;; which `project-buffers' is allowed to override. Straighten
;; this up sometime later. Or not. Since we can add a method
@ -2029,10 +2056,10 @@ With some possible metadata (to be decided).")
"Initialize `project--list' if it isn't already initialized."
(when (eq project--list 'unset)
(project--read-project-list)
(if-let* (project-prune-zombie-projects
(if-let* ((pred (alist-get 'list-first-read project-prune-zombie-projects))
((consp project--list))
(inhibit-message t))
(project-forget-zombie-projects))))
(project--delete-zombie-projects pred))))
(defun project--write-project-list ()
"Save `project--list' in `project-list-file'."
@ -2041,6 +2068,10 @@ With some possible metadata (to be decided).")
(insert ";;; -*- lisp-data -*-\n")
(let ((print-length nil)
(print-level nil))
(if-let* ((pred (alist-get 'list-write project-prune-zombie-projects))
((consp project--list))
(inhibit-message t))
(project--delete-zombie-projects pred))
(pp (mapcar (lambda (elem)
(let ((name (car elem)))
(list (if (file-remote-p name) name
@ -2124,9 +2155,9 @@ function; see `project-prompter' for more details.
Unless REQUIRE-KNOWN is non-nil, it's also possible to enter an
arbitrary directory not in the list of known projects."
(project--ensure-read-project-list)
(if-let* (project-prune-zombie-projects
(if-let* ((pred (alist-get 'prompt project-prune-zombie-projects))
(inhibit-message t))
(project-forget-zombie-projects))
(project--delete-zombie-projects pred))
(let* ((dir-choice "... (choose a dir)")
(choices
;; XXX: Just using this for the category (for the substring
@ -2165,9 +2196,9 @@ If PREDICATE is non-nil, filter possible project choices using this
function; see `project-prompter' for more details.
Unless REQUIRE-KNOWN is non-nil, it's also possible to enter an
arbitrary directory not in the list of known projects."
(if-let* (project-prune-zombie-projects
(if-let* ((pred (alist-get 'prompt project-prune-zombie-projects))
(inhibit-message t))
(project-forget-zombie-projects))
(project--delete-zombie-projects pred))
(let* ((dir-choice "... (choose a dir)")
project--name-history
(choices
@ -2295,16 +2326,21 @@ Return the number of detected projects."
count) count))
count))
(defun project-forget-zombie-projects ()
"Forget all known projects that don't exist any more."
(interactive)
(defun project--delete-zombie-projects (predicate)
"Helper function used by `project-forget-zombie-projects'.
PREDICATE can be a function with 1 argument which determines which
projects should be deleted."
(dolist (proj (project-known-project-roots))
(when (and (if project-prune-zombie-projects
(funcall project-prune-zombie-projects proj)
t)
(when (and (funcall (or predicate #'identity) proj)
(not (file-exists-p proj)))
(project-forget-project proj))))
(defun project-forget-zombie-projects (&optional interactive)
"Forget all known projects that don't exist any more."
(interactive (list t))
(let ((pred (when interactive (alist-get 'interactively project-prune-zombie-projects))))
(project--delete-zombie-projects pred)))
(defun project-forget-projects-under (dir &optional recursive)
"Forget all known projects below a directory DIR.
Interactively, prompt for DIR.

View file

@ -7424,12 +7424,19 @@ implementations: `python-mode' and `python-ts-mode'."
(when python-indent-guess-indent-offset
(python-indent-guess-indent-offset))
(unless (boundp 'treesit-major-mode-remap-alist) ; Emacs 31.1
(add-to-list 'auto-mode-alist (cons python--auto-mode-alist-regexp 'python-ts-mode))
(add-to-list 'interpreter-mode-alist '("python[0-9.]*" . python-ts-mode))))
(add-to-list 'interpreter-mode-alist '("python[0-9.]*" . python-ts-mode)))))
(when (fboundp 'derived-mode-add-parents) ; Emacs 30.1
(derived-mode-add-parents 'python-ts-mode '(python-mode)))
;;;###autoload
(when (and (fboundp 'treesit-available-p) (treesit-available-p)
(boundp 'treesit-major-mode-remap-alist)) ; Emacs 31.1
(add-to-list 'treesit-major-mode-remap-alist
'(python-mode . python-ts-mode)))
;;; Completion predicates for M-x
;; Commands that only make sense when editing Python code.
(dolist (sym '(python-add-import

View file

@ -2516,7 +2516,7 @@ A slash character after any of these should begin a regexp."))
(goto-char (point-min))
(cl-loop
while (search-forward-regexp
"^\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$"
"^\\(?:[^:|]+: \\)?\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$"
nil t)
for msg = (match-string 2)
for (beg . end) = (flymake-diag-region

View file

@ -1279,6 +1279,7 @@ leading double colon is not added."
;;;###autoload
(when (treesit-available-p)
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(ruby-mode . ruby-ts-mode)))

View file

@ -366,7 +366,8 @@ See https://doc.rust-lang.org/reference/tokens.html#suffixes.")
tail-p
(string-match-p
"\\`\\(?:use_list\\|call_expression\\|use_as_clause\\|use_declaration\\)\\'"
(treesit-node-type (treesit-node-parent (treesit-node-parent node)))))
(or (treesit-node-type (treesit-node-parent (treesit-node-parent node)))
"no_parent")))
nil)
(t 'font-lock-constant-face))))
(when face
@ -387,9 +388,9 @@ See https://doc.rust-lang.org/reference/tokens.html#suffixes.")
,(treesit-query-compile 'rust '((identifier) @id
(shorthand_field_identifier) @id)))))
(pcase-dolist (`(_name . ,id) captures)
(unless (string-match-p "\\`scoped_\\(?:type_\\)?identifier\\'"
(treesit-node-type
(treesit-node-parent id)))
(unless (string-match-p
"\\`scoped_\\(?:type_\\)?identifier\\'"
(or (treesit-node-type (treesit-node-parent id)) "no_parent"))
(treesit-fontify-with-override
(treesit-node-start id) (treesit-node-end id)
'font-lock-variable-name-face override start end)))))))
@ -656,7 +657,10 @@ See `prettify-symbols-compose-predicate'."
;;;###autoload
(defun rust-ts-mode-maybe ()
"Enable `rust-ts-mode' when its grammar is available."
"Enable `rust-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'rust)
(eq treesit-enabled-modes t)
(memq 'rust-ts-mode treesit-enabled-modes))
@ -667,6 +671,7 @@ See `prettify-symbols-compose-predicate'."
(when (treesit-available-p)
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(rust-mode . rust-ts-mode)))

View file

@ -1650,6 +1650,7 @@ not written in Bash or sh."
;;;###autoload
(when (treesit-available-p)
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(sh-mode . bash-ts-mode)))

View file

@ -724,7 +724,10 @@ This mode is intended to be inherited by concrete major modes."
;;;###autoload
(defun typescript-ts-mode-maybe ()
"Enable `typescript-ts-mode' when its grammar is available."
"Enable `typescript-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'typescript)
(eq treesit-enabled-modes t)
(memq 'typescript-ts-mode treesit-enabled-modes))
@ -735,6 +738,7 @@ This mode is intended to be inherited by concrete major modes."
(when (treesit-available-p)
(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(typescript-mode . typescript-ts-mode)))
@ -857,7 +861,10 @@ at least 3 (which is the default value)."
;;;###autoload
(defun tsx-ts-mode-maybe ()
"Enable `tsx-ts-mode' when its grammar is available."
"Enable `tsx-ts-mode' when its grammar is available.
Also propose to install the grammar when `treesit-enabled-modes'
is t or contains the mode name."
(declare-function treesit-language-available-p "treesit.c")
(if (or (treesit-language-available-p 'tsx)
(eq treesit-enabled-modes t)
(memq 'tsx-ts-mode treesit-enabled-modes))
@ -868,6 +875,7 @@ at least 3 (which is the default value)."
(when (treesit-available-p)
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode-maybe))
;; To be able to toggle between an external package and core ts-mode:
(defvar treesit-major-mode-remap-alist)
(add-to-list 'treesit-major-mode-remap-alist
'(tsx-mode . tsx-ts-mode)))

View file

@ -406,8 +406,8 @@ may have changed) back to `save-place-alist'."
(file-error (message "Saving places: can't write %s" file)))))))
(defun save-places-to-alist ()
;; go through buffer-list, saving places to alist if save-place-mode
;; is non-nil, deleting them from alist if it is nil.
"Save all buffer filenames and positions to `save-place-alist'.
See `save-place-to-alist'."
(let ((buf-list (buffer-list)))
(while buf-list
;; put this into a save-excursion in case someone is counting on

View file

@ -1232,7 +1232,7 @@ The following commands are accepted by the client:
(when prev
(setq string (concat prev string))
(process-put proc 'previous-string nil)))
(condition-case err
(condition-case-unless-debug err
(progn
(server-add-client proc)
;; Send our pid

Some files were not shown because too many files have changed in this diff Show more