* lisp/treesit.el (treesit-language-at-point-default): Return
nil if there's no parser in the buffer.
(treesit-parsers-at): Add docstring for parser order.
My previous commit foolishly excluded strings from the
condition, now add them back.
* lisp/progmodes/prog-mode.el (prog-fill-reindent-defun):
Include strings.
We already unconditionally claim that `xw-display-color-p`, which,
according to the docstring of this function, implies that we handle
grayscale too.
* src/pgtkfns.c (Fx_display_grayscale_p): Return Qt unconditionally.
* lisp/window.el (window--quit-restore-select-window):
Add optional arg 'frame'. Don't switch to another frame
if window is not on the selected frame (bug#71386).
(quit-restore-window): Provide the 'frame' arg
to 'window--quit-restore-select-window' calls.
Patch by martin rudalics <rudalics@gmx.at>.
* test/lisp/tab-bar-tests.el (tab-bar-tests-quit-restore-window):
No need to reselect the frame after 'quit-window'.
Don't add the primary parser or the first of treesit-parser-list
when non-nil 'with-host' is provided since there is no host
for the primary parser (bug#76788).
* doc/misc/modus-themes.org: Update the manual to document how
'modus-themes-list-colors' has changed. Make other minor changes.
* etc/themes/modus-operandi-deuteranopia-theme.el:
* etc/themes/modus-operandi-theme.el:
* etc/themes/modus-operandi-tinted-theme.el:
* etc/themes/modus-operandi-tritanopia-theme.el:
* etc/themes/modus-vivendi-deuteranopia-theme.el:
* etc/themes/modus-vivendi-theme.el:
* etc/themes/modus-vivendi-tinted-theme.el:
* etc/themes/modus-vivendi-tritanopia-theme.el: Make stylistic refinements.
* etc/themes/modus-themes.el: Make refinements to supported
faces, add support for more faces, and the like.
Release notes: <https://protesilaos.com/codelog/2025-04-17-emacs-modus-themes-4-7-0/>.
* lisp/treesit.el (treesit-parsers-at): Add treesit-primary-parser
only when it's non-nil. When the result list is still empty,
add the first parser from 'treesit-parser-list'.
https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00627.html
* test/src/treesit-tests.el (treesit-node-supplemental)
(treesit-node-at, treesit-node-check)
(treesit-search-subtree-forward-1)
(treesit-search-subtree-backward-1): Wrap test body in 'with-temp-buffer'.
prog-mode.el doens't need treesit.el dependency. And it
shouldn't depend on it. In principle, treesit.el should
integrate into various parts of Emacs through standard hooks and
variables.
* lisp/progmodes/prog-mode.el:
(prog-fill-reindent-defun): Remove treesit.el functions. Use
generic functions to check whether the current line has
comments, and make the test more comprehensive.
* lisp/progmodes/c-ts-common.el:
(c-ts-common--comment-regexp): Add // and /* to regexp for Rust.
(c-ts-common--line-comment-p): Extract out into new function,
add a check that the parent node is a comment node.
(c-ts-common--fill-paragraph): Extract some code out.
* lisp/emacs-lisp/eieio-base.el (make-instance) <eieio-named>:
Really skip backward compatibility when `eieio-backward-compatibility`
is nil and emit message if it's `warn`.
(eieio-persistent-make-instance): Warn when an obsolete name is used.
* lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility):
Change default to `warn`.
(eieio-defclass-internal): Warn when the *-list-p function is called
(eieio--slot-name-index): Warn when a initarg is used to access a slot.
* lisp/emacs-lisp/eieio.el (defclass): Warn when a class-slot is
accessed via the obsolete method.
(make-instance, clone) <eieio-default-superclass>: Really skip backward
compatibility when `eieio-backward-compatibility` is nil and emit
message if it's `warn`.
* src/pdumper.c (dump_builtin_symbol_p): Test BARE_SYMBOL_P
\(object) rather than SYMBOLP to avoid depending on the value of
symbols_with_pos_enabled or depositing non-relocated references
to vectorlikes in the dump file. Clarify commentary.
* lisp/erc/erc-backend.el (erc-server--reconnect-opened)
(erc--server-reconnect-opened): Rename former to latter. Restore
original buffer-local value of session connector for Emacs 29 and below.
(erc--server-reconnect-timeout-check)
(erc--server-reconnect-timeout-scale-function): Change from buffer-local
to normal variables, which they should have been originally.
(erc--recon-probe-reschedule): Ensure `erc-server-reconnect-timeout' is
always non-nil to avoid seeing format specifier in admin message. Use
current buffer when `proc' argument is nil. Perform cleanup when `proc'
and `erc-server-process' differ.
(erc-server-delayed-check-reconnect-reuse-process-p): New variable.
(erc--recon-probe-sentinel): Run `erc--server-reconnect-opened'
immediately because sending a speculative PING doesn't work on all
servers and proxies, most crucially on ZNC, which replies with an error
only after an extended timeout.
(erc--recon-probe-filter): Remove unused function.
(erc--recon-probe-check) Rework to not use fixed periodic timer, change
second parameter to a Lisp time object.
(erc-server-delayed-check-reconnect): Use realistic name when reusing
process so that the session's process isn't "*erc-connectivity-check*".
Set filter to `ignore'. Always run `erc--recon-probe-sentinel' when
status is `open' or something other than `connect', but don't bother
spawning a `erc--recon-probe-check' task as well because any problems
creating the process should already be known. Handle quits during
connect functions that perform blocking I/O, such as
`socks-open-network-stream'.
(erc-schedule-reconnect): Don't bother setting filter to nil.
* test/lisp/erc/erc-scenarios-base-auto-recon.el
(erc-scenarios-base-auto-recon-unavailable)
(erc-scenarios-base-auto-recon-check/no-reuse): Rename former to latter.
(erc-scenarios-base-auto-recon-no-proto)
(erc-scenarios-base-auto-recon-check/reuse): Rename former to latter and
rewrite not to expect a PING.
* test/lisp/erc/resources/erc-d/erc-d.el (erc-d--forget-process): New
function.
(erc-d--process-sentinel): Stop serving when all dialogs have been
exhausted. (Bug#62044)
In certain situations, Eglot has to report to the server parts
of the diagnostics that it itself sent us. The server may use
this as context to compute code actions, for example. Eglot
selects diagnostics by asking Flymake, looking for the ones that
contain Eglot-specific cookies.
But when doing so, it is important to also be aware of the LSP
document version these each of these diagnostics pertain to,
since if a diagonstic in the buffer pertains to an older version
of the LSP document (because Flymake fired or the server hasn't
pushed a new set), that diagnostics 'eglot-lsp-data' cookie is
invalid and possibly harmful.
An example is when a diagnostic extends all the way to the end
of the buffer. If we attempt to fix by shortening the buffer,
an Eldoc-started code actions request may be sent to the server
considering the soon-to-be-deleted Flymake diagnostic as
context. But that diagnostic's 'eglot-lsp-data' cookie is no
longer valid and when processing that context we try to go past
point-max and burp an annoying error.
Best to check the version of the diagnostic (if we have it) and
ignore the ones that don't match the document version.
* lisp/progmodes/eglot.el (eglot--versioned-identifier): Move up.
(eglot--flymake-diagnostics, eglot--diag-to-lsp-diag): New helpers.
(eglot-handle-notification): Record LSP doc version in diagnostics.
(eglot--code-action-bounds)
(eglot--code-action-params): Use eglot--flymake-diagnostics.
(markdown-ts--code-block-language-map): Add more aliases.
(markdown-ts-code-block-source-mode-map): Add more mappings
for existing core ts-modes.
(markdown-ts--convert-code-block-language):
Check 'lang-string' with 'symbolp'. Check 'mode' with 'fboundp'.
* lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode):
Call 'treesit-cycle-sexp-type' at the end to enable navigation across
nodes defined by the tree-sitter thing 'sexp' by default (bug#76788).
* lisp/outline.el (outline-after-change-functions): New variable.
(outline--fix-buttons-after-change):
Run hook 'outline-after-change-functions'.
* lisp/treesit.el (treesit--after-change): Improve docstring.
(treesit-major-mode-setup): Simplify to just add
'treesit--after-change' to 'outline-after-change-functions' hook.
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode): Add explicit
'treesit-outline-predicate' that is like
'treesit-simple-imenu-settings', but also adds "trait_item".
* lisp/treesit.el (treesit-language-at-point-function):
Change the default value from nil to 'treesit-language-at-point-default'.
(treesit-language-at): Funcall 'treesit-language-at-point-function'
unconditionally.
(treesit-language-at-point-default): New function with body from
'treesit-language-at'.
(treesit-node-at): Simplify by replacing duplicate code
with the call to 'treesit-parsers-at'.
Experience suggests that it's more often useful to keep point
at the end of the replacement than it is to keep point at the
beginning of the replacement.
This also aligns the behavior of `replace-region-contents` with
that of `insert`.
* src/insdel.c (replace_range): Treat PT like an insert-before marker.
* src/editfns.c (Freplace_region_contents): Adjust docstring accordingly.
- Define new faces and use them in place of font-lock faces
- Add more fontification, add a new feature for headings.
- Remove fontification for code blocks, so embedeed parser can
fontify them
- Add experimental code block support for javascript by using
tree-sitter setup from js-ts-mode.
- Correctly setup markdown_inline with range settings.
* lisp/textmodes/markdown-ts-mode.el:
(markdown-ts--code-block-language-map):
(markdown-ts-code-block-source-mode-map): New variables.
(markdown-ts-faces): New group.
(markdown-ts-delimiter):
(markdown-ts-heading-1):
(markdown-ts-setext-heading):
(markdown-ts-heading-2):
(markdown-ts-heading-3):
(markdown-ts-heading-4):
(markdown-ts-heading-5):
(markdown-ts-heading-6):
(markdown-ts-list-marker):
(markdown-ts-block-quote):
(markdown-ts-language-keyword): New faces.
(markdown-ts--treesit-settings):
(markdown-ts--configured-languages): New variables.
(markdown-ts--harvest-treesit-configs):
(markdown-ts--add-config-for-mode):
(markdown-ts--convert-code-block-language): New functions.
(markdown-ts--range-settings): New variable.
(markdown-ts-setup): Setup range configuration.
(markdown-ts-mode): Add heading feature.
* lisp/ruler-mode.el (ruler-mode-map): Remove down-mouse-1
binding that conflicts with dragging header line.
* src/xdisp.c (note_mode_line_or_margin_highlight): Renamed
to...
(note_line_or_margin_highlight): ...new name since it applies to
any window line (mode, tab, header). Set drag cursor for window
top lines.
(note_mouse_highlight): Update call to new name (bug#76084).
* lisp/man.el (Man-start-calling): Declare as debuggable.
(Man-getpage-in-background): Call `Man-bgproc-sentinel' with a
cons (BUFFER . EXIT-STATUS) as PROCESS argument for synchronous calls.
(Man-bgproc-sentinel): Use that information to handle those more
similarly to asynchronous calls. Do not employ window selection hacks
for synchronous calls. (Bug#77755)
Suggested by Kasper Gałkowski <kpg@posteo.net> (bug#77668)
* etc/NEWS: Announce new Dired user option.
* lisp/dired-aux.el (dired-create-empty-file-in-current-directory):
New user option.
(dired-create-empty-file): Use it. Update and clarify doc string.
* exec/config-mips.m4.in (DADDI2, DADDI3): Disable at-clobbering
by assembler macros expressly.
* exec/loader-mips64el.s: Adapt from loader-mipsel.s.
* exec/configure.ac (exec_cv_as_daddi): Properly escape reg
names.
* exec/exec.c (struct exec_jump_command, exec_0): Don't define
or set `fpu_mode' if __LP64__.
* exec/exec.h (struct exec_tracee): New field `callno'.
* exec/trace.c (process_system_call): Always record the current
system call number in TRACEE lest it should be required once it
has been overwritten upon the syscall's completion.
(seccomp_system_call): Likewise.
(after_fork): Clear `tracee->callno'.
* test/lisp/tab-bar-tests.el (tab-bar-tests-quit-restore-window):
Skip test on MS-Windows in batch mode, since terminal frames
cannot be created in that case.
* exec/loader-mipsel.s (rest_of_exec): Delete redundant nop.
(skip_environ): Correct stack space test. Don't jump into
the label for the sp preserving case's delay slot.