Commit graph

111 commits

Author SHA1 Message Date
John Wiegley
d8c1f02bf4 Whitespace fix 2017-11-29 16:44:11 -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
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
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
Noam Postavsky
5ed9a6b5a5 Remove obsolete mplist tests
The mplist functions were removed in the 2.0
refactoring (4ae584f3ff).
2016-10-31 08:49:21 -04:00
John Wiegley
23a61c8f6b Add some variable settings to use-package-tests.el, thanks tarsius 2016-02-25 15:22:10 -08:00
Nicolas Richard
dd937c4e36 Move tests to separate file 2014-02-12 22:30:12 +01:00