patches: fix two compile errors (stray unbind_to, voiceoverSetPoint scope)

Two bugs introduced during rebase/amend:

1. Stray 'unbind_to (count, Qnil)' in ns_focus (P0000):
   A hunk was misplaced into ns_focus where 'count' is not declared.
   The comment and unbind_to belonged at the end of ns_zoom_track_completion,
   which already has a correct unbind_to.  Remove the duplicate from ns_focus.

2. 'voiceoverSetPoint = NO' in EmacsView::initFrameFromEmacs: (P0008):
   voiceoverSetPoint is a BOOL ivar of EmacsAXBuffer, not EmacsView.
   Setting it in EmacsView's init method causes 'undeclared identifier'.
   ObjC BOOL ivars zero-initialize to NO automatically.  Remove the line.
   voiceoverSetPoint is consumed/set in EmacsAXBuffer methods only.
This commit is contained in:
2026-03-02 20:36:17 +01:00
parent 010630f33d
commit a64d24cbd9
9 changed files with 29 additions and 43 deletions

View File

@@ -1,4 +1,4 @@
From 66e54b491f6158a160f2191e9549da7e9a666fa2 Mon Sep 17 00:00:00 2001 From cac0509dbcd958d3bc71cac18c414af1543ca993 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz> From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 22:39:35 +0100 Date: Sat, 28 Feb 2026 22:39:35 +0100
Subject: [PATCH 0/8] ns: integrate with macOS Zoom for cursor tracking Subject: [PATCH 0/8] ns: integrate with macOS Zoom for cursor tracking

View File

@@ -1,4 +1,4 @@
From d58eefa46c7673eff2272ebcceea82c031152e10 Mon Sep 17 00:00:00 2001 From af06bbe06123968e08a2ea81ec2c24995f0a91f6 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz> From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 12:58:11 +0100 Date: Sat, 28 Feb 2026 12:58:11 +0100
Subject: [PATCH 1/8] ns: add accessibility base classes and text extraction Subject: [PATCH 1/8] ns: add accessibility base classes and text extraction

View File

