A recent change in the `.spacemacs.template` made it so that the
`dotspacemacs-configuration-layers` variable name can be found inside a
comment right before the expression that sets it's value. This makes the
lazy insertion fail to detect the proper place to add lazy loaded
layers.
This fix solves the immediate problem but maybe a better solution can
be found.
This is an attempt to tighten up the language of the docstrings for
initialization and configuration functions. I realize that's pretty
subjective, so please only use what makes sense. Below is a break-
down to avoid seeming _too_ arbitrary.
Rationale
---------
Headings: We know they're functions, so we don't need to say
'X function'. 'Layer configuration' is called that in the other
functions.
Instructions: Say what I should do.
Other: `dotspacemacs/init' -- 'very beginning' is the more common
English idiom.
If I sound strident, it's just 'cause I'm trying to be terse.
This is all opinion so YMMV. I hope it helps.
If dotspacemacs-auto-generate-layout-names is non-nil, and the user
tries to open a layout in a position that doesn't yet have a layout,
then create a new layout with an automatically generated name.
This allows the user to, for instance, include the spacemacs tree as a
git submodule of their configuration repository without seeing
superfluous warnings.
Add two new functions: `spacemacs/transient-state-register-add-bindings`
and `spacemacs/transient-state-register-remove-bindings` to prevent layer
authors and end users from dealing with the underlying variables' subtleties.
At the moment a Quelpa recipe like `(recipe :fetcher local)` is being translated
to something like
`(recipe :fetcher file :path "my-layer/local/my-pkg/my-pkg.el")`. So we can
build simple single-file local packages.
This commit changes it to translate to the package directory instead of exact lisp
file, so we can build multi-file local packages. Thus, the above example will be
translated to `(recipe :fetcher file :path "my-layer/local/my-pkg")`.
Also, add the relevant info to LAYERS.org.
Some of the layers do not supply a README.org file which caused
invalid links in the layer list. To avoid this I have changed
spacemacs//generate-layers-from-path to only add links to layers
with a valid README.org file.
I have also removed an invalid check to exclude the non existing directory
"distribution" from the layers list. I think that originally the folder
"distributions" should have been excluded but this is not longer
a feasible action as there is at least one layer with a valid README.org
file in there today. So now we add links to all layers providing a
README.org file independent of their category.
In 2015 a file CONTRIBUTE.org was existing in the /doc folder.
In addition a CONTRIBUTING.md file was existing in the project root folder.
This was merged into a CONTRIBUTING.org file, which is still located in the project root.
However the documentation publishing system was still looking only in the doc folder.
In addition the external documentation is still referring to the old CONTRIBUTE.html which is not longer existing.
I have now included a new function called prior to publishing
which is copying the documents from the projects root into the doc folder.
As a side effect it renames the CONTRIBUTING.org to the old CONTRIBUTE.org
to support the external documentation.
Specifying parent modes (e.g. prog-mode) in :enabled-for-modes and
:disabled-for-modes keys in dotspacemacs-line-numbers catches derived
modes (e.g. c-mode) as well.
Fix bug where an empty :disabled-for-modes and a non-empty :enabled-for-modes
enabled line numbers everywhere, instead of only in modes specified in
:enabled-for-modes. (see https://github.com/syl20bnr/spacemacs/issues/8482)
Add auxiliary function spacemacs/derived-mode-p, similar to derived-mode-p but
takes a major-mode as an argument instead of using the current major-mode.
In this case Spacemacs won't write custom variables to the
dotspacemacs/emacs-custom-settings variable.
Move setq and add-advice to spacemacs/initialize-custom-file which is now
called in spacemacs/init function just after dotspacemacs/user-init function.
New functions:
- configuration-layer/get-location-directory which return the location on disk
given a location
- spacemacs//get-theme-directory which returns the location on disk of the
theme
Add note in documentation to warn about the directory name when :location local
is used, the directory name is the package name not the theme name.
Also remove the docstring about SPC h SPC as it is already implied for the other
options in the dotfile.
Note that this commit modifies one condition, namely disabled mode condition.
It removes the first test:
(not (spacemacs/mplist-get dotspacemacs-line-numbers :enabled-for-modes))
as it is not necessary since we have a `or` in the enable-p condition. Disabled
modes will be checked only if the current major mode is not explicitly enabled
(as intented).
It is now possible to use package properties like :location in
dotspacemacs-themes.
Added hooks ran at the beginning and end of configuration-layer/sync:
- configuration-layer-pre-sync-hook
- configuration-layer-post-sync-hook
configuration-layer-pre-sync-hook is used to hook the new function
spacemacs//add-theme-packages-to-additional-packages. This new function updates
dotspacemacs--additional-theme-packages variables.
Update documentation to mention the new feature.
Add all theme packages defined in dotspacemacs-themes to the variable
dotspacemacs-additional-packages and delay the application of user theme at the
end of startup (only when user theme cannot be applied at the very beginning
of Emacs startup).
This has nice properties:
- we leverage the layer system to handle the theme packages installation and
cleanup.
- theme packages are automatically owned by the dotfile preventing them from
being garbage collected.
- the protected package mechanism is now obsolete since themes were the last
packages using it. This mechanism may be removed in a near future.
Thanks to TheBB for the initial idea.
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.
Since Emacs 25.1 I got screen flickering when packages are installed on
startup.
Shuffling the UI elements removal seems to fix it on my system using X.
It may have the opposite effect on other users setup.
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.
Discard the warnings produced when packages are byte-compiled which fix the
popup of the *Compile-Log* window at the end of the installation.
If emacs has been launch with argument `--debug-init` we don't discard the
warnings.
Function configuration-layer/load-or-install-package now correctly add the
installed packages to indexed-package hash map.
Those packages are put under the special layer `system`.
This is the first stone toward Spacemacs own ELPA repository.
New function configuration-layer/create-spacelpa-repository which creates the
archive-contents file for the Spacelpa repository containing all the ELPA
packages supported by Spacemacs (and only them).
The layer files were loaded twice because the global variable controlling
the loading of layer files was not explicity set at the layer discovery phase.
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.
spacemacs/alternate-window was suggested to switch between the last selected
window, or the window-analog of SPC TAB (spacemacs/alternate-buffer). This is
part of a larger family of functions, such as spacemacs/jump-to-last-layout on
SPC l TAB and eyebrowse-last-window-config on SPC l w TAB.
Resolves#7845
Some directories were added twice.
Make it more explicit in the code which directories we look into and filter out
directories that don't exist. Emit a warning if an unknown directory is
provided.
Given the loading process of Spacemacs we have no choice but to set the
custom settings twice:
- once at the very beginning of startup
- once at the very end of loading
The first application of custom settings is to be sure that Emacs knows all the
defined settings before saving them to a file (otherwise we loose all the
settings that Emacs does not know of).
The second application is to override any settings set in dotfile functions
like `dotspacemacs/user-config`, users expect the custom settings to be the
effective ones.
This double loading issue is independent from the managment method used for
custom settings. Even with a separate custom-settings file explicitly loaded in
the dotfile we would have been forced to load this file twice to acheive the
expected result described here.
Note: Loading custom-settings twice is not ideal since they can have side
effects! Maybe an inhibit variable in Emacs can supress these side effects?
New function `dotspacmacs/emacs-custom-settings` wrapping Emacs
custom settings sexps.
`dotspacemacs/emacs-custom-settings` is called just after the user
configuration (`dotspacemacs/user-config`)
Customize cannot write its auto-generated sexps inside a function, to
accomplish this we trick Emacs by setting the custom file to a file
in `.cache` directory, the path to this file is defined by the variable
`spacemacs--custom-file`. At the startup of Emacs we read this file
to insert its content inside the function
`dotspacemacs/emacs-custom-settings` in the dotfile, this is done in the
function `spacemacs/write-custom-settings-to-dotfile`.
I don't think we need to write the custom settings to the dotfile when
exiting Emacs as well, since we do it at startup at the very beginning
(i.e. before actually loading the dotfile) we should be OK.
Fixes#5170
When upgrading packages, Spacemacs backs up the old versions of the
packages and then tells the user to restart Emacs using `SPC q r` so
that the new version will be auto-installed. But `SPC q r` doesn't
work if restart-emacs is one of the packages which is being upgraded,
and hence isn't currently installed.
enumeration lists of the form:
- lorem ipsum
* lorem ipsum
+ lorem ipsum
1. lorem ipsum
2) lorem ipsum
will be treated as separate paragraphes and not be squished by
fill-region anymore.
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).
With a nil value for dotspacemacs-switch-to-buffer-prefers-purpose,
switch-to-buffer prefers using the current window, same as vanilla
Emacs. With a non-nil value, switch-to-buffer prefers another window
with the same purpose as the buffer. This affects actions like
spacemacs/alternate-buffer, and opening buffers from Dired.
Cleaned up a warning that occurs when loading private layers
The layer discovery loop scans the private layer directory (
~/.spacemacs.d/layers) AND also ~/.spacemacs.d
The code then checks if a layer directory already exists
but the comparison fails due to trailing / in some paths.
The fix is to strip any trailing slash from both directories being
compared.
- Apply `/` and `//` rules (double / is for private functions)
- Add missing `spacemacs/` prefixes
- Move functions used outside of spacemacs-base layer to
core/core-funcs.el
- Remove unused functions
Commit originally intented to only rename linum-update-window-scale-fix
to spacemacs/linum-update-window-scale-fix :-)