mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-04 19:29:37 +00:00
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")).
This commit is contained in:
parent
fc57b34299
commit
65c7b42a14
2 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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)))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue