emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Customizable modes and package.el


From: Philipp Stephani
Subject: Re: Customizable modes and package.el
Date: Sat, 28 Mar 2015 09:30:03 +0000



Sebastian Wiesner <address@hidden> schrieb am Sa., 28. März 2015 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. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]