commit 6094f3a16bc55a52215ed39507bc08e606629d78 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Thu Feb 17 13:34:01 2022 +0800 * src/xterm.c (x_init_master_valuators): Clear `pending_enter_reset'. diff --git a/src/xterm.c b/src/xterm.c index b0d3adca0e..e3e67f23c6 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -643,6 +643,7 @@ x_init_master_valuators (struct x_display_info *dpyinfo) valuator->emacs_value = DBL_MIN; valuator->increment = info->increment; valuator->number = info->number; + valuator->pending_enter_reset = false; break; } commit 5df33cfcaf379455857f2aefa5ca0ab39cb9fc6f Author: Po Lu Date: Thu Feb 17 13:25:01 2022 +0800 Improve handling of XI2 wheel movement * src/xterm.c (handle_one_xevent): Process movement in all directions and send it as a single event. diff --git a/src/xterm.c b/src/xterm.c index 57e06f6c7e..b0d3adca0e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10968,13 +10968,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, case XI_Motion: { struct xi_device_t *device; - bool touch_end_event_seen = false; states = &xev->valuators; values = states->values; device = xi_device_from_id (dpyinfo, xev->deviceid); - if (!device || !device->master_p) + if (!device) goto XI_OTHER; #ifdef XI_TouchBegin @@ -10988,6 +10987,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, double xv_total_x = 0.0; double xv_total_y = 0.0; #endif + double total_x = 0.0; + double total_y = 0.0; for (int i = 0; i < states->mask_len * 8; i++) { @@ -11029,7 +11030,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, } #endif - found_valuator = true; + if (delta == 0.0) + found_valuator = true; if (signbit (delta) != signbit (val->emacs_value)) val->emacs_value = 0; @@ -11041,26 +11043,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, && (fabs (delta) > 0)) continue; - bool s = signbit (val->emacs_value); - inev.ie.kind = (fabs (delta) > 0 - ? (val->horizontal - ? HORIZ_WHEEL_EVENT - : WHEEL_EVENT) - : TOUCH_END_EVENT); - inev.ie.timestamp = xev->time; - - XSETINT (inev.ie.x, lrint (xev->event_x)); - XSETINT (inev.ie.y, lrint (xev->event_y)); - XSETFRAME (inev.ie.frame_or_window, f); - - if (fabs (delta) > 0) - { - inev.ie.modifiers = !s ? up_modifier : down_modifier; - inev.ie.modifiers - |= x_x_to_emacs_modifiers (dpyinfo, - xev->mods.effective); - } - window = window_from_coordinates (f, xev->event_x, xev->event_y, NULL, false, false); @@ -11078,40 +11060,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (NUMBERP (Vx_scroll_event_delta_factor)) scroll_unit *= XFLOATINT (Vx_scroll_event_delta_factor); - if (fabs (delta) > 0) - { - if (val->horizontal) - { - inev.ie.arg - = list3 (Qnil, - make_float (val->emacs_value - * scroll_unit), - make_float (0)); - } - else - { - inev.ie.arg = list3 (Qnil, make_float (0), - make_float (val->emacs_value - * scroll_unit)); - } - } + if (val->horizontal) + total_x += delta * scroll_unit; else - { - inev.ie.arg = Qnil; - } - - if (inev.ie.kind != TOUCH_END_EVENT - || !touch_end_event_seen) - { - kbd_buffer_store_event_hold (&inev.ie, hold_quit); - touch_end_event_seen = inev.ie.kind == TOUCH_END_EVENT; - } + total_y += delta * scroll_unit; + found_valuator = true; val->emacs_value = 0; } } - - inev.ie.kind = NO_EVENT; } #ifdef HAVE_XWIDGETS @@ -11141,15 +11098,51 @@ handle_one_xevent (struct x_display_info *dpyinfo, goto XI_OTHER; } -#endif - if (found_valuator) + else { +#endif + if (found_valuator) + { + if (fabs (total_x) > 0 || fabs (total_y) > 0) + { + inev.ie.kind = (fabs (total_y) >= fabs (total_x) + ? WHEEL_EVENT : HORIZ_WHEEL_EVENT); + inev.ie.timestamp = xev->time; + + XSETINT (inev.ie.x, lrint (xev->event_x)); + XSETINT (inev.ie.y, lrint (xev->event_y)); + XSETFRAME (inev.ie.frame_or_window, f); + + inev.ie.modifiers = (signbit (fabs (total_y) >= fabs (total_x) + ? total_y : total_x) + ? down_modifier : up_modifier); + inev.ie.modifiers + |= x_x_to_emacs_modifiers (dpyinfo, + xev->mods.effective); + inev.ie.arg = list3 (Qnil, + make_float (total_x), + make_float (total_y)); + #ifdef USE_GTK - if (f && xg_event_is_for_scrollbar (f, event)) - *finish = X_EVENT_DROP; + if (f && xg_event_is_for_scrollbar (f, event)) + *finish = X_EVENT_DROP; #endif - goto XI_OTHER; + } + else + { + inev.ie.kind = TOUCH_END_EVENT; + inev.ie.timestamp = xev->time; + + XSETINT (inev.ie.x, lrint (xev->event_x)); + XSETINT (inev.ie.y, lrint (xev->event_y)); + XSETFRAME (inev.ie.frame_or_window, f); + } + + goto XI_OTHER; + } +#ifdef HAVE_XWIDGETS } +#endif ev.x = lrint (xev->event_x); ev.y = lrint (xev->event_y); commit 99d6536c326a4df3bfb964f421edc2a005deb851 Author: Po Lu Date: Thu Feb 17 02:32:55 2022 +0000 Fix SIGFPE on some fonts when calculating their average width on Haiku * src/haiku_font_support.cc (estimate_font_ascii): Avoid divison by zero. diff --git a/src/haiku_font_support.cc b/src/haiku_font_support.cc index 3930cd965f..549c54d864 100644 --- a/src/haiku_font_support.cc +++ b/src/haiku_font_support.cc @@ -68,7 +68,11 @@ estimate_font_ascii (BFont *font, int *max_width, *min_width = min; *max_width = max; - *avg_width = total / count; + + if (count) + *avg_width = total / count; + else + *avg_width = 0; } void commit 74c07733698b95eb455edcafab8634a700a3194f Author: Po Lu Date: Thu Feb 17 10:28:02 2022 +0800 * src/emacsgtkfixed.c (XSetWMSizeHints): Improve fix for bug#8919. diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index a38ba35ad8..cd5d1d1435 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c @@ -164,11 +164,30 @@ XSetWMSizeHints (Display *d, if ((hints->flags & PMinSize) && f) { - int w = f->output_data.x->size_hints.min_width; - int h = f->output_data.x->size_hints.min_height; - - data[5] = w; - data[6] = h; + /* Overriding the size hints with our own values of min_width + and min_height used to work, but these days just results in + frames resizing unpredictably and emitting GTK warnings while + Emacs fights with GTK over the size of the frame. So instead + of doing that, just respect the hints set by GTK, but make + sure they are an integer multiple of the resize increments so + that bug#8919 stays fixed. */ + + /* int w = f->output_data.x->size_hints.min_width; + int h = f->output_data.x->size_hints.min_height; + + data[5] = w; + data[6] = h; */ + + /* Make sure min_width and min_height are multiples of width_inc + and height_inc. */ + + if (hints->flags & PResizeInc) + { + if (data[5] % hints->width_inc) + data[5] += (hints->width_inc - (data[5] % hints->width_inc)); + if (data[6] % hints->height_inc) + data[6] += (hints->height_inc - (data[6] % hints->height_inc)); + } } XChangeProperty (d, w, prop, XA_WM_SIZE_HINTS, 32, PropModeReplace, commit e14317eec4461e86a93906973ff99527e7dfa4df Author: Po Lu Date: Thu Feb 17 01:26:14 2022 +0000 Don't auto-lower when moving onto a menu bar on Haiku * src/haiku_io.c (haiku_len): Handle `MENU_BAR_LEFT'. * src/haiku_support.cc (EmacsMenuBar::MouseMoved): New function. * src/haiku_support.h (enum haiku_event_type): New event `MENU_BAR_LEFT'. (struct haiku_menu_bar_left_event): New structure. * src/haikuterm.c (haiku_read_socket): Don't auto-lower when the mouse exits the frame view onto the menu bar and handle MENU_BAR_LEFT events. diff --git a/src/haiku_io.c b/src/haiku_io.c index f47ba00d5f..cade69f338 100644 --- a/src/haiku_io.c +++ b/src/haiku_io.c @@ -96,6 +96,8 @@ haiku_len (enum haiku_event_type type) return sizeof (struct haiku_app_quit_requested_event); case DUMMY_EVENT: return sizeof (struct haiku_dummy_event); + case MENU_BAR_LEFT: + return sizeof (struct haiku_menu_bar_left_event); } emacs_abort (); diff --git a/src/haiku_support.cc b/src/haiku_support.cc index ced680d2e5..eb78afc6cb 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -1169,6 +1169,27 @@ class EmacsMenuBar : public BMenuBar haiku_write (MENU_BAR_RESIZE, &rq); BMenuBar::FrameResized (newWidth, newHeight); } + + void + MouseMoved (BPoint point, uint32 transit, const BMessage *msg) + { + struct haiku_menu_bar_left_event rq; + + if (transit == B_EXITED_VIEW) + { + rq.x = std::lrint (point.x); + rq.y = std::lrint (point.y); + rq.window = this->Window (); + + if (movement_locker.Lock ()) + { + haiku_write (MENU_BAR_LEFT, &rq); + movement_locker.Unlock (); + } + } + + BMenuBar::MouseMoved (point, transit, msg); + } }; class EmacsView : public BView diff --git a/src/haiku_support.h b/src/haiku_support.h index c9035d3dc0..67fbd8c5e0 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -87,7 +87,8 @@ enum haiku_event_type ZOOM_EVENT, REFS_EVENT, APP_QUIT_REQUESTED_EVENT, - DUMMY_EVENT + DUMMY_EVENT, + MENU_BAR_LEFT }; struct haiku_quit_requested_event @@ -160,6 +161,12 @@ struct haiku_mouse_motion_event bigtime_t time; }; +struct haiku_menu_bar_left_event +{ + void *window; + int x, y; +}; + struct haiku_button_event { void *window; diff --git a/src/haikuterm.c b/src/haikuterm.c index f4e2452a6c..f0361c9dbe 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2726,6 +2726,23 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) XSETFRAME (inev.frame_or_window, f); } + break; + } + case MENU_BAR_LEFT: + { + struct haiku_menu_bar_left_event *b = buf; + struct frame *f = haiku_window_to_frame (b->window); + + if (!f) + continue; + + if (b->y > 0 && b->y <= FRAME_PIXEL_HEIGHT (f) + && b->x > 0 && b->x <= FRAME_PIXEL_WIDTH (f)) + break; + + if (f->auto_lower && !popup_activated_p) + haiku_frame_raise_lower (f, 0); + break; } case MOUSE_MOTION: @@ -2776,7 +2793,16 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) } if (f->auto_lower && !popup_activated_p) - haiku_frame_raise_lower (f, 0); + { + /* If we're leaving towards the menu bar, don't + auto-lower here, and wait for a exit + notification from the menu bar instead. */ + if (b->x > FRAME_PIXEL_WIDTH (f) + || b->y >= FRAME_MENU_BAR_HEIGHT (f) + || b->x < 0 + || b->y < 0) + haiku_frame_raise_lower (f, 0); + } haiku_new_focus_frame (x_display_list->focused_frame); commit 9780972a443d2485cb51ea35d699614ce33cf914 Author: Po Lu Date: Thu Feb 17 01:25:24 2022 +0000 Handle `unspecified' values of symbolic font values on Haiku * src/haikufont.c (haikufont_spec_or_entity_to_pattern): Handle `unspecified' values of symbolic values. diff --git a/src/haikufont.c b/src/haikufont.c index e9e788e8e8..5099285f10 100644 --- a/src/haikufont.c +++ b/src/haikufont.c @@ -440,35 +440,35 @@ haikufont_spec_or_entity_to_pattern (Lisp_Object ent, } tem = FONT_SLANT_SYMBOLIC (ent); - if (!NILP (tem)) + if (!NILP (tem) && !EQ (tem, Qunspecified)) { ptn->specified |= FSPEC_SLANT; ptn->slant = haikufont_lisp_to_slant (tem); } tem = FONT_WEIGHT_SYMBOLIC (ent); - if (!NILP (tem)) + if (!NILP (tem) && !EQ (tem, Qunspecified)) { ptn->specified |= FSPEC_WEIGHT; ptn->weight = haikufont_lisp_to_weight (tem); } tem = FONT_WIDTH_SYMBOLIC (ent); - if (!NILP (tem)) + if (!NILP (tem) && !EQ (tem, Qunspecified)) { ptn->specified |= FSPEC_WIDTH; ptn->width = haikufont_lisp_to_width (tem); } tem = AREF (ent, FONT_SPACING_INDEX); - if (FIXNUMP (tem)) + if (!NILP (tem) && !EQ (tem, Qunspecified)) { ptn->specified |= FSPEC_SPACING; ptn->mono_spacing_p = XFIXNUM (tem) != FONT_SPACING_PROPORTIONAL; } tem = AREF (ent, FONT_FAMILY_INDEX); - if (!NILP (tem) && + if (!NILP (tem) && !EQ (tem, Qunspecified) && (list_p && !haikufont_maybe_handle_special_family (tem, ptn))) { ptn->specified |= FSPEC_FAMILY; commit 8737d79be8f82bb12ca12dc1a7de37a4d2875f39 Author: Michael Albinus Date: Wed Feb 16 20:22:45 2022 +0100 Fix problem with file-modification-time in tramp-sshfs.el * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist): * lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist): Use `tramp-handle-file-notify-add-watch', `tramp-handle-file-notify-rm-watch' and `tramp-handle-file-notify-valid-p'. (tramp-sshfs-handle-write-region): Set file modification time. (Bug#54016) * test/lisp/net/tramp-tests.el (tramp--test-asynchronous-processes-p): Filter out tramp-adb on multi-byte `default-directory'. (tramp--test-hpux-p, tramp--test-macos-p): Protect against errors. (tramp--test-check-files): Discriminate also tramp-sshfs.el. diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index 2a6db03672..47c707451e 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -193,9 +193,9 @@ If NAME doesn't belong to a crypted remote directory, retun nil." ;; `file-name-nondirectory' performed by default handler. ;; `file-name-sans-versions' performed by default handler. (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) - (file-notify-add-watch . ignore) - (file-notify-rm-watch . ignore) - (file-notify-valid-p . ignore) + (file-notify-add-watch . tramp-handle-file-notify-add-watch) + (file-notify-rm-watch . tramp-handle-file-notify-rm-watch) + (file-notify-valid-p . tramp-handle-file-notify-valid-p) (file-ownership-preserved-p . tramp-crypt-handle-file-ownership-preserved-p) (file-readable-p . tramp-crypt-handle-file-readable-p) (file-regular-p . tramp-handle-file-regular-p) diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 259e85a04a..32ec19bf23 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -107,9 +107,9 @@ (file-name-nondirectory . tramp-handle-file-name-nondirectory) ;; `file-name-sans-versions' performed by default handler. (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) - (file-notify-add-watch . ignore) - (file-notify-rm-watch . ignore) - (file-notify-valid-p . ignore) + (file-notify-add-watch . tramp-handle-file-notify-add-watch) + (file-notify-rm-watch . tramp-handle-file-notify-rm-watch) + (file-notify-valid-p . tramp-handle-file-notify-valid-p) (file-ownership-preserved-p . ignore) (file-readable-p . tramp-rclone-handle-file-readable-p) (file-regular-p . tramp-handle-file-regular-p) diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el index 40c02ccea0..d30c19436d 100644 --- a/lisp/net/tramp-sshfs.el +++ b/lisp/net/tramp-sshfs.el @@ -108,9 +108,9 @@ (file-name-nondirectory . tramp-handle-file-name-nondirectory) ;; `file-name-sans-versions' performed by default handler. (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) - (file-notify-add-watch . ignore) - (file-notify-rm-watch . ignore) - (file-notify-valid-p . ignore) + (file-notify-add-watch . tramp-handle-file-notify-add-watch) + (file-notify-rm-watch . tramp-handle-file-notify-rm-watch) + (file-notify-valid-p . tramp-handle-file-notify-valid-p) (file-ownership-preserved-p . ignore) (file-readable-p . tramp-handle-file-readable-p) (file-regular-p . tramp-handle-file-regular-p) @@ -389,6 +389,12 @@ arguments to pass to the OPERATION." start end (tramp-fuse-local-file-name filename) append 'nomessage) (tramp-flush-file-properties v localname)) + ;; Set file modification time. + (when (or (eq visit t) (stringp visit)) + (set-visited-file-modtime + (or (file-attribute-modification-time (file-attributes filename)) + (current-time)))) + ;; Unlock file. (when file-locked ;; `unlock-file' exists since Emacs 28.1. diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 7fbe541270..797804dfd4 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -100,9 +100,9 @@ See `tramp-actions-before-shell' for more info.") (file-name-nondirectory . tramp-handle-file-name-nondirectory) ;; `file-name-sans-versions' performed by default handler. (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) - (file-notify-add-watch . ignore) - (file-notify-rm-watch . ignore) - (file-notify-valid-p . ignore) + (file-notify-add-watch . tramp-handle-file-notify-add-watch) + (file-notify-rm-watch . tramp-handle-file-notify-rm-watch) + (file-notify-valid-p . tramp-handle-file-notify-valid-p) (file-ownership-preserved-p . ignore) (file-readable-p . tramp-sudoedit-handle-file-readable-p) (file-regular-p . tramp-handle-file-regular-p) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index baddcd2d7a..2ce7881543 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -6198,10 +6198,14 @@ This requires restrictions of file name syntax." "Whether asynchronous processes tests are run. This is used in tests which we dont't want to tag `:tramp-asynchronous-processes' completely." - (ert-select-tests - (ert--stats-selector ert--current-run-stats) - (list (make-ert-test :name (ert-test-name (ert-running-test)) - :body nil :tags '(:tramp-asynchronous-processes))))) + (and + (ert-select-tests + (ert--stats-selector ert--current-run-stats) + (list (make-ert-test :name (ert-test-name (ert-running-test)) + :body nil :tags '(:tramp-asynchronous-processes)))) + ;; tramp-adb.el cannot apply multi-byte commands. + (not (and (tramp--test-adb-p) + (string-match-p "[[:multibyte:]]" default-directory))))) (defun tramp--test-crypt-p () "Check, whether the remote directory is crypted." @@ -6250,7 +6254,7 @@ If optional METHOD is given, it is checked first." Several special characters do not work properly there." ;; We must refill the cache. `file-truename' does it. (file-truename tramp-test-temporary-file-directory) - (tramp-check-remote-uname tramp-test-vec "^HP-UX")) + (ignore-errors (tramp-check-remote-uname tramp-test-vec "^HP-UX"))) (defun tramp--test-ksh-p () "Check, whether the remote shell is ksh. @@ -6265,7 +6269,7 @@ a $'' syntax." "Check, whether the remote host runs macOS." ;; We must refill the cache. `file-truename' does it. (file-truename tramp-test-temporary-file-directory) - (tramp-check-remote-uname tramp-test-vec "Darwin")) + (ignore-errors (tramp-check-remote-uname tramp-test-vec "Darwin"))) (defun tramp--test-mock-p () "Check, whether the mock method is used. @@ -6527,8 +6531,10 @@ This requires restrictions of file name syntax." ;; Prior Emacs 27, `shell-file-name' was ;; hard coded as "/bin/sh" for remote ;; processes in Emacs. That doesn't work - ;; for tramp-adb.el. + ;; for tramp-adb.el. tramp-sshfs.el times + ;; out for older Emacsen, reason unknown. (or (not (tramp--test-adb-p)) + (not (tramp--test-sshfs-p)) (tramp--test-emacs27-p))) (let ((default-directory file1)) (dolist (this-shell-command commit b299c042012c769280ede736907777e80b624ff0 Author: Matthias Meulien Date: Mon Feb 14 22:29:49 2022 +0100 Fix computation of outline heading level for non-git diff * lisp/vc/diff-mode.el (diff-setup-buffer-type): Compute outline heading level using diff-hunk-header-re (bug#51809). (diff--font-lock-prettify): Disable prettify in non-git diff. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 0bf7899246..d0c05d3204 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -1596,8 +1596,8 @@ modified lines of the diff." nil))) (when (eq diff-buffer-type 'git) (setq diff-outline-regexp - (concat "\\(^diff --git.*\n\\|" diff-hunk-header-re "\\)")) - (setq-local outline-level #'diff--outline-level)) + (concat "\\(^diff --git.*\n\\|" diff-hunk-header-re "\\)"))) + (setq-local outline-level #'diff--outline-level) (setq-local outline-regexp diff-outline-regexp)) (defun diff-delete-if-empty () @@ -2599,7 +2599,8 @@ fixed, visit it in a buffer." nil nil 'center) (defun diff--font-lock-prettify (limit) - (when diff-font-lock-prettify + (when (and diff-font-lock-prettify + (eq diff-buffer-type 'git)) (save-excursion ;; FIXME: Include the first space for context-style hunks! (while (re-search-forward "^[-+! ]" limit t) commit eb0680bd57bd68ca369dc5133646e8ac9215854c Author: Eli Zaretskii Date: Wed Feb 16 17:07:58 2022 +0200 Add support for Tai Tham script * lisp/international/fontset.el (setup-default-fontset) (script-representative-chars): Add tai-tham. * lisp/language/thai.el ("Northern Thai"): New language environment. Patch by Richard Wordingham . Set 'composition-function-table' for the Tai Tham block. Original code by Richard Wordingham . * etc/HELLO: Add Northern Thai greeting. * etc/NEWS: Announce addition of Northern Thai language environment. diff --git a/etc/HELLO b/etc/HELLO index 5b2002ff93..da9b388f36 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -66,6 +66,7 @@ Maldivian (ދިވެހި) އައްސަލާމު ޢަލައިކުމް / ކިހިނ Maltese (il-Malti) Bonġu / Saħħa Mathematics ∀ p ∈ world • hello p □ Mongolian (монгол хэл) Сайн байна уу? +Northern Thai (ᨣᩣᩴᨾᩮᩬᩥᨦ / ᨽᩣᩈᩣᩃ᩶ᩣ᩠ᨶᨶᩣ) ᩈ᩠ᩅᩢᩔ᩠ᨯᩦᨣᩕᩢ᩠ᨸ Norwegian (norsk) Hei / God dag Oriya (ଓଡ଼ିଆ) ଶୁଣିବେ Polish (język polski) Dzień dobry! / Cześć! diff --git a/etc/NEWS b/etc/NEWS index 8d28340c33..0bc0b120a9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -514,6 +514,9 @@ Setting it to a non-nil value temporarily disables automatic composition of character sequences at point, and thus makes it easier to edit such sequences by allowing point to "enter" the sequence. +*** New language environment "Northern Thai". +This uses the Tai Tham script, whose support has been enhanced. + * Changes in Specialized Modes and Packages in Emacs 29.1 diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index bd557df180..973c637eff 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -184,6 +184,7 @@ (runic #x16A0) (khmer #x1780) (mongolian #x1826) + (tai-tham #x1A20 #x1A55 #x1A61 #x1A80) (symbol . [#x201C #x2200 #x2500]) (braille #x2800) (ideographic-description #x2FF0) @@ -779,6 +780,7 @@ counting-rod-numeral toto adlam + tai-tham mahjong-tile domino-tile emoji)) diff --git a/lisp/language/thai.el b/lisp/language/thai.el index 6a6289a44c..60f5f9d2a3 100644 --- a/lisp/language/thai.el +++ b/lisp/language/thai.el @@ -82,6 +82,43 @@ This is the same as `thai-tis620' with the addition of no-break-space." (aset composition-function-table (aref chars i) elt))) (aset composition-function-table ?ำ '(["[ก-ฯ]." 1 thai-composition-function])) +;; Tai-Tham + +(set-language-info-alist + "Northern Thai" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (sample-text . + "Northern Thai (ᨣᩣᩴᨾᩮᩬᩥᨦ / ᨽᩣᩈᩣᩃ᩶ᩣ᩠ᨶᨶᩣ) ᩈ᩠ᩅᩢᩔ᩠ᨯᩦᨣᩕᩢ᩠ᨸ") + (documentation . t))) + +;; From Richard Wordingham : +(defvar tai-tham-composable-pattern + (let ((table + ;; C is letters, independent vowels, digits, punctuation and symbols. + '(("C" . "[\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD]") + ("M" . ; Marks, CGJ, ZWNJ, ZWJ + "[\u0324\u034F\u0E49\u0E4A\u0E4B\u1A55-\u1A57\u1A59-\u1A5E\u1A61-\u1A7C\u1A7F\u200C\200D]") + ("H" . "\u1A60") ; Sakot + ("S" . ; Marks commuting with sakot + "[\u0E49-\u0E4B\u0EC9\u0ECB\u1A75-\u1A7C]") + ("N" . "\u1A58"))) ; mai kang lai + (basic-syllable "C\\(N*\\(M\\|HS*C\\)\\)*") + (regexp "X\\(N\\(X\\)?\\)*H?")) ; where X is basic syllable + (let ((case-fold-search nil)) + (setq regexp (replace-regexp-in-string "X" basic-syllable regexp t t)) + (dolist (elt table) + (setq regexp (replace-regexp-in-string (car elt) (cdr elt) + regexp t t)))) + regexp)) + +(let ((elt (list (vector tai-tham-composable-pattern 0 'font-shape-gstring) + ))) + (set-char-table-range composition-function-table '(#x1A20 . #x1A54) elt) + (set-char-table-range composition-function-table '(#x1A80 . #x1A89) elt) + (set-char-table-range composition-function-table '(#x1A90 . #x1A99) elt) + (set-char-table-range composition-function-table '(#x1AA0 . #x1AAD) elt)) + (provide 'thai) ;;; thai.el ends here commit bf07ab5430478368e97be2045774d265f8ad19ce Author: Eli Zaretskii Date: Wed Feb 16 15:37:57 2022 +0200 ; * etc/NEWS: Fix wording of a recently added text. diff --git a/etc/NEWS b/etc/NEWS index d02e7dcb8a..8d28340c33 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -72,8 +72,8 @@ work on any underlying window system supported by GDK, such as Wayland and Broadway. We do not recommend that you use this configuration, unless you are running a window system that's supported by GDK other than X. Running this configuration on X is known to have problems, -such as undesirable frame positioning and keyboard input of sequences -such as "C-;" and "C-S-u". +such as undesirable frame positioning and various issues with keyboard +input of sequences such as "C-;" and "C-S-u". --- ** The docstrings of preloaded files are not in "etc/DOC" any more. commit e389da74d59c3ebc3555794844772e98d0fc4ace Author: Po Lu Date: Wed Feb 16 19:54:40 2022 +0800 Fix recent change in xwidget.c * src/xwidget.c (xwidget_init_view): Don't assume ttip_widget is NULL if tooltips have not been initialized. diff --git a/src/xwidget.c b/src/xwidget.c index bfee80ef3e..9fbf6678ae 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -1738,11 +1738,9 @@ xw_maybe_synthesize_crossing (struct xwidget_view *view, /* Work around a silly bug in WebKitGTK+ that tries to make tooltip windows transient for our offscreen window. */ int tooltip_width, tooltip_height; - struct x_output *output = FRAME_X_OUTPUT (view->frame); - if (!output->ttip_widget) - xg_prepare_tooltip (view->frame, dummy_tooltip_string, - &tooltip_width, &tooltip_height); + xg_prepare_tooltip (view->frame, dummy_tooltip_string, + &tooltip_width, &tooltip_height); #endif toplevel = gtk_widget_get_window (XXWIDGET (view->model)->widgetwindow_osr); commit 3b7d55a8013914b6707211d148a6e878ca118ad9 Author: Mattias Engdegård Date: Wed Feb 16 12:27:59 2022 +0100 Speed up count_size_as_multibyte This function is used in many places to calculate the length of a unibyte string converted to multibyte. * src/character.c (count_size_as_multibyte): Move the overflow test outside the loop, which makes it much faster. Standard compilers will even vectorise it if asked to (-O2 in Clang, -O3 in GCC). diff --git a/src/character.c b/src/character.c index eba417d005..c1a1b55389 100644 --- a/src/character.c +++ b/src/character.c @@ -654,15 +654,14 @@ str_as_multibyte (unsigned char *str, ptrdiff_t len, ptrdiff_t nbytes, ptrdiff_t count_size_as_multibyte (const unsigned char *str, ptrdiff_t len) { - const unsigned char *endp = str + len; + /* Count the number of non-ASCII (raw) bytes, since they will occupy + two bytes in a multibyte string. */ + ptrdiff_t nonascii = 0; + for (ptrdiff_t i = 0; i < len; i++) + nonascii += str[i] >> 7; ptrdiff_t bytes; - - for (bytes = 0; str < endp; str++) - { - int n = *str < 0x80 ? 1 : 2; - if (INT_ADD_WRAPV (bytes, n, &bytes)) - string_overflow (); - } + if (INT_ADD_WRAPV (len, nonascii, &bytes)) + string_overflow (); return bytes; } commit bc84c31823e424827a27dc2eb1b5cbee040036cf Author: Mattias Engdegård Date: Wed Feb 16 12:26:30 2022 +0100 Avoid emacs-module-tests failure on macOS * test/src/emacs-module-tests.el (module/describe-function-1): Prevent string mismatch caused by line breaks after filling; the macOS dynamic library suffix (.dylib) is longer than on other platforms. diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index 2ff33644a8..ec83f91f00 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -308,7 +308,8 @@ local reference." "Check that Bug#30163 is fixed." (with-temp-buffer (let ((standard-output (current-buffer)) - (text-quoting-style 'grave)) + (text-quoting-style 'grave) + (fill-column 200)) ; prevent line breaks when filling (describe-function-1 #'mod-test-sum) (goto-char (point-min)) (while (re-search-forward "`[^']*/src/emacs-module-resources/" nil t)