Commit graph

182118 commits

Author SHA1 Message Date
Eshel Yaron
b57124b747
; More 'elisp-scope' and 'elisp-fontify-semantically' doc improvements
See discussion at
https://yhetil.org/emacs/86y0hy9e6g.fsf@gnu.org/

* lisp/emacs-lisp/elisp-scope.el (elisp-scope-analyze-form):
Add example in docstring.
* lisp/progmodes/elisp-mode.el (elisp-fontify-semantically):
Clarify use of 'cursor-sensor-mode'.
2026-05-05 19:10:45 +02:00
Juri Linkov
c9078c505b Improve 'context-menu-send-to' (bug#79512)
* lisp/mouse.el (context-menu-functions): Add missing
'context-menu-send-to' to :type.
(context-menu-send-to): Get non-nil items to avoid
useless message "Nothing to send".

* lisp/send-to.el (send-to-handlers): Change from
'defvar-local' to 'defvar' to allow easier global configuration.
(send-to-supported-p): Check for non-nil handler.
2026-05-05 19:45:28 +03:00
Eshel Yaron
0649c501ad
; (elisp-scope-analyze-form): Improve docstring. 2026-05-05 14:30:59 +02:00
Sean Whitton
283b47ab2e vc-switch-working-tree: Don't find non-VC projects
* lisp/vc/vc.el (project-current-directory-override):
Delete declaration.
(project-find-matching-buffer-function): Declare.
(vc-switch-working-tree):
Don't find non-VC projects (bug#80939).
2026-05-05 12:17:53 +01:00
Sean Whitton
8f9607d532 vc-finish-logentry: Skip displaying async command buffer sometimes
* lisp/vc/vc-dispatcher.el (vc-finish-logentry): Don't display
the async command buffer if vc-display-failed-async-commands is
non-nil.
2026-05-05 11:00:52 +01:00
Eshel Yaron
5789621632
elisp-mode: Cache 'help-echo' function results (bug#80948)
This ensures we only compute the 'help-echo' string once per
symbol in a certain position.

* lisp/progmodes/elisp-mode.el
(elisp--annotate-symbol-with-help-echo): Add caching for
when the symbol role's :help property is a function.
2026-05-05 11:19:30 +02:00
Eshel Yaron
288f8d0b05
; (elisp-fontify-symbol): Improve docstring. 2026-05-05 11:19:30 +02:00
Eli Zaretskii
47e014ff90 ; Fix byte-compilation warnings in markdown-ts-mode
* lisp/textmodes/markdown-ts-mode-x.el: Use
'treesit-declare-unavailable-functions'.

* lisp/treesit.el (treesit-declare-unavailable-functions): Add
declaration.
2026-05-05 11:42:12 +03:00
Eli Zaretskii
d48b774524 ; Fix last change
* src/xdisp.c (extend_face_to_end_of_line): Fix last argument to
'append_stretch_glyph', to avoid assertion violations.  (Bug#80693)
2026-05-05 11:22:56 +03:00
Andrea Alberti
d24b10ca75 Introduce 'margin' face for window margin background
A new basic face 'margin' is used for text displayed in the left and
right margin areas, i.e., the areas typically used by VCS and LSP
packages for per-line annotations.  Its background defaults to the
frame default, preserving existing behavior for users who do not
customize it.
* etc/NEWS: Document the new 'margin' face.
* lisp/faces.el (margin): Add 'margin' face, inheriting from 'default'.
* src/dispextern.h (face_id): Add MARGIN_FACE_ID.
* src/xdisp.c (face_at_pos): Use 'margin' as the base face for
strings displayed in margin areas so that they inherit the gutter
background by default.
(extend_face_to_end_of_line): Compute 'margin_fill_face_id' from the
'margin' face.  Use while loops to explicitly fill all empty character
slots in both left and right margins for both GUI and TTY branches.
(display_line): Call 'extend_face_to_end_of_line' for beyond-EOB rows
when the window has margins.  Also extend the existing condition for
text rows with empty margins to trigger when the 'margin' face
background differs from the frame default, not only when the default
face is remapped.
* src/xfaces.c (realize_basic_faces): Realize 'margin' as a basic
face to support face-remapping and efficient lookup.
(Bug#80693)
2026-05-05 11:21:57 +03:00
Augusto Stoffel
c878753d39 Accept stream type as 4th argument of X-Message-SMTP-Method header
* lisp/gnus/message.el (message-multi-smtp-send-mail): Set
'smtpmail-stream-type' if specificed in the header.
* doc/misc/message.texi (Mail Variables): Document that.
(Bug#80880)
2026-05-05 10:28:25 +03:00
Eli Zaretskii
344d826956 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2026-05-05 10:25:46 +03:00
Rahul Martim Juliato
b36a26bb3b
Improve 'markdown-ts-mode'
Overhaul 'markdown-ts-mode' with comprehensive fontification,
code block handling, editing commands, fill-paragraph support,
inline image previews, a mode menu, and table editing.  Add
'markdown-ts-mode-x.el' with conversion/export and TOC support.

* lisp/textmodes/markdown-ts-mode.el: Add Version,
Package-Requires, and Keywords header fields.  Expand Commentary
with documentation for code block language modes, code block
commands, bidirectional text, and known tree-sitter grammar
bugs.
(require 'goto-addr, xref, icons): New requirements.
(markdown-ts): New customization group with :version and
:package-version tags.
(markdown-ts-hide-markup): Add :version and :package-version.
(markdown-ts-ellipsis): New option for folded heading ellipsis.
(markdown-ts-menu-bar-show): New option to toggle mode menu.
(markdown-ts-default-folding): New option for default fold
level.
(markdown-ts-inline-images): New option to display inline
images.
(markdown-ts-image-max-width): New option for image max width.
(markdown-ts-display-remote-inline-images): New option for
remote image handling.
(markdown-ts--resolve-display-value): New helper to resolve
display values using char-displayable-p.
(markdown-ts-checked-checkbox): New option for checked checkbox
display string or icon.
(markdown-ts-checked-checkbox-icon): New icons.el icon for the
checked variant.
(markdown-ts-unchecked-checkbox): New option for unchecked
checkbox display string or icon.
(markdown-ts-unchecked-checkbox-icon): New icons.el icon for the
unchecked variant.
(markdown-ts-thematic-break-character): New option for thematic
break display character.
(markdown-ts-hard-line-break-backslash): New option for the
glyph shown in place of a trailing-backslash hard line break
when markup is hidden.
(markdown-ts-hard-line-break-space): New option for the glyph
shown in place of a trailing-spaces hard line break when markup
is hidden.
(markdown-ts-code-block-in-context-mode-lighter): New option for
code block context mode lighter string.
(markdown-ts-inhibit-code-block-mode-warnings): New option to
inhibit code-block major-mode messages and warnings.
(markdown-ts-table-default-column-width): New option for default
table column width.
(markdown-ts-enable-table-mode): New option to enable table
mode.
(markdown-ts-table-auto-align): New option for triggers that
cause automatic table alignment.
(markdown-ts-table-align-features): New option for table align
features.
(markdown-ts-in-table-mode-lighter): New option for
markdown-ts-in-table-mode lighter string.
(markdown-ts-emphasis, markdown-ts-bold)
(markdown-ts-strikethrough, markdown-ts-link)
(markdown-ts-link-destination, markdown-ts-code-span)
(markdown-ts-code-block, markdown-ts-code-block-markup-hidden)
(markdown-ts-indented-code-block, markdown-ts-html-tag)
(markdown-ts-html-block, markdown-ts-thematic-break)
(markdown-ts-entity-reference)
(markdown-ts-numeric-character-reference, markdown-ts-latex)
(markdown-ts-table-header, markdown-ts-table-cell)
(markdown-ts-table-delimiter-cell, markdown-ts-task-unchecked)
(markdown-ts-task-checked): New faces.
(markdown-ts-hard-line-break-backslash)
(markdown-ts-hard-line-break-backslash-hidden)
(markdown-ts-hard-line-break-space)
(markdown-ts-hard-line-break-space-hidden): New faces for the
two hard-line-break variants, with distinct shown/hidden
appearances.
(markdown-ts-in-code-block): New face for when point is inside a
fenced code block.
(markdown-ts-table): New face for Markdown pipe table
background.
(markdown-ts-in-table): New face for markdown-ts-in-table-mode
when point is in a table.
(markdown-ts--set-up-inline): New variable for lightweight setup
in embedded inline markdown-ts-mode buffers used by code block
commands.
(markdown-ts-default-code-block-mode): New variable to define
default mode for anonymous code blocks.
(markdown-ts-fontify-code-blocks-natively): New option to
enable/disable native fontification of fenced code block
contents.
(markdown-ts-enable-code-block-context-mode): New option to
enable/disable code block context integration.
(markdown-ts-code-block-modes): New variable replacing
markdown-ts--code-block-language-map and
markdown-ts-code-block-source-mode-map with unified language to
mode mapping including heuristic lookup.
(markdown-ts-code-block-force-conventional-modes): New variable
listing tree-sitter modes whose fontification of code block
content should be harvested via a temporary buffer.
(markdown-ts-table-export-buffer): New constant for table export
output buffer name.
(markdown-ts--table-row-types, markdown-ts--table-cell-types)
(markdown-ts--table-delimiter-cell-types)
(markdown-ts--table-delimiter-cell-subtypes): New constants for
pipe table node type classification.
(markdown-ts--make-link-button): New function to create
clickable link buttons with mailto, browse-url, and find-file
dispatch.
(markdown-ts--fontify-link-destination): New fontifier that
hides link destinations when markup is hidden.
(markdown-ts--link-ref-cache, markdown-ts--link-ref-cache-tick)
(markdown-ts--link-ref-definitions)
(markdown-ts--resolve-link-ref): New link reference definition
cache with case-insensitive matching per CommonMark spec.
(markdown-ts--fontify-link-node): New fontifier for inline,
reference, shortcut, and collapsed links as clickable buttons.
(markdown-ts--fontify-autolink): New fontifier for URI and email
autolinks with angle bracket hiding.
(markdown-ts--fontify-link-ref-label)
(markdown-ts--fontify-link-ref-destination): New fontifiers for
link reference definitions.
(markdown-ts--slug-github-strip-re, markdown-ts--slug-github)
(markdown-ts--slug-pandoc, markdown-ts--explicit-id-re)
(markdown-ts--heading-text-and-id)
(markdown-ts--heading-id-cache)
(markdown-ts--heading-id-cache-tick)
(markdown-ts--build-heading-ids, markdown-ts--heading-ids)
(markdown-ts--follow-fragment): New fragment link support with
GitHub and Pandoc slug algorithms.
(markdown-ts--latex-block-valid-p)
(markdown-ts--fontify-latex-block): New LaTeX/math fontifier
with cross-paragraph validation.
(markdown-ts--fontify-backslash-escape): New fontifier that
hides backslash in escapes except inside LaTeX blocks.
(markdown-ts--decode-entity, markdown-ts--fontify-entity): New
HTML entity decoder and fontifier using org-entities and
sgml-char-names with display property for decoded values.
(markdown-ts--fontify-checkbox): New fontifier showing the
configured checkbox glyph when markup is hidden.
(markdown-ts--fontify-hard-line-break): New fontifier for
'hard_line_break' nodes.
(markdown-ts--fontify-heading): New fontifier for ATX and Setext
headings.
(markdown-ts--fontify-thematic-break): New fontifier showing
horizontal line when markup is hidden.
(markdown-ts--fontify-code-block): New fontifier applying
background overlay to code blocks with language and mode
properties.
(markdown-ts-at-code-block-p)
(markdown-ts-code-block-language-at)
(markdown-ts-code-block-mode-at): New accessors for code block
overlay properties.
(markdown-ts--imenu-code-block-node-p): New helper for imenu
code block detection.
(markdown-ts--image-alone-on-line-p)
(markdown-ts--fontify-image): New inline image display with
standalone and inline positioning.
(markdown-ts--bare-url-regexp)
(markdown-ts--bare-email-uri-regexp)
(markdown-ts--fontify-bare-uri): New bare URL/email
fontification via jit-lock using goto-addr regexps.
(markdown-ts--treesit-settings): Rewrite with dedicated faces,
custom fontifiers, and new font-lock features for all inline and
block elements.  Also add a new 'error' font-lock feature
highlighting tree-sitter ERROR nodes.
(markdown-ts--code-block-languages)
(markdown-ts--code-block-non-ts-modes): New buffer-local alists
for code block language tracking.
(markdown-ts--harvest-mode-treesit-configuration): Rename from
markdown-ts--harvest-treesit-configs with delay-mode-hooks.
(markdown-ts--configure-current-buffer): Rename from
markdown-ts--add-config-for-mode.
(markdown-ts--language-at-node): New helper extracting language
symbol from code_fence_content node.
(markdown-ts--non-ts-fontify-cache): New buffer-local hash table
caching fontification results for non-tree-sitter code blocks.
(markdown-ts--fontify-non-ts-collect-faces): New function
harvesting face properties from a mode in an indirect or
temporary buffer.
(markdown-ts--fontify-non-ts-code-block): New fontifier for
non-tree-sitter modes via temporary buffer font-lock.
(markdown-ts--code-block-language-mode): New function with
heuristic mode name probing.
(markdown-ts--code-block-ts-language): Rename from
markdown-ts--convert-code-block-language with support for non-ts
modes and recursive markdown handling.
(markdown-ts-code-block-commands)
(markdown-ts-code-block-thing-commands)
(markdown-ts-code-block-region-commands): New command lists for
code-block context execution.
(markdown-ts--enable-code-block-in-context-mode)
(markdown-ts--maybe-run-command-in-code-block)
(markdown-ts--code-block-xref-find-definitions)
(markdown-ts--run-command-in-code-block): New code block minor
mode with temp-buffer command dispatch.
(markdown-ts--code-block-newline): New command for newline
inside code blocks, dispatching to the block's mode.
(markdown-ts--range-settings): Update range configuration;
remove :range-fn treesit-range-fn-exclude-children.
(markdown-ts--remove-image-overlays)
(markdown-ts--outline-view-change): New helpers for image
overlay management during outline fold/unfold.
(markdown-ts--outline-invisible-p): New helper testing whether a
position is inside an outline-folded region.
(markdown-ts--host-ranges-notifier): New function pruning stale
code block overlays when the host parse tree changes.
(markdown-ts--barf-if-not-mode): New helper signaling a
user-error when the current buffer is not derived from
markdown-ts-mode.
(markdown-ts-code-block-in-context-mode): New minor mode enabled
when point is within a fenced code block, activating
markdown-ts-code-block-in-context-mode-map so eligible commands
dispatch to the block's major mode.
(markdown-ts--set-hide-markup): Clear image overlays when
toggling markup visibility.
(markdown-ts--set-inline-images)
(markdown-ts-toggle-inline-images): New functions for toggling
inline image display.
(markdown-ts--parser-heading-max-level): New constant.
(markdown-ts--heading-at-point, markdown-ts--heading-level)
(markdown-ts--section-at-point): New heading navigation helpers.
(markdown-ts-promote, markdown-ts-demote): New commands for
heading and list item promotion/demotion with region support.
(markdown-ts--promote-or-demote)
(markdown-ts--promote-or-demote-region): New heading level
adjustment functions.
(markdown-ts-move-subtree-up, markdown-ts-move-subtree-down):
New commands for moving sections and list items.
(markdown-ts--section-folded-p)
(markdown-ts--move-subtree-up-or-down): New subtree move with
folding state preservation.
(markdown-ts-toggle-checkbox): New command to toggle task list
checkboxes.
(markdown-ts--list-item-at-point): New helper with block quote
marker handling.
(markdown-ts--list-marker-width, markdown-ts--list-item-region)
(markdown-ts--list-ordered-item-p): New list item helpers.
(markdown-ts--list-promote-or-demote): New function with ordered
list nesting guard.
(markdown-ts--list-node-bol, markdown-ts--list-move): New list
item movement functions.
(markdown-ts-renumber-list): New command for sequential list
renumbering with prefix argument support.
(markdown-ts--list-item-new-marker)
(markdown-ts--new-marker-for-line): New marker string generators
for list item insertion.
(markdown-ts--line-block-quote-depth): New helper counting block
quote depth.
(markdown-ts-newline): New RET command for context-aware
newline.
(markdown-ts-insert-list-item): New M-RET command that creates a
new list item.
(markdown-ts--fill-unfillable-block-query): New tree-sitter
query for unfillable blocks.
(markdown-ts--list-item-text-column): New helper for list item
text alignment.
(markdown-ts--fill-list-item): New function filling within list
items without merging adjacent items.
(markdown-ts--adaptive-fill): New adaptive fill function for
list item continuation.
(markdown-ts--fill-forward-paragraph): New paragraph motion
respecting list items and unfillable blocks.
(markdown-ts-fill-paragraph): New fill-paragraph-function with
cond* dispatch for lists, block quotes, HTML comments, and
unfillable blocks.
(markdown-ts--fill-html-comment): New HTML comment filler with
continuation alignment.
(markdown-ts--block-quote-prefix): New helper preserving
existing block quote marker style.
(markdown-ts--fill-block-quote): New block quote filler with
list item text column alignment.
(markdown-ts-emphasis-alist): New alist of emphasis markers.
(markdown-ts--emphasis-node-at-point): New tree-sitter based
emphasis detection.
(markdown-ts-remove-emphasis): New command removing emphasis at
point or region.
(markdown-ts-emphasize): New interactive emphasis insertion with
region wrapping and word-at-point support.
(markdown-ts-insert-structure): New command for inserting code
blocks, block quotes, and dividers.
(markdown-ts--insert-code-block): New function with language
completion from known modes.
(markdown-ts--insert-block-quote): New function with region
wrapping.
(markdown-ts--insert-divider): New function for horizontal
rules.
(markdown-ts--apply-ellipsis): New function applying custom
ellipsis via display table.
(markdown-ts--set-up): Rename from markdown-ts-setup.
(markdown-ts-outline-cycle): New TAB command cycling outline
visibility on headings.
(markdown-ts-mode-map): New keymap for code block navigation,
bindings for heading navigation, structure editing, emphasis,
and list operations.
(markdown-ts-code-block-in-context-mode-map): New keymap for
code block context.
(markdown-ts-mode-menu): New menu bar with Show/Hide, Navigate
Headings, Edit Structure, and Editing sections.
(markdown-ts-mode): Add outline-minor-mode, ellipsis, folding,
fill-paragraph integration, code-block-context-mode hooks,
comment settings, and outline-view-change-hook.  Use
markdown-ts-mode directly in auto-mode-alist instead of
markdown-ts-mode-maybe.
(markdown-ts-mode-install-parsers): New command for installing
required and optional tree-sitter language grammars.
(markdown-ts-code-block-context-mode): New minor mode for code
block context.
(markdown-ts--find-code-block-delimiter)
(markdown-ts--find-next-code-block-delimiter): New helpers for
locating fenced code block delimiter nodes.
(markdown-ts-move-to-next-code-block)
(markdown-ts-move-to-previous-code-block): New commands for
navigating between fenced code blocks.
(markdown-ts--table-abutting-pos, markdown-ts--table-node-cell)
(markdown-ts--table-node-row, markdown-ts--table-parse-error-p):
New pipe table node helpers.
(markdown-ts-at-table-p): New predicate returning non-nil when
point is at or within a pipe table.
(markdown-ts--enable-in-table-mode): New helper enabling
markdown-ts-in-table-mode from post-command-hook.
(markdown-ts--table-body-row-near-pos): New helper locating the
nearest body row to a position.
(markdown-ts--table-compute-node-column)
(markdown-ts-table--goto-column): New helpers for column-based
table navigation.
(markdown-ts--table-aligners, markdown-ts--table-make-aligner)
(markdown-ts--table-align-cell): New table cell alignment
helpers.
(markdown-ts-table-insert-table): New command to insert a pipe
table with configurable rows and columns.
(markdown-ts-table-delete-table): New command to delete the pipe
table at point.
(markdown-ts-table-previous-row, markdown-ts-table-next-row)
(markdown-ts-table-previous-cell, markdown-ts-table-next-cell):
New commands for navigating table rows and cells.
(markdown-ts-table-insert-row-below)
(markdown-ts-table-insert-row-above)
(markdown-ts-table-clone-row-below)
(markdown-ts-table-clone-row-above)
(markdown-ts-table-insert-row): New commands for inserting and
cloning table rows.
(markdown-ts-table-delete-row, markdown-ts-table-move-row-up)
(markdown-ts-table-move-row-down, markdown-ts-table-move-row):
New commands for deleting and moving table rows.
(markdown-ts-table-insert-column-left)
(markdown-ts-table-insert-column-right)
(markdown-ts-table-clone-column-left)
(markdown-ts-table-clone-column-right)
(markdown-ts-table-insert-column): New commands for inserting
and cloning table columns.
(markdown-ts-table-delete-column)
(markdown-ts-table-move-column-left)
(markdown-ts-table-move-column-right)
(markdown-ts-table-move-column): New commands for deleting and
moving table columns.
(markdown-ts-table-align-column-left)
(markdown-ts-table-align-column-center)
(markdown-ts-table-align-column-right)
(markdown-ts-table-align-column): New commands for setting
column alignment.
(markdown-ts-table-align-table): New command to align all
columns in the table at point.
(markdown-ts-table-transpose-table): New command to transpose
the table at point.
(markdown-ts-table-convert-csv-region)
(markdown-ts-table-convert-tsv-region)
(markdown-ts-table-convert-region): New commands to convert
delimited text regions to pipe tables.
(markdown-ts-table-export-table-csv)
(markdown-ts-table-export-table-tsv)
(markdown-ts-table-export-table): New commands to export the
pipe table at point to CSV or TSV format.
(markdown-ts-in-table-mode-map): New keymap for
markdown-ts-in-table-mode.
(markdown-ts--code-block-in-context-mode-ov): New buffer-local
variable for code block context overlay.
(markdown-ts--code-block-in-context-mode-update-ov): New
function updating the code block context overlay.
(markdown-ts-in-table-mode): New minor mode enabled when point
is within a pipe table, activating markdown-ts-in-table-mode-map.
(markdown-ts--in-table-mode-ov)
(markdown-ts--in-table-mode-get-ov)
(markdown-ts--table-tick-update)
(markdown-ts--table-tick-stale-p)
(markdown-ts--in-table-mode-update-ov): New helpers supporting
markdown-ts-in-table-mode overlay management.
(markdown-ts-table-mode): New minor mode providing table editing
commands and auto-alignment.
(markdown-ts-mode-maybe): Remove; auto-mode-alist now uses
markdown-ts-mode directly.
Auto-mode-alist: Add .markdown and .mdx extensions.

* lisp/textmodes/markdown-ts-mode-x.el: New file providing extra
features for markdown-ts-mode.
(markdown-ts-commonmark-spec-url, markdown-ts-gfm-spec-url): New
constants for CommonMark and GFM specification URLs.
(markdown-ts-browse-commonmark-spec)
(markdown-ts-browse-gfm-spec): New commands to browse the
CommonMark and GFM specifications.
(markdown-ts-convert): New customization group for Markdown
conversion/export features.
(markdown-ts-default-converter): New option to set the default
format and converter for Markdown export.
(markdown-ts-convert-display-function): New option specifying
the function used to display converted output.
(markdown-ts-converters): New variable listing format/converter
configurations for pandoc, cmark, cmark-gfm, markdown, and
markdown.pl.
(markdown-ts-convert-file, markdown-ts-convert): New commands to
convert Markdown buffers or files to HTML, PDF, and other
formats via external converters.
(markdown-ts-toc): New customization group for table of contents
features.
(markdown-ts-toc-generate-warn-if-none): New option controlling
behavior when no TOC is found during generation.
(markdown-ts-toc-update-before-save-mode-lighter): New option
for the before-save TOC update minor mode lighter string.
(markdown-ts-toc-slug-function): New option to select the slug
algorithm used for TOC heading anchors.
(markdown-ts--toc-handles, markdown-ts--toc-handle-classes): New
variables defining TOC handle types and classes.
(markdown-ts--toc-expand-candidate-handles, markdown-ts--tocs)
(markdown-ts--tocs-sanity-check)
(markdown-ts--toc-collect-candidates)
(markdown-ts--toc-list-item-depth)
(markdown-ts--toc-atx_header-normalize)
(markdown-ts--toc-text-normalizers)
(markdown-ts--toc-text-normalize): New internal helpers for TOC
parsing and text normalization.
(markdown-ts-toc-update-before-save-mode): New minor mode that
regenerates tables of contents before saving.
(markdown-ts-toc-clear-and-remove, markdown-ts-toc-clear): New
commands to remove or clear TOC bodies.
(markdown-ts-toc-insert-template): New command to insert a TOC
template at point.
(markdown-ts-toc-generate): New command to generate tables of
contents in the current buffer.

Includes fixes for: (bug#80613) (bug#80625) (bug#80690)

Co-authored-by: Stéphane Marks <shipmints@gmail.com>
2026-05-05 00:22:46 -07:00
Eli Zaretskii
151ea29a8e ; Fix doc string of 'elisp-fontify-semantically' (bug#80948)
* lisp/progmodes/elisp-mode.el (elisp-fontify-semantically): Doc fix.
2026-05-05 10:05:28 +03:00
Eli Zaretskii
b20307c4c7 ; Fix doc strings of timer-set-* functions
* lisp/emacs-lisp/timer.el (timer-set-time, timer-set-idle-time):
Doc fix.
2026-05-05 07:59:08 +03:00
Stefan Monnier
ed1fe2ca95 nadvice.el: Make it easier to find how to change an interactive-form
* lisp/emacs-lisp/nadvice.el (advice--how-alist): Add ':interactive-only'.
* doc/lispref/functions.texi (Advice Combinators): Document it.
(Core Advising Primitives): Use it.
2026-05-04 20:21:51 -04:00
Stefan Monnier
bc4a4500fc lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): Avoid obsolete "face vars" 2026-05-04 19:37:02 -04:00
Stefan Monnier
a952324e9b keyboard.c: Allow SIGINT to quit in batch mode, instead of exit
In terminal sessions, SIGINT is turned into a `quit` ELisp signal,
but in batch it has traditionally killed Emacs.  It can be very
useful to cause a `quit` from outside the process when running
in batch (e.g. for "batch" sessions that provide a REPL via stdin/out),
so add a new var 'kill-emacs-on-sigint' to control that behavior.
(bug#80942)

* src/keyboard.c (handle_interrupt_signal): Obey `kill_emacs_on_sigint`.
(init_keyboard): Use `deliver_interrupt_signal` for SIGINT also for
batch sessions.
(syms_of_keyboard): New variable `kill_emacs_on_sigint`.

* test/src/keyboard-tests.el (keyboard-sigint-to-quit): New test.

* doc/emacs/cmdargs.texi (Initial Options): Mention the effect of
`kill-emacs-on-sigint` in batch mode.
2026-05-04 12:49:35 -04:00
Michael Albinus
9c0a699c59 Adaot tramp-tests.el
* test/lisp/net/tramp-tests.el (ert-remote-temporary-file-directory):
Ensure that it is expanded.
2026-05-04 16:09:10 +02:00
Michael Albinus
cbc912ed63 ; * admin/notes/jargon: Add entries. 2026-05-04 16:08:43 +02:00
Michael Albinus
0848cbb326 * admin/notes/documentation: Recommend not using "it's". 2026-05-04 16:08:22 +02:00
Michael Albinus
ee1cbd9775 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2026-05-04 16:07:29 +02:00
João Távora
e24d9232e0 Jsonrpc: add new tests using Python subprocesses
Most of these tests are for the scontrol/"anxious continuation"
mechanism (bug#80623)

The new ERT tests use Python subprocesses via stdin/stdout pipe as
JSONRPC endpoints.  A shared framing library lives in
jsonrpc-resources/common.py.

* test/lisp/jsonrpc-tests.el (jsonrpc--test-dir): New constant.
(jsonrpc--with-python-fixture): New macro.
(scontrol-remote-during-sync-1)
(scontrol-remote-during-sync-2)
(scontrol-anxious-nested)
(scontrol-remote-error)
(shutdown-clean-after-notification): New tests.

* test/lisp/jsonrpc-resources/common.py: New file.

* test/lisp/jsonrpc-resources/server-remote-during-sync-1.py: New file.

* test/lisp/jsonrpc-resources/server-remote-during-sync-2.py: New file.

* test/lisp/jsonrpc-resources/server-anxious-nested.py: New file.

* test/lisp/jsonrpc-resources/server-remote-error.py: New file.

* test/lisp/jsonrpc-resources/server-harakiri.py: New file.
2026-05-04 13:32:37 +01:00
João Távora
9b3855e164 Jsonrpc: rework sync request handling (bug#80623)
When the remote endpoint is handling a local request 'LR' it can
sometimes make a remote sync request 'RR' as part of its handling.  Some
endpoints (like Go's gopls) wait for Emacs's reply to 'RR' before
responding to 'LR'.  Others (like Julia's JETLS) respond to 'LR'
immediately, and only then wait for Emacs's reply to 'RR'.  Both
approaches are valid.  However, in the latter case, the handling of 'RR'
(which could well be waiting for user input from the minibuffer to
complete) is vulnerable to 'throw' from process filters handling (which
is just what happens when the endpoints replies to 'LR'), so if that
happens it will unexpectedly be aborted when the reply to 'LR' comes in,
suprising the user and causing a spurious -32603 reply to be sent.

To solve this problem, this commit first refactors the sync
request/anxious queue handling and replace plain integer keys of the
rebaptized "scontrol" alist with structured (:local ID) / (:remote ID)
pairs, using `equal' for comparisons.  This is to introduce some
clarity/sanity into this somewhat hairy code.

Then, the 'RR' situation is fixed: we push a (:remote ID) entry onto the
top of the 'jsonrpc-connection--control' stack and only then call
rdispatcher.  Any 'LR' reply arriving during dispatch is deferred as an
"anxious" continuation rather than firing its `throw' immediately.  When
rdispatcher is done, we call jsonrpc--continue at a safe point, this
will run any "anxious" continuations.

* lisp/jsonrpc.el (jsonrpc-connection): Rename -sync-request-alist to
-scontrol; accessor from jsonrpc--sync-request-alist to
jsonrpc--scontrol; update docstring for new key structure.

(jsonrpc-connection-receive): Update with-slots binding to scontrol.
Tighten anxious check to match (:local ID) keys with `equal'.  In
remote-request branch, push (:remote ID) entry before rdispatcher and
call jsonrpc--continue after jsonrpc--reply.

(jsonrpc-request): Pass (:local ID) to jsonrpc--continue.

(jsonrpc--continue): Use jsonrpc--scontrol; change `=' to `equal' in
sanity check.
p
(jsonrpc--async-request-1): Push (:local ID) entry.

(jsonrpc--log-event): Use jsonrpc--scontrol.
2026-05-04 11:47:21 +01:00
Dmitry Gutov
9ff0768804 Re-add a call to clear_under_internal_border in clear_garbaged_frames
* src/xdisp.c (clear_garbaged_frames): Re-add the call to
clear_under_internal_border, reverting that part of commit
a6a3b32208 as not essential to the fix (bug#80662).
2026-05-04 05:22:03 +03:00
Philip Kaludercic
9be140466a
Ensure package archives are loaded for 'package-isolate'
* lisp/emacs-lisp/package.el (package-isolate): Use
'package--archive-contents' instead of the actual variable, to
ensure that we load the archive contents if missing.  This is
likely the case if 'package-isolate' is the first package
function invoked during a session.
2026-05-03 20:25:53 +02:00
Philip Kaludercic
75a36bde59
Add for <picture> to 'html-tag-alist' and 'html-tag-help'
* lisp/textmodes/sgml-mode.el (html-tag-alist): Add very basic skeleton.
(html-tag-help): Add description.
2026-05-03 20:25:53 +02:00
Philip Kaludercic
f2de11f1f0
Add for <details> to 'html-tag-alist' and 'html-tag-help'
* lisp/textmodes/sgml-mode.el (html-tag-alist): Add skeleton.
(html-tag-help): Add description.
2026-05-03 20:25:53 +02:00
Philip Kaludercic
9f6cf73b8e
Prevent indentation within whitespace sensitive HTML tags
* lisp/textmodes/sgml-mode.el (sgml-whitespace-sensitive-tags):
Add new variable.
(sgml-calculate-indent): Check if in the context of a tag
specified by 'sgml-whitespace-sensitive-tags'.
(html-mode): Set 'sgml-whitespace-sensitive-tags' to not adjust
the indentation within <pre> and <textarea> tags.
2026-05-03 20:25:53 +02:00
Philip Kaludercic
29f2c6eee0
Use 'read-shell-command' to read SGML validation command
* lisp/textmodes/sgml-mode.el (sgml-validate): Update
interactive spec.
2026-05-03 20:25:53 +02:00
Philip Kaludercic
77e968b97c
Raise an error if 'sgml-validate-command' is not configured
* lisp/textmodes/sgml-mode.el (sgml-validate-command): If no
known program is installed, fall back to nil as the default
value instead of a warning message.
2026-05-03 20:25:53 +02:00
Philip Kaludercic
c704ae0ffc
Implement 'sgml-name-8bit-mode' as a proper minor mode
* lisp/textmodes/sgml-mode.el (sgml-name-8bit-mode): Merge
'defcustom' and 'defun' into a 'define-minor-mode'.
2026-05-03 20:25:53 +02:00
Philip Kaludercic
dbc2e073c0
Refine SGML offset user option types
* lisp/textmodes/sgml-mode.el (sgml-basic-offset)
(sgml-attribute-offset): Allow natural numbers, not arbitrary
integers.
2026-05-03 20:25:53 +02:00
Philip Kaludercic
7a710c3c0e
Allow setting 'sgml-xml-mode' buffer locally
* lisp/textmodes/sgml-mode.el (sgml-xml-mode): Add :safe property.
2026-05-03 20:25:53 +02:00
Philip Kaludercic
fe58f45782
Allow changing SGML "quick keys" after loading sgml-mode.el
* lisp/textmodes/sgml-mode.el (sgml-quick-keys): Replace with
user option, that adjusts 'sgml-mode-map'.
(sgml-mode-map): Don't insert quick keys.
(html-quick-keys): Replace with user option, that adjusts
'html-mode-map'.
(html-mode-map): Don't insert quick keys.
2026-05-03 20:25:53 +02:00
Stefan Monnier
e682959b6b (package--builtin-alist): Don't use defconst since we later change it
* lisp/emacs-lisp/package.el (package--builtin-alist): Use `defvar`.
2026-05-03 13:32:51 -04:00
Vincent Belaïche
a1739bc75e ; * doc/translations/fr/misc/ses-fr.texi: Typo. 2026-05-03 17:44:09 +02:00
Juri Linkov
5beeb4446f * lisp/treesit.el (treesit-outline-level): Add guard condition. 2026-05-03 18:38:43 +03:00
Matto Fransen
963d2ebffb ; * doc/lispintro/emacs-lisp-intro.texi: Update *Backtrace* outputs.
Copyright-paperwork-exempt: yes
2026-05-03 12:06:54 +01:00
Manuel Giraud
d0f72ef864 Gnus logo in server buffer's mode line (bug#80850)
* lisp/gnus/gnus-srvr.el (gnus-server-mode): Initialize needed
format specifications and call 'gnus-set-mode-line' for the
server buffer.
* lisp/gnus/gnus-sum.el (gnus-set-mode-line): Handle when WHERE
is set to 'server.
* lisp/gnus/gnus.el (gnus-updated-mode-lines): Add server.
2026-05-03 12:01:21 +01:00
Eshel Yaron
7c70816066
Remove 'completion-preview--is-calling'
We decided to leave it out for now, see discussion at
https://yhetil.org/emacs/jwvqzntzvvg.fsf-monnier+emacs@gnu.org/
This brings completion-preview.el back to how it were before
commit a24ff52a79.

* lisp/completion-preview.el (completion-preview--is-calling):
Delete.
(completion-preview--capf-wrapper): Adapt.
2026-05-02 21:46:31 +02:00
Stephen Berman
e05fab5775 Fix 'vc-dir-resynch-file' (bug#80803)
* lisp/vc/vc-dir.el (vc-dir-resynch-file): Apply 'file-truename'
instead of 'expand-file-name' to FNAME argument to prevent
spurious display of symlinked files in *vc-dir* buffer.
2026-05-02 15:11:37 +02:00
Eli Zaretskii
e420725935 ; * lisp/emacs-lisp/subr-x.el (work-buffer--release): Autoload (bug#80947). 2026-05-02 14:34:59 +03:00
Eshel Yaron
939e5956d9
Demote 'completion-preview-is-calling'
See discussion at
https://yhetil.org/emacs/87pl3egzww.fsf@mail.eshelyaron.com/

* lisp/completion-preview.el (completion-preview-is-calling):
Rename to...
(completion-preview--is-calling): ...this.
(completion-preview--capf-wrapper): Update accordingly.
* etc/NEWS: Remove announcement.
2026-05-02 13:33:51 +02:00
Chris Roberts
b376c405aa ; Add a test for sqlite-close
* test/src/sqlite-tests.el (sqlite-closed-db): Add test.
(Bug#80908)

Copyright-paperwork-exempt: yes
2026-05-02 14:20:42 +03:00
Eli Zaretskii
d51a472231 ; * src/sfnt.c (sfnt_read_name_table): Avoid 32-bit overflow. 2026-05-02 14:17:14 +03:00
Eli Zaretskii
0d0891c1bb ; Fix an issue with counting glyphs on TTY frames
* src/dispnew.c (fake_current_matrices): Fix the 'used' count of
glyphs for the right margin and the text-area.  (Bug#80900)
2026-05-02 13:26:46 +03:00
Eli Zaretskii
25659d5a75 ; * lisp/emacs-lisp/pcase.el (pcase-exhaustive): Doc fix. 2026-05-02 13:10:33 +03:00
Eli Zaretskii
e575817e8f ; Improve documentation of Emacs server-client protocol
* lib-src/emacsclient.c (main):
* lisp/server.el (server-process-filter): Document the protocol
requirements regarding the terminating newline.  (Bug#80807)
2026-05-02 12:35:48 +03:00
João Távora
2207a58899 Eglot: find well behaved UTF char for code actions (bug#80326)
* lisp/progmodes/eglot.el (eglot-code-action-indicator): No lighbulb, no
fancy lightning bolt, just use zigzags which seem to display well on
typical fonts and typically have a width of 1.
2026-05-02 09:56:41 +01:00