patches: fix em-dash and SPECPDL_INDEX ordering
Replace all Unicode em-dashes (---) with ASCII triple-dash (---) across 0001-0007 (39 occurrences). GNU Emacs source files must be ASCII; em-dash in comments would cause encoding issues on some systems. Fix SPECPDL_INDEX() call order in postCompletionAnnouncementForBuffer: (0003): specpdl_ref must be taken BEFORE block_input() so the snapshot captures the pre-block_input specpdl depth. This matches the pattern established in patches 0001 and 0002.
This commit is contained in:
@@ -209,7 +209,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
|
||||
/* 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 (
|
||||
@@ -218,7 +218,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
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;
|
||||
@@ -267,7 +267,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
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. */
|
||||
@@ -354,7 +354,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
/* 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)
|
||||
@@ -363,11 +363,11 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
|
||||
/* 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)
|
||||
{
|
||||
@@ -376,7 +376,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
return cp;
|
||||
}
|
||||
}
|
||||
- /* Past end — return last charpos. */
|
||||
- /* Past end --- return last charpos. */
|
||||
+ /* Past end --- return last charpos. */
|
||||
if (lo > 0)
|
||||
{
|
||||
@@ -385,7 +385,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
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.
|
||||
@@ -462,7 +462,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
|
||||
|
||||
/* ===================================================================
|
||||
- EmacsAccessibilityBuffer (Notifications) — AX event dispatch
|
||||
- EmacsAccessibilityBuffer (Notifications) --- AX event dispatch
|
||||
+ EmacsAccessibilityBuffer (Notifications) --- AX event dispatch
|
||||
|
||||
These methods notify VoiceOver of text and selection changes.
|
||||
@@ -471,7 +471,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
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];
|
||||
@@ -480,7 +480,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
/* 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;
|
||||
|
||||
@@ -562,7 +562,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
}
|
||||
|
||||
/* --- 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 from the overlay branch above. */
|
||||
@@ -590,7 +590,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
|
||||
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]];
|
||||
@@ -599,7 +599,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
}
|
||||
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))
|
||||
@@ -608,7 +608,7 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
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))
|
||||
@@ -617,13 +617,13 @@ index e4e43dd7a3..c9fe93a57b 100644
|
||||
}
|
||||
|
||||
/* 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]])
|
||||
|
||||
Reference in New Issue
Block a user