Commit graph

339 commits

Author SHA1 Message Date
John Wiegley
87a8ff6d69 Return t' after calling eval-after-load'
Fixes https://github.com/jwiegley/use-package/issues/174
2017-02-16 11:44:41 -08:00
John Wiegley
61d6a8e449 Add autoload cookie for use-package-autoload-keymap
Fixes https://github.com/jwiegley/use-package/issues/337
2017-02-16 11:33:29 -08:00
John Wiegley
a4c3244f30 Merge remote-tracking branch 'origin/pr/349' 2017-02-16 11:14:25 -08:00
John Wiegley
0905a7b1c7 Merge pull request from justbur/find-form
Add function use-package-jump-to-package-form
GitHub-reference: https://github.com/jwiegley/use-package/issues/359
2017-02-13 16:53:56 -05:00
John Wiegley
c287aa3085 Merge pull request from justbur/imenu3
Improve imenu support
GitHub-reference: https://github.com/jwiegley/use-package/issues/356
2017-02-13 16:44:04 -05:00
Radon Rosborough
482c8e5728 Fix use-package-defaults
This patch should address issues https://github.com/jwiegley/use-package/issues/428 and https://github.com/jwiegley/use-package/issues/429. See https://github.com/jwiegley/use-package/issues/426 for
discussion. In brief, the issue was that use-package-sort-keywords was
not applied when the predicates in use-package-defaults did not return
true, when it should have been applied unconditionally.
2017-02-13 12:48:48 -08:00
Radon Rosborough
8fa6e8823b Unrevert "Add use-package-defaults"
This reverts commit 013425edeb.
2017-02-13 12:48:24 -08:00
John Wiegley
013425edeb Revert "Add use-package-defaults"
This reverts commit 3dec23c086.
2017-02-13 10:33:11 -08:00
Radon Rosborough
3dec23c086 Add use-package-defaults
Previously, the :config, :ensure, and :pin keywords had default
values (dependent on the values of the use-package-always-ensure and
use-package-always-pin). This change allows the user to customize the
default values used for those keywords, and add default values for
their own keywords in a non-hacky way.

This functionality would be useful for (as an example) the
quelpa-use-package package, which needs to use an advice to override
the functionality of :ensure. The same problem prevents adding a
use-package-always-quelpa variable in any reasonable way, without a
way to customize the default values of keywords.
2017-01-16 13:47:31 -08:00
Radon Rosborough
e853355714 Add use-package-ensure-function
This allows the user to customize the :ensure keyword by using a
different package manager than package.el.
2017-01-15 09:03:05 -07:00
John Wiegley
ad8094c22d Add new customization option use-package-always-demand
This is equivalent to adding `:demand t` to all `use-package` declarations,
and has the same semantics as doing so (meaning it can be overridden locally
using `:defer t` in a declaration).

Fixes https://github.com/jwiegley/use-package/issues/423
2016-12-22 09:03:47 -08:00
John Wiegley
dbf46d97be Merge pull request from basil-conto/preface
Increase :preface priority
GitHub-reference: https://github.com/jwiegley/use-package/issues/418
2016-12-18 15:21:10 -08:00
Jonas Bernoulli
134ecb3c88 Support outline-minor-mode
In "use-package.el" prefix headings with ";;;" instead of just
";;".  In "bind-key.el" add the missing ";;; Code:" heading.
In both libraries set `outline-regexp' to an appropriate value.
2016-12-17 15:26:15 +01:00
Basil L. Contovounesios
aad07daa8d Increase :preface priority
Reconcile order of `use-package-keywords' with the README
description of `:preface' as occurring before everything but
`:disabled'.
2016-12-16 08:50:05 +00:00
Philipp Stephani
baa9e25a6b Declare package-read-all-archive-contents
Fixes https://github.com/jwiegley/use-package/issues/398
2016-10-31 18:22:03 +01:00
Noam Postavsky
9688d2f64b Don't allow implicit package name arg for binders
It's unlikely that

    (use-package foopkg :bind "<some-key>")

