1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-20 19:42:53 -08:00
Commit graph

50347 commits

Author SHA1 Message Date
Eli Zaretskii
6ed119d305 ; Fix documentation of recent treesit changes
* src/treesit.c (Ftreesit_query_capture)
(Ftreesit_parser_embed_level, Ftreesit_parser_set_embed_level)
(Ftreesit_parser_set_parent_node):
* lisp/treesit.el (treesit-query-range)
(treesit-query-range-by-language, treesit-range-settings)
(treesit-range-rules, treesit--parser-at-level)
(treesit--update-ranges-non-local, treesit--update-ranges-local)
(treesit--update-range-1): Fix wording and typos in doc strings.

* doc/lispref/parsing.texi (Pattern Matching): Fix wording.
2025-02-28 09:12:05 +02:00
Yuan Fu
625b2b02a3
Enable treesit-query-capture to return grouped captures
This is needed for creating embedded parsers for embedded code
blocks of which language cannot be known ahead of time.  E.g.,
markdown and org mode's code block.

* src/treesit.c (Ftreesit_query_capture): Add parameter GROUPED.
2025-02-27 17:22:03 -08:00
Yuan Fu
30e1508ef2
Add tree-sitter-parser-embed-level and parent-node
Add parser properties embed-level and parent-node. They'll be
help us implement arbitrarily nested embeded parser, and
navigation across embedded and host parsers, respectively.

* src/treesit.c:
(Ftreesit_parser_embed_level):
(Ftreesit_parser_set_embed_level):
(Ftreesit_parser_parent_node):
(Ftreesit_parser_set_parent_node): New functions.
2025-02-27 17:22:03 -08:00
Philipp Stephani
32da093e52 Don't overwrite non-local exit symbol and data (Bug#65796).
The previous approach would incorrectly invalidate the returned module
values if another non-local exit occurred while dealing with a non-local
exit.  See Bug#65796.  Instead, allocate the values from the usual
environment storage, and return statically-allocated objects if that
fails.

* src/emacs-module.c (struct emacs_env_private): Turn non-local exit
symbol and data into normal Lisp objects.
(initialize_environment): Initialize them.
(mark_module_environment): Prevent them from being garbage-collected.
(module_signal_or_throw, module_non_local_exit_signal_1)
(module_non_local_exit_throw_1): Adapt uses.
(value_to_lisp): No longer scan for them with module assertions enabled.
(module_out_of_memory_signal, module_out_of_memory_data): New
statically-allocated module values to return in case of allocation
failure.
(syms_of_module): Initialize them.
(module_non_local_exit_get): Allocate module values normally.  If that
fails, return statically-allocated values.

* doc/lispref/internals.texi (Module Nonlocal): Document new behavior.
2025-02-28 01:45:35 +01:00
Po Lu
a4a458ffa4 Fix drag-and-drop treatment of reused tooltip frames
* src/androidfns.c (Fx_show_tip): Set `tip_window' to that of
any reused tooltip frame.

* src/haikufns.c (unwind_create_frame): Return whether the frame
was destroyed, as on X.
(unwind_create_tip_frame, haiku_create_frame, Fx_show_tip):
Synchronize with X.
(do_unwind_create_frame): New function.
(tip_window): Remove unused variable.

* src/nsfns.m (tip_window, unwind_create_tip_frame): Remove
unused variable `tip_window'.

