kuanyui / moe-theme.el

A customizable colorful eye-candy theme for Emacser. Moe, moe, kyun!
GNU General Public License v3.0
752 stars 59 forks source link

Day/Night theme functionality should be extracted. #3

Open milkypostman opened 10 years ago

milkypostman commented 10 years ago

When you install the moe-theme from MELPA, for some reason the light theme gets loaded. I feel that a theme should not do this.

I like your idea for a day and nigh theme, but would you at all consider making that functionality its own package that is not integrated wit the theme? That is you could easily make a minor-mode that simply has two variables—possibly daytime-theme and nighttime-theme—and sets the themes accordingly?

Then when this minor mode s activated, the theme choice is ignored.

I mean, the bigger issue is that I should be able to install just the moe-themes (light and dark) without having to worry about the day and night code.

kuanyui commented 10 years ago

Thanks for your reporting:

When you install the moe-theme from MELPA, for some reason the light theme gets loaded. I feel that a theme should not do this.

That's not my mind... I don't know why moe-light gets applied when installing from package.el... I just tried installing solarized-theme from MELPA, it also loaded its solarized-light, so I don't sure what do you mean...

I like your idea for a day and nigh theme, but would you at all consider making that functionality its own package that is not integrated wit the theme? That is you could easily make a minor-mode that simply has two variables—possibly daytime-theme and nighttime-theme—and sets the themes accordingly?

That's right. I've ever considered about making switching function independent from moe-theme, but soon I found a very ridiculous thing: Someone other has written an independent package (e.g. theme-changer.el, also available in MELPA) to switch light and dark themes according day/night time...So...I gave up because I thought MELPA needs not a functionally duplicated package. And the switcher kept being an additional function along with moe-theme.

Then when this minor mode s activated, the theme choice is ignored.

That's a good idea~:heart: but I need some free time to see how to write a minor mode for Emacs. [TODO]

I mean, the bigger issue is that I should be able to install just the moe-themes (light and dark) without having to worry about the day and night code.

If user isn't interesting in moe-theme-switcher, just ignore it (no matter whether location information has been set or not, as long as don't require moe-theme-switcher.) I think this may be enough, how do you think?

milkypostman commented 10 years ago

Ah, see I haven't used solarized-theme recently but it also should not load itself when installing.

Try some other theme packages and see how they behave. Most will not change the theme, but will then show up when you run customize-themes.

milkypostman commented 10 years ago

So I think there are actually two problems.

  1. In each theme file you set the background color outside of the deftheme macro.
  2. When one loads moe-theme-switcher there is a call to moe-theme-autoswitch.

When I get a chance I'll try to whip something up that could be a minor mode instead of a file that always calls a function. For now we could just remove the moe-theme-switcher from the package that melpa builds or we can leave it until someone complains.

Thanks for taking a shoot at a fix! On Nov 4, 2013 10:27 AM, "kuanyui" notifications@github.com wrote:

60261e7https://github.com/kuanyui/moe-theme.el/commit/60261e7880c77fe8f00c0789d379d25a60b0bf66

— Reply to this email directly or view it on GitHubhttps://github.com/kuanyui/moe-theme.el/issues/3#issuecomment-27709568 .

kuanyui commented 10 years ago

In fact, I'm just testing if the commit can fix the problem, so waiting for MELPA build it and tried to install it via package.el.

So I think there are actually two problems.

  1. In each theme file you set the background color outside of the deftheme macro.

Sorry, I still haven't understand the concept of Lisp's macro (errrrr...) so I don't know how should I fix this. I only know if (set-background-color ......) not exist, the background and foreground will goes wrong under a GUI version's Emacs.

  1. When one loads moe-theme-switcher there is a call to moe-theme-autoswitch. When I get a chance I'll try to whip something up that could be a minor mode instead of a file that always calls a function.

That's TOO thanks you! :pray: I think I definitely need spending times to learn how to write a minor/major mode for Emacs...

For now we could just remove the moe-theme-switcher from the package that melpa builds or we can leave it until someone complains.

Ja....Leave it until someone complains XD

Thanks for taking a shoot at a fix!

No no no, I really need to apologize that I left this issue for so many days... And thanks you spending times on report issues. :pray:

ssbb commented 9 years ago

I think that is non-theme related feature. And we already have module for this functionality - https://github.com/hadronzoo/theme-changer

xuchunyang commented 9 years ago

I still have this issue, third-part packages should not change Emacs behavior during compiling (or even loading with require) period. If moe-theme-switcher.el introduces this issue, I think it is ok to remove it from moe-theme.