1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-13 01:32:21 -07:00
Commit graph

47962 commits

Author SHA1 Message Date
Po Lu
99754dad3c Implement primitive frame synchronization on Haiku
Instead of relying on a compositor to do the work, we simply
wait for VBLANK and hope that the update finishes soon enough.

* doc/lispref/frames.texi (Management Parameters): Document that
frame synchronization is now supported on Haiku.

* src/haiku_support.cc (class EmacsView): New field
`use_frame_synchronization'.
(FlipBuffers): Wait for vertical blanking period.
(be_set_use_frame_synchronization): New function.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (haiku_create_frame): Set
`use-frame-synchronization'.

(haiku_set_use_frame_synchronization)
(haiku_frame_parm_handlers): New param handler.
2022-08-01 05:51:59 +00:00
Po Lu
3b5c03eeb2 Make frame synchronization a frame parameter
* doc/lispref/frames.texi (Management Parameters): Document
`use-frame-synchronization'.
* etc/NEWS: Update entry.

* src/frame.c (frame_parms): New frame parameter
`use-frame-synchronization'.
(syms_of_frame): New defsym.
* src/haikufns.c (haiku_frame_parm_handlers):
* src/nsfns.m (ns_frame_parm_handlers):
* src/pgtkfns.c (pgtk_frame_parm_handlers):
* src/w32fns.c (w32_frame_parm_handlers): Update frame param
handlers correctly.
* src/xfns.c (x_set_use_frame_synchronization): New function.
(Fx_create_frame): Set default value of said parameter.
(x_frame_parm_handlers): Add handler.

* src/xterm.c (x_sync_wait_for_frame_drawn_event): Clear
parameter if sync fails.
2022-08-01 09:56:12 +08:00
Gregory Heytings
43a174f62c Move the computation of narrowing bounds for long line optimizations.
* src/xdisp.c (init_iterator): Move the computation from here...
(reseat): ... to here.  Also recompute the position in certain cases.
2022-08-01 00:38:48 +02:00
Gregory Heytings
5e296283f5 Add locked narrowing around pre- and post-command-hook
* src/keyboard.c (safe_run_hooks_maybe_narrowed): New function.
(command_loop_1): Use it for 'pre-command-hook' and 'post-command-hook'.
(syms_of_keyboard): Update docstrings of 'pre-command-hook' and
'post-command-hook'.

* src/lisp.h: Prototype of the new function.
2022-07-31 22:42:09 +02:00
Eli Zaretskii
78759ddcb0 * src/lisp.h (CHECK_INTEGER): Fix the predicate. (Bug#56856) 2022-07-31 18:05:09 +03:00
Po Lu
57100e0a36 ; * src/xterm.c (XTset_vertical_scroll_bar): Fix yet another typo.
Reported by Lars Ingebrigtsen <larsi@gnus.org>.
2022-07-31 15:12:22 +08:00
Stefan Kangas
d9bd334ef3 Merge from origin/emacs-28
eb11dae499 Improve documentation of column-related functions
c95a34c960 * src/macfont.m (macfont_open): Initialize font->space_wid...
31a6a37d45 Improve indexing of keymap variables
2022-07-31 06:30:25 +02:00
Po Lu
3d6af11c42 Fix NS unexec build
* nextstep/Makefile.in (all): Only build Emacs.pdmp on pdumper
builds.

* src/sheap.h: Make STATIC_HEAP_SIZE bigger, otherwise I get:
static heap exhausted: avail 67108864 used 67101824 failed
request 20480
2022-07-31 10:55:06 +08:00
Po Lu
b7f227ed8b ; * src/xterm.c (XTset_vertical_scroll_bar): Fix typo in last change. 2022-07-31 10:42:51 +08:00
Po Lu
a66e654276 Fix frame synchronization with scroll bar movement
* src/xfns.c (x_set_inhibit_double_buffering): Stop condeming
scroll bars.

* src/xterm.c (x_scroll_bar_create): Create an InputOnly window.
Update event masks accordingly and stop allocating back buffer.
(x_scroll_bar_remove): Stop deallocating back buffer.
(XTset_vertical_scroll_bar, x_scroll_bar_set_handle): Draw onto
the edit window so they can be synchronized with buffer flips.
(x_scroll_bar_clear): Redraw scroll bars instead of just
clearing them.
(x_scroll_bar_handle_expose, x_scroll_bar_redraw): New
functions.
(x_scroll_bar_expose, x_scroll_bar_end_update): Delete
functions.
(handle_one_xevent): Update exposure logic accordingly.

* src/xterm.h (struct scroll_bar): Remove `x_drawable' field.
2022-07-31 10:41:58 +08:00
Stefan Kangas
5b29f8cd98 Delete redisplay-end-trigger-functions and related defuns
This variable and related functions have been obsolete since 23.1.
The last things to depend on this (fast-lock.el and lazy-lock.el) were
recently removed.

* src/dispextern.h (struct it): Delete field
'redisplay_end_trigger_charpos'.
* src/window.c (Fwindow_redisplay_end_trigger)
(Fset_window_redisplay_end_trigger): Delete defuns and corresponding
defsubrs for functions obsolete since 23.1.
* src/window.h (wset_redisplay_end_trigger): Delete function.
(GCALIGNED_STRUCT): Delete 'redisplay_end_trigger'.
* src/xdisp.c (run_redisplay_end_trigger_hook): Delete function.
(syms_of_xdisp) <redisplay_end_trigger_functions>: Delete
variable obsolete since 23.1.
(init_iterator, next_element_from_buffer): Don't run or set above
deleted hook variable.

* lisp/subr.el: Delete obsoletion definitions for above deleted
defuns and variable.
* doc/lispref/hooks.texi (Standard Hooks):
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns):
* lisp/loadhist.el (unload-feature-special-hooks): Don't mention
above deleted variable.
* admin/coccinelle/window.cocci: Adjust for above changes.
2022-07-31 01:44:22 +02:00
Eli Zaretskii
eb11dae499 Improve documentation of column-related functions
* doc/lispref/text.texi (Primitive Indent, Columns):
* src/indent.c (Fcurrent_indentation, Fmove_to_column): Document
that column counting ignores invisible text.  (Bug#56837)
2022-07-30 19:34:38 +03:00
Gerd Möllmann
ff57f30bee ; Fix warnings from #pragma GCC iagnostic pop on macOS
* src/comp.c: Add #pragma GCC diagnostic push in some places.
2022-07-30 17:36:27 +02:00
Eli Zaretskii
76f49943c3 Make sure to preserve point across locked narrowing
* src/editfns.c (Fnarrow_to_region): Save the position of point
when locking the restriction, since this function can move point.
2022-07-30 16:11:43 +03:00
Gregory Heytings
a5adcbdf28 Handle the optional argument of 'narrow-to-region' in byte-compiled code.
* lisp/emacs-lisp/bytecomp.el: Adapt the specifications.

* src/bytecode.c (exec_byte_code): Get the optional argument.
2022-07-30 14:03:37 +02:00
YAMAMOTO Mitsuharu
c95a34c960 * src/macfont.m (macfont_open): Initialize font->space_width. (Bug#56808) 2022-07-30 17:21:54 +09:00
Po Lu
a1975a69b2 Fix failure caused by misreading the frame synchronization spec
* src/xterm.c (x_sync_update_begin): Ensure value % 4 is 1.
(x_sync_update_finish): Then, add 3.
2022-07-30 10:04:26 +08:00
Po Lu
af152ffab1 Don't freeze if the compositing manager crashes
* src/xterm.c (x_if_event): New function, like XIfEvent but with
a timeout.
(x_sync_wait_for_frame_drawn_event): Disable frame
synchronization if x_if_event times out after 1 second.
2022-07-30 09:40:00 +08:00
Gregory Heytings
4b5b447b7f ; * src/xdisp.c (handle_fontified_prop): Fix BOB case. 2022-07-29 19:21:20 +02:00
Gregory Heytings
9c12c3b7c5 Improve narrowing when iterator has moved outside of narrowing bounds.
* src/xdisp.c (get_narrowed_begv, get_narrowed_zv): Add 'pos'
parameter.
(init_iterator): Add arguments to 'get_narrowed_begv' and
'get_narrowed_zv'.
(handle_fontified_prop): Recompute the narrowing when iterator
has moved outside of narrowing bounds.

* src/dispextern.h (get_narrowed_begv, get_narrowed_zv): Adapt
prototypes.

* src/composite.c (find_automatic_composition): Add argument
to 'get_narrowed_begv'.
2022-07-29 18:28:44 +02:00
Gregory Heytings
ebe9cd3e9f Improvement for long line optimizations.
* src/xdisp.c (handle_fontified_prop): Also apply the forced
narrowing at BOB.
2022-07-29 17:33:29 +02:00
Po Lu
9547c28583 Fix handling of extended frame resize synchronization
* src/xterm.c (x_sync_wait_for_frame_drawn_event): Don't wait if
the frame is invisible.  If it is mapped again the compositing
manager is obliged to send us another event, so we can wait in
that case.
(x_sync_update_begin, x_sync_update_finish): Handle extended
resize synchronization here.
(XTframe_up_to_date, handle_one_xevent): Save stuff here.

* src/xterm.h (struct x_output): New field
`resize_counter_value'.
2022-07-29 21:00:59 +08:00
Eli Zaretskii
01ca1c70ae ; Minor copyedits of documentation related to long-line handling
* src/xdisp.c (syms_of_xdisp) <fontification-functions>:
* etc/NEWS: Fix documentation related to long lines.  (Bug#56682)
2022-07-29 13:20:38 +03:00
Po Lu
02b180e955 ; * src/xterm.c (x_update_begin): Fix build without DBE. 2022-07-29 17:27:37 +08:00
Po Lu
acefbcf835 Minor additions to last change
* doc/emacs/xresources.texi (Table of Resources): Update
description of `extended'.
* etc/NEWS: Announce frame tearing reduction.

* src/xterm.c (x_sync_update_finish, x_sync_update_begin)
(x_update_begin, x_update_end, show_back_buffer, x_flip_and_flush)
(XTframe_up_to_date, handle_one_xevent): Minor redesign of frame
synchronization feature.  Fix crash with overflow and checking.
2022-07-29 17:27:36 +08:00
Po Lu
ee93a06b8b Implement monitor refresh rate synchronization on X
* src/xfns.c (x_set_parent_frame, Fx_create_frame): Disable
vsync on child and embedded frames.
* src/xmenu.c (x_menu_show): Fix XMenu position calculation in
child frames.

* src/xterm.c (x_sync_is_frame_drawn_event)
(x_sync_wait_for_frame_drawn_event): New functions.
(x_sync_update_begin): Wait for frame to be drawn if not double
buffered.
(x_sync_update_finish): Set FRAME_X_WAITING_FOR_DRAW (f).
(show_back_buffer): Wait for frame to be drawn before flipping
buffers.
(XTframe_up_to_date): Set FRAME_X_WAITING_FOR_DRAW if bumped.
(handle_one_xevent): Handle frame drawn events.

* src/xterm.h (struct x_output): New fields for frame dirtyness
and vsync.
2022-07-29 17:27:36 +08:00
Gregory Heytings
db03eda636 Merge branch 'feature/long-lines-and-font-locking' 2022-07-29 10:22:03 +02:00
Gregory Heytings
cdaa3b51f1 Further minor improvements of documentation
* src/xdisp.c (syms_of_xdisp) <fontification-functions>:
* etc/NEWS: Further minor wording improvements.
2022-07-29 10:15:06 +02:00
Eli Zaretskii
c6029ed34e Minor improvements of recent documentation changes
* src/editfns.c (Fwiden):
* doc/lispref/display.texi (Auto Faces):
* src/xdisp.c (syms_of_xdisp) <fontification-functions>:
* etc/NEWS: Clarify and improve wording of documentation changes.
2022-07-29 10:08:50 +03:00
Po Lu
77882158b2 Also update after buffer flip caused by flush_frame
* src/xterm.c (x_flip_and_flush): Mark the end of a sync frame.
2022-07-29 14:54:55 +08:00
Po Lu
1cdc64cdda Implement extended frame synchronization
* src/xterm.c (x_atom_refs): New atom _NET_WM_FRAME_TIMINGS.
(x_sync_update_finish, x_sync_update_begin): New frame.
(x_update_begin, x_update_end, XTframe_up_to_date): Begin and
end frames accordingly if extended frame synchronization is
enabled.
(handle_one_xevent): Ignore timing and frame drawn events.

* src/xterm.h (struct x_display_info): New atom.
(FRAME_X_COUNTER_VALUE): New macro.
2022-07-29 10:14:04 +08:00
Gregory Heytings
67a218d339 Final documentation tweaks.
* etc/NEWS: Update the NEWS entry.

* src/xdisp.c (syms_of_xdisp): Mention the fact that restrictions
may be locked around 'fontification-functions'.
2022-07-28 23:12:43 +02:00
Gregory Heytings
d3c4833d13 Add an optional 'lock' parameter to 'narrow-to-region'
* src/editfns.c (Fnarrow_to_region): Add the parameter to the
function, and handle it. Update docstring.
(unwind_locked_begv, unwind_locked_zv): New functions.
(Fwiden): Do nothing when restrictions are locked. Update
docstring.
(syms_of_editfns): Replace the 'inhibit-widen' symbol and variable
with a 'restrictions-locked' symbol and variable. Update docstring.

* src/xdisp.c (handle_fontified_prop): Use Fnarrow_to_region with
the new parameter.
(unwind_narrowed_zv): Remove function.

* src/process.c (Finternal_default_process_filter): Add a third
argument to Fnarrow_to_region.

* src/lread.c (readevalloop): Add a third argument to
Fnarrow_to_region.

* src/bytecode.c (exec_byte_code): Add a third argument to
Fnarrow_to_region.

* etc/NEWS (like): Mention the new parameter of 'narrow-to-region'.

* doc/lispref/positions.texi (Narrowing): Document it.
2022-07-28 22:40:42 +02:00
Po Lu
977aed9f79 Fix grab view persisting on Haiku after popup menu closes
* src/haiku_support.cc (BasicMouseUp): Improve handling of
wait_for_release_message.
(be_clear_grab_view): New function.
* src/haiku_support.h: Update prototypes.
* src/haikumenu.c (haiku_menu_show): Call it here.
2022-07-28 13:25:06 +00:00
Po Lu
d17a867d70 ; * src/print.c (print_vectorlike): Fix Lisp_Object type mixup. 2022-07-28 21:04:06 +08:00
Po Lu
163424e04b Correctly set marker position after specpdl is unwound during printing
* src/print.c (PRINTFINISH): Don't call set_marker_both with the
wrong current_buffer.  Reported by Lars Ingebrigtsen
<larsi@gnus.org>.
2022-07-28 19:28:23 +08:00
Lars Ingebrigtsen
f2c7c664a7 Don't export print--unreadable-callback-buffer to lisp
* src/print.c (syms_of_print): Don't export
`print--unreadable-callback-buffer' to lisp.
2022-07-28 12:39:45 +02:00
Lars Ingebrigtsen
4895ca16f7 Ensure that we don't call print-unreadable-function from " prin1"
* src/print.c (PRINTPREPARE): Bind the current buffer so that we
can retrieve it later.
(print_vectorlike): Use it (bug#56773).
(syms_of_print): New internal `print--unreadable-callback-buffer'
variable.
2022-07-28 12:24:03 +02:00
Eli Zaretskii
2bab0f2db6 Minor update of truncate-line optimization
* src/xdisp.c (forward_to_next_line_start): Look into display and
overlay strings only when lines are truncated on display.
2022-07-28 11:39:28 +03:00
Po Lu
02ab6aaf7b Fix minor problem with scroll bar grabs on Haiku
* haiku_support.cc (class EmacsScrollBar, EmacsScrollBar)
(MouseDown, MouseUp): Keep a counter of the mouse down events
received.
2022-07-28 07:28:23 +00:00
Po Lu
27a0bcd779 Fix race conditions in mouse button handling on Haiku
* src/haiku_support.cc (class EmacsView): New field
`grabbed_buttons'.  Remove `previous_buttons'.
(BasicMouseDown, BasicMouseUp): Accept new parameter `message'.
Use data from that message instead.
(MouseDown, MouseUp): Pass the current message to BasicMouseUp
and BasicMouseDown.
2022-07-28 07:17:04 +00:00
Po Lu
c44068ac6c * src/xterm.c (x_set_offset): Respect x-no-window-manager. 2022-07-28 10:59:19 +08:00
Po Lu
f720630195 Remove excessive synchronization from x_sync_with_move
* src/xterm.c (x_sync_with_move): Remove redundant XSync.  The X
server always handles requests in order.
2022-07-28 09:25:37 +08:00
Eli Zaretskii
4313c695cd ; Fix typos in comments and remove debug code. 2022-07-27 20:10:46 +03:00
Eli Zaretskii
a25cd7f68a Speed up Isearch in very long lines under line truncation
* src/xdisp.c (strings_with_newlines): New function.
(forward_to_next_line_start): Call 'strings_with_newlines' in
buffers with very long lines, to avoid falling back on slow
iteration.  (Bug#56682)
2022-07-27 20:05:44 +03:00
Po Lu
833a1f2c53 Fix thinko in last change
* src/print.c (PRINTPREPARE): Also remove `print_free_buffer'.
Record unwind protect instead.
(PRINTFINISH): Stop freeing the print buffer.  (bug#56773)
2022-07-27 20:01:53 +08:00
Po Lu
bfa951cdfa Fix invalid current buffer after print-unreadable-function signals
* src/print.c (PRINTPREPARE): Remove `old' and
record_unwind_current_buffer instead.
(PRINTFINISH): Stop restoring `old'.  (bug#56773)
2022-07-27 17:42:30 +08:00
Po Lu
27b5ab80ec Fix frame determination for XI touch events
* src/xterm.c (handle_one_xevent): Find touchscreen event
windows using x_window_to_frame.
2022-07-27 16:00:29 +08:00
Po Lu
de863f70aa Remove workaround for some input method problems
* src/xterm.c (handle_one_xevent): Remove modifier key
workaround for some input method problems, since they cause more
problems than they fix.  (bug#56782)
2022-07-27 13:01:54 +08:00
Po Lu
86f60ec54a Fix NS stretch glyph display
* src/nsterm.m (ns_draw_window_cursor): Just draw hollow cursor.
There is no need to draw the phys cursor glyph.
(ns_dumpglyphs_stretch): Delete function.
(ns_draw_glyph_string): New function.  Port code from X and use
it instead.  (bug#56787)
2022-07-27 11:21:34 +08:00