From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daphne Preston-Kendal Newsgroups: gmane.emacs.devel Subject: Re: Detecting changes between dark and light mode on Mac OS Date: Sun, 21 Mar 2021 11:22:43 +0100 Message-ID: <3B7287EE-B559-4E3B-A24E-7ABD71EFEB6F@nonceword.org> References: <345983B0-C75E-46FF-870C-5FBD3D7381B9@nonceword.org> <87h7l5j8hg.fsf@gnus.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14050"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 21 11:23:57 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNvFV-0003Wq-K4 for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Mar 2021 11:23:57 +0100 Original-Received: from localhost ([::1]:45726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNvFU-0007O5-IY for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Mar 2021 06:23:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNvEU-0006vq-IB for emacs-devel@gnu.org; Sun, 21 Mar 2021 06:22:55 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:55967) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNvEQ-0002Fz-0s for emacs-devel@gnu.org; Sun, 21 Mar 2021 06:22:54 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 8EC33146A; Sun, 21 Mar 2021 06:22:48 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 21 Mar 2021 06:22:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=ohstk0VRoBLv3qGhoQNiLQrR9NQwCiPRkexJAsDRX ZA=; b=Ydmb8s82Q3a/mlXy3HEnC3fWxRKX/g/YpT999enwrILkKF7Hckv39u9Xf QWqSqEF9BSBpe8flZCWuOUyM/j1xJZNGEvmK4c5TZqbot9kBqYmED1bMw91DKEFk 0TiOrkbehAH3Z+lMEvhGb4gEAAr0oVfO5MeK5n/NRMHtrSrTX75VS11S1SKX0S3S klgFcQUbbzh36wT/vGjmKAo2B+WxEKAYm+CwVcFVDUQ526xp+KniCLsP7iHJZPCP +eK2UEZ2AO3dFdTYFb/U4o41FcvY1FwVACKs7aeh5tbZCbmc7iMDEwiEYzwgZ0qt A7zr5Fj5XEg+51CK8HRJqgWL7LHXg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffgffkfhfvofesthhqmhdthhdtjeenucfhrhhomhepffgrphhh nhgvucfrrhgvshhtohhnqdfmvghnuggrlhcuoeguphhksehnohhntggvfihorhgurdhorh hgqeenucggtffrrghtthgvrhhnpeekueeivefgudegjeeuuddvleegleffudeileekuefh tedugfejuefhjeefhedtgfenucffohhmrghinhepihhnghgvsghrihhgthhsvghnrdhnoh enucfkphepleehrdeltddrvdefgedrudefleenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpeguphhksehnohhntggvfihorhgurdhorhhg X-ME-Proxy: Original-Received: from [192.168.0.3] (ip5f5aea8b.dynamic.kabel-deutschland.de [95.90.234.139]) by mail.messagingengine.com (Postfix) with ESMTPA id 74FBF108005F; Sun, 21 Mar 2021 06:22:47 -0400 (EDT) In-Reply-To: <87h7l5j8hg.fsf@gnus.org> X-Mailer: Apple Mail (2.3654.60.0.2.21) Received-SPF: none client-ip=64.147.123.20; envelope-from=dpk@nonceword.org; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266690 Archived-At: On 21 Mar 2021, at 08:01, Lars Ingebrigtsen wrote: > Sorry about the lack of feedback here -- yes, in general, it's better = to > send patches to the issue tracker (i.e., bug-gnu-emacs@gnu.org) than = to > emacs-devel, because patches have a tendency to get lost on = emacs-devel. Okay, thanks =E2=80=94 I=E2=80=99ll try there directly. > In Emacs, we generally don't add features that work on non-free > operating systems only. So this should instead be a general > `dark-mode-changed-hook' feature, with a specific implementation on > GNU/Linux, Macos, etc. >=20 > And we should definitely have a feature in Emacs to respond to = dark-mode > changes across the board. I seem to recall there being some = discussion > about this in the past, but I can't find it now. Does anybody = remember > where that went? Okay, well, if there are plans to support similar functionality cross-platform, surely it=E2=80=99s okay to add it just for Mac OS for = now? There=E2=80=99s already quite a few Mac OS specific features in nsterm.m = and nsfns.m. The ns-appearance property on frames, which already provides a limited form of integration with this Mac OS feature (you can set the theme to light or dark on a per-frame basis, but it doesn=E2=80=99t = tell you what the system sets it to by default, which my patch fixes) is one of them! I don=E2=80=99t know how well standardized the events (and event = systems) for changes in system theme are in other Unix desktop environments, but if someone does manage to make it work cross-platform, then the ns-dark-mode-changed-hook from this patch could simply be made an alias to a new, cross-platform dark-mode-changed-hook. (Though note that the inspection of which theme was just activated, dark or light, which typical functions attached to ns-dark-mode-hook would have to do, also depends on the Mac OS-specific ns-appearance frame property.) Or is your suggestion that I simply rename this hook to dark-mode-changed-hook without the ns- prefix, notwithstanding that it doesn=E2=80=99t currently work on any platform other than Mac OS? > --=20 > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no Many thanks, Daphne Preston-Kendal