Commit Graph

209 Commits

Author SHA1 Message Date
Eivind Fonn d51987f497 core: remove support for all layers 2016-05-30 21:06:54 -04:00
syl20bnr d98be63dfa core: new layer file -> layers.el / Fix regressions of previous commits
The new layer file `layers.el` is used to declared additional layers.
It is like the sibling of packages.el except that for now it does not
take a list (can do this in a futur commit).

The new order for file loading is the following:

layers.el > packages.el > funcs.el > config.el > keybindings.el

Since packages.el relies on some undefined stuff encapsulated
in init functions, it is not meant to be byte compiled. OTOH funcs.el
(where lies most of the computation added by a package config) should
be compilable.

Since we load packages.el very early it is not possible to use
`configuration-layer/package-usedp` in funcs.el.

This commit also fixes the tests.
2016-05-28 21:20:23 -04:00
syl20bnr 37dfa47961 core: allow package-usedp in both packages.el and funcs.el 2016-05-27 00:32:05 -04:00
syl20bnr c35e4ee27b core: remove packages-funcs and packages-config
Change the semantic of the files for a better control over the
configuration (like being able to use package-usedp function to
guard package configuration and function definition).

This is a big change!

The list of packages of the layer must now be placed in config.el
packages.el only contains pre-init, init and post-init functions

Now both packages.el and funcs.el can use
configuration-layer/package-usedp which is much more powerful than
just configuration-layer/layer-usedp.

Also merging into one file the layer variable and the list of packages
make sense (in this case config.el).

It also means that we can quickly load all the packages declared in
all layer for helm and ivy sources by just loading the config.el file.

Expect some regressions introduced by this change, like the helm
and ivy sources, they will be fixed in other commits.
2016-05-27 00:32:05 -04:00
syl20bnr 1f993bddf6 Rename spacemacs-helm and spacemacs-ivy layers to helm and ivy
For ivy users: be sure to update your dotfile by replacing spacemacs-ivy
by ivy
2016-05-15 22:24:27 -04:00
syl20bnr 1ebbe18b47 core: display warning buffers at the bottom of the screen
when synchronizing layers.
2016-05-14 22:10:20 -04:00
syl20bnr b21c7177ec core: new command line params --no-layer and --distribution
--no-layer: desactive all the layers except the distribution layer
--distribution: allow the change temporarily the distribution

example

Start emacs with spacemacs-base and no layers:
emacs --no-layer --distribution spacemacs-base
2016-04-21 23:29:23 -04:00
syl20bnr 09ff77fbd4 Make it possible to use spacemacs-bootstrap layer as a distribution 2016-04-06 13:12:13 -04:00
syl20bnr c55c21d1c3 core: fix layer auto-mode function
Not installed used layers were not lazy installed appropriately.
2016-04-04 22:15:24 -04:00
syl20bnr 22c2763569 core: add package breakdown in summary message
e: elpa
r: recipe
l: local
b: built-in
2016-04-03 12:02:28 -04:00
syl20bnr d60228219f core: ensure quelpa is available when installing packages 2016-04-03 02:51:01 -04:00
syl20bnr 8e897f6b7b core: new layer spacemacs-bootstrap and new package :step
New package :step 'bootstrap', this step happens before 'pre' packages.
A new layer names 'spacemacs-bootstrap' gather all the ':step bootstrap'
packages. This layer is special and is always the first element of
the variable 'configuration-layer--layers' which assure that all
bootstrap packages are configured first.

This new layer leverages the configuration layer system, removes the
clutter of package installations in the function 'spacemacs/init' and
isolate the bootstrap packages in one place.
2016-04-03 00:28:47 -04:00
syl20bnr 91eeccc7a5 core: change meaning of t for dotspacemacs-enable-lazy-installation
t now means unused.
2016-03-28 12:10:12 -04:00
syl20bnr ae9f40ae77 core: new variable dotspacemacs-ask-for-lazy-installation 2016-03-27 15:56:15 -04:00
syl20bnr 5e5b7a6569 core: new values for dotspacemacs-enable-lazy-installation
- all
- unused
- nil
- t

