Eli Zaretskii [Tue, 4 Jan 2022 13:37:16 +0000 (15:37 +0200)]
A cleaner fix for display bug#52947
* src/xdisp.c (tab_bar_height, redisplay_tab_bar): Don't call
set_iterator_to_next here...
(display_tab_bar_line): ...call it here, even if we exit the loop
because we encounter a newline.
Po Lu [Tue, 4 Jan 2022 11:30:07 +0000 (19:30 +0800)]
Stop assuming X kbd state works with GDK when forwarding events to xwidgets
* src/xwidget.c (xw_translate_x_modifiers): New function.
(Fxwidget_perform_lispy_event): Translate X modifiers to GDK
modifiers before sending them to the xwidget.
Jim Porter [Mon, 3 Jan 2022 06:08:52 +0000 (22:08 -0800)]
Prevent further cases of duplicated separators in context menus
In some cases, context menu items are added before the overall prompt
string. This could cause multiple consecutive separators to appear if
they "surround" the prompt string. (Bug#52293)
* lisp/mouse.el (context-menu-map): Improve the de-duplication logic
to ignore non-menu-items when checking for consecutive separators.
* test/lisp/mouse-tests.el
(context-menu-map-remove-consecutive-separators)
(context-menu-map-remove-separators-at-beginning-or-end): New tests.
Po Lu [Tue, 4 Jan 2022 06:48:08 +0000 (06:48 +0000)]
Make menu bar key navigation work on Haiku
* src/haiku_support.cc (menu_bar_active_p): New variable.
(DispatchMessage): Pass through key events if the menu bar is
active.
(MenusBeginning, MenusEnd): Set `menu_bar_active_p' according
to the state of the menu bar.
(BMenuBar_delete): Clear `menu_bar_active_p'.
* src/haikufns.c (haiku_free_frame_resources): Block input only
after checking that F is a window system frame.
* src/haikumenu.c (Fhaiku_menu_bar_open): Update doc string.
Po Lu [Tue, 4 Jan 2022 05:22:56 +0000 (05:22 +0000)]
Find a way to make restacking frames work on Haiku
* doc/lispref/frames.texi (Raising and Lowering): Update
documentation to reflect that restacking frames is now
supported on Haiku.
* lisp/frame.el (haiku-frame-restack): New declaration.
(frame-restack): Use `haiku-frame-restack' on Haiku.
* src/haiku_support.cc (BWindow_send_behind):
* src/haiku_support.h (BWindow_send_behind):
* src/haikufns.c (Fhaiku_frame_restack): New functions.
(syms_of_haikufns): New subr `haiku-frame-restack'.
While we don't need to put docstrings of .elc files into etc/DOC,
we still need to put those of `loaddefs.el` there since we don't have
a "dynamic docstring" feature for the non-compiled files and keeping
the actual docstrings in the heap would be prohibitive.
Po Lu [Mon, 3 Jan 2022 10:16:06 +0000 (10:16 +0000)]
Implement AC line status for the Haiku battery function
* lisp/battery.el (battery--search-haiku-acpi-status): Return
`fully-charged' instead of `normal'.
(battery-haiku-acpi-battery): Implement %L for AC line status.
Stefan Kangas [Mon, 3 Jan 2022 08:02:29 +0000 (09:02 +0100)]
elide-head: Make GPL regexp more forgiving
* lisp/elide-head.el (elide-head-headers-to-hide): Make GPL regexp
more forgiving.
* test/lisp/elide-head-tests.el (elide-head--add-test): New macro.
(elide-head--test-headers-to-hide/gpl2-1)
(elide-head--test-headers-to-hide/gpl3-1)
(elide-head--test-headers-to-hide/gpl3-2)
(elide-head--test-headers-to-hide/gpl3-3)
(elide-head--test-headers-to-hide/gpl3-4): New tests.
Po Lu [Mon, 3 Jan 2022 07:39:18 +0000 (15:39 +0800)]
Add support for the Haiku ACPI battery driver
* lisp/battery.el (battery-status-function): Choose
`battery-haiku-acpi-battery' if the Haiku ACPI driver is
available.
(battery--search-haiku-acpi-status):
(battery-haiku-acpi-battery): New functions.
Stefan Kangas [Mon, 3 Jan 2022 03:59:03 +0000 (04:59 +0100)]
Silence byte-compiler in eieio tests
This is a temporary workaround for Bug#52971.
* test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
(eieio-compat)
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-compat):
Silence byte-compiler by wrapping require in with-no-warnings.
Po Lu [Mon, 3 Jan 2022 02:56:45 +0000 (10:56 +0800)]
Use XKB to find modifiers on x
* src/xterm.c (x_find_modifier_meanings): Look for virtual
modifiers with Xkb instead.
(handle_one_xevent): Add group when translating XI2 keycodes and
handle Xkb keymap events.
(x_term_init): Populate dpyinfo->xkb_event_type.
* src/xterm.h (struct x_display_info): New field
`xkb_event_type', and change modifier masks to `unsigned int'.
Stefan Kangas [Sun, 2 Jan 2022 22:27:16 +0000 (23:27 +0100)]
Move define-keymap and defvar-keymap to keymap.el
These functions deal with the "new" keymap binding interface, so they
belong in keymap.el rather than in subr.el.
* lisp/subr.el (define-keymap--compile, define-keymap)
(defvar-keymap): Move from here ...
* lisp/keymap.el (define-keymap--compile, define-keymap)
(defvar-keymap): ... to here.
Juri Linkov [Sun, 2 Jan 2022 18:00:40 +0000 (20:00 +0200)]
* lisp/tab-line.el: Revert part of the fix in a6adfe21e4 (bug#52881)
(tab-line--get-tab-property, tab-line-auto-hscroll): Use get-pos-property
instead of get-text-property that fails after previous-single-property-change.
Stefan Kangas [Sun, 2 Jan 2022 15:46:02 +0000 (16:46 +0100)]
New :type key for defcustom
As compared to the old type key-sequence that deals with raw key
sequences, this :type conforms to the format used by the new keymap-*
functions.
* lisp/wid-edit.el (key): New widget type. (Bug#52523)
(widget-key-prompt-value-history): New variable.
(widget-key-validate): New function.
(key-sequence): Doc fix.
* doc/lispref/customize.texi (Simple Types): Document above new type.
Don't fail flymake-tests if `gcc` actually is Clang
* test/lisp/progmodes/flymake-tests.el (flymake-tests--gcc-is-clang)
(different-diagnostic-types, included-c-header-files): Skip tests that
depend on the `gcc` command really being GCC and not Clang.
Stefan Kangas [Sun, 2 Jan 2022 05:31:44 +0000 (06:31 +0100)]
Merge from origin/emacs-28
efb1c7ec37 ; * admin/notes/years: More known problems. f475c5823a ; Copyright year fixes 2684def348 ; Run set-copyright from admin.el 2558b37b5e ; * admin/notes/years: Mention known problems with 'update...
Po Lu [Sun, 2 Jan 2022 02:37:21 +0000 (02:37 +0000)]
Fix mouse face problems when moving between two frames on Haiku
* src/haiku_support.cc (movement_locker): New locker.
(MouseMoved): Lock that locker.
(BWindow_new):
(BWindow_quit): Use LockLooper instead of Lock.
* src/haikuterm.c (haiku_read_socket): Clear mouse face if
a motion event is received for a frame other than the one
that is currently displaying the mouse face.
Eli Zaretskii [Sat, 1 Jan 2022 12:03:03 +0000 (07:03 -0500)]
Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years.
Po Lu [Sat, 1 Jan 2022 11:33:01 +0000 (19:33 +0800)]
Increase size of precision scrolling momentum ring
* lisp/pixel-scroll.el
(pixel-scroll-precision-initial-velocity-factor): Fix
calculation of last timestamp.
(pixel-scroll-precision):
(pixel-scroll-kinetic-state):
(pixel-scroll-accumulate-velocity):
(pixel-scroll-start-momentum):
(pixel-scroll-calculate-velocity): Increase default ring size
to 30.
Po Lu [Sat, 1 Jan 2022 10:29:44 +0000 (10:29 +0000)]
Make last change compile
* src/haiku_support.cc (EmacsShow): Fix last change.
(TearDownDoubleBuffering): Likewise.
(Draw): Draw normally if not double buffered even if shown_flag
is true.
Po Lu [Sat, 1 Jan 2022 09:56:14 +0000 (09:56 +0000)]
Fix some more off-by-one errors in Haiku image code
* src/haiku_draw_support.cc (BView_DrawBitmapWithEraseOp):
(BView_DrawMask):
(BBitmap_transform_bitmap):
* src/haiku_support.cc (AttachCairoSurface): Adjust calculations
to take account of BRect width and height functions returning
(start - end) instead of the actual width and height of the
rectangle.
Po Lu [Sat, 1 Jan 2022 09:33:15 +0000 (09:33 +0000)]
Fix deadlocks with invisible frames and threads in Haiku
* src/haiku_support.cc (class EmacsWindow): New field
`was_shown_p'.
(EmacsShow): Lock looper if the window wasn't ever visible.
(BWindow_new): Unlock window looper after creating it.
Po Lu [Fri, 31 Dec 2021 13:03:07 +0000 (13:03 +0000)]
On Haiku, sync a frames's connection to the app sever after raising
* src/haiku_support.h: (BWindow_sync)
* src/haiku_support.cc (BWindow_sync): New function.
* src/haikuterm.c (haiku_frame_raise_lower): Synchronize window
after raising it to avoid situations where raising windows is
done out-of-order, such as when ediff raises a frame.
Po Lu [Fri, 31 Dec 2021 09:31:27 +0000 (09:31 +0000)]
Use a single global lock for the child frame state on Haiku
Each BWindows (and various system callbacks) runs in a separate
thread, so there are very complicated locking semantics that
used to be handled manually. This changes child frame state to
use a single global lock, which makes things much easier.
* src/haiku_support.cc (child_frame_lock): New variable.
(class EmacsWindow):
(~EmacsWindow):
(Unparent):
(ParentTo):
(MoveChild):
(FrameMoved):
(EmacsHide):
(EmacsShow):
(GetParentWidthHeight):
(OffsetChildRect):
(MakeFullscreen):
(SetUpDoubleBuffering): Use a single lock for controlling access
to child frame state.
Stephen Berman [Fri, 31 Dec 2021 09:25:52 +0000 (10:25 +0100)]
Fix handling of webkit xwidget bookmarks
Make jumping to a bookmarked webkit xwidget in another window or
another frame show the xwidget only in that window or frame and
refactor new session code used by the bookmark code (bug#52856).
In addition, make xwidget-webkit-clone-* commands work.
* lisp/xwidget.el (xwidget-webkit-clone-and-split-below)
(xwidget-webkit-clone-and-split-right): Unbreak these functions by
passing just the URL to them, not the message displaying it.
(xwidget-webkit-bookmark-jump-new-session): Adjust doc string,
rephrasing and removing a customization suggestion that cannot
take effect.
(xwidget-webkit-bookmark-jump-handler): New autoloaded function.
(xwidget-webkit-bookmark-make-record): Use it.
(xwidget-webkit--create-new-session-buffer): New function
extracted from `xwidget-webkit-new-session'.
(xwidget-webkit-new-session): Use it.
Juri Linkov [Fri, 31 Dec 2021 09:20:51 +0000 (11:20 +0200)]
* lisp/tab-line.el (tab-line--get-tab-property): New function (bug#52881).
(tab-line-auto-hscroll): Use ‘tab-line--get-tab-property’ instead of
‘get-pos-property 1’, and ‘get-text-property’ instead of
‘get-pos-property’.
(tab-line-select-tab, tab-line-close-tab): Use tab-line--get-tab-property.