Deflayer.el lets you define layers of configuration overrides.
Imagine you have some package that makes you configure where some data is.
Well, what if you wanted to use that package with two or more different sets of data.
This package will let you define the different configuration for each and switch between them easily.
Let’s use Org-brain as an example.
Org-brain requires you to specify where the org-mode files making up your brain
are located with the org-brain-path
setting defined in the org-brain
defcustom
group.
Let’s specify the location of two!
Simply (require 'deflayer)
and use the (deflayer)
macro for each:
(deflayer brain-one org-brain
((org-brain-path "~/org/brain-one/")
(whatever-other-settings "value one")))
(deflayer brain-two org-brain
((org-brain-path "~/org/brain-two/")
(whatever-other-settings "value two")))
We call (deflayer NAME GROUP BODY)
twice. Once with settings for our first
dataset, and once with settings for the second dataset.
This will save the values of all variables in the org-brain
defcustom group to
a defaults cache.
It will also produce two functions, deflayer-activate-brain-one
, and
deflayer-activate-brain-two
. Calling these functions will apply their
respective configuration values specified in BODY
.
At anytime call (deflayer-restore GROUP)
with any defcustom group to reset
all configuration values to their defaults.
(el-get-bundle deflayer
:url "https://github.com/dustinlacewell/deflayer.el.git"
:features deflayer)
(use-package deflayer
:straight (deflayer :type git :host github :repo "dustinlacewell/deflayer.el")
There are no configuration options yet!