kuanyui / moe-theme.el

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

Update autoloads to ensure moe-theme available to theme choosing helpers #38

Open stsquad opened 9 years ago

stsquad commented 9 years ago

Currently when installed moe-theme is not available to theme pickers like helm-themes. This is because it's not using the Emacs custom theme machinery. As the theme is Emacs 24 only there is no particular reason not to use it.

kuanyui commented 9 years ago

First, I don't understand, moe-theme is just written for > 24.3 and just using built-in deftheme you've said. Why cannot be loaded by load-theme or something like?


As regards why moe-theme.el exists, instead of only moe-light-theme.el&moe-dark-theme.el...

The file moe-theme.el is just used for customization options, you still can load & use moe-light/dark-theme.el themselves (though, without customizations).

In fact, I've surely ever tried to do those options machinery withing themselves file (ligth&dark), but they just cannot be loaded and applied successfully. (Don't ask me why, I also want to know the reason. I've ever ask the community for this question but didn't get answer. After all, I guess it may be for security reasons that load-theme won't merely eval or load-file the themes files...) I don't know if this problem has fixed in 24.4. Currently I cannot and have no time try it.

stsquad commented 9 years ago

I've done some additional digging and I think it's not the deftheme machinery (which I'd missed having only looked at moe-theme.el) but the autoloads. I think if you add:

;;;###autoload
(when load-file-name
  (add-to-list 'custom-theme-load-path
               (file-name-as-directory (file-name-directory load-file-name))))

This will ensure that custome-theme-load-path is updated and then moe-theme can be loaded on demand from theme choosers like helm-themes.

stsquad commented 9 years ago

I see the autoload was added to try and fix #31 which I don't think it did.

priyadarshan commented 8 years ago

I also see the same.

After installing moe-theme, and doing M-x load-theme RET TAB moe-theme does not show up in the completion list, in no variants (dark or light).

Installing, for example, color-theme-sanityinc-tomorrow, and doing the same (M-x load-theme RET TAB) one can see the various variants offered by that theme.

I am not sure if related, but I have also noticed that moe-theme takes quite a bit of time loading, more than double than other similarly complex themes.

Try profiling with esup.

moe-theme takes, on my machine, about 600ms, while, for example, the aforementioned color-theme-sanityinc-tomorrow just 200ms.

Using use-package, my total load time (with about 150 packages) is about 2s, of which 1/8 is moe-theme.

I need to restart Emacs often, for developing reasons. Becasue of that, unfortunately I had to stop using moe-theme for now, although it has been my favourite since a long time.

priyadarshan commented 8 years ago

Using el-get allows to fix the issue. Could it be a MELPA related bug?

Also, I was able to shrink down moe-theme load time a lot with this:

(el-get-bundle moe-theme)
(use-package moe-theme
  :config
  (setq moe-theme-highlight-buffer-id t)
  (setq moe-theme-resize-org-title '(1.6 1.4 1.2 1.1 1.0 1.0 1.0 1.0 1.0))
  (moe-dark))

Now my load time is back to 0.4 seconds and I started using moe-theme again.

:tada: