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 :-)
Currently j/k were only navigating between lines, but hitting RET
wouldn't work on a recent file and the like, when the cursor wasn't
directly over the filename. Changing j/k to widget navigation, ensures
that the cursor is always on something clickable. This change should
make the home buffer feel more at home for evil mode users.
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.
Hook semantic is to be used with run-hooks API and run all hooks
sequentially, jump list semantic is different since the running
functions are not guaranteed to be executed so we prefer using regular
list API to manage jump-lists.
Previous change in 5d6e9ab789 dropped the
"/" marker to match at beginning of string. Since directory-files
matches a regex, use "\\`" to indicate match at beginning of string.
This commit defines:
- spacemacs-default-jump-handlers: a list of functions that can jump to
definition in ALL modes.
- spacemacs-jump-handlers-MODE: a list of functions that can jump to
definition in MODE.
- spacemacs-jump-handlers: a buffer-local list of functions that can
jump to definition. This is made up of the values of the two previous
variables whenever a given major mode is activated.
- spacemacs/jump-to-definition: a function that tries each function in
spacemacs-jump-handlers in order, and stops when one of them takes us
somewhere new.
- spacemacs|define-jump-handlers: a macro that
* defines spacemacs-jump-handlers-MODE, possibly filled with initial
functions
* defines a function that is added to the hook of the given MODE
* binds “SPC m g g” of that MODE to spacemacs/jump-to-definition
This is an attempt to harmonize all the different approaches to jumping.
Specifically,
- Existing intelligent jump packages that work for only a single mode
should go to the beginning of spacemacs-jump-handlers-MODE. E.g.
anaconda for python, ensime for scala, etc.
- Packages like gtags that work for several modes (but potentially not
all) and which is dumber than the intelligent jumpers should go the
the END of spacemacs-jump-handlers-MODE.
- Packages like dumb-jump that work for all modes should go to
spacemacs-default-jump-handlers.
In all cases the order of the jump handlers in each list should be from
most to least intelligent.
Fixes#6619
Rename dotspacemacs-download-packages to dotspacemacs-install-packages
to better reflect the changes in the previous commit.
Also change the value 'used to 'used-only (note that 'used is still
supported for backward compatibility).
See end of this message for important breaking changes.
Previous behavior was to configure any installed package which caused
a lot of bad side effects and could make spacemacs unusable. This
behavior made little sense and does not fit with spacemacs.
This commit fixes this behavior by separating installed packages from
configured packages. In short dostspacemacs-download-packages variable
now only affect package installation. Packages are now configured if and
only if they are effectively *used* (i.e. listed in variable
dotspacemacs-configuration-layers or dotspacemacs-additional-packages).
IMPORTANT CHANGE: functions `configuration-layer/declare-used-layer` and
`configuration-layer/declare-used-layers` have been removed. These
functions have been introduced in develop branch only so the impact
should be minimal.
Saving a pkg-match regex to a temporary variable lets us avoid recomputing it on each
iteration. I didn't benchmark the performance impact, but unless there's a downside to
using `let*` vs `let`, it seems like a no-brainer.
Passing pkg-match to `directory-files` reduces the returned files to those that match the
regex rolling our own reduction.
For emacs 24.5 packages will be installed in .emacs.d/elpa/24.5, for
emacs 24.4 packages will be installed in .emacs.d/elpa/24.4, etc.
For a user that uses several emacs versions with the same config, the
packages for version X will be in .emacs.d/elpa/X and the packages for
version Y will be in .emacs.d/elpa/Y. This is instead of using the same
.emacs.d/elpa and possibly having copmiled elisp packages the are
incompatible with one of the emacs versions in use.
Rollback directories are also separated by version:
.cache/.rollback/24.5, .cache/.rollback/24.4, etc.
Don't fallback to default init file when SPACMACSDIR is used and
$SPACEMACSDIR/init.el doesn't exist. The file will be created during
the startup process.
Misspellings:
"beginnign" changed to "beginning",
"Insert one of several lines" changed to "Insert one or several lines" in two functions,
"identation" changed to "indentation",
Missing comment copied from the function that inserts a line
in the opposite direction:
(defun spacemacs/insert-line-below-no-indent (count)
"Insert a new line below with no indentation."
and renamed the direction, resulting in:
"Insert a new line above with no indentation."
Duplicate comments removed, the comments inside the functions,
are better explanations of what the function does.
Functions reordered:
The functions:
(defun spacemacs/evil-insert-line-below (count)
and
(defun spacemacs/evil-insert-line-above (count)
were written in a illogical order,
the "above" function should be written before the "below" function,
with this change, the function order will match other functions
with "above" and "below" in their names,
for example these:
(defun spacemacs/insert-line-above-no-indent (count)
https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Bdistributions/spacemacs-base/funcs.el#L535
(defun spacemacs/insert-line-below-no-indent (count)
https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Bdistributions/spacemacs-base/funcs.el#L549
evil-commands.el
line 2205: (defun evil-open-above (count)
line 2219: (defun evil-open-below (count)
line 2310: (defun evil-copy-from-above (arg)
line 2326: (defun evil-copy-from-below (arg)
evil-common.el
line 1892: (defun evil-insert-newline-above ()
line 1901: (defun evil-insert-newline-below ()
Can force a check with the universal prefix argument, for instance:
SPC u SPC SPC spacemacs/check-for-new-version
will always check for a new version even if not on master branch.
Once per 24 hours by default.
Caveat: if a new version is detected on the current instance of Emacs
and Emacs is restarted before the end of the 24 hours window then
the new version lighter in the modeline disappear; i.e. we don't
remember the last check results.
Fixes#6692