]> git.eshelyaron.com Git - emacs.git/commit
BREAKING CHANGE: Remove :idle and :idle-priority
authorJohn Wiegley <johnw@newartisans.com>
Sun, 15 Mar 2015 23:07:37 +0000 (18:07 -0500)
committerJohn Wiegley <johnw@newartisans.com>
Sun, 15 Mar 2015 23:07:37 +0000 (18:07 -0500)
commit9385ab417af21653b5b62219dd19ac95a0df3b0a
tree53e89a286a4ac5cfac91dd79716c3ba08abb0f44
parent81f5e48d328e209631c6ec2588fe8d29e3c7053b
BREAKING CHANGE: Remove :idle and :idle-priority

I am removing this feature for now because it can result in a nasty
inconsistency.  Consider the following definition:

  (use-package vkill
    :commands vkill
    :idle (some-important-configuration-here)
    :bind ("C-x L" . vkill-and-helm-occur)
    :init
    (defun vkill-and-helm-occur ()
      (interactive)
      (vkill)
      (call-interactively #'helm-occur))

    :config
    (setq vkill-show-all-processes t))

If I load my Emacs and wait until the idle timer fires, then this is the
sequence of events:

    :init :idle <load> :config

But if I load Emacs and immediately type C-x L without waiting for the
idle timer to fire, this is the sequence of events:

    :init <load> :config :idle

It's possible that the user could use `featurep` in their idle to test
for this case, but that's a subtlety I'd rather avoid.

What I would consider is this: `:idle [N]` is a keyword that simply
implies `:defer`, with an option number of N to specify a second count.
After that many seconds, if the package has not yet been loaded by
autoloading, it will be loaded via the idle timer.

This approach has the benefit of complete consistency for both the idle
and the autoloaded cases.  Although, the fact that it implies `:defer`
means we don't have to consider what it means to add `:idle` behavior to
a demand-loaded configuration.
lisp/use-package/use-package.el