Commit graph

351 commits

Author SHA1 Message Date
John Wiegley
3cb64648fc Only add :ensure nil on :load-path if use-package-always-ensure is t 2017-11-29 23:08:22 -08:00
John Wiegley
35f46f7b42 Restructure some code 2017-11-29 22:20:43 -08:00
John Wiegley
5e1a656e06 Using :load-path without also using :ensure now implies :ensure nil
Fixes https://github.com/jwiegley/use-package/issues/190
2017-11-29 22:12:19 -08:00
John Wiegley
fab33fef3a Correction to use-package--recognize-function
Finishes https://github.com/jwiegley/use-package/issues/525
2017-11-29 22:03:03 -08:00
John Wiegley
5f2b0cbe8f Allow keys to be bound to nil
Fixes https://github.com/jwiegley/use-package/issues/525
2017-11-29 21:44:02 -08:00
John Wiegley
1167e7d063 Fix a missing `and' 2017-11-29 16:53:41 -08:00
John Wiegley
6a62122e9c Use backquote rather than quote 2017-11-29 16:48:58 -08:00
John Wiegley
0887e1f9d0 Correct use-package-normalize-mode 2017-11-29 16:44:20 -08:00
John Wiegley
8051c9f5cd Update version and copyright 2017-11-29 16:38:23 -08:00
John Wiegley
bff472ea80 Allow :bind ("C-c C-c" . (lambda () (ding))) and #'(lambda ...)
Fixes https://github.com/jwiegley/use-package/issues/333
Fixes https://github.com/jwiegley/use-package/issues/461
2017-11-29 16:37:03 -08:00
Basil L. Contovounesios
3db39c0573 Require Emacs version >= 24.3
Re: https://github.com/jwiegley/use-package/issues/457
2017-11-29 16:11:09 +00:00
Basil L. Contovounesios
4303a2faf6 Require cl-lib and do not use seq functions
cl-lib is also required for a separate call to cl-mapcan.

Fixes https://github.com/jwiegley/use-package/issues/520
2017-11-29 15:47:00 +00:00
John Wiegley
b7041c0f29 When use-package-inject-hooks is non-nil, always fire init/config hooks
This used to not happen if `:init` or `:config` was missing, or set to nil as
with `:init nil`.

Fixes https://github.com/jwiegley/use-package/issues/250
2017-11-28 21:12:25 -08:00
John Wiegley
a392f6da55 When byte-compiling, correctly output declare-function directives
Fixes https://github.com/jwiegley/use-package/issues/474
2017-11-28 20:31:40 -08:00
John Wiegley
2c32857d57 Make diminish a soft dependency, as delight already was
Fixes https://github.com/jwiegley/use-package/issues/493
2017-11-28 20:26:48 -08:00
John Wiegley
7531c374bf Allow :diminish to take no argument, once again 2017-11-28 16:27:09 -08:00
John Wiegley
c811637b30 Fix for single :custom (foo bar) 2017-11-28 14:39:59 -08:00
John Wiegley
2ebf076733 Allow :custom (foo1 bar1) (foo2 bar2) etc
Fixes https://github.com/jwiegley/use-package/issues/518
2017-11-28 14:16:13 -08:00
John Wiegley
4ad4a59685 Add support for :hook
Fixes https://github.com/jwiegley/use-package/issues/444
2017-11-28 13:58:38 -08:00
John Wiegley
700c92c5de Append to *use-package* when debugging, don't clear it
Fixes https://github.com/jwiegley/use-package/issues/476
2017-11-28 11:41:50 -08:00
John Wiegley
6f9d4342ca Make unrecognized keywords a warning
This could actually be used to store your own metadata in use-package
declarations, to be (read) later by simply parsing init file contents.

Fixes https://github.com/jwiegley/use-package/issues/483
2017-11-28 11:31:35 -08:00
John Wiegley
9b523d7c4e Upgrade license to GPL 3
Fixes https://github.com/jwiegley/use-package/issues/499
2017-11-28 11:22:53 -08:00
John Wiegley
18b9bf18ad Don't allow :commands, :bind, etc., to be given an empty list
This makes the following an error:

    :commands
    :commands nil
    :commands ()

Fixes https://github.com/jwiegley/use-package/issues/512
2017-11-28 11:17:05 -08:00
John Wiegley
4ddf42185a Explicit :defer t should override use-package-always-demand
Fixes https://github.com/jwiegley/use-package/issues/514
2017-11-28 11:14:30 -08:00
John Wiegley
5ac5f8bc63 Merge pull request from drrlvn/patch-1
Remove duplicate documentation of :mode
GitHub-reference: https://github.com/jwiegley/use-package/issues/489
2017-11-28 11:08:08 -08:00
John Wiegley
c72d8567d2 Corrections to the normalization of :custom 2017-11-28 11:07:36 -08:00
John Wiegley
903ff82219 Merge pull request from joewreschnig/implicit-diminish
Allow `:diminish` with no arguments.
GitHub-reference: https://github.com/jwiegley/use-package/issues/472
2017-11-28 11:07:03 -08:00
Justin Talbott
57ec21a013 allow customized values to be nil 2017-11-20 23:33:34 -05:00
John Wiegley
9bf8264523 Merge pull request from canatella/add-customization-keywords
Add customization keywords
GitHub-reference: https://github.com/jwiegley/use-package/issues/508
2017-11-20 15:42:19 -08:00
Damien Merenne
d8bbc3a95d Add support for face customization
Allows customization of faces using customize-set-faces. This makes it
easier to manage customization in version control. Instead of having all the
faces written in a custom.el, the faces can be customized where the rest
of the package is configured.
2017-11-10 09:17:46 +01:00
Damien Merenne
fcf219701b Add support for variable customization
Allows customization of variable using customize-set-variables. This makes it
easier to manage customization in version control. Instead of having all the
variables written in a custom.el, the variable can be customized where the rest
of the package is configured.
2017-11-10 09:14:38 +01:00
Carl Lieberman
5396491aec Fix typos in docstring 2017-10-30 16:03:35 -04:00
Jonas Bernoulli
85643eaf18 Cosmetic changes to use-package-ensure-elpa 2017-10-13 14:09:13 +02:00
Jonas Bernoulli
68c9ee4bff Don't use with-demoted-errors in use-package-ensure-elpa
It expects a literal string as argument at macro-expansion
time, but we need to construct the message.
2017-10-13 14:08:06 +02:00
John Wiegley
3f58555ed8 Merge pull request from raxod502/feat/fix-install-deferred
Fix bug in use-package-install-deferred-package
GitHub-reference: https://github.com/jwiegley/use-package/issues/479
2017-08-12 22:56:38 -07:00
Dror Levin
c3455b2a67 Remove duplicate documentation of :mode 2017-07-31 00:11:13 +03:00
Joe Wreschnig
d0dcd95d80 Document :delight in the doc string and README 2017-07-10 09:17:23 +02:00
Joe Wreschnig
ca83649a32 Allow :diminish with no arguments
When given no arguments, have :diminish assume it should diminish a
mode named after the current package (the package’s name, with “-mode”
appended, if it’s not already) to an empty string.

When given only a string to diminish an implicit package name to, do
not append “-mode” to the package name if it already ends with
it.  (This is a backwards-incompatible change if someone was
diminishing a package named “foo-mode” implementing `foo-mode-mode`.)

Add test cases for `use-package-normalize-diminish`.

This addresses some of the redundancy mentioned in issue https://github.com/jwiegley/use-package/issues/288.
2017-07-08 15:32:46 +02:00
Joe Wreschnig
7eec86f5cd Allow :major as the third argument in :delight calls 2017-07-02 17:45:26 +02:00
Joe Wreschnig
4b8b850cf0 Allow multiple :delight arguments, or omitting the mode. ()
This allows using forms such as

    (use-package foo :delight)
        ;; => (delight 'foo-mode)
    (use-package foo :delight " f")
        ;; => (delight 'foo-mode " f")
    (use-package foo :delight (a-mode) (b-mode " b")
        ;; => (delight 'a-mode) (delight 'b-mode " b")

This brings support for `:delight` in line with `:diminish`.
GitHub-reference: https://github.com/jwiegley/use-package/issues/477
2017-07-02 16:32:38 +02:00
Radon Rosborough
6e6b533aaf Fix bug in use-package-install-deferred-package
Previously, deferred installation didn't work because I didn't convert
the result of a `completing-read' back from a string to a symbol,
which meant the hash-table lookup failed.
2017-06-30 12:26:26 -07:00
Joe Wreschnig
ac4a3a4aa8 Add :magic and :magic-fallback keywords (issue)
These keywords work equivalently to `:mode` or `:interpreter`, but for
`magic-mode-alist` and `magic-fallback-mode-alist`.

The handler function implementation is now passed a list to add to,
and shared by all four of them.
GitHub-reference: https://github.com/jwiegley/use-package/issues/469
2017-06-15 20:56:53 +02:00
David Leatherman
ec088b747a Protect against errors during package install
If the network is missing and there is a new use-package with :ensure,
startup would fail part of the way through due package.el being unable
to reach the package repo.  This will catch that error and report it
while allowing startup to continue.

Copyright-paperwork-exempt: yes
2017-05-22 18:23:26 -07:00
Radon Rosborough
3823a9059e Fix quoting error in failed autoload message 2017-05-07 15:23:50 -07:00
Radon Rosborough
a9ffffcee5 Make use-package-normalize-value handle nil better
The previous version of `use-package-normalize-value', when passed
nil, would return the list (symbol-value (quote nil)). This meant that
keywords which used `use-package-normalize-value' or the higher-level
normalizer `use-package-normalize-test' would get a non-nil
argument (i.e. the above list) even when the user specified nil to the
package.

This had the concrete impact of making it so that :defer-install nil
was treated as :defer-install t.
2017-04-04 21:16:06 -07:00
Radon Rosborough
e5e335424c Add comment explaining keyword-argument patch 2017-04-03 10:40:46 -07:00
Radon Rosborough
d5d320e607 Don't mutilate keyword arguments in :bind
The parsing logic in `use-package-normalize-pairs' is not designed to
deal with keyword arguments. However, `use-package-normalize-pairs' is
used to process the arguments to :bind, which can include keyword
arguments. These keyword arguments are supposed to be passed untouched
to the underlying `bind-keys' function, but there is a clause in
`use-package-normalize-pairs' that replaces lists with their first
element. Thus an invocation like:

(use-package company
  :bind (:map company-active-map
         :filter (company-explicit-action-p)
         ("RET" . company-complete-selection)))

Generates code like this:

(bind-keys
  :map company-active-map
  :filter company-explicit-action-p
  ("RET" . company-complete-selection))

Which generates an error since `company-explicit-action-p' is now
being referenced as a variable rather than a function.

The proper solution is to refactor the logic that goes into parsing
uses of :bind, but this commit adds a temporary patch to eliminate the
above problem, while trying to be as reverse-compatible as possible.
In particular it just inhibits the list-to-first-element
transformation when the previous element processed was a keyword.
2017-04-02 21:03:47 -07:00
John Wiegley
9f90129b95 Merge pull request from raxod502/fix-after
Fix :after keyword
GitHub-reference: https://github.com/jwiegley/use-package/issues/439
2017-03-27 14:49:43 -07:00
Radon Rosborough
bca84ee71a Add use-package-always-defer-install
See https://github.com/jwiegley/use-package/pull/433#issuecomment-289317875
2017-03-26 14:40:17 -07:00
Radon Rosborough
9ad6f2ef1a Fix :after keyword
Commit [1] broke the functionality of :after (see [2]) due to an
extraneous quote being added.

[1]: bd2afa53c7
[2]: https://github.com/jwiegley/use-package/pull/433#issuecomment-287606553
2017-03-19 08:33:30 -07:00