Commit Graph

301 Commits

Author SHA1 Message Date
ZarsBranchkin 1e340f62f3 add --skip-sync startup flag
This adds a new startup flag `--skip-sync`. It will force spacemacs to skip
package synchonization. This can be useful in cases when you're working under
poor or restrictive network.

Thanks, @zaript, for this idea!
2017-07-01 09:54:21 -04:00
Eivind Fonn fcf186faff Fix cfgl-layer docstring (concat not evaluated) 2017-06-23 09:27:05 +02: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
Eivind Fonn 9c9bdf749a Don’t look in .spacemacs.d/layers if it doesn’t exist 2017-05-29 11:52:31 +02:00
Ben Gamari 1320f8e8fa Resolve symlinks when warning about duplicate layers
This allows the user to, for instance, include the spacemacs tree as a
git submodule of their configuration repository without seeing
superfluous warnings.
2017-05-24 12:26:25 +02:00
MadAnd 9f3e656c8f Add support for building multi-file local packages with Quelpa
At the moment a Quelpa recipe like `(recipe :fetcher local)` is being translated
to something like
`(recipe :fetcher file :path "my-layer/local/my-pkg/my-pkg.el")`. So we can
build simple single-file local packages.

This commit changes it to translate to the package directory instead of exact lisp
file, so we can build multi-file local packages. Thus, the above example will be
translated to `(recipe :fetcher file :path "my-layer/local/my-pkg")`.

Also, add the relevant info to LAYERS.org.
2017-05-14 13:39:02 -04:00
Robert (Robby) O'Connor 9660a90022 grammar fix
This was introduced in a85634c. The grammar wasn't correct here -- so this fixes it.
2017-04-17 19:49:16 -04:00
syl20bnr 252547aa81 core: add support for :location keyword in dotspacemacs-themes
New functions:
- configuration-layer/get-location-directory which return the location on disk
given a location
- spacemacs//get-theme-directory which returns the location on disk of the
theme

Add note in documentation to warn about the directory name when :location local
is used, the directory name is the package name not the theme name.
2017-02-05 23:47:17 -05:00
syl20bnr a85634cd5a core: display message in mode-line while uninstalling packages 2017-02-03 11:40:19 -05:00
syl20bnr 415b29b140 core: dotspacemacs-themes entries now accept package properties
It is now possible to use package properties like :location in
dotspacemacs-themes.

Added hooks ran at the beginning and end of configuration-layer/sync:
- configuration-layer-pre-sync-hook
- configuration-layer-post-sync-hook

configuration-layer-pre-sync-hook is used to hook the new function
spacemacs//add-theme-packages-to-additional-packages. This new function updates
dotspacemacs--additional-theme-packages variables.

Update documentation to mention the new feature.
2017-02-01 22:59:03 -05:00
syl20bnr b3c8ebc816 core: improve theme application
Add all theme packages defined in dotspacemacs-themes to the variable
dotspacemacs-additional-packages and delay the application of user theme at the
end of startup (only when user theme cannot be applied at the very beginning
of Emacs startup).

This has nice properties:
- we leverage the layer system to handle the theme packages installation and
  cleanup.
- theme packages are automatically owned by the dotfile preventing them from
being garbage collected.
- the protected package mechanism is now obsolete since themes were the last
packages using it. This mechanism may be removed in a near future.

Thanks to TheBB for the initial idea.
2017-01-25 23:37:57 -05:00
syl20bnr 90fe6074eb core: add some feedback test in mode-line during startup
A message is displayed while indexing layers and installing packages.
2017-01-25 23:37:57 -05:00
d12frosted 5be07e90d2 temporarily fix value of configuration-layer--elpa-archives 2017-01-25 10:38:59 +02: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 1afa0f8faa core: import quelpa and package-build into core/libs
Remove the need to fetch these libs from the internet.
2017-01-23 23:52:57 -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 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