unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Matt Armstrong <matt@rfc20.org>
To: Daphne Preston-Kendal <dpk@nonceword.org>, 47291@debbugs.gnu.org
Subject: bug#47291: [PATCH] Auto-detect ns-appearance of frames and call a hook when it changes
Date: Tue, 23 Mar 2021 11:05:59 -0700	[thread overview]
Message-ID: <87blb9hhiw.fsf@rfc20.org> (raw)
In-Reply-To: <1B39376A-B108-41FD-87EE-52D68E8F7256@nonceword.org>

Daphne Preston-Kendal <dpk@nonceword.org> writes:

> This is a slightly cleaned-up version of the patch I initially posted for
> commentary on emacs-devel.
> <https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00482.html>
>
> The patch makes two closely related changes: when a new frame is
> created, the ns-appearance parameter (which was already in Emacs) is
> bound to 'light or 'dark depending on the system theme. (Previously,
> it could be set explicitly and Emacs would respect that change on a
> per-frame basis, but if it wasn't explicitly set it was unbound.)

I think GTK already has similar functionality.  When I change the GTK
theme Emacs' frame decorations change accordingly.  So, to me this part
of the patch seems fine from the policy perspective that Lars raised on
emacs-devel.


> Secondly, it registers an event handler for changes to the system-wide
> theme, and when the system theme changes, it changes the ns-appearance
> parameter of all frames to match the new system theme, and runs a new
> hook, ns-dark-mode-changed-hook so that users can e.g. set a new Emacs
> theme to match the new system theme or whatever.

I suggested an alternative approach on emacs-devel -- use the
dynamic-setting.el mechanism which is used for GTK but expressed in a
general way.

Since Emacs already has that mechanism for GTK, I think this approach
would satisfy the policy issue Lars raised as well.





  reply	other threads:[~2021-03-23 18:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-21 10:48 bug#47291: [PATCH] Auto-detect ns-appearance of frames and call a hook when it changes Daphne Preston-Kendal
2021-03-23 18:05 ` Matt Armstrong [this message]
2021-05-18 14:43   ` Lars Ingebrigtsen
2021-05-18 17:44     ` Alan Third
2021-05-18 18:03   ` Daphne Preston-Kendal
2021-10-08  8:24     ` Daphne Preston-Kendal

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=87blb9hhiw.fsf@rfc20.org \
    --to=matt@rfc20.org \
    --cc=47291@debbugs.gnu.org \
    --cc=dpk@nonceword.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).