mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 14:30:50 -08:00
Create new "use-package" themse and use it for :custom with custom-theme-set-variables
This commit is contained in:
parent
5ceb51ae19
commit
a3c310c11a
2 changed files with 17 additions and 14 deletions
|
|
@ -43,6 +43,11 @@
|
||||||
(require 'cl-lib)
|
(require 'cl-lib)
|
||||||
(require 'tabulated-list)
|
(require 'tabulated-list)
|
||||||
|
|
||||||
|
;; Declare a synthetic theme for :custom variables.
|
||||||
|
;; Necessary in order to avoid having those variables saved by custom.el.
|
||||||
|
(deftheme use-package)
|
||||||
|
(enable-theme 'use-package)
|
||||||
|
|
||||||
(if (and (eq emacs-major-version 24) (eq emacs-minor-version 3))
|
(if (and (eq emacs-major-version 24) (eq emacs-minor-version 3))
|
||||||
(defsubst hash-table-keys (hash-table)
|
(defsubst hash-table-keys (hash-table)
|
||||||
"Return a list of keys in HASH-TABLE."
|
"Return a list of keys in HASH-TABLE."
|
||||||
|
|
@ -1394,8 +1399,9 @@ no keyword implies `:all'."
|
||||||
(comment (nth 2 def)))
|
(comment (nth 2 def)))
|
||||||
(unless (and comment (stringp comment))
|
(unless (and comment (stringp comment))
|
||||||
(setq comment (format "Customized with use-package %s" name)))
|
(setq comment (format "Customized with use-package %s" name)))
|
||||||
`(customize-set-variable (quote ,variable) ,value ,comment)
|
`(let ((custom--inhibit-theme-enable nil))
|
||||||
`(put ',variable 'theme-value '((use-package-synthetic-theme ignore-just-for-saving)))))
|
(custom-theme-set-variables 'use-package
|
||||||
|
'(,variable ,value nil () ,comment)))))
|
||||||
args)
|
args)
|
||||||
(use-package-process-keywords name rest state)))
|
(use-package-process-keywords name rest state)))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1129,28 +1129,25 @@
|
||||||
;; '((foo bar baz))))
|
;; '((foo bar baz))))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
(ert-deftest use-package-test/:custom-1 ()
|
(ert-deftest use-package-test/:custom-1 ()
|
||||||
(match-expansion
|
(match-expansion
|
||||||
(use-package foo :custom (foo bar))
|
(use-package foo :custom (foo bar))
|
||||||
`(progn
|
`(progn
|
||||||
(funcall
|
(let
|
||||||
(or
|
((custom--inhibit-theme-enable nil))
|
||||||
(get 'foo 'custom-set)
|
(custom-theme-set-variables 'use-package
|
||||||
(function set-default))
|
'(foo bar nil nil "Customized with use-package foo")))
|
||||||
'foo bar)
|
|
||||||
(set 'foo 'saved-variable-comment "Customized with use-package foo")
|
|
||||||
(require 'foo nil nil))))
|
(require 'foo nil nil))))
|
||||||
|
|
||||||
(ert-deftest use-package-test/:custom-with-comment1 ()
|
(ert-deftest use-package-test/:custom-with-comment1 ()
|
||||||
(match-expansion
|
(match-expansion
|
||||||
(use-package foo :custom (foo bar "commented"))
|
(use-package foo :custom (foo bar "commented"))
|
||||||
`(progn
|
`(progn
|
||||||
(funcall
|
(let
|
||||||
(or
|
((custom--inhibit-theme-enable nil))
|
||||||
(get 'foo 'custom-set)
|
(custom-theme-set-variables 'use-package
|
||||||
(function set-default))
|
'(foo bar nil nil "commented")))
|
||||||
'foo bar)
|
|
||||||
(set 'foo 'saved-variable-comment "commented")
|
|
||||||
(require 'foo nil nil))))
|
(require 'foo nil nil))))
|
||||||
|
|
||||||
(ert-deftest use-package-test/:custom-face-1 ()
|
(ert-deftest use-package-test/:custom-face-1 ()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue