GNU bug report logs -
#79070
[PATCH] Fix macOS dictation post NSTextInputClient migration in v30
Previous Next
Full log
View this message in rfc822 format
> From: Alvaro Ramirez <alvaro <at> xenodium.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 79070 <at> debbugs.gnu.org,
> shipmints <at> gmail.com, kickingvegas <at> gmail.com, Stefan Kangas
> <stefankangas <at> gmail.com>
> Date: Tue, 22 Jul 2025 08:54:09 +0100
>
> diff --git a/etc/PROBLEMS b/etc/PROBLEMS
> index 20fe9134da5..1323f02a1e9 100644
> --- a/etc/PROBLEMS
> +++ b/etc/PROBLEMS
> @@ -3566,6 +3566,14 @@ file; for example:
> "/usr/local/opt/libgccjit/lib/gcc/11"
> "/usr/local/opt/gcc/lib/gcc/11/gcc/x86_64-apple-darwin20/11.2.0") ":"))
>
> +** macOS text dictation isn't recognising keyboard shortcut
> +
> +There's a chance that microphone permission may have been rejected in the past.
> +
> +Try clearing this permission with:
> +
> + tccutil reset Microphone org.gnu.Emacs
> +
This should explain better what are the indications of the problem.
> --- a/src/nsterm.m
> +++ b/src/nsterm.m
> @@ -7413,7 +7413,24 @@ - (NSRange)selectedRange
> {
> if (NS_KEYLOG)
> NSLog (@"selectedRange request");
> - return NSMakeRange (NSNotFound, 0);
> +
> + struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
> + struct buffer *buf = XBUFFER (w->contents);
> + ptrdiff_t point = BUF_PT (buf);
> +
> + if (NILP (BVAR (buf, mark_active)))
> + {
> + NSUInteger selection_location = point - BUF_BEGV (buf);
> + return NSMakeRange (selection_location, 0);
> + }
> +
> + ptrdiff_t mark = marker_position (BVAR (buf, mark));
> + ptrdiff_t region_start = min (point, mark);
> + ptrdiff_t region_end = max (point, mark);
> + NSUInteger selection_location = region_start - BUF_BEGV (buf);
> + NSUInteger selection_length = region_end - region_start;
> +
> + return NSMakeRange (selection_location, selection_length);
Can we have a comment there explaining why this code is needed?
This bug report was last modified 1 day ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.