unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alvaro Ramirez <alvaro@xenodium.com>
To: 72827@debbugs.gnu.org
Cc: copyright-clerk@fsf.org
Subject: bug#72827: [PATCH] Adds NSSpeechRecognitionUsageDescription to Info.plist.in
Date: Tue, 27 Aug 2024 10:12:48 +0100	[thread overview]
Message-ID: <m2ed6aqqgf.fsf@xenodium.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

Hi folks,

Here's a tiny patch to add NSSpeechRecognitionUsageDescription to 
Info.plist.in.

Without NSSpeechRecognitionUsageDescription, we cannot launch 
processes that use macOS's speech recognition APIs (including 
built-in shells).

Here's an eshell example:

$ macosrec --speech-to-text --input /tmp/audio.mp3
  abort trap: 6

With NSSpeechRecognitionUsageDescription in place, macOS displays 
a dialog asking users to grant permission and allows the speech 
APIs to be used from the process.

Added change to Emacs 31 NEWS. If there's any chance the 
permission can make it to 30, I'd be happy to rework the patch as 
needed.

Cheers,

Álvaro

ps. My copyright assignment paperwork has been is 
submitted. Awaiting copyright-clerk reply.

In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin23.5.0, NS
 appkit-2487.60 Version 14.5 (Build 23F79)) of 2024-08-27 built on 
 jiko
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.5

Configured using:
 'configure --with-ns'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Adds-NSSpeechRecognitionUsageDescription-to-Info-plist-in.patch --]
[-- Type: text/patch, Size: 1963 bytes --]

From db657bf4373115883634932a9a8200043b046184 Mon Sep 17 00:00:00 2001
From: xenodium <me+gh@xenodium.com>
Date: Tue, 27 Aug 2024 09:36:56 +0100
Subject: [PATCH] Adds NSSpeechRecognitionUsageDescription to Info.plist.in

Without it, we cannot launch processes that use macOS's speech
recognition APIs.

With NSSpeechRecognitionUsageDescription in place, macOS displays the
dialog asking the user to grant permission and allows the speech APIs
to be used from the process.
---
 etc/NEWS                         | 6 ++++++
 nextstep/templates/Info.plist.in | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 07d1cce0966..556b6005f32 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -43,6 +43,12 @@ The 'find-function', 'find-library', 'find-face-definition', and
 'find-variable' commands now allow retrieving previous input using the
 usual minibuffer history commands.  Each command has a separate history.
 
+---
+** NSSpeechRecognitionUsageDescription now included in Info.plist (macOS).
+Should Emacs (or any built-in shell) invoke a process using macOS speech
+recognition APIs, the relevant permission dialog is now displayed, thus
+allowing Emacs users access to speech recognition utilities.
+
 ** Minibuffer and Completions
 
 +++
diff --git a/nextstep/templates/Info.plist.in b/nextstep/templates/Info.plist.in
index beddbf4a893..192c061bd1e 100644
--- a/nextstep/templates/Info.plist.in
+++ b/nextstep/templates/Info.plist.in
@@ -693,5 +693,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
         <string>Emacs requires permission to access the Downloads folder.</string>
         <key>NSRemovableVolumesUsageDescription</key>
         <string>Emacs requires permission to access files on Removable Volumes.</string>
+        <key>NSSpeechRecognitionUsageDescription</key>
+        <string>Emacs requires permission to handle any speech recognition.</string>
 </dict>
 </plist>
-- 
2.39.3 (Apple Git-146)


             reply	other threads:[~2024-08-27  9:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27  9:12 Alvaro Ramirez [this message]
2024-08-29  0:57 ` bug#72827: [PATCH] Adds NSSpeechRecognitionUsageDescription to Info.plist.in Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-29  5:05   ` Eli Zaretskii
2024-08-29  7:07     ` Alvaro Ramirez
2024-08-30  8:10 ` Stefan Kangas
2024-08-30  9:18   ` Alvaro Ramirez
2024-08-30 16:08     ` Stefan Kangas
2024-08-30 17:45       ` Alvaro Ramirez
2024-08-31 10:39         ` Eli Zaretskii
2024-08-31 11:05           ` Alvaro Ramirez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ed6aqqgf.fsf@xenodium.com \
    --to=alvaro@xenodium.com \
    --cc=72827@debbugs.gnu.org \
    --cc=copyright-clerk@fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).