Commit graph

181668 commits

Author SHA1 Message Date
Ivan
52e5dbd2da Fix erc-track-faces-normal-list regression
* lisp/erc/erc-track.el (erc-track--select-mode-line-face): Check
whether ranked faces in the message appear in the value of the option
`erc-track-faces-normal-list' rather than repeatedly checking if the
current nominee does, usually the highest ranked face in the message.
Failure to do so caused ERC to treat faces absent from the option's
value as being present and thus eligible to replace ranked faces in the
mode line segment.  This bug was introduced in ERC 5.6 and is also part
of 5.6.1.  (Bug#80659)

Copyright-paperwork-exempt: yes
2026-03-23 18:14:57 -07:00
F. Jason Park
bb3c103968 Avoid nested erc-display-message in alert utility
* lisp/erc/erc.el (erc--warn-once-before-connect): Don't call
`erc-display-message' from insertion hooks because doing so places an
unnecessary burden on the caller to preserve the insertion marker and
"msg prop" environment.
2026-03-23 18:13:28 -07:00
Sean Whitton
f08dcace70 ; * lisp/whitespace.el (whitespace-global-modes): Grammar fix. 2026-03-23 21:11:38 +00:00
Basil L. Contovounesios
a4d99971d8 Fix recent whitespace.el changes
* etc/NEWS
(Changes in Specialized Modes and Packages in Emacs 31.1):
Announce new user option whitespace-global-mode-buffers (bug#79230).
* lisp/whitespace.el (whitespace-global-modes): Improve docstring
grammar.
(whitespace-global-mode-buffers): Make default value match *scratch*
exactly for backward compatibility.  Fix custom :type.
(whitespace-enable-predicate): Prefer any over seq-find.
2026-03-23 16:53:57 +01:00
Sean Whitton
c9676d68a2 ; Update tests to match rename of 'any' to 'member-if'. 2026-03-23 12:23:26 +00:00
Yuan Fu
6c79b6bede
; * lisp/treesit.el (treesit-range-rules): Fix range-fn handler. 2026-03-22 20:54:58 -07:00
Pip Cet
1932bb434a Delay initializing 'compile-command' to runtime (bug#80648)
* lisp/progmodes/compile.el (compile-command): Use
'custom-initialize-delay'.
2026-03-22 16:44:04 +00:00
Sean Whitton
17a3f6bf99 * lisp/subr.el (member-if): Fix compiler macro multiple evaluation.
Problem reported by Pip Cet <pipcet@protonmail.com>.
2026-03-22 16:03:16 +00:00
Daniel Mendler
c96c89faaa (dabbrev-completion): Improve last fix for bug#80645
* lisp/dabbrev.el (dabbrev-completion): Signal the error that
`dabbrev-capf` doesn't signal any more.
2026-03-22 10:58:40 -04:00
Helmut Eller
55bf30e017 Staticpro executing_kbd_macro
* src/macros.c (syms_of_macros): Staticpro executing_kbd_macro.
(executing_kbd_macro): Update comment.
* src/macros.h (executing_kbd_macro): Remove redundant comment.
2026-03-22 15:29:37 +01:00
Basil L. Contovounesios
5f3689d77f Fix no-focus-on-map on X without GTK
* src/xterm.c [!USE_GTK] (x_update_frame_user_time_window): When
replacing _NET_WM_USER_TIME with a new _NET_WM_USER_TIME_WINDOW and
the frame has requested no-focus-on-map, ensure _NET_WM_USER_TIME is
zero also on the new _NET_WM_USER_TIME_WINDOW.
(x_make_frame_visible) [!USE_GTK]: Don't overwrite _NET_WM_USER_TIME
before mapping a frame that has requested no-focus-on-map, and whose
_NET_WM_USER_TIME should thus remain zero (bug#80525).
2026-03-22 12:18:03 +01:00
Guilherme de Almeida Suckevicz
8dcbf4fafc Fix wrong type argument error in 'find-file-read-only-other-tab' (Bug#80630)
* lisp/tab-bar.el (find-file-read-only-other-tab): Pass the
function 'find-file-other-tab' directly to
'find-file--read-only' (Bug#80630).

Copyright-paperwork-exempt: yes
2026-03-22 09:27:41 +01:00
Stefan Monnier
a7d0520721 (dabbrev-capf): Fix bug#80645.
* lisp/dabbrev.el (dabbrev-capf): Return an empty table rather than
signaling an error when there are no completions.
The completion UI already takes care of emitting a message like
"No match".
2026-03-21 22:53:13 -04:00
Helmut Eller
e427d55284 * test/src/charset-tests.el (charset-tests-define-charset): New. 2026-03-21 18:42:01 +01:00
Helmut Eller
b06a1f85c6 Use signed ints in struct charset_table
* src/charset.h (struct charset_table): Make the slots size and used
signed.
(charset_attributes_getter): Fix spacing.
2026-03-21 18:42:01 +01:00
Helmut Eller
b0d38e2934 * src/charset.c (Fdefine_charset_internal): Fix memory leak. 2026-03-21 18:42:01 +01:00
Helmut Eller
497fd657cd * src/charset.c (shrink_charset_table): Simplify. 2026-03-21 18:42:00 +01:00
Helmut Eller
32f9e21098 Introduce a struct charset_table
The fields of the new struct are what the global variables
charset_table, charset_table_size, charset_table_used, and
charset_attributes_table used to be.  The struct should make it clearer
that those fields must be kept in sync.

* src/charset.h (struct charset_table): New struct.
(charset_attributes_getter): Adjust accordingly.
* src/charset.c (charset_table): Change type to struct charset_table.
(charset_table_size, charset_table_used, charset_attributes_table):
Moved to the struct.
(Fdefine_charset_internal, Ffind_charset_region, Ffind_charset_string)
(shrink_charset_table, syms_of_charset): Adjust to struct charset_table.
* src/pdumper.c (dump_charset, dump_charset_table): Adjust to struct
charset_table.
2026-03-21 18:42:00 +01:00
Helmut Eller
bbb4fc26e7 * src/charset.h (charset_attributes_getter): Add assertion. 2026-03-21 18:42:00 +01:00
Helmut Eller
186af8e934 Remove the charset_table_init array
Determining the best size for a static array seems difficult; so
allocate it dynamically.

* src/charset.c (CHARSET_TABLE_INIT_SIZE): New constant.
(syms_of_charset): Malloc charset_table here.
(charset_table_init): Removed.
(shrink_charset_table): New function.
(Fclear_charset_maps): Call it.
* src/charset.h (charset_table_init): Removed.
(charset_attributes_getter): Add an assertion.
* src/pdumper.c (dump_charset_table): Assert that charset_table_size ==
charset_table_used.
2026-03-21 18:41:20 +01:00
Helmut Eller
96eacb2c09 Move the attribute field of charsets to a separate vector
This simplifies the GC code, as this was the only field in the charset
struct that referenced the GC heap.  Without it, we no longer need to
trace the charset_table.

* src/charset.h (struct charset.attributes): Removed.
(charset_attributes_getter): New helper.
(CHARSET_ATTRIBUTES): Use it.
* src/charset.c (charset_attributes_table): New.
(Fdefine_charset_internal): Place attrs in charset_attributes_table.
(syms_of_charset): Initialize charset_attributes_table.
(mark_charset): Deleted.
* src/pdumper.c (dump_charset): Skip attributes field.
* src/lisp.h (mark_charset): Deleted.
* src/alloc.c (garbage_collect): mark_charset no longer needed.
2026-03-21 18:20:42 +01:00
Basil L. Contovounesios
fac42338bb Make member-if compiler-macro hygienic
* lisp/subr.el (member-if): Use uninterned symbol in
compiler-macro (bug#80647).
2026-03-21 13:51:27 +01:00
Eli Zaretskii
9adc553ab9 ; * doc/lispintro/emacs-lisp-intro.texi: Fix parens (bug#80646). 2026-03-21 13:27:56 +02:00
Stéphane Marks
48d65afa32 vtable truncate-string-pixelwise, ellipsis can be a string (bug#80026)
Eliminate 'vtable--limit-string' in favor of the more efficient
'truncate-string-pixelwise'.  Remove extraneous pre-measurement
calls to 'string-pixel-width' and ellipsis concatenation as
'truncate-string-pixelwise' does both.
The 'make-vtable' 'ellipsis' keyword can be a string to override
the default returned by 'truncate-string-ellipsis'.

* lisp/emacs-lisp/vtable.el (vtable--ellipsis): New defun.
(vtable-insert-object, vtable--insert): Use 'vtable--ellipsis'.
(vtable--insert-line, vtable--insert-header-line): Call
'truncate-string-pixelwise' instead of 'vtable--limit-string'.
(vtable--limit-string): Remove function.

* test/lisp/emacs-lisp/vtable-tests.el
(test-vtable--limit-string-with-face-remapped-buffer): Remove
test, obsoleted by misc-test-truncate-string-pixelwise.

* doc/misc/vtable.texi: Document that :ellipsis can be a string.
2026-03-21 12:50:04 +02:00
Jeff Valk
eca93f40d1 Ensure correct expansion in 'find-sibling-file-search'
* lisp/files.el (find-sibling-file-search): Following expansion
of each EXPANSION, advance the search start position to reflect
the actual length of the expanded text (the updated string), not
the length of the "\\([&0-9]+\\)" (the string before expansion).
(Bug#80636)

Copyright-paperwork-exempt: yes
2026-03-21 12:31:21 +02:00
Eli Zaretskii
531f45551a ; * src/fns.c (internal_equal_cycle) <use-short-answers>: Doc fix. 2026-03-21 10:12:03 +02:00
Eli Zaretskii
aefa854d01 ; * etc/NEWS: Fix wording. 2026-03-21 09:07:25 +02:00
Eli Zaretskii
4901015055 ; * doc/lispref/variables.texi (Void Variables): Add cross-reference. 2026-03-21 09:05:59 +02:00
Tassilo Horn
8ae0877416 Fix wrong-type-argument error in package-upgrade
* lisp/emacs-lisp/package.el (package-upgrade): Fix wrong-type-argument
error when upgrading a builtin package (bug#80633).
2026-03-21 07:15:35 +01:00
Stefan Monnier
3ed7868f6e simple-tests.el: Use kmacro function
* test/lisp/simple-tests.el (undo-test-kill-c-a-then-undo)
(undo-test-point-after-forward-kill): Use `kmacro` function.
2026-03-20 23:19:43 -04:00
Stefan Monnier
f986e5a897 cursor-sensor.el: Partial fix for bug#80255
This provides limited support for window-specific overlay properties.
To complete it, we still need to add support for it to
`next/previous-single-char-property-change`.

* lisp/emacs-lisp/cursor-sensor.el (cursor-sensor--intangible-p):
Add `window` argument.
(cursor-sensor-tangible-pos, cursor-sensor--detect):
Pass `window` argument to the functions
looking for overlay properties.
2026-03-20 23:18:29 -04:00
Stefan Monnier
378cfb8660 (Fmakunbound): Break aliasing, if present (bug#80538)
* src/data.c (Fmakunbound): Break aliasing, if present.
* doc/lispref/variables.texi (Void Variables): Document it.
2026-03-20 17:21:05 -04:00
Stefan Monnier
89b40650da diff-mode.el: Don't recompute the position of Git preamble/footer
On some profiles (after disabling syntax and refined
fontification), this was taking >90% of the time to fontify a buffer.

* lisp/vc/diff-mode.el (diff--git-preamble-overlay)
(diff--git-footer-overlay): New variables.
(diff--git-preamble-end, diff--git-footer-start): Use them to cache
the result.
2026-03-20 16:53:42 -04:00
Eshel Yaron
a1a76ba06e
; Simplify 'elisp-fontify-symbol'.
* lisp/progmodes/elisp-mode.el (elisp-fontify-symbol):
Simplify.  See also discussion at bug#80593.
2026-03-20 15:10:50 +01:00
Philip Kaludercic
c852297037
; Adjust use-package tests for :vc
See https://lists.gnu.org/archive/html/emacs-devel/2026-03/msg00567.html.

* test/lisp/use-package/use-package-tests.el (use-package-test-normalize/:vc):
Drop or change expected to match change that interprets a string
argument to :vc in the same manner as 'package-vc-install.
2026-03-19 21:38:29 +01:00
Eshel Yaron
72c262d5d1
; Adapt 'elisp-fontify-symbol' to 'cursor-sensor-mode' changes
* lisp/progmodes/elisp-mode.el (elisp-fontify-symbol): Mark
the 'cursor-sensor-functions' property as 'rear-nonsticky',
to adapt to 'cursor-sensor-mode' taking into account
property stickiness since f4a1c00656.  See also bug#80593.
2026-03-19 17:29:27 +01:00
Ihor Radchenko
e4aa9cfbab New option to enable global-whitespace-mode in special-buffers (bug#79230)
* lisp/whitespace.el (whitespace-global-mode-buffers): New custom
option.
(whitespace-enable-predicate): Use it.
(whitespace-global-modes): Refer to the new option.
2026-03-19 17:51:02 +02:00
Eli Zaretskii
0801652979 ; * lisp/ibuffer.el (ibuffer-fontification-alist): Doc fix (bug#80618). 2026-03-19 17:46:57 +02:00
Eli Zaretskii
ee42c392d2 ; Fix documentation of window-dimension functions
* doc/lispref/windows.texi (Window Sizes):
* src/window.c (Fwindow_body_height, Fwindow_total_height)
(Fwindow_total_width, Fwindow_body_width): Clarify that window
dimensions are returned in canonical columns and lines.
(Bug#80620)
2026-03-19 17:40:31 +02:00
Elias Gabriel Perez
5c961f4903 hideshow: Fix 'hs-hide-block-behavior' set to 'after-cursor'.
Bug#80455.

* etc/NEWS: Document changed behavior.

* lisp/progmodes/hideshow.el (hs-get-near-block): Remove
'forward-line'.
(hs-hide-block-behavior): Update docstring.

* doc/emacs/programs.texi (Hideshow): Update.

Suggested-by: Dima Kogan <dima@secretsauce.net>
2026-03-19 17:27:57 +02:00
Eli Zaretskii
687fe594d6 Fix "make install-nt" in parallel builds
* Makefile.in (install-nt): Add order-only dependency on $(NTDIR).
Suggested by Joel Reicher <joel.reicher@gmail.com>.  (Bug#80470)
2026-03-19 17:19:44 +02:00
Elías Gabriel Pérez
c911495fb1 hideshow: New minor mode 'hs-indentation-mode'. (Bug#80179)
This minor mode configures hs-minor-mode to use
indentation-based folding.

* lisp/progmodes/hideshow.el (hs-hideable-block-p): New
function.
(hs-indentation-respect-end-block): New option.
(hs-indentation--store-vars): New variable.
(hs-cycle-filter, hs-get-first-block-on-line, hs-get-near-block)
(hs-find-block-beg-fn--default): Adapt code to use
'hs-hideable-block-p'.
(hs-block-positions): Update.
(hs-indentation-mode): New minor mode.

* doc/emacs/programs.texi (Hideshow): Update documentation.

* etc/NEWS: Announce changes

* test/lisp/progmodes/hideshow-tests.el: Add 'require'.
(hideshow-check-indentation-folding): New test.
2026-03-19 17:11:54 +02:00
Eli Zaretskii
1f04208898 ; * lisp/files.el (find-sibling-rules): Doc fix. 2026-03-19 09:54:07 +02:00
Stefan Monnier
7fae444857 lisp/progmodes/elisp-mode.el (elisp--local-macroenv): Add static-if 2026-03-18 09:33:55 -04:00
Stéphane Marks
7ae5562bd4 Kick the event loop in NS drag and drop (bug#80592)
Eliminate an annoying event-loop delay after dropping into an
Emacs window.

* src/nsterm.m: ([EmacsView performDragOperation:]): Kick the
event loop after posting the DRAG_N_DROP_EVENT.
2026-03-18 10:34:29 +00:00
Michael R. Mauger
6db7ab34a1 Window handling bug fixes.
* lisp/play/zone.el: (zone--build-zone-buffer): select window.
(zone--prepare-frames): Avoid dedicated windows.
2026-03-17 18:32:40 -04:00
Stefan Monnier
dd264fb439 (delete-selection-repeat-replace-region): Partial fix for bug#80216
* lisp/delsel.el (delete-selection-repeat-replace-region): Clarify the
need for `delete-selection-save-to-register`.
2026-03-17 12:40:22 -04:00
Tassilo Horn
fdfe617e73 Further improve blink-matching-paren-highlight-offscreen
* lisp/simple.el (blink-matching-paren-offscreen): Inherit from
show-paren-match face.
(blink-paren-open-paren-line-string): Add blink-matching-paren-offscreen
face properties to opening paren instead of replacing original
fontification.
* lisp/paren.el (show-paren-context-when-offscreen): Mention
blink-matching-paren-highlight-offscreen in docstring.
2026-03-17 06:13:54 +01:00
Dmitry Gutov
f8696367bc Assign bit gravity to window in Lucid and Motif ports too
* src/widget.c (EmacsFrameRealize): Assign bit_gravity, and use
the value of NorthWestGravity which matches the GTK3 behavior,
and the general intuition that window's contents should move
with its top-left corner.  The result is that the frame is not
blinking during resizing (bug#80369).

* src/xfns.c (x_window) [!USE_X_TOOLKIT]: Change bit_gravity from
StaticGravity to NorthWestGravity as well, to match the others.
2026-03-16 23:55:24 +02:00
Philip Kaludercic
4147410852
; Fix handling of string by the use-package keyword :vc
This makes :vc behave more like 'package-vc-install'.

* lisp/use-package/use-package-core.el (use-package-normalize/:vc):
Translate :vc arguments that are just a string into a minimal
package specification containing only a :url field, thus
preventing a type error down the line.
2026-03-16 18:23:37 +01:00