Fixed #5608
2016-03-27 15:55:24 -04:00
syl20bnr d37c38053e core: fix installation and configuration of lazy installed packages
Several things have been fixed:
- correctly set the :lazy-install flag on all packages of a lazy
  installed layer
- correctly unset the :lazy-install flag when installing the packages
- sort the packages before installation and configuration

Fixes #5610
2016-03-27 12:23:24 -04:00
syl20bnr 21496c462c core: fix detection of packages to lazy install
Make cfgl-layer-owned-packages return a list of package objects instead
of just package names.
Use this function to correctly excluded non owned package when flagging
package for lazy installation.

Fixes #5608
2016-03-27 03:27:53 -04:00
syl20bnr 842bb368ea core: display home buffer when installing a layer lazily 2016-03-26 03:36:54 -04:00
syl20bnr b7923ad1d9 core: don't configure package marked for lazy install 2016-03-26 03:23:18 -04:00
syl20bnr f70bcbcd4c core: improve lazy install robustness
- only consider distant packages (i.e. requiring an installation)
- remove lazy install flag of a layer if at least one owned package is
  already installed
2016-03-26 03:23:03 -04:00
syl20bnr fe8f0a74ad core: fix lazy install prompt for installed layers
Fixes #5591
2016-03-26 02:15:55 -04:00
syl20bnr a7f46a496e core: fix mode activation when lazy install is cancelled 2016-03-26 00:50:13 -04:00
syl20bnr 8815868524 core: fix lazy installation of not used packages
Fixes #5591
2016-03-26 00:46:11 -04:00
syl20bnr 16afe67907 core: enhance lazy installation of layer
Now Spacemacs will ask for layer installation when opening a file with
a known file type.
The auto-mode-alist entries are added by the file auto-layer.el in
the layers directory.

Easy insert of forms for lazy initialization can be done with the
interactive function configuration-layer//insert-lazy-install-form.

Change default value of dotspacemacs-enable-lazy-installation to t.
2016-03-25 01:03:37 -04:00
syl20bnr c3bb8a609e core: add overriding rules for :toggle
:toggle is ignored if not used in the owner of a package, it can
be overridden by new owners or by the dotfile.
2016-03-19 18:26:18 -04:00
syl20bnr 00d13b4ff9 core: use eval for toggle property
In this case the dispatch to symbol-value is useless since we accept
an prog form.

See https://www.gnu.org/software/emacs/manual/html_node/elisp/Eval.html
2016-03-12 14:02:51 -05:00
bmag 0daba08781 Use package-user-dir where appropriate
Elpa dir is no longer hard-coded to <user-emacs-directory>/elpa/. Users
can change the location of Elpa dir by changing the value of
package-user-dir.
2016-03-10 23:13:19 -05:00
syl20bnr f6657a5382 core: new interactive function to insert lazy installation config
New function configuration-layer/insert-lazy-install-configuration
This function asks for a layer and then insert the lazy configuration
for all the packages owned by this layer.
2016-03-05 23:25:00 -05:00
Eivind Fonn 52bb7b7c7f Revert one instance of condition-case 2016-03-03 21:14:40 +01:00
bmag b224c9f1e1 Bugfix: honor package :toggle spec when provided 2016-03-03 20:41:10 +01:00
justbur 39e06feba9 Use unless-debug version of condition-case
It's not possible to get full backtraces in these instances when an
error is signaled, and I think we should generate full backtraces when
debug-on-error is enabled as a general rule.

I had to make this change at one place to track down the root of problem
2 in #5200.
2016-03-03 20:30:30 +01:00
syl20bnr 8849e9c807 core: fix activation of package dependencies
Bug lurking in the code for quite some time, if both a package and
its dependencies were uninstalled then activation of the dependencies
could fail. This is resolved by explicitly asking package.el to install
the dependencies if required.
2016-02-23 13:00:38 -05:00
syl20bnr fd9326486a core: new function configuration-layer/describe-package
Add actions for both helm and ivy.

TODO:
- see TODO in function body
- replace SPC h d p (list all packages, use spacemacs describe when
it is a layer package, otherwise use vanilla describe).
2016-02-22 02:29:43 -05:00
syl20bnr e4447264d9 core: new package keyword :toggle
This new keyword allows to add all the packages to the <layer>-packages
even when a package is not toggled on by a given layer variable.

This fixes an issue of the layer system where we had to choose between
discoverability (ie. the list of package in helm or ivy with SPC h SPC)
and installation of package (because any package listed in the variable
<layer>-packages were installed).
2016-02-21 00:01:39 -05:00
syl20bnr 308fb1118d core: replace package keyword :skip-install by :location site 2016-02-20 23:05:36 -05:00
syl20bnr 6bb306a999 Improve theme installation robustness
Also use stock Emacs functions for warning reporting before the
home buffer is actually created.
2016-02-19 23:30:35 -05:00
syl20bnr da83bef2cb Fix unusable Emacs when an ELPA repository is down 2016-02-19 22:14:45 -05:00
bmag 31f532dfe5 install-package: don't set lazy-install pkg is nil
Fix bug: When the list of package names returned by
configuration-layer//get-uninstalled-packages contains a package that
isn't contained in configuration-layer--packages, then
configuration-layer//install-package throws "wrong-argument-type:
eieio-object-p nil" error at startup.
configuration-layer//install-packages catches it and prints it in the
home buffer.
2016-02-14 23:07:22 -05:00
syl20bnr 3b6b55485a core: don´t catch errors if --debug-init 2016-01-31 23:15:29 -05:00
Robert O'Connor 42735c9f9f core: fix typo 2016-01-31 22:18:32 -05:00
syl20bnr 45def1ec60 core: Add support for lazy installed layer.
New function configuration-layer/lazy-install to add support for
lazy installation of layers based on auto-mode-alist emacs mechanism.

This is essentially the Prelude feature but translated at the layer
level for Spacemacs.

New dotspacemacs variable to enable this feature:
dotspacemacs-enable-lazy-installation
For now this variable is set to nil by default, it will be put to t when
the feature is stable.

POC with elixir layer.
2016-01-31 00:10:14 -05:00
syl20bnr 5a061b3813 core: new layer files packages-config.el and packages-funcs.el
Start to isolate the list of packages. Also we want to define packages
function at the top level of an elisp file in order to not prevent
emacs from knowing where the functions are defined.

This commit has a POC made with elfeed and elixir layers.
2016-01-31 00:03:04 -05:00
Eivind Fonn ad6efee8a2 Don't accidentally overwrite skip-install 2016-01-26 01:20:59 -05:00
james sangho nah 23525a3d1d Remove non-directories from rollback slot list
Addressing #4586. The bug stops Spacemacs from listing rollback slots if
there exists a file (i.e. non-directory) in the rollback directory.
e.g. .emacs.d/.cache/.rollback/.DS_Store (common in OS X)
2016-01-21 15:55:32 +01:00
syl20bnr 1a5229048c core: new keyword :skip-install 2016-01-17 23:27:30 -05:00
syl20bnr 33ead6fc42 Deprecation of extensions and <pkg>-excluded-packages variables
As announced in previous releases, see CHANGELOG.next for more info
in the Breaking Changes section.
2016-01-17 22:06:04 -05:00
syl20bnr 321d2f028a core: add configuration-layer/remove-layer(s) 2016-01-13 00:06:38 -05:00
syl20bnr 3d63dd4392 core: fix red mode-line when an error occurred
Rename function configuration-layer//set-error to
configuration-layer//increment-error-count
2016-01-12 00:08:36 -05:00
syl20bnr 046d86800c Clean copyrights and update for year 2016 2016-01-11 21:42:17 -05:00
Chris Barrett 6d7d399cfe Update packages.el template
- Remove extensions template
- Prompt before creating readme (Users creating private layers probably
  don't want to create a readme)
- Template out layer author and email address
- Rename LAYERNAME to LAYER_NAME for readability
- Use fallback attributes if user-full-name is unset
- Fix inconsistent Spacemacs capitalization in template
2016-01-11 19:06:43 -05:00