[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU Elpa Theme (ahungry-theme) - should I add code to auto load-them
From: |
Matthew Carter |
Subject: |
Re: GNU Elpa Theme (ahungry-theme) - should I add code to auto load-theme it? |
Date: |
Thu, 05 Feb 2015 23:03:03 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Artur Malabarba <address@hidden> writes:
>> (at least until the ELPA generated
>> autoload file has support for adding ELPA loaded themes into the
>> custom-theme-load-path automatically).
>
> What do you mean by support? Here's what some themes do:
>
> ;;;###autoload
>
> (and load-file-name (boundp 'custom-theme-load-path) (add-to-list
> 'custom-theme-load-path (file-name-as-directory (file-name-directory
> load-file-name))))
>
> It might be worth defining a notation of sorts that would have
> make-autoloads do this for you automatically. But in the mean time,
> use the snippet above, don't ask people to require your theme.
>
I had actually tried the aforementioned snippet (placed in
ahungry-theme.el) in the past, but it never gets evaluated unless I have
a (require 'ahungry-theme) in the init (which is how I discovered that
the simple 'require' applies most the theme).
Adding the following to ahungry-theme-autoloads.el:
(add-to-list 'custom-theme-load-path (or (file-name-directory #$) (car
load-path)))
lets a simple (load-theme 'ahungry) work as expected (prompt to trust
the theme, and a second to remember the trust choice), as well as
applying the theme, without requiring user intervention of setting the
custom-theme-load-path in their init.
Since I have a dependency defined in the theme file of ((emacs "24)),
which will thus have the load-theme support, it is probably unnecessary
to have a check for (boundp 'custom-theme-load-path) right?
If I manually create and add an "ahungry-theme-autoloads.el" file in
elpa/packages/ahungry-theme, will it supersede the one Elpa creates
automatically?
--
Matthew Carter (address@hidden)
http://ahungry.com
Re: GNU Elpa Theme (ahungry-theme) - should I add code to auto load-theme it?, Ivan Shmakov, 2015/02/05