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.
This commit is contained in:
2026-03-04 13:29:55 +01:00
parent ea9d231177
commit c418db05dc
3 changed files with 9 additions and 10 deletions

View File

@@ -206,8 +206,8 @@ index 3b923ee5fa..41c6b8dc14 100644
+ /* Block input to prevent concurrent redisplay from modifying buffer + /* Block input to prevent concurrent redisplay from modifying buffer
+ state while we read text properties. Unwind-protected so + state while we read text properties. Unwind-protected so
+ block_input is always matched by unblock_input on signal. */ + block_input is always matched by unblock_input on signal. */
+ record_unwind_protect_void (unblock_input);
+ block_input (); + block_input ();
+ record_unwind_protect_void (unblock_input);
+ if (b != current_buffer) + if (b != current_buffer)
+ set_buffer_internal_1 (b); + set_buffer_internal_1 (b);
+ +
@@ -1060,8 +1060,8 @@ index 3b923ee5fa..41c6b8dc14 100644
+ so block_input is always matched by unblock_input, even if + so block_input is always matched by unblock_input, even if
+ ensureTextCache triggers a Lisp signal (longjmp). */ + ensureTextCache triggers a Lisp signal (longjmp). */
+ specpdl_ref count = SPECPDL_INDEX (); + specpdl_ref count = SPECPDL_INDEX ();
+ record_unwind_protect_void (unblock_input);
+ block_input (); + block_input ();
+ record_unwind_protect_void (unblock_input);
+ +
+ /* Find the glyph row at this y coordinate. */ + /* Find the glyph row at this y coordinate. */
+ struct glyph_matrix *matrix = w->current_matrix; + struct glyph_matrix *matrix = w->current_matrix;

View File

@@ -223,10 +223,10 @@ index e4e43dd7a3..c9fe93a57b 100644
charposForAccessibilityIndex which handles invisible text. */ charposForAccessibilityIndex which handles invisible text. */
ptrdiff_t cp_start = charpos_start; ptrdiff_t cp_start = charpos_start;
ptrdiff_t cp_end = cp_start + charpos_len; 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. */ 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 --- - "selected item" face. Substring match is intentionally broad ---
- it catches vertico-current, icomplete-selected-match, - it catches vertico-current, icomplete-selected-match,
- ivy-current-match, company-tooltip-selection, and similar. - ivy-current-match, company-tooltip-selection, and similar.
@@ -251,8 +251,7 @@ index e4e43dd7a3..c9fe93a57b 100644
- return false; - return false;
-} -}
- -
-static inline void static inline void
+ static inline void
ns_ax_post_notification (id element, ns_ax_post_notification (id element,
NSAccessibilityNotificationName name) NSAccessibilityNotificationName name)
{ {

View File

@@ -477,8 +477,8 @@ index c9fe93a57b..f7574efb39 100644
+ echo produced by postTextChangedNotification, making typed + echo produced by postTextChangedNotification, making typed
+ characters inaudible. VoiceOver should read the overlay + characters inaudible. VoiceOver should read the overlay
+ candidate only when the user navigates (C-n/C-p), not types. */ + candidate only when the user navigates (C-n/C-p), not types. */
+ if (!MINI_WINDOW_P (w) || didTextChange) + if (MINI_WINDOW_P (w) && !didTextChange)
+ goto skip_overlay_scan; + {
+ +
+ int selected_line = -1; + int selected_line = -1;
+ NSString *candidate + NSString *candidate
@@ -536,9 +536,9 @@ index c9fe93a57b..f7574efb39 100644
+ annInfo); + annInfo);
} }
} }
+ }
} }
+ skip_overlay_scan:
/* --- Cursor moved or selection changed --- /* --- Cursor moved or selection changed ---
Independent check from the overlay branch above. */ Independent check from the overlay branch above. */
if (point != self.cachedPoint || markActive != self.cachedMarkActive) if (point != self.cachedPoint || markActive != self.cachedMarkActive)