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
TL;DR Should get 20~25% speed improvement on startup, should get a big
improvement when using ivy or helm SPC h SPC. Users with layers.el files
in their layers must use `configuration-layer/declare-used-layer`
instead of `configuration-layer/declare-layer`
The implementation of the layer system made heavy use of `object-assoc`
and `object-assoc-list` functions which are not efficient. This PR
mainly replaces those object lists with hash maps in order to index the
objects by their name and achieve an O(1) access time.
The old object lists `configuration-layer--layers` and
`configuration-layer--packages` have been each by two variables each:
- `configuration-layer--indexed-layers` which is a hash-map of all the
layer objects and `configuration-layer--used-layers` which is a list of
all _used_ layers symbols,
- symmetrically `configuration-layer--indexed-packages` which is a
hash-map of all the package objects and
`configuration-layer--used-packages` which is a list of all _used_
packages symbols.
The hash map `configuration-layer--layer-paths` is gone, now we create
directly layer objects when discovering the layers and set the :dir
property. Note that previously the layer paths were the parent directory
of the layer, now :dir is the layer path.
The function `configuration-layer//make-layer` is now similar to its
counterpart `configuration-layer//make-package` in the sense that it
takes an optional `obj` to be able to override its properties.
The functions `configuration-layer/declare-layer` and
`configuration-layer/declare-layers` now takes an optional parameter
`usedp` in order to declare used or not used layers. For convenience
new functions have been added: `configuration-layer/declare-used-layer`
and `configuration-layer/declare-used-layers`, users _must_ update all
occurrences of `configuration-layer/declare-layer` by
`configuration-layer/declare-used-layers` in their `layers.el` files.
`helm-spacemacs-help` and `ivy-spacemacs-help` are updated to match the
changes in `core-configuration-layer.el`.
Rename some variables to make them more explicit:
`configuration-layer-no-layer` -> `configuration-layer-exclude-all-layers`
`configuration-layer-distribution` -> `configuration-layer-force-distribution`
Choose to inherit from face lazy-highlight instead of region.
Ideally a theme should not set lazy-highlight to the same face as
region.
Also move some function to funcs.el and remove some empty lines.