all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Artur Malabarba <bruce.connor.am@gmail.com>
To: M <m@ahungry.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: GNU Elpa Theme (ahungry-theme) - should I add code to auto load-theme it?
Date: Fri, 6 Feb 2015 06:59:40 -0200	[thread overview]
Message-ID: <CAAdUY-K4dTwTXZKMqT6ohYqfH4SAEWokTdycyOxdnzYL9p1=2w@mail.gmail.com> (raw)
In-Reply-To: <87siejd6vc.fsf@ahungry.com>

[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]

> > 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).

Did you notice that the snippet starts with ";;;###autoload"?
That should take care of adding it to the auto loads file. If it doesn't,
then something is wrong.

>
> Adding the following to ahungry-theme-autoloads.el:
>
> (add-to-list 'custom-theme-load-path (or (file-name-directory #$) (car
> load-path)))

This kind of what the above snippet is supposed to do.

> 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.

Yes.

> 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?

I believe so.

> 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?

Possibly, I'd have to look into the code. But that's the wrong way of doing
things. It's better to just figure out why your file isn't being generated
properly.

[-- Attachment #2: Type: text/html, Size: 2398 bytes --]

  reply	other threads:[~2015-02-06  8:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 21:47 GNU Elpa Theme (ahungry-theme) - should I add code to auto load-theme it? Matthew Carter
2015-01-30 21:50 ` Dmitry Gutov
2015-01-30 23:57 ` Artur Malabarba
2015-02-05 17:44   ` Matthew Carter
2015-02-05 19:13     ` Stefan Monnier
2015-02-05 19:58       ` Matthew Carter
2015-02-05 20:48         ` Stefan Monnier
2015-02-05 22:08         ` Artur Malabarba
2015-02-06  4:03           ` Matthew Carter
2015-02-06  8:59             ` Artur Malabarba [this message]
2015-02-05 19:31     ` Ivan Shmakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAdUY-K4dTwTXZKMqT6ohYqfH4SAEWokTdycyOxdnzYL9p1=2w@mail.gmail.com' \
    --to=bruce.connor.am@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=m@ahungry.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.