181895 Commits

Author SHA1 Message Date
Elias Gabriel Perez
d835775d9b hideshow: New function 'hs-add-cycle-binding' (Bug#80657)
https://lists.gnu.org/archive/html/emacs-devel/2026-02/msg00153.html

* lisp/progmodes/hideshow.el (hs-cycle-filter)
(hs-minor-mode-map): Update.
(hs--filter-function, hs-add-cycle-binding): New functions.
(hs-cycle): Minor rework.
2026-04-12 20:45:34 +03:00
Juri Linkov
032d4e97e6 * lisp/tab-bar.el (tab-bar-show): Support the 0 value (bug#80713).
Add explicit choice for the 0 value to always show the tab bar.
Also add a choice for other non-negative numbers.
In the setter enable 'tab-bar-mode' only for numbers,
but not for the t value that should not enable the tab bar
after customization, only after creating a new tab.
2026-04-12 20:32:05 +03:00
Eli Zaretskii
1f946a4497 ; * src/xwidget.c (Fmake_xwidget): Fix commentary. 2026-04-12 14:24:51 +03:00
Dirk-Jan C. Binnema
4e855f90d1 xwidgets: re-enable with newer webkit2gtk
By disabling hw-acceleration we can re-enable xwidgets with newer
webkit2gtk versions (Bug#80728).
Newer versions were disallowed (Bug#66068) since they abort when a
webkit view is created; however, they work fine as long as we disable
hw-acceleration, since the off-screen windows that xwidgets uses do not
support that.
* configure.ac: Remove upper-bound for webkit2gtk version check.
* src/xwidget.c (Fmake_xwidget): Turn off hardware-acceleration.

Copyright-paperwork-exempt: yes
2026-04-12 14:22:26 +03:00
Philip Kaludercic
be2b4a9831 Clean up 'Info-directory-list' after deleting package
* lisp/emacs-lisp/package.el (package--delete-directory): Remove
manual before physically deleting the package.  (Bug#80776)
2026-04-12 13:10:57 +02:00
Philip Kaludercic
dedd652fc5 Fix computation of package description file
* lisp/subr.el (package--description-file): Do not expect
non-numeric version components to be followed directly by a
number.  (Bug#80744)
2026-04-12 12:37:58 +02:00
Philip Kaludercic
b6e7c7d43b Add face for obsolete packages in package menu
* lisp/emacs-lisp/package.el (package-status-obsolete): New face.
(package-menu-status-faces): Use new face instead of hard-coding
a font-lock face.
2026-04-12 12:37:17 +02:00
Richard Lawrence
0326130e1b Add short documentation group for iCalendar lib
Define a short documentation group and document the major functions:

* lisp/calendar/icalendar-shortdoc.el: New file.
* lisp/calendar/diary-icalendar.el:
* lisp/calendar/icalendar-ast.el:
* lisp/calendar/icalendar-parser.el:
* lisp/calendar/icalendar-recur.el:
* lisp/calendar/icalendar-utils.el: Refer to icalendar-shortdoc.el in
file commentary.
* lisp/calendar/icalendar-macs.el: Ditto, and also mention the macros
for binding values.
* lisp/calendar/icalendar.el: Ditto, and also remove some obsolete
commentary.

Also make some improvements to documentation strings that the above
changes revealed would be helpful:

* lisp/calendar/icalendar-recur.el
(icalendar-recur-recurrences-in-window-w/end-times): Fix broken ref.
(icalendar-recur-current-tz-to-vtimezone): Clarify docstring.
* lisp/calendar/icalendar-parser.el (icalendar-parse): Clarify
docstring.

(Bug#80727)
2026-04-12 12:17:33 +03:00
Richard Lawrence
6eea015337 Improve performance of icalendar-recur.el and its tests
As discussed in Bug#80520.

* test/lisp/calendar/icalendar-recur-tests.el
(icalendar-test-rrule-test-rfc5545-sec3.8.5.3/3)
(icalendar-test-rrule-test-rfc5545-sec3.8.5.3/29)
(icalendar-test-rrule-test-rfc5545-sec3.8.5.3/30)
(icalendar-test-rrule-test-rfc5545-sec3.8.5.3/31)
(icalendar-test-rrule-test-rfc5545-sec3.8.5.3/33)
(icalendar-test-rrule-test-rfc5545-sec3.8.5.3/34)
(icalendar-test-rrule-test-rfc5545-sec3.8.5.3/38): Mark tests expensive.

Abstract the implementation of intervals in icalendar-recur.el.  Don't
store interval NEXT-LOW when it's the same as HIGH.  This reduces
allocations, and shaves about ~20% off the full test suite.

* lisp/calendar/icalendar-recur.el
(icalendar-recur-make-interval)
(icalendar-recur-interval-low)
(icalendar-recur-interval-high)
(icalendar-recur-interval-next): Implement intervals and subintervals as
vectors.  Only store NEXT-LOW when it's non-nil.
(icalendar-recur-find-absolute-interval)
(icalendar-recur-find-daily-interval)
(icalendar-recur-find-weekly-interval)
(icalendar-recur-find-monthly-interval)
(icalendar-recur-find-yearly-interval)
(icalendar-recur-next-interval)
(icalendar-recur-previous-interval)
(icalendar-recur-refine-byyearday)
(icalendar-recur-refine-byweekno)
(icalendar-recur-refine-bymonth)
(icalendar-recur-refine-bymonthday)
(icalendar-recur-refine-byday)
(icalendar-recur-refine-byhour)
(icalendar-recur-refine-byminute)
(icalendar-recur-refine-bysecond)
(icalendar-recur-subintervals-to-date-times)
(icalendar-recur-subintervals-to-dates)
(icalendar-recur-recurrences-in-interval)
(icalendar-recur-recurrences-in-window)
(icalendar-recur--key-from-interval): Use new interval constructor and
accessors.  Don't generate NEXT-LOW when it's the same as HIGH.
* lisp/calendar/icalendar-utils.el (icalendar-dates-until): Use new
interval constructor and accessors.
* test/lisp/calendar/icalendar-recur-tests.el
(icalendar-test-recur-find-secondly-interval)
(icalendar-test-recur-find-minutely-interval)
(icalendar-test-recur-find-hourly-interval)
(icalendar-test-recur-find-daily-interval-w/date)
(icalendar-test-recur-find-daily-interval-w/date-time)
(icalendar-test-recur-find-weekly-interval-w/date)
(icalendar-test-recur-find-weekly-interval-w/date-time)
(icalendar-test-recur-find-monthly-interval)
(icalendar-test-recur-find-yearly-interval)
(icalendar-test-recur-refine-byyearday)
(icalendar-test-recur-refine-bymonth)
(icalendar-test-recur-refine-bymonthday)
(icalendar-test-recur-refine-byday)
(icalendar-test-recur-refine-byhour)
(icalendar-test-recur-refine-byminute)
(icalendar-test-recur-refine-bysecond)
(icalendar-test-recur-subintervals-to-dates)
(icalendar-test-recur-subintervals-to-date-times)
(icalendar-test-rrule-test): Use new interval constructor and accessors.

Rearrange loops when refining subintervals, so that the loop always runs
once but doesn't run a second no-op iteration.  Astonishingly this cuts
the running time of the full test suite by almost 50%.

* lisp/calendar/icalendar-recur.el (icalendar-recur-refine-byyearday)
(icalendar-recur-refine-byweekno)
(icalendar-recur-refine-bymonth)
(icalendar-recur-refine-bymonthday)
(icalendar-recur-refine-byday)
(icalendar-recur-refine-byhour)
(icalendar-recur-refine-byminute)
(icalendar-recur-refine-bysecond): Tighten up loop bounds when refining
subintervals.

Improve performance of `icalendar-recur-tz-observance-on'.  This also
brings about a ~20% performance gain.

* lisp/calendar/icalendar-recur.el
(icalendar-recur-tz-observance-on): Eliminate calculation of previous
interval recurrences when it's unnecessary.  Add a cheap upper bound check to
prevent fully computing recurrences for irrelevant observances.
(icalendar-recur--w/in-locally-p):
(icalendar-recur--w/in-abs-p): New helper functions for the upper bound check.

Other more minor changes:

Improve performance in `icalendar-recur-refine-byday'

* lisp/calendar/icalendar-recur.el (icalendar-recur-refine-byday): Avoid
calculating Gregorian from absolute date unless it's necessary.

Improve performance of BYSETPOS filtering in icalendar-recur.el:
η-reduce `icalendar-recur-make-bysetpos-filter'.
Thanks to Mattias Engdegård for the suggestion and implementation.

* lisp/calendar/icalendar-recur.el
(icalendar-recur-make-bysetpos-filter): Rename to
`icalendar-recur-bysetpos-filter' and avoid `seq-map-indexed'.
(icalendar-recur-recurrences-in-interval): Use new function.
* test/lisp/calendar/icalendar-recur-tests.el
(icalendar-test-recur-bysetpos-filter): Use new function.

Improve sorting performance:
Thanks to Mattias Engdegård for the suggestion and implementation.

* lisp/calendar/icalendar-recur.el (icalendar-recur-refine-byyearday):
(icalendar-recur-refine-byweekno):
(icalendar-recur-refine-bymonthday):
(icalendar-recur-refine-byday): Use :key instead of :lessp in `sort'
calls.

Eliminate `apply-partially' and `seq-take':
Thanks to Mattias Engdegård for the suggestion and implementation.

* lisp/calendar/icalendar-recur.el
(icalendar-recur-recurrences-in-window): Eliminate `apply-partially'.
(icalendar-recur-recurrences-in-interval): Eliminate
`apply-partially' and replace `seq-take' with `take'.

Reduce consing:

* lisp/calendar/icalendar-recur.el
(icalendar-recur-subintervals-to-dates):
(icalendar-recur-recurrences-in-window):
(icalendar-recur-recurrences-in-window-w/end-times):
(icalendar-recur-recurrences-to-count): Replace `append' with `nconc'.

Avoid a few uses of `seq-filter' in common functions in icalendar-ast.el:

* lisp/calendar/icalendar-ast.el (icalendar-ast-node-children-of):
Reimplement filter imperatively.
2026-04-12 12:05:44 +03:00
Eli Zaretskii
386e9598b6 ; * doc/lispintro/emacs-lisp-intro.texi (Files List): Fix typo (bug#80694). 2026-04-12 11:54:08 +03:00
Stephen Berman
ee9b2db1cf ; Fix last change to 'ls' error message tests
* test/lisp/dired-tests.el (dired-test-ls-error-message):
* test/lisp/files-tests.el
(files-tests-file-name-non-special-insert-directory): Use
`string-match-p' instead of `equal' because the error message may
report e.g. "/bin/ls" even though the value of
`insert-directory-program' is "ls".
2026-04-11 15:40:40 +02:00
Eli Zaretskii
15f1b565a2 ; * lisp/dired.el (dired-readin-insert): Fix a recent change (bug#80499). 2026-04-11 15:39:47 +03:00
Eli Zaretskii
e8203e3142 Fix setting and restoring cursor shape on Windows Terminal
* src/w32console.c (w32con_set_cursor_size): New function.
(w32con_reset_terminal_modes, w32con_set_terminal_modes)
(Fset_cursor_size): Use it to change cursor shape on Windows
Terminal.
2026-04-11 15:29:25 +03:00
Eli Zaretskii
1eb7218f90 Fix display of ambiguous-width characters on MS-Windows terminal
* src/w32console.c (syms_of_ntterm) <w32--terminal-is-conhost>:
New variable.
(initialize_w32_display): Set 'w32--terminal-is-conhost' non-nil
when running on ConHost.

* lisp/international/characters.el (use-cjk-char-width-table):
When Emacs runs on MS-Windows Terminal, behave as if
'cjk-ambiguous-chars-are-wide' were nil even in CJK locales.
(Bug#79298)
2026-04-11 14:49:47 +03:00
Stephen Berman
adfa1e969f Improve tests involving 'ls' error message
* test/lisp/dired-tests.el (dired-test-ls-error-message):
* test/lisp/files-tests.el
(files-tests-file-name-non-special-insert-directory): Make test
comparing the expected 'ls' error message with the string in the
'ls' error buffer more robust (bug#80499).
2026-04-11 12:09:42 +02:00
Stephen Berman
3e5697864c Ensure Dired does not list deleted 'ls' error file
* lisp/dired.el (dired--ls-error-file): New variable.
(dired-readin-insert): Use it to find and remove entry in Dired
buffer of already deleted temporary 'ls' error file (bug#80499).

* lisp/files.el (insert-directory): Set it to temporary 'ls' error file.
2026-04-11 11:46:52 +02:00
Eli Zaretskii
69d6f58557 Fix face extension in 'visual-line-mode'
* src/xdisp.c (display_line): Under WORD_WRAP, save and restore
the iterator _before_ the wrap point.  This fixes face extension
under 'visual-line-mode', because otherwise 'extend_face_to_end_of_line'
is called with the value of 'it' that corresponds to the first display
element on the next screen line.  (Bug#80673)
2026-04-11 12:27:08 +03:00
Stephen Berman
6a90e0ee32 Handle 'dired' called with -Al switches (bug#80711)
* lisp/dired.el (dired-internal-noselect): After reading in
directory, check whether there was an 'ls' error instead of
checking for file entries, since there may be none is the -Al
switches (or just -l) were used.
(dired--display-ls-error): Ensure the 'ls' error buffer is a live buffer.

* lisp/files.el (insert-directory-clean): Ensure deletion of
"//DIRED-OPTIONS//" line when using -Al switches (or just -l).
2026-04-11 11:01:05 +02:00
Stefan Monnier
52e484742d uni-script.el: Fix failure when loading the file directly
* lisp/international/textsec.el (textsec--create-script-table): Autoload
and don't define while compiling.
(uni-script): Require only when loading, not when compiling.
2026-04-10 14:38:39 -04:00
Pip Cet
c05037ba1c Don't continue FOR_EACH_FRAME loops after delete_frame (bug#80789)
* src/xterm.c (x_connection_closed, x_delete_terminal): Restart
FOR_EACH_FRAME loops after deleting one (or potentially more) frames.
2026-04-10 18:16:54 +00:00
Pip Cet
2edcc6d422 Ensure selected_frame isn't the deleted frame (bug#80789)
The previous code would sometimes exit the loop with frame1 set to the
last considered frame, even if that wasn't a suitable frame to switch
to.

* src/frame.c (delete_frame): Reset 'frame1' in the loops if we don't
match the break condition, so we don't think we've found a suitable
replacement frame if we haven't. Error if, for some reason, that
fails.
2026-04-10 18:16:54 +00:00
Pip Cet
708759324e Don't accept dead selected_frame in x_connection_closed (bug#80789)
* src/xterm.c (x_connection_closed): Try to restore frame if the
selected frame is dead. If that fails, abort.
2026-04-10 18:16:54 +00:00
Mike Kupfer
bc0eacca97 ; * etc/MH-E-NEWS: Document the fix for SF#473. 2026-04-10 11:04:34 -07:00
Mike Kupfer
80c0529e94 Improve previous change.
* lisp/mh-e/mh-thread.el: Require 'mh-folder.
(mh-thread-refile): Update the docstring.
2026-04-10 11:04:29 -07:00
Henrique Martins
b07a3970ae MH-E: remember destination when refiling a thread (SF#473)
* lisp/mh-e/mh-thread.el (mh-thread-refile): Add an optional argument
'dont-update-last-destination-flag'.  If it is nil, update
'mh-last-destination' and 'mh-last-destination-folder'.

Copyright-paperwork-exempt: yes
2026-04-10 11:04:09 -07:00
Stefan Monnier
923eb9afef src/eval.c (Fdefault_toplevel_value): Improve docstring (bug#80775) 2026-04-10 12:05:16 -04:00
Michael Albinus
5cb7446245 * test/infra/gitlab-ci.yml (default): User docker 28.5.2. 2026-04-10 14:28:54 +02:00
Michael Albinus
247f46d5e4 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2026-04-10 12:47:33 +02:00
Eli Zaretskii
34b582301f ; Update "Key Binding" node in Emacs Lisp Intro
* doc/lispintro/emacs-lisp-intro.texi (Key Bindings): Remove
obsolete text about \C in key bindings.  (Bug#80787)
2026-04-10 09:54:42 +03:00
Stefan Monnier
7d00565fee (elisp--font-lock-flush-elisp-buffers): Avoid eager font-locking
When jit-lock is not in use, `font-lock-flush` is too costly to
justify using it just to maybe update the highlighting of a few macro calls.

* lisp/progmodes/elisp-mode.el (elisp--font-lock-flush-elisp-buffers):
Skip buffers that use jit-lock, like the `*ielm*-comint-indirect` buffer.
2026-04-09 17:55:16 -04:00
Stéphane Marks
b4da8610cd ; New function 'ns-process-is-accessibility-trusted', no message (bug#80624)
* src/nsfns.m (Fns_process_is_accessibility_trusted): New
function.
(syms_of_nsfns): New defsubr.
* src/nsterm.m: ([EmacsApp applicationDidFinishLaunching:]):
Remove the AXIsProcessTrusted message.
* etc/NEWS: Updated.
2026-04-09 21:59:13 +01:00
Stefan Monnier
fc128826b5 (elisp--local-variables): Restore point earlier
* lisp/progmodes/elisp-mode.el (elisp--local-variables): Restore
point before calling `elisp--safe-macroexpand-all` in case this
triggers a temporary redisplay.
2026-04-09 14:32:15 -04:00
Stefan Monnier
dcae106214 lisp/vc/vc.el (vc-checkin): Use vc-dir-buffers like we do everywhere else 2026-04-09 12:57:44 -04:00
Stefan Monnier
72ba149cfa (listify-key-sequence): Fix breakage with unibyte chars
* lisp/subr.el (listify-key-sequence): The funny
"7th bit is Meta" applies only to unibyte strings.

* test/lisp/subr-tests.el (subr-listify-key-sequence): New test.
2026-04-09 12:23:26 -04:00
Sean Whitton
1d2c3cb5bb * lisp/vc/vc.el (vc-checkin): Don't assume vc-dir is loaded. 2026-04-09 16:22:39 +01:00
Sean Whitton
49420f7033 with-vc-properties: Don't substitute in a global value
* lisp/vc/vc.el (with-vc-properties): Don't substitute in the
value vc-touched-properties happens to have at macro expansion
time.  This was left over from when vc-touched-properties was
bound to a local gensym.
2026-04-09 16:22:20 +01:00
Michael Albinus
bad60b50ed ; * doc/emacs/msdos.texi (Windows Misc): Fix typo. 2026-04-09 12:00:20 +02:00
समीर सिंह Sameer Singh
04dbd88c34 Fix emoji--insert-buffer being wiped by emoji-list-mode
* lisp/international/emoji.el (emoji-list): Set insert-buffer after the
emoji buffer is set up.  (bug#80773)
2026-04-09 12:07:05 +03:00
Eli Zaretskii
d43aa7c6e2 ; Update admin/authors.el
* admin/authors.el (authors-aliases, authors-fixed-entries): Add
Ewan Townshend and his contribution.
2026-04-09 07:56:56 +03:00
Dmitry Gutov
9d6d4cabbf Fix "Narrowing src/ file breaks xref"
* lisp/emacs-lisp/find-func.el (find-function-C-source):
Look outside of the current narrowing as well (bug#80749).
2026-04-09 05:57:52 +03:00
Stefan Monnier
1df537e8eb lisp/emacs-lisp/cl-macs.el (cl-typep): Undo accidental change 2026-04-08 16:38:19 -04:00
Stefan Monnier
24ff3398c8 src/data.c (set_internal): Mention var which can't be unbound in error msg 2026-04-08 15:43:56 -04:00
Stefan Monnier
d8c9a86063 (take-while, drop-while, all, member-if)
* lisp/subr.el (take-while, drop-while, all, member-if): Don't inline
if `pred` is not a "constant" since it wouldn't bring any
significant benefit.  Also, don't explicitly `macroexpand-all` since
the compiler macro will be called (again) after macro-expansion,
if needed.
(internal--effect-free-fun-arg-p): Return nil for variable references.
2026-04-08 15:29:13 -04:00
Stefan Monnier
666955dfa0 (dired-at-point-prompter): Fix bug#80545
* lisp/ffap.el (ffap-read-file-or-url): Add `read-dir` argument to
indicate we expect a directory as return value.
Avoid `read-file-name` when we want a directory and the dialog UI
might prevent us from doing so.
(dired-at-point-prompter): Use the new arg.
2026-04-08 15:19:06 -04:00
Stefan Monnier
7c5ab95f03 (natnum, keyword, command): Fix bootstrap warnings (bug#80732)
To break the interdependence between `cl-macs` and `cl-preloaded`,
we refrain from defining some types in `cl-macs` in some corner case
situations which affect only the early bootstrap.
`transient.el` is used during early bootstrap (while loading
`emoji.el` to produce `emoji-labels.el`) and it uses the
`keyword` and `command` types, so make sure they're not among
those types that are sometimes not defined.

Include `natnum` while we're at it, so the only types still
affected by this corner case are "Common Lisp" types, which are
less likely to be used during early bootstrap.

* lisp/emacs-lisp/cl-macs.el (natnum, keyword, command): Move type
declaration from here to...

* lisp/emacs-lisp/cl-preloaded.el (natnum, keyword, command): ...here.
2026-04-08 15:01:46 -04:00
Pip Cet
948aecee65 Avoid infinite recursion in bind-keys-form (bug#80759)
* lisp/bind-key.el (bind-keys-form): Always continue loop after
matching a keyword argument.
2026-04-08 14:56:02 +00:00
Michael Albinus
65b984c21a * doc/misc/tramp.texi (New operations): Extend example. 2026-04-08 16:40:15 +02:00
Eli Zaretskii
00207670e5 ; * lisp/term/w32console.el (set-screen-color): Fix signature. 2026-04-08 16:33:57 +03:00
ewantown
2bca4ac0ed Support 24-bit TrueColor on MS-Windows console
* src/w32console.c (DEFAULTP, SSPRINTF, w32con_write_vt_seq)
(w32con_get_cursor_coords): New functions and macros.
(w32con_write_glyphs): Hide cursor before writing to the console.
Add code for writing in virtual-terminal mode when
'w32_use_virtual_terminal' is non-zero.
(w32con_write_glyphs_with_face): Add code for writing in
virtual-terminal mode when 'w32_use_virtual_terminal' is non-zero.
(w32con_setup_virtual_terminal): New function.
(w32con_set_terminal_modes): Call it.
(turn_on_face, turn_off_face): New functions.
(initialize_w32_display): Save background and foreground, and the
current TTY.
(Fset_screen_color): Accept an additional optional argument VTP;
if non-nil, arrange for 24-bit display to use the specified
colors.
(Fget_screen_color): Accept an additional optional argument VTP;
if non-nil, return colors used by 24-bit display.
(Fw32_use_virtual_terminal, Fw32_use_virtual_terminal_p): New
functions.
* src/term.c (tty_setup_colors) [WINDOWSNT]: Set up
virtual-terminal sequences for colors.
(init_tty) [WINDOWSNT]: Set up terminfo capabilities for Windows
virtual-terminal.
* src/xdisp.c (redisplay_internal): Don't call set_tty_color_mode
for WINDOWSNT.

* lisp/term/w32console.el (w32-tty-set-base-colors)
(w32-tty-define-base-colors, w32-tty-define-8bit-colors)
(w32-tty-define-24bit-colors, w32-tty-get-pixel): New functions.
(terminal-init-w32console): Remove color setup.
(w32-tty-setup-colors): New function.
* lisp/term/tty-colors.el (tty-color-mode-alist): Add --color
modes for 256 and 24-bit color modes.
* lisp/startup.el (tty-handle-args): Fix --color handling.
* lisp/faces.el (tty-set-up-initial-frame-faces): Set up colors
for MS-Windows consoles.

* etc/NEWS:
* doc/emacs/msdos.texi (Windows Misc):
* doc/emacs/cmdargs.texi (Colors X): Document 24-bit color support
on MS-Windows.
(Bug#79298)
2026-04-08 15:12:14 +03:00
Eli Zaretskii
9b8361d9ab Improve documentation of 'url-retrieve' and GnuTLS peer status
* doc/misc/url.texi (Retrieving URLs): Describe the ':peer' entry
of the STATUS argument passed to CALLBACK of 'url-retrieve'.

* lisp/url/url.el (url-retrieve):
* src/gnutls.c (Fgnutls_peer_status): Doc fixes.
(Bug#80762)
2026-04-08 11:02:47 +03:00