Automatically figure out which regval can be used for insertion
and jump based on the presence of a matching method.
* lisp/register.el (register-type, register--type): Delete functions.
(register--get-method-type, register--jumpable-p)
(register--insertable-p): New functions.
(jump-to-register, insert-register): Use them.
* lisp/frameset.el (register--type): Delete method.
* lisp/register.el (register-command-info): Delete function.
(register-read-with-preview-fancy): Don't use it any more.
(jump-to-register, increment-register, view-register)
(insert-register, append-to-register, prepend-to-register):
Pass a `pred` arg instead.
* lisp/register.el (register--read-with-preview-function):
Improve docstring..
(register--type) <(eql nil)>: New method.
(register-of-type-alist, register-preview-1)
(register--preview-get-defaults): Replace `types` arg with `pred` arg.
(register-read-with-preview, register-read-with-preview-traditional):
Add `pred` arg.
(register-read-with-preview-fancy): Add `pred` arg.
Use it instead of the `types` info returned by `register-command-info`,
when provided.
* lisp/register.el (register-preview-info): Delete slot `act`.
(register-command-info): Delete arg `:act`.
(register--preview-get-defaults): Rename from
`register--preview-get-defaults` and rewrite with, different args.
(register-read-with-preview-fancy): Use it instead of `act`.
Use the `types` slot to carry that info instead.
Replace the list of types `(all)` with `(t)` since `t` is the
usual name of the "supertype of all types".
Use the type `null` to represent the fact that empty registers
can be used. Allow an empty list of types to stand for
`(t null)`, i.e. any register even empty ones.
* lisp/register.el (register-preview-info): Delete slot `smatch`.
(register-command-info): Delete arg `:smatch`. Adjust `:types` instead.
Fix the `copy-rectangle-to-register` case, which disallowed using
an empty register.
(register-of-type-alist): Adjust handling of `types` accordingly.
(register-preview-1): Simplify.
(register-read-with-preview-fancy): Use types instead of `smatch`.
Use it also in place of `act`.
* lisp/register.el (register-preview-info): Remove `noconfirm` slot.
(register-command-info): Delete `:noconfirm` args.
(register-read-with-preview-fancy): Hardcode the `noconfirm` setting
because it was always exactly the same anyway.
The code assumed that the string returned by `register-preview-function`
has the register name as the first char. This was an
incompatible change which broke packages that set this var,
such as `calculator.el` and others.
Remove this assumption by recording the register names in the
preview buffer on a new `register--name` text property.
While at it, fix a few other problems where control chars were
not pretty printed.
* lisp/register.el (register-preview-1): Remember the raw
register name in the `register--name` text property.
(register-preview-forward-line): Use the
`register--name` text property.
(register--find-preview): New function.
(register-read-with-preview-fancy): Use it.
If the last command inserted more than one char, only keep the first of
the new chars.
Make sure control chars are pretty printed in the minibuffer.
including minibuffer messages.
* lisp/frameset.el (register-val-jump-to): Fix `:cleanup-frames`.
The code did not obey its documented behavior and matched
against the wrong symbols.
* lisp/register.el (register-command-info) <append-to-register>,
<prepend-to-register>: Remove `number` from the `:types` argument
since those operations fail on numbers.
* lib-src/emacsclient.c (set_fg, get_wc): Declare using actual
function signatures.
(w32_give_focus): Cast return value of 'GetProcAddress' to correct
pointer types. (Bug#78160)
* lisp/progmodes/cperl-mode.el (cperl-mode-map): Don't bind C-j.
The default global mode bindings will DTRT depending on whether
or not electric-indent-mode is on.
* lisp/register.el (frame-register, kmacro-register): Remove bogus deftypes.
(register--type) <oclosure>: Fix kmacro method and generalize it to
any OClosure.
(register--type) <frameset-register>: Fix method and move it to ...
* lisp/frameset.el (register--type) <frameset-register>: ... here,
where `frameset-register` is defined.
* lisp/outline.el (outline-font-lock-keywords): For non-nil
outline-search-function return a lambda that calls the function,
then sets the match data to the end of the line that is equivalent
to adding ".*" in the regexp. Then search functions don't need to
match ".*" themselves.
* lisp/progmodes/elisp-mode.el (elisp-outline-search):
New function to skip leading parens in strings when searching
for outline headings.
(emacs-lisp-mode): Set buffer-local 'outline-search-function' to
'elisp-outline-search'.
https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00934.html
* lisp/isearch.el (search-within-boundaries): Don't go over BOUND.
* test/lisp/isearch-tests.el (isearch--test-search-within-boundaries):
Test with the BOUND arg as well (bug#78116).
In the vast majority of cases, changing the source overlay
invalidates the content of the end-of-line overlay, so best to
delete it asap.
* lisp/progmodes/flymake.el (flymake--delete-overlay): Use
'flymake--eol-ov'
(flymake--highlight-line): Use some overlay modification hooks.
After a change in the buffer has occured, it is often the case
that Flymake is quicker to ask for diagnostics than the server
is to supply them to us. If we're still stuck with old outdated
diagnostics, don't forward them to Flymake, even if it eagerly
asks us for them.
* etc/EGLOT-NEWS (Changes in upcoming Eglot): Announce changes.
* lisp/progmodes/eglot.el
(eglot--diagnostics): Rework.
(eglot--report-to-flymake): Also take version.
(eglot-handle-notification textDocument/publishDiagnostics)
(eglot--managed-mode)
(eglot-flymake-backend): Tweak call to eglot--report-to-flymake.
Some explanation: Fsubst_char_in_region used to have a branch,
one branch path calls replace_range, one branch path modifies
the buffer directly. replace_range already calls
treesit_record_change within it, so we needed to make sure we
only call treesit_record_change in the other branch path.
After I added the call to treesit_record_change, some changes
are made to Fsubst_char_in_region, and the branch was removed.
So no wonder Stefan had the confusion and wrote the FIXME note.
Now that the branch is gone, we can indeed call
treesit_record_change in the end like signal_after_change.
* src/editfns.c (Fsubst_char_in_region): Move to end.
* lisp/vc/log-edit.el (log-edit-maybe-show-diff): New function.
(log-edit-hook): Add it as an option.
(log-edit-diff-function):
* etc/NEWS: Document it.
This reverts the following two changesets:
Author: Sean Whitton <spwhitton@spwhitton.name>
AuthorDate: Tue Oct 29 09:40:02 2024 +0800
Fix window selection after log-edit-show-diff
Author: Sean Whitton <spwhitton@spwhitton.name>
AuthorDate: Tue Apr 8 20:36:42 2025 +0800
Fix window selection after log-edit-show-diff, again
This also replaces the following changeset:
Author: Sean Whitton <spwhitton@spwhitton.name>
AuthorDate: Tue Oct 29 12:52:20 2024 +0800
* lisp/vc/log-edit.el (log-edit-diff-function): Document.
* lisp/vc/log-edit.el (log-edit-diff-function): Document that
the function *should* leave the window selected when it returns.
(log-edit-diff-fileset):
* lisp/vc/vc.el (vc-modify-change-comment):
Don't use save-selected-window (bug#77946).
(vc-diff-patch-string):
Call pop-to-buffer, not display-buffer (bug#77946).
* lisp/isearch.el (isearch-allow-motion)
(isearch-motion-changes-direction): Use isearch-mode-map for
commands in docstrings (bug#78118).
Copyright-paperwork-exempt: yes
Fix various bugs, including bug#77718, by rewriting the way file
name completion handles environment variable expansion. Instead
of using completion-table-with-quoting to manipulate the string
being completed on, simply make the completion table itself
understand substitute-in-file-name.
Tests are updated: partial-completion now preserves unexpanded
environment variables. However, partial-completion no longer
works across environment variables containing delimiters; that's
an acceptable sacrifice.
* lisp/minibuffer.el (completion--sifn-boundaries): Add.
(completion--file-name-table): Rewrite to use
substitute-in-file-name explicitly. (bug#77718)
* test/lisp/minibuffer-tests.el (completion-table-test-quoting):
Update.
Among other users, let-alist widely uses symbols which start with a ".".
Make those symbols print more nicely by tweaking the escaping rules in
print_object to not escape a leading "." followed by a letter. This is
a conservative change to avoid constraining future lexer changes.
This is a followup to 637dde4aba, which
removed some unnecessary escaping of "." and "?" when printing symbols
in prin1. (Actually, if we always escaped "?" (which was the case
before 637dde4aba) then "." only ever needs to be escaped when
string_to_number returns non-nil. So 637dde4aba could have just
dropped the escaping of "." with no other changes, if it didn't also
remove escaping of "?")
* src/print.c (print_object): Don't escape "." as the first
character in a symbol if followed by a letter. (bug#77656).
* test/src/print-tests.el (test-dots): Update for new behavior.
* lisp/cus-edit.el (Custom-dirlocals-mode-map): Rename from
`custom-dirlocals-map`.
(Custom-dirlocals-menu): Adjust accordingly.
(Custom-dirlocals-mode): Let `define-derived-mode` do its job.
Use `run-mode-hooks`.