intendes to bind <some-key> to 'foopkg command.
2016-10-31 08:49:21 -04:00
Noam Postavsky
65c7b42a14 Don't allow nil as a mode function
This means (use-package foopkg :mode (".foo")) will add (".foo"
. foopkg) into auto-mode-alist instead of the broken (".foo" . nil),
this is more consistent with the behaviour of (use-package foopkg
:mode (".foo" ".bar")).
2016-10-31 08:49:21 -04:00
Noam Postavsky
fc57b34299 Refactor pair normalizers; add tests for them
This is not a pure refactoring, it also fixes a bug where
:bind ([keysym] . "string") would actually bind keysym to nil (i.e.,
unbind it).  It now binds to "string" as expected.
2016-10-31 08:49:21 -04:00
John Wiegley
fc7fc42f13 Bump version to 2.3 2016-10-17 16:40:29 -07:00
Mike Appleby
ef0cbfdc73 Ensure package-pinned-packages is bound before referencing it
Add a bound-and-true-p guard to package-pinned-packages before
referencing it in use-package-ensure-elpa.

Package pinning was introduced in Emacs 24.4, and hence
package-pinned-packages in unbound by default in earlier versions.

Relevant commits:
	 72452b5 Merge pull request https://github.com/jwiegley/use-package/issues/367 from ketbra/master
	 5053f75 Make pin and ensure compatible

Fixes https://github.com/jwiegley/use-package/issues/375

Copyright-paperwork-exempt: yes
2016-08-15 11:48:33 -05:00
John Wiegley
4629e86240 Remove the use of a tab 2016-07-22 11:23:10 -07:00
Matthew Feinberg
5053f75e00 Make pin and ensure compatible
`:pin` does not work with `:ensure`, because it doesn't add the package to package-pinned-packages until after reading the package archive contents.  This change causes the package archive contents to be reread if the package is pinned and `:ensure` is being used.

Copyright-paperwork-exempt: yes
2016-07-21 08:38:30 -04:00
Noam Postavsky
79c38c5184 Fix declare-function call: FILE must be a string 2016-07-17 22:28:25 -04:00
Noam Postavsky
71057bc20f use-package-as-string: use noerror parameter 2016-07-17 22:27:13 -04:00
Noam Postavsky
be7a0e4649 Don't pass a constant as the state
for use-package-process-keywords, because the function may modify the
list object.  Modifying a quoted constant can lead to unexpected side
effects (e.g. values from previous use-package forms end up in
subsequent ones).
2016-07-17 22:26:40 -04:00
John Wiegley
758739e6db Version 2.2 2016-07-06 15:20:41 -07:00
Justin Burkett
59d34cf9ce Move :init forms before :after and :demand
The docstring of use-package says that :init should run before the
package is loaded but using :after moves the require statement ahead of
:init when any package specified in :after is already loaded. In the
following example, in the first case bar-x might get set before or after
bar is loaded depending on if foo is already loaded at the time, while
the second case always sets bar-x first.

(use-package bar
  :after (foo)
  :init (setq bar-x 2)
  :config (bar-mode))

(use-package bar
  :init (setq bar-x 2)
  :config (bar-mode))

This commit fixes the issue and makes sure that bar-x is set before bar
is loaded by use-package. Fixes https://github.com/jwiegley/use-package/issues/352.
2016-06-23 10:01:33 -04:00
Justin Burkett
c13ca927c2 Add function use-package-jump-to-package-form
This is an attempt at resolving https://github.com/jwiegley/use-package/issues/329. The new interactive function
use-package-jump-to-package-form will prompt with a completing read of
all known packages. After selecting a package, use-package-find-require
searches load-history to see where the package was required and then I
attempt to find the correct use-package form using
use-package-form-regexp.

It will fail if the use-package form you are looking for did not
actually load the package. For example it could be something that is a
dependency of a library that was already loaded. In some sense this is a
feature because it is helpful to know that the library was already
loaded when your use-package form was encountered. It will also fail if
your use-package declaration doesn't match the regexp used, but this is
easily adjusted.
2016-06-22 23:18:14 -04:00
Justin Burkett
75bdb87833 Improve imenu support
Instead of using defvar for lisp-mode-symbol-regexp, wait until
lisp-mode is loaded and check for its existence to avoid making
use-package the place where this variable is declared.
2016-06-15 22:54:15 -04:00
Justin Burkett
da08a04652 Fix imenu support for older versions
lisp-mode-symbol-regexp was not defined in Emacs 24.5.
2016-06-13 21:02:14 -04:00
John Wiegley
1d6b3174f5 Merge pull request from justbur/imenu
Add imenu support for use-package forms
GitHub-reference: https://github.com/jwiegley/use-package/issues/354
2016-06-13 09:57:20 -07:00
Justin Burkett
d34fb2bdc9 Add imenu support for use-package forms
Also add require forms and group both under menu "Package".
2016-06-13 09:45:27 -04:00
robario
858a7f9b7c Fix to ignore load error caused via :after
Copyright-paperwork-exempt: yes
2016-06-05 14:58:40 +09:00
Chunyang Xu
3aa6aecb7f Mark package as selected with package-install
Fixes https://github.com/jwiegley/use-package/issues/327
2016-03-31 19:33:55 +08:00
John Wiegley
a1c4e6d0ab Normalize some error text 2016-02-26 16:18:21 -08:00
John Wiegley
f150691c78 Only printing debug messages if use-package-verbose is `debug'
Fixes https://github.com/jwiegley/use-package/issues/271
2016-02-26 16:16:49 -08:00
John Wiegley
6a90a9f16d Add configuration variable `use-package-check-before-init'
Fixes https://github.com/jwiegley/use-package/issues/306
2016-02-25 17:24:59 -08:00
John Wiegley
ce51ea2055 Use add-to-list' defensively instead of push'
GitHub-reference: fixes https://github.com/jwiegley/use-package/issues/293
2016-02-25 17:13:02 -08:00
John Wiegley
6da4e0ce9d Add variable `use-package-always-defer'
GitHub-reference: fixes https://github.com/jwiegley/use-package/issues/202
2016-02-25 17:04:17 -08:00
John Wiegley
eeba14ef07 Restore :bind-keymap, it does something special still 2016-02-25 16:41:09 -08:00
John Wiegley
828563a756 Remove :bind-keymaps, and only apply :map bindings after load 2016-02-25 16:37:34 -08:00
John Wiegley
856e8ee245 Support multiples uses of :map with :bind
GitHub-reference: fixes https://github.com/jwiegley/use-package/issues/121
2016-02-25 15:57:50 -08:00
John Wiegley
947345028e Add another `declare' 2016-02-25 15:16:04 -08:00
John Wiegley
c65a334276 Handle :unless correctly
GitHub-reference: fixes https://github.com/jwiegley/use-package/issues/197
2016-02-25 15:08:32 -08:00
John Wiegley
543935482f Add a comment about a recent change 2016-02-09 19:33:09 -05:00
John Wiegley
416096bfdc Merge pull request from waymondo/master
Allow string values in cons for :bind keywords
GitHub-reference: https://github.com/jwiegley/use-package/issues/303
2016-02-09 19:31:48 -05:00
John Wiegley
ee8ac83641 Add an autoload cookie for `use-package' 2016-02-06 14:56:43 -05:00
Thierry Volpiatto
c5e98d87da Ensure package-install support a second argument
* use-package.el (use-package-ensure-elpa): Do it.
2016-02-04 11:19:23 +01:00
Thierry Volpiatto
5cbfd926c5 When :ensure is used install package as a selected package
Also shutup bytecompiler about package-archive-contents.

* use-package.el (use-package-ensure-elpa): Add package to selected package
by using second arg of package install.
2016-02-04 10:20:55 +01:00
John Wiegley
9e2dcf8655 Merge pull request from kovrik/fix-pin-performance
Do not package-initialize on each :pin
GitHub-reference: https://github.com/jwiegley/use-package/issues/308
2016-01-25 12:58:02 -05:00