Stefan Kangas [Sat, 20 Nov 2021 12:12:38 +0000 (13:12 +0100)]
Make string-animate smoother
* lisp/play/animate.el (animate-total-added-delay): New defcustom.
(animate-n-steps): Double the default value. Use :type 'natnum'.
(animate-string): Make the delay depend on the above new defcustom
divided by the number of steps.
Po Lu [Sat, 20 Nov 2021 11:54:51 +0000 (19:54 +0800)]
Fix xwidgets with XInput 2 builds
* src/xwidget.c (Fmake_xwidget): Refrain from synthesizing
a focus event here on XI2 builds.
(Fxwidget_perform_lispy_event): Try to set embedder on XI2
builds and do nothing otherwise.
(synthesize_focus_in_event): Use focus_change.window as opposed
to any.window.
(x_draw_xwidget_glyph_string): Synthesize focus event here
instead on XI2 builds.
* lisp/net/shr.el (shr-sup): New face.
(shr-tag-sup, shr-tag-sub): Use it to make the super/subscripts
slightly smaller so that we don't get uneven line heights with
text that uses these.
Po Lu [Sat, 16 Oct 2021 05:15:36 +0000 (13:15 +0800)]
Add support for event processing via XInput 2
* configure.ac: Add an option to use XInput 2 if available.
* src/Makefile.in (XINPUT_LIBS, XINPUT_CFLAGS): New variables.
(EMACS_CFLAGS): Add Xinput CFLAGS.
(LIBES): Add XInput libs.
* src/xmenu.c (popup_activated_flag): Expose flag if
XInput 2 is available.
* src/xfns.c (x_window): Set XInput 2 event mask.
(setup_xi_event_mask): New function.
(syms_of_xfns): Provide XInput 2 feature.
* src/xterm.c (x_detect_focus_change): Handle XInput 2
GenericEvents.
(handle_one_xevent): Handle XInput 2 events.
(x_term_init): Ask the server for XInput 2 support and set
xkb_desc if available.
(x_delete_terminal): Free XKB kb desc if it exists, and free
XI2 devices if they exist.
(xi_grab_or_ungrab_device)
(xi_reset_scroll_valuators_for_device_id)
(x_free_xi_devices, x_init_master_valuators): New functions.
(x_get_scroll_valuator_delta): New function.
(init_xterm): Don't tell GTK to only use Core Input when built
with XInput 2 support.
* src/xterm.h (struct x_display_info): Add fields for XKB
and XI2 support.
* src/gtkutil.c (xg_event_is_for_menubar): Handle
XIDeviceEvents.
(xg_is_menu_window): New function.
(xg_event_is_for_scrollbar): Handle XIDeviceEvents.
* etc/NEWS: Document changes.
* lisp/mwheel.el (mouse-wheel-down-alternate-event)
(mouse-wheel-up-alternate-event)
(mouse-wheel-left-alternate-event)
(mouse-wheel-right-alternate-event): New user options.
(mouse-wheel-text-scale)
(mwheel-scroll): Test for alternate events.
(mouse-wheel--setup-bindings): Set up bindings for alternate
buttons.
Po Lu [Sat, 20 Nov 2021 06:30:12 +0000 (14:30 +0800)]
Use `xwidget-live-p' inside `xwidget-at'.
It should no longer be possible for Lisp code to abuse internal
xwidget state, or cause crashes with killed xwidgets and such,
so the pedantic checking done in this function is no longer
necessary. (In fact, it is even wrong, as it won't catch
killed xwidgets.)
* lisp/xwidget.el (xwidget-at): Use `xwidget-live-p'.
Po Lu [Fri, 19 Nov 2021 12:04:08 +0000 (20:04 +0800)]
Allow controlling where xwidget-webkit stores cookies
* doc/lispref/display.texi (Xwidgets): Document new function.
* etc/NEWS: Announce `xwidget-webkit-cookie-file' and
`xwidget-webkit-set-cookie-storage-file'.
* lisp/xwidget.el (xwidget-webkit-cookie-file): New user
option.
(xwidget-webkit-new-session): Set cookie storage file.
* src/xwidget.c (Fmake_xwidget): Create new context for
each unrelated widget.
(Fxwidget_webkit_set_cookie_storage_file): New function.
(syms_of_xwidget): Define new subr.
Po Lu [Fri, 19 Nov 2021 10:41:53 +0000 (18:41 +0800)]
Display page loading progress in xwidget webkit
* lisp/xwidget.el (xwidget-webkit--title): Remove internal
variable.
(xwidget-webkit--loading-p)
(xwidget-webkit--progress-update-timer): New variables.
(xwidget-webkit--update-progress-timer-function): New function.
(xwidget-webkit-callback): Set up progress update timer during
page loads.
(xwidget-webkit-mode): Add page load progress to header line
format.
Make UCS compose/decompose functions more understandable
* lisp/international/ucs-normalize.el ()
(ucs-normalize-NFD-region, ucs-normalize-NFD-string)
(ucs-normalize-NFC-region, ucs-normalize-NFC-string)
(ucs-normalize-NFKD-region, ucs-normalize-NFKD-string)
(ucs-normalize-NFKC-region, ucs-normalize-NFKC-string): Make the
doc strings say what they actually do.
Stefan Kangas [Fri, 19 Nov 2021 06:00:24 +0000 (07:00 +0100)]
Merge from origin/emacs-28
02853edba7 Fix sorting of menus in `context-menu-local' (bug#50067). 14271d050a Fix flyspell-correct-word selected from context menu opene... bf824843f4 * lisp/repeat.el (describe-repeat-maps): Print all bound k... 6fc94fb99e * lisp/tab-bar.el: Use 'mouse-1' for history buttons like ... 5eeaf85767 Improve documentation of window hooks 7404f4b4e0 Improve doc string of 'highlight-nonselected-windows'
* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--decode-isodatetime):
* test/src/eval-tests.el
(eval-tests-19790-backquote-comma-dot-substitution):
Change `defun` into `ert-deftest` where this seems to have been the
original intention.
Juri Linkov [Thu, 18 Nov 2021 18:36:55 +0000 (20:36 +0200)]
Fix sorting of menus in `context-menu-local' (bug#50067).
* lisp/menu-bar.el (menu-bar-keymap): Don't use `lookup-key'
on the `keymap' arg.
* lisp/mouse.el (context-menu-global): Use `lookup-key global-map'
for the `keymap' arg of `menu-bar-keymap'.
(context-menu-local): Use `menu-bar-keymap' to sort `keymap'.
Michael Albinus [Thu, 18 Nov 2021 18:35:13 +0000 (19:35 +0100)]
Do not exclude emacs-module-tests.el on emba
* test/infra/gitlab-ci.yml (test-native-comp-speed0)
(test-all-inotify): Do not exclude emacs-module-tests.el.
* test/src/emacs-module-tests.el
(module--test-assertions--load-non-live-object)
(module--test-assertions--load-non-live-object-with-global-copy)
(module--test-assertions--call-emacs-from-gc)
(module--test-assertions--globref-invalid-free): Tag them as
:unstable on emba. (Bug#50902)
Juri Linkov [Thu, 18 Nov 2021 18:23:58 +0000 (20:23 +0200)]
Fix flyspell-correct-word selected from context menu opened with the keyboard
* lisp/mouse.el (context-menu-open): Call interactively a command
returned by `context-menu-map' such as `flyspell-correct-word' (bug#50067).
* lisp/textmodes/flyspell.el (flyspell-correct-word): Handle the
case when it's called by a key bound to `context-menu-open'.
Then it should work the same way as `C-c $' typed on misspelled word
where the arg `event' of `flyspell-correct-word-before-point' is nil.
Juri Linkov [Thu, 18 Nov 2021 17:27:46 +0000 (19:27 +0200)]
* lisp/tab-bar.el: Optimize data usage for nil tab-bar-history-mode.
* lisp/tab-bar.el (tab-bar--tab): Add wc-history-back and
wc-history-forward only when tab-bar-history-mode is non-nil.
(tab-bar-select-tab): Use wc-history-back and
wc-history-forward only when tab-bar-history-mode is non-nil.
(tab-bar-new-tab-to): Reset tab-bar-history-back and
tab-bar-history-forward to nil.
Juri Linkov [Thu, 18 Nov 2021 17:24:35 +0000 (19:24 +0200)]
* lisp/tab-bar.el: Avoid micro-steps in tab-bar-history-back/forward.
* lisp/tab-bar.el (tab-bar-history-pre-command)
(tab-bar-history-done-command): New variables.
(tab-bar--history-pre-change): Set 'tab-bar-history-omit' and
'tab-bar-history-pre-command'.
(tab-bar--history-change): Use 'tab-bar-history-done-command' and
'tab-bar-history-pre-command' (bug#51370).
* doc/misc/modus-themes.org (File): Use new version and add release
date.
(How do the themes look like, Learn about the latest changes): Update
link to new URL.
(Enable and load): Update text of internal reference.
(Sample configuration for use-package): Add sample configuration
without the 'use-package' infrastructure.
(Differences between loading and enabling): Minor rewordings.
(Customization Options): Update sample code to cover latest changes.
(Option for inhibiting theme reload)
(Option for color-coding success state (deuteranopia))
(Option for more bold constructs)
(Option for more italic constructs)
(Option for syntax highlighting)
(Option for links)
(Option for command prompt styles)
(Option for mode line presentation)
(Option for accented background in tab interfaces)
(Option for completion framework aesthetics)
(Option for mail citations)
(Option for fringe visibility)
(Option for language checkers)
(Option for line highlighting (hl-line-mode))
(Option for line numbers (display-line-numbers-mode))
(Option for parenthesis matching (show-paren-mode))
(Option for active region)
(Option for diff buffer looks)
(Option for org-mode block styles)
(Option for Org agenda constructs)
(Option for scaled headings)
(Control the scale of headings)
(Option for variable-pitch font in UI elements)
(Option for variable-pitch font in headings): Write brief description,
document the type of the user option, and make any other relevant
adjustments.
(Option for font mixing): Document new 'modus-themes-mixed-fonts' user
option, which supersedes the old 'modus-themes-no-mixed-fonts'.
(Option for mode line padding): Document new user option
'modus-themes-mode-line-padding'.
(Option for language checkers): Include new available property for the
user option 'modus-themes-lang-checkers'. Reword the rest of the
entry.
(Option for intense markup in Org and others): Describe new boolean
option 'modus-themes-intense-markup'.
(Option for Org agenda constructs): Include new available property for
the 'event' key in the alist 'modus-themes-org-agenda'.
(Option for the headings' overall style): Describe the new style of
explicitly specifying an optional font weight other than the implied
bold.
(Font configurations for Org and others (DIY))
(Configure bold and italic faces (DIY)): Reword and clarify some
statements.
(Decrease mode line height (DIY)): Add new Do-It-Yourself section on
tweaking the mode line's :box attribute.
(Full support for packages or face groups): Include new packages.
(Acknowledgements): Update list of contributors to code, user
feedback, etc. Does not affect the status of copyright assignment.
(Meta): Update URLs to protesilaos.com (my website).
* etc/themes/modus-themes.el (modus-themes-variable-pitch)
(modus-themes-fixed-pitch, modus-themes-no-mixed-fonts): Reference the
new 'modus-themes-mixed-fonts' user option.
(modus-themes--headings-choice): Include new font weight styles.
(modus-themes-headings): Document the new feature of accepting an
explicit font weight.
(modus-themes-org-agenda): Document the refinements to the 'event' key
of the alist and the new 'varied' property it accepts.
(modus-themes-lang-checkers): Describe the new 'faint' property.
(modus-themes-mode-line-padding): Include new user option.
(modus-themes-intense-hl-line): Remove old-deprecated user option.
(modus-themes-intense-markup): Add new option.
(modus-themes-success-deuteranopia): Update doc string.
(modus-themes--fixed-pitch): Work with 'modus-themes-mixed-fonts'.
(modus-themes--lang-check): Update internal function to add the
'faint' property of 'modus-themes-lang-checkers'.
(modus-themes--markup): Add helper function.
(modus-themes--heading-weights): Private variable with available font
weights.
(modus-themes--heading-weight): New helper function to pick the
desired font weight.
(modus-themes--heading): Update helper function to implement the
aforementioned change to 'modus-themes-headings'.
(modus-themes--agenda-event): Update helper function to apply the new
styles of 'modus-themes-org-agenda'.
(modus-themes--mode-line-padding): Add helper function for
'modus-themes-mode-line-padding'.
(modus-themes--mode-line-attrs): Minor refinements.
(modus-themes-load-operandi, modus-themes-load-vivendi): Make these
functions interactive.
(modus-themes-faces): Update faces.
* etc/themes/modus-operandi-theme.el: Bump version number.
* etc/themes/modus-vivendi-theme.el: Same.
* * *
A detailed change log entry is available here:
<https://protesilaos.com/codelog/2021-11-18-modus-themes-1-7-0/>.
Signal an error for duplicated ERT tests (bug#51941)
Make `ert-deftest` fail with an error (in batch mode only) if an
existing test is redefined, because that is an easy mistake to make
and which leads to a test being discarded silently.
Revert VC-related prefix user options to previous values
* lisp/vc/smerge-mode.el (smerge-command-prefix):
* lisp/vc/pcvs.el (cvs-minor-mode-prefix):
* lisp/vc/diff-mode.el (diff-minor-mode-prefix): Revert to
previous values, as external packages rely on those values.
Fix `narrow-to-defun' in "async function" in js-mode
* lisp/progmodes/js.el (js--plain-method-re):
(js--function-prologue-beginning):
(js--ensure-cache): Allow "async" before "function" (bug#51926).
This makes `narrow-to-defun' work as expected.
Miha Rihtaršič [Wed, 17 Nov 2021 08:12:21 +0000 (09:12 +0100)]
Don't ignore restriction in indent-region-line-by-line
* lisp/indent.el (indent-according-to-mode): Don't widen if the new
optional argument is non-nil.
(indent-region): Explicitly widen before calling
indent-region-line-by-line.
(indent-region-line-by-line): Don't widen (bug#51892).
Emacs convention is that low-level functions should respect restriction
so that their callers can set restriction according to their needs. For
example, 'c-indent-region' is a lower-level function which respects the
current restriction and 'indent-region' is a higher-level user command
which sets the restriction for lower-level functions, it calls
"(widen)".
'indent-region-line-by-line' is a low-level function on a similar level
as 'c-indent-region'. This patch makes it respect the current
restriction instead of having it call "(widen)".
This commit gives warnings on builds --without-x.
Problem pointed out by Glenn Morris <rgm@gnu.org> in:
https://lists.gnu.org/r/emacs-devel/2021-11/msg01278.html
Eli Zaretskii [Wed, 17 Nov 2021 18:33:40 +0000 (20:33 +0200)]
Fix recent changes related to USABLE_SIGIO
* src/process.c (wait_reading_process_output) [WINDOWSNT]:
* src/keyboard.c (handle_async_input) [DOS_NT]: Ifdef away the
code that is not needed on MS-Windows. (Bug#50403) (Bug#51820)
Ken Brown [Wed, 17 Nov 2021 18:02:44 +0000 (13:02 -0500)]
Make process_pending_signals useful on systems without SIGIO
* src/keyboard.c (handle_async_input): Call gobble_input
unconditionally, not just if USABLE_SIGIO is defined. This makes
process_pending_signals do something useful on systems that have
to poll for input. (Bug#51820)
Ken Brown [Wed, 17 Nov 2021 16:55:39 +0000 (11:55 -0500)]
Avoid delays waiting for input on systems without SIGIO
* src/process.c (wait_reading_process_output) [!USABLE_SIGIO]: If
we're waiting for input, don't use a timeout of more than 25 msec
in the call to select. (Bug#50043)
Po Lu [Wed, 17 Nov 2021 12:31:41 +0000 (20:31 +0800)]
Don't draw xwidgets that have just been resized
This serves to eliminate the huge black bar displayed when the
offscreen widget has been resized (and as such the damage event
signal is sent), but the X window hasn't.
* src/xwidget.c (xv_do_draw): Don't draw xwidgets that have
just been resized.
(x_draw_xwidget_glyph_string)
(xwidget_init_view): Clear just_resized.
(Fxwidget_resize): Set just_resized first, then queue allocate.
* lisp/keymap.el (keymap-substitute): Make the keymap the first
parameter for symmetry with the other functions.
* lisp/emacs-lisp/shortdoc.el (keymaps):
* lisp/emacs-lisp/bytecomp.el (lambda): Adjust.
Stefan Kangas [Wed, 17 Nov 2021 06:59:00 +0000 (07:59 +0100)]
Temporarily mark two failing tests as unstable
* test/lisp/mh-e/mh-utils-tests.el
(mh-folder-completion-function-08-plus-slash)
(mh-folder-completion-function-09-plus-slash-tmp): Temporarily
mark two failing tests as unstable.