mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-05 11:49:37 +00:00
Allow :major as the third argument in :delight calls
This commit is contained in:
parent
4b8b850cf0
commit
7eec86f5cd
2 changed files with 13 additions and 6 deletions
|
@ -1466,9 +1466,16 @@ deferred until the prefix key sequence is pressed."
|
||||||
(symbolp (car args)))
|
(symbolp (car args)))
|
||||||
`((,(car args) nil ,name)))
|
`((,(car args) nil ,name)))
|
||||||
((and (= (length args) 1)
|
((and (= (length args) 1)
|
||||||
(or (not (listp (car args)))
|
(stringp (car args)))
|
||||||
(eq 'quote (caar args))))
|
|
||||||
`((,(use-package-as-mode name) ,(car args) ,name)))
|
`((,(use-package-as-mode name) ,(car args) ,name)))
|
||||||
|
((and (= (length args) 1)
|
||||||
|
(listp (car args))
|
||||||
|
(eq 'quote (caar args)))
|
||||||
|
`((,(use-package-as-mode name) ,@(cdar args) ,name)))
|
||||||
|
((and (= (length args) 2)
|
||||||
|
(listp (nth 1 args))
|
||||||
|
(eq 'quote (car (nth 1 args))))
|
||||||
|
`((,(car args) ,@(cdr (nth 1 args)) ,name)))
|
||||||
(t (mapcar
|
(t (mapcar
|
||||||
(apply-partially #'use-package--normalize-delight-1 name)
|
(apply-partially #'use-package--normalize-delight-1 name)
|
||||||
(if (symbolp (car args)) (list args) args)))))
|
(if (symbolp (car args)) (list args) args)))))
|
||||||
|
@ -1477,9 +1484,7 @@ deferred until the prefix key sequence is pressed."
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(let ((body (use-package-process-keywords name rest state)))
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
body
|
body
|
||||||
(mapcar (lambda (arg)
|
`((delight '(,@args))))))
|
||||||
`(delight ',(nth 0 arg) ,(nth 1 arg) ',(nth 2 arg)))
|
|
||||||
args))))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -58,9 +58,11 @@
|
||||||
(use-package-normalize/:delight 'foo-mode :delight nil)))
|
(use-package-normalize/:delight 'foo-mode :delight nil)))
|
||||||
(should (equal `((bar-mode nil foo))
|
(should (equal `((bar-mode nil foo))
|
||||||
(use-package-normalize/:delight 'foo :delight '(bar-mode))))
|
(use-package-normalize/:delight 'foo :delight '(bar-mode))))
|
||||||
|
(should (equal `((bar-mode nil :major))
|
||||||
|
(use-package-normalize/:delight 'foo :delight '((bar-mode nil :major)))))
|
||||||
(should (equal `((foo-mode "abc" foo))
|
(should (equal `((foo-mode "abc" foo))
|
||||||
(use-package-normalize/:delight 'foo :delight '("abc"))))
|
(use-package-normalize/:delight 'foo :delight '("abc"))))
|
||||||
(should (equal `((foo-mode '(:eval 1) foo))
|
(should (equal `((foo-mode (:eval 1) foo))
|
||||||
(use-package-normalize/:delight 'foo :delight '('(:eval 1)))))
|
(use-package-normalize/:delight 'foo :delight '('(:eval 1)))))
|
||||||
(should (equal `((a-mode nil foo)
|
(should (equal `((a-mode nil foo)
|
||||||
(b-mode " b" foo))
|
(b-mode " b" foo))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue