Commit Graph

418 Commits

Author SHA1 Message Date
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
Exaos-memes 904f7ea665 Define new variable: spacemacs-start-directory.
With this new variable, user can load spacemacs anywhere, e.g.
"~/.emacs.d/spacemacs/". Only user's cache directory is still hard-coded
as "~/.emacs.d/.cache/". If user want to use spacemacs this way, drop
one line as the below in "~/.emacs.d/init.el":

    (setq spacemacs-start-directory "~/.emacs.d/spacemacs/")
    (load-file (concat spacemacs-start-directory "init.el"))
2016-06-23 00:19:34 -04:00
syl20bnr 290f5fd6a2 core: add argument to cfgl-package-enablep to disable messages
To avoid logging the same messages each time the toggle is resolved.
2016-06-21 19:04:59 -04:00
Eivind Fonn 92b48eadea 💣 Drop support for Emacs 24.3
Spacemacs now needs at least 24.4 to launch.
2016-06-20 22:05:56 -04:00
syl20bnr 117dcba0ed Revert "Drop support for Emacs 24.3"
This reverts commit 31bab70397 making
a new commit to put TheBB as the author.
2016-06-20 22:05:12 -04:00
syl20bnr 31bab70397 💣 Drop support for Emacs 24.3
Spacemacs now needs at least 24.4 to launch.
2016-06-20 21:55:36 -04:00
syl20bnr 57350a3b48 core: reimplement :packages keyword and update documentation
Old implementation excluded package that were not selected, this
implementation does not excluded them, it simply ignore it in the
layer where they are not selected. This reimplementation comes from
a refactor of the way packages.el files are loaded, instead of loading
these files at the moment of resolving the list of used packages, they
are now loaded when making the layer objects. A neat consequence is that
side effects is better confined and the configuration-layer/get-packages
is now pure (at least a lot more pure than before).
In the `cfgl-layer` class the slot `:user-packages` has been renamed
to `:selected-packages` which defaults to `'all` meaning that all
the packages in `:packages` are selected. `:selected-packages` value
is given by the new function `configuration-layer//select-packages`.
Effectively selected packages are given by a new method for `cfgl-layer`
class called `cfgl-layer-get-packages`.

Tests have been updated to reflect the changes.

Also documentation on configuration layer declaration in the dotfile
section of DOCUMENTATION.org has been greatly improved (I hope) and
reflect the last feature added to the
`dotspacemacs-configuration-layers` list.
2016-06-20 20:48:25 -04:00
ralesi 704732fc84 Reimplement #5339 by justbur to add :packages keyword. 2016-06-19 22:07:44 -04:00
syl20bnr 768ec3fc50 core: fix configuration-layer//warning function
Correctly apply arguments to the spacemacs-buffer/warning funcion.
2016-06-12 21:09:22 -04:00
Carl Lange a00045d410 Fix duplicated layer string format error
I had a duplicated layer, but the message that's printed broke spacemacs starting up because it was a format string but wasn't in a `format` form. Simple fix. Spacemacs works again! Yay!

This issue was introduced in c0851ddcb3, according to a quick `git bisect`. :)
2016-06-12 12:58:38 +01:00
syl20bnr 1b77fd84b0 core: fix infinite loop :-) 2016-06-11 01:15:35 -04:00
syl20bnr 4f5d7670f1 core: fix typo with configuration-layer--inhibit-warnings 2016-06-10 23:41:33 -04:00
syl20bnr c0851ddcb3 core: new variable configuration-layer--inhibit-warnings
If non nil then the configuration system does not emit warning.
2016-06-10 22:47:45 -04:00
syl20bnr 3a9cffd2d9 core: add method cfgl-package-get-safe-owner
Safe method to get the owner of a package.
2016-06-10 22:38:38 -04:00
syl20bnr b2d4adb14d core: change cfgl-package :owner slot to :owners
The car of :owners is the real owner.
Now we can easily gather the list of all owners of a package.

