GNU bug report logs - #79070
[PATCH] Fix macOS dictation post NSTextInputClient migration in v30

Previous Next

Package: emacs;

Reported by: Alvaro Ramirez <alvaro <at> xenodium.com>

Date: Mon, 21 Jul 2025 12:27:01 UTC

Severity: normal

Tags: patch

Merged with 76765, 76771

Found in version 30.1

Fixed in version 31.1

Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alvaro Ramirez <alvaro <at> xenodium.com>
Cc: gerd.moellmann <at> gmail.com, stefankangas <at> gmail.com, shipmints <at> gmail.com, 79070 <at> debbugs.gnu.org, kickingvegas <at> gmail.com
Subject: bug#79070: [PATCH] Fix macOS dictation post NSTextInputClient migration in v30
Date: Tue, 22 Jul 2025 16:10:13 +0300
> 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.