moe-theme.el icon indicating copy to clipboard operation
moe-theme.el copied to clipboard

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

Open stsquad opened this issue 9 years ago • 5 comments

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.

stsquad avatar Nov 04 '14 09:11 stsquad

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.

kuanyui avatar Nov 04 '14 14:11 kuanyui

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 avatar Nov 04 '14 14:11 stsquad

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

stsquad avatar Nov 04 '14 14:11 stsquad

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 avatar Aug 14 '15 14:08 priyadarshan

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:

priyadarshan avatar Aug 22 '15 08:08 priyadarshan