From: Daphne Preston-Kendal <dpk@nonceword.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: Detecting changes between dark and light mode on Mac OS
Date: Sun, 21 Mar 2021 11:22:43 +0100 [thread overview]
Message-ID: <3B7287EE-B559-4E3B-A24E-7ABD71EFEB6F@nonceword.org> (raw)
In-Reply-To: <87h7l5j8hg.fsf@gnus.org>
On 21 Mar 2021, at 08:01, Lars Ingebrigtsen <larsi@gnus.org> 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 — I’ll 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.
>
> 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’s okay to add it just for Mac OS for now?
There’s 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’t tell
you what the system sets it to by default, which my patch fixes) is
one of them!
I don’t 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’t currently work on any platform other than Mac OS?
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no
Many thanks,
Daphne Preston-Kendal
next prev parent reply other threads:[~2021-03-21 10:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 13:23 Detecting changes between dark and light mode on Mac OS Daphne Preston-Kendal
2021-03-20 16:51 ` Daphne Preston-Kendal
2021-03-20 17:52 ` Alan Third
2021-03-21 11:01 ` Daphne Preston-Kendal
2021-03-21 7:01 ` Lars Ingebrigtsen
2021-03-21 10:22 ` Daphne Preston-Kendal [this message]
2021-03-22 20:07 ` Lars Ingebrigtsen
2021-03-23 18:32 ` chad
2021-03-23 17:49 ` Matt Armstrong
2021-03-24 8:30 ` Lars Ingebrigtsen
2021-03-25 16:33 ` Stefan Monnier
2021-03-28 1:16 ` chad
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=3B7287EE-B559-4E3B-A24E-7ABD71EFEB6F@nonceword.org \
--to=dpk@nonceword.org \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.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).