Commit graph

47252 commits

Author SHA1 Message Date
Po Lu
ca1ce00854 Pacify compiler warning in xterm.c
* src/xterm.c (handle_one_xevent): Mark gen_help_time UNINIT.
Reported by Lars Ingebrigtsen <larsi@gnus.org>.
2022-09-29 09:36:13 +08:00
Stefan Kangas
7280f3f073 ; Fix typos 2022-09-28 17:34:59 +02:00
Stefan Kangas
86938bfbea Merge from origin/emacs-28
8033947fe2 .mailcap: Some additional fixes.
b1e92c59ed Avoid assertion violations in 'pop_it'
2022-09-28 16:38:31 +02:00
Eli Zaretskii
b1e92c59ed Avoid assertion violations in 'pop_it'
* src/xdisp.c (pop_it): Avoid assertion violations when handling
lists or vectors of display properties.  (Bug#58122)
2022-09-28 16:46:39 +03:00
Stefan Kangas
d1d0f03a58 Merge from origin/emacs-28
72aac80184 ; Fix typo
c54a64491f Add .mailmap for proper git log output
f9a072c592 ; Fix typo
3d056f6947 * doc/emacs/ack.texi (Acknowledgments): Update maintainers.
00159c086c ; Add commentary to disabled OTF support code in font.c

# Conflicts:
#	src/font.c
2022-09-28 15:35:06 +02:00
Po Lu
5f7d9a1a9f Apply root window coordinate optimizations to crossing events as well
* src/xterm.c (xi_compute_root_window_offset_enter): New
function.
(handle_one_xevent): Apply root window crossing optimizations to
XI_Enter and XI_Leave events too.  Not strictly necessary but
since we apply them to motion events it would be consistent to
apply them to crossing events as well as recommended by the
ICCCM.
2022-09-28 20:36:17 +08:00
Paul Eggert
f6fb2b9e1f Port better to C23 bool+true+false keywords
C23 is adding the C++ keywords bool, true, and false;
prefer them to <stdbool.h> if they are available.
* admin/merge-gnulib (GNULIB_MODULES):
Add stdbool, which emulates C23 on pre-C23 platforms.
(AVOIDED_MODULES): Remove stdbool; Gnulib has renamed
this module to stdbool-c99 and nobody uses it so it does
not need to be avoided.
* m4/c-bool.m4: New file, from Gnulib stdbool module.
* lib-src/seccomp-filter.c, src/conf_post.h, src/dynlib.h:
* src/emacs-module.c, src/nsterm.m, src/systhread.h:
* test/src/emacs-module-resources/mod-test.c:
Use the C23 style and use bool without including <stdbool.h>.
The Gnulib stdbool module causes config.h to include stdbool.h
on pre-C23 platforms.
* src/emacs-module.h.in:
Don’t include <stdbool.h> if C23 or later, or if
it has already been included.
2022-09-28 01:09:01 -07:00
Stefan Kangas
327890dd6c Document the new "XRandR 1.5" value
* src/xfns.c (Fx_display_monitor_attributes_list):
* lisp/frame.el (display-monitor-attributes-list):
* doc/lispref/frames.texi (Multiple Terminals): Document the new
"XRandR 1.5" value.
2022-09-27 15:29:33 +02:00
Po Lu
fe21507439 ; * src/xfns.c (Fx_window_property): Fix markup. 2022-09-27 20:04:57 +08:00
Po Lu
60b4fe92c8 Improve doc of `x-window-property'
* src/xfns.c (Fx_window_property): Fix errors in doc string and
document where to obtain documentation for standardized window
properties.
2022-09-27 20:04:56 +08:00
YAMAMOTO Mitsuharu
604b541d5c Avoid uninitialized variable warning
* src/composite.c (composition_gstring_adjust_zero_width): Simplify
last change with respect to an exit condition.
2022-09-27 12:39:31 +09:00
Po Lu
51ec68b318 Optimize coordinate translation during event handling
These changes noticeably improve turning the mouse wheel on top of
scroll bars etc over slow network connections.

* src/xterm.c (x_dnd_note_self_position, x_dnd_note_self_wheel)
(x_dnd_note_self_drop): Use x_translate_coordinates.
(x_compute_root_window_offset): New function for calculating and
caching root window offsets of edit window.
(x_translate_coordinates): New function.  Use cached values
whenever possible.
(xi_compute_root_window_offset)
(xi_compute_root_window_offset_pinch): New wrappers for XI2
events.
(x_construct_mouse_click, handle_one_xevent): Use
x_translate_coordinates wherever appropriate.
* src/xterm.h (struct x_output): New fields for keeping track of
the root window offset of the edit window.
2022-09-27 10:51:13 +08:00
YAMAMOTO Mitsuharu
cd88f6de4b Adjust zero-width grapheme clusters so they are displayed (Bug#50951)
* src/composite.c (composition_gstring_adjust_zero_width): New function.
* src/composite.h: Declare it.
* src/font.c (Ffont_shape_gstring): Use it before putting gstring to cache.
2022-09-27 09:22:00 +09:00
Eli Zaretskii
00159c086c ; Add commentary to disabled OTF support code in font.c
* src/font.c (check_gstring, check_otf_features, otf_tag_symbol)
(otf_open, font_otf_capability, generate_otf_features)
(font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
Move closer to the primitives that use them.  Add commentary for
the purpose of this code.
2022-09-26 09:35:10 +03:00
YAMAMOTO Mitsuharu
9ed03040d5 Make average width computation on ftcr more permissive (Bug#43058)
* src/ftcrfont.c (ftcrfont_open): Use only non-zero width glyphs for
computing average width.
2022-09-26 09:57:23 +09:00
Mattias Engdegård
197afa4de3 ; * src/fns.c (Fcopy_alist): More accurate error type 2022-09-25 17:51:19 +02:00
Mattias Engdegård
fb5a049770 Don't crash in copy-alist with non-list argument
* src/fns.c (Fcopy_alist): Check argument type.
* test/src/fns-tests.el (fns--copy-alist): New test.
2022-09-25 17:04:49 +02:00
Po Lu
568920a5b7 Implement font-use-system-font on Haiku
* doc/emacs/frames.texi (Fonts): Update documentation to say
what font-use-system-font really does and where it can be used.
* src/haiku_font_support.cc (language_code_points): Fix coding
style.
(font_style_to_flags, be_font_style_to_flags): Accept const char
*.
(be_send_font_settings, be_listen_font_settings)
(be_lock_font_defaults, be_unlock_font_defaults)
(be_get_font_default, be_get_font_size): New functions used to
retrieve default font data.

* src/haiku_io.c (haiku_len): Handle FONT_CHANGE_EVENT.
* src/haiku_support.h (enum haiku_event_type): New event type
FONT_CHANGE_EVENT.
(enum haiku_what_font): New enum.
(struct haiku_font_change_event): New struct.

* src/haikufont.c (Ffont_get_system_normal_font)
(Ffont_get_system_font, haiku_handle_font_change_event): New
functions.
(syms_of_haikufont): Provide `dynamic-setting' and define new
variables and subrs.

* src/haikuterm.c (haiku_default_font_parameter): Use system font.
(haiku_read_socket): Handle FONT_CHANGE_EVENTS.
(haiku_term_init): Start listening for font configuration changes.
* src/haikuterm.h: Update prototypes.

* src/xsettings.c (Ffont_get_system_normal_font)
(Ffont_get_system_font): Update doc string.
(syms_of_xsettings): Replace calls to intern with a static
string.
2022-09-25 13:24:03 +00:00
Manuel Giraud
703f29d541 Ensure no memory leaks of glyph_matrix
; * src/dispnew.c (allocate_matrices_for_window_redisplay): Allocate
each glyph_matrix only when it's NULL.  (Bug#58028)
2022-09-24 19:07:27 +03:00
Stefan Monnier
0cc107ac09 Merge branch 'emacs-28' 2022-09-24 10:32:39 -04:00
Lars Ingebrigtsen
126d5b23cf `append' doc string clarification
* src/fns.c (Fappend): Clarify whether arguments are copied.
2022-09-24 11:43:04 +02:00
Po Lu
54876bf498 Reduce complexity of scroll bar window protection code
It turns out my previous theories of why ClientMessages were
generated were wrong, and they are just generated so we can set
finish to X_EVENT_GOTO_OUT to have them delivered immediately.

This allows for the code to be simplified greatly, by not
unpacking pointers to the raw window into the client messages.

* src/xterm.c (x_unprotect_window_for_callback): Return the
window removed from the queue, or nil if none.
(x_scroll_bar_to_input_event)
(x_horizontal_scroll_bar_to_input_event): Use window provided by
x_unprotect_window_for_callback.
(handle_one_xevent): Pass dpyinfo to functions that need it.
(x_free_frame_resources): Remove "first scroll bar request"
code.

* src/xterm.h (struct x_display_info): Likewise.
2022-09-24 16:30:37 +08:00
Eli Zaretskii
597c59078e ; * src/keyboard.c (Fposn_at_point): Doc fix. (Bug#52092) 2022-09-24 09:22:45 +03:00
Stefan Kangas
7aa771a482 Merge from origin/emacs-28
60ac12d21f Fix shaping with bitmap-only fonts on HarfBuzz 5.2.0 (Bug#...
9f65e52362 ; Minor copyedits of elisp.texi
2022-09-23 14:56:54 +02:00
Po Lu
e359df4217 Fix more toolkit scroll bar window protection issues
* src/xterm.c (handle_one_xevent): Ignore outdated scroll bar
events.
(x_free_frame_resources): Clear protected windows and invalidate
previous scroll bar events.
* src/xterm.h (struct x_display_info): New field
`first_valid_scroll_bar_req'.
2022-09-23 20:41:47 +08:00
YAMAMOTO Mitsuharu
60ac12d21f Fix shaping with bitmap-only fonts on HarfBuzz 5.2.0 (Bug#57976)
* src/ftcrfont.c (ftcrhbfont_begin_hb_font): Undo last change for
HarfBuzz 5.2.0.
2022-09-23 14:17:49 +09:00
Po Lu
9369e4242f Work around rare crash when turning scroll wheel
* src/xterm.c (handle_one_xevent): Don't allow devices to be
added twice handling hierarcy events.
2022-09-22 17:06:36 +08:00
Stefan Kangas
9b14e312f4 Merge from origin/emacs-28
478b786d5a ; * doc/lispref/windows.texi (Window Hooks): Fix a typo (b...
5085351645 * lisp/text-modes/tex-mode.el (tex-mode): Fix AUCTeX regre...
ee6f8598ca Add vc-annotate-switches to manual
616dcf27e5 ; Fix typos in Lisp symbols
5405852541 Remove mention of non-existent `annotate-switches'
191505b8a3 Mention that src/macuvs.h sometimes needs committing
10373c4b68 ; More comment fixes in font.h (bug#57935)
c2595b8dcc ; * src/font.h (struct font_driver): Comment fix.
97b928ce09 MacOS ld warning from native compilation (bug#57849)
2022-09-21 10:25:06 +02:00
Po Lu
df79a23da7 Fix minor thinko in focus tracking logic
* src/xterm.c (xi_handle_focus_change): Prefer explicit focus to
implicit focus.
2022-09-21 14:23:13 +08:00
Po Lu
1b77f1981d Remove intern calls with a static string from haiku*.c
* src/haikufns.c (Fx_show_tip, syms_of_haikufns):
* src/haikufont.c (haikufont_maybe_handle_special_family)
(syms_of_haikufont):
* src/haikuterm.c (haiku_term_init, syms_of_haikuterm): Replace
intern with real predefined symbols.
2022-09-20 03:00:10 +00:00
Mattias Engdegård
60102016e4 Abolish max-specpdl-size (bug#57911)
The max-lisp-eval-depth limit is sufficient to prevent unbounded stack
growth including the specbind stack; simplify matters for the user by
not having them to worry about two different limits.  This change
turns max-specpdl-size into a harmless variable with no effects,
to keep existing code happy.

* lisp/subr.el (max-specpdl-size):
Define as an ordinary (but obsolete) dynamic variable.
* admin/grammars/Makefile.in:
* doc/lispintro/emacs-lisp-intro.texi (Loops & Recursion):
* doc/lispref/control.texi (Cleanups):
* doc/lispref/edebug.texi (Checking Whether to Stop):
* doc/lispref/eval.texi (Eval):
* doc/lispref/variables.texi (Local Variables):
* doc/misc/calc.texi (Recursion Depth):
Update documentation.
* etc/NEWS: Announce.
* src/eval.c
(FletX): Use safe iteration to guard against circular bindings list.
(syms_of_eval): Remove old max-specpdl-size definition.
(init_eval_once, restore_stack_limits, call_debugger)
(signal_or_quit, grow_specpdl_allocation):
* leim/Makefile.in:
* lisp/Makefile.in:
* lisp/calc/calc-stuff.el (calc-more-recursion-depth)
(calc-less-recursion-depth):
* lisp/calc/calc.el (calc-do):
* lisp/cedet/semantic/ede-grammar.el (ede-proj-makefile-insert-rules):
* lisp/cedet/semantic/grammar.el (semantic-grammar-batch-build-one-package):
* lisp/cus-start.el (standard):
* lisp/emacs-lisp/comp.el (comp--native-compile):
* lisp/emacs-lisp/edebug.el (edebug-max-depth):
(edebug-read-and-maybe-wrap-form, edebug-default-enter):
* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
* lisp/eshell/esh-mode.el (eshell-mode):
* lisp/loadup.el (max-specpdl-size):
* lisp/mh-e/mh-e.el (mh-invisible-headers):
* lisp/net/shr.el (shr-insert-document, shr-descend):
* lisp/play/hanoi.el (hanoi-internal):
* lisp/progmodes/cperl-mode.el:
* src/fileio.c (Fdo_auto_save):
Remove references to and modifications of max-specpdl-size.
2022-09-19 19:30:03 +02:00
Eli Zaretskii
10373c4b68 ; More comment fixes in font.h (bug#57935) 2022-09-19 18:58:25 +03:00
Manuel Giraud
c2595b8dcc ; * src/font.h (struct font_driver): Comment fix. 2022-09-19 18:56:39 +03:00
Eli Zaretskii
cd2168cd13 Fix 'posn-at-point' around several 'display' properties
* src/xdisp.c (pos_visible_p): Fix the case when CHARPOS is hidden
by a display property, and its neighbors are also hidden.
(Bug#45915)
2022-09-19 16:24:44 +03:00
Stefan Kangas
97679d06e8 Avoid an unnecessary call to intern
* src/doc.c (Fdocumentation): Prefer DEFSYM to using intern directly.
2022-09-19 11:38:49 +02:00
Stefan Kangas
731c453b03 Merge from origin/emacs-28
a2f9788cbc ; Minor copyedits of *-frame-alist doc strings
c200098dde ; * src/intervals.c (get_local_map): Fix commentary.
69cc3d38bc Fix Tramp error with eshell integration
2022-09-19 06:31:49 +02:00
Po Lu
5b3c4004a9 Remove calls to intern with a static string from code that runs on X
* Makefile.in (actual-all): Reword build failure advice.

* src/bytecode.c (exec_byte_code, syms_of_bytecode):
* src/font.c (syms_of_font):
* src/hbfont.c (uni_combining):
* src/xfns.c (Fx_display_backing_store, Fx_display_visual_class)
(x_create_tip_frame, Fx_show_tip, syms_of_xfns):
* src/xfont.c (xfont_supported_scripts, xfont_driver)
(syms_of_xfont):
* src/xsmfns.c (Fhandle_save_session, syms_of_xsmfns): Remove
calls to intern with a static string.
2022-09-19 10:01:52 +08:00
Po Lu
202c416e2e Get rid of intern calls to static strings in xterm.c
* src/xterm.c (x_cr_export_frames): Use Qconcat instead of
interning concat.
(syms_of_xterm): New defsym Qconcat.
2022-09-19 09:39:21 +08:00
Po Lu
a5405e5644 Fix GC protection of scroll bar windows
* src/xterm.c (x_atom_refs): Add _EMACS prefix to
vendor-specific scroll-bar atoms.
(handle_one_xevent): Unprotect windows immediately upon
receiving an _EMACS_SCROLLBAR event, instead of waiting for the
event to be put on the keyboard buffer.  Reported by martin
rudalics <rudalics@gmx.at>.
2022-09-19 09:36:44 +08:00
Eli Zaretskii
a2f9788cbc ; Minor copyedits of *-frame-alist doc strings
* src/frame.c (syms_of_frame) <default-frame-alist>:
* lisp/frame.el (initial-frame-alist): Minor doc fixes.
2022-09-18 20:21:58 +03:00
Eli Zaretskii
c200098dde ; * src/intervals.c (get_local_map): Fix commentary. 2022-09-18 19:59:58 +03:00
Stefan Kangas
1bdac41e4d Prefer using DEFSYMs to intern with wrong_type_argument
* src/data.c (syms_of_data) <Qbooleanp>:
* src/fileio.c (syms_of_fileio) <Qinserted_chars, Qfile_offset>:
* src/font.c (syms_of_font) <Qfont_extra_type>: New DEFSYMs.
* src/dbusbind.c (xd_signature, xd_append_arg):
* src/fileio.c (file_offset, Finsert_file_contents):
* src/font.c (Ffontp): Prefer using above new DEFSYMs to using intern
directly.
2022-09-18 18:55:19 +02:00
Po Lu
25587ada2c Remove what should be unnecessary calls to block_input
* src/xterm.c (handle_one_xevent): Do not block input inside.
This function is not reentrant and is always called with input
blocked.
2022-09-18 15:24:02 +08:00
Gerd Möllmann
117795a059 Fix possible null pointer access
* src/term.c (Ftty__output_buffer_size): Handle case of
decode_tty_terminal returning NULL.
2022-09-18 07:44:23 +02:00
YAMAMOTO Mitsuharu
7fe22182d3 Fix rare shaping problems with Urdu and Arabic
* src/composite.c (fill_gstring_body): Clear unused slots of the
gstring.  (Bug#50951)
2022-09-17 19:58:52 +03:00
Gerd Möllmann
cbac94b4ae Optimize tty display updates (bug#57727)
* src/dispnew.c (update_frame_1): Don'f flush if tty's
output_buffer_size is non-zero.
* src/sysdep.c (init_sys_modes): Setvbuf depending on the tty's
output_buffer_size.
* src/term.c (Ftty__set_output_buffer_size, Ftty__output_buffer_size):
Low-level interface for setting and retrieving a tty's output buffer
size.
(syms_of_term): Defsubr the new functions.
* src/termchar.h (struct tty_display_info): New member
output_buffer_size.
* stc/NEWS: Describe the change.
2022-09-17 15:33:10 +02:00
Po Lu
f7eec293a6 Fix MPX focus tracking upon frame deletion
* src/xterm.c (x_free_frame_resources): Consider focus change
after.
2022-09-17 16:46:40 +08:00
Eli Zaretskii
55cffddad4 ; Update src/macuvs.h, forgotten in Unicode 15.0 commit. 2022-09-17 10:15:14 +03:00
Po Lu
4cb3b4e98a Fix wrong source window being generated for XDND leave events
* src/xterm.c (x_dnd_update_state, handle_one_xevent): Let
x_dnd_last_seen_toplevel remain at its old value until any
XdndLeave event was definitely sent.
2022-09-16 17:01:41 +08:00
Po Lu
3c0dda2663 Avoid asserting for fontset validity before it is used
* src/fontset.c (face_for_char): Move `eassert' to before the
fontset is really used.  Suggested by Eli Zaretskii
<eliz@gnu.org>
2022-09-16 15:52:21 +08:00