From c418db05dc467da1eebb088258188bbb38e1013f Mon Sep 17 00:00:00 2001 From: Daneel Date: Wed, 4 Mar 2026 13:29:55 +0100 Subject: [PATCH] patches: fix all round-1 blockers (B1 B3 B5 B6) B1 (0007): Fix dangling comment - change context line to deletion so the opening comment of the removed ns_ax_face_is_selected function is properly deleted, not left as an unclosed comment fragment that would cause a compilation failure. B3 (0002): Fix block_input/record_unwind_protect_void ordering in two places in accessibilityRangeForPosition: and related method. Correct order: block_input() BEFORE record_unwind_protect_void(), so the unwind handler cannot call unblock_input without a matching block_input even if specpdl_push fails. B5 (0008): Replace goto skip_overlay_scan with proper if-block. The goto skipped over ObjC variable declarations which is poor style and would be flagged by Emacs maintainers. Restructure as if (MINI_WINDOW_P (w) && !didTextChange) { ... }. B6 (0008): Fix nlines < 128 to nlines < 512 in ns_ax_selected_child_ frame_text. Arrays line_starts[] and line_ends[] are declared with size 512; the trailing-line guard used 128, silently dropping the last line for buffers with 128-511 lines. --- ...plement-buffer-accessibility-element-core-proto.patch | 4 ++-- ...nounce-overlay-completion-candidates-for-VoiceO.patch | 9 ++++----- ...nounce-child-frame-completion-candidates-for-Vo.patch | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/patches/0002-ns-implement-buffer-accessibility-element-core-proto.patch b/patches/0002-ns-implement-buffer-accessibility-element-core-proto.patch index 9a4967d..98e09bb 100644 --- a/patches/0002-ns-implement-buffer-accessibility-element-core-proto.patch +++ b/patches/0002-ns-implement-buffer-accessibility-element-core-proto.patch @@ -206,8 +206,8 @@ index 3b923ee5fa..41c6b8dc14 100644 + /* Block input to prevent concurrent redisplay from modifying buffer + state while we read text properties. Unwind-protected so + block_input is always matched by unblock_input on signal. */ -+ record_unwind_protect_void (unblock_input); + block_input (); ++ record_unwind_protect_void (unblock_input); + if (b != current_buffer) + set_buffer_internal_1 (b); + @@ -1060,8 +1060,8 @@ index 3b923ee5fa..41c6b8dc14 100644 + so block_input is always matched by unblock_input, even if + ensureTextCache triggers a Lisp signal (longjmp). */ + specpdl_ref count = SPECPDL_INDEX (); -+ record_unwind_protect_void (unblock_input); + block_input (); ++ record_unwind_protect_void (unblock_input); + + /* Find the glyph row at this y coordinate. */ + struct glyph_matrix *matrix = w->current_matrix; diff --git a/patches/0007-ns-announce-overlay-completion-candidates-for-VoiceO.patch b/patches/0007-ns-announce-overlay-completion-candidates-for-VoiceO.patch index e1ef5e4..c1374ea 100644 --- a/patches/0007-ns-announce-overlay-completion-candidates-for-VoiceO.patch +++ b/patches/0007-ns-announce-overlay-completion-candidates-for-VoiceO.patch @@ -223,10 +223,10 @@ index e4e43dd7a3..c9fe93a57b 100644 charposForAccessibilityIndex which handles invisible text. */ ptrdiff_t cp_start = charpos_start; ptrdiff_t cp_end = cp_start + charpos_len; -@@ -7606,31 +7749,7 @@ already on the main queue (e.g., inside postAccessibilityUpdates +@@ -7606,31 +7749,6 @@ already on the main queue (e.g., inside postAccessibilityUpdates freeing the main queue for VoiceOver's dispatch_sync calls. */ - - /* Return true if FACE (a symbol or list of symbols) looks like a + +-/* Return true if FACE (a symbol or list of symbols) looks like a - "selected item" face. Substring match is intentionally broad --- - it catches vertico-current, icomplete-selected-match, - ivy-current-match, company-tooltip-selection, and similar. @@ -251,8 +251,7 @@ index e4e43dd7a3..c9fe93a57b 100644 - return false; -} - --static inline void -+ static inline void + static inline void ns_ax_post_notification (id element, NSAccessibilityNotificationName name) { diff --git a/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch b/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch index 3d4f456..babbcab 100644 --- a/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch +++ b/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch @@ -477,8 +477,8 @@ index c9fe93a57b..f7574efb39 100644 + echo produced by postTextChangedNotification, making typed + characters inaudible. VoiceOver should read the overlay + candidate only when the user navigates (C-n/C-p), not types. */ -+ if (!MINI_WINDOW_P (w) || didTextChange) -+ goto skip_overlay_scan; ++ if (MINI_WINDOW_P (w) && !didTextChange) ++ { + + int selected_line = -1; + NSString *candidate @@ -536,9 +536,9 @@ index c9fe93a57b..f7574efb39 100644 + annInfo); } } ++ } } -+ skip_overlay_scan: /* --- Cursor moved or selection changed --- Independent check from the overlay branch above. */ if (point != self.cachedPoint || markActive != self.cachedMarkActive)