patches: fix forward dependency (helpers moved to patch 1)

This commit is contained in:
2026-02-28 10:24:39 +01:00
parent 5016155c8a
commit fa28bb52e1
5 changed files with 197 additions and 192 deletions

View File

@@ -1,38 +1,39 @@
From 757988a19f7aef1f03ec277f898d92bdd4f2607e Mon Sep 17 00:00:00 2001
From af5c91f537511e4d3f5d6a7d86cf63bd89482f56 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 10:10:55 +0100
Date: Sat, 28 Feb 2026 10:24:31 +0100
Subject: [PATCH 2/5] ns: implement buffer and mode-line accessibility elements
Add the full NSAccessibility text protocol for Emacs windows and
mode-line readout.
* src/nsterm.m (ns_ax_find_completion_overlay_range): New function.
(ns_ax_event_is_line_nav_key): New function.
(ns_ax_completion_text_for_span): New function.
(EmacsAccessibilityBuffer): Implement NSAccessibility protocol:
text cache with @synchronized, visible-run binary search O(log n),
selectedTextRange, lineForIndex/indexForLine, frameForRange,
rangeForPosition, setAccessibilitySelectedTextRange, setAccessibility-
Focused.
(EmacsAccessibilityBuffer postTextChangedNotification:): New method.
ValueChanged with edit details.
(EmacsAccessibilityBuffer): Implement NSAccessibility protocol.
(EmacsAccessibilityBuffer ensureTextCache): Text cache with
visible-run array, invalidated on modiff/overlay/window changes.
(EmacsAccessibilityBuffer accessibilityIndexForCharpos:): Binary
search O(log n) index mapping.
(EmacsAccessibilityBuffer charposForAccessibilityIndex:): Inverse.
(EmacsAccessibilityBuffer postTextChangedNotification:): ValueChanged
with edit type details.
(EmacsAccessibilityBuffer postFocusedCursorNotification:direction:
granularity:markActive:oldMarkActive:): New method. Hybrid
SelectedTextChanged / AnnouncementRequested per WebKit pattern.
(EmacsAccessibilityBuffer postCompletionAnnouncementForBuffer:point:):
New method. Announce completion candidates in non-focused buffers.
granularity:markActive:oldMarkActive:): Hybrid SelectedTextChanged /
AnnouncementRequested per WebKit pattern.
(EmacsAccessibilityBuffer postCompletionAnnouncementForBuffer:
point:): Announce non-focused buffer completions.
(EmacsAccessibilityBuffer postAccessibilityNotificationsForFrame:):
New method. Main dispatch: edit vs cursor-move vs no-change.
Main dispatch: edit vs cursor-move vs no-change.
(EmacsAccessibilityModeLine): Implement AXStaticText element.
Tested on macOS 14 with VoiceOver. Verified: buffer reading, line
navigation, word/character announcements, completions, mode-line.
---
src/nsterm.m | 1620 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 1620 insertions(+)
diff --git a/src/nsterm.m b/src/nsterm.m
index c91ec90..90db3b7 100644
index 935919f..c1cb602 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7177,6 +7177,1626 @@ enum {
@@ -7290,6 +7290,1626 @@ ns_ax_post_notification_with_info (id element,
@end