* src/pgtkfns.c (pgtk_create_tip_frame): Rename to
pgtk_create_tip_frame.
(Fx_show_tip): Adjust accordingly.  Set `tip_window' to that of
any reused tooltip frame.

* src/w32fns.c (Fx_show_tip):

* src/xfns.c (Fx_show_tip): Set `tip_window' to that of any
reused tooltip frame.
2025-02-27 18:18:58 +08:00
Gerd Möllmann
3de9994b9e * src/dispnew.c (rect_intersect): Fix a typo (bug#76592) 2025-02-27 07:03:51 +01:00
Stefan Kangas
8c16583491 ; Whitespace fixes to silence git hooks 2025-02-26 18:11:22 +01:00
Po Lu
928dc34e05 Guarantee delivery of inotify special events
* src/inotify.c (inotifyevent_to_event): Always match events
that are not encompassed by IN_ALL_EVENTS and which the
documentation implies are always delivered to callbacks.

* test/src/inotify-tests.el (inotify-file-watch-stop-delivery):
New test.
2025-02-26 10:39:46 +08:00
Pip Cet
1f891898d4 Handle multibyte mode line spec chars (bug#76517)
* src/xdisp.c (display_mode_element): Make 'c' an 'int'.  Use
'string_char_and_length' to fetch the character from a multibyte
string, not 'SREF'.
2025-02-25 16:36:17 +00:00
Martin Rudalics
be60601ae8 Clarify semantics of 'frame-inhibit-implied-resize'
* src/frame.c (frame_inhibit_implied_resize):
* doc/lispref/frames.texi (Implied Frame Resizing): Clarify
semantics of 'frame-inhibit-implied-resize'.
2025-02-24 09:47:30 +01:00
Stefan Monnier
d84dbcb450 (Ftranspose_regions): Fix text-properties for len1==len2
When `len1_byte == len2_byte`, the code presumed that len1==len2
as well in its handling of text-properties.  Fix that case.
While at it, try and reduce code duplication by hoisting common
code out of `if`s, and throw away the optimization for `len_mid == 0`
which only saved 3 trivial function calls.

* src/editfns.c (Ftranspose_regions): Shuffle the code a bit.

* test/src/editfns-tests.el (editfns-tests--transpose-equal-but-not):
New test.
2025-02-23 11:46:37 -05:00
Eli Zaretskii
70b15c5174 ; Fix last change
* src/frame.c (syms_of_frame) <frame-inhibit-implied-resize>:
* doc/lispref/frames.texi (Implied Frame Resizing): Don't use
passive voice.  (Bug#76275)
2025-02-23 12:25:14 +02:00
Martin Rudalics
499da9e1a9 Optionally inhibit implied resizing while frame is made (Bug#76275)
* src/frame.c (frame_inhibit_resize): Handle new value 'force'
for 'frame-inhibit-implied-resize' (Bug#76275).
(frame_inhibit_implied_resize): New value 'force' to inhibit
implied resizing while a new frame is made.
* lisp/cus-start.el (frame-inhibit-implied-resize): Make new
value 'force' customizable.
* doc/lispref/frames.texi (Implied Frame Resizing): Describe new
value 'force' of 'frame-inhibit-implied-resize'.
* etc/NEWS: Announce new value 'force' of
'frame-inhibit-implied-resize'.
2025-02-23 11:01:20 +01:00
Gerd Möllmann
2a756ce9d7 Enforce redisplay when deleting a child frame (bug#76406)
* src/term.c (tty_free_frame_resources): When deleting a child mark its
root frame to garbaged.
* src/dispnew.c (prepare_desired_root_row): Add a check for GLYPH_DEBUG.
2025-02-23 10:38:27 +01:00
Paul Eggert
f12fbed4c1 Revert “Pacify GCC in pgtkselect malloc alignment”
Problem reported by the wurfkreuz (Bug#76414).
* src/pgtkselect.c: Revert my commit
ff65cc9944 dated Sun Jan 26 22:15:49
2025 -0800 for now.  I may come up with a better commit later.
2025-02-22 23:54:22 -07:00
Eli Zaretskii
827a91dbf3 Make 'text-property-default-nonsticky' buffer-local when set
* src/textprop.c (syms_of_textprop)
<text-property-default-nonsticky>: Make buffer-local when set.
(Bug#76445)

* etc/symbol-releases.eld: Add text-property-default-nonsticky.

* etc/NEWS:
* doc/lispref/text.texi (Sticky Properties): Document the change.
2025-02-22 18:04:04 +02:00
Stefan Kangas
702cb123fa ; Fix typos 2025-02-22 14:48:29 +01:00
Po Lu
1f2e06283c Merge from savannah/emacs-30
25ba253609 Fix reported Haiku build error in emacs-30.1-rc1
92e96a1175 ; Delete troff markers from ChangeLog files
2025-02-21 13:32:14 +08:00
Po Lu
25ba253609 Fix reported Haiku build error in emacs-30.1-rc1
* src/haiku_support.cc (keysym_from_raw_char): Don't define
duplicate cases on the previous release.
2025-02-21 13:28:55 +08:00
Mattias Engdegård
b481fbe92f * src/fns.c (Fmapconcat): Faster fast-path condition 2025-02-20 20:14:33 +01:00
Paul Eggert
241e8e5fcf ; Spelling fix in comment. 2025-02-20 09:42:33 -08:00
Po Lu
1c49cfc711 Fix set-time-zone-rule on DJGPP
* lisp/loadup.el ("tooltip"): Load even on MS-DOS.

* src/timefns.c (tzvalbuf): Don't define on MS-DOS.
(emacs_getenv_TZ, emacs_setenv_TZ) [MSDOS]: Call getenv and
putenv rather than overwrite existing environment storage to
update DJGPP's environment modification counter.
2025-02-20 19:46:50 +08:00
Po Lu
b65971b2c0 ; * src/pdumper.c (Fdump_emacs_portable): Fix typo in comment. 2025-02-20 14:27:03 +08:00
Po Lu
c22957c4bf Port to modern GCC and pdumper on MS-DOS
* config.bat (mvOk): Protoize.
(djgppOk): Include sys/version.h for _DJGPP_MINOR.

* lisp/loadup.el: If system-type is ms-dos, dump bootstrap-emacs
as b-emacs.dmp.

* msdos/INSTALL: Document new versions of tools that have been
verified successfully to compile Emacs.

* msdos/emacs.djl: New linker script that arranges to link
symbols in `.subrs' in a contiguous part of data, as the DJGPP
runtime appears to treat any non-data and non-text section as
allocatable.

* msdos/mainmake.v2 (install): Install emacs.dmp alongside
emacs.exe.

* msdos/sed1v2.inp (CFLAGS): Define to -O2 -g3.
(LDFLAGS): Provide the said linker script.
(HAVE_PDUMPER): Define to yes.
(UNEXEC_OBJ, PAXCTL_dumped, PAXCTL_notdumped): Delete.
(DUMPING): Set to pdumper.
(MAKE_PDUMPER_FINGERPRINT): Don't erase this variable.
Don't stubify or set minstack.  Remove native-comp specific
directives.  Don't remove temacs prior to copying and replace
`pdmp' extension with DOS-conformant `dmp'.

* msdos/sed2v2.inp (HAVE_UNEXEC): Remove definition.
(HAVE_PDUMPER): Define to 1.

* msdos/sed6.inp (top_srcdir): Define appropriately.

* msdos/sedlibmk.inp (HAVE_BLKCNT_T): Define to 1.

* src/emacs.c (load_pdump) [MSDOS]: Use `dmp' suffix.

* src/pdumper.c (Fdump_emacs_portable) [MSDOS]: Replace ".pdmp"
suffixes with ".dmp".
2025-02-20 14:04:59 +08:00
Stefan Kangas
92e96a1175 ; Delete troff markers from ChangeLog files 2025-02-20 02:46:43 +01:00
Gerd Möllmann
23bf94a011 Don't call x-popup-function for non-tty frames
* src/menu.c (x_popup_menu_1): Don't call x-popup-function for non-tty
frames
(syms_of_menu): Remove Qx_popup_menu_function because unused, extend doc
string of x-popup-menu-function.
2025-02-19 08:36:59 +01:00
Gerd Möllmann
1194ebe3a7 Handle nil top frame (bug#76410)
* src/frame.c (do_switch_frame): Don't assume that top_frame is always a
frame, it can be nil.
2025-02-19 08:05:56 +01:00
Stefan Monnier
d685d21e8a (lexical-binding): Allow changing the default value (bug#74145)
* lisp/loadup.el: Preserve (default-toplevel-value 'lexical-binding).

* src/lread.c (Fload, Feval_buffer): Obey (default-toplevel-value
'lexical-binding).

* doc/lispintro/emacs-lisp-intro.texi (Lexical vs Dynamic Binding
Example): Use the lexical dialect also for the dynamic
scoping example.
* doc/lispref/edebug.texi (Edebug Eval): Remove long-obsolete mention
of Edebug support for `lexical-let`.
2025-02-18 15:37:50 -05:00
Stefan Monnier
20edecd21f Merge remote-tracking branch 'refs/remotes/origin/master' 2025-02-18 10:07:34 -05:00
Gerd Möllmann
4d3a618941 ; * src/menu.c (x_popup_menu_1): Fix typo. 2025-02-18 16:05:38 +01:00
Stefan Monnier
41624d94ce (replace_range): Delete last arg, always the negation of the first bool
* src/insdel.c (replace_range): Merge last arg, with `prepare`.
Rename `prepare` to `run-mode-hooks`.
* src/lisp.h (replace_range): Adjust accordingly.
* src/editfns.c (Ftranslate_region_internal):
* src/cmds.c (internal_self_insert):
* src/search.c (Freplace_match): Adjust callers.
2025-02-18 10:05:34 -05:00
Stefan Monnier
19f5ccbf39 src/search.c (Freplace_match): Let replace_range call the a-c-f 2025-02-18 09:54:48 -05:00
Stefan Monnier
9854103b52 * src/editfns.c (Fsubst_char_in_region): Delete left-over code
This code was missed back in 2000 (commit 1b16afa45bb6).
2025-02-18 09:52:35 -05:00
Gerd Möllmann
bf067daf0d * src/menu.c (x_popup_menu_1): Use calln. 2025-02-18 15:47:18 +01:00
Po Lu
37fad04830 * src/menu.c (x_popup_menu_1): Fix coding style. 2025-02-18 21:00:08 +08:00
Gerd Möllmann
17bf6b9efe Add x-popup-menu-function
* src/menu.c (x_popup_menu_1): If non-nil call x-popup-menu-function.
(syms_of_menu): DEFSYM x-popup-menu-function, DEFVAR_LISP it.
2025-02-18 05:13:16 +01:00
Gerd Möllmann
a51cfbbd15 Hide cursor based on tty frame's `cursor-type'
* src/dispnew.c (terminal_cursor_magic): if selected-frame has
`(cursor-type . nil)' parameter.
2025-02-18 05:05:39 +01:00
Eli Zaretskii
1136963b4e ; * src/xdisp.c (maybe_produce_line_number): Fix last change (bug#76362). 2025-02-17 18:00:30 +02:00
Gerd Möllmann
d80ac0fbaa Fix child coordinate calculation (bug#76321)
* src/dispnew.c (rect_intersect): Simplify.
(copy_child_glyphs): Compute child coordinates using child_xy.
2025-02-17 11:22:28 +01:00
Po Lu
a951dbcf16 Implement `(- N)' frame position specifications on Haiku
* src/haikuterm.c (haiku_calc_absolute_position): New function.
(haiku_set_offset): Apply offsets configured by the said
function.
2025-02-17 12:07:20 +08:00
Po Lu
6c1e6ba83c ; * src/androidterm.c (android_set_offset): Apply correct frame offsets. 2025-02-17 12:02:05 +08:00
Po Lu
718a227f0f ; Correct merge errors. 2025-02-17 11:36:41 +08:00
Po Lu
25b25fce75 Merge from savannah/emacs-30
e3dc0ea254 Fix crash in frame deletion on Android
e34ea5db5f * src/pgtkterm.c (pgtk_enumerate_devices): Circumvent bug...
48f9d6aafe * lisp/man.el (Man-shell-file-name): Ensure a Bourne shel...
7016c13e5e ; Update etc/AUTHORS (bug#76319).
0bc7b5a389 ; * admin/authors.el (authors-aliases): Add "Elías Gabrie...
e9c4f642b9 ; * doc/emacs/package.texi (Package Installation): Add om...
8c4294f370 ; Move index entries in user manual

# Conflicts:
#	src/pgtkterm.c
2025-02-17 11:36:14 +08:00
Po Lu
0a6997b58d Synchronize frame placement logic with X
* src/androidterm.c (android_calc_absolute_position): New
function.
(android_set_offset): Call android_calc_absolute_position.

* src/pgtkterm.c (pgtk_calc_absolute_position): Synchronize with
X.
2025-02-17 11:34:06 +08:00
Po Lu
e34ea5db5f * src/pgtkterm.c (pgtk_enumerate_devices): Circumvent bug#76239. 2025-02-17 10:56:45 +08:00
Eli Zaretskii
0f768b8843 Prevent buffer overflow in line-numbering code
* src/xdisp.c (maybe_produce_line_number): Limit the value of
'display-line-numbers-width' to what can be shown in the window,
and set dimension of the lnum_buf[] accordingly.  (Bug#75969)
2025-02-15 13:15:36 +02:00
Po Lu
c37e7cef42 Merge from savannah/emacs-30
58e4bfe340 Add two missing NULL checks of malloc'd values on Android
81ca9c75f1 ; * etc/PROBLEMS: Document how to grant storage permissio...
d82d468979 ; * etc/TODO: Rethink finder-known-keywords.
b9b9c33dcb Fix (Non)GNU ELPA description in manual
87a61eba1b Move 'package-archives' documentation to emacs manual
316e47c5af ; * src/fns.c (Fmapconcat): Doc fix (bug#76242).
3cfbeb3fca ; Fix >72 character long lines in docstring
c68886ddb7 ; Change "virus" to "malicious" in lispref
6701866be4 Document (Non-)GNU ELPA in emacs manual
02851768b7 ; * .mailmap: Add entry for Thuna.  (Bug#76221)
2d7a8cbf4c Fix author name
1931425748 Use c-ts-common's comment setup in go-ts-mode (bug#75978)
316893ca38 Add java-language-server to eglot-server-programs
2025-02-15 16:58:55 +08:00
Po Lu
58e4bfe340 Add two missing NULL checks of malloc'd values on Android
* src/android.c (sendDndUri, sendDndText): Verify that allocated
string memory is non-nil before writing to it.
2025-02-15 16:58:18 +08:00
Pip Cet
608113628c Avoid crashes in lread.c when invalid characters are read
* src/lread.c (readchar): Don't crash for non-fixnum return values.
(read_filtered_event): Don't crash for invalid symbol properties.
(Fread_char):
(Fread_char_exclusive):
(character_name_to_code): Check 'FIXNUMP' before using 'XFIXNUM'.
(read_char_escape): Crash on invalid Lisp-supplied data when
ENABLE_CHECKING; otherwise, signal an error.
2025-02-14 13:51:28 +00:00
Eli Zaretskii
316e47c5af ; * src/fns.c (Fmapconcat): Doc fix (bug#76242). 2025-02-13 11:03:26 +02:00