This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.
The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
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.
The purpose of this PR is to set the default for ⌘ to `hyper' and to provide the
function `kbd-mac-command` to replace `kbd' when defining keybindings for ⌘ in
case someone decides to explicitly set osx-command-as to `super' or `alt'.
There are problems setting osx-command-as to `alt' and `super',
so we use `hyper' as a default instead because, for example:
- Using `alt': Command-x or Command-m inserts, respectively: × µ
- Using `super': Control-Command-f produces keycode: <C-s-268632078>
Setting to `hyper' seems to avoid both types of the above problems.
Also, while it is possible, it is not recommended to set to `meta'
since standard OSX shortcuts would overshadow important keys such
as M-x.
Two other small changes include:
- Commenting out the code that defines <C-s-268632078> (C-s-f) since it is
unnecessary if we use `hyper' as the default; and if we really want to use
`super' then we should figure out how to solve the weird keycode issue.
- add keybinding for ⌘` (Command-backtick) to `other-window'.
Emacs usually swallows this keystroke, so other-window basically restores
the default behavior that most Mac OSX users would expect.
Enabling a company backend for a specific mode was a tedious tasks with code
scattered at different locations, one for local variable definitions, one for
company hook function definitions and another where the backends were pushed to
the local variables (which was problematic, since we ended up pushing the same
backends over and over again with `SPC f e R`, pushes have been replaced by
add-to-list calls in the new macro).
All these steps are now put together at one place with the new macro
spacemacs|add-company-backends, check its docstring for more info on its
arguments.
This macro also allows to define arbitrary buffer local variables to tune
company for specific modes (similar to layer variables via a keyword :variables)
The code related to company backends management has been moved to the
auto-completion layer in the funcs.el file. A nice side effect of this move is
that it enforces correct encapsulation of company backends related code. We can
now easily detect if there is some configuration leakage when the
auto-completion layer is not used. But we loose macro expansion at file loading
time (not sue it is a big concern though).
The function spacemacs|enable-auto-complete was never used so it has been
deleted which led to the deletion of the now empty file core-auto-completion.el.
The example in LAYERS.org regarding auto-completion is now out of date and has
been deleted. An example to setup auto-completion is provided in the README.org
file of the auto-completion layer.