From 63f0e899cee22df8a799761fbbe4d9aeee57a90b Mon Sep 17 00:00:00 2001 From: Daneel Date: Sun, 1 Mar 2026 06:04:22 +0100 Subject: [PATCH] patches: fix childFrameLastBuffer ivar init order The Qnil initialization was in patch 0000 (Zoom) but the ivar declaration is in patch 0008 (child frame tracking). Moved the init to patch 0008 so each patch compiles independently. --- ...-with-macOS-Zoom-for-cursor-tracking.patch | 18 ++++----------- ...lity-base-classes-and-text-extractio.patch | 12 +++++----- ...fer-accessibility-element-core-proto.patch | 4 ++-- ...tification-dispatch-and-mode-line-el.patch | 4 ++-- ...ive-span-elements-for-Tab-navigation.patch | 4 ++-- ...essibility-with-EmacsView-and-redisp.patch | 6 ++--- ...r-accessibility-section-to-macOS-app.patch | 2 +- ...lay-completion-candidates-for-VoiceO.patch | 12 +++++----- ...d-frame-completion-candidates-for-Vo.patch | 22 ++++++++++++++----- 9 files changed, 42 insertions(+), 42 deletions(-) diff --git a/patches/0000-ns-integrate-with-macOS-Zoom-for-cursor-tracking.patch b/patches/0000-ns-integrate-with-macOS-Zoom-for-cursor-tracking.patch index b5f9122..1efdf8c 100644 --- a/patches/0000-ns-integrate-with-macOS-Zoom-for-cursor-tracking.patch +++ b/patches/0000-ns-integrate-with-macOS-Zoom-for-cursor-tracking.patch @@ -1,4 +1,4 @@ -From 5637c7ec4d3511e42bca8e5b1cb628cc2d2200ad Mon Sep 17 00:00:00 2001 +From 82465943223138dfa1185467400e547c59e6e1be Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 22:39:35 +0100 Subject: [PATCH 1/9] ns: integrate with macOS Zoom for cursor tracking @@ -38,8 +38,8 @@ window splits, switches (C-x o), and completion frameworks. --- etc/NEWS | 11 ++ src/nsterm.h | 6 + - src/nsterm.m | 341 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 358 insertions(+) + src/nsterm.m | 338 +++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 355 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index ef36df5..80661a9 100644 @@ -81,7 +81,7 @@ index 7c1ee4c..ea6e7ba 100644 } diff --git a/src/nsterm.m b/src/nsterm.m -index 74e4ad5..f189c9e 100644 +index 74e4ad5..d624a76 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1081,6 +1081,270 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen) @@ -443,16 +443,6 @@ index 74e4ad5..f189c9e 100644 ns_focus (f, NULL, 0); NSGraphicsContext *ctx = [NSGraphicsContext currentContext]; -@@ -8321,6 +8659,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f - - windowClosing = NO; - processingCompose = NO; -+#ifdef NS_IMPL_COCOA -+ childFrameLastBuffer = Qnil; -+#endif - scrollbarsNeedingUpdate = 0; - fs_state = FULLSCREEN_NONE; - fs_before_fs = next_maximized = -1; -- 2.43.0 diff --git a/patches/0001-ns-add-accessibility-base-classes-and-text-extractio.patch b/patches/0001-ns-add-accessibility-base-classes-and-text-extractio.patch index 7331d22..c22aca7 100644 --- a/patches/0001-ns-add-accessibility-base-classes-and-text-extractio.patch +++ b/patches/0001-ns-add-accessibility-base-classes-and-text-extractio.patch @@ -1,4 +1,4 @@ -From 5afa856fd6295a8937e3a32b2571f02ff78a8ce3 Mon Sep 17 00:00:00 2001 +From 2320cde84ba0577f2f09f1ef43aa9949ca4f142f Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 12:58:11 +0100 Subject: [PATCH 2/9] ns: add accessibility base classes and text extraction @@ -188,7 +188,7 @@ index ea6e7ba..6e830de 100644 diff --git a/src/nsterm.m b/src/nsterm.m -index f189c9e..73b1c50 100644 +index d624a76..7390b47 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -46,6 +46,7 @@ Updated by Christian Limpach (chris@nice.ch) @@ -630,7 +630,7 @@ index f189c9e..73b1c50 100644 /* ========================================================================== EmacsView implementation -@@ -11653,6 +12078,28 @@ Convert an X font name (XLFD) to an NS font name. +@@ -11650,6 +12075,28 @@ Convert an X font name (XLFD) to an NS font name. DEFSYM (Qns_drag_operation_generic, "ns-drag-operation-generic"); DEFSYM (Qns_handle_drag_motion, "ns-handle-drag-motion"); @@ -659,7 +659,7 @@ index f189c9e..73b1c50 100644 Fput (Qalt, Qmodifier_value, make_fixnum (alt_modifier)); Fput (Qhyper, Qmodifier_value, make_fixnum (hyper_modifier)); Fput (Qmeta, Qmodifier_value, make_fixnum (meta_modifier)); -@@ -11785,7 +12232,7 @@ Convert an X font name (XLFD) to an NS font name. +@@ -11782,7 +12229,7 @@ Convert an X font name (XLFD) to an NS font name. doc: /* Non-nil means to use native fullscreen on Mac OS X 10.7 and later. Nil means use fullscreen the old (< 10.7) way. The old way works better with multiple monitors, but lacks tool bar. This variable is ignored on @@ -668,7 +668,7 @@ index f189c9e..73b1c50 100644 ns_use_native_fullscreen = YES; ns_last_use_native_fullscreen = ns_use_native_fullscreen; -@@ -11801,10 +12248,19 @@ Nil means use fullscreen the old (< 10.7) way. The old way works better with +@@ -11798,10 +12245,19 @@ Nil means use fullscreen the old (< 10.7) way. The old way works better with This variable is ignored on Mac OS X < 10.7 and GNUstep. */); ns_use_srgb_colorspace = YES; @@ -689,7 +689,7 @@ index f189c9e..73b1c50 100644 ns_use_mwheel_acceleration = YES; DEFVAR_LISP ("ns-mwheel-line-height", ns_mwheel_line_height, -@@ -11815,7 +12271,7 @@ Nil means use fullscreen the old (< 10.7) way. The old way works better with +@@ -11812,7 +12268,7 @@ Nil means use fullscreen the old (< 10.7) way. The old way works better with DEFVAR_BOOL ("ns-use-mwheel-momentum", ns_use_mwheel_momentum, doc: /* Non-nil means mouse wheel scrolling uses momentum. diff --git a/patches/0002-ns-implement-buffer-accessibility-element-core-proto.patch b/patches/0002-ns-implement-buffer-accessibility-element-core-proto.patch index 1774d0d..452574e 100644 --- a/patches/0002-ns-implement-buffer-accessibility-element-core-proto.patch +++ b/patches/0002-ns-implement-buffer-accessibility-element-core-proto.patch @@ -1,4 +1,4 @@ -From a820d8168b8fabaf4255fb7eefe5bbeb6301fe47 Mon Sep 17 00:00:00 2001 +From 60df7f8141d50a3c7e257151f43a0cc0b2a325e3 Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 12:58:11 +0100 Subject: [PATCH 3/9] ns: implement buffer accessibility element (core @@ -22,7 +22,7 @@ line-by-line navigation, word/character announcements. 1 file changed, 1104 insertions(+) diff --git a/src/nsterm.m b/src/nsterm.m -index 73b1c50..73e56d3 100644 +index 7390b47..a144abb 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7616,6 +7616,1110 @@ - (id)accessibilityTopLevelUIElement diff --git a/patches/0003-ns-add-buffer-notification-dispatch-and-mode-line-el.patch b/patches/0003-ns-add-buffer-notification-dispatch-and-mode-line-el.patch index b73e5c7..74e9da6 100644 --- a/patches/0003-ns-add-buffer-notification-dispatch-and-mode-line-el.patch +++ b/patches/0003-ns-add-buffer-notification-dispatch-and-mode-line-el.patch @@ -1,4 +1,4 @@ -From 7d711a2d08efbd491b664818954e078e214a89c3 Mon Sep 17 00:00:00 2001 +From 4ea286a9cb5f13d8854d646f891677500ed4094a Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 12:58:11 +0100 Subject: [PATCH 4/9] ns: add buffer notification dispatch and mode-line @@ -24,7 +24,7 @@ region selection feedback, completion popups, mode-line reading. 1 file changed, 545 insertions(+) diff --git a/src/nsterm.m b/src/nsterm.m -index 73e56d3..b48f0c2 100644 +index a144abb..e818817 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -8720,6 +8720,551 @@ - (NSRect)accessibilityFrame diff --git a/patches/0004-ns-add-interactive-span-elements-for-Tab-navigation.patch b/patches/0004-ns-add-interactive-span-elements-for-Tab-navigation.patch index f4d5950..25f4d1e 100644 --- a/patches/0004-ns-add-interactive-span-elements-for-Tab-navigation.patch +++ b/patches/0004-ns-add-interactive-span-elements-for-Tab-navigation.patch @@ -1,4 +1,4 @@ -From 014826c0b4de37f5e6adbd85032282dabae623a3 Mon Sep 17 00:00:00 2001 +From deb9e1e6d759b387246a71061194716505920684 Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 12:58:11 +0100 Subject: [PATCH 5/9] ns: add interactive span elements for Tab navigation @@ -17,7 +17,7 @@ Tested on macOS 14. Verified: Tab-cycling through org-mode links, 1 file changed, 286 insertions(+) diff --git a/src/nsterm.m b/src/nsterm.m -index b48f0c2..01751ce 100644 +index e818817..d2a5a58 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -9265,6 +9265,292 @@ - (NSRect)accessibilityFrame diff --git a/patches/0005-ns-integrate-accessibility-with-EmacsView-and-redisp.patch b/patches/0005-ns-integrate-accessibility-with-EmacsView-and-redisp.patch index c89048e..d24e849 100644 --- a/patches/0005-ns-integrate-accessibility-with-EmacsView-and-redisp.patch +++ b/patches/0005-ns-integrate-accessibility-with-EmacsView-and-redisp.patch @@ -1,4 +1,4 @@ -From 495554a23725688fb7030e6837efff5341e8e9a2 Mon Sep 17 00:00:00 2001 +From d2436b4215e5480d35f88fcb5b78fb8f8e44945d Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 12:58:11 +0100 Subject: [PATCH 6/9] ns: integrate accessibility with EmacsView and redisplay @@ -51,7 +51,7 @@ index 80661a9..2b1f9e6 100644 ** Re-introduced dictation, lost in Emacs v30 (macOS). We lost macOS dictation in v30 when migrating to NSTextInputClient. diff --git a/src/nsterm.m b/src/nsterm.m -index 01751ce..f7da553 100644 +index d2a5a58..c796840 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1404,6 +1404,9 @@ so the visual offset is (ov_line + 1) * line_h from @@ -129,7 +129,7 @@ index 01751ce..f7da553 100644 } -@@ -12184,6 +12211,332 @@ - (int) fullscreenState +@@ -12181,6 +12208,332 @@ - (int) fullscreenState return fs_state; } diff --git a/patches/0006-doc-add-VoiceOver-accessibility-section-to-macOS-app.patch b/patches/0006-doc-add-VoiceOver-accessibility-section-to-macOS-app.patch index 8633e63..b587d60 100644 --- a/patches/0006-doc-add-VoiceOver-accessibility-section-to-macOS-app.patch +++ b/patches/0006-doc-add-VoiceOver-accessibility-section-to-macOS-app.patch @@ -1,4 +1,4 @@ -From 6e03e0051d7f15bd1391ff5c5b9d2093711d4300 Mon Sep 17 00:00:00 2001 +From 472c446d629dc95c5c71560af5de3462943ff84a Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 12:58:11 +0100 Subject: [PATCH 7/9] doc: add VoiceOver accessibility section to macOS diff --git a/patches/0007-ns-announce-overlay-completion-candidates-for-VoiceO.patch b/patches/0007-ns-announce-overlay-completion-candidates-for-VoiceO.patch index fe2b487..cb9455d 100644 --- a/patches/0007-ns-announce-overlay-completion-candidates-for-VoiceO.patch +++ b/patches/0007-ns-announce-overlay-completion-candidates-for-VoiceO.patch @@ -1,4 +1,4 @@ -From 3840a4b1e57f6fbdfc005ad86ef16bb0bfdf0868 Mon Sep 17 00:00:00 2001 +From ba3ea125d91b9e2379ce1da3b000a0896255ac50 Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 14:46:25 +0100 Subject: [PATCH 8/9] ns: announce overlay completion candidates for VoiceOver @@ -61,7 +61,7 @@ index 6e830de..2102fb9 100644 @property (nonatomic, assign) BOOL cachedMarkActive; @property (nonatomic, copy) NSString *cachedCompletionAnnouncement; diff --git a/src/nsterm.m b/src/nsterm.m -index f7da553..e333d45 100644 +index c796840..f1aa0a4 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7208,11 +7208,154 @@ Accessibility virtual elements (macOS / Cocoa only) @@ -540,7 +540,7 @@ index f7da553..e333d45 100644 Methods are kept here (same .m file) so they access the ivars declared in the @interface ivar block. */ @implementation EmacsAccessibilityBuffer (InteractiveSpans) -@@ -12227,7 +12473,7 @@ - (int) fullscreenState +@@ -12224,7 +12470,7 @@ - (int) fullscreenState if (WINDOW_LEAF_P (w)) { @@ -549,7 +549,7 @@ index f7da553..e333d45 100644 EmacsAccessibilityBuffer *elem = [existing objectForKey:[NSValue valueWithPointer:w]]; if (!elem) -@@ -12261,7 +12507,7 @@ - (int) fullscreenState +@@ -12258,7 +12504,7 @@ - (int) fullscreenState } else { @@ -558,7 +558,7 @@ index f7da553..e333d45 100644 Lisp_Object child = w->contents; while (!NILP (child)) { -@@ -12373,7 +12619,7 @@ - (void)postAccessibilityUpdates +@@ -12370,7 +12616,7 @@ - (void)postAccessibilityUpdates accessibilityUpdating = YES; /* Detect window tree change (split, delete, new buffer). Compare @@ -567,7 +567,7 @@ index f7da553..e333d45 100644 Lisp_Object curRoot = FRAME_ROOT_WINDOW (emacsframe); if (!EQ (curRoot, lastRootWindow)) { -@@ -12382,12 +12628,12 @@ - (void)postAccessibilityUpdates +@@ -12379,12 +12625,12 @@ - (void)postAccessibilityUpdates } /* If tree is stale, rebuild FIRST so we don't iterate freed diff --git a/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch b/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch index e1224fe..e80c582 100644 --- a/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch +++ b/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch @@ -1,4 +1,4 @@ -From a5f18d7d2b4fdabb3d1ed10d536117ea8d641dad Mon Sep 17 00:00:00 2001 +From c38bfe9c3328a9355fe786fea0e6bddcf2bdd54f Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 16:01:29 +0100 Subject: [PATCH 9/9] ns: announce child frame completion candidates for @@ -43,8 +43,8 @@ refocus parent buffer element when child frame closes. doc/emacs/macos.texi | 6 - etc/NEWS | 4 +- src/nsterm.h | 5 + - src/nsterm.m | 263 +++++++++++++++++++++++++++++++++++++++++-- - 4 files changed, 260 insertions(+), 18 deletions(-) + src/nsterm.m | 266 +++++++++++++++++++++++++++++++++++++++++-- + 4 files changed, 263 insertions(+), 18 deletions(-) diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi index 4825cf9..97777e2 100644 @@ -109,7 +109,7 @@ index 2102fb9..dd98d56 100644 @end diff --git a/src/nsterm.m b/src/nsterm.m -index e333d45..27607c0 100644 +index f1aa0a4..27607c0 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7352,6 +7352,112 @@ visual line index for Zoom (skip whitespace-only lines @@ -295,7 +295,17 @@ index e333d45..27607c0 100644 [[self menu] release]; [super dealloc]; } -@@ -12603,6 +12724,80 @@ - (id)accessibilityFocusedUIElement +@@ -11292,6 +11413,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f + + windowClosing = NO; + processingCompose = NO; ++#ifdef NS_IMPL_COCOA ++ childFrameLastBuffer = Qnil; ++#endif + scrollbarsNeedingUpdate = 0; + fs_state = FULLSCREEN_NONE; + fs_before_fs = next_maximized = -1; +@@ -12600,6 +12724,80 @@ - (id)accessibilityFocusedUIElement The existing elements carry cached state (modiff, point) from the previous redisplay cycle. Rebuilding first would create fresh elements with current values, making change detection impossible. */ @@ -376,7 +386,7 @@ index e333d45..27607c0 100644 - (void)postAccessibilityUpdates { NSTRACE ("[EmacsView postAccessibilityUpdates]"); -@@ -12613,11 +12808,59 @@ - (void)postAccessibilityUpdates +@@ -12610,11 +12808,59 @@ - (void)postAccessibilityUpdates /* Re-entrance guard: VoiceOver callbacks during notification posting can trigger redisplay, which calls ns_update_end, which calls us