patches: fix two more compile errors

- Remove f->child_frame_list (field does not exist in struct frame)
- Fix dangling else-if after goto label (skip_overlay_scan)
This commit is contained in:
2026-03-01 04:33:35 +01:00
parent 3d2fa7a54e
commit bc71e58123
9 changed files with 76 additions and 74 deletions

View File

@@ -1,4 +1,4 @@
From 8c424f291b8a635e2b1cd7f3303bc726b5d21a8a Mon Sep 17 00:00:00 2001
From 5cd1b5f46e670f031ce5fcca2d9312059d6efa87 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 14:46:25 +0100
Subject: [PATCH 8/9] ns: announce overlay completion candidates for VoiceOver
@@ -45,8 +45,8 @@ Key implementation details:
Independent overlay branch, BUF_CHARS_MODIFF gating, candidate
---
src/nsterm.h | 1 +
src/nsterm.m | 315 ++++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 285 insertions(+), 31 deletions(-)
src/nsterm.m | 319 +++++++++++++++++++++++++++++++++++++++++++++------
2 files changed, 287 insertions(+), 33 deletions(-)
diff --git a/src/nsterm.h b/src/nsterm.h
index 6e830de..2102fb9 100644
@@ -61,10 +61,10 @@ index 6e830de..2102fb9 100644
@property (nonatomic, assign) BOOL cachedMarkActive;
@property (nonatomic, copy) NSString *cachedCompletionAnnouncement;
diff --git a/src/nsterm.m b/src/nsterm.m
index c35db76..7e34286 100644
index 9de92fb..7c44e9c 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7156,11 +7156,154 @@ Accessibility virtual elements (macOS / Cocoa only)
@@ -7154,11 +7154,154 @@ Accessibility virtual elements (macOS / Cocoa only)
/* ---- Helper: extract buffer text for accessibility ---- */
@@ -220,7 +220,7 @@ index c35db76..7e34286 100644
static NSString *
ns_ax_buffer_text (struct window *w, ptrdiff_t *out_start,
ns_ax_visible_run **out_runs, NSUInteger *out_nruns)
@@ -7231,7 +7374,7 @@ Accessibility virtual elements (macOS / Cocoa only)
@@ -7229,7 +7372,7 @@ Accessibility virtual elements (macOS / Cocoa only)
/* Extract this visible run's text. Use
Fbuffer_substring_no_properties which correctly handles the
@@ -229,7 +229,7 @@ index c35db76..7e34286 100644
include garbage bytes when the run spans the gap position. */
Lisp_Object lstr = Fbuffer_substring_no_properties (
make_fixnum (pos), make_fixnum (run_end));
@@ -7312,7 +7455,7 @@ Mode lines using icon fonts (e.g. doom-modeline with nerd-font)
@@ -7310,7 +7453,7 @@ Mode lines using icon fonts (e.g. doom-modeline with nerd-font)
return NSZeroRect;
/* charpos_start and charpos_len are already in buffer charpos
@@ -238,7 +238,7 @@ index c35db76..7e34286 100644
charposForAccessibilityIndex which handles invisible text. */
ptrdiff_t cp_start = charpos_start;
ptrdiff_t cp_end = cp_start + charpos_len;
@@ -7791,6 +7934,7 @@ @implementation EmacsAccessibilityBuffer
@@ -7789,6 +7932,7 @@ @implementation EmacsAccessibilityBuffer
@synthesize cachedOverlayModiff;
@synthesize cachedTextStart;
@synthesize cachedModiff;
@@ -246,7 +246,7 @@ index c35db76..7e34286 100644
@synthesize cachedPoint;
@synthesize cachedMarkActive;
@synthesize cachedCompletionAnnouncement;
@@ -7888,7 +8032,7 @@ - (void)ensureTextCache
@@ -7886,7 +8030,7 @@ - (void)ensureTextCache
NSTRACE ("EmacsAccessibilityBuffer ensureTextCache");
/* This method is only called from the main thread (AX getters
dispatch_sync to main first). Reads of cachedText/cachedTextModiff
@@ -255,7 +255,7 @@ index c35db76..7e34286 100644
write section at the end needs synchronization to protect
against concurrent reads from AX server thread. */
eassert ([NSThread isMainThread]);
@@ -7901,16 +8045,15 @@ - (void)ensureTextCache
@@ -7899,16 +8043,15 @@ - (void)ensureTextCache
return;
ptrdiff_t modiff = BUF_MODIFF (b);
@@ -278,7 +278,7 @@ index c35db76..7e34286 100644
&& cachedTextStart == BUF_BEGV (b)
&& pt >= cachedTextStart
&& (textLen == 0
@@ -7927,7 +8070,6 @@ - (void)ensureTextCache
@@ -7925,7 +8068,6 @@ - (void)ensureTextCache
[cachedText release];
cachedText = [text retain];
cachedTextModiff = modiff;
@@ -286,7 +286,7 @@ index c35db76..7e34286 100644
cachedTextStart = start;
if (visibleRuns)
@@ -7992,7 +8134,7 @@ - (NSUInteger)accessibilityIndexForCharpos:(ptrdiff_t)charpos
@@ -7990,7 +8132,7 @@ - (NSUInteger)accessibilityIndexForCharpos:(ptrdiff_t)charpos
/* Binary search: runs are sorted by charpos (ascending). Find the
run whose [charpos, charpos+length) range contains the target,
or the nearest run after an invisible gap. O(log n) instead of
@@ -295,7 +295,7 @@ index c35db76..7e34286 100644
NSUInteger lo = 0, hi = visibleRunCount;
while (lo < hi)
{
@@ -8005,7 +8147,7 @@ - (NSUInteger)accessibilityIndexForCharpos:(ptrdiff_t)charpos
@@ -8003,7 +8145,7 @@ - (NSUInteger)accessibilityIndexForCharpos:(ptrdiff_t)charpos
else
{
/* Found: charpos is inside this run. Compute UTF-16 delta
@@ -304,7 +304,7 @@ index c35db76..7e34286 100644
NSUInteger chars_in = (NSUInteger)(charpos - r->charpos);
if (chars_in == 0 || !cachedText)
return r->ax_start;
@@ -8030,10 +8172,10 @@ - (NSUInteger)accessibilityIndexForCharpos:(ptrdiff_t)charpos
@@ -8028,10 +8170,10 @@ - (NSUInteger)accessibilityIndexForCharpos:(ptrdiff_t)charpos
/* Convert accessibility string index to buffer charpos.
Safe to call from any thread: uses only cachedText (NSString) and
@@ -317,7 +317,7 @@ index c35db76..7e34286 100644
@synchronized (self)
{
if (visibleRunCount == 0)
@@ -8067,7 +8209,7 @@ - (ptrdiff_t)charposForAccessibilityIndex:(NSUInteger)ax_idx
@@ -8065,7 +8207,7 @@ - (ptrdiff_t)charposForAccessibilityIndex:(NSUInteger)ax_idx
return cp;
}
}
@@ -326,7 +326,7 @@ index c35db76..7e34286 100644
if (lo > 0)
{
ns_ax_visible_run *last = &visibleRuns[visibleRunCount - 1];
@@ -8089,7 +8231,7 @@ - (ptrdiff_t)charposForAccessibilityIndex:(NSUInteger)ax_idx
@@ -8087,7 +8229,7 @@ - (ptrdiff_t)charposForAccessibilityIndex:(NSUInteger)ax_idx
deadlocking the AX server thread. This is prevented by:
1. validWindow checks WINDOW_LIVE_P and BUFFERP before every
@@ -335,7 +335,7 @@ index c35db76..7e34286 100644
2. All dispatch_sync blocks run on the main thread where no
concurrent Lisp code can modify state between checks.
3. block_input prevents timer events and process output from
@@ -8443,6 +8585,50 @@ - (NSInteger)accessibilityInsertionPointLineNumber
@@ -8441,6 +8583,50 @@ - (NSInteger)accessibilityInsertionPointLineNumber
return [self lineForAXIndex:point_idx];
}
@@ -386,7 +386,7 @@ index c35db76..7e34286 100644
- (NSRange)accessibilityRangeForLine:(NSInteger)line
{
if (![NSThread isMainThread])
@@ -8665,7 +8851,7 @@ - (NSRect)accessibilityFrame
@@ -8663,7 +8849,7 @@ - (NSRect)accessibilityFrame
/* ===================================================================
@@ -395,7 +395,7 @@ index c35db76..7e34286 100644
These methods notify VoiceOver of text and selection changes.
Called from the redisplay cycle (postAccessibilityUpdates).
@@ -8680,7 +8866,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
@@ -8678,7 +8864,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
if (point > self.cachedPoint
&& point - self.cachedPoint == 1)
{
@@ -404,7 +404,7 @@ index c35db76..7e34286 100644
[self invalidateTextCache];
[self ensureTextCache];
if (cachedText)
@@ -8699,7 +8885,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
@@ -8697,7 +8883,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
/* Update cachedPoint here so the selection-move branch does NOT
fire for point changes caused by edits. WebKit and Chromium
never send both ValueChanged and SelectedTextChanged for the
@@ -413,7 +413,7 @@ index c35db76..7e34286 100644
self.cachedPoint = point;
NSDictionary *change = @{
@@ -9032,14 +9218,81 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
@@ -9030,16 +9216,83 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
BOOL markActive = !NILP (BVAR (b, mark_active));
/* --- Text changed (edit) --- */
@@ -493,11 +493,15 @@ index c35db76..7e34286 100644
/* --- Cursor moved or selection changed ---
- Use 'else if' — edits and selection moves are mutually exclusive
+ Use 'else if' --- edits and selection moves are mutually exclusive
per the WebKit/Chromium pattern. */
else if (point != self.cachedPoint || markActive != self.cachedMarkActive)
- per the WebKit/Chromium pattern. */
- else if (point != self.cachedPoint || markActive != self.cachedMarkActive)
+ Independent check: the goto above may jump here from the overlay
+ branch, so this must be a standalone if, not else-if. */
+ if (point != self.cachedPoint || markActive != self.cachedMarkActive)
{
@@ -9209,7 +9462,7 @@ - (NSRect)accessibilityFrame
ptrdiff_t oldPoint = self.cachedPoint;
BOOL oldMarkActive = self.cachedMarkActive;
@@ -9207,7 +9460,7 @@ - (NSRect)accessibilityFrame
/* ===================================================================
@@ -506,7 +510,7 @@ index c35db76..7e34286 100644
=================================================================== */
/* Scan visible range of window W for interactive spans.
@@ -9417,7 +9670,7 @@ - (void) setAccessibilityFocused: (BOOL) focused
@@ -9415,7 +9668,7 @@ - (void) setAccessibilityFocused: (BOOL) focused
dispatch_async (dispatch_get_main_queue (), ^{
/* lwin is a Lisp_Object captured by value. This is GC-safe
because Lisp_Objects are tagged integers/pointers that
@@ -515,7 +519,7 @@ index c35db76..7e34286 100644
Emacs. The WINDOW_LIVE_P check below guards against the
window being deleted between capture and execution. */
if (!WINDOWP (lwin) || NILP (Fwindow_live_p (lwin)))
@@ -9443,7 +9696,7 @@ - (void) setAccessibilityFocused: (BOOL) focused
@@ -9441,7 +9694,7 @@ - (void) setAccessibilityFocused: (BOOL) focused
@end
@@ -524,7 +528,7 @@ index c35db76..7e34286 100644
Methods are kept here (same .m file) so they access the ivars
declared in the @interface ivar block. */
@implementation EmacsAccessibilityBuffer (InteractiveSpans)
@@ -12168,7 +12421,7 @@ - (int) fullscreenState
@@ -12166,7 +12419,7 @@ - (int) fullscreenState
if (WINDOW_LEAF_P (w))
{
@@ -533,7 +537,7 @@ index c35db76..7e34286 100644
EmacsAccessibilityBuffer *elem
= [existing objectForKey:[NSValue valueWithPointer:w]];
if (!elem)
@@ -12202,7 +12455,7 @@ - (int) fullscreenState
@@ -12200,7 +12453,7 @@ - (int) fullscreenState
}
else
{
@@ -542,7 +546,7 @@ index c35db76..7e34286 100644
Lisp_Object child = w->contents;
while (!NILP (child))
{
@@ -12314,7 +12567,7 @@ - (void)postAccessibilityUpdates
@@ -12312,7 +12565,7 @@ - (void)postAccessibilityUpdates
accessibilityUpdating = YES;
/* Detect window tree change (split, delete, new buffer). Compare
@@ -551,7 +555,7 @@ index c35db76..7e34286 100644
Lisp_Object curRoot = FRAME_ROOT_WINDOW (emacsframe);
if (!EQ (curRoot, lastRootWindow))
{
@@ -12323,12 +12576,12 @@ - (void)postAccessibilityUpdates
@@ -12321,12 +12574,12 @@ - (void)postAccessibilityUpdates
}
/* If tree is stale, rebuild FIRST so we don't iterate freed