Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adjust frame-background-mode automatically #56

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

sellout
Copy link
Contributor

@sellout sellout commented Jul 7, 2024

So themes that support the background face spec characteristic work with Auto-Dark.

Fixes #55.

So themes that support the `background` face spec characteristic work with
Auto-Dark.

Fixes LionyxML#55.
@sellout
Copy link
Contributor Author

sellout commented Jul 7, 2024

I just realized that the file got autoformatted. Let me know if that’s an issue and I can revert those bits.

sellout added a commit to sellout/auto-dark-emacs that referenced this pull request Jul 7, 2024
Like `custom-enabled-themes`, Auto-Dark now allows multiple themes to be set for
either each mode. It also now defaults to using `custom-enabled-themes` if there
is nothing explicitly set for Auto-Dark. Because (dis|en)abling themes modifies
`custom-enabled-themes`, you either have to set both the dark-themes and
light-themes or neither, so there is a single new variable `auto-dark-themes`
that manages both lists.

If neither the new variable nor `custom-enabled-themes` is set, then it falls
back to the pre-existing single theme behavior, which is now marked obsolete.

With this change[^1] I can now configure my themes like
```elisp
(use-package emacs
  :custom (custom-enabled-themes '(bringhurst solarized inheritance)))

(use-package auto-dark
  :init (auto-dark-mode))
```
(since my themes all support dark/light modes).

[^1]: This change is built on LionyxML#56, because it doesn’t make sense to use
`custom-enabled-themes` with Auto-Dark unless it updates
`frame-background-mode`.
Copy link
Owner

@LionyxML LionyxML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool! Thanks @sellout!

This really makes auto-dark more robust when dealing with these sort of themes.

I see no reason why not add your changes. If you could please just check the review notes, that would be nice.

- undo unrelated auto-formatting
- use ASCII for docstring quotes
- minor phrasing adjustments in docstring
@sellout sellout requested a review from LionyxML July 8, 2024 02:56
@sellout
Copy link
Contributor Author

sellout commented Jul 8, 2024

Thanks for the quick review and encouragement. I have hopefully addressed everything.

I don’t know how I overlooked Auto-Dark for so long.

Copy link
Owner

@LionyxML LionyxML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for you efforts @sellout!
I am approving this one, It is already a nice addition to our package. :)

@LionyxML LionyxML changed the title Adjust frame-background-mode automatically feat: adjust frame-background-mode automatically Jul 11, 2024
@LionyxML LionyxML merged commit 39b168e into LionyxML:master Jul 11, 2024
sellout added a commit to sellout/auto-dark-emacs that referenced this pull request Jul 14, 2024
Like `custom-enabled-themes`, Auto-Dark now allows multiple themes to be set for
either each mode. It also now defaults to using `custom-enabled-themes` if there
is nothing explicitly set for Auto-Dark. Because (dis|en)abling themes modifies
`custom-enabled-themes`, you either have to set both the dark-themes and
light-themes or neither, so there is a single new variable `auto-dark-themes`
that manages both lists.

If neither the new variable nor `custom-enabled-themes` is set, then it falls
back to the pre-existing single theme behavior, which is now marked obsolete.

With this change[^1] I can now configure my themes like
```elisp
(use-package emacs
  :custom (custom-enabled-themes '(bringhurst solarized inheritance)))

(use-package auto-dark
  :init (auto-dark-mode))
```
(since my themes all support dark/light modes).

[^1]: This change is built on LionyxML#56, because it doesn’t make sense to use
`custom-enabled-themes` with Auto-Dark unless it updates
`frame-background-mode`.
LionyxML pushed a commit that referenced this pull request Sep 14, 2024
* Support multiple themes

Like `custom-enabled-themes`, Auto-Dark now allows multiple themes to be set for
either each mode. It also now defaults to using `custom-enabled-themes` if there
is nothing explicitly set for Auto-Dark. Because (dis|en)abling themes modifies
`custom-enabled-themes`, you either have to set both the dark-themes and
light-themes or neither, so there is a single new variable `auto-dark-themes`
that manages both lists.

If neither the new variable nor `custom-enabled-themes` is set, then it falls
back to the pre-existing single theme behavior, which is now marked obsolete.

With this change[^1] I can now configure my themes like
```elisp
(use-package emacs
  :custom (custom-enabled-themes '(bringhurst solarized inheritance)))

(use-package auto-dark
  :init (auto-dark-mode))
```
(since my themes all support dark/light modes).

[^1]: This change is built on #56, because it doesn’t make sense to use
`custom-enabled-themes` with Auto-Dark unless it updates
`frame-background-mode`.

* Update the README to match these changes

* Update the version to 0.13

* Improve variable documentation
@sellout sellout deleted the support-frame-background-mode branch October 17, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toggle without changing themes
2 participants