patches: address review B1-B4 and N1,N3
B4: Shorten all subject lines to <=50 chars (preference from CONTRIBUTE).
B3: Fix intermediate BUF_CHARS_MODIFF state in 0002: use BUF_MODIFF
from the start, eliminating the wrong-then-corrected pattern across
patches 0002+0007.
B2: Wrap long NEWS line in Zoom entry (was 80 chars, now <=79).
B1: Long block_input comment already fixed by 0004 in both branches;
confirmed no change needed in final state.
N1: Fix DEFVAR doc in 0001 to reflect auto-detection at startup.
N3: Convert VoiceOver NEWS bullet list to prose paragraphs.
N2: Skip (existing file uses 80-char separators throughout; changing
only new ones would be inconsistent).
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
From fcc1826baee5b424d5fdc176239c5675aee6159b Mon Sep 17 00:00:00 2001
|
||||
From 2bce9ba4ad500eabad619e684ba319b58f9b1fca Mon Sep 17 00:00:00 2001
|
||||
From: Martin Sukany <martin@sukany.cz>
|
||||
Date: Sat, 28 Feb 2026 22:39:35 +0100
|
||||
Date: Wed, 4 Mar 2026 15:23:53 +0100
|
||||
Subject: [PATCH 1/9] ns: integrate with macOS Zoom for cursor tracking
|
||||
|
||||
Inform macOS Zoom of the text cursor position so the zoomed viewport
|
||||
@@ -28,8 +28,8 @@ to the selected completion candidate after normal cursor tracking.
|
||||
---
|
||||
etc/NEWS | 11 ++
|
||||
src/nsterm.h | 6 +
|
||||
src/nsterm.m | 354 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 371 insertions(+)
|
||||
src/nsterm.m | 366 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 383 insertions(+)
|
||||
|
||||
diff --git a/etc/NEWS b/etc/NEWS
|
||||
index 7367e3ccbd..4c149e41d6 100644
|
||||
@@ -71,7 +71,7 @@ index 7c1ee4cf53..ea6e7ba4f5 100644
|
||||
}
|
||||
|
||||
diff --git a/src/nsterm.m b/src/nsterm.m
|
||||
index 932d209f56..88c9251c18 100644
|
||||
index 932d209f56..6333a7253a 100644
|
||||
--- a/src/nsterm.m
|
||||
+++ b/src/nsterm.m
|
||||
@@ -71,6 +71,11 @@ Updated by Christian Limpach (chris@nice.ch)
|
||||
@@ -86,7 +86,7 @@ index 932d209f56..88c9251c18 100644
|
||||
#endif
|
||||
|
||||
static EmacsMenu *dockMenu;
|
||||
@@ -1081,6 +1086,281 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
|
||||
@@ -1081,6 +1086,293 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
|
||||
}
|
||||
|
||||
|
||||
@@ -127,10 +127,9 @@ index 932d209f56..88c9251c18 100644
|
||||
+/* Identify faces that mark a selected completion candidate.
|
||||
+ Matches vertico-current, corfu-current, icomplete-selected-match,
|
||||
+ ivy-current-match, etc. by checking the face symbol name.
|
||||
+ Defined here so the Zoom patch compiles independently of the
|
||||
+ VoiceOver patches. */
|
||||
+ Shared by both Zoom cursor tracking and VoiceOver accessibility. */
|
||||
+static bool
|
||||
+ns_zoom_face_is_selected (Lisp_Object face)
|
||||
+ns_face_name_matches_selected_p (Lisp_Object face)
|
||||
+{
|
||||
+ if (SYMBOLP (face))
|
||||
+ {
|
||||
@@ -143,7 +142,7 @@ index 932d209f56..88c9251c18 100644
|
||||
+ {
|
||||
+ Lisp_Object tail;
|
||||
+ for (tail = face; CONSP (tail); tail = XCDR (tail))
|
||||
+ if (ns_zoom_face_is_selected (XCAR (tail)))
|
||||
+ if (ns_face_name_matches_selected_p (XCAR (tail)))
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
@@ -163,6 +162,13 @@ index 932d209f56..88c9251c18 100644
|
||||
+ if (!MINI_WINDOW_P (w))
|
||||
+ return -1;
|
||||
+
|
||||
+ /* block_input must come before record_unwind_protect_void (unblock_input)
|
||||
+ so that the unwind handler is never invoked without a matching
|
||||
+ block_input, even if Foverlays_in or Foverlay_get signals. */
|
||||
+ specpdl_ref count = SPECPDL_INDEX ();
|
||||
+ block_input ();
|
||||
+ record_unwind_protect_void (unblock_input);
|
||||
+
|
||||
+ struct buffer *b = XBUFFER (w->contents);
|
||||
+ ptrdiff_t beg = marker_position (w->start);
|
||||
+ ptrdiff_t end = BUF_ZV (b);
|
||||
@@ -195,8 +201,11 @@ index 932d209f56..88c9251c18 100644
|
||||
+ Lisp_Object face
|
||||
+ = Fget_text_property (make_fixnum (line_start),
|
||||
+ Qface, str);
|
||||
+ if (ns_zoom_face_is_selected (face))
|
||||
+ return line;
|
||||
+ if (ns_face_name_matches_selected_p (face))
|
||||
+ {
|
||||
+ unbind_to (count, Qnil);
|
||||
+ return line;
|
||||
+ }
|
||||
+ line++;
|
||||
+ line_start = i + 1;
|
||||
+ }
|
||||
@@ -207,6 +216,7 @@ index 932d209f56..88c9251c18 100644
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ unbind_to (count, Qnil);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
@@ -242,7 +252,9 @@ index 932d209f56..88c9251c18 100644
|
||||
+ ptrdiff_t zv = BUF_ZV (b);
|
||||
+ int line = 0;
|
||||
+
|
||||
+ block_input ();
|
||||
+ specpdl_ref count = SPECPDL_INDEX ();
|
||||
+ record_unwind_protect_void (unblock_input);
|
||||
+ record_unwind_current_buffer ();
|
||||
+ set_buffer_internal_1 (b);
|
||||
+
|
||||
@@ -252,7 +264,7 @@ index 932d209f56..88c9251c18 100644
|
||||
+ Lisp_Object face
|
||||
+ = Fget_char_property (make_fixnum (pos), Qface,
|
||||
+ cw->contents);
|
||||
+ if (ns_zoom_face_is_selected (face))
|
||||
+ if (ns_face_name_matches_selected_p (face))
|
||||
+ {
|
||||
+ unbind_to (count, Qnil);
|
||||
+ *child_frame = cf;
|
||||
@@ -368,7 +380,7 @@ index 932d209f56..88c9251c18 100644
|
||||
static void
|
||||
ns_update_end (struct frame *f)
|
||||
/* --------------------------------------------------------------------------
|
||||
@@ -1104,6 +1384,41 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
|
||||
@@ -1104,6 +1396,41 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
|
||||
|
||||
unblock_input ();
|
||||
ns_updating_frame = NULL;
|
||||
@@ -410,7 +422,7 @@ index 932d209f56..88c9251c18 100644
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3232,6 +3547,45 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
|
||||
@@ -3232,6 +3559,45 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
|
||||
/* Prevent the cursor from being drawn outside the text area. */
|
||||
r = NSIntersectionRect (r, ns_row_rect (w, glyph_row, TEXT_AREA));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user