Commit graph

182231 commits

Author SHA1 Message Date
João Távora
13b29eebc1 Eglot: use standard face for completion annotations (bug#81088)
* lisp/progmodes/eglot.el (eglot-completion-at-point): Use
completions-annotations face, not font-lock-function-name-face.
2026-05-21 10:33:37 +01:00
Juri Linkov
655302cc21 Fix 'shr-outline-search' (bug#81073)
* lisp/net/shr.el (shr-outline-search):
Don't check for the beginning of the line.
Suggested by Omar Antolín Camarena <omar@im.unam.mx>.
Confirmed by Rahguzar <rahguzar@mailbox.org>.
2026-05-20 18:41:59 +03:00
Michael Albinus
1754015c60 Improve auth-source-backend-parse
* lisp/auth-source.el (auth-source-backend-parse): Use `run-hook-wrapped'.
Suggested by Augusto Stoffel <arstoffel@gmail.com>.
Transform a warning into a debug message.
2026-05-20 10:10:30 +02:00
João Távora
8f31ccbf82 Eglot: announce markdown support for completion docs
No reason not to.  Tested with gfm-view-mode and markdown-ts-mode

* lisp/progmodes/eglot.el (eglot-client-capabilities): Annouce
markdown support for completion docs.
2026-05-20 00:51:57 +01:00
Rahul Martim Juliato
aad170d1ed markdown-ts-mode: hide fence lines in view-mode (bug#81081)
* lisp/textmodes/markdown-ts-mode.el
(markdown-ts--fontify-delimiter): When `markdown-ts-hide-markup'
is enabled in `markdown-ts-view-mode', also hide the whole line
containing a `fenced_code_block_delimiter' (including its
terminating newline) so Eldoc/LSP markdown snippets render
without stray blank lines around the code block.  Scoped to
view-mode and to fenced delimiters on purpose: the same handler
is shared by inline delimiters (emphasis, code span, link
brackets) where munching surrounding whitespace would collapse
word separators, and tuning rendering for
hide-markup-while-editing is not a goal.
2026-05-20 00:35:49 +01:00
João Távora
133d1d591c markdown-ts-mode: align default face definitions with markdown-mode
Match the out-of-the-box appearance of markdown-ts-mode to the
non-tree-sitter markdown-mode package, making switching between modes
less jarring.

* lisp/textmodes/markdown-ts-mode.el (markdown-ts-delimiter)
(markdown-ts-heading-1, markdown-ts-heading-2, markdown-ts-heading-3)
(markdown-ts-heading-4, markdown-ts-heading-5, markdown-ts-heading-6)
(markdown-ts-block-quote, markdown-ts-code-block, markdown-ts-code-span)
(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-table, markdown-ts-table-header, markdown-ts-table-cell)
(markdown-ts-table-delimiter-cell, markdown-ts-language-keyword)
(markdown-ts-list-marker, markdown-ts-hard-line-break-backslash)
(markdown-ts-hard-line-break-backslash-hidden)
(markdown-ts-hard-line-break-space-hidden)
(markdown-ts-task-unchecked, markdown-ts-task-checked): Tweak.
2026-05-20 00:35:39 +01:00
Stéphane Marks
e0aeee2dc5 Fix markdown-ts-mode atx_heading face computation (bug#81042)
The grammar reports leading spaces as part of the atx_heading "marker"
and we cannot use the length of the marker as a result.  Instead, count
the number of consecutive # after any blanks to determine its "level."

* lisp/textmodes/markdown-ts-mode.el
(markdown-ts--fontify-atx-heading): Count the octothorpes rather
than using the length of the marker node's text.
2026-05-20 00:35:16 +01:00
Stéphane Marks
997fc2cef7 Allow markdown-ts--run-command-in-code-block to ignore output (bug#81041)
Do not assume every command run in
'markdown-ts--run-command-in-code-block' produces output that needs to
be merged from the temp/work buffer into the source buffer.  One example
is 'xref-find-definitions', the temp buffer of which is unrelated to the
source buffer.

* lisp/textmodes/markdown-ts-mode.el
(markdown-ts-code-block-commands): Add 'complete-symbol'.
(markdown-ts-code-block-ignore-output-commands): New defvar.
(markdown-ts--run-command-in-code-block): Ignore command output
when necessary.
2026-05-20 00:34:39 +01:00
Lin Sun
7d84e69a34 hideshow: Menu entry for 'hs-toggle-all'
* lisp/progmodes/hideshow.el: Menu entry for hs-toggle-all (bug#81045).
2026-05-19 18:30:57 +03:00
Eli Zaretskii
e90cafc288 ; * doc/lispref/display.texi (Displaying Faces): Mention 'margin' face. 2026-05-19 15:13:04 +03:00
Eli Zaretskii
520c5b7c71 ; * doc/lispref/text.texi (Special Properties): Fix last change. 2026-05-19 13:57:47 +03:00
Stefan Monnier
8095fbef77 doc/lispref/text.texi: Add complement to commit f4a1c00656
* doc/lispref/text.texi (Examining Properties): Mention the change in
cursor-sensor-functions.
2026-05-18 18:47:47 -04:00
João Távora
9436d92c5d Eglot: fix eglot--format-makrup when MARKUP just a string
* lisp/progmodes/eglot.el (eglot--format-markup): Fix case where
markup is string.
2026-05-18 23:14:49 +01:00
F. Jason Park
9ba65aa965 Fix missing margin face on display prop in erc-stamp
* lisp/erc/erc-stamp.el (erc-insert-timestamp-right): Explicitly add
face to right-hand stamp's `display' margin string.  Commit d24b10ca
"Introduce 'margin' face for window margin background" did away with the
"fall-through" behavior in which a margin spec's string that lacks its
own face property inherited whatever the associated `display' char
happened to have.  (Bug#80693)

;; The old language in "(elisp) Display Margins" said "if the
;; string to be displayed in the margin doesn't specify a face, its
;; face is determined using the same rules and priorities as it is
;; for strings displayed in the text area (see Displaying Faces),"
;; and that "if this results in undesirable 'leaking' of faces into
;; the margin, make sure the string has an explicit face specified
;; for it."  It seems ERC and likely more than a few other packages
;; never came to heed this guidance and have erroneously depended
;; on such behavior for years if not decades.
;;
;; * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld:
;; * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld:
;; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld:
;; * test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld:
;; * test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld:
;; * test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld:
;; * test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld:
;; * test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld:
;; * test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: Update
;; snapshot.
2026-05-18 15:07:34 -07:00
Sean Whitton
28a13b01c7 vc-refresh-state: Override default-directory for backend functions
I ran into the issue described in the comment with the current
code in project-find-file-in and project-find-dir, when using
'C-x p p' to switch between projects.

* lisp/vc/vc-hooks.el (vc-refresh-state): When calling into the
backend, override any let-bindings of default-directory.
2026-05-18 22:15:29 +01:00
João Távora
389874c533 Eglot: unbreak for treesit-less builds
* lisp/progmodes/eglot.el
(eglot--builtin-mdown-p): New helper.
(eglot--accepted-formats)
(eglot--format-markup): Use it.
2026-05-18 20:53:15 +01:00
Joshua Murphy
10e91e096d Get selected item in newsticker list view
* lisp/net/newst-treeview.el
(newsticker--treeview-get-selected-item): If an item is already
selected, use it.  (Bug#80972)

Copyright-paperwork-exempt: yes
2026-05-18 19:51:04 +03:00
João Távora
6bd73af241 ; * test/lisp/jsonrpc-tests.el: Adjust timeouts for CI EMBA testing 2026-05-18 17:22:30 +01:00
João Távora
eb90c528f3 ; * lisp/progmodes/eglot.el (eglot-code-action-indications): Tweak. 2026-05-18 16:27:35 +01:00
Eli Zaretskii
1d7d6ffedb ; * etc/PROBLEMS: Fix entries about display of Emoji on TTY (bug#81052). 2026-05-18 16:36:05 +03:00
Brian Leung
6c1829bf4c Eglot: fix thinko in recent markdown-related commit (bug#81063)
* lisp/progmodes/eglot.el (eglot--format-markup): Correct return value
for gfm-view-mode.
2026-05-17 19:28:16 +01:00
João Távora
36036e71c0 Jsonrpc: migrate more tests to Python subprocess fixtures
All tests now use 'jsonrpc--with-python-fixture' with a Python3
subprocess instead of the in-Emacs TCP server.  Changed the "harakiri"
method to be a request instead of a notification for to reduce chance of
"Sentinel hasn't run" warning.

The two in-Emacs-RPC-specific error tests ('errors-with--32601' and
'signals-an--32603-JSONRPC-error') are dropped with the fixture itself,
as the error paths they exercise are internal to the Emacs Lisp
dispatcher and have no direct Python equivalent.  They will have to be
re-done later on in other form.

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

* test/lisp/jsonrpc-resources/server-anxious-nested.py: Use new
  harakiri.

* test/lisp/jsonrpc-resources/server-emacsrpc.py: Use new harakiri.

* test/lisp/jsonrpc-resources/server-harakiri.py: Use new harakiri.

* test/lisp/jsonrpc-resources/server-remote-during-sync-1.py: Use new
  harakiri.

* test/lisp/jsonrpc-resources/server-remote-during-sync-2.py: Use new
  harakiri.

* test/lisp/jsonrpc-resources/server-remote-error.py: Use new harakiri.

* test/lisp/jsonrpc-resources/common.py (harakiri): New definition.

* test/lisp/jsonrpc-tests.el
(jsonrpc--with-python-fixture): Rework, move up.
(jsonrpc-connection-ready-p): Move up.
(jsonrpc--call-with-emacsrpc-fixture)
(jsonrpc--with-emacsrpc-fixture)
(errors-with--32601)
(signals-an--32603-JSONRPC-error): Remove.
(returns-3, times-out, doesnt-time-out, stretching-it-but-works)
(deferred-action-toolate, deferred-action-intime)
(deferred-action-complex-tests): Migrate to Python fixture.
(scontrol-remote-during-sync-1, scontrol-remote-during-sync-2)
(scontrol-anxious-nested, scontrol-remote-error)
(shutdown-clean-after-notification): Tweak.
2026-05-17 19:28:07 +01:00
João Távora
0977d5915d Eglot: add left-fringe code action indicator (bug#80326)
The fringe indicator uses a custom lightning-bolt bitmap, an alternative
to the margin indicator on GUI frames.  It is non-interactive, however.

* lisp/progmodes/eglot.el (eglot--fringe-action): New fringe bitmap.

(eglot-code-action-indications): Add 'left-fringe' to default value
and to docstring.  Update incompatibility note.

(eglot-code-action-suggestion): Handle 'left-fringe' indication.
2026-05-17 19:24:53 +01:00
Michael Albinus
b7825c3a27 Fix auth-source-backends-parse
* lisp/auth-source.el (auth-source-backend-parse): Drop backends
of type `ignore'.  (Bug#81024)
(auth-source-backends): Drop duplicate backends.
2026-05-17 18:21:49 +02:00
Eli Zaretskii
d89054627c Fix updates of embedded formulas by 'calc-embedded-update-formula'
* lisp/calc/calc-embed.el (calc-embedded-update): Use
'buffer-substring' to better track the string representation of
the formula when it is being edited.  Suggested by
gnu@publik.slmail.me.  Also, update commentary.  (Bug#80901)
2026-05-17 10:57:53 +03:00
Eli Zaretskii
1832a93547 ; * src/fns.c (Fequal): Doc fix. 2026-05-17 10:37:01 +03:00
Eli Zaretskii
f68e7a0a41 ; Improve documentation of commands that move by compilation errors
* lisp/simple.el (next-error):
* lisp/progmodes/compile.el (compilation-next-error)
(compilation-previous-error): Doc fixes.
2026-05-17 09:05:13 +03:00
Eli Zaretskii
cf96e9cb5a ; Fix byte-compilation warnings in non-Tree-Sitter builds
* lisp/progmodes/eglot.el (treesit-grammar-location):
* lisp/treesit.el (treesit-grammar-location): Declare.
2026-05-16 14:13:56 +03:00
Eli Zaretskii
23575adc7b ; * doc/lispref/variables.texi (Local Variables): Fix types (bug#81004). 2026-05-16 13:43:53 +03:00
Eli Zaretskii
8b6fb2f646 ; * doc/lispref/variables.texi (Local Variables): Fix 'named-let'. 2026-05-16 13:16:09 +03:00
Eli Zaretskii
d3c72b8389 ; * src/xdisp.c (display_line): Fix commentary (bug#80693). 2026-05-16 11:54:43 +03:00
Andrea Alberti
a981517b72 Fill margins with 'margin' face on truncated screen lines
* src/xdisp.c (display_line): Remove the unnecessary condition that
row->used of the margin areas is zero, for when we call
'extend_face_to_end_of_line'.  (Bug#80693)
2026-05-16 11:48:34 +03:00
Manuel Giraud
8e37499035 ; * doc/lispref/os.texi (Init File): Fix markup (bug#81049). 2026-05-15 15:27:23 +03:00
Eli Zaretskii
f4c326c378 ; * src/sfnt.c (sfnt_read_cmap_format_12): Assert there's no overflow. 2026-05-15 15:00:35 +03:00
Eli Zaretskii
bf89ee6d07 ; * etc/PROBLEMS: Cursor not shown on Windows with system caret (bug#81047). 2026-05-15 10:20:31 +03:00
Eshel Yaron
20500d6200
; htmlfontify: Handle 'reset' face attribute value (bug#81032)
* lisp/htmlfontify.el (hfy-face-to-style-i): Add special
handling for the 'reset' face attribute value.
2026-05-14 17:11:43 +02:00
Michael Albinus
d0d657fa90 ; Minor Tramp cleanup
* lisp/net/tramp.el (tramp-unquote-shell-quote-argument): Do not
expand remote file names w/o a localname.

* test/lisp/net/tramp-tests.el
(tramp--test-supports-environment-variables-p): New defun.
(tramp-test33-environment-variables): Use it.
2026-05-14 12:31:04 +02:00
Eli Zaretskii
93ea0d7d28 ; Improve documentation of VC commands in Dired
* doc/emacs/dired.texi (Misc Dired Features): Move VC reference
from here...
(Operating on Files): ...to here.  Add other VC commands supported
by Dired.
* doc/emacs/maintaining.texi (Old Revisions, VC Change Log): Fix
cross-references.
2026-05-14 13:12:21 +03:00
João Távora
318084829c Eglot: adjust reference to completion frontends in manual
* doc/misc/eglot.texi (Eglot Features): Rework.
2026-05-14 11:05:30 +01:00
João Távora
2a166c2dbd Eldoc: display documentation in visual-line-mode
Documentation is overwhelmingly prose and intended to be viewed,
not edited.  Using visual-line-mode allows members of
'eldoc-doc-functions' to provide long lines that correctly fill
to the window width.

* lisp/emacs-lisp/eldoc.el (eldoc--format-doc-buffer): Use
visual-line-mode.
2026-05-14 11:05:30 +01:00
João Távora
aba60ad0c5 Eglot: prefer markdown-ts-view-mode for markup rendering (bug#80127)
Eglot previously needed gfm-view-mode from markdown-mode.el to render
Markdown from LSP servers.  It now prefers markdown-ts-view-mode when
available.

* lisp/progmodes/eglot.el (eglot--accepted-formats): Recognize
markdown-ts-view-mode as a Markdown renderer.
(eglot--format-markup): Rework with cl-labels; prefer
markdown-ts-view-mode over gfm-view-mode.

* doc/misc/eglot.texi (Eglot Features): Don't mention
markdown-mode directly.

* etc/EGLOT-NEWS: Mention change
2026-05-14 11:05:30 +01:00
Rahul Martim Juliato
689c3bd508 Use 'read-multiple-choice' in 'markdown-ts-mode' (bug#81027)
Replace the "c" character-prompt interactive spec with
'read-multiple-choice', which presents named options instead of
requiring users to decode the prompt string and type a single
character.

* lisp/textmodes/markdown-ts-mode.el
(markdown-ts-table-align-column): Use 'read-multiple-choice'.
Adjust ALIGN docstring punctuation.
* lisp/textmodes/markdown-ts-mode-x.el
(markdown-ts-toc-insert-template): Use 'read-multiple-choice'.
2026-05-14 11:05:30 +01:00
Rahul Martim Juliato
71809ee5df Fix 'markdown-ts-code-span' face (bug#81026)
* lisp/textmodes/markdown-ts-mode.el (markdown-ts-code-span):
Inherit from 'font-lock-keyword-face' rather than
'font-lock-string-face'.
2026-05-14 11:05:30 +01:00
Rahul Martim Juliato
286833e401 Add read-only 'markdown-ts-view-mode' (bug#81023)
This new derived mode is intended for consumers that render
Markdown content for display rather than editing, such as Eglot
and Eldoc when showing documentation popups and buffers.  It
pre-sets the relevant customizations (markup hidden, inline
images on, hard-line-break markup hidden, native code-block
fontification, table and code-block context minor modes off),
makes the buffer read-only, and uses its own keymap derived from
'special-mode-map' so navigation keys behave like a viewer.

A pre-init hook lets callers normalize buffer content before the
grammar parses it; 'markdown-ts-add-final-newline' is the
default so that markup depending on a terminating newline parses
correctly.  'markdown-ts-buffer-string' returns the rendered
buffer string with overlay faces flattened into text properties,
which is useful for callers that capture the rendered output.

Along the way: 'list_marker_parenthesis' is now recognized as an
ordered list marker; the strikethrough query is simplified to a
single rule; thematic breaks span the window via an ':extend'
underline when the face supports it.

* lisp/textmodes/markdown-ts-mode.el (markdown-ts-view-mode):
New read-only derived mode.
(markdown-ts-view-mode-map): New keymap.
(markdown-ts-view-mode-pre-init-hook): New hook, defaulting to
'markdown-ts-add-final-newline'.
(markdown-ts-mode--initialize): New helper, factored out of
'markdown-ts-mode' so 'markdown-ts-view-mode' can reuse the
parser readiness and setup logic after overriding local
variables.
(markdown-ts-mode): Call 'markdown-ts-mode--initialize'.
(markdown-ts-add-final-newline): New function.
(markdown-ts-buffer-string): New function.
(markdown-ts-unordered-list-marker): New defcustom.
(markdown-ts-hard-line-break-backslash)
(markdown-ts-hard-line-break-space): Accept the symbol 'hide.
(markdown-ts--fontify-hard-line-break): Honor 'hide.
(markdown-ts--fontify-atx-heading)
(markdown-ts--fontify-setext-heading)
(markdown-ts--fontify-atx-delimiter)
(markdown-ts--fontify-unordered-list-marker)
(markdown-ts--list-item-depth): New functions supporting clean
rendering when markup is hidden.
(markdown-ts--fontify-thematic-break): Use ':extend' underline
span when the face supports it.
(markdown-ts--resolve-display-value): Accept non-cons values.
(markdown-ts--list-ordered-item-p): Also recognize
'list_marker_parenthesis'.
(markdown-ts--range-settings): Mark markdown-inline embed as
':local t'.
(markdown-ts--set-up): Create the markdown-inline parser only in
the inline setup branch; drop the redundant
'markdown-ts-hide-markup' make-local-variable.
(markdown-ts--treesit-settings): Route atx and setext headings
to their dedicated fontifiers; route unordered list markers
through 'markdown-ts--fontify-unordered-list-marker'; move
'strikethrough' to the simpler paragraph-inline query.
2026-05-14 11:04:07 +01:00
Rahul Martim Juliato
b39c123490 Fix strikethrough in 'markdown-ts-mode' (bug#80991)
* lisp/textmodes/markdown-ts-mode.el
(markdown-ts--treesit-settings): Add a new font-lock block for
'paragraph-inline' that handles strikethrough nodes more
carefully.
2026-05-13 23:36:27 +01:00
Rahul Martim Juliato
0be998d4bc Fix code-span in headings in 'markdown-ts-mode' (bug#80979)
* lisp/textmodes/markdown-ts-mode.el
(markdown-ts--treesit-settings): Move the 'code_span' and
'code_span_delimiter' font-lock rules into a separate block with
':override prepend' instead of 'append'.  The heading feature
(level 1) applies its face via 'font-lock-append-text-property',
so a code span that later appends 'markdown-ts-code-span' ends
up with '(markdown-ts-heading-N markdown-ts-code-span)', where
the heading face takes priority and the code-span face is
suppressed.  Prepending ensures 'markdown-ts-code-span' appears
first in the face list and wins visually.
2026-05-13 23:36:27 +01:00
Stéphane Marks
a00beb3a31 Make 'markdown-ts-inline-images' buffer local and test for GUI (bug#80978)
* lisp/textmodes/markdown-ts-mode.el (markdown-ts-inline-images):
Now buffer local.
(markdown-ts--fontify-image): Defensively test for graphical
display before rendering images.
2026-05-13 23:36:27 +01:00
Michael Albinus
a0c05029fd * etc/NEWS: Mention new user option tramp-propagate-emacsclient-tramp. 2026-05-13 18:46:31 +02:00
Michael Albinus
2e71d2c709 Propagate EMACSCLIENT_TRAMP to remote hosts with Tramp
* doc/misc/tramp.texi (Remote processes):
Explain `tramp-propagate-emacsclient-tramp'.

* lisp/net/tramp.el (tramp-remote-process-environment): Adapt docstring.
(tramp-propagate-emacsclient-tramp): New defcustom.
(tramp-handle-make-process):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process)
(tramp-sh-handle-process-file): Use it.

* test/lisp/net/tramp-tests.el (tramp-test33-environment-variables):
Adapt test.
2026-05-13 18:39:04 +02:00
Stefan Monnier
ff96db93f2 keyboard-tests.el: Try and fix the failure on EMBA
* test/src/keyboard-tests.el (keyboard-sigint-to-quit): Fix a small
race condition and avoid `sit-for` returning early.
2026-05-13 11:10:15 -04:00