* [core][keybinng] improve minor mode binding
This commit added add a new function defun spacemacs/declare-prefix-for-minor-mode
and improved spacemacs/set-leader-keys-for-minor-mode.
`which-key` package recently introduced a new api
which-key-add-keymap-based-replacements which improves perfomance and allows
prefix and namings to be stored directly in keymap. This is a great improvement.
With this new api we now make change to spacemacs/declare-prefix-for-minor-mode
to manage prefix also. For example:
(spacemacs/set-leader-keys-for-minor-mode 'lsp-mode
"=" "format"
"=b" #'lsp-format-buffer)
Before we had to use another api to bind prefix
spacemacs/declare-prefix-for-mode which only works on major-mode. As lsp-mode is
a minor mode this api causes a lot of problems to which-key performance. An
example is https://github.com/syl20bnr/spacemacs/issues/12455 which led to my
hack in https://github.com/syl20bnr/spacemacs/pull/12474.
The improved spacemacs/set-leader-keys-for-minor-mode will take care of both
prefix and key naming for the minor mode. This will allows us to have a better
set up for dynamic minor modes such as lsp-mode, tide-mode etc.
Also another api is created to make prefix for minor mode:
spacemacs/declare-prefix-for-minor-mode.
Usage:
(spacemacs/declare-prefix-for-minor-mode 'tide-mode "E" "errors")"
* [tide] improve prefix
* [lsp] improve prefix
Many new users (quite logically) assume that the additional-packages list
behaves like installing a layer, so they assume the file is also loaded
automatically. This commit adds info about the requirement to also load the
package with load/require/use-package in the user-config section of the dotfile.
Added "configuration-layer//system-package?" based on package-delete
(pretty much a direct partial copy-paste) so that
"configuration-layer//package-delete" can check if package is a
system package
No crash on spacemacs boot (with unused system-package present).
Though right now "configuration-layer//package-delete" only ignores system
packages instead of reporting them. Not entierly what @nbraud proposed,
but insufficient err-logging is a significantly smaller issue.
Fixes#11160
The new variable was not following the naming conventions.
The file was not initialised in core-dotspacemacs.el.
The file was not part of the .spacemacs.template.
Spacemacs allows to define layers declaratively like so:
dotspacemacs-configuration-layers
`(,(when (eq system-type 'darwin) 'osx))
The problem - in Linux that would add a nil element into the list, which then
makes it unable to run dotspacemacs/sync-configuration-layers <SPC f e R>, the
tests won't pass.
time-date.el requires cl-lib under Emacs 27 and above. Then the around advice
spacemacs//timed-require and spacemacs//load-timer of require will cause
recursive load under emacs 27 and above. The load sequences is: requiring cl-lib
uses autoload function time-since which loads time-date.el and then time-date.el
requires cl-lib.
The solution to break this recursive load sequence is to load time-date.el
before adding the around advice spacemacs//timed-require and
spacemacs//load-timer to require.
The original idea was to have a warning when
use-package-inject-hooks is set to nil however
having a warning in that macro caused too much
negative side effects and also does not cover
all cases.
Therefore it is to be removed.
In my first commit I did not add the warning message properly.
Basically the macro should emit code to create a warning if
the generated code is run and the predicate is not fulfilled.
However in my last commit it did run the code during macro
expansion which would do the testing there which is not
what I wanted.
spacemacs|use-package-add-hook is generating code which
is dependent on use-package-inject-hooks being non-nil.
If this happens now a big warning is written to the log
informing users of a potential issue or problem caused
by their user-config.
In a terminal, when a modes mode line name is diminished,
to two characters, and the first one is a unicode character,
then the second character overlaps the right side of the first character.
Add doom-gruvbox-light theme to prevent Spacemacs from trying to download a
package with the same name from elpa (and failing because there is no such
package).
doom-gruvbox-theme can now be included in dotspacemacs-themes configuration
without generating an error or trying to download a non-existent package.
To optimise performance of lsp mode in emacs 27 and above
I have introduced a new dotfile variable to define the size
of data read from external processes. The default I have
set to the recommended setting from lsp-mode.
In addition I have introduced a new layer variable for
auto-complete-layer to define the minimum prefix length.
I have also added instructions to auto-complete's readme
how to set these variables to the recommended settings
for lsp-mode.
Changes inspired from #13507
Themes can now contain keywords in addition to just the theme name like
dotspacemacs-themes '((name :location (recipe :fetcher github
:repo "user/repo"))
solarized-light
solarized-dark)
However, for theme cycling, we first try to detect whether the current
theme (spacemacs--cur-theme) is in the list of cycleable themes and go on from
there. Since spacemacs--cur-theme is just a name, this fails when
spacemacs--cur-theme is the name of a theme that's specified with additional
keywords in dotspacemacs-themes.
To fix this, check if spacemacs--cur-theme is in the list of theme names.
This is a squash commit including below commits
Add dotspacemacs--pretty-ignore-subdirs
Within the specified subdirs of `dotspacemacs-start-dir`,
spacemacs/prettify-org-buffer (and hence space-doc-mode) will not be called.
Without this variable, using spacemacs/open-junk-file to create an Org file will
result in prettification, which is not necessarily the desired behavior.
Call make-directory in spacemacs/open-junk-file
This imitates the behavior of open-junk-file.
Prevent spacemacs/open-junk-file from getting confused by Dired
If we're in a dired buffer, counsel-find-file will ignore
current-directory (i.e. junk-dir) and use (dired-current-directory) instead. We
fool Counsel by shadowing major-mode to nil.
Update CHANGELOG.develop re spacemacs/open-junk-file
Theme transient state key-binding `t` is broken if `ivy` completion framework is
used. The binding unconditionally invokes `helm-themes`.
This change adds a new function which takes care of invoking correct
theme-loader function based on completion framework currently in use.
The old binding used `helm-themes` but the new function uses already defined
`spacemacs/helm-themes` which removes the number of candidates limit.