patches: fix all non-ASCII, PATCH numbering, block_input order, pkg names

- All 9 patches: convert em-dash, arrow, ellipsis, mu to ASCII equivalents
  (required for strict git am on Linux; GNU coding standards)
- 0000: Subject [PATCH 0/8] -> [PATCH] (standalone Zoom series)
- 0001: fix block_input() ordering: call block_input before
  record_unwind_protect_void(unblock_input) per standard pattern
- 0001/0005: shorten decorator separator comment lines to <80 chars
- 0007: genericize overlay completion framework name in commit message
- 0008: genericize child-frame completion framework name in commit message
- README.txt: fix stale 'default t' to 'default nil' with auto-detection note
- TESTING.txt: fix stale 'defaults to t' to 'defaults to nil'
This commit is contained in:
2026-03-03 13:12:25 +01:00
parent b6b2fe34e1
commit aa0388d485
11 changed files with 121 additions and 147 deletions

View File

@@ -1,11 +1,11 @@
From affdaf60d28ad4d9836c6505216e19599b31c437 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
From: Daneel <daneel@sukany.cz>
Date: Mon, 2 Mar 2026 18:39:46 +0100
Subject: [PATCH 7/8] ns: announce overlay completion candidates for VoiceOver
Overlay-based completion frameworks render candidates via overlay
before-string/after-string properties (e.g., Vertico, Icomplete,
Ivy). Without this change VoiceOver cannot read these completion UIs.
Completion frameworks such as overlay-based completion frameworks, Ivy, and Icomplete render
candidates via overlay before-string/after-string properties. Without
this change VoiceOver cannot read overlay-based completion UIs.
* src/nsterm.m (ns_ax_face_is_selected): New static function; matches
'current', 'selected', 'selection' in face symbol names.
@@ -18,8 +18,8 @@ ValueChanged; keep overlay_modiff out of ensureTextCache to prevent a
race where an AX query consumes the change before notification.
---
src/nsterm.h | 1 +
src/nsterm.m | 352 ++++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 311 insertions(+), 42 deletions(-)
src/nsterm.m | 348 ++++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 307 insertions(+), 42 deletions(-)
diff --git a/src/nsterm.h b/src/nsterm.h
index 5746e9e9bd..21a93bc799 100644
@@ -37,13 +37,10 @@ diff --git a/src/nsterm.m b/src/nsterm.m
index 8e5cc7e1d7..8ef344d9fe 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7266,11 +7266,158 @@ Accessibility virtual elements (macOS / Cocoa only)
@@ -7263,11 +7263,154 @@ Accessibility virtual elements (macOS / Cocoa only)
/* ---- Helper: extract buffer text for accessibility ---- */
+/* Note: ns_zoom_face_is_selected in the Zoom series has identical
+ logic. The duplication is intentional: both series are independent
+ and must compile standalone. */
+/* Return true if FACE is or contains a face symbol whose name
+ includes "current" or "selected", indicating a highlighted
+ completion candidate. Works for vertico-current,
@@ -188,7 +185,6 @@ index 8e5cc7e1d7..8ef344d9fe 100644
+
+ return nil;
+}
+
/* Build accessibility text for window W, skipping invisible text.
Populates *OUT_START with the buffer start charpos.
Populates *OUT_RUNS with an array of visible runs and *OUT_NRUNS
@@ -197,25 +193,25 @@ index 8e5cc7e1d7..8ef344d9fe 100644
static NSString *
ns_ax_buffer_text (struct window *w, ptrdiff_t *out_start,
ns_ax_visible_run **out_runs, NSUInteger *out_nruns)
@@ -7343,7 +7489,7 @@ Accessibility virtual elements (macOS / Cocoa only)
@@ -7340,7 +7483,7 @@ Accessibility virtual elements (macOS / Cocoa only)
/* Extract this visible run's text. Use
Fbuffer_substring_no_properties which correctly handles the
- buffer gap raw BUF_BYTE_ADDRESS reads across the gap would
- buffer gap --- raw BUF_BYTE_ADDRESS reads across the gap would
+ buffer gap --- raw BUF_BYTE_ADDRESS reads across the gap would
include garbage bytes when the run spans the gap position. */
Lisp_Object lstr = Fbuffer_substring_no_properties (
make_fixnum (pos), make_fixnum (run_end));
@@ -7424,7 +7570,7 @@ Mode lines using icon fonts (e.g. nerd-font icons)
@@ -7421,7 +7564,7 @@ Mode lines using icon fonts (e.g. nerd-font icons)
return NSZeroRect;
/* charpos_start and charpos_len are already in buffer charpos
- space the caller maps AX string indices through
- space --- the caller maps AX string indices through
+ space --- the caller maps AX string indices through
charposForAccessibilityIndex which handles invisible text. */
ptrdiff_t cp_start = charpos_start;
ptrdiff_t cp_end = cp_start + charpos_len;
@@ -7899,6 +8045,7 @@ @implementation EmacsAccessibilityBuffer
@@ -7896,6 +8039,7 @@ @implementation EmacsAccessibilityBuffer
@synthesize cachedOverlayModiff;
@synthesize cachedTextStart;
@synthesize cachedModiff;
@@ -223,16 +219,16 @@ index 8e5cc7e1d7..8ef344d9fe 100644
@synthesize cachedPoint;
@synthesize cachedMarkActive;
@synthesize cachedCompletionAnnouncement;
@@ -7996,7 +8143,7 @@ - (void)ensureTextCache
@@ -7993,7 +8137,7 @@ - (void)ensureTextCache
NSTRACE ("EmacsAccessibilityBuffer ensureTextCache");
/* This method is only called from the main thread (AX getters
dispatch_sync to main first). Reads of cachedText/cachedTextModiff
- below are therefore safe without @synchronized only the
- below are therefore safe without @synchronized --- only the
+ below are therefore safe without @synchronized --- only the
write section at the end needs synchronization to protect
against concurrent reads from AX server thread. */
eassert ([NSThread isMainThread]);
@@ -8008,25 +8155,34 @@ - (void)ensureTextCache
@@ -8005,25 +8149,34 @@ - (void)ensureTextCache
if (!b)
return;
@@ -284,7 +280,7 @@ index 8e5cc7e1d7..8ef344d9fe 100644
&& cachedTextStart == BUF_BEGV (b)
&& pt >= cachedTextStart
&& (textLen == 0
@@ -8042,7 +8198,7 @@ included in the cached AX text (it is handled separately via
@@ -8039,7 +8192,7 @@ included in the cached AX text (it is handled separately via
{
[cachedText release];
cachedText = [text retain];
@@ -293,7 +289,7 @@ index 8e5cc7e1d7..8ef344d9fe 100644
cachedTextStart = start;
if (visibleRuns)
@@ -8054,9 +8210,9 @@ included in the cached AX text (it is handled separately via
@@ -8051,9 +8204,9 @@ 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
@@ -306,47 +302,47 @@ index 8e5cc7e1d7..8ef344d9fe 100644
enters this code. */
if (lineStartOffsets)
xfree (lineStartOffsets);
@@ -8111,7 +8267,7 @@ - (NSUInteger)accessibilityIndexForCharpos:(ptrdiff_t)charpos
@@ -8108,7 +8261,7 @@ - (NSUInteger)accessibilityIndexForCharpos:(ptrdiff_t)charpos
/* Binary search: runs are sorted by charpos (ascending). Find the
run whose [charpos, charpos+length) range contains the target,
or the nearest run after an invisible gap. O(log n) instead of
- O(n) matters for org-mode with many folded sections. */
- O(n) --- matters for org-mode with many folded sections. */
+ O(n) --- matters for org-mode with many folded sections. */
NSUInteger lo = 0, hi = visibleRunCount;
while (lo < hi)
{
@@ -8160,10 +8316,10 @@ by run length (visible window), not total buffer size. */
@@ -8157,10 +8310,10 @@ by run length (visible window), not total buffer size. */
/* Convert accessibility string index to buffer charpos.
Safe to call from any thread: uses only cachedText (NSString) and
- visibleRuns no Lisp calls. */
- visibleRuns --- no Lisp calls. */
+ visibleRuns --- no Lisp calls. */
- (ptrdiff_t)charposForAccessibilityIndex:(NSUInteger)ax_idx
{
- /* May be called from AX server thread synchronize. */
- /* May be called from AX server thread --- synchronize. */
+ /* May be called from AX server thread --- synchronize. */
@synchronized (self)
{
if (visibleRunCount == 0)
@@ -8205,7 +8361,7 @@ the slow path (composed character sequence walk), which is
@@ -8202,7 +8355,7 @@ the slow path (composed character sequence walk), which is
return cp;
}
}
- /* Past end return last charpos. */
- /* Past end --- return last charpos. */
+ /* Past end --- return last charpos. */
if (lo > 0)
{
ns_ax_visible_run *last = &visibleRuns[visibleRunCount - 1];
@@ -8227,7 +8383,7 @@ the slow path (composed character sequence walk), which is
@@ -8224,7 +8377,7 @@ the slow path (composed character sequence walk), which is
deadlocking the AX server thread. This is prevented by:
1. validWindow checks WINDOW_LIVE_P and BUFFERP before every
- Lisp access the window and buffer are verified live.
- Lisp access --- the window and buffer are verified live.
+ Lisp access --- the window and buffer are verified live.
2. All dispatch_sync blocks run on the main thread where no
concurrent Lisp code can modify state between checks.
3. block_input prevents timer events and process output from
@@ -8573,6 +8729,50 @@ - (NSInteger)accessibilityInsertionPointLineNumber
@@ -8570,6 +8723,50 @@ - (NSInteger)accessibilityInsertionPointLineNumber
return [self lineForAXIndex:point_idx];
}
@@ -397,34 +393,34 @@ index 8e5cc7e1d7..8ef344d9fe 100644
- (NSRange)accessibilityRangeForLine:(NSInteger)line
{
if (![NSThread isMainThread])
@@ -8795,7 +8995,7 @@ - (NSRect)accessibilityFrame
@@ -8792,7 +8989,7 @@ - (NSRect)accessibilityFrame
/* ===================================================================
- EmacsAccessibilityBuffer (Notifications) AX event dispatch
- EmacsAccessibilityBuffer (Notifications) --- AX event dispatch
+ EmacsAccessibilityBuffer (Notifications) --- AX event dispatch
These methods notify VoiceOver of text and selection changes.
Called from the redisplay cycle (postAccessibilityUpdates).
@@ -8810,7 +9010,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
@@ -8807,7 +9004,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
if (point > self.cachedPoint
&& point - self.cachedPoint == 1)
{
- /* Single char inserted refresh cache and grab it. */
- /* Single char inserted --- refresh cache and grab it. */
+ /* Single char inserted --- refresh cache and grab it. */
[self invalidateTextCache];
[self ensureTextCache];
if (cachedText)
@@ -8829,7 +9029,7 @@ - (void)postTextChangedNotification:(ptrdiff_t)point
@@ -8826,7 +9023,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
- same user action they are mutually exclusive. */
- same user action --- they are mutually exclusive. */
+ same user action --- they are mutually exclusive. */
self.cachedPoint = point;
NSDictionary *change = @{
@@ -9223,16 +9423,83 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
@@ -9220,16 +9417,83 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f
BOOL markActive = !NILP (BVAR (b, mark_active));
/* --- Text changed (edit) --- */
@@ -503,7 +499,7 @@ index 8e5cc7e1d7..8ef344d9fe 100644
+ skip_overlay_scan:;
/* --- Cursor moved or selection changed ---
- Use 'else if' edits and selection moves are mutually exclusive
- Use 'else if' --- edits and selection moves are mutually exclusive
- per the WebKit/Chromium pattern. */
- else if (point != self.cachedPoint || markActive != self.cachedMarkActive)
+ Independent check: the goto above may jump here from the overlay
@@ -512,44 +508,44 @@ index 8e5cc7e1d7..8ef344d9fe 100644
{
ptrdiff_t oldPoint = self.cachedPoint;
BOOL oldMarkActive = self.cachedMarkActive;
@@ -12406,7 +12673,7 @@ - (int) fullscreenState
@@ -12403,7 +12667,7 @@ - (int) fullscreenState
if (WINDOW_LEAF_P (w))
{
- /* Buffer element reuse existing if available. */
- /* Buffer element --- reuse existing if available. */
+ /* Buffer element --- reuse existing if available. */
EmacsAccessibilityBuffer *elem
= [existing objectForKey:[NSValue valueWithPointer:w]];
if (!elem)
@@ -12440,7 +12707,7 @@ - (int) fullscreenState
@@ -12437,7 +12701,7 @@ - (int) fullscreenState
}
else
{
- /* Internal (combination) window recurse into children. */
- /* Internal (combination) window --- recurse into children. */
+ /* Internal (combination) window --- recurse into children. */
Lisp_Object child = w->contents;
while (!NILP (child))
{
@@ -12552,7 +12819,7 @@ - (void)postAccessibilityUpdates
@@ -12549,7 +12813,7 @@ - (void)postAccessibilityUpdates
accessibilityUpdating = YES;
/* Detect window tree change (split, delete, new buffer). Compare
- FRAME_ROOT_WINDOW if it changed, the tree structure changed. */
- FRAME_ROOT_WINDOW --- if it changed, the tree structure changed. */
+ FRAME_ROOT_WINDOW --- if it changed, the tree structure changed. */
Lisp_Object curRoot = FRAME_ROOT_WINDOW (emacsframe);
if (!EQ (curRoot, lastRootWindow))
{
@@ -12561,12 +12828,12 @@ - (void)postAccessibilityUpdates
@@ -12558,12 +12822,12 @@ - (void)postAccessibilityUpdates
}
/* If tree is stale, rebuild FIRST so we don't iterate freed
- window pointers. Skip notifications for this cycle the
- window pointers. Skip notifications for this cycle --- the
+ window pointers. Skip notifications for this cycle --- the
freshly-built elements have no previous state to diff against. */
if (!accessibilityTreeValid)
{
[self rebuildAccessibilityTree];
- /* Invalidate span cache window layout changed. */
- /* Invalidate span cache --- window layout changed. */
+ /* Invalidate span cache --- window layout changed. */
for (EmacsAccessibilityElement *elem in accessibilityElements)
if ([elem isKindOfClass: [EmacsAccessibilityBuffer class]])