From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel 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 Message-ID: References: <87iofo7xfo.fsf@ahungry.com> <87mw4sdzi0.fsf@ahungry.com> <87d25odtai.fsf@ahungry.com> <87siejd6vc.fsf@ahungry.com> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8fb1f33813bf71050e67a411 X-Trace: ger.gmane.org 1423213192 1172 80.91.229.3 (6 Feb 2015 08:59:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Feb 2015 08:59:52 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: M Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 06 09:59:52 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YJelS-0004XJ-4f for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 09:59:50 +0100 Original-Received: from localhost ([::1]:47235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJelR-0003CG-K3 for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 03:59:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJelK-0003C7-K2 for emacs-devel@gnu.org; Fri, 06 Feb 2015 03:59:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJelJ-0004hA-G0 for emacs-devel@gnu.org; Fri, 06 Feb 2015 03:59:42 -0500 Original-Received: from mail-ob0-x236.google.com ([2607:f8b0:4003:c01::236]:58279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJelJ-0004h2-8f for emacs-devel@gnu.org; Fri, 06 Feb 2015 03:59:41 -0500 Original-Received: by mail-ob0-f182.google.com with SMTP id nt9so11810368obb.13 for ; Fri, 06 Feb 2015 00:59:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=ZNtghwbeQ0ANl6FI/pQgiEzp0itkX/WMLR+lED9Ql9Y=; b=tqqvUlo5/EJI6cQkhKbRmGjf1SS6k2No+flZYECFJivFZoThFz7+TJjeADizP+Bhkw ESoQq7t82lZoTXQA2MqkbZfMjUFShuGrI+5NaPQ/k4iB0gxzYLwRP+4OWMCL5NgkNvAJ I3G7KRB7+/63iE4Anls4gHbvhwVf4OVe8KofCAnGVayf6oNdQ5ODTg1tlMOwfjydWO8t WJYzstVQTu8Dh5pe/90XfG8/fcOcPx9hMpkELvBw0gmHiaibU/57tUGyNtElU1gKEk9H wbgE9806T2Ai5X9eDh+Habpy8NNnSb7Z8UcktN9ngep4X3cNMMutvFCZ2G3s7wd2o99y NZrg== X-Received: by 10.182.68.12 with SMTP id r12mr1727244obt.84.1423213180721; Fri, 06 Feb 2015 00:59:40 -0800 (PST) Original-Received: by 10.76.125.1 with HTTP; Fri, 6 Feb 2015 00:59:40 -0800 (PST) Original-Received: by 10.76.125.1 with HTTP; Fri, 6 Feb 2015 00:59:40 -0800 (PST) In-Reply-To: <87siejd6vc.fsf@ahungry.com> X-Google-Sender-Auth: a5fM-bUUlxVf0KlPOLneIKvkNkk X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182506 Archived-At: --e89a8fb1f33813bf71050e67a411 Content-Type: text/plain; charset=UTF-8 > > 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. --e89a8fb1f33813bf71050e67a411 Content-Type: text/html; charset=UTF-8

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

--e89a8fb1f33813bf71050e67a411--