Commit Graph

284 Commits

Author SHA1 Message Date
syl20bnr 1846984bd0 core: add support for interpreter-mode-alist to layer lazy installation
Update python lazy declaration as an example.
Still need to update the auto-layer.el file for other modes.
2017-01-22 13:41:04 -05:00
syl20bnr 220bbabd36 core: fix computation of package installation lazyness
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.
2017-01-22 13:37:12 -05:00
syl20bnr 7dde962ec8 core: Improve configuration-layer/create-elpa-repository
Fetch the archives before creating the elpa repository.
2017-01-22 00:40:02 -05:00
syl20bnr 984a3f956b core: fix delayed warning display in emacs 25.5
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.
2017-01-22 00:37:10 -05:00
syl20bnr 6dac7d8ce9 core: correctly index packages installed by spacemacs core
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`.
2017-01-22 00:34:08 -05:00
syl20bnr 9909a95ad3 core: add ~ character to detect local package archives 2017-01-22 00:32:34 -05:00
syl20bnr c6bf7f7664 core: new functions to synchronize distant ELPA packages with local repo
New functions:
configuration-layer//download-elpa-file
configuration-layer//sync-elpa-packages-files
2017-01-18 00:24:14 -05:00
syl20bnr 273e1e94d6 core: add function to create spacelpa archive-contents
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).
2017-01-17 00:24:32 -05:00
syl20bnr afb2efcf56 core: minor functions renaming in core-configuration-layer.el
configuration-layer//get-packages-dependencies --> configuration-layer//get-packages-upstream-dependencies-from-alist
 configuration-layer//get-implicit-packages --> configuration-layer//get-implicit-packages-from-alist
2017-01-17 00:23:04 -05:00
syl20bnr cf5dac00ad core: move and rename spacemacs//get-package-directory
Move it to core-configuration-layer.el
Rename it to configuration-layer/get-elpa-package-install-directory
2017-01-17 00:20:59 -05:00
syl20bnr 14e690d82c core: add parameter to configuration-layer/make-all-packages
New parameter `skip-layer-discovery', if non-nil then rediscovery of layers
is skipped (used essentialy for the tests).
2017-01-15 23:14:20 -05:00
syl20bnr 2875ed4b0c Speedup SPC h SPC for both helm and ivy
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.
2017-01-15 22:19:56 -05:00
syl20bnr 3162f0e19b core: factorize code in configuration-layer/make-all-packages 2017-01-15 22:19:56 -05:00
syl20bnr fb27ede558 Bump year in copyright headers
Happy New Year 2017!
2017-01-05 23:08:17 -05:00
syl20bnr f5957eb877 core: cleanup layers discovery
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.
2016-12-25 15:14:20 -05:00
Keshav Kini 39667d3c87 Don't suggest `SPC q r` if restart-emacs is missing
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.
2016-11-20 18:57:52 -05:00
Harry Walsh 452931ba2d Cleaned up directory warning about duplicate layers.
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.
2016-10-21 12:10:47 +02:00
syl20bnr ee6c353abd core: inverse inhibition of :toggle messages
Makes more sense to inhibit at install time instead of configuration
time.
2016-10-20 09:30:16 -04:00
Eivind Fonn 1a97aeb215 Warn if layers changed outside dotspacemacs/layers 2016-10-18 10:13:17 +02:00
Eivind Fonn d7938d63b1 Check package excluded property before toggle 2016-10-17 13:33:46 +02:00
syl20bnr 04ebeb712d core: fix exclusion of package when installing all packages
Fixes #7059
2016-10-10 01:09:05 -04:00
syl20bnr 8b4f3462c6 core: simplify construction of package objects 2016-10-10 01:08:45 -04:00
syl20bnr 22aafd9523 core: fix lazy installation of layers
Fixes #7256
2016-10-09 23:32:31 -04:00
ynilu 3b6c0e3b31
Correct the format of recipe when check for update 2016-10-03 20:53:33 +03:00
d12frosted 8578b40404
properly resolve local package archive urls 2016-09-13 16:44:41 +03:00
syl20bnr 03f9f9f700 core: contain side effects when loading packages for SPC h SPC
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.
2016-09-05 20:54:07 -04:00
syl20bnr 34971edc32 core: fix make-package multiple calls side effects
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.
2016-09-05 15:01:35 -04:00
syl20bnr 7a9f031e2b core: Split configuration-layer/make-packages-from-layers
Split the function in two functions:
- configuration-layer/make-packages-from-layers
- configuration-layer/make-packages-from-dotfile
2016-09-05 12:40:44 -04:00
syl20bnr f7668181d6 core: refactor make-package and make-packages
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.
2016-09-05 11:54:29 -04:00
syl20bnr 43a445b1df Remove wrongly pushed change in core 2016-09-04 12:29:52 -04:00
syl20bnr c6a6c41d92 Replace hooks by regular list for jump lists
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.
2016-09-04 12:28:40 -04:00
Eivind Fonn 3a28393a23 Implement :enabled-for layer keyword 2016-08-31 22:15:13 -04:00
deb0ch 55accac7e5 center startup summary in spacemacs buffer 2016-08-31 18:44:15 +02:00
deb0ch 7dfa038107 redisplay startup info summary when re-centering and refreshing spacemacs buffer 2016-08-31 18:42:19 +02:00
syl20bnr 41f70e979c Add todo to remove delayed layer hack in future version 2016-08-25 22:51:32 -04:00
syl20bnr 1e64768fb7 core: rename dotspacemacs-download-packages
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).
2016-08-19 21:31:57 -03:00
syl20bnr 564cbc40ed core: better behavior for dotspacemacs-download-packages
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.
2016-08-19 21:04:33 -03:00
syl20bnr a14bfb9d6d core: fix 'all value for dotspacemacs-download-packages 2016-08-18 22:48:34 -03:00
Eivind Fonn 36f3b63079 Make elpa directory more flexible
- Rename variable to dotspacemacs-elpa-subdirectory
- Allow arbitrary form to be evaluated
2016-08-13 14:21:01 +02:00
Bar Magal 6b23983205 core: different elpa dir per emacs version
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.
2016-08-13 14:02:06 +02:00
syl20bnr 9c3802b142 core: fix SPC f e R after layer system refactoring
Correctly adds packages when resync the dofile. Also flush the layer
index before rediscovering the layers.
2016-07-29 00:00:55 -04:00
syl20bnr 1c4f685b13 core: refactor layer system
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`
2016-07-28 23:26:54 -04:00
NJBS 37ce95b362 Use Quelpa file fetcher instead of url
An upstream issue with Emacs causes local file urls to incorrectly be
interpreted as FTP addresses on Windows, see #6602.
2016-07-17 02:04:14 -04:00
d12frosted 46cc89457d
allow to install local package using quelpa
Package can be installed using quelpa if it's defined as in following
example.

(package-name :location (recipe :url local))
2016-07-15 15:13:56 +03:00
syl20bnr f1247c8d18 core: new variable dotspacemacs-frozen-packages
Packages listed in dotspacemacs-frozen-packages cannot be updated or
rollbacked.
2016-07-09 14:58:30 -04:00
syl20bnr e7dcf16670 core: rename configuration-layer--skipped-packages
to configuration-layer--check-new-version-error-packages
2016-07-09 14:58:30 -04:00
syl20bnr ad3eb41c52 core: use version info and package desc for dependencies
when installing from ELPA repositories.
2016-07-09 14:58:30 -04:00
syl20bnr 2152f66b9f core: add min-version keyword to package list
Providing a min-version allows to fetch the elpa version of a built-in
package. For intance to install python mode from GNU elpa, add to
the dotspacemacs-additional-packages:

(python :location elpa :min-version "0.25.2")
2016-07-09 14:58:30 -04:00
syl20bnr 85494376c3 core: add tests for make-package 2016-07-05 00:23:16 -04:00
Allen Li 45afa3be19 Don't un-exclude an excluded package
If a layer using a package is loaded after a layer excluding it, the
exclude flag should not be overwritten.
2016-07-05 00:23:16 -04:00