From 6d2d702aa736dbad873df3a3d89cd28424cb4191 Mon Sep 17 00:00:00 2001 From: Daneel Date: Sun, 1 Mar 2026 15:02:20 +0100 Subject: [PATCH] patches: fix encoding + cursor sync + echo area --- ...d-frame-completion-candidates-for-Vo.patch | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) 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 abd1e31..b2a0aab 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 a238db02b1d26210a61106c804c8dd012e93fc52 Mon Sep 17 00:00:00 2001 +From d3915c6f58a0db4f8c0e3d681e207dbcda0e18f1 Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 16:01:29 +0100 Subject: [PATCH 8/8] ns: announce child frame completion candidates for @@ -20,8 +20,8 @@ element when a child frame completion closes. doc/emacs/macos.texi | 6 - etc/NEWS | 4 +- src/nsterm.h | 9 ++ - src/nsterm.m | 338 +++++++++++++++++++++++++++++++++++++++++-- - 4 files changed, 334 insertions(+), 23 deletions(-) + src/nsterm.m | 341 +++++++++++++++++++++++++++++++++++++++++-- + 4 files changed, 337 insertions(+), 23 deletions(-) diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi index 6514dfc..f47929e 100644 @@ -97,7 +97,7 @@ index 21a93bc..bbce9fe 100644 @end diff --git a/src/nsterm.m b/src/nsterm.m -index 8d44b5f..e05608f 100644 +index 8d44b5f..a6d2bf1 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7415,6 +7415,112 @@ visual line index for Zoom (skip whitespace-only lines @@ -301,7 +301,7 @@ index 8d44b5f..e05608f 100644 specpdl_ref count2 = SPECPDL_INDEX (); record_unwind_current_buffer (); if (b != current_buffer) -@@ -9352,6 +9481,46 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f +@@ -9352,6 +9481,49 @@ - (void)postAccessibilityNotificationsForFrame:(struct frame *)f if (!b) return; @@ -326,7 +326,10 @@ index 8d44b5f..e05608f 100644 + set_buffer_internal (b); + Lisp_Object ls = Fbuffer_string (); + set_buffer_internal (prev); -+ NSString *raw = [NSString stringWithUTF8String: SSDATA (ls)]; ++ /* Use stringWithLispString: — it converts Emacs's internal ++ multibyte encoding to NSString correctly, unlike a raw ++ UTF-8 cast via SSDATA which fails for non-ASCII text. */ ++ NSString *raw = [NSString stringWithLispString: ls]; + NSString *msg = [raw stringByTrimmingCharactersInSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if ([msg length] > 0) @@ -348,7 +351,7 @@ index 8d44b5f..e05608f 100644 ptrdiff_t modiff = BUF_MODIFF (b); ptrdiff_t point = BUF_PT (b); BOOL markActive = !NILP (BVAR (b, mark_active)); -@@ -9488,6 +9657,16 @@ frameworks like Vertico bump BOTH BUF_MODIFF (via text property +@@ -9488,6 +9660,16 @@ frameworks like Vertico bump BOTH BUF_MODIFF (via text property granularity = ns_ax_text_selection_granularity_line; } @@ -365,7 +368,7 @@ index 8d44b5f..e05608f 100644 /* Post notifications for focused and non-focused elements. */ if ([self isAccessibilityFocused]) [self postFocusedCursorNotification:point -@@ -9931,6 +10110,10 @@ - (void)dealloc +@@ -9931,6 +10113,10 @@ - (void)dealloc #endif [accessibilityElements release]; @@ -376,7 +379,7 @@ index 8d44b5f..e05608f 100644 [[self menu] release]; [super dealloc]; } -@@ -11380,6 +11563,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f +@@ -11380,6 +11566,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f windowClosing = NO; processingCompose = NO; @@ -386,7 +389,7 @@ index 8d44b5f..e05608f 100644 scrollbarsNeedingUpdate = 0; fs_state = FULLSCREEN_NONE; fs_before_fs = next_maximized = -1; -@@ -12688,6 +12874,80 @@ - (id)accessibilityFocusedUIElement +@@ -12688,6 +12877,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. */ @@ -467,7 +470,7 @@ index 8d44b5f..e05608f 100644 - (void)postAccessibilityUpdates { NSTRACE ("[EmacsView postAccessibilityUpdates]"); -@@ -12698,11 +12958,59 @@ - (void)postAccessibilityUpdates +@@ -12698,11 +12961,59 @@ - (void)postAccessibilityUpdates /* Re-entrance guard: VoiceOver callbacks during notification posting can trigger redisplay, which calls ns_update_end, which calls us