patches: review iteration 1 fixes
Shortened ivar comments (line length), broke long ObjC method call, changed '---' to em-dash in overlay patch comment.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 479cfe85e8efc97c184ca68bbe4373d762e5841f Mon Sep 17 00:00:00 2001
|
||||
From d8a9886e85772c934b9f619251f301ee9baddc84 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Sukany <martin@sukany.cz>
|
||||
Date: Sat, 28 Feb 2026 14:46:25 +0100
|
||||
Subject: [PATCH 7/8] ns: announce overlay completion candidates for VoiceOver
|
||||
@@ -45,11 +45,11 @@ Key implementation details:
|
||||
Independent overlay branch, BUF_CHARS_MODIFF gating, candidate
|
||||
---
|
||||
src/nsterm.h | 1 +
|
||||
src/nsterm.m | 308 +++++++++++++++++++++++++++++++++++++++++++++------
|
||||
2 files changed, 277 insertions(+), 32 deletions(-)
|
||||
src/nsterm.m | 306 +++++++++++++++++++++++++++++++++++++++++++++------
|
||||
2 files changed, 276 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/src/nsterm.h b/src/nsterm.h
|
||||
index ec7b587..19a7e7a 100644
|
||||
index d308a71..7a8c5a0 100644
|
||||
--- a/src/nsterm.h
|
||||
+++ b/src/nsterm.h
|
||||
@@ -509,6 +509,7 @@ typedef struct ns_ax_visible_run
|
||||
@@ -61,7 +61,7 @@ index ec7b587..19a7e7a 100644
|
||||
@property (nonatomic, assign) BOOL cachedMarkActive;
|
||||
@property (nonatomic, copy) NSString *cachedCompletionAnnouncement;
|
||||
diff --git a/src/nsterm.m b/src/nsterm.m
|
||||
index f0e8751..72478e0 100644
|
||||
index 156dba9..a6fce74 100644
|
||||
--- a/src/nsterm.m
|
||||
+++ b/src/nsterm.m
|
||||
@@ -6884,11 +6884,154 @@ Accessibility virtual elements (macOS / Cocoa only)
|
||||
@@ -386,7 +386,7 @@ index f0e8751..72478e0 100644
|
||||
- (NSRange)accessibilityRangeForLine:(NSInteger)line
|
||||
{
|
||||
if (![NSThread isMainThread])
|
||||
@@ -8392,7 +8578,7 @@ - (NSRect)accessibilityFrame
|
||||
@@ -8393,7 +8579,7 @@ - (NSRect)accessibilityFrame
|
||||
|
||||
|
||||
/* ===================================================================
|
||||
@@ -395,7 +395,7 @@ index f0e8751..72478e0 100644
|
||||
|
||||
These methods notify VoiceOver of text and selection changes.
|
||||
Called from the redisplay cycle (postAccessibilityUpdates).
|
||||
@@ -8407,7 +8593,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
|
||||
@@ -8408,7 +8594,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
|
||||
if (point > self.cachedPoint
|
||||
&& point - self.cachedPoint == 1)
|
||||
{
|
||||
@@ -404,7 +404,7 @@ index f0e8751..72478e0 100644
|
||||
[self invalidateTextCache];
|
||||
[self ensureTextCache];
|
||||
if (cachedText)
|
||||
@@ -8426,7 +8612,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
|
||||
@@ -8427,7 +8613,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 f0e8751..72478e0 100644
|
||||
self.cachedPoint = point;
|
||||
|
||||
NSDictionary *change = @{
|
||||
@@ -8759,14 +8945,72 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
|
||||
@@ -8760,14 +8946,72 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
|
||||
BOOL markActive = !NILP (BVAR (b, mark_active));
|
||||
|
||||
/* --- Text changed (edit) --- */
|
||||
@@ -488,7 +488,7 @@ index f0e8751..72478e0 100644
|
||||
per the WebKit/Chromium pattern. */
|
||||
else if (point != self.cachedPoint || markActive != self.cachedMarkActive)
|
||||
{
|
||||
@@ -8936,7 +9180,7 @@ - (NSRect)accessibilityFrame
|
||||
@@ -8937,7 +9181,7 @@ - (NSRect)accessibilityFrame
|
||||
|
||||
|
||||
/* ===================================================================
|
||||
@@ -497,16 +497,7 @@ index f0e8751..72478e0 100644
|
||||
=================================================================== */
|
||||
|
||||
/* Scan visible range of window W for interactive spans.
|
||||
@@ -9127,7 +9371,7 @@ - (NSRect) accessibilityFrame
|
||||
- (BOOL) isAccessibilityFocused
|
||||
{
|
||||
/* Read the cached point stored by EmacsAccessibilityBuffer on the main
|
||||
- thread — safe to read from any thread (plain ptrdiff_t, no Lisp calls). */
|
||||
+ thread --- safe to read from any thread (plain ptrdiff_t, no Lisp calls). */
|
||||
EmacsAccessibilityBuffer *pb = self.parentBuffer;
|
||||
if (!pb)
|
||||
return NO;
|
||||
@@ -9144,7 +9388,7 @@ - (void) setAccessibilityFocused: (BOOL) focused
|
||||
@@ -9145,7 +9389,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 +506,7 @@ index f0e8751..72478e0 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)))
|
||||
@@ -9170,7 +9414,7 @@ - (void) setAccessibilityFocused: (BOOL) focused
|
||||
@@ -9171,7 +9415,7 @@ - (void) setAccessibilityFocused: (BOOL) focused
|
||||
|
||||
@end
|
||||
|
||||
@@ -524,7 +515,7 @@ index f0e8751..72478e0 100644
|
||||
Methods are kept here (same .m file) so they access the ivars
|
||||
declared in the @interface ivar block. */
|
||||
@implementation EmacsAccessibilityBuffer (InteractiveSpans)
|
||||
@@ -11892,7 +12136,7 @@ - (int) fullscreenState
|
||||
@@ -11893,7 +12137,7 @@ - (int) fullscreenState
|
||||
|
||||
if (WINDOW_LEAF_P (w))
|
||||
{
|
||||
@@ -533,7 +524,7 @@ index f0e8751..72478e0 100644
|
||||
EmacsAccessibilityBuffer *elem
|
||||
= [existing objectForKey:[NSValue valueWithPointer:w]];
|
||||
if (!elem)
|
||||
@@ -11926,7 +12170,7 @@ - (int) fullscreenState
|
||||
@@ -11927,7 +12171,7 @@ - (int) fullscreenState
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -542,7 +533,7 @@ index f0e8751..72478e0 100644
|
||||
Lisp_Object child = w->contents;
|
||||
while (!NILP (child))
|
||||
{
|
||||
@@ -12038,7 +12282,7 @@ - (void)postAccessibilityUpdates
|
||||
@@ -12039,7 +12283,7 @@ - (void)postAccessibilityUpdates
|
||||
accessibilityUpdating = YES;
|
||||
|
||||
/* Detect window tree change (split, delete, new buffer). Compare
|
||||
@@ -551,7 +542,7 @@ index f0e8751..72478e0 100644
|
||||
Lisp_Object curRoot = FRAME_ROOT_WINDOW (emacsframe);
|
||||
if (!EQ (curRoot, lastRootWindow))
|
||||
{
|
||||
@@ -12047,12 +12291,12 @@ - (void)postAccessibilityUpdates
|
||||
@@ -12048,12 +12292,12 @@ - (void)postAccessibilityUpdates
|
||||
}
|
||||
|
||||
/* If tree is stale, rebuild FIRST so we don't iterate freed
|
||||
|
||||
Reference in New Issue
Block a user