Commit Graph

204 Commits

Author SHA1 Message Date
bbd328dc81 fix: patch hunk 8 old_count 7→6 (trailer miscount) 2026-02-28 09:10:53 +01:00
b002d3004a patches: fix MRC build — add @synthesize for spanLabel/spanValue 2026-02-27 22:25:36 +01:00
d408a542e5 patches: review fixes — defvar, method extraction, GC safety, window_end_valid
Review-based improvements:
- ns-accessibility-enabled DEFVAR_BOOL (disable AX overhead)
- window_end_valid guard in ns_ax_window_end_charpos
- GC safety comments on Lisp_Object ObjC ivars
- postAccessibilityNotificationsForFrame split into 4 methods
- block_input in ns_ax_completion_text_for_span
- Fplist_get predicate comment
- macos.texi VoiceOver section with defvar docs
- README updated with USER OPTION + REVIEW CHANGES sections
2026-02-27 17:51:39 +01:00
b83a061322 patches: review fixes — eassert, blank lines, Texinfo doc
- nsterm.m: Remove 2 stray blank lines at start of
  ns_ax_event_is_line_nav_key body
- nsterm.m: Add eassert([NSThread isMainThread]) to ensureTextCache
  for explicit main-thread contract enforcement
- New 0002 patch: Texinfo section in doc/emacs/macos.texi documenting
  VoiceOver accessibility, Zoom tracking, completion announcements
- README.txt: Updated file listing and patch index
2026-02-27 17:15:18 +01:00
65c799dc3f patches: review fixes — specpdl protection, overlay_modiff tracking, binary search, enum cleanup
M1: accessibilityRangeForPosition uses specpdl unwind protection for
    block_input/unblock_input (consistent with all other methods).
M2: Track BUF_OVERLAY_MODIFF in ensureTextCache — overlay-only changes
    (timer-based completion highlight) now invalidate the text cache.
M3: Detect narrowing/widening by comparing cachedTextStart vs BUF_BEGV.
m1: Binary search (O(log n)) for visible runs in both
    accessibilityIndexForCharpos and charposForAccessibilityIndex.
m3: Add EmacsAXSpanTypeNone = -1 to enum instead of (EmacsAXSpanType)-1 cast.
m5: Add TODO comment in ns_ax_mode_line_text about non-CHAR_GLYPH limitation.
README: Remove resolved overlay_modiff limitation, document binary search
    and narrowing detection, update architecture section.
2026-02-27 16:56:05 +01:00
765725aaef patches: fix review B1/W1-5 — unwind protection, dealloc leak, DEFSYM nav, lineRange, buffer validation, select-window
B1: setAccessibilitySelectedTextRange: — add record_unwind_protect_void(unblock_input)
    before block_input to prevent permanently blocked input if Fset_marker signals.
W1: EmacsAccessibilityInteractiveSpan — add -dealloc releasing spanLabel/spanValue
    (MRC copy properties leaked on every span rebuild cycle).
W2: ns_ax_event_is_line_nav_key — replace 8x intern_c_string with DEFSYM'd symbols
    (Qns_ax_next_line etc.) to avoid per-cursor-move obarray lookups.
W3: accessibilityRangeForLine: — rewrite from O(n chars) characterAtIndex loop to
    O(lines) lineRangeForRange, matching accessibilityLineForIndex: pattern.
W4: accessibilityChildrenInNavigationOrder — validate buffer before calling
    ns_ax_scan_interactive_spans to prevent Lisp signals in dispatch_sync context.
W5: EmacsAccessibilityBuffer setAccessibilityFocused: — add Fselect_window so
    VoiceOver focus actually switches the Emacs selected window, with proper
    unwind protection for block_input.
2026-02-27 16:38:12 +01:00
936c251f11 patches: comprehensive review fixes — B1/W1-4/M1-4
B1: setAccessibilityFocused: on EmacsAccessibilityBuffer now checks
    ![NSThread isMainThread] and dispatches to main via dispatch_async.
    Prevents data race + AppKit thread violation from AX server thread.

W1: accessibilityInsertionPointLineNumber and accessibilityLineForIndex:
    now use lineRangeForRange iteration — O(lines) instead of O(chars).

W2: ns_ax_scan_interactive_spans skips non-interactive regions using
    Fnext_single_property_change for each scannable property and
    Fnext_single_char_property_change for keymap overlays.

W3: ns_ax_event_is_line_nav_key inspects Vthis_command against known
    navigation command symbols (next-line, previous-line, evil variants,
    dired variants) instead of raw key codes. Tab/backtab fallback
    retained via last_command_event.

W4: DEFSYM symbols renamed with ns_ax_ prefix (Qns_ax_button, etc.)
    to avoid linker collisions with other Emacs source files.
    Lisp symbol strings unchanged.

M3: Removed dead enum values (CheckBox, TextField, PopUpButton) and
    corresponding dead switch cases.

M4: Improved accessibilityStyleRangeForIndex: comment documenting the
    line-granularity simplification.

README: Updated stats, KNOWN LIMITATIONS, DEFSYM docs, test numbering.
2026-02-27 16:14:47 +01:00
Martin Sukany
a6a3aca678 remove some stale files 2026-02-27 15:47:21 +01:00
60e9ea2c59 patches: update README — document async notification posting
Add deadlock prevention section to THREADING MODEL, note async
posting in NOTIFICATION STRATEGY, add design decision 6a, and
add deadlock regression test case (#24) to testing checklist.
2026-02-27 15:44:22 +01:00
111013ddf1 patches: fix VoiceOver deadlock — async AX notification posting
NSAccessibilityPostNotification may synchronously invoke VoiceOver
callbacks from a background AX server thread.  Those callbacks call
dispatch_sync(main_queue) to read buffer state.  If the main thread
is still inside the notification-posting method (postAccessibilityUpdates,
windowDidBecomeKey, or postAccessibilityNotificationsForFrame), the
dispatch_sync deadlocks.

Symptom: Emacs hangs on C-x o after M-x list-buffers from Completions
buffer, but only with VoiceOver enabled.

Fix: introduce ns_ax_post_notification() and
ns_ax_post_notification_with_info() wrappers that defer notification
posting via dispatch_async(main_queue).  This lets the current method
return and frees the main queue for VoiceOver's dispatch_sync calls.

All 14 notification-posting sites now use the async wrappers.
2026-02-27 15:41:26 +01:00
fa3ee7cc88 fix: correct patch hunk headers after static BOOL insertion
The previous sed edit added a line but didn't update @@ hunk
headers, causing 'corrupt patch at line 2849'. Fixed:
- Main hunk: 2386 -> 2387 new-side lines
- Subsequent hunks: +1 offset on new-file line numbers
2026-02-27 15:23:19 +01:00
d29a33fcfb fix: add missing 'static BOOL' return type to ns_ax_find_completion_overlay_range
The function definition lacked a return type, causing:
  nsterm.m:7149:1: error: a type specifier is required for all declarations

Added 'static BOOL' — the function returns YES/NO and is file-scoped.
Updated patch line counts in header and README accordingly.
2026-02-27 15:21:47 +01:00
0b43fd25e3 patches: review fixes — memory leak, dead code, unwind-protect, protocol conformance
B1: Fix memory leak in ns_ax_scan_interactive_spans — [spans copy]
    returned +1 retained object never released by caller.
    Now returns [[spans copy] autorelease].

B2: Remove dead function ns_ax_utf16_length_for_buffer_range —
    defined but never called anywhere in the patch.

B3: Add specpdl unwind protection in
    EmacsAccessibilityInteractiveSpan setAccessibilityFocused: —
    if Fselect_window signals, block_input is now always matched
    by unblock_input via record_unwind_protect_void.

W2: Document ns_ax_event_is_line_nav_key fragility in README
    Known Limitations (raw keycodes vs command symbols).

W4: Add comment for #include intervals.h (TEXT_PROP_MEANS_INVISIBLE).

M3: accessibilityBoundsForRange: on EmacsView now delegates to the
    focused EmacsAccessibilityBuffer for accurate per-range geometry,
    with cursor-rect fallback for Zoom.

M4: Add <NSAccessibility> protocol conformance to
    EmacsAccessibilityBuffer @interface declaration.

W1: Expanded commit message listing all new types, functions, DEFSYM
    additions, and threading model.
2026-02-27 15:12:40 +01:00
6994403014 patches: complete thread safety — dispatch_sync on ALL AX methods
Add dispatch_sync guard to: Buffer accessibilityFrame, accessibilityLabel,
accessibilityRole, accessibilityRoleDescription, accessibilityPlaceholderValue,
isAccessibilityFocused. ModeLine accessibilityValue, accessibilityFrame,
accessibilityLabel. setAccessibilitySelectedTextRange now uses
record_unwind_current_buffer + unbind_to.
2026-02-27 14:55:03 +01:00
e4129581b7 patches: unify AX threading — dispatch_sync on all getter methods
8 methods were missing thread guards: accessibilityNumberOfCharacters,
accessibilitySelectedText, accessibilityStringForRange:,
accessibilityLineForIndex:, accessibilityRangeForLine:,
accessibilityRangeForIndex:, accessibilityVisibleCharacterRange,
setAccessibilitySelectedTextRange:.

All AX getters now consistently dispatch_sync to main thread.
GC safety comment added to InteractiveSpan setAccessibilityFocused:.
2026-02-27 14:49:33 +01:00
404d26e2fe patches: R3 — add missing NSTRACE to 3 EmacsView methods 2026-02-27 14:37:11 +01:00
1ecb9908af patches: maintainer review R2 fixes — all must-fix items resolved
- unwind-protect in ns_ax_utf16_length_for_buffer_range
- unwind-protect in ns_ax_completion_text_for_span
- unwind-protect in postAccessibilityNotificationsForFrame
- NSTRACE added to all 4 key functions (3 were missing)
- O(n) mouse-face scan → Fprevious/Fnext_single_char_property_change
- etc/NEWS entry added to patch
- Main-thread invariant comment in ensureTextCache
2026-02-27 14:35:04 +01:00
eafc80e324 patches: maintainer review fixes — thread safety, performance, safety
BLOCKER fixes:
- @synchronized on visibleRuns/cachedText (AX thread data race)
- Foverlays_in bulk query replaces O(n) per-char Foverlays_at loop

WARNING fixes:
- record_unwind_current_buffer in ns_ax_buffer_text
- ns_ax_frame_for_range simplified (charpos params, no NSRange indirection)
- NSTRACE added to 4 key accessibility functions
- MAC_OS_X_VERSION_MIN_REQUIRED guard for UAZoom APIs
- BUF_OVERLAY_MODIFF TODO in ensureTextCache
2026-02-27 14:29:41 +01:00
4eb370f6f0 patches: add README.txt — full VoiceOver architecture documentation
QA PASS 93.2/100. Covers: architecture, threading model, notification
strategy, text cache, completion announcements, interactive spans,
Zoom integration, design decisions, known limitations, testing checklist.
2026-02-27 13:59:08 +01:00
33eff6e9f8 patches: QA round 2 PASS (93.5/100) — final indentation fix + ChangeLog commit message 2026-02-27 13:38:30 +01:00
95b5271e35 patches: QA round 1 — all 13 issues fixed
- Delete dead ns_ax_command_is_basic_line_move
- Rename ns_ax_event_is_ctrl_n_or_p → ns_ax_event_is_line_nav_key
- Fix DEFSYM naming (Qwidget/Qbutton/Qfollow_link/Qorg_link/Qcompletion_list_mode)
- DEFSYM for hot-path symbols (Qcompletion__string, Qcompletions_highlight, Qbacktab)
- Remove duplicate overlay scan in else branch
- Add accessibilityStringForRange: to EmacsView (legacy API fix)
- Replace @try/@finally with explicit re-entrance guard
- Replace NSCAssert with eassert
- Wrap all lines to ≤79 columns (dispatch_sync, NSDictionary literals)
- Add missing comments (NS_AX_TEXT_CAP, sentinel values, @public, block_input)
- Fix indentation of cachedCompletionPoint lines
- Remove orphan @protected
2026-02-27 13:34:33 +01:00
7971f42600 patches: restore full-line AnnouncementRequested for C-n/C-p 2026-02-27 12:59:32 +01:00
3447fcc8d5 patches: hybrid notification — SelectedTextChanged + selective AnnouncementRequested
- SelectedTextChanged always posted (interrupts auto-read, braille)
- Character moves: granularity omitted from userInfo + AnnouncementRequested(char AT point)
- Word moves: granularity=word in userInfo (VoiceOver reads word) — fixes M-f/M-b
- Line moves: granularity=line in userInfo (VoiceOver reads line)
- Completion in focused buffer: AnnouncementRequested overrides line
2026-02-27 12:49:55 +01:00
495a5510c6 patches: AnnouncementRequested PriorityMedium→High (interrupt buffer reading) 2026-02-27 12:37:42 +01:00
8a834448f9 patches: systematic notification strategy — eliminate double-speech
SelectedTextChanged → only for selection changes (mark active)
AnnouncementRequested → only for cursor moves (char/line)
Never both for the same event. Fixes double-speech globally.
2026-02-27 12:27:20 +01:00
edad606809 patches: fix double-speech and evil block cursor char reading
- SelectedTextChanged posted only for focused element: prevents completion
  buffer from triggering double-speech (old-candidate + new-candidate)
- AnnouncementRequested for char navigation restored (evil block cursor fix):
  posted AFTER SelectedTextChanged so VoiceOver cancels its own reading
  and uses our explicit char-at-point announcement
- Priority: Medium (was High)
2026-02-27 12:16:32 +01:00
5f98a78467 patches: fix 5 critical issues in VoiceOver patch
- Remove static Lisp_Object locals; use DEFSYM in syms_of_nsterm (GC-safe)
- Replace Lisp calls in accessibilityIndexForCharpos / charposForAccessibilityIndex
  with NSString composed-character traversal (thread-safe, no Lisp needed)
- isAccessibilityFocused reads cachedPoint instead of marker_position off-thread
- Remove double-announcement: character nav uses only SelectedTextChanged
- Line announcement priority: High → Medium (avoid suppressing VO feedback)
2026-02-27 12:07:19 +01:00
3df5dc94b1 patches: fix char nav — announce char AT point, not before it (evil block cursor) 2026-02-27 11:48:42 +01:00
75c1b471c4 patches: fix granularity — line comparison not delta, fixes org-mode empty lines 2026-02-27 11:36:08 +01:00
8890e659e1 patches: systematic line announcement (granularity=line, all modes) 2026-02-27 11:14:30 +01:00
0110670734 patches: fix broken function insertion (build error) 2026-02-27 11:06:14 +01:00
f306599d94 patches: fix completion announcement (CONSP completion--string, focused+unfocused paths) 2026-02-27 11:01:22 +01:00
c138bdc6d5 patches: remove accessibilityChildren override (C-n/C-p line nav regression fix) 2026-02-27 10:47:54 +01:00
5f08e0a315 patches: fix completion span boundary (completion--string vs mouse-face) 2026-02-27 10:42:31 +01:00
23102444d4 patches: fix build errors (Fplist_get arity, MRC weak, duplicate decl) 2026-02-27 10:31:02 +01:00
92ef24332f patches: add EmacsAccessibilityInteractiveSpan (VoiceOver Tab nav, buttons, links, completions) 2026-02-27 10:26:29 +01:00
7a0e7722f7 patches: fix Tab navigation in completion buffer (probe order + Tab detection) 2026-02-27 10:10:39 +01:00
1245253e15 patches: fix B1 (live window ref), B2 (matrix guard), B3 (invisibility-spec), H1 (thread safety), H4 (main thread assert) 2026-02-27 09:57:10 +01:00
081d1c01e7 patches: restore postAccessibilityUpdates in ns_update_end (VoiceOver broken after rebase) 2026-02-27 09:39:42 +01:00
d11aa168b9 patches: fix Vreal_this_command linker error, squash into single patch 2026-02-27 07:43:13 +01:00
f37e06b00f patches: rebase on upstream f0dbe25 + fix NSRange return type 2026-02-27 07:38:18 +01:00
7419d9b0e4 patches: regenerate from actual emacs repo (fix src/ path prefix) 2026-02-27 07:31:44 +01:00
368f9600df patches: fix NSRange return type bug in accessibilitySelectedTextRange 2026-02-27 07:29:56 +01:00
97776b5141 Fix patch after 3-reviewer pipeline review
- BLOCKER: real_this_command → Vreal_this_command (DEFVAR_LISP uses V prefix)
- Thread safety: setAccessibilitySelectedTextRange dispatches to main thread
- Defensive: 7 new BUFFERP(w->contents) guards before XBUFFER calls

Reviewed by: symbol checker, logic/memory reviewer, ABI/build reviewer
Verified: git apply --check OK, zero real_this_command refs, dispatch_async present
2026-02-26 22:27:25 +01:00
3c0a68cfb9 Fix patch: adjust subsequent hunk offsets after 2-line removal 2026-02-26 21:52:48 +01:00
Martin Sukany
9a08f01066 removed 2026-02-26 21:51:50 +01:00
35a5326c18 Fix corrupt patch: correct hunk line counts after extern removal 2026-02-26 21:50:23 +01:00
220e90144f Fix build errors in Zoom/VoiceOver patch
- Remove 'extern Lisp_Object last_command_event' - last_command_event
  is a macro in globals.h (expands to globals.f_last_command_event),
  so an extern declaration conflicts with the existing
  'extern struct emacs_globals globals'
- Replace invalid C escape sequences '\C-n' and '\C-p' with
  ('n' & 0x1f) and ('p' & 0x1f) respectively
2026-02-26 21:43:04 +01:00
3bad798541 patches: fix v16.4 build errors (extern redecl + invalid C-n/C-p escape) 2026-02-26 21:37:41 +01:00
7c01587079 patches: isolate C-n/C-p keypath from arrow navigation 2026-02-26 18:41:35 +01:00