patches: fix build errors (Fplist_get arity, MRC weak, duplicate decl)

This commit is contained in:
2026-02-27 10:31:02 +01:00
parent 92ef24332f
commit 23102444d4

View File

@@ -1,19 +1,19 @@
From c0d683db88b52e0e154b6434a5f29ed3ed36703d Mon Sep 17 00:00:00 2001
From 9ecac3f53f402174cafbe07d7809826f9f698a23 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
Date: Fri, 27 Feb 2026 10:26:21 +0100
Date: Fri, 27 Feb 2026 10:30:58 +0100
Subject: [PATCH] ns: implement VoiceOver accessibility (AXBoundsForRange, line
nav, completions, interactive spans)
---
src/nsterm.h | 110 +++
src/nsterm.m | 2646 +++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 2606 insertions(+), 150 deletions(-)
src/nsterm.h | 109 +++
src/nsterm.m | 2645 +++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 2604 insertions(+), 150 deletions(-)
diff --git a/src/nsterm.h b/src/nsterm.h
index 7c1ee4c..bc9e17b 100644
index 7c1ee4c..6c95673 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -453,6 +453,101 @@ enum ns_return_frame_mode
@@ -453,6 +453,100 @@ enum ns_return_frame_mode
@end
@@ -66,7 +66,6 @@ index 7c1ee4c..bc9e17b 100644
+@property (nonatomic, assign) ptrdiff_t cachedCompletionOverlayEnd;
+@property (nonatomic, assign) ptrdiff_t cachedCompletionPoint;
+- (void)invalidateTextCache;
+- (void)invalidateInteractiveSpans;
+- (void)postAccessibilityNotificationsForFrame:(struct frame *)f;
+- (ptrdiff_t)charposForAccessibilityIndex:(NSUInteger)ax_idx;
+- (NSUInteger)accessibilityIndexForCharpos:(ptrdiff_t)charpos;
@@ -99,7 +98,7 @@ index 7c1ee4c..bc9e17b 100644
+@property (nonatomic, assign) EmacsAXSpanType spanType;
+@property (nonatomic, copy) NSString *spanLabel;
+@property (nonatomic, copy) NSString *spanValue;
+@property (nonatomic, weak) EmacsAccessibilityBuffer *parentBuffer;
+@property (nonatomic, unsafe_unretained) EmacsAccessibilityBuffer *parentBuffer;
+
+- (NSAccessibilityRole) accessibilityRole;
+- (NSString *) accessibilityLabel;
@@ -115,7 +114,7 @@ index 7c1ee4c..bc9e17b 100644
/* ==========================================================================
The main Emacs view
@@ -471,6 +566,14 @@ enum ns_return_frame_mode
@@ -471,6 +565,14 @@ enum ns_return_frame_mode
#ifdef NS_IMPL_COCOA
char *old_title;
BOOL maximizing_resize;
@@ -130,7 +129,7 @@ index 7c1ee4c..bc9e17b 100644
#endif
BOOL font_panel_active;
NSFont *font_panel_result;
@@ -528,6 +631,13 @@ enum ns_return_frame_mode
@@ -528,6 +630,13 @@ enum ns_return_frame_mode
- (void)windowWillExitFullScreen;
- (void)windowDidExitFullScreen;
- (void)windowDidBecomeKey;
@@ -145,7 +144,7 @@ index 7c1ee4c..bc9e17b 100644
diff --git a/src/nsterm.m b/src/nsterm.m
index 932d209..1acdc42 100644
index 932d209..1166ad9 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -46,6 +46,7 @@ Updated by Christian Limpach (chris@nice.ch)
@@ -803,7 +802,7 @@ index 932d209..1acdc42 100644
+ns_ax_text_prop_at (ptrdiff_t pos, Lisp_Object prop, Lisp_Object buf_obj)
+{
+ Lisp_Object plist = Ftext_properties_at (make_fixnum (pos), buf_obj);
+ return Fplist_get (plist, prop);
+ return Fplist_get (plist, prop, Qnil);
+}
-/*****************************************************************************/
@@ -911,28 +910,28 @@ index 932d209..1acdc42 100644
+ EmacsAXSpanType span_type = (EmacsAXSpanType) -1;
+ Lisp_Object limit_prop = Qnil;
+
+ if (!NILP (Fplist_get (plist, Qwidget_sym)))
+ if (!NILP (Fplist_get (plist, Qwidget_sym, Qnil)))
+ {
+ span_type = EmacsAXSpanTypeWidget;
+ limit_prop = Qwidget_sym;
+ }
+ else if (!NILP (Fplist_get (plist, Qbutton_sym)))
+ else if (!NILP (Fplist_get (plist, Qbutton_sym, Qnil)))
+ {
+ span_type = EmacsAXSpanTypeButton;
+ limit_prop = Qbutton_sym;
+ }
+ else if (!NILP (Fplist_get (plist, Qfollow_link_sym)))
+ else if (!NILP (Fplist_get (plist, Qfollow_link_sym, Qnil)))
+ {
+ span_type = EmacsAXSpanTypeLink;
+ limit_prop = Qfollow_link_sym;
+ }
+ else if (!NILP (Fplist_get (plist, Qorg_link_sym)))
+ else if (!NILP (Fplist_get (plist, Qorg_link_sym, Qnil)))
+ {
+ span_type = EmacsAXSpanTypeLink;
+ limit_prop = Qorg_link_sym;
+ }
+ else if (is_completion_buf
+ && !NILP (Fplist_get (plist, Qmouse_face_sym)))
+ && !NILP (Fplist_get (plist, Qmouse_face_sym, Qnil)))
+ {
+ span_type = EmacsAXSpanTypeCompletionItem;
+ limit_prop = Qmouse_face_sym;
@@ -2591,7 +2590,7 @@ index 932d209..1acdc42 100644
}
@@ -9474,6 +11518,308 @@ - (int) fullscreenState
@@ -9474,6 +11518,307 @@ - (int) fullscreenState
return fs_state;
}
@@ -2725,7 +2724,6 @@ index 932d209..1acdc42 100644
+ if (!accessibilityElements || !accessibilityTreeValid)
+ [self rebuildAccessibilityTree];
+
+ struct window *sel = XWINDOW (emacsframe->selected_window);
+ for (EmacsAccessibilityElement *elem in accessibilityElements)
+ {
+ if ([elem isKindOfClass:[EmacsAccessibilityBuffer class]]