1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00
Commit graph

47270 commits

Author SHA1 Message Date
Eli Zaretskii
d52d6e1e10 Avoid assertion violations in STRING_CHAR
* src/xdisp.c (handle_composition_prop):
* src/editfns.c (styled_format): Don't call 'STRING_CHAR' on
unibyte strings.  This avoids assertion violation in
'string_char_and_length'.
2022-10-04 14:23:20 +03:00
Po Lu
3583f6184d Fix deiconification handling on FVWM and possibly other window managers
I can't believe we weren't doing this before.

* src/xterm.c (x_handle_wm_state): New function.
(handle_one_xevent): Handle window state changes in WM_STATE
messages, and use them for signalling deiconification.
(bug#58164)
2022-10-04 09:26:14 +08:00
Stefan Kangas
6a5169e747 Merge from origin/emacs-28
992611b10a Fix documentation  of 'TAB' in cc-mode
08e485a2a5 Fix 'org-export-dispatch' command name in manual
e5a49f44ff * src/emacs.c (load_pdump): Fix use of xpalloc.
7ff5207624 Avoid assertion violation in 'xpalloc'

# Conflicts:
#	src/emacs.c
2022-10-04 00:07:22 +02:00
Lars Ingebrigtsen
f97993ee66 Rename to inhibit-automatic-native-compilation
* src/comp.c (maybe_defer_native_compilation):
(syms_of_comp):
* lisp/subr.el (native-comp-deferred-compilation):
* lisp/startup.el (inhibit-native-compilation):
(normal-top-level):
* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
* lisp/emacs-lisp/comp.el (comp-trampoline-compile):
* etc/NEWS:
* doc/lispref/compile.texi (Native-Compilation Variables): Rename
inhibit-native-compilation to inhibit-automatic-native-compilation.
2022-10-03 19:50:03 +02:00
Manuel Giraud
81003b53f8 ; * src/menu.c: remove unused lwlib include
* src/menu.c: remove unused lwlib include (bug#58275).
2022-10-03 19:15:12 +02:00
Lars Ingebrigtsen
5fec9182db Add new variable 'inhibit-native-compilation'
* doc/lispref/compile.texi (Native-Compilation Variables):
Document it.

* lisp/startup.el (normal-top-level): Set
inhibit-native-compilation from environment variable.

* lisp/subr.el (native-comp-deferred-compilation): Make obsolete.

* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Don't write
trampolines to disk.

* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Adjust.

* src/comp.c (syms_of_comp): New variable
inhibit-native-compilation.
(maybe_defer_native_compilation): Use it.
2022-10-03 15:26:13 +02:00
Po Lu
da02b9edad Fix coding systems used for X input methods
* doc/emacs/mule.texi (International): Refer to X Coding as
well.
(Communication Coding): Document that locale-coding-system is
not always used on X to decode keyboard input.
(X Coding): New node.
* etc/NEWS: Announce change to input method coding resolution.
* lisp/term/x-win.el (x-get-input-coding-system): New function.
* src/coding.c (syms_of_coding): Update doc string of
locale-coding-system.
* src/xfns.c (struct x_xim_text_conversion_data)
(x_xim_text_to_utf8_unix_1, x_xim_text_to_utf8_unix_2)
(x_xim_text_to_utf8_unix): Accept dpyinfo.  Use the coding
system specified inside if possible.
(xic_preedit_draw_callback): Pass dpyinfo.
* src/xterm.c (handle_one_xevent): Use XIM coding system for IM
input.
(xim_open_dpy): Try to determine the input method coding system.
(mark_xterm): Mark `xim_coding'.
(syms_of_xterm): New variable `x-input-coding-system'.
* src/xterm.h (struct x_display_info): New field `xim_coding'.
(FRAME_X_XIM_CODING): New macro.
2022-10-03 20:18:37 +08:00
Alan Mackenzie
3cc1706c63 Suppress irritating/misleading message in make bootstrap about old .elc files
These are the "compile-first" .elc files, artificially given an old timestamp
to cause them later to be native compiled.  This fixes bug #58224.

* lisp/Makefile.in (compile-first .el.elc): Give these .elc's the UTC epoch.
Amend the comment.

* src/lread.c (Fload): New variable, epoch_timestamp, initialized to binary
zero.  Compare with this the timestamp of .elc's being loaded, and if they
match, don't output the message about the source file being newer than the
file being loaded.
2022-10-02 20:31:12 +00:00
Andreas Schwab
e5a49f44ff * src/emacs.c (load_pdump): Fix use of xpalloc. 2022-10-02 12:20:09 +02:00
Eli Zaretskii
7ff5207624 Avoid assertion violation in 'xpalloc'
* src/emacs.c (load_pdump): Ensure the 3rd argument of xpalloc is
always positive.  (Bug#58232)
2022-10-02 12:58:04 +03:00
Po Lu
3924fbd025 Only rely on EWMH window activation if possible
* xterm.c (x_ewmh_activate_frame): Remove unnecessary
x_wm_supports check.
(x_focus_frame): When the window manager supports
_NET_ACTIVE_WINDOW, just use it; anything else may confuse the
window manager.
2022-10-02 08:28:56 +08:00
Eli Zaretskii
3bd9606922 ; Another fix for vertical motion
* src/xdisp.c (move_it_vertically_backward): Undo recent changes for
bidi-reordered text.  (Bug#58210)
2022-10-01 17:56:58 +03:00
Eli Zaretskii
ff43fd07b7 Fix vertical motion in some rare bidi situations
* src/xdisp.c (move_it_by_lines): Handle the case where we
didn't move vertically at all.
2022-10-01 17:01:15 +03:00
Eli Zaretskii
82860cb7f7 ; (move_it_vertically_backward): Yet another fix of bug#58210. 2022-10-01 15:44:23 +03:00
Eli Zaretskii
372cc9e88c Fix 'C-a' and 'C-e' under 'visual-line-mode'
* src/xdisp.c (move_it_vertically_backward): Fix last change.
(Bug#58210)
2022-10-01 09:24:04 +03:00
Mattias Engdegård
123506f9ca Speed up string-lessp further
* src/fns.c (Fstring_lessp): Use the memcmp fast path for ASCII-only
multibyte strings as well.  Specialise loops on argument
multibyteness.
2022-09-30 16:24:44 +02:00
Eli Zaretskii
3553904a90 Fix some issues with vertical-motion in bidi-reordered text
This fixes some uses of vertical-motion when a screen line
starts withcharacters of directionality that is opposite to
the current paragraph's base direction.
* src/xdisp.c (move_it_vertically_backward): Adjust NLINES to
compensate for its increasing when DY == 0.
2022-09-30 15:38:22 +03:00
Po Lu
12a78711c9 Fix calculation of frame times when X server time overflows
* etc/TODO: Add TODO about frame synchronization and animations.
* src/xterm.c (x_display_set_last_user_time): Handle cases when
the monotonic time is not the server time due to the latter
overflowing.
2022-09-30 14:54:24 +08:00
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