1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00
Commit graph

180202 commits

Author SHA1 Message Date
Stefan Monnier
4532f5ae8f (loaddefs-generate--emacs-batch): Fix bug#79821 again
Hopefully, this one is for good.
Use `file-truename` on all the input file/dir names to try and
make sure we don't get bitten any more by symlinks or driver
letter capitalization.

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Revert last change.
(loaddefs-generate--excluded-files): Remove test that's not needed any
more now that we use all relative names.
(loaddefs-generate--emacs-batch): Apply truename to all input files/dirs.
2025-11-18 17:33:11 -05:00
Stefan Monnier
be2b38ce14 (lisp-indent-function): Auto-load macros to get the indent info
Rather than preload the `lisp-indent-function` property for
autoloaded macros, auto-load them to fetch their property.
In terms of cost, this slightly reduces the heap size at
startup, while tending to increase the heap size while editing
ELisp code since more packages will be (auto)loaded.

The benefit is elsewhere: by loading the definition the macro we
will also load other (non-autoloaded) definitions, so we get
better behavior for things like `ert.el` and `inline.el` where
only some of the macros are autoloaded, because there's a good
chance that we'll end up loading them to indent the autoloaded
macro, after which indentation of the other macros will be
performed correctly (bug#68818).

* lisp/emacs-lisp/byte-run.el (byte-run--dont-autoload): New function.
(macro-declarations-alist): Use it to override `byte-run--set-indent`.

* lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Auto-load macros
if needed to get the indent info.
2025-11-18 17:23:11 -05:00
Anatolii Smolianinov
6b389a61c1 Eglot: use symbol at point as default in eglot-rename (bug#79757)
* lisp/progmodes/eglot.el (eglot-rename): Tweak.

Copyright-paperwork-exempt: yes
2025-11-18 20:53:55 +00:00
Juri Linkov
6b0cf8ab87 Display daemon startup warnings on the first client frame (bug#79783)
* lisp/emacs-lisp/warnings.el (display-warning): For warnings/errors
on the initial daemon frame use 'after-make-frame-functions'
to postpone their display until the first client frame is created.
(warning--display-buffer): New internal function refactored out of
'display-warning'.
2025-11-18 19:57:04 +02:00
Jonas Bernoulli
6415fc5e04
Update to Transient v0.11.0-10-g6637364e 2025-11-18 17:55:10 +01:00
Eshel Yaron
ce5d8ddb32
; Mention LSP semantic highlighting in the Emacs manual
* doc/emacs/display.texi (Semantic Font Lock): Mention
LSP-based semantic highlighting, refer to the Eglot manual.
2025-11-18 16:08:05 +01:00
Eli Zaretskii
0026445dd6 Fix MinGW build broken by integration of 'stdio-consolesafe'
* src/conf_post.h: Avoid redirecting '*printf' functions if
'OMIT_CONSOLESAFE' is defined to 1.
* nt/cmdproxy.c:
* nt/ddeclient.c: Define 'OMIT_CONSOLESAFE' to 1 to avoid
redirecting '*printf functions' to stdio-consolesafe replacements.
* nt/Makefile.in (LIBS_ADDPM): Add -lgnu to link 'addpm' against
Gnulib.  (Bug#79855)
2025-11-18 16:19:20 +02:00
Sean Whitton
3ae79b7c05 diff-apply-hunk: Avoid display-buffer-overriding-action
* lisp/vc/diff-mode.el (diff-apply-hunk): Use ACTION argument to
display-buffer instead of display-buffer-overriding-action.
2025-11-18 12:56:25 +00:00
Eli Zaretskii
f81fc11613 ; Improve wording of documentation of 'hs-cycle-filter'
* doc/emacs/programs.texi (Hideshow):
* etc/NEWS:
* lisp/progmodes/hideshow.el (hs-cycle-filter): Improve wording.
2025-11-17 17:54:48 +02:00
Stefan Monnier
6c770f8624 lisp/emacs-lisp/smie.el (smie-indent-basic): Add safety predicate 2025-11-17 08:51:56 -05:00
Juri Linkov
1668290c9d Improve hs-indicator-mouse-toggle-hiding for non-selected windows
* lisp/progmodes/hideshow.el (hs-indicator-mouse-toggle-hiding):
Use 'mouse-set-point' to select the clicked window when it was not selected.
2025-11-17 09:34:36 +02:00
Juri Linkov
ec08011af4 New hideshow option 'hs-cycle-filter' for visibility-cycling with 'TAB'
* doc/emacs/programs.texi (Hideshow): Add 'hs-cycle-filter' and
remove duplicate 'hs-toggle-hiding'.

* lisp/progmodes/hideshow.el (hs-cycle-filter): New defcustom (bug#79585).
(hs-minor-mode-map): Bind 'TAB' to 'hs-toggle-hiding' using the filter.
2025-11-17 09:30:45 +02:00
Elías Gabriel Pérez
6663df5655 hideshow: Simplify code. (Bug#79585)
* lisp/progmodes/hideshow.el (hs-get-first-block): New function.
(hs--add-indicators, hs-hide-block): Use the new function and
simplify.
2025-11-17 09:27:08 +02:00
Thomas Fitzsimmons
ad13e0b864 ntlm.el: Add Package-Requires and fix two docstrings
* lisp/net/ntlm.el (Package-Requires): Add emacs 27.1.
* lisp/net/ntlm.el (ntlm-build-auth-response, ntlm-string-xor):
Fix docstrings to satisfy `checkdoc'.
2025-11-16 18:28:03 -05:00
João Távora
c81d8fd490 ; Eglot: minor documentation cleanup of last change
* lisp/progmodes/eglot.el (eglot--semtok-cache)
(eglot--semtok-inflight): Minimally enhance docstrings.
(eglot--semtok-font-lock-2): Remove FIXME comment.

bug#79374
2025-11-16 22:16:40 +00:00
Juri Linkov
4fad95d9fc * lisp/outline.el: Small fixes.
(outline-font-lock-keywords, outline-minor-mode-highlight-buffer):
Fall back to eol when there is no newline at the end of outline at eob.
(outline-after-change-functions): Remove the temporarily added variable.
(outline--fix-buttons): Remove its last use.
2025-11-16 19:37:23 +02:00
João Távora
7469ee7e27 Eglot: rework semtok feature again
This time, I bit the bullet and made eglot--semtok-cache a list
of responses.  This is motivated by "range" request which happen
in for multiple regions asynchronously.  They must all be
(eventually) sent and cannot stomp on each others' cache.

Figuring out when to delete outdated entries from
eglot--semtok-cache is also tricky.  It must be done only once
we're certain an outdated entry cannot be reused for a "delta"
request.

* lisp/progmodes/eglot.el (eglot--semtok-cache): Reword docstring.
(eglot--semtok-apply-delta-edits): Tweak variable name.
(eglot--semtok-request): Rework again.
(eglot--semtok-font-lock): Rework.
(eglot--semtok-font-lock-1): DATA no longer optional.
2025-11-16 15:26:48 +00:00
Eli Zaretskii
364b5306c0 Fix last change in keyboard.c
* src/keyboard.c (adjust_point_for_property): Handle 'display'
property on the same text as 'invisible' property the same as the
overlay with a 'display' property.  (Bug#79787)
2025-11-16 17:17:37 +02:00
Eli Zaretskii
3888979ee1 Fix cursor motion across invisible text with an overlay
* src/keyboard.c (adjust_point_for_property): Handle the case
where invisible text has an overlay over it with a replacing
'display' property, which leaves some "trace" of the invisible
text on display.  (Bug#79787)
2025-11-16 16:38:37 +02:00
Eli Zaretskii
858d54d51d ; Fix cleanup in buffer-tests
* test/src/buffer-tests.el (test-restore-buffer-modified-p)
(test-buffer-chars-modified-ticks): Don't leave unsaved and
modified file buffers after the tests.
2025-11-16 11:08:11 +02:00
Martin Rudalics
50c30a9240 ; Improve documentation of 'clone-of' window parameter
* lisp/window.el (window-state-get, window-state-put): Mention
'clone-of' parameter in doc-strings.
* doc/lispref/windows.texi (Window Configurations, Window
Parameters): Improve description of 'clone-of' parameter.
2025-11-16 09:28:30 +01:00
Elías Gabriel Pérez
361807bf18 hideshow: Make ellipsis a little noticeable in TTY frames
bug#79585

* lisp/progmodes/hideshow.el (hs-ellipsis): Use 'shadow' face.
(hs--get-ellipsis): Rework.
(hs-already-hidden-p): Fix regression.
2025-11-16 09:42:40 +02:00
Eli Zaretskii
2ab07033ea Workaround for MSVCRT stdio on MS-Windows for CJK locales
MSVCRT implementation of stdio functions which output
characters one by one fails for CJK double-byte encodings.
Gnulib provides replacement functions which work around
those bugs.  This change makes Emacs and lib-src programs
use the replacements when Emacs is linked against MSVCRT.
* src/conf_post.h (fwrite, fprintf, printf, vfprintf, vprintf)
[WINDOWSNT]: Redirect to Gnulib replacements when Emacs is linked
against MSVCRT (as opposed to UCRT).  Suggested by Bruno Haible
<bruno@clisp.org>.
2025-11-16 09:36:03 +02:00
João Távora
cc9ec87e53 Eglot: rework semtok feature again
This version was tested with the clangd, rust-analyzer and lean servers.
Each server is slightly different.

The main change is to recognize that that eglot--semtok-request is a
promise to get some data for BEG to END and a promise to flush it.  The
eglot--semtok-inflight variable is overhauled so that it more precisely
encodes this information.

The lean server insists on many workspace/semanticTokens/refresh waiting
for a textDocument/semanticTokens/full request from our part, but we
don't give in.  The spec doesn't actually say what types of requests the
clients should issue.  It eventualy gives up.  The only thing we do on
this request is to flush everything we know.  After this flush, the
font-lock machinery will know what to do.

* lisp/progmodes/eglot.el (eglot--async-request): Return id.
(eglot--semtok-inflight): Redesign variable.
(eglot-handle-request): Just flush.
(eglot--semtok-request): Rewrite.
(eglot--semtok-font-lock): Tweak.
2025-11-16 03:03:35 +00:00
Eli Zaretskii
28f0658d8f Fix processing sub-process exit when keyboard input is pending
* src/process.c (wait_reading_process_output): Process status
changes of sub-processes when called with read_kbd zero and some
"keyboard input" is available, but no output from any sub-process.
(Bug#79777)
2025-11-15 19:48:08 +02:00
Eli Zaretskii
fd5e3b123e Avoid extra newline in user-error logged in *Messages*
* src/xdisp.c (reset_message_log_need_newline): New function.
* src/lisp.h: Add prototype of 'reset_message_log_need_newline'.
* src/print.c (print_error_message): Call
'reset_message_log_need_newline' to prevent message3 from
outputting a newline after "user-error:".  (Bug#79840)
2025-11-15 19:29:20 +02:00
Paul Nelson
a0761ddb4b Improve foldout-exit-fold with negative arg (bug#77370)
* lisp/foldout.el (foldout-exit-fold): When called with a
negative prefix argument (so that the exited fold is not
hidden), preserve the position of point and do not recenter.
2025-11-15 19:16:01 +02:00
Eli Zaretskii
c9372ced9c : Update ldefs-boot.el. 2025-11-15 07:25:19 -05:00
Eli Zaretskii
43fac918bf Merge from origin/emacs-30
9b3eb06c76 Indent jsx_text properly with modern grammars
1c87be8ac9 ; * lisp/gnus/gnus.el (gnus-summary-line-format): Reindent.
2025-11-15 07:21:32 -05:00
Eli Zaretskii
34a0b1b3a7 ; Merge from origin/emacs-30
The following commit was skipped:

288f1bc7d9 ; gnus-summary-line-format: Fix '%&user-date;' docs (bug#...
2025-11-15 07:21:32 -05:00
Jostein Kjønigsen
fef4084b54 csharp-mode.el: fontify variables assigned from awaited tasks
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Add missing selector.  (Bug#79825)
2025-11-15 12:14:32 +02:00
Marc Herbert
42a176d0de * lisp/gnus/gnus.el (gnus-summary-line-format): Doc fix (bug#79820).
Copyright-paperwork-exempt: yes
2025-11-15 12:05:35 +02:00
Eli Zaretskii
045fe2e2a3 ; * etc/NEWS (Ibuffer): Announce new faces. (Bug#79786) 2025-11-15 11:28:57 +02:00
Protesilaos Stavrou
ad4ca87ca4 Make ibuffer.el use dedicated faces
* lisp/ibuffer.el (ibuffer-marked, ibuffer-deletion)
(ibuffer-title, ibuffer-filter-group-name): Define the faces.
(ibuffer-marked-face, ibuffer-deletion-face, ibuffer-title-face)
(ibuffer-filter-group-name-face): Make the new faces the default
values.  (Bug#79786)
2025-11-15 11:24:58 +02:00
Jackson Ray Hamilton
9b3eb06c76
Indent jsx_text properly with modern grammars
* lisp/progmodes/js.el:
* lisp/progmodes/typescript-ts-mode.el: Indent jsx_text from correct
column when a modern grammar is installed; previously was over-indented.
2025-11-14 22:32:15 -08:00
João Távora
f772fe526a Eglot: fix bug in eglot--semtok-font-lock
The entry condition to eglot--semtok-font-lock-1, which checks
if the region to refontify is contained in the recorded region
in eglot--semtok-cache was blatantly wrong.  It used 'beg'
twice!

* lisp/progmodes/eglot.el (eglot--semtok-font-lock): Fix bug.
2025-11-14 22:29:34 +00:00
João Távora
f83c35788a Eglot: invalidate local semtok cache at server's bidding
When the server sends workspace/semanticTokens/refresh, calling
font-lock-flush isn't enough.  It will trigger a new
eglot--semtok-font-lock call, but we can't assume anything about
the validity of eglot--semtok-cache.

Clangd seems to send workspace/semanticTokens/refresh when
complicated enough changes happen in an LSP document.  If the
buffer-local eglot--semtok-cache isn't flushed we'll likely
request a delta, and clangd may still supply it, but it won't
apply correctly to the outdated local state.

* lisp/progmodes/eglot.el (eglot--semtok-cache)
(eglot--semtok-inflight): Move up here.
(eglot-handle-request): Flush the eglot--semtok-cache.
2025-11-14 15:45:37 +00:00
João Távora
d81bb68ed0 Eglot: janitorial cleanup
* lisp/progmodes/eglot.el (eglot--lsp-position-to-point): Use
eglot--widening.
(eglot--lsp-position-to-point): Use eglot--widening.
(eglot-range-region): New util.
(eglot-format)
(eglot--code-action-params)
(eglot--update-hints-1)
(eglot--semtok-request): Use eglot-range-region.
(eglot--after-change): Add comment.

eglot-range-region is an idea by Lua Viana Reis <me@lua.blog.br>
2025-11-14 15:45:37 +00:00
Sean Whitton
78a73acf61 ; * lisp/emacs-lisp/cond-star.el (cond*): New FIXME. 2025-11-14 14:12:38 +00:00
Sean Whitton
3c9bcdebe4 Autoload match*, bind*, bind-and* dummy macros
* lisp/emacs-lisp/cond-star.el (match*, bind*, bind-and*):
Autoload, for the sake of syntax highlighting.
2025-11-14 14:11:04 +00:00
Sean Whitton
0d4741ec92 diff-apply-hunk: Don't display BUF in the selected window
* lisp/vc/diff-mode.el (diff-apply-hunk): Don't display BUF in
the selected window.
2025-11-14 13:00:13 +00:00
Eli Zaretskii
a40d8885f8 ; * lisp/progmodes/hideshow.el: Fix wording in commentary. 2025-11-14 10:14:14 +02:00
Spencer Baugh
ab8d3624c4 Do eager display of *Completions* while idle
Don't block user input while rendering the *Completions* buffer
due to eager-display.  This allows eager-display to be used with
larger and slower completion tables without interfering with the
user.  Like in eager-update, we use while-no-input and
non-essential to ensure that eager-display happens without
blocking the user.

To support this, we remove the ability to set eager-display to a
function.  The only user was tmm.el, which nows sets
eager-display to t and adds a completion-setup-hook instead.
(This also fixes a bug in tmm where dismissing and redisplaying
the *Completions* buffer would not have the special help text)

* lisp/minibuffer.el (completion-eager-display--timer)
(completions--eager-display, completions--start-eager-display):
Add. (bug#79819)
(completing-read-default): Call
completions--start-eager-display, stop supporting functionp
eager-display.
* lisp/tmm.el (tmm-add-prompt): Delete.
(tmm--completion-setup-hook): Add.
(tmm-add-prompt): Add completion-setup-hook, set eager-display
to t.
(tmm-goto-completions): Call minibuffer-completion-help instead
of tmm-add-prompt.
2025-11-14 09:29:30 +02:00
Elías Gabriel Pérez
4e08b2d434 ; hideshow: Fix previous changes
* lisp/progmodes/hideshow.el (hs--add-indicators): Add the
indicators per line (bug#79810).
(hs-already-hidden-p, hs-hide-block): Simplify.
2025-11-14 09:23:35 +02:00
Elías Gabriel Pérez
99ec59f1a4 hideshow: Update Header Commentary. (Bug#79829)
* lisp/progmodes/hideshow.el: Document how to migrate from
'hs-special-modes-alist'.
2025-11-14 09:20:01 +02:00
João Távora
7a3b8c6df5 Eglot: add two semtok tests
The tests are pretty basic, I don't expect them to catch
anything else than giant bugs.

* test/lisp/progmodes/eglot-tests.el (eglot-test-semtok-basic)
(eglot-test-semtok-refontify): New tests.
(eglot--semtok-faces, eglot--semtok-wait): New helpers.
2025-11-13 22:18:46 +00:00
João Távora
6126ab8d82 Eglot: tweak some semtok functions to be more debug-friendly
* lisp/progmodes/eglot.el (eglot--semtok-request): Return value
records return reason.
(eglot--semtok-font-lock-1): Return number of painted tokens and
exit locus.
(eglot--semtok-decode-token): Rename
from eglot--semtok-token-faces.  Rework.
(eglot--semtok-font-lock-1): Use eglot--semtok-decode-token.
2025-11-13 22:18:46 +00:00
João Távora
2f196548f5 Eglot: tidy overlay cleanup code
And turn off semtok when tearing down eglot--managed-mode.

* lisp/progmodes/eglot.el (eglot--delete-overlays): New helper.
(eglot--managed-mode): Turn off minor modes and cleanup here.
(eglot--managed-mode-off): Not here.
(eglot-highlight-eldoc-function)
(eglot-code-action-suggestion): Use eglot--overlay prop.
(eglot-inlay-hints-mode): Use eglot--delete-overlays.
2025-11-13 22:18:46 +00:00
Elías Gabriel Pérez
394090486c hideshow: Fix indicator mouse clicks on TTY
* lisp/progmodes/hideshow.el (hs-make-overlay)
(hs--make-indicators-overlays): Rework (bug#79585).
2025-11-13 20:30:36 +02:00
Sean Whitton
4a8b7bd217 ; * lisp/vc/vc.el (vc-revert-revision): Fix line length. 2025-11-13 18:13:58 +00:00