From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Customizable modes and package.el Date: Sat, 28 Mar 2015 09:30:03 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b3a8b34d2e2e0051255e479 X-Trace: ger.gmane.org 1427535019 11266 80.91.229.3 (28 Mar 2015 09:30:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Mar 2015 09:30:19 +0000 (UTC) To: Sebastian Wiesner , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 28 10:30:19 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 1Ybn4J-0000Ec-92 for ged-emacs-devel@m.gmane.org; Sat, 28 Mar 2015 10:30:15 +0100 Original-Received: from localhost ([::1]:53264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ybn4D-0006cn-8Q for ged-emacs-devel@m.gmane.org; Sat, 28 Mar 2015 05:30:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ybn4A-0006bC-5z for emacs-devel@gnu.org; Sat, 28 Mar 2015 05:30:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ybn48-0004y2-SJ for emacs-devel@gnu.org; Sat, 28 Mar 2015 05:30:06 -0400 Original-Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:38773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ybn48-0004w3-M5 for emacs-devel@gnu.org; Sat, 28 Mar 2015 05:30:04 -0400 Original-Received: by wibgn9 with SMTP id gn9so61272963wib.1 for ; Sat, 28 Mar 2015 02:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=WUzATOnHfAvtRUfty7t+3eoKDN5AV7PP2PSUxUJL8g8=; b=YvAHakpD0QLfPwZYWFc8393OWfNMf3M/SN6Q9bIExbKGudMl1jYBMZpTsFrSCstPMj yvH4YPLGOnl/2COcefrFyB/YddElr74JH+OwO6BtOKinO4zMJ5VC67oNgVwSII0Ns5tz E+PYstoW4K9Wq4GBS+ZzD8v6FfRztmnYbGWBSfeS+/pZwnZdZY2zMsKwcEVeIVqVkGgK 3H3ExnffELdmGTEGSOFTb2GZHjQ4Byz+yRaAP671caj2mhotRhwgYEFpPc+zAQr4RJ6F QOoJopVnWANHHpyzEH99SYdk5hTvpx1ZPVpNWlYQtGCO99q8v7vn7SPadgt3tFrk2dx7 4bLg== X-Received: by 10.194.19.166 with SMTP id g6mr45511821wje.150.1427535004097; Sat, 28 Mar 2015 02:30:04 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22c 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:184446 Archived-At: --047d7b3a8b34d2e2e0051255e479 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sebastian Wiesner schrieb am Sa., 28. M=C3=A4rz 20= 15 um 09:58 Uhr: > Hello, > > I have a globalized minor mode defined as follows: > > (define-globalized-minor-mode global-flycheck-mode flycheck-mode > flycheck-mode-on-safe > :init-value nil > :group 'flycheck > :require 'flycheck) > > If my understanding is correct, users should now be able to enable > "global-flycheck-mode" through the customize interface, shouldn't > they? After all, I can see the mode in customize, enable it, and > Emacs writes the following form to my init file: > > (custom-set-variables > ... > '(global-flycheck-mode t nil (flycheck)) > ... > > Now, my users usually install my package via ELPA, and by default, > ELPA packages do not become available until *after* the init file was > loaded. > > Consequently, the above form fails to load, since customize tries to > load a library which isn't available yet. I read the documentation on > customize again, but I didn't find anything related to package.el at > all. > > Probably because package.el started as a third-party library that is newer than custom.el. Now that package.el is part of Emacs, their interaction could be improved. Perhaps custom-theme-set-variables could do two-phase initialization: if requiring a feature fails, the initialization of the variable is retried after package-initialize has been executed. --047d7b3a8b34d2e2e0051255e479 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Sebastian Wiesner <<= a href=3D"mailto:swiesner@lunaryorn.com">swiesner@lunaryorn.com> sch= rieb am Sa., 28. M=C3=A4rz 2015 um 09:58=C2=A0Uhr:
Hello,

I have a globalized minor mode defined as follows:

(define-globalized-minor-mode global-flycheck-mode flycheck-mode
=C2=A0 flycheck-mode-on-safe
=C2=A0 :init-value nil
=C2=A0 :group 'flycheck
=C2=A0 :require 'flycheck)

If my understanding is correct, users should now be able to enable
"global-flycheck-mode" through the customize interface, shouldn&#= 39;t
they?=C2=A0 After all, I can see the mode in customize, enable it, and
Emacs writes the following form to my init file:

(custom-set-variables
...
=C2=A0'(global-flycheck-mode t nil (flycheck))
=C2=A0...

Now, my users usually install my package via ELPA, and by default,
ELPA packages do not become available until *after* the init file was
loaded.

Consequently, the above form fails to load, since customize tries to
load a library which isn't available yet. I read the documentation on customize again, but I didn't find anything related to package.el at all.



Probably because packag= e.el started as a third-party library that is newer than custom.el.
Now that package.el is part of Emacs, their interaction could be improve= d. Perhaps custom-theme-set-variables could do two-phase initialization: if= requiring a feature fails, the initialization of the variable is retried a= fter package-initialize has been executed.=C2=A0
--047d7b3a8b34d2e2e0051255e479--