Po Lu [Sat, 18 Dec 2021 12:45:11 +0000 (20:45 +0800)]
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.
Eli Zaretskii [Sat, 18 Dec 2021 11:56:10 +0000 (13:56 +0200)]
; 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'.
Po Lu [Sat, 18 Dec 2021 10:48:11 +0000 (18:48 +0800)]
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.
Eli Zaretskii [Sat, 18 Dec 2021 09:03:48 +0000 (11:03 +0200)]
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.
Po Lu [Sat, 18 Dec 2021 00:58:51 +0000 (08:58 +0800)]
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.
Paul Eggert [Fri, 17 Dec 2021 09:11:54 +0000 (01:11 -0800)]
Port tramp-adb.el back to Emacs 26
* lisp/net/tramp-adb.el (tramp-adb-ls-output-time-less-p):
Revert previous change since Tramp code should still be backward
compatible to Emacs 26. But add a comment about this.
Problem reported by Michael Albinus in:
https://lists.gnu.org/r/emacs-devel/2021-12/msg01623.html
Eli Zaretskii [Fri, 17 Dec 2021 08:35:44 +0000 (10:35 +0200)]
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)
* lisp/emacs-lisp/multisession.el: Don't require url -- this pulls
in gnus-util, which requires rmail, which depends on
rmail-loaddefs being generated, which our Makefiles doesn't guarantee.
Po Lu [Thu, 16 Dec 2021 07:15:28 +0000 (15:15 +0800)]
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.
Paul Eggert [Thu, 16 Dec 2021 17:40:22 +0000 (09:40 -0800)]
Simplify epa-ks--parse-buffer timestamp handling
* lisp/epa-ks.el (epa-ks--parse-buffer): Omit unnecessary calls to
seconds-to-time, and prefer the unaliased name time-convert when
calls are necessary.
Paul Eggert [Thu, 16 Dec 2021 17:40:22 +0000 (09:40 -0800)]
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.
Paul Eggert [Thu, 16 Dec 2021 17:40:21 +0000 (09:40 -0800)]
Fix icalendar time zone parsing glitch
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
Use pcase instead of cl-case, as cl-macs might not be loaded.
Otherwise, a build complains “calendar/icalendar.el:618:57:
Warning: ‘90’ is a malformed function” and some
icalendar--decode-isodatetime tests fail. This fixes a bug
introduced in 2021-11-21T08:18:57Z!dick.r.chiang@gmail.com.
* lisp/international/emoji.el (emoji--recent): Make into a
multisession variable.
(emoji-recent, emoji--recent-transient): Use it.
(emoji--add-recent): Update it.
Martin Rudalics [Wed, 15 Dec 2021 17:53:49 +0000 (18:53 +0100)]
Fix control buffer window height in 'ediff-setup-control-buffer' (Bug#49277)
* lisp/vc/ediff-util.el (ediff-setup-control-buffer): Emulate
original 'shrink-window-if-larger-than-buffer' call by calling
'fit-window-to-buffer' with an appropriate maximum height
argument (Bug#49277).
Andrea Corallo [Wed, 15 Dec 2021 14:47:14 +0000 (15:47 +0100)]
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'.
Stefan Kangas [Wed, 15 Dec 2021 05:30:41 +0000 (06:30 +0100)]
Merge from origin/emacs-28
7078f32b5b Fix crash when dumping charset_table with portable dumper ... a4fcbf46a7 ; etc/NEWS: Move the note about Xref EIEIO change to the p... f88c1d222f Remove maintainer comment from Emacs 28 module snippet.
Stefan Monnier [Tue, 14 Dec 2021 22:01:34 +0000 (17:01 -0500)]
eieio-compat.el: Move to lisp/obsolete
The file only contains obsolete definitions, so it really belongs in
`lisp/obsolete`. Moving it there will also signal a warning for those
people who run old `.elc` files using EIEIO and generated with
Emacs<25 and who otherwise might not know about the obsolescence of
some of the functions they use.
* lisp/emacs-lisp/eieio-compat.el: Move to ...
* lisp/obsolete/eieio-compat.el: ... here.
Philipp Stephani [Tue, 14 Dec 2021 10:17:37 +0000 (11:17 +0100)]
Remove maintainer comment from Emacs 28 module snippet.
This is the same as 44c13eefe8d30841000a96d82f467fb8d222e365 on
master. We should also remove this comment on the release branch,
otherwise it ends up in the emacs-module.h shipped to users.
* test/infra/gitlab-ci.yml (variables): Set EMACS_TEST_JUNIT_REPORT.
(.job-template): Use it in script and after_script.
(.build-template, .gnustep-template, .filenotify-gio-template)
(.native-comp-template): Adapt rules.
(.test-template): Trigger JUnit test report.
Stefan Monnier [Mon, 13 Dec 2021 14:29:42 +0000 (09:29 -0500)]
lisp/pcomplete.el: Mark obsolete some unused functions
* lisp/pcomplete.el (pcomplete-match-beginning, pcomplete-match-end):
Mark as obsolete.
(pcomplete-opt, pcomplete--here, pcomplete--help): Use lexical-binding.
Stefan Kangas [Mon, 13 Dec 2021 05:30:58 +0000 (06:30 +0100)]
Merge from origin/emacs-28
9bd3f78645 Make `M-x run-python' select the window again 62139aeb42 * lisp/tab-bar.el (tab-bar-switch-to-last-tab): Add 'abs' ... ea8422204f * make-dist (manifest): Filter out msdos/autogen/* files. b5354e989d Rewrite the "Quitting Windows" section of Emacs Lisp Refer... 64ea1a178c Fix eshell for systems that do not have subprocesses
* doc/lispref/text.texi (Database): Document it.
* src/sqlite.c (Fsqlite_pragma): Add a separate command for
pragmas. These can be done via sqlite-execute, but it's less
confusing to have them in a separate command.
* src/sqlite.c (Fsqlite_execute): Use it.
(syms_of_sqlite): Introduce a new error for locked databases so
that we can catch that condition on higher levels.
Kévin Le Gouguec [Mon, 13 Dec 2021 04:17:00 +0000 (05:17 +0100)]
Make `M-x run-python' select the window again
Interactively, we want M-x run-python to focus the interpreter buffer.
The previous code failed in two ways:
- the call to 'display-buffer' was not reached if an interpreter
was already running,
- set-buffer is ineffectual if the interpreter's window is not
selected: once Emacs returns to the command loop, the current buffer
will revert back to what the selected window contains.
* lisp/progmodes/python.el (python-shell-make-comint): Handle the SHOW
argument regardless of whether an interpreter buffer exists, and use
pop-to-buffer to select the window.
(run-python): Delegate buffer management to
'python-shell-make-comint'.
* test/lisp/progmodes/python-tests.el
(python-tests--run-python-selects-window): Rename from
'python-tests--bug31398', and adjust assertions (bug#52380).
Po Lu [Mon, 13 Dec 2021 01:59:39 +0000 (09:59 +0800)]
Work around pixel scrolling issues when org-indent-mode is on
* lisp/pixel-scroll.el (pixel-point-and-height-at-unseen-line):
Subtract line height of window start when it doesn't appear
at the 0th pixel of the line.
Po Lu [Mon, 13 Dec 2021 01:17:55 +0000 (09:17 +0800)]
Stop using XI focus events on non-GTK builds
* src/xfns.c (setup_xi_event_mask): Stop setting XI_FocusIn
and XI_FocusOut.
* src/xterm.c (x_detect_focus_change) <GenericEvent>: Don't
handle XI_FocusIn and XI_FocusOut events when not on GTK.
Juri Linkov [Sun, 12 Dec 2021 19:11:47 +0000 (21:11 +0200)]
* lisp/char-fold.el (char-fold-override): New defcustom (bug#52394).
(char-fold--default-override): New defconst with the default value nil.
(char-fold--previous): Add char-fold--default-override.
(char-fold--make-table): Don't populate the table with default chars
when char-fold-override or char-fold--default-override is non-nil.
(char-fold-update-table): Add char-fold--default-override.