Subject: bug#66245: closed (Re: bug#66245: [PATCH] ; Silence macOS 14 warning)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 29 Sep 2023 11:37:02 +0000

Your bug report

#66245: [PATCH] ; Silence macOS 14 warning

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
66245: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66245
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#66245: [PATCH] ; Silence macOS 14 warning
From: Stefan Kangas <[email-masked]>
To: Eshel Yaron <[email-masked]>, [email-masked]
Date: Fri, 29 Sep 2023 04:35:57 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 29.2

Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <[email-masked]> writes:

> Tags: patch
>
> Hi,
>
> After updating to macOS 14 (and rebuilding Emacs), I see the following
> warning whenever I start Emacs:
>
>     WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
>
> This patch does exactly what the warning suggests, and it silences the
> warning.

Thanks, this patch is now installed on emacs-29 ([1: a4185f87bd0]).

I'm also closing the bug, but this obviously doesn't preclude further
discussion.

[1: a4185f87bd0]: 2023-09-29 13:32:55 +0200
  ; Silence macOS 14 warning
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a4185f87bd0e5c129ce93a56b5a3330e2d6b1776

Subject: [PATCH] ; Silence macOS 14 warning
From: Eshel Yaron <[email-masked]>
To: [email-masked]
Date: Wed, 27 Sep 2023 21:00:45 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

Hi,

After updating to macOS 14 (and rebuilding Emacs), I see the following
warning whenever I start Emacs:

    WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.

This patch does exactly what the warning suggests, and it silences the
warning.

TBH I'm not entirely sure I understand the implications of implementing
`applicationSupportsSecureRestorableState`.  IIUC it makes Emacs opt-in
to the "secure state restoration" mechanism in contrast to a former
(supposedly less secure) mechanism, but AFAICT Emacs doesn't opt-in to
state restoration in the NS port in the first place...

>From 10a9205535c20ff951c61fb84a32b9ab6511fc67 Mon Sep 17 00:00:00 2001
From: Eshel Yaron <[email-masked]>
Date: Wed, 27 Sep 2023 20:46:26 +0200
Subject: [PATCH] ; Silence macOS 14 warning

* src/nsterm.m: Implement 'applicationSupportsSecureRestorableState'
to silence warning on macOS 14.
---
 src/nsterm.m | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/nsterm.m b/src/nsterm.m
index 4e0dfa58c63..e46b71a499b 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6110,6 +6110,11 @@ - (void)antialiasThresholdDidChange:(NSNotification *)notification
 
 */
 
+- (BOOL) applicationSupportsSecureRestorableState:(NSApplication *)app
+{
+  return YES;
+}
+
 - (void) terminate: (id)sender
 {
   struct input_event ie;
-- 
2.42.0