Also fix unit tests about missing spacemacs-insecure variable.
2016-06-10 21:43:25 -04:00
syl20bnr 7e3a827f63 core: warn about packages without any init functions
Display a message when a not excluded package has no pre-init, init or
post-init function in a layer.
2016-06-10 20:53:24 -04:00
syl20bnr 419eb51836 core: new variable spacemacs-insecure
Revert "Parse CLI args after dotspacemacs/init"
This reverts commit 0a35502de4.

We cannot delay the parsing of CLI params since we need their values
early during the loading process (i.e. debug info).

Replace the previous commit with a new variable `spacemacs-insecure`
which takes the value of --insecure boolean parameter.
2016-06-09 23:09:59 -04:00
syl20bnr f23ecf0b12 Rename `+distribution` to `+distributions` 2016-06-08 22:17:04 -04:00
syl20bnr 627e934453 core: condensed versions into one string in left-hand side
spacemacs-version@emacs-version (distribution)
2016-06-05 00:19:18 -04:00
syl20bnr f3e50195d7 core: add footer in home buffer 2016-06-05 00:19:18 -04:00
syl20bnr 89452fc34d core: fix nil value for display-buffer-alist
preventing popwin from working properly

Fixes #6220
2016-06-04 00:00:52 -04:00
syl20bnr 1da124f689 Add TODO for configuration-layer/describe-package 2016-05-31 22:33:04 -04:00
Eivind Fonn 6b3e1452cf core: misc. goodies for describe-package
- Use completing-read when called interactively
- Check for string locations in addition to built-in etc.
- Don’t double-princ on/off for toggles
- Bind to SPC hdP
2016-05-31 22:26:59 -04:00
syl20bnr ad40bae1bf core: fix deletion of orphan packages and deps 2016-05-31 14:32:21 -04:00
syl20bnr 9dfa7c3fa6 core: fix error with unknown layer listed in dotfile 2016-05-31 12:47:35 -04:00
syl20bnr 60f5a3a0fa New dotfile variable dotspacemacs-download-packages
This new variable replace dotspacemacs-delete-orphan-packages

It defines the behaviour of Spacemacs when downloading packages.

