Po Lu [Wed, 22 Dec 2021 03:13:23 +0000 (11:13 +0800)]
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.
Allow for next-completion to wrap around the completion buffer
* lisp/simple.el (completion-wrap-movement): Add new option.
(previous-completion): Update docstring.
(next-completion): Respect completion-wrap-movement.
(switch-to-completions): Handle backwards completion by jumping to the
end of the buffer.
* lisp/minibuffer.el: (minibuffer-local-completion-map): Bind
minibuffer-complete to backtab
(completion--in-region-1): Handle backtab to scroll backwards
Don't produce multibyte strings by accident in sasl-scram-rfc
* lisp/net/sasl-scram-rfc.el (sasl-scram--client-final-message):
The XOR of two unibyte strings should be a unibyte string.
This code previously worked by accident because of an overly tolerant
base64 encoder (bug#52670), but now causes a test failure.
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).
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.)
Stefan Monnier [Mon, 20 Dec 2021 16:04:37 +0000 (11:04 -0500)]
Fix bug#28557
* test/lisp/emacs-lisp/cconv-tests.el: Remove `:expected-result :failed`
from the bug#28557 tests.
(cconv-tests-cl-function-:documentation): Account for the presence of
the arglist (aka "usage") in the docstring.
Stefan Monnier [Tue, 21 Dec 2021 01:45:39 +0000 (20:45 -0500)]
eieio-tests.el: Silence last warnings
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-tests--dummy):
New class.
(eieio-test-22-init-forms-dont-match-runnable): Tweak to silence warning.
Paul Eggert [Mon, 20 Dec 2021 23:03:33 +0000 (15:03 -0800)]
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.
Silence byte-compiler warnings from absent optional features
* test/src/inotify-tests.el (inotify-rm-watch):
* test/src/lcms-tests.el (lcms-xyz->jch):
* test/src/sqlite-tests.el (sqlite-open):
Add declarations to prevent byte-compilation warnings when features
are absent.
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.
Treat base64 string encode/decode as pure functions
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns, pure-fns):
Mark base64-decode-string, base64-encode-string and
base64url-encode-string as pure and side-effect-free.
Stefan Kangas [Mon, 20 Dec 2021 14:54:56 +0000 (15:54 +0100)]
Silence byte-compiler using with-no-warnings in tests
We could silence the specific warnings by adding support for them to
with-suppressed-warnings, but it is almost not worth the complexity
for warnings that only show up in one file. In any case, it is not
urgent, so leave behind FIXMEs for now.
Stefan Kangas [Mon, 20 Dec 2021 14:25:23 +0000 (15:25 +0100)]
Silence undefined function warnings in eieio-tests.el
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el: Silence
byte-compiler with some function definitions. These are overridden by
class definitions further down.
* lisp/international/emoji.el (emoji--score): Don't take the bit
after the colon into consideration, like in "kiss: person, person,
light skin tone, medium-light skin tone".
* lisp/international/emoji.el (emoji--parse-emoji-test): Ensure
that we key off of the "person" variants, even if they come after
the gendered variations (which is the case for a handful of glyphs).
Juri Linkov [Sun, 19 Dec 2021 17:47:36 +0000 (19:47 +0200)]
* lisp/isearch.el: Don't display "Pending" for lax and toggle commands.
* lisp/isearch.el (isearch-message-prefix): Display "Pending"
only when isearch-adjusted is 't' (bug#52356).
(isearch-define-mode-toggle):
Set isearch-adjusted to 'toggle' instead of 't'.
(isearch-search-fun-default):
Set isearch-adjusted to 'lax' instead of 't'.
Eli Zaretskii [Sun, 19 Dec 2021 15:44:32 +0000 (17:44 +0200)]
; Fix last change to filelock-tests.el
* test/src/filelock-tests.el (filelock-tests-file-locked-p-spoiled)
(filelock-tests-unlock-spoiled)
(filelock-tests-kill-buffer-spoiled): Expect 'permission-denied' only
on MS-Windows.
Eli Zaretskii [Sun, 19 Dec 2021 15:29:40 +0000 (17:29 +0200)]
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.
Alan Mackenzie [Sun, 19 Dec 2021 14:26:06 +0000 (14:26 +0000)]
CC Mode: Remove annoying background fontification. Should fix bug #52298
Partially revert the commits from 2021-10-24 - 2021-10-26, "CC Mode: Fontify
"found types" which are recognized after being first scanned".
This removes the background fontification which ran off of a 0.1s timer, but
leaves the facility of normal fontification causing the fontification
throughout the buffer of newly found types.
* lisp/progmodes/cc-mode.el (c-type-finder-timer, c-inhibit-type-finder)
(c-type-finder-pos, c-post-gc-hook): Remove.
(c-leave-cc-mode-mode): Remove the manipulations of c-type-finder-timer and
c-post-gc-hook.
(c-basic-common-init): Remove the manipulations of c-type-finder-pos,
c-type-finder-timer, and c-post-gc-hook.
Rework how shr sets <span id='foo'> targets to make it more reliable
* lisp/net/eww.el (eww-display-html): The target is now a list.
* lisp/net/shr.el (shr--link-targets): New variable.
(shr-insert-document): Set the targets.
(shr-descend): Save targets and apply them later.
(shr-ensure-paragraph): Remove hack to avoid filling from removing
targets.
(shr-tag-a): Save targets for later.
(shr-render-td-1): Bind and set targets (bug#52512).
LdBeth [Sun, 19 Dec 2021 11:26:15 +0000 (12:26 +0100)]
Add a shr-allowed-images user option
* lisp/net/shr.el (shr-allowed-images): New variable (bug#52594).
(shr-image-is-blocked): New function to use it.
(shr-tag-img): Use it.
* doc/misc/eww.texi (Advanced): Document it.
This optimisation is of very limited utility and miscompiles top-level
code having the form (eval 'CODE t) by replacing it with CODE which
will then, as things currently stand, be evaluated with dynamic binding.
Michael Albinus [Sat, 18 Dec 2021 17:43:18 +0000 (18:43 +0100)]
Make generation of JUnit test reports more robust.
* lisp/emacs-lisp/ert.el (ert-load-file-name): New defvar.
(ert-write-junit-test-report): Use it. Make detection of selector
more robust. Protect calls of `xml-escape-string' with 'noerror.
* test/infra/Makefile.in (subdir_template): Use "make -k ...".
* test/infra/gitlab-ci.yml (test-filenotify-gio):
Adapt make_params in order to get a JUnit test report.
(test-native-comp-speed0): Use "make -k ...".
* test/infra/test-jobs.yml: Regenerate.
* test/lisp/progmodes/perl-mode-tests.el (top):
Set `ert-load-file-name'.
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.