Commit Graph

127 Commits

Author SHA1 Message Date
JAremko fc00cfa882 core-documentation-edn refactoring 2017-07-25 01:56:29 +03:00
JAremko 72659c59ab Initial impl of export to intermediate doc formats 2017-07-25 01:56:03 +03:00
Eivind Fonn f4b53d2a4f Rename :depends to :requires 2017-07-03 09:54:53 +02:00
syl20bnr d89f2dcf82 tests: rename helper functions
helper--set-layers -> helper--add-layers
helper--set-packages -> helper--add-packages
2017-07-02 10:53:26 -04:00
syl20bnr 6a34072d7f tests: add tests for all code paths of layer-used-p and package-used-p 2017-07-02 10:51:33 -04:00
syl20bnr 3259b8667a tests: simple move of code 2017-07-02 10:09:39 -04:00
syl20bnr e2e532bb49 core: change <function>p to <function>-p suffixes for consistency
Also defined aliases for backward compatibility with `usedp` functions.
2017-07-02 10:09:39 -04:00
Eivind Fonn db4adde089 Fix: Check owner of dependent packages 2017-07-02 09:41:38 -04:00
Eivind Fonn 69b5f83d5a Fix: Check dependencies for owned packages too
Fixes #9134
2017-07-02 09:41:38 -04:00
Eivind Fonn 08561d8631 core: implement :depends for package declarations
This replaces the older pattern
:toggle (configuration-layer/package-usedp ..)

This implementation ensures that :disabled-for honors dependent packages, i.e.
if package a depends on package b, which is owned by layer c, and layer c is
disabled for layer d, then neither package a nor b will be configured for layer
d. Previously, this was only true for package a, but not b.

This commit also fixes:

- configuration-layer/describe-package now shows which post-init and pre-init
  functions are disabled, if any
- Does not recreate all layer objects unconditionally when calling
  configuration-layer/discover-layers. Previously, this led to all layers being
  recreated after e.g. `SPC h SPC`, without any of the dotfile information.
  Since this information is now necessary for
  configuration-layer/describe-package, it’s important that we don’t clear the
  indexed layers when invoking this function.
2017-06-22 11:53:05 +02:00
JAremko 70538672d1 cleanup after doc test 2017-04-19 23:00:00 -04:00
syl20bnr 62167f708d tests: move html-export test to doc /tests/doc directory 2017-04-17 19:25:43 -04:00
smile13241324 89ab17bd7a Add test for spacemacs//publish-doc export of documentation
To avoid further issues with the publishing of
documentations I have written a test to ensure that
all documentation files can be exported to html.

To avoid issues with loading the right org version
after package installation I have also slightly
modified the test workflow to include a dedicated
package installation target done prior to executing
any tests.
2017-04-17 19:03:41 -04:00
syl20bnr 9ac779a2e4 core: import spacemacs-theme into libs
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.
2017-01-25 00:30:31 -05:00
syl20bnr 1a9c5ea8ad core: force installation of org-contrib-plus instead of org
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.
2017-01-22 23:23:39 -05:00
syl20bnr 65fea08de3 core: add support for local elpa repositories
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
2017-01-22 17:55:59 -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 19bfb9ea7b core: fix unit tests
Awkward patch since the function configuration-layer/declare-layer is not
tested.

We should add tests for this function and then this patch would be more
acceptable.
2017-01-15 23:14:21 -05:00
syl20bnr fb27ede558 Bump year in copyright headers
Happy New Year 2017!
2017-01-05 23:08:17 -05:00
deb0ch e952eef1a6 home buffer: center buffer on fixed width 80 when not responsive 2016-11-07 09:15:56 -05:00
deb0ch 3fa8b40057 home buffer: better framed notes display <3
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).
2016-11-07 09:13:46 -05:00
ynilu 3b6c0e3b31
Correct the format of recipe when check for update 2016-10-03 20:53:33 +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
Eivind Fonn 3a28393a23 Implement :enabled-for layer keyword 2016-08-31 22:15:13 -04:00
syl20bnr 3a5edf9f05 Fix configuration layer functional tests 2016-08-19 23:50:29 -03:00
syl20bnr a9489a431d core: fix naming conventions for private funcs and vars
in core-release-management.el
2016-08-03 21:43:12 -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
syl20bnr 85494376c3 core: add tests for make-package 2016-07-05 00:23:16 -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
syl20bnr e018e41b37 Fix tests
Mock the correct function configuration-layer//warning
2016-06-11 00:00:46 -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 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 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 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 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 b7923ad1d9 core: don't configure package marked for lazy install 2016-03-26 03:23:18 -04:00
syl20bnr 35b314f677 Fix unit-test test-insert-lazy-install-form 2016-03-25 01:48:05 -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 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
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 da83bef2cb Fix unusable Emacs when an ELPA repository is down 2016-02-19 22:14:45 -05: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 046d86800c Clean copyrights and update for year 2016 2016-01-11 21:42:17 -05:00
syl20bnr 96a648d1da Update deprecation TODO to 0.106 2016-01-03 22:46:01 -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
syl20bnr 629d736b79 core: add package keyword :protected
A protected package cannot be uninstalled nor excluded.
2015-11-19 00:53:57 -05:00
syl20bnr e3df025eff evilified-state: fix tests and rename library to evil-evilified-state 2015-11-19 00:24:27 -05:00
justbur b294461957 evilified-state: Make into local package 2015-11-18 23:35:01 -05: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 6757ce7607 Use spaceline to provide mode-line 2015-09-29 23:48:03 -04:00
syl20bnr a38f79158c Fix core tests 2015-09-29 22:06:19 -04:00
syl20bnr a295d296ba tests: add missing require 2015-09-26 00:29:15 -04:00
syl20bnr 773076a1be core: remove core-evilify-keymap.el
Move its contents to core-evilified-state.el
2015-09-26 00:26:16 -04:00
syl20bnr d237d56c23 evilify: simplify implementation and fix tests 2015-09-26 00:11:34 -04:00
syl20bnr 5fd04c51df tests: install evil package for evilify func. tests 2015-09-25 00:27:53 -04: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 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 4228f9c749 Update tests folder structure 2015-09-12 13:37:47 +02:00
Eivind Fonn 666c202d28 Fix tests 2015-09-12 13:24:56 +02: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 71ce9968d9 tests: update configuration layers func. tests 2015-09-09 23:51:05 -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 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
Eivind Fonn 5f756be832 Test modeline DSL 2015-08-31 21:16:40 -04:00
Eivind Fonn c6ba7d9300 Refactor test system
Should allow easier testing of layers, not just core
2015-08-31 21:16:34 -04:00
syl20bnr dc88ba2253 Remove more uneeded stuff 2014-09-02 00:51:43 -04:00
syl20bnr 9a41f1c7c4 Add key bindings for ert 2014-04-27 00:58:12 -04:00