1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 08:11:05 -08:00
Commit graph

44896 commits

Author SHA1 Message Date
Alan Third
0f427befe8 Simplify NS color handling
* src/image.c (RGB_TO_ULONG):
(ARGB_TO_ULONG):
(RED_FROM_ULONG):
(RED16_FROM_ULONG):
(GREEN16_FROM_ULONG):
(BLUE16_FROM_ULONG): Define these here for NS too.
* src/nsfns.m (ns_set_foreground_color):
(ns_set_background_color): Use new EmacsColor methods.
* src/nsterm.h (struct ns_color_table): Replace this struct with a
built-in Objective C type.
(RGB_TO_ULONG):
(ARGB_TO_ULONG):
(ALPHA_FROM_ULONG):
(RED_FROM_ULONG):
(GREEN_FROM_ULONG):
(BLUE_FROM_ULONG):
(RED16_FROM_ULONG):
(GREEN16_FROM_ULONG):
(BLUE16_FROM_ULONG): These are no longer needed in the NS specific code.
(struct ns_display_info): Use an NSMutableArray instead of a custom struct.
* src/nsterm.m ([NSColor colorWithUnsignedLong:hasAlpha:]):
([NSColor unsignedLong]): New methods.
(ns_lookup_indexed_color):
(ns_index_color): Use the NSMutableArray lookup table.
(ns_term_init):
(ns_color_index_to_rgba):
(ns_query_color): Use the new EmacsColor methods.
(ns_initialize_display_info):
(ns_delete_display): Initialize and release the NSMutableArray lookup table.
2021-12-22 20:48:19 +00:00
Po Lu
3dbe7caed7 * src/pgtkterm.c (scroll_event): Fix scroll delta scale. 2021-12-22 21:36:18 +08:00
Po Lu
551fe22557 * src/pgtkterm.c (scroll_event): Fix sign of delta_y. 2021-12-22 21:33:00 +08:00
Po Lu
141bf182da Fix horizontal scrolling on PGTK
* src/pgtkterm.c (scroll_event): Fix for when
`mwheel-coalesce-scroll-events' is nil.
2021-12-22 17:29:27 +08:00
Po Lu
f703232b7f Use XI2 calls to warp the client pointer
* src/xfns.c (Fx_set_mouse_absolute_pixel_position):
* src/xterm.c (frame_set_mouse_pixel_position): Replace
calls to XWarpPointer with calls to XIWarpPointer with
the client pointer explictly specified.  This avoids the
odd situation where the client pointer of the root window
is not the client pointer of the frame.
2021-12-22 11:13:23 +08:00
Po Lu
026804b606 Fix GTK crash when clicking on xwidgets on XI2
* src/xterm.c (handle_one_xevent): Drop button events destined
for an xwidget.
2021-12-22 09:24:05 +08:00
Eli Zaretskii
678b29711b ; * src/xdisp.c (display_string): Fix a typo in a comment. 2021-12-21 19:18:33 +02:00
Po Lu
264589cdf7 Fix xg_event_is_scrollbar for grab-related events on XI2
* src/gtkutil.c (xg_event_is_for_scrollbar): Don't return true
if event coordinates are outside the frame on XInput 2.
2021-12-21 19:26:40 +08:00
Po Lu
c0e9785c7c ; * src/xterm.c (handle_one_xevent): Fix typo in last change. 2021-12-21 15:02:37 +08:00
Po Lu
e703735383 Ignore XI_TouchBegin events on the GTK tool bar
* src/xterm.c (handle_one_xevent): Ignore TouchBegin events
that target the tool bar.
2021-12-21 15:00:08 +08:00
Lars Ingebrigtsen
cf2597da0d Revert "Speed up find_field when called from outside a field"
This reverts commit 4d8af56c76.

This leads to lisp-mode-tests failures
2021-12-21 05:25:50 +01:00
Lars Ingebrigtsen
18ce031f9b Remove the `mode-line-percent-position' min width hack
* lisp/bindings.el (mode-line-position): Remove hack to get
min-width to work on the `mode-line-percent-position' bit.
* src/xdisp.c (display_string): Respect min-width in the non-Lisp
string case (bug#52332).
2021-12-21 05:23:11 +01:00
Lars Ingebrigtsen
4d8af56c76 Speed up find_field when called from outside a field
* src/editfns.c (find_field): Speed up the field functions when
called from outside a field (bug#52593).  (In some cursory tests,
this makes the called-from-outside-a-field case about 3x faster.)
2021-12-21 05:23:11 +01:00
Po Lu
43356423a2 Don't drop touch events we're not interested in on GTK3
* src/xterm.c (handle_one_xevent): Allow GTK to handle
unwanted TouchBegin events.
2021-12-21 10:01:37 +08:00
Po Lu
513fe2d6ff Fix touch event menu bar detection
* src/xterm.c (handle_one_event): Don't drop menu bar touch
events.
2021-12-21 09:58:14 +08:00
Po Lu
a5509a2a5e Fix xg_event_is_for_menubar for XI2 events
* src/gtkutil.c (xg_event_is_for_menubar): Use correct fields
for XI2 events.
* src/xterm.c (handle_one_event): Drop TouchBegin events we
know about.
2021-12-21 09:53:10 +08:00
Po Lu
4234995d42 * src/xterm.c (handle_one_xevent): Set user time on touch events. 2021-12-21 09:43:23 +08:00
Po Lu
2bcd299431 Ignore all emulated button events (i.e. those from touchscreens)
* src/xterm.c (handle_one_xevent): Ignore all XIPointerEmulated
events if the display supports XI 2.2 or later.
2021-12-21 09:41:40 +08:00
Paul Eggert
aa1fdb3f6f Put AM_V_GEN etc. first
With the recent changes to src/verbose.mk.in, it’s more important
to be consistent about putting AM_V_GEN and similar macros at the
start of a rule’s recipe, since ‘make’ now outputs the diagnostic
before it executes the recipe rather than the shell outputting it.
Most of the uses were already this way, but there were a few
outliers.  Problem reported by Pip Cet.
* Makefile.in (${srcdir}/info/dir):
* admin/unidata/Makefile.in (${unidir}/charprop.el, ${unifiles})
(${unidir}/emoji-labels.el):
* lib/Makefile.in (libgnu.a, libegnu.a):
* lisp/Makefile.in (TAGS):
* src/Makefile.in (lisp.mk, Emacs):
* test/Makefile.in (%.log, $(test_module)):
Put AM_V_GEN and similar macros first.
2021-12-20 15:05:08 -08:00
Paul Eggert
eaa44ca40e Prefer $(info) to @echo
Have GNU Make output some diagnostics directly, instead of forking
and execing a shell to do it.
* GNUmakefile (help):
* doc/lispref/two-volume.make (vol2.pdf, elisp2med-init)
(elisp2-init):
* doc/misc/Makefile.in (echo-info, echo-sources):
* lib-src/Makefile.in (archlibdir, install, check):
* src/verbose.mk.in (AM_V_AR, AM_V_CC, AM_V_CXX, AM_V_CCLD)
(AM_V_CXXLD, AM_V_ELC, AM_V_ELN, AM_V_GEN, AM_V_GLOBALS)
(AM_V_RC):
* test/Makefile.in (subdirs, subdir-targets):
Prefer $(info) to @echo.
* GNUmakefile (MAKECMDGOALS, configure, Makefile):
Prefer $(warning) to @echo >&2.
* src/verbose.mk.in (AM_V_ELN): Output target, like the others.
2021-12-20 12:24:04 -08:00
Mattias Engdegård
a34650acff Fix sloppy base64 acceptance of some multibyte characters
The base64 encoding functions incorrectly accepted some multibyte
characters; stop doing that (bug#52670).

* src/fns.c (base64_encode_1): Reject all multibyte characters.
* test/src/fns-tests.el (fns-tests-base64-encode-string)
(fns-test-base64url-encode-region)
(fns-test-base64url-encode-string): Add tests.
* doc/lispref/text.texi (Base 64): Rephrase outdated manual text.
* etc/NEWS: Add a notice.
2021-12-20 20:22:09 +01:00
Sam Steingold
27be90154d Fix build in a separate directory (bug#52669)
* src/lisp.h: Include <globals.h> instead of "globals.h"
2021-12-20 13:25:46 -05:00
Mattias Engdegård
8706f6fde1 Add macroexp--dynamic-variable-p
This predicate can be used for discriminating between lexically and
dynamically bound variables during macro-expansion (only).
It is restricted to internal use for the time being.

* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
Use macroexpand--all-toplevel.
* lisp/emacs-lisp/macroexp.el (macroexp-dynamic-variable-p): New.
(macroexp--expand-all): Maintain macroexp--dynvars.
(macroexpand-all): Rebind macroexp--dynvars.
(macroexpand--all-toplevel): New.
(internal-macroexpand-for-load): Use macroexpand--all-toplevel.
* src/eval.c (eval_sub): Transfer defvar declarations from
Vinternal_interpreter_environment into macroexp--dynvars during
lazy macro-expansion.
* src/lread.c (readevalloop): Rebind macroexp--dynvars around
read-and-evaluate operations.
(syms_of_lread): Define macroexp--dynvars.
* test/lisp/emacs-lisp/macroexp-resources/vk.el: New file.
* test/lisp/emacs-lisp/macroexp-tests.el (macroexp-tests--run-emacs)
(macroexp-tests--eval-in-subprocess)
(macroexp-tests--byte-compile-in-subprocess)
(macroexp--tests-dynamic-variable-p): Add tests.
2021-12-20 16:26:02 +01:00
Eli Zaretskii
cc63704815 New error symbol 'permission-denied'
* src/fileio.c (syms_of_fileio) <permission-denied>: Define the
symbol and its 'err-conditions' and 'error-message' properties.
(get_file_errno_data): Return permission-denied on EACCES.

* test/src/filelock-tests.el (filelock-tests-file-locked-p-spoiled)
(filelock-tests-unlock-spoiled)
(filelock-tests-kill-buffer-spoiled): Adapt the tests to the new
error symbol.

* doc/lispref/errors.texi (Standard Errors):
* etc/NEWS: Document 'permission-denied' error.
2021-12-19 17:29:40 +02:00
Eli Zaretskii
ec692470bd Fix last change in 'handle_display_prop'
* src/xdisp.c (handle_display_prop): Pass the window's buffer to
'display_min_width' and to 'handle_display_spec'.  (Bug#52385)
2021-12-19 15:48:30 +02:00
Po Lu
1fce1d99d4 * src/gtkutil.c: Remove obsolete fixme. 2021-12-19 09:18:20 +08:00
Eli Zaretskii
f60265e73f Clean up some of PGTK code
* src/pgtkgui.h: Fix comments.
* src/image.c (DONT_CREATE_TRANSFORMED_IMAGEMAGICK_IMAGE)
(is_wayland_display, check_x_display_info)
(pgtk_get_string_resource): Reformat comments.
* src/gtkutil.c (xg_show_tooltip): Add comments to large #ifdef's.
2021-12-18 16:12:23 +02:00
Po Lu
97b6907563 * src/pgtkfns.c (Fx_show_tip): Adjust call for new signature. 2021-12-18 20:59:11 +08:00
Po Lu
4ff3a70153 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-18 20:58:44 +08:00
Po Lu
4544651b3f Work around some mysterious touch ownership race on GNOME Shell
* src/xterm.c (x_unlink_touch_point): Return if touchpoint was
actually unlinked.
(handle_one_xevent): Catch and ignore errors during touch
sequence grabbing.
2021-12-18 20:46:50 +08:00
Eli Zaretskii
d99aa9461b ; Fix last change
* src/xdisp.c (window_text_pixel_size): Fix whitespace and braces.

* src/xdisp.c (Fwindow_text_pixel_size):
* etc/NEWS:
* doc/lispref/display.texi (Size of Displayed Text): Improve
wording of the documentation of the new argument of
'window-text-pixel-size'.
2021-12-18 13:56:10 +02:00
Po Lu
43c4cc2ea2 Add new argument ignore-line-at-end' to window-text-pixel-size'
* doc/lispref/display.texi (Size of Displayed Text): Update
documentation.
* etc/NEWS: Announce new argument.
* src/xdisp.c (window_text_pixel_size): Allow controlling if
the iterator's ascent and descent will be appended to the
pixel height returned.  All callers changed.
(Fwindow_text_pixel_size): New argument `ignore-line-at-end'.
All callers changed.
2021-12-18 19:16:16 +08:00
Eli Zaretskii
3fea95b79f Fix display of window-specific overlays with 'display' property
* src/xdisp.c (handle_display_prop): Pass the window to
'get_char_property_and_overlay', not the buffer.  (Bug#52385)
The assignment of the buffer to OBJECT was moved to before
the call to 'get_char_property_and_overlay', for unknown
reasons, as part of installing the support for the
'min-width' space spec.
2021-12-18 11:03:48 +02:00
Po Lu
7ab1b71c0d Coding style fixes
* src/gtkutil.c (xg_frame_set_char_size): Fix coding style.
2021-12-18 15:45:42 +08:00
Po Lu
6ad5ff4496 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-18 15:30:43 +08:00
Po Lu
f7755b8818 Flip buffers if display were modified in haiku_read_socket
* src/haikuterm.c (flush_dirty_back_buffers): New function.
(haiku_read_socket): Flip buffers if the display could have
been modified.
2021-12-18 03:40:44 +00:00
Po Lu
26d1f04d76 Don't abort upon untracked TouchUpdate events
Emacs might get an untracked TouchUpdate event in the unlikely
event of a device hierarchy change during a touch sequence, in
which case all devices and touchpoints will be reset.

* src/xterm.c (handle_one_xevent): Don't abort when receiving
a TouchUpdate that isn't part of a touch sequence.
2021-12-18 08:58:51 +08:00
Po Lu
efdfe22704 Fix touchscreen support on Xt builds
* src/xterm.c (handle_one_xevent): Make menu bar touch event
code conditional on GTK3.
2021-12-17 19:17:50 +08:00
Po Lu
62fc53d75b Update menu bar when processing touch sequences on it
* src/xterm.c (handle_one_event): Prevent menu bar from
becoming outdated when handling XI_TouchBegin events that may
cause it to be opened.
2021-12-17 19:11:54 +08:00
Po Lu
75e6c169ae Ignore motion events sent by an emulated pointer
* src/xterm.c (handle_one_xevent): Ignore XI_Motion events that
have PointerEmulated set when the display supports XInput 2.2
or later.
2021-12-17 19:04:03 +08:00
Eli Zaretskii
1b2511fa2a Fix selection of fonts that don't have regular weight
* src/font.c (font_delete_unmatched): The kludge of allowing
inexact matches of the font weight is now used for non-NTGUI
platforms as well.  (Bug#52493)
2021-12-17 10:35:44 +02:00
Po Lu
5e5cde55e5 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-17 14:23:07 +08:00
Po Lu
f6339412ee Add support for touchscreen events generated by XInput 2
* doc/lispref/commands.texi (Input Events): Add "Touchscreen
Events" to menu.
(Touchscreen Events): New node.
* etc/NEWS: Announce new event types.

* src/keyboard.c (make_lispy_event): Handle touchscreen events.
(syms_of_keyboard): New symbols `touchscreen-begin',
`touchscreen-end' and `touchscreen-update'.
* src/termhooks.h (enum event_kind): New touchscreen events.

* src/xfns.c (setup_xi_event_mask): Set up touch event mask if
appropriate.
(x_window) [USE_GTK]: Call `setup_xi_event_mask'.

* src/xterm.c (x_free_xi_devices): Free touchpoints.
(x_init_master_valuators): Handle all devices and set master and
touch mode flags appropriately.
(xi_reset_scroll_valuators_for_device_id):
(x_get_scroll_valuator_delta): Ignore slave devices.

(xi_link_touch_point):
(xi_unlink_touch_point):
(xi_find_touch_point): New functions.
(handle_one_xevent): Handle XI touch events and events from
non-master devices.

* src/xterm.h (struct xi_touch_point_t): New structure.
(struct xi_device_t): Add touchpoints field.
2021-12-17 14:20:05 +08:00
Paul Eggert
895215854d * src/timefns.c: Minor comment fix. 2021-12-16 15:35:32 -08:00
Paul Eggert
73d6b19024 Omit temporary warning re obsolete timestamps
Do not warn about timestamps like (1 . 1000).  This warning was added
in Emacs 27 as a temporary transition aid, and has now served its
purpose.  These timestamps, which Emacs 26 and earlier treated as (HI
. LO) instead of as (TICKS . HZ), were never generated by Emacs
primitives, and in practice the warning seems to have been triggered
only by test cases designed to generate it.
* src/timefns.c (WARN_OBSOLETE_TIMESTAMPS): Remove.
All uses changed to assume it’s false.
(decode_lisp_time): Simplify by taking a bool instead of an
integer bitmask.  All uses changed.
2021-12-16 11:17:27 -08:00
Paul Eggert
34e3ad5ae4 Fix encode-time doc string
* src/timefns.c (Fencode_time): Fix incorrect doc string
that talks about FORM (which doesn’t exist) by copying
wording from the manual instead.
2021-12-16 11:17:24 -08:00
Po Lu
32b9b22f66 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-16 17:57:56 +08:00
Po Lu
1c6363ff4b Require xwidget.el in `make-xwidget'
* src/xwidget.c (Fmake_xwidget): Require `xwidget'.
2021-12-16 14:12:53 +08:00
Andrea Corallo
e6b93245fe Have 'dlopen' use RTLD_GLOBAL in 'dynlib_open'
* src/pdumper.c (dump_do_dump_relocation): Use 'dynlib_open_for_eln'
in place of 'dynlib_open'.
* src/dynlib.h (dynlib_open_for_eln): Declare it.
* src/dynlib.c (dynlib_open_for_eln): New function.
(dynlib_open): Add RTLD_GLOBAL.
* src/comp.c (Fnative_elisp_load): Use 'dynlib_open_for_eln' in place
of 'dynlib_open'.
2021-12-15 15:55:01 +01:00
Po Lu
81d2e846a8 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-15 18:39:06 +08:00