1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00
Commit graph

180363 commits

Author SHA1 Message Date
Paul Eggert
cada1c3192 Fix more mis-declarations of non-const functions
Problem reported by Helmut Eller in:
https://lists.gnu.org/r/emacs-devel/2025-11/msg00809.html
* src/data.c (Fsymbol_with_pos_p, Fnatnump):
* src/fns.c (Fproper_list_p):
* src/gnutls.c (Fgnutls_errorp):
Now pure, not const.
2025-11-20 09:11:59 -08:00
Stefan Monnier
4681042493 Editorconfig: Cherrypick from commit fbd078ad6478 from upstream
* lisp/editorconfig-core-handle.el (editorconfig-core-handle--parse-file):
Bump limits beyond the spec's minimum.
Cherrypick from commit fbd078ad6478 from upstream.
* lisp/editorconfig-fnmatch.el (editorconfig-fnmatch--do-translate):
Hoist `push` out of the `cl-case`.
2025-11-20 06:58:39 -05:00
Paul Eggert
20fd47e741 Fix mis-declarations of non-const functions
Problem for mpz_get_d_rounded reported by Helmut Eller in:
https://lists.gnu.org/r/emacs-devel/2025-11/msg00795.html
* lib-src/make-docfile.c (DEFUN_pure): New constant.
(write_globals, scan_c_stream): Support "attributes: pure".
* src/bignum.h (mpz_get_d_rounded):
* src/data.c (Fsymbolp, Fmodule_function_p, Fintegerp, Fnumberp):
* src/lisp.h (bignum_to_double, bignum_to_intmax)
(bignum_to_uintmax, bignum_bufsize):
Now pure, not const, since they depend on current state.
For example, Fsymbolp now inspects symbols_with_pos_enabled,
and the bignum functions inspect bignum contents in memory.
* src/data.c (Feq):
* src/xfaces.c (Fface_attribute_relative_p):
No longer const, since they might abort when debugging.
* src/pdumper.h (pdumper_object_p, pdumper_cold_object_p)
(pdumper_find_object_type, pdumper_object_p_precise):
These are not const functions.  But there is no need to declare
them to be pure, either, as they’re inline so the compiler can
figure it out.
2025-11-19 16:21:24 -08:00
Eli Zaretskii
a1f36dc3b8 ; * admin/authors.el (authors-aliases): Update. 2025-11-19 17:32:21 +02:00
Spencer Baugh
784d5b4954 Fix implicit usage of the current window-width in vtable.el
Previously, many functions in vtable.el called 'vtable--cache',
which computed 'vtable--cache-key' based on the current selected
window and frame; this could cause vtable functions to fail or
misbehave if they were not called from the selected window and
frame that 'vtable-insert' was last called in.

Now, the vtable cache is stored with the text of the vtable, so
that functions which need to interact with some vtable text can
do so reliably without having to use the same selected window
and frame.

Also, 'vtable-update-object' has always required TABLE to be
present at point in the current buffer; now its docstring states
this.

* lisp/emacs-lisp/vtable.el (vtable--current-cache)
(vtable--cache-widths, vtable--cache-lines): Add.
(vtable-insert): Save cache in 'vtable-cache.
(vtable--ensure-cache, vtable--recompute-cache): Inline into
'vtable-insert'.
(vtable--widths, vtable--cache): Delete.
(vtable-update-object): Use 'vtable--current-cache' and
update docstring.  (Bug#69837)
(vtable-remove-object, vtable-insert-object): Use
'vtable--current-cache' and save cache in 'vtable-cache'.
(vtable--sort, vtable--alter-column-width)
(vtable-previous-column, vtable-next-column): Use
'vtable--current-cache'.
2025-11-19 17:26:50 +02:00
10sr
97d2ac4f95 Editorconfig: Fix for spaces_in_middle_key test
* lisp/editorconfig-core-handle.el (editorconfig-core-handle--parse-file):
fix for `spaces_in_middle_key` test.

Cherrypick of commit 72b8847275cb from upstream.
2025-11-19 10:17:30 -05:00
Ron Parker
7ec541ae2c Editorconfig: Fix parsing section lines with trailing comments (#363)
Copyright-paperwork-exempt: yes

* lisp/editorconfig-core-handle.el (editorconfig-core-handle--parse-file):
Fix parsing section lines with trailing comments.

Cherrypick of commit 183cfa105c2e from upstream.
2025-11-19 10:12:39 -05:00
Stefan Monnier
5e10b7fe4e Fix editorconfig-display-current-properties
In Emacs-30, `editorconfig-display-current-properties` was
broken in that it displayed only the properties set by
`editorconfig-apply` but not those set in the "normal" way,
i.e. by `hack-local-variables`.  Fix that along with a few
docstrings that had misleading old info.

* lisp/editorconfig-tools.el (editorconfig-apply)
(editorconfig-mode-apply): Fix docstring and declare obsolete.

* lisp/editorconfig.el (editorconfig-properties-hash):
(editorconfig-call-get-properties-function): Remove elements of
docstring that aren't true any more.
(editorconfig-call-get-properties-function):
Set `editorconfig-properties-hash`.
2025-11-19 09:58:19 -05:00
Martin Rudalics
788b39740a Fix 'make_lispy_position' for left margin clicks (Bug#79846)
* src/keyboard.c (make_lispy_position): When calculating a
position in the left margin skip any scroll bar on the left of
the associated window (Bug#79846).
2025-11-19 09:31:28 +01:00
Elías Gabriel Pérez
bfa0cb81dd hideshow: Fix regressions. (Bug#79857)
* lisp/progmodes/hideshow.el (hs-block-positions): Exit the
function if 'hs-forward-sexp' fails.
(hs-hide-level-recursive): Fix infloop.
* test/lisp/progmodes/hideshow-tests.el (hideshow-hide-level-1):
(hideshow-hide-level-2): Update tests.
2025-11-19 09:20:00 +02:00
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
Sean Whitton
e262ed18f9 ; * admin/notes/spelling: Copy note on possessive from CONTRIBUTE. 2025-11-18 15:04:58 +00: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