patches: fix duplicate EmacsAccessibilityBuffer(InteractiveSpans)

Stub @implementation added in 0001 was never removed when 0004
added the full implementation, causing Clang to error:
  reimplementation of category 'InteractiveSpans'

Remove the stub block in 0004 (interactive span elements for Tab).
This commit is contained in:
2026-03-04 19:42:01 +01:00
parent ad868e0fab
commit abc518a60a
5 changed files with 69 additions and 51 deletions

View File

@@ -1,4 +1,4 @@
From 87d1a86ca4130475a908e41928f4ee802c861372 Mon Sep 17 00:00:00 2001
From b6bc1d102334e32dbc3e284d9e65b0f304c3e694 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
Date: Wed, 4 Mar 2026 15:23:56 +0100
Subject: [PATCH 8/9] ns: announce overlay completions to VoiceOver
@@ -43,7 +43,7 @@ index d9ae6efc2e..ff81675bb5 100644
@property (nonatomic, assign) BOOL cachedMarkActive;
@property (nonatomic, copy) NSString *cachedCompletionAnnouncement;
diff --git a/src/nsterm.m b/src/nsterm.m
index 4261886974..90c59c47b4 100644
index 705c3ece06..209b8a0a1d 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7276,11 +7276,126 @@ Accessibility virtual elements (macOS / Cocoa only)
@@ -174,7 +174,7 @@ index 4261886974..90c59c47b4 100644
static NSString *
ns_ax_buffer_text (struct window *w, ptrdiff_t *out_start,
ns_ax_visible_run **out_runs, NSUInteger *out_nruns)
@@ -7917,6 +8032,7 @@ @implementation EmacsAccessibilityBuffer
@@ -7906,6 +8021,7 @@ @implementation EmacsAccessibilityBuffer
@synthesize cachedOverlayModiff;
@synthesize cachedTextStart;
@synthesize cachedModiff;
@@ -182,7 +182,7 @@ index 4261886974..90c59c47b4 100644
@synthesize cachedPoint;
@synthesize cachedMarkActive;
@synthesize cachedCompletionAnnouncement;
@@ -8027,20 +8143,33 @@ - (void)ensureTextCache
@@ -8016,20 +8132,33 @@ - (void)ensureTextCache
return;
/* Use BUF_MODIFF, not BUF_CHARS_MODIFF, for cache validity.
@@ -228,7 +228,7 @@ index 4261886974..90c59c47b4 100644
ptrdiff_t modiff = BUF_MODIFF (b);
ptrdiff_t pt = BUF_PT (b);
NSUInteger textLen = cachedText ? [cachedText length] : 0;
@@ -8072,9 +8201,8 @@ included in the cached AX text (it is handled separately via
@@ -8061,9 +8190,8 @@ included in the cached AX text (it is handled separately via
Walk the cached text once, recording the start offset of each
line. Uses NSString lineRangeForRange: --- O(N) in the total
text --- but this loop runs only on cache rebuild, which is
@@ -240,7 +240,7 @@ index 4261886974..90c59c47b4 100644
if (lineStartOffsets)
xfree (lineStartOffsets);
lineStartOffsets = NULL;
@@ -8590,26 +8718,26 @@ - (NSInteger)accessibilityInsertionPointLineNumber
@@ -8579,26 +8707,26 @@ - (NSInteger)accessibilityInsertionPointLineNumber
return [self lineForAXIndex:point_idx];
}
@@ -278,7 +278,7 @@ index 4261886974..90c59c47b4 100644
}
- (NSInteger)accessibilityLineForIndex:(NSInteger)index
@@ -8631,6 +8759,29 @@ - (NSInteger)accessibilityLineForIndex:(NSInteger)index
@@ -8620,6 +8748,29 @@ - (NSInteger)accessibilityLineForIndex:(NSInteger)index
idx = [cachedText length];
return [self lineForAXIndex:idx];
@@ -308,7 +308,7 @@ index 4261886974..90c59c47b4 100644
}
- (NSRange)accessibilityRangeForIndex:(NSInteger)index
@@ -8833,7 +8984,7 @@ - (NSRect)accessibilityFrame
@@ -8822,7 +8973,7 @@ - (NSRect)accessibilityFrame
/* ===================================================================
@@ -317,7 +317,7 @@ index 4261886974..90c59c47b4 100644
These methods notify VoiceOver of text and selection changes.
Called from the redisplay cycle (postAccessibilityUpdates).
@@ -8848,7 +8999,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
@@ -8837,7 +8988,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
if (point > self.cachedPoint
&& point - self.cachedPoint == 1)
{
@@ -326,7 +326,7 @@ index 4261886974..90c59c47b4 100644
[self invalidateTextCache];
[self ensureTextCache];
if (cachedText)
@@ -8867,7 +9018,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
@@ -8856,7 +9007,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
@@ -335,7 +335,7 @@ index 4261886974..90c59c47b4 100644
self.cachedPoint = point;
NSDictionary *change = @{
@@ -9261,16 +9412,80 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
@@ -9250,16 +9401,80 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
BOOL markActive = !NILP (BVAR (b, mark_active));
/* --- Text changed (edit) --- */
@@ -420,7 +420,7 @@ index 4261886974..90c59c47b4 100644
{
ptrdiff_t oldPoint = self.cachedPoint;
BOOL oldMarkActive = self.cachedMarkActive;
@@ -9288,8 +9503,14 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
@@ -9277,8 +9492,14 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
bool isCtrlNP = ns_ax_event_is_line_nav_key (&ctrlNP);
/* --- Granularity detection --- */
@@ -436,7 +436,7 @@ index 4261886974..90c59c47b4 100644
if (cachedText && oldPoint > 0)
{
NSUInteger tlen = [cachedText length];
@@ -12449,7 +12670,7 @@ - (int) fullscreenState
@@ -12438,7 +12659,7 @@ - (int) fullscreenState
if (WINDOW_LEAF_P (w))
{
@@ -445,7 +445,7 @@ index 4261886974..90c59c47b4 100644
EmacsAccessibilityBuffer *elem
= [existing objectForKey:[NSValue valueWithPointer:w]];
if (!elem)
@@ -12483,7 +12704,7 @@ - (int) fullscreenState
@@ -12472,7 +12693,7 @@ - (int) fullscreenState
}
else
{
@@ -454,7 +454,7 @@ index 4261886974..90c59c47b4 100644
Lisp_Object child = w->contents;
while (!NILP (child))
{
@@ -12595,7 +12816,7 @@ - (void)postAccessibilityUpdates
@@ -12584,7 +12805,7 @@ - (void)postAccessibilityUpdates
accessibilityUpdating = YES;
/* Detect window tree change (split, delete, new buffer). Compare
@@ -463,7 +463,7 @@ index 4261886974..90c59c47b4 100644
Lisp_Object curRoot = FRAME_ROOT_WINDOW (emacsframe);
if (!EQ (curRoot, lastRootWindow))
{
@@ -12604,12 +12825,12 @@ - (void)postAccessibilityUpdates
@@ -12593,12 +12814,12 @@ - (void)postAccessibilityUpdates
}
/* If tree is stale, rebuild FIRST so we don't iterate freed