Possible values are `used', `used-but-keep-unused' and `all'.
- `used' will download only explicitly used packages and remove any
unused packages as well as their dependencies.
- `used-but-keep-unused' will download only the used packages but won't
delete them if they become unused.
- `all' will download all the packages regardless if they are used or
not and packages won't be deleted by Spacemacs.

Default value is `used`.
2016-05-30 22:58:59 -04:00
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
syl20bnr 8ca9f7a5e5 core: sort alphabetically the list of packages to be updated 2016-01-11 10:59:52 -05:00
syl20bnr d610a13d60 core: display the list of packages to update 2016-01-11 01:13:09 -05:00
justbur 900ae8a06d core/config-layer: Conditionally use ivy in create-layer 2016-01-09 13:36:03 -05:00
justbur 32f523e062 spacemacs-helm: New layer
Collect helm configuration from spacemacs and spacemacs-base into one
place. The purpose is to allow choice between this layer and
spacemacs-ivy.
2016-01-09 13:36:03 -05:00
syl20bnr 609b79fd6c core: move handling of --insecure to core-command-line.el 2016-01-06 23:27:09 -05:00
syl20bnr 96a648d1da Update deprecation TODO to 0.106 2016-01-03 22:46:01 -05:00
syl20bnr 00c420211c core: fix configuration-layer--refresh-package-timeout
Set it again to dotspacemacs-elpa-timeout in
configuration-layer/initialize
2015-12-21 00:56:04 -05:00
justbur a713e8d71e core: Fix free variable references
Most are innocuous. One is update-packages-alist in config layer. Define
the variable and give it a docstring with an explanation of its purpose.
2015-12-21 00:25:41 -05:00
justbur 39760a1cfe core: Update to preferred versions of functions
1. Don't use beginning-of-buffer (or end):
   These are for interactive use only according to compiler

2. reduce => cl-reduce

3. next-line => forward-line
   next-line is only for interactive use

4. set-default-font => set-frame-font
   set-default-font is obsolete since 23.1

5. show-subtree => outline-show-subtree (alias)

6. show-all => outline-show-all (alias)
2015-12-21 00:25:41 -05:00
Eivind Fonn ddd5e7112d Fix rollback language 2015-12-09 10:55:32 +01:00
syl20bnr 741bd0375f core: remove request.el dependency 2015-12-07 23:31:30 -05:00
syl20bnr 4a5ec73edf core: add `--insecure` command line parameter
Will set dotspacemacs-elpa-https to nil. Useful to be able to install
spacemacs in an environment where https is an issue.
2015-12-07 23:10:44 -05:00
syl20bnr 26ecdee0e3 New dotspacemacs variable `dotspacemacs-elpa-timeout`
Increase timeout from 3 seconds to 5 seconds.
2015-12-06 02:22:49 -05:00
syl20bnr 61707e593d core: improve installation speed of themes and bootstrap packages
package-refresh-packages was called every time a bootstrap package or
a theme was installed

Use configuration-layer/retrieve-package-archives to install bootstrap
packages and themes
Add a reentrance boolean to configuration-layer/retrieve-package-archives
Add force and quiet optional arguments to configuration-layer/retrieve-package-archives
Force refresh of archive when the user requests an update of packages
2015-12-02 23:53:02 -05:00
syl20bnr d822241739 core: use request.el to check elpa archive availability
Add request.el to core/libs
Refactor package.el initialization in configuration-layer.el
Cosmetic improvements to loading messages
Remove redefinition of package-refresh-packages
2015-12-02 23:25:00 -05:00
Fabien Dubosson 028c53fbd7 Create the layer README on create-layer
When using `configuration-layer/create-layer`, the `README.org` file is
not created from the template. This change corrects this.

Close #3259
2015-11-24 23:20:45 +01:00
Sebastian Wiesner 659d585c7a Fix type error in package-archives
The archive name must be a name.

Fixes `SPC a P`.
2015-11-20 11:45:08 +01:00
syl20bnr 629d736b79 core: add package keyword :protected
A protected package cannot be uninstalled nor excluded.
2015-11-19 00:53:57 -05:00
syl20bnr 1061adbac9 New variable dotspacemacs-elpa-https
If non nil use HTTPS otherwise use HTTP.
Default is t.
2015-11-18 13:50:30 -05:00
Jason McCandless 91588dc7a0 Use https for package sources that support it 2015-11-14 00:38:06 -05:00
syl20bnr 9e5e309bf0 dotfile: new variable dotspacemacs-max-rollback-slots
Replaces the old spacemacs-number-of-rollback-slots
2015-11-11 00:14:46 -05:00
Eivind Fonn 353acb4070 core: fix function name
Introduced in ddeea31ca4
2015-11-10 23:34:27 +01:00
Eivind Fonn ddeea31ca4 core: remove dash dependency 2015-11-10 22:40:26 +01:00
Fabian Wilk 55664858ae Rollback slots are now limited.
- Introduced new variable `spacemacs-spacemacs-number-of-rollback-slots'
      which holds the maximum number of desired rollback slots.
    - Introduced functionality to delete oldest rollback slot directories if
      total number exceeds the configuration value.
2015-11-10 22:24:57 +01:00
Eivind Fonn 4f2b08154c core: Don't delete bootstrap packages as orphans 2015-11-04 20:21:42 +01:00
syl20bnr 37cb1bc562 core: fix configuration-layer/package-usedp for excluded packages
Was returning non nil for excluded packages.
Fix exclusion of evil-magit and evilification of magit buffers.
2015-11-01 00:59:29 -04:00
syl20bnr 3dec1ce9ec core: perform local path existence check at configuration time
In order to be able to log the not found path as a warning instead
of crashing.

Also adds unit test to test both valid and invalid local paths.
2015-10-22 22:39:53 -04:00
Eivind Fonn 0c6065e32d Allow explicit path for package location 2015-10-22 18:27:32 -04:00
justbur aa547faed6 config-layer: Correct package update note 2015-10-18 22:11:03 -04:00
Yen-Chin Lee 2a983671af Fix some cl-lib function with prefix
Since emacs 24.3, function in cl-lib should with cl- prefix.

