Ensime seems to be finally dead, as ensime-mode is not longer
available on melpa. The same applies to ob-scala the package
which delivered scala support for org babel.
I have changed the layers default to metals and took care that
ensime is not tried to be installed until it is really selected
as a package.
In addition I have also fixed some smaller issues in the layer
which caused ensime specific settings to be forced even when
metals was selected as a backend.
I have also removed the not longer existing org-babel support
for scala as it requires ob-scala which in turn is based on ensime.
See https://github.com/hvesalai/emacs-scala-mode/issues/155 for details.
There was a edge case with the declaration of the `lsp` layer in `layers.el`
files.
The `hy` layer depends on the `python` layer which in turn depends on the `lsp`
layer if and only if the `python-backend` layer variable is set to `lsp`.
When the `hy` layer was declared first then it declares the `python` layer
without its layer variables, thus the `lsp` layer was not declared because the
`python-backend` variable was not set.
The fix is to gather all the layer dependencies and resolve them only after all
the used layers have been declared.
* new function `configuration-layer/declare-layer-dependencies`
* replace all calls to `configuration-layer/declare-layer` by the new function
except for distribution layers (we declare layer dependencies right away in
distribution layers)