summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-08-07Revert "Improve X event timestamp tracking"Po Lu
This reverts commit 4b98a79a508ebdc719abfcf51ee6de32e46d0e1c. This change was installed without answering several important questions.
2022-08-06Improve X event timestamp trackingDaniel Colascione
Fix two problems with our handling of X timestamps 1) We're not properly updating the X interaction timestamp after receiving certain input events, and 2) X events sent in response to emacsclient commands get stale timestamps because the timestamp tracking doesn't take into account that interactions with the user can occur outside the X input event channel. * src/xterm.c: (x_display_set_last_user_time_1): New function. (x_display_set_last_user_time): Call it. (x_ewmh_activate_frame): Refactor. (x_focus_frame): Don't call XSetInputFocus if we can use EWMH activation. (server_timestamp_predicate): New function. (x_get_server_time): New function. (x_note_oob_interaction): New function. (x_create_terminal): Register new function as terminal hook. * src/termhooks.h: New hook: note_oob_interaction_hook. * src/gtkutil.h: (xg_set_user_timestamp): Declare. * src/gtkutil.c: (xg_set_user_timestamp): New function. * src/frame.c: (Fframe_note_oob_interaction): New function. (syms_of_frame): Register it. * lisp/server.el: (server-switch-buffer): Call frame-note-oob-interaction when user requests frame be raised.
2022-08-07Correctly set user time on GTK+ for key press eventsPo Lu
* src/xterm.c (x_set_gtk_user_time): New function. (handle_one_xevent): Call that after key press event on GTK+.
2022-08-06; * src/composite.c: Include stdlib.h.Eli Zaretskii
2022-08-06; * src/composite.c (Fcomposition_sort_rules): Fix last change.Eli Zaretskii
2022-08-06New function 'composition-sort-rules'Eli Zaretskii
* src/composite.c (Fcomposition_sort_rules) (compare_composition_rules): New functions.
2022-08-06Fix C-n/C-p inside bidirectional textEli Zaretskii
* src/xdisp.c (move_it_by_lines, try_cursor_movement): Handle glyph rows whose direction of increasing buffer positions is reverse of the normal: going down in the window makes buffer positions higher. * src/indent.c (Fvertical_motion): When looking for the last glyph row occupied by point, take into account the bidi iteration direction.
2022-08-06Correctly initialize values after a new device is enabledPo Lu
* src/xterm.c (handle_one_xevent): Initialize new device to zero. (bug#57011)
2022-08-06* src/puresize.h (BASE_PURESIZE): Bump the value. (Bug#57007)Eli Zaretskii
2022-08-06Improve XI focus handling for entry and exit eventsPo Lu
* src/xterm.c (handle_one_xevent): Skip useless x_detect_focus_change calls in more cases.
2022-08-06* src/callproc.c (emacs_spawn): Fix Mac OS X build.Po Lu
2022-08-06Improve XI focus handlingPo Lu
* src/xterm.c (handle_one_xevent): Skip useless x_detect_focus_change calls in some cases.
2022-08-05Add STREAM argument to 'process-tty-name'Jim Porter
* src/process.c (process-tty-name): Add STREAM argument. * lisp/eshell/esh-io.el (eshell-close-target): Only call 'process-send-eof' once if the process's stdin is a pipe. * test/src/process-tests.el (make-process/test-connection-type): Check behavior of 'process-tty-name'. * doc/lispref/processes.texi (Process Information): Document the new argument. * etc/NEWS: Announce this change.
2022-08-05Allow creating processes where only one of stdin or stdout is a PTYJim Porter
* src/lisp.h (emacs_spawn): * src/callproc.c (emacs_spawn): Add PTY_IN and PTY_OUT arguments to specify which streams should be set up as a PTY. (call_process): Adjust call to 'emacs_spawn'. * src/process.h (Lisp_Process): Replace 'pty_flag' with 'pty_in' and 'pty_out'. * src/process.c (is_pty_from_symbol): New function. (make-process): Allow :connection-type to be a cons cell, and allow using a stderr process with a PTY for stdin/stdout. (create_process): Handle creating a process where only one of stdin or stdout is a PTY. * lisp/eshell/esh-proc.el (eshell-needs-pipe, eshell-needs-pipe-p): Remove. (eshell-gather-process-output): Use 'make-process' and set ':connection-type' as needed by the value of 'eshell-in-pipeline-p'. * lisp/net/tramp.el (tramp-handle-make-process): * lisp/net/tramp-adb.el (tramp-adb-handle-make-process): * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Don't signal an error when ':connection-type' is a cons cell. * test/src/process-tests.el (process-test-sentinel-wait-function-working-p): Allow passing PROC in, and rework into... (process-test-wait-for-sentinel): ... this. (process-test-sentinel-accept-process-output) (process-test-sentinel-sit-for, process-test-quoted-batfile) (process-test-stderr-filter): Use 'process-test-wait-for-sentinel'. (make/process/test-connection-type): New function. (make-process/connection-type/pty, make-process/connection-type/pty-2) (make-process/connection-type/pipe) (make-process/connection-type/pipe-2) (make-process/connection-type/in-pty) (make-process/connection-type/out-pty) (make-process/connection-type/pty-with-stderr-buffer) (make-process/connection-type/out-pty-with-stderr-buffer): New tests. * test/lisp/eshell/esh-proc-tests.el (esh-proc-test--detect-pty-cmd): New variable. (esh-proc-test/pipeline-connection-type/no-pipeline) (esh-proc-test/pipeline-connection-type/first) (esh-proc-test/pipeline-connection-type/middle) (esh-proc-test/pipeline-connection-type/last): New tests. * doc/lispref/processes.texi (Asynchronous Processes): Document new ':connection-type' behavior. (Output from Processes): Remove caveat about ':stderr' forcing 'make-process' to use pipes. * etc/NEWS: Announce this change (bug#56025).
2022-08-05* src/keyboard.c (timer_check_2): Replace redundant test with assertionStefan Monnier
2022-08-05Avoid assertion violations in 'back_to_previous_visible_line_start'Eli Zaretskii
* src/xdisp.c (init_iterator): Always initialize narrowed_begv to zero, since SET_WITH_NARROWED_BEGV depends on it being non-zero as an indication that long-line optimizations are in use. (back_to_previous_visible_line_start): When long-line optimizations are in effect, we may end up not on a newline.
2022-08-05Make loaddefs.el dependencies more explicit in src/Makefile.inLars Ingebrigtsen
* src/Makefile.in (LC_ALL): Add loaddefs.el as a dependency, too, since that file may be deleted, but the loaddefs.elc file still exists. This causes problems in nativecomp builds.
2022-08-05Fix oldXMenu grab handlingPo Lu
* src/xmenu.c (x_menu_translate_generic_event, pop_down_menu): Clear grab correctly on individual XI2 devices.
2022-08-05Improve multi-pointer X supportPo Lu
* etc/TODO: Document that MPX support still needs work. * src/xterm.c (xi_handle_interaction): New function. (handle_one_xevent): Call it in the appropriate places.
2022-08-05Improve input extension focus handling with multiple master devicesPo Lu
* src/xterm.c (x_cache_xi_devices): Initialize device fields to 0. (xi_handle_focus_change, xi_focus_handle_for_device) (xi_handle_delete_frame): New functions; store focus information per-device instead. (x_detect_focus_change): Handle GenericEvents that way instead. (handle_one_xevent): Don't cache XI devices on DeviceChanged. (x_free_frame_resources): Clear any frame focus information. * src/xterm.h (struct xi_device_t): New fields for focus tracking. Add comments describing fields.
2022-08-04Merge branch 'feature/long-lines-improvements'Gregory Heytings
2022-08-04; * src/keyboard.c (safe_run_hooks_maybe_narrowed): Fix broken merge.Gregory Heytings
2022-08-04; * src/xterm.c (x_sync_init_fences): Fix number of fences announced.Po Lu
2022-08-04Merge branch 'master' into feature/long-lines-improvementsGregory Heytings
2022-08-04; * src/composite.c (find_automatic_composition): Fix a typo.Eli Zaretskii
2022-08-04Improve Bidi with long lines.Gregory Heytings
* src/composite.c (composition_compute_stop_pos): Use an 'endpos' that is not too far away. (find_automatic_composition): Use a 'head' that is not too far away. Also make sure that this code path is not taken when long line optimizations are disabled. * src/dispextern.h (struct composition_it): Add a field that points to the parent iterator. * src/xdisp.c (init_iterator): Set it.
2022-08-04Correctly implement refresh synchronization fencesPo Lu
* configure.ac (HAVE_XSYNC): Also check for XSyncTriggerFence. * src/xfns.c (Fx_create_frame): Create fences. * src/xterm.c (x_atom_refs): New atom. (x_sync_trigger_fence, x_sync_init_fences, x_sync_free_fences): New functions. (x_sync_update_finish): Trigger the appropriate fence. (x_free_frame_resources): Free fences. * src/xterm.h (struct x_display_info): New atom `_NET_WM_SYNC_FENCES'. (struct x_output): New field `sync_fences'.
2022-08-04Adjust src/Makefile.in comments about make-docfileLars Ingebrigtsen
* src/Makefile.in ($(etc)/DOC): Remove comment aboout make-docfile being run twice (because it no longer is).
2022-08-04Reduce code duplication in XI scroll bar codePo Lu
* src/xterm.c (xi_select_scroll_bar_events): New function. (x_create_toolkit_scroll_bar) (x_create_horizontal_toolkit_scroll_bar, x_scroll_bar_create): Factor out input extension code there.
2022-08-04Remove read_string_literal purify doc string hackLars Ingebrigtsen
* src/lread.c (read_string_literal): Since we're now byte-compiling the loaddefs files (so doc strings come from the .elc files), remove the hack that make this return 0 when the string starts with "\\n".
2022-08-04Remove VCSWITNESS dependency, since we're always rescanning nowLars Ingebrigtsen
* Makefile.in (VCSWITNESS): Remove, since we're always rescanning for loaddefs. * src/Makefile.in ($(lispsource)/loaddefs.el): Remove VCSWITNESS dependency.
2022-08-04Avoid redundant calls to XFlush in x_make_frame_visiblePo Lu
* src/xterm.c (x_make_frame_visible): Keep track of whether or not the output buffer was implictly flushed before issuing XFlush.
2022-08-03Byte-compile the in-tree loaddefs.el filesLars Ingebrigtsen
* lisp/Makefile.in (all): Add "autoloads", which now otherwise won't be done. ($(lisp)/loaddefs.el): Remove this target, since it's always done, and would then trigger a re-compilation of loaddefs.elc. * lisp/loadup.el: Load loaddefs.elc (if it exists). * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Don't include no-byte-compile cookies in the Emacs build. * src/Makefile.in ($(pdmp)): Depend on loaddefs.elc to ensure that it's built by this point. ($(etc)/DOC): Don't scan loaddefs.el for doc strings, since they are now picked up from the .elc file (bug#53024).
2022-08-03; * src/xterm.c (x_if_event): Minor speed improvements.Po Lu
2022-08-03Fix crash on setting frame background colorPo Lu
* src/xfns.c (x_set_background_color): Stop setting scroll bar window background, since this is now taken care of automatically.
2022-08-03Improve X server time computationPo Lu
* src/xterm.c (x_sync_get_monotonic_time): Use that if available. (x_display_set_last_user_time): Compute an offset between the monotonic time and the X server time if they are not identical. * src/xterm.h (struct x_display_info): New field `server_time_offset'.
2022-08-03Add preparations for animation frame timing supportPo Lu
* src/xterm.c (x_sync_get_monotonic_time) (x_sync_current_monotonic_time, x_sync_note_frame_times): New functions. (x_sync_wait_for_frame_drawn_event, x_sync_update_begin) (x_sync_handle_frame_drawn): Note frame times. (x_display_set_last_user_time): Check if the X server time is probably the same as CLOCK_MONOTONIC. * src/xterm.h (struct x_display_info, struct x_output): New fields and flags for clock handling and frame times.
2022-08-03Fix window iconification, raising and lowering frames, etcPo Lu
* src/xterm.c (XFlush): Remove define to 0. (x_clear_frame, x_scroll_run, x_draw_window_cursor) (x_free_frame_resources): Remove calls to XFlush where it is not really necessary. Leave the calls that actually are intact.
2022-08-02* src/xdisp.c (redisplay_window): Use BEG rather than hard coding 1Stefan Monnier
2022-08-02; Clarify documentation of "locked narrowing"Eli Zaretskii
* src/editfns.c (Fwiden, Fnarrow_to_region): * doc/lispref/positions.texi (Narrowing): Explain when 'narrow-to-region' and 'widen' might have no effect.
2022-08-02Further reduce monitor change event duplicationPo Lu
* src/xterm.c (handle_one_xevent): Also don't store duplicate events for ConfigureNotify events bound for the root window.
2022-08-02Avoid extra consing on monitor configuration changePo Lu
* src/xterm.c (x_find_monitors_changed_event): New function. (x_monitors_changed_cb, handle_one_xevent): Look through the entire event queue to skip delivering monitor change events.
2022-08-01Fix the bytecode incompatibility due to the change to 'narrow-to-region'.Gregory Heytings
* src/editfns.c (narrow_to_region_internal): New function, which contains the body previously in 'Fnarrow_to_region' but accepts a third argument. (Fnarrow_to_region): Use the new function. Update the docstring. (Fwiden): Update the docstring. * src/lisp.h: Prototype of the new function. * src/xdisp.c (handle_fontified_prop): Use the new function instead of 'Fnarrow_to_region'. * src/process.c (Finternal_default_process_filter): * src/lread.c (readevalloop): Remove the third argument to 'Fnarrow_to_region'. * src/bytecode.c (exec_byte_code): * lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): * lisp/emacs-lisp/bytecomp.el: Restore the statu quo ante. * etc/NEWS: Remove the entry about the new optional argument. * doc/lispref/positions.texi (Narrowing): Update the documentation.
2022-08-01* src/eval.c (Fdefvaralias): Clarify error messages. (Bug#56863)Eli Zaretskii
2022-08-01; * src/xdisp.c (get_visually_first_element): Fix last change.Gregory Heytings
2022-08-01* src/xdisp.c (get_visually_first_element): Fix a typo.Eli Zaretskii
2022-08-01Various improvements to long lines handling.Gregory Heytings
* src/xdisp.c (get_visually_first_element, (move_it_vertically_backward): Do not go back too far with bidi. (get_narrowed_begv): Do not return 0 anymore instead of BEGV. (handle_fontified_prop): Simplify accordingly. * src/keyboard.c (safe_run_hooks_maybe_narrowed): Simplify accordingly. * src/composite.c (find_automatic_composition): Ditto.
2022-08-01; * src/xdisp.c (reseat): Improve recomputations.Gregory Heytings
2022-08-01Fix forgotten initialization for long line optimizations.Gregory Heytings
* src/xdisp.c (init_iterator): Initialize the 'narrowed_begv' field. * src/buffer.c (syms_of_buffer): Docstring clarification.
2022-08-01Improve handling of xsettings eventsPo Lu
* src/xsettings.c (xft_settings_event): * src/xsettings.h: Return if the event was handled. * src/xterm.c (handle_one_xevent): If it was, don't handle the event any further.