Signed-off-by: Yen-Chin Lee <coldnew.tw@gmail.com>
2015-10-07 15:51:39 -04:00
Syohei YOSHIDA 2bd94c18d3 Loading warnings for using warning-minimum-level 2015-09-29 15:05:36 +09:00
syl20bnr 7a2e604741 core: remove 'post value for :step property
post value for package :step property is both useless and considered
harmful. It would hijack the determinism of the loading order.

'pre value is used very very rarely and I even think it is not even
used since most of the time a package that must be loaded in pre step
is a bootstrap package. But we keep 'pre since it can be useful to
have it for _exceptional_ cases.
2015-09-24 00:02:02 -04:00
syl20bnr 5402dae81b core: add new :location value -> built-in
Can be used to configure built-in packages
2015-09-23 22:01:47 -04:00
syl20bnr f294ba3887 core: remove 'private value for :location
While doing the tests I encountered an edge case where a package owned
by the dotfile could be passed either a 'private or 'local location
which is ambiguous (moreover where do we put packages with 'local
location ?).

We remove the ambiguity by removing the 'private value and push the
path ~/.emacs.d/private/local/pkg/ when the owner of a local
package PKG is the dotfile.

When the owner of a local package is a layer then the load path is
in the "local" subdirectory of the layer directory. It adds no value
to use the old 'private location in this case.
2015-09-20 00:49:18 -04:00
Eivind Fonn 92c792c18e Allow local packages without owner 2015-09-19 18:44:19 -04:00
syl20bnr ff2ff60830 core: fix configuration-layer/create-layer
Missing name parameter for configuration-layer//copy-template
2015-09-19 01:37:45 -04:00
syl20bnr c111ff24af core: make private location work with dotfile owner 2015-09-19 01:36:48 -04:00
Eivind Fonn c169b78eed Add private package location 2015-09-19 01:11:11 -04:00
syl20bnr 3f18a09560 core: install and uninstall package from package-alist
Consult the archive only when the user actually update the packages.
Fixes #2956
2015-09-17 23:06:43 -04:00
Eivind Fonn fa32b9be5c More flexible additional packages
When the package already exists, use configuration-layer/make-package
to copy information into the existing package object.

This allows overwriting location, step and excluded, but NOT owner,
pre-layers or post-layers.
2015-09-17 22:32:54 -04:00
Robert O'Connor b4e6e52d0e Remove Tromey.
Fixes #3049
2015-09-16 21:41:37 -04:00
justbur 02fbfbe74f core-conf-layer: Use NOSAVE for pack. update (v25)
Should fix #2849. The new package-delete tries to save changes to the
selected package variable during the update process and this can cause
conflicts with how spacemacs wants to update packages (and even lead to
the .spacemacs file being deleted. This is also unnecessary, because we
are only deleting the packages temporarily to be installed at the next
boot, so there should be no need to update this variable.

This change only affects Emacs 25 users.
2015-09-16 21:41:08 -04:00
Bar Magal b4c10a4749 Fix update error when a distant package is unavailable
Instead of error, show a warning that the unavailable package(s) were
skipped. This should handle situations were a package is temporarily
unavailable from MELPA (or other sources).
2015-09-16 21:38:40 -04:00
Eivind Fonn a764eb4eb9 Fix version injection in home buffer
Don't inject version if banner is nil
2015-09-13 22:54:16 -04:00
syl20bnr cd50d9c069 core: defer distro insertion in home buffer 2015-09-11 23:14:16 -04:00
syl20bnr 77161bd591 core: restore default mode line in home buffer 2015-09-11 23:04:01 -04:00
justbur 6eab954afe Use + instead of ! for layer categories
Helm seems to treat "!" specially in pattern matching, so having a ! in
the pattern string when traversing directories is problematic. This
change fixes #2737, because as far as I can tell "+" has no special
meaning in a helm pattern.

Of course, we can choose a different character, but I'm fond of "+" as
representing "more layers here".
2015-09-11 00:13:51 -04:00
syl20bnr c17db0dcb0 core: minor update of warning message when a layer does not exist 2015-09-09 23:45:04 -04:00
justbur cc9287863b core: Fix #2952 by not loading missing layer
This issues a warning if the layer was declared in the dotfile but not
found through the layer discovery mechanism.
2015-09-09 23:45:04 -04:00
syl20bnr 6b33031dc5 core: dotspacemacs-distribution, spacemacs-core layer and rename contrib
- Rename contrib directory to layers
- Add new variable dotspacemacs-distribution
- Move spacemacs layer to layers/!distribution
- New layer spacemacs-core in layers/!distribution
- User can now set dotspacemacs-distribution to spacemacs or
  spacemacs-core (default spacemacs)

spacemacs-core is very lightweight layer sufficient to build upon
spacemacs.
2015-09-07 23:44:43 -04:00
syl20bnr 37609161c8 tests: Add configuration layer functional tests 2015-09-07 19:42:22 -04:00
syl20bnr 555927c7ec core: use package-alist to resolve orphans
instead of the downloaded package archive. It fixes a case where
a package maintainer removes a dependency D of a package P and spacemacs
detects it which has the effect of deleting the obsolete package D, but
package-alist is not yet updated, because package-alist is updated only
when P is reinstalled (or upgraded).
2015-09-07 01:06:27 -04:00
syl20bnr 8adc82d1ae core: actually read :disabled-for layer property
Also it is not need to pass a list, example:

```
(setq dotspacemacs-configuration-layers
   '((auto-completion :disabled-for org git)))
```

Will disable auto-completion for org and git layers.
2015-09-03 13:17:02 -04:00
syl20bnr 88d30d7074 core: add :disabled-for keyword for declared layers
Example:

(setq dotspacemacs-configuration-layers
'((auto-completion :disabled-for (org))))

Will not run any org/pre-init-xxx or org/post-init-xxx functions where
xxx is a package owned by the auto-completion layer.

Limitation:

If ownership of an auto-completion package P is stolen by another layer L
then :disabled-for must also be declared with L, otherwise the P will
be configured for org.

(setq dotspacemacs-configuration-layers
'((auto-completion :disabled-for (org))
  (L :disabled-for (org)))

The user should not change the default owner of a layer unless really
required (for instance to use his own fork).
2015-09-02 23:10:30 -04:00
syl20bnr 719080f533 core: rename configuration-layer/filter-packages to
configuration-layer/filter-objects
2015-09-02 23:10:30 -04:00
Ben Booth a8582813c0 fix typo 2015-08-26 21:57:22 -04:00
syl20bnr 6318f009bc core: add new function to allow a layer to add other layers
- configuration-layer/declare-layers
- configuration-layer/declare-layer

These functions can be used in the config.el file of a layer to add
required layers.

For instance the react layer needs both html and javascript layers.
salt layer needs the yaml layer (see the following commits)
2015-08-26 02:41:54 -04:00
syl20bnr a8f6afaf13 core: fix resolution of orphan packages
Fix a bug were distant packages with no owner were not deleted.
2015-08-25 22:52:26 -04:00
syl20bnr d255cae4b8 core: refactor layer loading
Prepare the field for some kind of layer prerequisites required by
react and yaml layers
2015-08-25 22:28:30 -04:00
syl20bnr 8a5f454c32 core: fix installation of package dependencies 2015-08-15 00:08:21 -04:00
syl20bnr 50b3b4c99a core: add support for recipe update 2015-08-15 00:07:56 -04:00
syl20bnr 437a819ea1 core: inline recipe in package list
It is now possible to override the recipe in a custom layer.

For instance to override the recipe R for package P in layer L
In a private layer L' put at the end of dotspacemacs-configuration-layers
and listing P with an init function for P, L' becomes the ower of
P and the recipe R' defined in L' overrides the recipe R.
2015-08-14 15:31:22 -04:00
justbur 568e464ca3 Fix #2148: Update failure in Emacs 25
The `package-delete` function refuses to delete a package that is a
depency by default, which prevents the spacemacs update function from
working most of the time.

This commit sets the flag to force deletion for Emacs 25.
2015-08-14 14:39:34 -04:00
syl20bnr e8072b0057 Fix returned local dir value in python and rcirc layers 2015-08-13 09:02:03 -04:00
syl20bnr 62c6462ae9 core: fix nil :owner on package dependencies
Fixes #2643
2015-08-13 09:00:18 -04:00
syl20bnr b45f3b0d0a core: the owner of a package can override some properties
Allowed properties to be overridden are: location, step and excluded
This mechanism allow the user to alter the location of a given
package, for instance if she wants to use her own fork instead of the
version in ELPA.

Note that for now there is no easy way to override the package recipes.
2015-08-13 01:23:39 -04:00
syl20bnr 1c8d90c856 core: add support for quelpa recipes 2015-08-12 23:56:24 -04:00
syl20bnr 1514c6e7d3 core: fix bug in package-usedp
It returned t even if the package has no owner.
Fixes #2601
2015-08-11 23:25:00 -04:00
syl20bnr 4148fdff56 core: add support for local directory 2015-08-11 19:45:28 -04:00
syl20bnr e2bdc25396 core: fix mandatory package and extension list variables 2015-08-10 21:22:28 -04:00
Robert O'Connor 3f7dab0eeb Change elpa to use http.
GNU is having issues with HTTPS right now.

Fixes #2596
2015-08-09 21:52:47 -04:00
syl20bnr b7205ebd49 core: fix load file error with dotspacemacs-additional-packages 2015-08-09 14:47:19 -04:00
syl20bnr 88143a33fa core: correctly handle packages owned by the dotfile
i.e. packages listed it dotspacemacs-additional-packages
2015-08-09 11:38:15 -04:00
syl20bnr 9ac2d54423 core: correctly make excluded packages 2015-08-09 11:34:35 -04:00
syl20bnr 51807654a1 core: package-list-v2 fix packages update
Ready to be merged in develop
2015-08-09 00:59:13 -04:00
syl20bnr 64be291221 core: rename some function arguments to more explicit pkg-name 2015-08-09 00:59:13 -04:00
syl20bnr 88a6ddbe37 core: package-list-v2 fix orphan deletion 2015-08-09 00:59:12 -04:00
syl20bnr f0985162c6 core: package-list-v2 fix helm-spacemacs 2015-08-09 00:59:12 -04:00
syl20bnr 00fc8f9502 core: package-list-v2 fix install of packages 2015-08-09 00:59:11 -04:00
syl20bnr b887a21bb6 core: package-list-v2 working loading, still error at install time 2015-08-09 00:59:11 -04:00
syl20bnr aa2669ee9c core: package-list-v2 install and orphan detection
Still need to clean the orphan detection though

Packages are not configured for now
2015-08-09 00:58:48 -04:00
syl20bnr e4748ea692 core: package-list-v2 sort package list 2015-08-09 00:58:33 -04:00
syl20bnr e145f73b8b core: package-list-v2 fix layer variables 2015-08-09 00:58:02 -04:00
syl20bnr f484c2594a core: package-list-v2 new class cfgl-package 2015-08-09 00:55:46 -04:00
syl20bnr a0cbcd4a5d core: fix error when a layer is not found 2015-07-26 20:41:06 -04:00
syl20bnr faa18f49df core: start to use eieio
Replace the alist of layer by a list of layer objects.
2015-07-26 00:41:41 -04:00
syl20bnr 844f2026ac core: rename declare-layers and declare-layer funcs
renamed to declare-used-layers and declare-used-layer respectively
2015-07-25 22:59:54 -04:00
syl20bnr 55f13db2b7 core: fix error when dotspacemacs-directory is nil 2015-07-23 22:59:45 -04:00
justbur 252f26d555 Make default private layer directory explicit 2015-07-23 22:28:26 -04:00
justbur e1eed07c30 Add option for .spacemacs.d/init.el .spacemacs file
Setting SPACEMACSDIR overrides location of .spacemacs.d

Add dotspacemacs-directory variable

Add dotspacemacs-directory to layer search path
2015-07-23 22:25:39 -04:00
syl20bnr 5e1c5319e9 core: put MELPA at the top of the list of archives 2015-07-02 00:38:47 -04:00