@@ -1,4 +1,4 @@
From 07e5007d2ad00a191339286c41ad12aa8439636f Mon Sep 17 00:00:00 2001 From 60f0e223190b158679322411b4186b7a378114e7 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz> From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 12:58:11 +0100 Date: Sat, 28 Feb 2026 12:58:11 +0100
Subject: [PATCH 2/8] ns: implement buffer accessibility element (core Subject: [PATCH 2/8] ns: implement buffer accessibility element (core

View File

@@ -1,4 +1,4 @@
From 6df7e595967100a26599fd9a575f7f947238e2f1 Mon Sep 17 00:00:00 2001 From 7bd0a761b78c1c05fe74e150d841bf15686efbb9 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz> From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 12:58:11 +0100 Date: Sat, 28 Feb 2026 12:58:11 +0100
Subject: [PATCH 3/8] ns: add buffer notification dispatch and mode-line Subject: [PATCH 3/8] ns: add buffer notification dispatch and mode-line

View File

@@ -1,4 +1,4 @@
From e270501ae776e953e369fcfdaf5ba2237c3a44c3 Mon Sep 17 00:00:00 2001 From e4d2760f5e99cb6015fb85e68db37fa766a4ab53 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz> From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 12:58:11 +0100 Date: Sat, 28 Feb 2026 12:58:11 +0100
Subject: [PATCH 4/8] ns: add interactive span elements for Tab navigation Subject: [PATCH 4/8] ns: add interactive span elements for Tab navigation

View File

@@ -1,4 +1,4 @@
From 0ac5f50dfe0a4111a6538e1106b6f4ac5259659e Mon Sep 17 00:00:00 2001 From 7c042d446bddee16a83e4cd8f0050e24e262ef77 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz> From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 12:58:11 +0100 Date: Sat, 28 Feb 2026 12:58:11 +0100
Subject: [PATCH 5/8] ns: integrate accessibility with EmacsView and redisplay Subject: [PATCH 5/8] ns: integrate accessibility with EmacsView and redisplay

View File

@@ -1,4 +1,4 @@
From 7e419d0b59c4d4cbec800306a61eecaaa1921500 Mon Sep 17 00:00:00 2001 From b33ad461f56034270d8461ad48e838f5f36a98da Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz> From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 12:58:11 +0100 Date: Sat, 28 Feb 2026 12:58:11 +0100
Subject: [PATCH 6/8] doc: add VoiceOver accessibility section to macOS Subject: [PATCH 6/8] doc: add VoiceOver accessibility section to macOS

View File

@@ -1,4 +1,4 @@
From c1fa92dbf8caa6faffed7a0813c92bed2f983092 Mon Sep 17 00:00:00 2001 From dd8b0911c8a690aa7110b881b6a88977e2fc67f1 Mon Sep 17 00:00:00 2001
From: Daneel <daneel@sukany.cz> From: Daneel <daneel@sukany.cz>
Date: Mon, 2 Mar 2026 18:39:46 +0100 Date: Mon, 2 Mar 2026 18:39:46 +0100
Subject: [PATCH 7/8] ns: announce overlay completion candidates for VoiceOver Subject: [PATCH 7/8] ns: announce overlay completion candidates for VoiceOver

View File

@@ -1,4 +1,4 @@
From 2de5c652dbcc355549941cc9940bac9f31ab3ea6 Mon Sep 17 00:00:00 2001 From 13da736610fc631a9ea420d6918eefd2791940d3 Mon Sep 17 00:00:00 2001
From: Daneel <daneel@sukany.cz> From: Daneel <daneel@sukany.cz>
Date: Mon, 2 Mar 2026 18:49:13 +0100 Date: Mon, 2 Mar 2026 18:49:13 +0100
Subject: [PATCH 8/8] ns: announce child frame completion candidates for Subject: [PATCH 8/8] ns: announce child frame completion candidates for
@@ -33,8 +33,8 @@ area announcements.
doc/emacs/macos.texi | 14 +- doc/emacs/macos.texi | 14 +-
etc/NEWS | 18 +- etc/NEWS | 18 +-
src/nsterm.h | 20 ++ src/nsterm.h | 20 ++
src/nsterm.m | 515 ++++++++++++++++++++++++++++++++++++++++--- src/nsterm.m | 508 ++++++++++++++++++++++++++++++++++++++++---
4 files changed, 519 insertions(+), 48 deletions(-) 4 files changed, 512 insertions(+), 48 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 8d4a7825d8..03a657f970 100644 index 8d4a7825d8..03a657f970 100644
@@ -149,7 +149,7 @@ index 21a93bc799..bdd40b8eb7 100644
@end @end
diff --git a/src/nsterm.m b/src/nsterm.m diff --git a/src/nsterm.m b/src/nsterm.m
index 523f79d235..a885249f30 100644 index 523f79d235..45f83f3ac6 100644
--- a/src/nsterm.m --- a/src/nsterm.m
+++ b/src/nsterm.m +++ b/src/nsterm.m
@@ -1126,24 +1126,19 @@ Uses CFAbsoluteTimeGetCurrent() (~5 ns, a VDSO read) for timing. */ @@ -1126,24 +1126,19 @@ Uses CFAbsoluteTimeGetCurrent() (~5 ns, a VDSO read) for timing. */
@@ -187,20 +187,7 @@ index 523f79d235..a885249f30 100644
} }
/* Scan overlay before-string / after-string properties in the /* Scan overlay before-string / after-string properties in the
@@ -1464,6 +1459,12 @@ so the visual offset is (ov_line + 1) * line_h from @@ -7407,6 +7402,112 @@ visual line index for Zoom (skip whitespace-only lines
#endif
gsaved = YES;
}
+ /* Unbind record_unwind_current_buffer for both overlay and child
+ frame paths. The overlay path calls unbind_to before return;
+ this call covers the child frame path and the no-candidate path.
+ unbind_to is idempotent if count equals the current specpdl
+ index (i.e. already unbound by the overlay path). */
+ unbind_to (count, Qnil);
}
@@ -7407,6 +7408,112 @@ visual line index for Zoom (skip whitespace-only lines
return nil; return nil;
} }
@@ -313,7 +300,7 @@ index 523f79d235..a885249f30 100644
/* Build accessibility text for window W, skipping invisible text. /* Build accessibility text for window W, skipping invisible text.
Populates *OUT_START with the buffer start charpos. Populates *OUT_START with the buffer start charpos.
Populates *OUT_RUNS with an array of visible runs and *OUT_NRUNS Populates *OUT_RUNS with an array of visible runs and *OUT_NRUNS
@@ -8149,15 +8256,23 @@ - (void)ensureTextCache @@ -8149,15 +8250,23 @@ - (void)ensureTextCache
if (!b) if (!b)
return; return;
@@ -343,7 +330,7 @@ index 523f79d235..a885249f30 100644
if (cachedText && cachedTextModiff == chars_modiff if (cachedText && cachedTextModiff == chars_modiff
&& cachedTextStart == BUF_BEGV (b) && cachedTextStart == BUF_BEGV (b)
&& pt >= cachedTextStart && pt >= cachedTextStart
@@ -8587,6 +8702,11 @@ - (void)setAccessibilitySelectedTextRange:(NSRange)range @@ -8587,6 +8696,11 @@ - (void)setAccessibilitySelectedTextRange:(NSRange)range
[self ensureTextCache]; [self ensureTextCache];
@@ -355,7 +342,7 @@ index 523f79d235..a885249f30 100644
specpdl_ref count = SPECPDL_INDEX (); specpdl_ref count = SPECPDL_INDEX ();
record_unwind_current_buffer (); record_unwind_current_buffer ();
/* Ensure block_input is always matched by unblock_input even if /* Ensure block_input is always matched by unblock_input even if
@@ -9042,15 +9162,23 @@ - (void)postFocusedCursorNotification:(ptrdiff_t)point @@ -9042,15 +9156,23 @@ - (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;
@@ -385,7 +372,7 @@ index 523f79d235..a885249f30 100644
NSAccessibilitySelectedTextChangedNotification, NSAccessibilitySelectedTextChangedNotification,
moveInfo); moveInfo);
@@ -9148,12 +9276,17 @@ user expectation ("w" jumps to next word and reads it). */ @@ -9148,12 +9270,17 @@ user expectation ("w" jumps to next word and reads it). */
} }
} }
@@ -408,7 +395,7 @@ index 523f79d235..a885249f30 100644
if (cachedText if (cachedText
&& granularity == ns_ax_text_selection_granularity_line) && granularity == ns_ax_text_selection_granularity_line)
{ {
@@ -9218,6 +9351,11 @@ - (void)postCompletionAnnouncementForBuffer:(struct buffer *)b @@ -9218,6 +9345,11 @@ - (void)postCompletionAnnouncementForBuffer:(struct buffer *)b
block_input (); block_input ();
specpdl_ref count2 = SPECPDL_INDEX (); specpdl_ref count2 = SPECPDL_INDEX ();
@@ -420,7 +407,7 @@ index 523f79d235..a885249f30 100644
record_unwind_protect_void (unblock_input); record_unwind_protect_void (unblock_input);
record_unwind_current_buffer (); record_unwind_current_buffer ();
if (b != current_buffer) if (b != current_buffer)
@@ -9394,12 +9532,29 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f @@ -9394,12 +9526,29 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
if (!b) if (!b)
return; return;
@@ -450,7 +437,7 @@ index 523f79d235..a885249f30 100644
if (modiff != self.cachedModiff) if (modiff != self.cachedModiff)
{ {
self.cachedModiff = modiff; self.cachedModiff = modiff;
@@ -9413,6 +9568,7 @@ Text property changes (e.g. face updates from @@ -9413,6 +9562,7 @@ Text property changes (e.g. face updates from
{ {
self.cachedCharsModiff = chars_modiff; self.cachedCharsModiff = chars_modiff;
[self postTextChangedNotification:point]; [self postTextChangedNotification:point];
@@ -458,7 +445,7 @@ index 523f79d235..a885249f30 100644
} }
} }
@@ -9435,8 +9591,15 @@ frameworks like Vertico bump BOTH BUF_MODIFF (via text property @@ -9435,8 +9585,15 @@ frameworks like Vertico bump BOTH BUF_MODIFF (via text property
displayed in the minibuffer. In normal editing buffers, displayed in the minibuffer. In normal editing buffers,
font-lock and other modes change BUF_OVERLAY_MODIFF on font-lock and other modes change BUF_OVERLAY_MODIFF on
every redisplay, triggering O(overlays) work per keystroke. every redisplay, triggering O(overlays) work per keystroke.
@@ -476,7 +463,7 @@ index 523f79d235..a885249f30 100644
goto skip_overlay_scan; goto skip_overlay_scan;
int selected_line = -1; int selected_line = -1;
@@ -9482,7 +9645,18 @@ frameworks like Vertico bump BOTH BUF_MODIFF (via text property @@ -9482,7 +9639,18 @@ frameworks like Vertico bump BOTH BUF_MODIFF (via text property
self.cachedPoint = point; self.cachedPoint = point;
self.cachedMarkActive = markActive; self.cachedMarkActive = markActive;
@@ -496,7 +483,7 @@ index 523f79d235..a885249f30 100644
NSInteger direction = ns_ax_text_selection_direction_discontiguous; NSInteger direction = ns_ax_text_selection_direction_discontiguous;
if (point > oldPoint) if (point > oldPoint)
direction = ns_ax_text_selection_direction_next; direction = ns_ax_text_selection_direction_next;
@@ -9530,6 +9704,58 @@ frameworks like Vertico bump BOTH BUF_MODIFF (via text property @@ -9530,6 +9698,58 @@ frameworks like Vertico bump BOTH BUF_MODIFF (via text property
granularity = ns_ax_text_selection_granularity_line; granularity = ns_ax_text_selection_granularity_line;
} }
@@ -555,7 +542,7 @@ index 523f79d235..a885249f30 100644
/* 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
@@ -9672,6 +9898,13 @@ - (NSRect)accessibilityFrame @@ -9672,6 +9892,13 @@ - (NSRect)accessibilityFrame
if (vis_start >= vis_end) if (vis_start >= vis_end)
return @[]; return @[];
@@ -569,7 +556,7 @@ index 523f79d235..a885249f30 100644
block_input (); block_input ();
specpdl_ref blk_count = SPECPDL_INDEX (); specpdl_ref blk_count = SPECPDL_INDEX ();
record_unwind_protect_void (unblock_input); record_unwind_protect_void (unblock_input);
@@ -9796,6 +10029,7 @@ than O(chars). Fall back to pos+1 as safety net. */ @@ -9796,6 +10023,7 @@ than O(chars). Fall back to pos+1 as safety net. */
pos = span_end; pos = span_end;
} }
@@ -577,7 +564,7 @@ index 523f79d235..a885249f30 100644
return [[spans copy] autorelease]; return [[spans copy] autorelease];
} }
@@ -9977,6 +10211,10 @@ - (void)dealloc @@ -9977,6 +10205,10 @@ - (void)dealloc
#endif #endif
[accessibilityElements release]; [accessibilityElements release];
@@ -588,18 +575,17 @@ index 523f79d235..a885249f30 100644
[[self menu] release]; [[self menu] release];
[super dealloc]; [super dealloc];
} }
@@ -11426,6 +11664,10 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f @@ -11426,6 +11658,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f
windowClosing = NO; windowClosing = NO;
processingCompose = NO; processingCompose = NO;
+#ifdef NS_IMPL_COCOA +#ifdef NS_IMPL_COCOA
+ childFrameLastBuffer = Qnil; + childFrameLastBuffer = Qnil;
+ voiceoverSetPoint = NO;
+#endif +#endif
scrollbarsNeedingUpdate = 0; scrollbarsNeedingUpdate = 0;
fs_state = FULLSCREEN_NONE; fs_state = FULLSCREEN_NONE;
fs_before_fs = next_maximized = -1; fs_before_fs = next_maximized = -1;
@@ -12734,6 +12976,154 @@ - (id)accessibilityFocusedUIElement @@ -12734,6 +12969,154 @@ - (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. */
@@ -754,7 +740,7 @@ index 523f79d235..a885249f30 100644
- (void)postAccessibilityUpdates - (void)postAccessibilityUpdates
{ {
NSTRACE ("[EmacsView postAccessibilityUpdates]"); NSTRACE ("[EmacsView postAccessibilityUpdates]");
@@ -12744,11 +13134,64 @@ - (void)postAccessibilityUpdates @@ -12744,11 +13127,64 @@ - (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