mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-31 04:41:23 -08:00
Merge pull request from joewreschnig/implicit-diminish
Allow `:diminish` with no arguments. GitHub-reference: https://github.com/jwiegley/use-package/issues/472
This commit is contained in:
commit
903ff82219
2 changed files with 15 additions and 1 deletions
|
|
@ -1482,10 +1482,12 @@ deferred until the prefix key sequence is pressed."
|
|||
SYMBOL
|
||||
(SYMBOL . STRING)"
|
||||
(cond
|
||||
((not arg)
|
||||
(list (use-package-as-mode name)))
|
||||
((symbolp arg)
|
||||
(list arg))
|
||||
((stringp arg)
|
||||
(list (cons (intern (concat (use-package-as-string name) "-mode")) arg)))
|
||||
(list (cons (use-package-as-mode name) arg)))
|
||||
((and (consp arg) (stringp (cdr arg)))
|
||||
(list arg))
|
||||
((and (not recursed) (listp arg) (listp (cdr arg)))
|
||||
|
|
|
|||
|
|
@ -72,6 +72,18 @@
|
|||
|
||||
)
|
||||
|
||||
(ert-deftest use-package-normalize-diminish ()
|
||||
(should (equal (use-package-normalize-diminish 'foopkg :diminish nil)
|
||||
'(foopkg-mode)))
|
||||
(should (equal (use-package-normalize-diminish 'foopkg :diminish 'bar)
|
||||
'(bar)))
|
||||
(should (equal (use-package-normalize-diminish 'foopkg :diminish "bar")
|
||||
'((foopkg-mode . "bar"))))
|
||||
(should (equal (use-package-normalize-diminish 'foopkg :diminish 'foo-mode)
|
||||
'(foo-mode)))
|
||||
(should (equal (use-package-normalize-diminish 'foopkg :diminish '(foo . "bar"))
|
||||
'((foo . "bar")))))
|
||||
|
||||
;; Local Variables:
|
||||
;; indent-tabs-mode: nil
|
||||
;; no-byte-compile: t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue