diff options
author | Noam Postavsky <npostavs@gmail.com> | 2016-05-26 15:09:46 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2016-10-31 08:49:21 -0400 |
commit | 65c7b42a14c5ad42d4b6c6e6547c793e0ccbfe80 (patch) | |
tree | 5861ba48c09682026cd5e0b6739652bb3bd61c87 | |
parent | fc57b342991b94640d5ff565a47b5603adec0a6f (diff) | |
download | emacs-65c7b42a14.tar.gz |
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")).
-rw-r--r-- | lisp/use-package/use-package.el | 2 | ||||
-rw-r--r-- | test/lisp/use-package/use-package-tests.el | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index aeb39b4c343..96137c3c78d 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -803,7 +803,7 @@ deferred until the prefix key sequence is pressed." (defun use-package-normalize-mode (name keyword args) (use-package-as-one (symbol-name keyword) args (apply-partially #'use-package-normalize-pairs - #'stringp #'symbolp + #'stringp (lambda (m) (and (not (null m)) (symbolp m))) name))) (defalias 'use-package-normalize/:interpreter 'use-package-normalize-mode) diff --git a/test/lisp/use-package/use-package-tests.el b/test/lisp/use-package/use-package-tests.el index aa9f542a803..d3deef995b1 100644 --- a/test/lisp/use-package/use-package-tests.el +++ b/test/lisp/use-package/use-package-tests.el @@ -44,6 +44,8 @@ '((".foo" . foopkg) (".bar" . foopkg)))) (should (equal (use-package-normalize-mode 'foopkg :mode '((".foo" ".bar"))) '((".foo" . foopkg) (".bar" . foopkg)))) + (should (equal (use-package-normalize-mode 'foopkg :mode '((".foo"))) + '((".foo" . foopkg)))) (should (equal (use-package-normalize-mode 'foopkg :mode '((".foo" . foo) (".bar" . bar))) '((".foo" . foo) (".bar" . bar))))) |