* lisp/help-fns.el (describe-mode--minor-modes): New function
(bug#2473).
(describe-mode): Rewritten to include local minor mode links first,
then the major mode, and then global minor mode links, and then
all the minor modes.
Po Lu [Wed, 13 Apr 2022 00:47:00 +0000 (00:47 +0000)]
Fix freezes when trying to accelerate menu bar on Haiku
* src/haiku_support.cc (class EmacsWindow): New field
`menus_begun'.
(MenusBeginning): Don't send menu bar open events when that is
set, instead set it to true.
(BMenuBar_start_tracking): Stop locking the menu bar here and
send a special BE_MENU_BAR_OPEN event instead.
* src/haiku_support.h (struct haiku_menu_bar_state_event):
Delete field `no_lock'.
* src/haikumenu.c (Fhaiku_menu_bar_open):
* src/haikuterm.c (haiku_read_socket): Update accordingly.
* src/image.c (svg_load_image): Don't include the spec in the
error message, because this is commonly the entire SVG string, and
this will fill up the *Messages* buffer quickly.
Sean Whitton [Tue, 12 Apr 2022 15:59:22 +0000 (17:59 +0200)]
Fix eager macroexpansion cycle in cl-once-only
* lisp/emacs-lisp/cl-macs.el (cl-once-only): Use different cl-loop
syntax, with no functional change, but such that the loop does not
expand into cl-psetq.
Po Lu [Tue, 12 Apr 2022 13:29:02 +0000 (21:29 +0800)]
Fix keyboard event device attribution on GTK+ 2
* src/xfns.c (setup_xi_event_mask): Select for raw keypress
events on GTK 2.
* src/xterm.c (handle_one_xevent): Set pending keystroke time
when a raw event is received.
* src/xterm.h (struct x_display_info): New flag
`pending_keystroke_time_special_p'.
Po Lu [Tue, 12 Apr 2022 08:36:42 +0000 (16:36 +0800)]
Disallow drag and drop inside a menu-entry
* src/xterm.c (x_dnd_cleanup_drag_and_drop): Always free DND
targets even if waiting for finish.
(x_dnd_begin_drag_and_drop): Free targets correctly when
signalling error and prevent activating drag-and-drop inside a
menu or popup. (It doesn't work.)
process-attributes-ps-args / process-attributes-ps-format for Darwin
* lisp/net/tramp-integration.el
(tramp-darwin-process-attributes-ps-args)
(tramp-darwin-process-attributes-ps-format)
(tramp-connection-local-darwin-ps-variables): New defconsts. Add
them to connection-local variables. Preset default "ps" profile
for Darwin.
Juri Linkov [Mon, 11 Apr 2022 16:51:49 +0000 (19:51 +0300)]
* lisp/minibuffer.el (minibuffer-completion-auto-choose): New defcustom.
(minibuffer-choose-previous-completion)
(minibuffer-choose-next-completion): Remove commands.
(minibuffer-local-completion-map): Remove keybindings of
minibuffer-choose-next-completion and minibuffer-choose-previous-completion.
Use them for minibuffer-next-completion and minibuffer-previous-completion.
* lisp/simple.el (minibuffer-local-shell-command-map): Idem.
* src/image.c (gif_load): Invert the way animated pixmaps are
created: Work on the cached computed-so-far pixmap, and then copy
the entire thing to the ximg with PUT_PIXEL at the end. This
should work across platforms, which the previous version didn't.
Recognise hybrid IPv6/IPv4 addresses in textsec (bug#54624)
* lisp/international/textsec.el (textsec--ipvx-address-p):
Recognise hybrid addresses like "::ffff:129.55.2.201".
Combine to a single regexp and translate to rx.
Remove some regexp ambiguity (relint complaint).
* test/lisp/international/textsec-tests.el (test-suspiction-domain):
Add test cases.
* src/image.c (anim_prune_animation_cache): Tweak the destructor
API.
(gif_destroy): New function.
(gif_load): Use a cache to avoid quadratic CPU usage for animated
images (bug#45224).
(webp_destroy): New function.
(webp_load): Use it.
Refactor the webp cache code to allow usage by gif_load, too
* src/image.c (struct anim_cache, anim_create_cache)
(anim_prune_animation_cache, anim_get_animation_cache): Rename
from webp_cache (etc) to prepare for usage in the gif animation
implementation, too.
(webp_load): Adjust cache usage.
Po Lu [Mon, 11 Apr 2022 07:45:37 +0000 (07:45 +0000)]
Always cascade from toplevel frames on Haiku
* src/haikufns.c (haiku_create_frame): Cascade from toplevel
frames, since otherwise the positions are wrong anyway, and it
doesn't make sense to cascade from a frame that disappears when
it becomes deactivated.
Po Lu [Mon, 11 Apr 2022 04:25:51 +0000 (12:25 +0800)]
Fix IM event source attribution on GTK
* src/xterm.c (handle_one_xevent): Set pending times on GTK as
well.
* src/gtkutil.c (xg_widget_key_press_event_cb): Respect pending
keystroke time on XI2.
Augusto Stoffel [Sat, 9 Apr 2022 10:47:28 +0000 (12:47 +0200)]
Add lazy highlight when reading 'query-replace' arguments
* lisp/replace.el (query-replace-read-args): Use
'minibuffer-lazy-highlight-setup' to highlight the text to be replaced
in the original buffer (and a match count, if applicable).
(replace--region-filter): New function for code that
used to be inlined in perform-replace but is useful elsewhere.
(perform-replace): Use 'replace--region-filter'.
Augusto Stoffel [Sat, 9 Apr 2022 10:38:14 +0000 (12:38 +0200)]
Rewrite the minibuffer lazy highlight feature
The new API was discussed in bug#53126. It's more robust and easier
to use in complex cases like that of 'query-replace'.
* etc/NEWS: Amend the feature announcement
* lisp/isearch.el (isearch-edit-string): Use new API.
(minibuffer-lazy-highlight-transform,
minibuffer-lazy-highlight--overlay, minibuffer-lazy-highlight--count,
minibuffer-lazy-highlight--after-change,
minibuffer-lazy-highlight--exit) Remove helper functions, which are
now kept together with the lazy highlight configuration variables
within a closure.
(minibuffer-lazy-highlight-setup): This function now takes the lazy
highlighting configuration variables as argument, and returns a
closure that is intended to run as part of the minibuffer setup.
Eli Zaretskii [Sun, 10 Apr 2022 13:45:43 +0000 (16:45 +0300)]
Fix WebP image support on MS-Windows
* src/image.c (init_webp_functions) [WINDOWSNT]: Load Demux
functions from the WebPDemux DLL. Load internal functions where
the public APIs are inline functions defined in the WebP headers.
(WebPAnimDecoderOptionsInit) [WINDOWSNT]: Define to call
'WebPAnimDecoderOptionsInitInternal'.
(WebPDemux): Define to call 'WebPDemuxInternal'.
(WebPAnimDecoderNew): Define to call
'WebPAnimDecoderNewInternal'.
(syms_of_image) <webpdemux>: New symbol.
* lisp/term/w32-win.el (dynamic-library-alist): Add a member for
'webpdemux'.
Po Lu [Sun, 10 Apr 2022 11:33:51 +0000 (19:33 +0800)]
Attribute filtered events to the right source device
* src/xterm.c (handle_one_xevent): Attribute core events sent by
input methods like I-Bus to the extension device that caused
them to be sent.
* src/xterm.h (struct x_display_info): New fields
`pending_keystroke_time' and `pending_keystroke_source'.
* configure.ac (HAVE_RSVG): Also include the webpdemux library.
It was new in version 0.4.4, and we require 0.6.0, so it should be
safe.
* src/image.c: Include demux.h.
(enum webp_keyword_index, webp_format): Include :index for
animations.
(init_webp_functions): Add Windows LOAD_DLLs.
(struct webp_cache, webp_create_cache)
(webp_prune_animation_cache, webp_get_animation_cache): New
functions.
(webp_load): Support animated webp images (bug#54242).
Po Lu [Sun, 10 Apr 2022 01:31:24 +0000 (09:31 +0800)]
Try harder to own DND selections
* src/xterm.c (x_dnd_do_unsupported_drop): Fix computation of
local value.
(x_dnd_begin_drag_and_drop): Try to own the selection if we do
have a local value.
Po Lu [Sat, 9 Apr 2022 05:30:32 +0000 (13:30 +0800)]
Handle hierarchy events for updating scroll valuators correctly
* src/keyboard.c (gen_help_event, kbd_buffer_store_help_event):
Make sure to initialize the event buffer correctly.
* src/xterm.c (xi_populate_device_from_info): New function.
(x_init_master_valuators): Factor out most of the valuator
tracking code to that function.
(handle_one_xevent): Handle device enable and disable events in
a more detailed fashion.
Po Lu [Sat, 9 Apr 2022 03:35:08 +0000 (11:35 +0800)]
Minor cleanups in X Windows drag-and-drop code
* src/keyboard.c (kbd_buffer_get_event): Don't dereference f if
nil when generating mouse motion event.
* src/xterm.c (x_dnd_send_enter, x_dnd_send_position)
(x_dnd_send_leave, x_dnd_send_drop, x_send_scroll_bar_event):
Use NoEventMask instead of 0.
Po Lu [Sat, 9 Apr 2022 01:02:24 +0000 (09:02 +0800)]
Clean up XI2 scroll valuator tracking code
* src/xterm.c (x_get_scroll_valuator_delta): Accept a pointer to
a device instead of the device id.
(handle_one_xevent): Pass the previously found device.
Po Lu [Sat, 9 Apr 2022 00:41:00 +0000 (08:41 +0800)]
Fix subpixel AA with alpha-background on Cairo on X
* xterm.c (x_set_cr_source_with_gc_foreground)
(x_set_cr_source_with_gc_background): Set operator back to OVER
if alpha-background isn't to be respected.
Alan Third [Wed, 30 Mar 2022 21:40:03 +0000 (22:40 +0100)]
Fix scrollbars on macOS 10.13 and below (bug#54623)
Make any build on macOS 10.13 and below follow the same drawing path
as the GNUstep port. macOS 10.14 and above will use EmacsLayer.
* src/nsterm.h (EmacsLayer):
* src/nsterm.m ([EmacsView makeBackingLayer]):
([EmacsView unlockFocus]):
([EmacsView windowDidChangeBackingProperties:]):
([EmacsView copyRect:to:]): Remove any code required for macOS 10.13
and below, and fix the #if's to enforce strict separation of the
drawing paths.
(ns_update_end):
(ns_unfocus): Fix #ifs so that flushWindow is called on old macOS
versions as well as GNUstep.
Enable warnings when building as a developer with Clang
The configure-script logic that automatically enables warnings when
building in a development tree didn't work for Clang because it was
identified as an old GCC version.
* configure.ac: Don't test Clang version as if it were GCC.
Po Lu [Fri, 8 Apr 2022 10:50:48 +0000 (18:50 +0800)]
Interpolate scrolls coming from mice by default
* lisp/pixel-scroll.el
(pixel-scroll-precision-interpolate-mice): New
user option.
(pixel-scroll-precision): If the class of the last event device
is `mouse', interpolate the next scroll.
Po Lu [Fri, 8 Apr 2022 00:13:49 +0000 (08:13 +0800)]
Make device reporting work for tool bar clicks
* src/dispextern.h: Update prototyupes.
* src/xdisp.c (handle_tool_bar_click): Pass Qt to that function
instead.
(handle_tool_bar_click_with_device): New function.
* src/xterm.c (handle_one_xevent): Pass device to tool bar click
logic.