|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
From 0fc45d4df14bdc39d6c005cc2c02c745fd59ea22 Mon Sep 17 00:00:00 2001
|
|
|
|
From a238db02b1d26210a61106c804c8dd012e93fc52 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Martin Sukany <martin@sukany.cz>
|
|
|
|
From: Martin Sukany <martin@sukany.cz>
|
|
|
|
Date: Sat, 28 Feb 2026 16:01:29 +0100
|
|
|
|
Date: Sat, 28 Feb 2026 16:01:29 +0100
|
|
|
|
Subject: [PATCH 8/8] ns: announce child frame completion candidates for
|
|
|
|
Subject: [PATCH 8/8] ns: announce child frame completion candidates for
|
|
|
|
@@ -20,8 +20,8 @@ element when a child frame completion closes.
|
|
|
|
doc/emacs/macos.texi | 6 -
|
|
|
|
doc/emacs/macos.texi | 6 -
|
|
|
|
etc/NEWS | 4 +-
|
|
|
|
etc/NEWS | 4 +-
|
|
|
|
src/nsterm.h | 9 ++
|
|
|
|
src/nsterm.h | 9 ++
|
|
|
|
src/nsterm.m | 337 +++++++++++++++++++++++++++++++++++++++++--
|
|
|
|
src/nsterm.m | 338 +++++++++++++++++++++++++++++++++++++++++--
|
|
|
|
4 files changed, 333 insertions(+), 23 deletions(-)
|
|
|
|
4 files changed, 334 insertions(+), 23 deletions(-)
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi
|
|
|
|
diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi
|
|
|
|
index 6514dfc..f47929e 100644
|
|
|
|
index 6514dfc..f47929e 100644
|
|
|
|
@@ -48,7 +48,7 @@ index 6514dfc..f47929e 100644
|
|
|
|
To disable the accessibility interface entirely (for instance, to
|
|
|
|
To disable the accessibility interface entirely (for instance, to
|
|
|
|
eliminate overhead on systems where assistive technology is not in
|
|
|
|
eliminate overhead on systems where assistive technology is not in
|
|
|
|
diff --git a/etc/NEWS b/etc/NEWS
|
|
|
|
diff --git a/etc/NEWS b/etc/NEWS
|
|
|
|
index a4a525f..d26c926 100644
|
|
|
|
index 2b1f9e6..8a40850 100644
|
|
|
|
--- a/etc/NEWS
|
|
|
|
--- a/etc/NEWS
|
|
|
|
+++ b/etc/NEWS
|
|
|
|
+++ b/etc/NEWS
|
|
|
|
@@ -4404,8 +4404,8 @@ send user data to Apple's speech recognition servers.
|
|
|
|
@@ -4404,8 +4404,8 @@ send user data to Apple's speech recognition servers.
|
|
|
|
@@ -97,7 +97,7 @@ index 21a93bc..bbce9fe 100644
|
|
|
|
@end
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/nsterm.m b/src/nsterm.m
|
|
|
|
diff --git a/src/nsterm.m b/src/nsterm.m
|
|
|
|
index 8d44b5f..251a03e 100644
|
|
|
|
index 8d44b5f..e05608f 100644
|
|
|
|
--- a/src/nsterm.m
|
|
|
|
--- a/src/nsterm.m
|
|
|
|
+++ b/src/nsterm.m
|
|
|
|
+++ b/src/nsterm.m
|
|
|
|
@@ -7415,6 +7415,112 @@ visual line index for Zoom (skip whitespace-only lines
|
|
|
|
@@ -7415,6 +7415,112 @@ visual line index for Zoom (skip whitespace-only lines
|
|
|
|
@@ -274,7 +274,7 @@ index 8d44b5f..251a03e 100644
|
|
|
|
cachedTextStart = start;
|
|
|
|
cachedTextStart = start;
|
|
|
|
|
|
|
|
|
|
|
|
if (visibleRuns)
|
|
|
|
if (visibleRuns)
|
|
|
|
@@ -9060,11 +9186,14 @@ - (void)postFocusedCursorNotification:(ptrdiff_t)point
|
|
|
|
@@ -9060,11 +9186,13 @@ - (void)postFocusedCursorNotification:(ptrdiff_t)point
|
|
|
|
= @(ns_ax_text_state_change_selection_move);
|
|
|
|
= @(ns_ax_text_state_change_selection_move);
|
|
|
|
moveInfo[@"AXTextSelectionDirection"] = @(direction);
|
|
|
|
moveInfo[@"AXTextSelectionDirection"] = @(direction);
|
|
|
|
moveInfo[@"AXTextChangeElement"] = self;
|
|
|
|
moveInfo[@"AXTextChangeElement"] = self;
|
|
|
|
@@ -283,26 +283,17 @@ index 8d44b5f..251a03e 100644
|
|
|
|
- for evil block-cursor mode). Include it for word/line/
|
|
|
|
- for evil block-cursor mode). Include it for word/line/
|
|
|
|
- selection so VoiceOver reads the appropriate text. */
|
|
|
|
- selection so VoiceOver reads the appropriate text. */
|
|
|
|
- if (!isCharMove)
|
|
|
|
- if (!isCharMove)
|
|
|
|
+ /* Include granularity for sequential moves so VoiceOver reads
|
|
|
|
+ /* Include granularity for sequential moves so VoiceOver reads the
|
|
|
|
+ the appropriate unit of text. Omit for character moves (we
|
|
|
|
+ appropriate unit. Omit for character moves (announced explicitly
|
|
|
|
+ announce the character explicitly below) and for discontiguous
|
|
|
|
+ below) and for discontiguous jumps (destination line announced
|
|
|
|
+ jumps (the destination line is announced explicitly; omitting
|
|
|
|
+ explicitly; omitting granularity lets VoiceOver use its default
|
|
|
|
+ granularity lets VoiceOver use default behaviour and re-anchor
|
|
|
|
+ behaviour and re-anchor its browse cursor). */
|
|
|
|
+ its browse cursor to accessibilitySelectedTextRange). */
|
|
|
|
|
|
|
|
+ if (!isCharMove
|
|
|
|
+ if (!isCharMove
|
|
|
|
+ && direction != ns_ax_text_selection_direction_discontiguous)
|
|
|
|
+ && direction != ns_ax_text_selection_direction_discontiguous)
|
|
|
|
moveInfo[@"AXTextSelectionGranularity"] = @(granularity);
|
|
|
|
moveInfo[@"AXTextSelectionGranularity"] = @(granularity);
|
|
|
|
|
|
|
|
|
|
|
|
ns_ax_post_notification_with_info (
|
|
|
|
ns_ax_post_notification_with_info (
|
|
|
|
@@ -9072,6 +9201,7 @@ derive its own speech (it would read the wrong character
|
|
|
|
@@ -9175,6 +9303,7 @@ - (void)postCompletionAnnouncementForBuffer:(struct buffer *)b
|
|
|
|
NSAccessibilitySelectedTextChangedNotification,
|
|
|
|
|
|
|
|
moveInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/* For character moves: explicit announcement of char AT point.
|
|
|
|
|
|
|
|
This is the ONLY speech source for character navigation.
|
|
|
|
|
|
|
|
Correct for evil block-cursor (cursor ON the character)
|
|
|
|
|
|
|
|
@@ -9175,6 +9305,7 @@ - (void)postCompletionAnnouncementForBuffer:(struct buffer *)b
|
|
|
|
|
|
|
|
ptrdiff_t currentOverlayStart = 0;
|
|
|
|
ptrdiff_t currentOverlayStart = 0;
|
|
|
|
ptrdiff_t currentOverlayEnd = 0;
|
|
|
|
ptrdiff_t currentOverlayEnd = 0;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -310,18 +301,20 @@ index 8d44b5f..251a03e 100644
|
|
|
|
specpdl_ref count2 = SPECPDL_INDEX ();
|
|
|
|
specpdl_ref count2 = SPECPDL_INDEX ();
|
|
|
|
record_unwind_current_buffer ();
|
|
|
|
record_unwind_current_buffer ();
|
|
|
|
if (b != current_buffer)
|
|
|
|
if (b != current_buffer)
|
|
|
|
@@ -9352,6 +9483,44 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
|
|
|
|
@@ -9352,6 +9481,46 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
|
|
|
|
if (!b)
|
|
|
|
if (!b)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
+ /* --- Echo area announcements ---
|
|
|
|
+ /* --- Echo area announcements ---
|
|
|
|
+ When the minibuffer is not active for user input (minibuf_level == 0)
|
|
|
|
+ When the minibuffer is not active for user input (minibuf_level == 0)
|
|
|
|
+ and its character content changes, announce the new text to VoiceOver.
|
|
|
|
+ and its character content changes, announce the new message to
|
|
|
|
+ This surfaces error messages, informational echoes, and git/process
|
|
|
|
+ VoiceOver. This surfaces error messages, completion notices, and
|
|
|
|
+ status updates. We skip the rest of the notification cycle (cursor
|
|
|
|
+ process status updates (e.g. "Wrote file", "Git finished").
|
|
|
|
+ tracking etc.) because an inactive minibuffer has no meaningful cursor.
|
|
|
|
+
|
|
|
|
+ When minibuf_level > 0 the user is composing a command; fall through
|
|
|
|
+ Priority High interrupts ongoing speech, which matches the urgency
|
|
|
|
+ to normal processing so prompt and completion announcements work. */
|
|
|
|
+ of a status change. While minibuf_level > 0 the user is composing
|
|
|
|
|
|
|
|
+ a command; we fall through to normal cursor and completion tracking
|
|
|
|
|
|
|
|
+ in that case. */
|
|
|
|
+ if (MINI_WINDOW_P (w) && minibuf_level == 0)
|
|
|
|
+ if (MINI_WINDOW_P (w) && minibuf_level == 0)
|
|
|
|
+ {
|
|
|
|
+ {
|
|
|
|
+ ptrdiff_t echo_chars = BUF_CHARS_MODIFF (b);
|
|
|
|
+ ptrdiff_t echo_chars = BUF_CHARS_MODIFF (b);
|
|
|
|
@@ -355,23 +348,24 @@ index 8d44b5f..251a03e 100644
|
|
|
|
ptrdiff_t modiff = BUF_MODIFF (b);
|
|
|
|
ptrdiff_t modiff = BUF_MODIFF (b);
|
|
|
|
ptrdiff_t point = BUF_PT (b);
|
|
|
|
ptrdiff_t point = BUF_PT (b);
|
|
|
|
BOOL markActive = !NILP (BVAR (b, mark_active));
|
|
|
|
BOOL markActive = !NILP (BVAR (b, mark_active));
|
|
|
|
@@ -9488,6 +9657,15 @@ frameworks like Vertico bump BOTH BUF_MODIFF (via text property
|
|
|
|
@@ -9488,6 +9657,16 @@ frameworks like Vertico bump BOTH BUF_MODIFF (via text property
|
|
|
|
granularity = ns_ax_text_selection_granularity_line;
|
|
|
|
granularity = ns_ax_text_selection_granularity_line;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /* Non-sequential jumps that cross a line boundary (e.g. ]], [[,
|
|
|
|
+ /* Programmatic jumps that cross a line boundary (]], [[, M-<,
|
|
|
|
+ M-<, xref, imenu) are discontiguous: the cursor moved to an
|
|
|
|
+ xref, imenu, …) are discontiguous: the cursor teleported to an
|
|
|
|
+ arbitrary location, not one sequential step. Reporting direction
|
|
|
|
+ arbitrary position, not one sequential step forward/backward.
|
|
|
|
+ discontiguous causes VoiceOver to re-anchor its rotor browse
|
|
|
|
+ Reporting AXTextSelectionDirectionDiscontiguous causes VoiceOver
|
|
|
|
+ cursor to the new accessibilitySelectedTextRange instead of
|
|
|
|
+ to re-anchor its rotor browse cursor at the new
|
|
|
|
+ advancing linearly from its previous position. */
|
|
|
|
+ accessibilitySelectedTextRange rather than advancing linearly
|
|
|
|
|
|
|
|
+ from its previous internal position. */
|
|
|
|
+ if (!isCtrlNP && granularity == ns_ax_text_selection_granularity_line)
|
|
|
|
+ if (!isCtrlNP && granularity == ns_ax_text_selection_granularity_line)
|
|
|
|
+ direction = ns_ax_text_selection_direction_discontiguous;
|
|
|
|
+ direction = ns_ax_text_selection_direction_discontiguous;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
/* Post notifications for focused and non-focused elements. */
|
|
|
|
/* Post notifications for focused and non-focused elements. */
|
|
|
|
if ([self isAccessibilityFocused])
|
|
|
|
if ([self isAccessibilityFocused])
|
|
|
|
[self postFocusedCursorNotification:point
|
|
|
|
[self postFocusedCursorNotification:point
|
|
|
|
@@ -9931,6 +10109,10 @@ - (void)dealloc
|
|
|
|
@@ -9931,6 +10110,10 @@ - (void)dealloc
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
[accessibilityElements release];
|
|
|
|
[accessibilityElements release];
|
|
|
|
@@ -382,7 +376,7 @@ index 8d44b5f..251a03e 100644
|
|
|
|
[[self menu] release];
|
|
|
|
[[self menu] release];
|
|
|
|
[super dealloc];
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -11380,6 +11562,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f
|
|
|
|
@@ -11380,6 +11563,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f
|
|
|
|
|
|
|
|
|
|
|
|
windowClosing = NO;
|
|
|
|
windowClosing = NO;
|
|
|
|
processingCompose = NO;
|
|
|
|
processingCompose = NO;
|
|
|
|
@@ -392,7 +386,7 @@ index 8d44b5f..251a03e 100644
|
|
|
|
scrollbarsNeedingUpdate = 0;
|
|
|
|
scrollbarsNeedingUpdate = 0;
|
|
|
|
fs_state = FULLSCREEN_NONE;
|
|
|
|
fs_state = FULLSCREEN_NONE;
|
|
|
|
fs_before_fs = next_maximized = -1;
|
|
|
|
fs_before_fs = next_maximized = -1;
|
|
|
|
@@ -12688,6 +12873,80 @@ - (id)accessibilityFocusedUIElement
|
|
|
|
@@ -12688,6 +12874,80 @@ - (id)accessibilityFocusedUIElement
|
|
|
|
The existing elements carry cached state (modiff, point) from the
|
|
|
|
The existing elements carry cached state (modiff, point) from the
|
|
|
|
previous redisplay cycle. Rebuilding first would create fresh
|
|
|
|
previous redisplay cycle. Rebuilding first would create fresh
|
|
|
|
elements with current values, making change detection impossible. */
|
|
|
|
elements with current values, making change detection impossible. */
|
|
|
|
@@ -473,7 +467,7 @@ index 8d44b5f..251a03e 100644
|
|
|
|
- (void)postAccessibilityUpdates
|
|
|
|
- (void)postAccessibilityUpdates
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NSTRACE ("[EmacsView postAccessibilityUpdates]");
|
|
|
|
NSTRACE ("[EmacsView postAccessibilityUpdates]");
|
|
|
|
@@ -12698,11 +12957,59 @@ - (void)postAccessibilityUpdates
|
|
|
|
@@ -12698,11 +12958,59 @@ - (void)postAccessibilityUpdates
|
|
|
|
|
|
|
|
|
|
|
|
/* Re-entrance guard: VoiceOver callbacks during notification posting
|
|
|
|
/* Re-entrance guard: VoiceOver callbacks during notification posting
|
|
|
|
can trigger redisplay, which calls ns_update_end, which calls us
|
|
|
|
can trigger redisplay, which calls ns_update_end, which calls us
|
|
|
|
|