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")).
(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)
'((".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)))))