1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-05-16 10:00:00 -07:00
Commit graph

51064 commits

Author SHA1 Message Date
Randy Taylor
edc19c3536 Always compile w32image.c on MinGW (Bug#80924)
This enables features unrelated to native image APIs, such as
'w32-export-frame' and 'yank-media', which need to call GDI+
functions.
* configure.ac (HAVE_W32) [!CYGWIN]: Always include w32image.o in
W32_OBJ.
* etc/NEWS: Drop 'yank-media' '--without-native-image-api' caveat.
* src/emacs.c (main):
* src/w32select.c (convert_dibv5_to_png):
* src/w32term.c (w32_draw_image_foreground): Replace
HAVE_NATIVE_IMAGE_API with WINDOWSNT.
* src/w32.c (term_ntproc): Remove redundant HAVE_NATIVE_IMAGE_API guard.
* src/w32fns.c (Fw32_export_frame) [!WINDOWSNT]: Return nil on Cygwin.
2026-04-30 18:52:22 +03:00
Collin Funk
51ae6e12b9 Pacify -Wunused-but-set-variable from gcc 16 and clang 13
* src/coding.c: Remove file wide ignore pragma for
-Wunused-but-set-variable.
(detect_coding_XXX) <consumed_chars>: Mention that this variable might
need to be declared with the MAYBE_UNUSED attribute.
(detect_coding_utf_8, detect_coding_emacs_mule, detect_coding_iso_2022)
(encode_designation_at_bol, detect_coding_sjis, detect_coding_big5)
(detect_coding_ccl, detect_coding_charset) <consumed_chars>: Use the
MAYBE_UNUSED attribute.
2026-04-29 22:45:52 -07:00
Paul Eggert
4fcc8a473a ; Spelling fixes. 2026-04-29 22:45:51 -07:00
Eli Zaretskii
3ce42ffd60 ; * src/treesit.c (treesit_pred_with_guard): Fix style conventions. 2026-04-30 07:47:02 +03:00
Yuan Fu
4e420d0b20
In tree-sitter, signal if predicate function causes reparse
A reparse will make the TSTreeCursor or TSNode to possibly point
to freed memory (because the TSTree they point to is freed.)

* src/treesit.c (treesit_pred_with_guard): New function.
(treesit_predicate_pred):
(treesit_eval_predicates):
(Ftreesit_query_capture):
(treesit_traverse_match_predicate):
(treesit_build_sparse_tree): Add guard that signals if buffer is
changed when calling predicate function.
(Qtreesit_buffer_changed): New symbol.
2026-04-29 16:36:48 -07:00
Basil L. Contovounesios
dee5ca5acd ; Avoid mutation in string-collate-lessp example. 2026-04-29 14:42:39 +02:00
Eric S. Raymond
3897a808d9 ; Fix an inconsistency in C symbol naming
This is the one case out of 1902 where the C name didn't match the subr
name.

* src/xfns.c (Fx_display_last_user_time): renamed to Fx_display_set_last_user_time
2026-04-28 13:34:26 -04:00
Eli Zaretskii
5cee4fa0ff ; Fix last change
* etc/NEWS: Announce the change in 'sqlite-close'.
* src/sqlite.c (Fsqlite_close): Fix commentary.
(Bug#80908).
2026-04-27 13:47:17 +03:00
Chris Roberts
09a90f0e90 sqlite-close: no-op for already closed connections
This behavior is more expected than throwing an error,
as passing NULL (closed db connection) to 'sqlite3_close'
is a "harmless no-op" according to the documentation.
* src/sqlite.c (sqlite-close): Ignore already closed connections.
(Bug#80908)

Copyright-paperwork-exempt: yes
2026-04-27 13:42:47 +03:00
Aaron L. Zeng
e4633e657a Support Elisp debugging and backtraces in code called by modules
* src/lisp.h (handlertype) <CATCHER_ALL_DEBUGGABLE>: New enumeration
value.
* src/emacs-module.c (MODULE_HANDLE_NONLOCAL_EXIT):
* src/eval.c (Fthrow, signal_or_quit): Use it.

* test/src/emacs-module-tests.el
(mod-test-non-local-exit-funcall-debug-on-error): New test.

Bug#80714

Copyright-paperwork-exempt: yes.
2026-04-26 15:20:28 +03:00
Yuan Fu
ddbd311d37
; Move treesit-languages-require-line-column-tracking to treesit.c.
* lisp/treesit.el: Remove it.
* src/treesit.c (syms_of_treesit): Add it.
2026-04-25 10:49:26 -07:00
Eli Zaretskii
700768cd1d Fix line-truncation on horizontally-split TTY frames
* src/term.c (append_glyph, append_composite_glyph)
(append_glyphless_glyph): Account for the right-border glyph
when computing the end glyph of TEXT_AREA.  (Bug#80900)
2026-04-25 14:39:53 +03:00
Eli Zaretskii
52c4ef1109 ; * src/process.c (Fprocess_attributes): Doc fix. 2026-04-25 08:48:51 +03:00
Pip Cet
6a19ab9cce Don't modify kbd_fetch_ptr in x_delete_selection_requests (bug#80863)
This code may be called from within the loop in process_special_events
which assumed kbd_fetch_ptr remains unchanged.  This caused a buffer
underflow which resulted in the entire kbd buffer being replayed.

* src/xterm.c (x_delete_selection_requests): Simply clear deleted
events rather than rotating the kbd buffer.
2026-04-24 19:11:16 +00:00
Peter Oliver
74d411d600 Simplify Tc/COLORTERM=truecolor escape sequence
This should be more readable to most people, since C is
more widely familiar than the terminfo language.
* src/term.c (init_tty): Do the conversion from a single integer
24-bit color value to three 8-bit RGB values up-front.
(Bug#70941)
2026-04-23 10:32:50 +03:00
Tim Ruffing
8aa7f6a501 Support setrgbb/setrgbf for setting 24-bit color
* src/term.c (turn_on_face): Account for TF_rgb_separate.
(init_tty): Support setrgbf/setrrgbb and set TF_rgb_separate
accordingly.
* src/termchar.h: Update commentary.
(Bug#70941)
2026-04-23 10:29:00 +03:00
Peter Oliver
84ae97f865 Use expected escape sequence for terminfo Tc and COLORTERM=truecolor
When the non-standard terminfo capability Tc is present, or the
environment variable COLORTERM is set to truecolor, use a
hard-coded escape sequence that addresses all colors directly by
their RGB values.

Previously we used escape sequences cribbed from terminfo's
setaf/setab for direct color, that expect that we will only try to
use colors 000000 to 000007 for the first eight indexed colors.
This isn't something we currently handle.

* doc/misc/efaq.texi (Colors on a TTY): Fix off-by-one error in list
of indexed colors for terminfo RGB terminals.
* src/term.c (init_tty): Don’t use any indexed colors with terminfo
Tc capability or COLORTERM=truecolor environment variable (bug#70941).
2026-04-23 10:20:41 +03:00
Eli Zaretskii
ccb454f28c Fix unsafe use of SDATA in 'display_tty_menu_separator'
* src/xdisp.c (display_tty_menu_separator): Pass Lisp string to
display_string, not a pointer to its SDATA.  This is safer
GC-wise.
2026-04-21 15:49:07 +03:00
Yuan Fu
3d0597e9b2
* src/treesit.c (Ftreesit__linecol_at): Add treesit_check_position. 2026-04-19 19:50:12 -07:00
Yuan Fu
6894b65440
Fix tree-sitter variable name
* lisp/treesit.el:
(treesit-languages-require-line-column-tracking): This is what
treesit.c uses.
* src/treesit.c: Fix comment typo.
2026-04-19 19:50:12 -07:00
Paul Eggert
1ae3a09032 Pacify clang 21.1.8 + gdk-pixbuf 2.44
* src/pgtkfns.c (xg_set_icon_from_xpm_data):
* src/xfns.c (xg_set_icon_from_xpm_data):
Also pacify clang when --enable-gcc-warnings is used.
2026-04-18 22:33:52 -07:00
Yuan Fu
5e7518b838
; * src/treesit.c (compute_new_linecol_by_change): Fix comment. 2026-04-17 20:19:58 -07:00
Yuan Fu
35a8e7e068
Make sure range (1, 1) doesn't capture anything (bug#80798)
* src/treesit.c (Ftreesit_query_capture): Return Qnil if
querying (1, 1).
2026-04-16 23:23:25 -07:00
Yuan Fu
5ea181a75e
Accept marker as position in treesit.c functions (bug#80830)
* src/treesit.c (treesit_check_positive_integer): Remove.
(treesit_check_position):
(Ftreesit_node_first_child_for_pos):
(Ftreesit_node_descendant_for_range):
(Ftreesit_query_capture):
(Ftreesit__linecol_at): Use fix_position.

* test/src/treesit-tests.el:
(treesit-query-marker-position): Test.
2026-04-16 23:23:12 -07:00
Stefan Monnier
126eab79b0 src/syntax.c (update_syntax_table): Remove redundant assignment 2026-04-16 11:39:26 -04:00
Juri Linkov
0384600a21 New faces 'tab-line-active' and 'tab-line-inactive' (bug#80742)
This is intended to parallel the 'mode-line-active/inactive'
and 'header-line-active/inactive' distinction.

* doc/emacs/display.texi (Standard Faces): Document the new faces.

* lisp/faces.el (tab-line-active, tab-line-inactive): Add new faces.

* lisp/tab-line.el (tab-line-faces): Add new faces
to MEMBERS arg of 'defgroup'.
(tab-line-auto-hscroll): Use one of the faces
depending on 'mode-line-window-selected-p'.

* src/dispextern.h (CURRENT_TAB_LINE_ACTIVE_FACE_ID_3)
(CURRENT_TAB_LINE_ACTIVE_FACE_ID): New macros
based on header-line equivalents.
(CURRENT_TAB_LINE_HEIGHT): Use CURRENT_TAB_LINE_ACTIVE_FACE_ID.
(face_id): Use TAB_LINE_ACTIVE_FACE_ID and
TAB_LINE_INACTIVE_FACE_ID instead of TAB_LINE_FACE_ID.

* src/xdisp.c (window_box_height, pos_visible_p, init_iterator)
(window_text_pixel_size, display_mode_lines, display_mode_line)
(format-mode-line): Replace all uses of TAB_LINE_FACE_ID with
either a new macro or the new face IDs.

* src/xfaces.c (lookup_basic_face, realize_basic_faces):
Map new face IDs to their lisp symbols.
(syms_of_xfaces): New lisp symbols.
2026-04-14 20:14:15 +03:00
Eli Zaretskii
dcbfa53e4b ; * src/conf_post.h: Another tweak of conditionals for MinGW64. 2026-04-14 17:48:59 +03:00
Eli Zaretskii
5e34dba5b8 ; And one more attempt to fix MinGW64 build
* src/conf_post.h [WINDOWSNT]: Use "#if !FOO" because HAVE_DECL_*
are defined to zero.
2026-04-14 16:02:42 +03:00
Eli Zaretskii
6bda6e2123 ; Another attempt to fix the MinGW64 build
* src/conf_post.h [WINDOWSNT]: Add prototype for 'getline'.
2026-04-14 15:32:11 +03:00
Eli Zaretskii
601c099d1d ; Fix MinGW64 build due to missing 'getdelim' prototype
* src/conf_post.h [WINDOWSNT]: Add prototype for 'getdelim'.
Reported by Angelo Graziosi <angelo.g0@libero.it>.
2026-04-14 14:18:49 +03:00
Stefan Monnier
6942d508f0 SETUP_SYNTAX_TABLE: syntax-propertize more lazily (bug#80600)
Many regexps do not pay attention to syntax tables at all
because they don't use things like \s, \b, \<, or \_<.
So delay the actual initialization of the machinery for
`syntax-table` properties (especially the call to `syntax-propertize`)
until the first time we actually need to consult the syntax of
a character.

* src/syntax.c (uninitialized_interval): New constant.
(RE_SETUP_SYNTAX_TABLE_FOR_OBJECT, SETUP_SYNTAX_TABLE):
Set `forw/backward_i` to that new constant to indicate they haven't
actually be initialized yet.
Set `start` and `stop` fields right away, instead of delegating it to
`update_syntax_table`, so that `e_property` and `b_property`
can be set independently.
(update_syntax_table): Remove the `init` argument.  Instead, discover
the need for initialization based on the fact that `forw/backward_i`
are uninitialized.  Presume `start` and `stop` fields have been
set already.
(parse_sexp_propertize): Update call accordingly.
(update_syntax_table_forward): Remove the `init` argument.

* src/syntax.h (update_syntax_table, update_syntax_table_forward):
Remove the `init` argument.
(UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD):
Update calls accordingly.
2026-04-13 16:45:27 -04:00
Eli Zaretskii
5d0efe0a5a Fix hangs on MS-Windows when deleting a pipe process
* src/w32.c (sys_close): Don't close a descriptor from which the
reader thread is reading, to avoid hanging Emacs.  (Bug#80770)
2026-04-13 17:06:46 +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
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
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
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
Stefan Monnier
923eb9afef src/eval.c (Fdefault_toplevel_value): Improve docstring (bug#80775) 2026-04-10 12:05: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
24ff3398c8 src/data.c (set_internal): Mention var which can't be unbound in error msg 2026-04-08 15:43:56 -04: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
Eli Zaretskii
c3fda2e34b Fix display in window margins when text-area text is reordered
* src/xdisp.c (handle_stop_backwards): Don't overwrite
'stop_charpos' if we end up on a different stack level of the
iterator.  (Bug#80693)
2026-04-05 12:34:12 +03:00
Eli Zaretskii
91b08717d4 ; * src/sound.c (Fw32_sound_volume): Shut up GCC warning. 2026-04-05 09:54:56 +03:00
Yuan Fu
45d7678ca3
Fix treesit-query-capture's NODE-ONLY param
Before the fix, if user uses the NODE-ONLY option, we don't keep
the capture names in the results, then predicates won't work
because they can't reference capture names.

* src/treesit.c (query_capture_remove_capture_name): New
function.
(Ftreesit_query_capture): Use the new function to remove capture
names AFTER running the predicate.
* test/src/treesit-tests.el:
(treesit-query-node-only-and-grouped): New test.
2026-04-04 22:35:35 -07:00
Eli Zaretskii
01a9d78a7e Fix use of special glyphs with faces from display-table
* src/xdisp.c (produce_special_glyphs): Fix the case where the
display-table specifies a face for truncation/continuation glyphs.
(Bug#80693)
2026-04-04 18:22:05 +03:00
Eli Zaretskii
e7751405d0 ; Improve documentation of 'make-temp-file'
* doc/lispref/files.texi (Unique File Names):
* lisp/files.el (make-temp-file):
* src/fileio.c (Fmake_temp_file_internal): Doc fixes.
2026-04-04 09:56:32 +03:00