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.
Eli Zaretskii [Fri, 31 Dec 2021 08:56:28 +0000 (10:56 +0200)]
Minor improvements of 'lisp-directory' docs
* lisp/startup.el (lisp-directory):
* etc/NEWS:
* doc/lispref/loading.texi (Library Search): Improve wording of
documentation of 'lisp-directory' and related features.
Po Lu [Fri, 31 Dec 2021 07:29:30 +0000 (07:29 +0000)]
Prevent double buffering from being disabled on USE_BE_CAIRO builds
The direct rendering code used in that situation never
completely worked, and the BDirectWindow destructor is also
buggy. Completely remove that code in order to let us inherit
from BWindow, so as to prevent the buggy destructor from being
run.
* src/haiku_support.cc (cairo_format_from_color_space): Delete
function.
(class EmacsWindow): Inherit from BWindow.
(EmacsWindow): Call BWindow constructor instead.
(MessageReceived):
(DispatchMessage):
(FrameResized):
(FrameMoved):
(Zoom): Call BWindow functions instead.
(EmacsView_cairo_surface): Stop looking for surfaces in the
window.
(EmacsWindow_begin_cr_critical_section):
(EmacsWindow_end_cr_critical_section): Stop locking the window.
* src/haikufns.c (haiku_set_inhibit_double_buffering): Always
enable double buffering on Cairo builds.
Stefan Monnier [Fri, 31 Dec 2021 04:17:45 +0000 (23:17 -0500)]
Don't store docstrings of preloaded .el files in etc/DOC
Since the location of those files changes between build time and
installation time, this requires to tweak the file name used in those
(#$ . NNN) references during the dump so they don't hardcode the build
directory. We do it in the same way as was already done for those
same file names in `load-history`, except we convert them back to
absolute file names more lazily (i.e. when fetching the actual
docstring rather than at startup), which requires remembering the
`lisp-dir` computed at startup in the new `lisp-directory` variable.
* src/Makefile.in ($(etc)/DOC): Don't scan Lisp files any more.
* src/lread.c (Fload): Use relative file names for `load-file-name`
when preloading for the dump, like we already did for `current-load-list`.
(read_list): Don't zero-out dynamic docstring references during the
preload since they won't be filled later by Snarf-documentation any more.
(read1): Remove the hash-hack for doc references that were zeroed.
* lisp/startup.el (lisp-directory): New variable.
(command-line): Set it.
* src/doc.c (get_doc_string): Use `lisp-directory` for dynamic
docstring references using relative file names.
(syms_of_doc): Add `Qlisp_directory`.
* lib-src/make-docfile.c (scan_file): Don't handle `.el` or `.elc`
files any more.
(IS_SLASH): Remove macro, not used any more.
(skip_white, read_lisp_symbol, search_lisp_doc_at_eol)
(scan_lisp_file): Remove functions, not used any more.
Po Lu [Fri, 31 Dec 2021 02:07:30 +0000 (10:07 +0800)]
Add pinch event support to xwidgets
* src/xterm.c (handle_one_xevent): Pass through pinch events to
xwidgets and provide root coordinates when translating motion
events.
* src/xwidget.c (xwidget_motion_notify): Use provided root
window coordinates.
(xwidget_pinch): New function.
* src/xwidget.h (xwidget_motion_notify): Update prototype.
(xwidget_pinch): New function prototype.
Po Lu [Fri, 31 Dec 2021 01:27:12 +0000 (09:27 +0800)]
Restore original xwidget embedder after performing a lispy event
* src/xwidget.c (Fxwidget_perform_lispy_event): Restore original
embedder after performing event.
(Fdelete_xwidget_view): Block input around non-reentrant
section.
Eli Zaretskii [Thu, 30 Dec 2021 18:28:58 +0000 (20:28 +0200)]
Avoid assertion violations with variable-weight fonts
* src/font.c (font_score, font_delete_unmatched): Don't assume
weight, slant, and width properties of the font must be fixnums:
some variable-weight fonts violate that assumption. Reported
by Sean Whitton <spwhitton@spwhitton.name>. Do not merge to
master. (Bug#52888)
Philipp Stephani [Thu, 30 Dec 2021 15:59:16 +0000 (16:59 +0100)]
Properly report errors about unbound ERT test symbols.
Assertions should only be used to check internal consistency within a
package, not to check arguments passed by callers. Instead, define
and use a new error symbol.
* lisp/emacs-lisp/ert.el (ert-test-unbound): New error symbol.
(ert-select-tests): Use it.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-select-undefined): New
unit test.
Eli Zaretskii [Thu, 30 Dec 2021 14:44:13 +0000 (16:44 +0200)]
Fix multisession-tests on MS-Windows
* test/lisp/emacs-lisp/multisession-tests.el
(multi-test-files-simple): On MS-Windows and Haiku, wait before
invoking the Emacs sub-process, not after, to ensure the later
update is detected with 1-sec file time resolution.
Alan Mackenzie [Thu, 30 Dec 2021 11:32:25 +0000 (11:32 +0000)]
CC Mode: Prevent rapid alternation of fontification of "found types"
This fixes bug #52863.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): When a new type is
found, postpone entering it into c-found-types (and thus triggering the
fontification of that type throughout the buffer) until the end of the
function, when we're sure that the "type" found actually is a type.
Eli Zaretskii [Thu, 30 Dec 2021 11:21:01 +0000 (13:21 +0200)]
Fix start-of-box-face display after display and overlay strings
* src/xdisp.c (pop_it): Recompute the 'start_of_box_run_p' flag,
like we do in 'handle_fontified_prop', when faces change while
iterating over a buffer or string. (Bug#51550)
Po Lu [Thu, 30 Dec 2021 07:04:18 +0000 (15:04 +0800)]
Make xwidget motion commands hscroll the window of wide widgets
* lisp/xwidget.el (xwidget-info): New function declaration.
(xwidget-webkit-scroll-forward):
(xwidget-webkit-scroll-backward): Hscroll the window if the
widget is wider than the text area. (bug#52885)
* src/xwidget.c (xwidget_scroll, xwidget_motion_notify): Apply
clip offsets to coordinates.
Po Lu [Thu, 30 Dec 2021 02:04:29 +0000 (10:04 +0800)]
Use XRandR 1.5 to generate monitor attributes if available
* src/xfns.c (x_get_monitor_attributes_xrandr): Use XRR 1.5 if
present.
(xlw_monitor_dimensions_at_pos_1): Remove redundant XRR 1.5
code.
(xlw_monitor_dimensions_at_pos): Rely on
`x_get_monitor_attributes_xrandr' to retrieve the workarea
instead.
Juri Linkov [Wed, 29 Dec 2021 18:52:11 +0000 (20:52 +0200)]
* lisp/textmodes/sgml-mode.el (sgml-mode): Set skeleton-end-newline to nil.
Prevent skeleton.el from adding a newline to each inserted
skeleton. Those which do want a newline do that explicitly in
their define-skeleton form. This is what texinfo-mode does (bug#52864).