Shadowing is now control by layer property ':can-shadow' only.
can-shadow is a commutative relation, if layer1 can shadow layer2 then layer2
can shadow layer1.
the shadow operator is a binary operator accepting two layer names, it is not
commutative and the order of the operands is determined by the order of the
layers in the dotfile (like the ownership stealing mechanism).
If ':can-shadow' is set explicity to nil in the dotfile then the layer won't
shadow any layer.
For instance to install both ivy and helm layer:
(setq dotspacemacs-configuration-layers
'(
ivy
(helm :can-shadow nil)
)
note that due to the commutative relation the above example can also be
written (in this case, ':can-shadow' should be read ':can-be-shawdowed'):
(setq dotspacemacs-configuration-layers
'(
(ivy :can-shadow nil)
helm
)
Layers can now declare in their layers.el file that they shadow one or more
layers using the following functions:
- configuration-layer/shadow-layers
- configuration-layer/shadow-layer
Those function are commutative so:
(configuration-layer/shadow-layer 'layer1 'layer2)
is the same as
(configuration-layer/shadow-layer 'layer2 'layer1)
and means that
layer1 shadows layer2
and
layer2 shadows layer1
The typical use-case is helm and ivy layers. Helm shadows the ivy layer and
Ivy shadows the helm layer.
Shadowing is sensitive to the order of declaration of layers in the dotfile,
for instance:
(setq dotspacemacs-configuration-layers '(
helm
ivy
))
means that ivy shadows helm so helm layer is effectively ignored,
whereas
(setq dotspacemacs-configuration-layers '(
ivy
helm
))
means that helm shadows ivy so ivy layer is effectively ignored.
This mechanism can be turned off using the :can-shadow keyword:
(setq dotspacemacs-configuration-layers '(
ivy
(helm :can-shadow nil)
))
means that both ivy and helm layers will be installed (not recommended in this
case)
Note that the `:can-shadow` mechanism will be fully implemented in a next
commit.
- remove variable configuration-layer--used-distant-packages
- rename function configuration-layer//get-distant-packages to
configuration-layer//filter-distant-packages to better reflect what it does
- Add argument PREDICATE to configuration-layer//filter-distant-packages
- New cfgl-package methods: cfgl-package-used-p and cfgl-package-distant-p
- Add unit tests
This replaces the older pattern
:toggle (configuration-layer/package-usedp ..)
This implementation ensures that :disabled-for honors dependent packages, i.e.
if package a depends on package b, which is owned by layer c, and layer c is
disabled for layer d, then neither package a nor b will be configured for layer
d. Previously, this was only true for package a, but not b.
This commit also fixes:
- configuration-layer/describe-package now shows which post-init and pre-init
functions are disabled, if any
- Does not recreate all layer objects unconditionally when calling
configuration-layer/discover-layers. Previously, this led to all layers being
recreated after e.g. `SPC h SPC`, without any of the dotfile information.
Since this information is now necessary for
configuration-layer/describe-package, it’s important that we don’t clear the
indexed layers when invoking this function.
To avoid further issues with the publishing of
documentations I have written a test to ensure that
all documentation files can be exported to html.
To avoid issues with loading the right org version
after package installation I have also slightly
modified the test workflow to include a dedicated
package installation target done prior to executing
any tests.
Distribute spacemacs-theme with Spacemacs so we don't need to download the
package of the theme at startup. It was delaying the display of the home buffer.
Now Spacemacs fallback to spacemacs-dark theme if the user theme cannot be
applied. Spacemacs then tries to install and reapply the user theme. If
successful, at the subsequent startups the user theme is applied right away
instead of spacemacs-dark. If the installation failed then we display a warning
informing the user and suggesting some actions.
There is now no package left to be installed manually at the start of Spacemacs.
Thanks to the power provided by Lisp, hack package-install to patch on the
fly org and org dependencies installations in order to install org-plus-contrib
instead.
It is now possible to add local elpa repositories to private variable
configuration-layer--elpa-archives for instance:
(defvar configuration-layer--elpa-archives
'(("spacelpa" . "~/.emacs.d/.cache/spacelpa/"))
"List of ELPA archives required by Spacemacs.")
New functions:
- configuration-layer//package-archive-absolute-pathp
- configuration-layer//package-archive-local-pathp
Fix computation of package installation lazyness when the variable
dotspacemacs-enable-lazy-installation is set to all.
Improve methods on cfgl-layer class to be able to return a list of packages with
or without their properties.
Update tests to reflect the changes.
Awkward patch since the function configuration-layer/declare-layer is not
tested.
We should add tests for this function and then this patch would be more
acceptable.
More flexible framed text generation:
- adjust frame width to content width
- define minimum and maximum width
- allow for inserting a caption at the bottom of the frame
Unless dotspacemacs-startup-buffer-respinsive is nil:
- framed notes are centered
- max width is adapted to the window width
Also add a note inviting the user to update his packages and dotfile on
every new release (fixes#7357).
Fixes some edge cases like SPC f e R performed after SPC h SPC which
could wrongly install or uninstall packages.
Side effects is contained using the variable
configuration-layer--package-properties-read-onlyp, if non nil then
properties value of a package cannot be overwritten.
Calling multiple times configuration-layer/make-package appends the
same layers to :owners, :pre-layers and :post-layers slot.
Use object-add-to-list instead of push.
Add some tests and mock some warning messages.
Rename configuration-layers/make-packages to
configuration-layers/make-packages-from-layers
Move all package initialization logic to configuration-layers/make-package
instead of having it split between make-packages and make-package.
TL;DR Should get 20~25% speed improvement on startup, should get a big
improvement when using ivy or helm SPC h SPC. Users with layers.el files
in their layers must use `configuration-layer/declare-used-layer`
instead of `configuration-layer/declare-layer`
The implementation of the layer system made heavy use of `object-assoc`
and `object-assoc-list` functions which are not efficient. This PR
mainly replaces those object lists with hash maps in order to index the
objects by their name and achieve an O(1) access time.
The old object lists `configuration-layer--layers` and
`configuration-layer--packages` have been each by two variables each:
- `configuration-layer--indexed-layers` which is a hash-map of all the
layer objects and `configuration-layer--used-layers` which is a list of
all _used_ layers symbols,
- symmetrically `configuration-layer--indexed-packages` which is a
hash-map of all the package objects and
`configuration-layer--used-packages` which is a list of all _used_
packages symbols.
The hash map `configuration-layer--layer-paths` is gone, now we create
directly layer objects when discovering the layers and set the :dir
property. Note that previously the layer paths were the parent directory
of the layer, now :dir is the layer path.
The function `configuration-layer//make-layer` is now similar to its
counterpart `configuration-layer//make-package` in the sense that it
takes an optional `obj` to be able to override its properties.
The functions `configuration-layer/declare-layer` and
`configuration-layer/declare-layers` now takes an optional parameter
`usedp` in order to declare used or not used layers. For convenience
new functions have been added: `configuration-layer/declare-used-layer`
and `configuration-layer/declare-used-layers`, users _must_ update all
occurrences of `configuration-layer/declare-layer` by
`configuration-layer/declare-used-layers` in their `layers.el` files.
`helm-spacemacs-help` and `ivy-spacemacs-help` are updated to match the
changes in `core-configuration-layer.el`.
Rename some variables to make them more explicit:
`configuration-layer-no-layer` -> `configuration-layer-exclude-all-layers`
`configuration-layer-distribution` -> `configuration-layer-force-distribution`
Old implementation excluded package that were not selected, this
implementation does not excluded them, it simply ignore it in the
layer where they are not selected. This reimplementation comes from
a refactor of the way packages.el files are loaded, instead of loading
these files at the moment of resolving the list of used packages, they
are now loaded when making the layer objects. A neat consequence is that
side effects is better confined and the configuration-layer/get-packages
is now pure (at least a lot more pure than before).
In the `cfgl-layer` class the slot `:user-packages` has been renamed
to `:selected-packages` which defaults to `'all` meaning that all
the packages in `:packages` are selected. `:selected-packages` value
is given by the new function `configuration-layer//select-packages`.
Effectively selected packages are given by a new method for `cfgl-layer`
class called `cfgl-layer-get-packages`.
Tests have been updated to reflect the changes.
Also documentation on configuration layer declaration in the dotfile
section of DOCUMENTATION.org has been greatly improved (I hope) and
reflect the last feature added to the
`dotspacemacs-configuration-layers` list.
The car of :owners is the real owner.
Now we can easily gather the list of all owners of a package.
Also fix unit tests about missing spacemacs-insecure variable.
This new variable replace dotspacemacs-delete-orphan-packages
It defines the behaviour of Spacemacs when downloading packages.
Possible values are `used', `used-but-keep-unused' and `all'.
- `used' will download only explicitly used packages and remove any
unused packages as well as their dependencies.
- `used-but-keep-unused' will download only the used packages but won't
delete them if they become unused.
- `all' will download all the packages regardless if they are used or
not and packages won't be deleted by Spacemacs.
Default value is `used`.
The new layer file `layers.el` is used to declared additional layers.
It is like the sibling of packages.el except that for now it does not
take a list (can do this in a futur commit).
The new order for file loading is the following:
layers.el > packages.el > funcs.el > config.el > keybindings.el
Since packages.el relies on some undefined stuff encapsulated
in init functions, it is not meant to be byte compiled. OTOH funcs.el
(where lies most of the computation added by a package config) should
be compilable.
Since we load packages.el very early it is not possible to use
`configuration-layer/package-usedp` in funcs.el.
This commit also fixes the tests.
New package :step 'bootstrap', this step happens before 'pre' packages.
A new layer names 'spacemacs-bootstrap' gather all the ':step bootstrap'
packages. This layer is special and is always the first element of
the variable 'configuration-layer--layers' which assure that all
bootstrap packages are configured first.
This new layer leverages the configuration layer system, removes the
clutter of package installations in the function 'spacemacs/init' and
isolate the bootstrap packages in one place.
Make cfgl-layer-owned-packages return a list of package objects instead
of just package names.
Use this function to correctly excluded non owned package when flagging
package for lazy installation.
Fixes#5608