Commit graph

47249 commits

Author SHA1 Message Date
Stefan Monnier
800ecd4767 Merge remote-tracking branch 'origin/scratch/noverlay-wip' into noverlay 2022-09-28 11:57:16 -04:00
Gerd Möllmann
17ba7ac5d9 Avoid nested iteration over intervals (bug#58144)
* src/xdisp.c (strings_with_newlines): Call
buffer_overlay_iter_finish.
2022-09-28 16:38:04 +02:00
Gerd Möllmann
498d331b07 Add debugging help for nested iterators (nug#58144)
When starting an iteration, store __FILE__ and __LINE__ where this
happens in the interval_tree structure.

* src/buffer.h (buffer_overlay_iter_start): New macro adding __FILE
and __LINE__.
(buffer_overlay_iter_start1): Renamed from ..._start.
* src/itree.h (struct interval_tree): Add file and line info.
* src/itree.c: (interval_tree_contains, interval_tree_nodes,
interval_tree_insert_gap): Pass __FILE__ and __LINE__ to iter_start.
(interval_tree_iter_start): Record file and line info in tree.
2022-09-28 16:30:34 +02:00
Gerd Möllmann
8173a292e7 Fix last change 2022-09-28 12:10:30 +02:00
Gerd Möllmann
409327ff68 Fix macOS build (bug#58108)
* src/itree.h (struct interval_tree): Rename member nil to null.
* src/itree.c: Use null instead of nil
* src/pdumper.c (dump_buffer): Use null instead of nil.
* src/itree.c: Fix copyright.
* src/itree.h: Fix copyright.
2022-09-27 12:55:49 +02:00
Stefan Monnier
1a77f09f3c * src/buffer.c (overlays_in): Fix confusion Z-vs-ZV
This fixes test failures in `test-overlays-in-2` and `test-remove-overlays`.
2022-09-25 22:24:35 -04:00
Stefan Monnier
650c20f1ca Merge 'master' into noverlay 2022-09-25 16:15:16 -04: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
Gerd Möllmann
e3b79c641e Fix crash in GC on macOS (bug#57751)
* src/nsterm.m ([EmacsView windowDidMove:]): Initialize input_event.
2022-09-16 07:17:47 +02:00
Eli Zaretskii
6bcc7a2df7 ; Fix last change in w32fns.c. 2022-09-15 14:59:50 +03:00
Eli Zaretskii
09e93c4daf Implement support for 'wallpaper-set' on MS-Windows
* src/w32fns.c (Fw32_set_wallpaper): New primitive.
(syms_of_w32fns): Defsubr it.
(globals_of_w32fns): Attempt to load SystemParametersInfoW from
its DLL at run time.

* lisp/image/wallpaper.el (wallpaper-set): Support MS-Windows by
calling 'w32-set-wallpaper'.

* etc/NEWS: Update and simplify wording of the 'wallpaper-set'
entry.
2022-09-15 14:51:31 +03:00
Mattias Engdegård
3ad2adc48c Simplify and shrink reader buffers
A big on-stack buffer in a potentially long-running function can
interact badly with the GC's conservative scanning of the C stack.
It may make the scanning slower (since the stack frame is big) and
risks accidental retention of objects from stack detritus
(because the buffer isn't cleaned on entry).

* src/lread.c (stackbufsize): Remove.
(read_integer, read_string_literal, read_bool_vector): Use a local
buffer instead of piggy-backing on that in read0.
(read0): Reduce buffer to something suitable for most identifiers and
numbers.
2022-09-15 09:41:15 +02:00
Mattias Engdegård
f941cc76df mapconcat fast path with identity function argument
This makes (mapconcat #'identity SEQ) slightly faster than
(apply #'concat SEQ), which used to be much faster.
Notably, `string-join` benefits from this change as it uses mapconcat.

* src/fns.c (Fmapconcat): Speed up execution when the function
argument is `identity`.
2022-09-15 09:40:08 +02:00
Po Lu
429e61b130 More fixes for XDND proxy support
* src/xterm.c (handle_one_xevent): Check replies against
toplevel, not proxy.
2022-09-15 15:30:47 +08:00
Eli Zaretskii
52a3ba102c Revert "; Fix doc string of 'loaddefs-generate'"
This reverts commit 5fe9a1a85a.
It included unrelated changes.
2022-09-15 09:14:59 +03:00
Eli Zaretskii
5fe9a1a85a ; Fix doc string of 'loaddefs-generate'
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Doc fix.
(Bug#57815)
2022-09-15 09:12:13 +03:00
Augusto Stoffel
05971d2b8d ; * src/emacs.c (usage_message): Remove stray tabs. 2022-09-14 21:21:33 +02:00
Mattias Engdegård
cba866599c Raise default max-specpdl-size and max-lisp-eval-depth
Recent changes have caused bootstrapping to fail for certain
configurations, and it was likely getting close to the limits
for others.  This change raises the limits to those previously
used when configured for nativecomp:

  max-specpdl-size raised from 1800 to 2500
  max-lisp-eval-depth raised from 800 to 1600

* src/eval.c (init_eval_once): Raise limits.
* doc/lispref/eval.texi (Eval):
* doc/lispref/variables.texi (Local Variables): Document new values.
2022-09-14 15:59:43 +02:00
Po Lu
b9ca1a8e4f Implement wallpaper.el support for Haiku
* lisp/image/wallpaper.el (haiku-set-wallpaper, wallpaper-set):
Use `haiku-set-wallpaper' on Haiku.
* lisp/term/haiku-win.el (haiku-write-node-attribute)
(haiku-send-message, haiku-set-wallpaper): New function.
* src/haiku_support.cc (be_write_node_message, be_send_message):
New functions.
* src/haiku_support.h: Update prototypes.
* src/haikuselect.c (haiku_message_to_lisp)
(haiku_lisp_to_message): Fix CSTR type handling to include NULL
byte.
(haiku_report_system_error, Fhaiku_write_node_attribute)
(Fhaiku_send_message): New functions.
(syms_of_haikuselect): Add defsubrs.
2022-09-14 06:25:11 +00:00
Paul Eggert
49419912f2 Port alignas definition to C23
* src/lisp.h (alignas): C23 is removing the __alignas_is_defined
macro, so do not rely on it. Instead, do not define alignas if C23
or later, or if C++11 or later.
2022-09-13 12:42:31 -05:00