Commit graph

107 commits

Author SHA1 Message Date
jaremko b83521edbb Add spacebind macro and tests for it 2020-02-27 21:48:40 -05:00
JAremko 88b4df9d8a skip some tests on PRs 2019-12-04 14:38:06 +02:00
syl20bnr 249adcc35e [core] Add tests showing that list is required with multiple symbols
It means that:

        (helm-company :requires helm)

is OK, but

        (helm-company :requires helm pkg2)

is not OK, list is mandatory

        (helm-company :requires (helm pkg2))
2019-11-09 09:41:34 -05:00
syl20bnr 0e36cb9994 [core] Rename test functions testing :requires functionality
These functions were still using "depends-on" which is now inacurrate.
2019-11-09 09:41:31 -05:00
syl20bnr 789c1c8022 [core] Add unit tests for cfgl-package-reqs-satisfied-p 2019-11-09 09:41:27 -05:00
syl20bnr 09af9fc40b [core] Add "unit" and functional tests for archvie verification 2019-08-24 22:50:39 -04:00
syl20bnr 253a8ed413 tests: fix mocks for spacemacs/update-progress-bar 2018-07-05 00:02:17 -04:00
Codruț Constantin Gușoi 25827266a7 Disable mocks temporarily to not discourage contributions 2018-07-03 00:39:08 +03:00
bmag b54ea8ef90 line-nums: don't default to text/prog-mode if disabled by user
When :enabled-for-modes is nil we default it to '(prog-mode text-mode), but if
any of them is in :disabled-for-modes then it shouldn't be enabled by default.
This commit fixes the second part.
2018-06-27 09:13:21 +03:00
syl20bnr 6220ace290 core: rework environment variables and PATH management
See updated DOCUMENTATION.org and FAQ.org for more info.

* add core-env.el
* add library load-env-vars.el
* add bootstrap package dotenv-mode.el
* remove spacemacs-environment from bootstrap layer
* remove dotspacemacs variable dotspacemacs-import-env-vars-from-shell
* remove dotspacemacs variable dotspacemacs-improt-env-vars-shell-file-name
* add new key binding SPC f e e to open spacemacs.env file
* add new key binding SPC f e E to reload environment variable from env file
* add new key binding SPC f e C-e to re-initialize the env file from shell.
2018-06-25 02:55:28 -04:00
Benjamin Reynolds 594fdc8f05 Rename spacemacs/mplist-get functions to be more descriptive
* spacemacs/mplist-get -> spacemacs/mplist-get-values
* spacemacs/plist-get -> spacemacs/mplist-get-value
* refactor spacemacs/mplist-get-value to be defined in terms of mplist-get-values

Ref #10803 See [comment]

[comment]: https://github.com/syl20bnr/spacemacs/pull/10803#issuecomment-395292606
2018-06-14 00:15:49 -04:00
syl20bnr a0a3ff0c20 core: refactor the progress bar
Spacemacs is slow to startup so better give it a not buggy progress bar :-)

* Move progress bar code to core-progress-bar.el file
* Remove the counters at the end of the progress bar
* Fix update of the progress bar value
* Fix progress bar size when staring Emacs maximized
2018-06-10 02:32:29 -04:00
syl20bnr 0ae2a4774c Fix spacemacs-base functional tests 2018-06-06 23:54:17 -04:00
syl20bnr 2df4db5c60 core: new function spacemacs/plist-get
Made to play well with modified plist. Replace spacemacs/mplist-get by
spacemacs/plist-get in spacemacs|add-company-backends
2018-06-04 01:19:44 -04:00
bmag 3812c591cf Line numbers: tests and bug fixes for major-mode predicate 2018-05-30 11:35:26 +03:00
syl20bnr 92fac263a8 core: re-evaluate layer variables after package configuration
It allows to put package variable with a default value set by spacemacs in
the layer variables. For instance to set treemacs position to the right, you can
now do it like this:

(treemacs :variables treemacs-position 'right)
2018-05-28 11:23:57 -04:00
syl20bnr a14060a228 core: fix unit tests 2018-05-20 03:22:08 -04:00
Codruț Constantin Gușoi 0d9b349091 Fixes CI failure
Since the introduction of `spacemacs-bootstrap`, the position of layers
inside `configuration-layer--used-layers` was shifted by 1 to the right.

The test changes account for that now, and the names were changed to
indicate they are related to testing the `spacemacs-base` distribution,
since the complete `spacemacs` distribution has other layers in between
bootstrap and defaults.
2018-05-09 01:04:31 +03:00
syl20bnr 03343a7f1d Fix test test-resolve-package-archives--org-supports-https 2018-01-22 23:51:30 -05:00
Aaron Jensen c86940c4f0 core: Use https for org package repo 2018-01-22 23:34:54 -05:00
syl20bnr 4ecd015fe8 core: process all post-init function after all the init functions
With this commit, the new loading order for package configuration is:
- pre-init functions for all packages
- init function of all packages
- post-init functions for all packages
2018-01-11 23:52:18 -05:00
syl20bnr e9fb5285f4 core: execute all pre-init function before init and post-init
Fixes loading order issues when declaring use-package hooks.

Fixes #9979
2018-01-10 23:33:15 -05:00
Igor Avdeev 709782bdc1 Fix handling of windows paths of package archives
- the configuration-layer//resolve-package-archives function was adding
  extra `http://` for windows paths
2018-01-10 00:13:01 -05:00
syl20bnr 326965d4ce Happy New Year 2018! 2018-01-04 02:00:25 -05:00
syl20bnr 36c15b79f6 core: move versions to new file core/core-versions.el
As we need to have version files available in tests without loading the whole
init.el file.
2017-11-12 10:04:12 -05:00
syl20bnr dc58801c7d core: refactor shadow mechanism
Shadowing is now control by layer property ':can-shadow' only.
can-shadow is a commutative relation, if layer1 can shadow layer2 then layer2
can shadow layer1.
the shadow operator is a binary operator accepting two layer names, it is not
commutative and the order of the operands is determined by the order of the
layers in the dotfile (like the ownership stealing mechanism).

If ':can-shadow' is set explicity to nil in the dotfile then the layer won't
shadow any layer.
For instance to install both ivy and helm layer:

   (setq dotspacemacs-configuration-layers
   '(
     ivy
     (helm :can-shadow nil)
     )

note that due to the commutative relation the above example can also be
written (in this case, ':can-shadow' should be read ':can-be-shawdowed'):

   (setq dotspacemacs-configuration-layers
   '(
     (ivy :can-shadow nil)
     helm
     )
2017-09-25 23:07:22 -04:00
syl20bnr 95699ee61c core: add layer shadowing system
Layers can now declare in their layers.el file that they shadow one or more
layers using the following functions:

- configuration-layer/shadow-layers
- configuration-layer/shadow-layer

Those function are commutative so:
    (configuration-layer/shadow-layer 'layer1 'layer2)
is the same as
    (configuration-layer/shadow-layer 'layer2 'layer1)
and means that
layer1 shadows layer2
and
layer2 shadows layer1

The typical use-case is helm and ivy layers. Helm shadows the ivy layer and
Ivy shadows the helm layer.

Shadowing is sensitive to the order of declaration of layers in the dotfile,
for instance:

    (setq dotspacemacs-configuration-layers '(
      helm
      ivy
     ))

means that ivy shadows helm so helm layer is effectively ignored,
whereas

    (setq dotspacemacs-configuration-layers '(
      ivy
      helm
     ))

means that helm shadows ivy so ivy layer is effectively ignored.

This mechanism can be turned off using the :can-shadow keyword:

    (setq dotspacemacs-configuration-layers '(
      ivy
      (helm :can-shadow nil)
     ))

means that both ivy and helm layers will be installed (not recommended in this
case)

Note that the `:can-shadow` mechanism will be fully implemented in a next
commit.
2017-09-21 23:56:09 -04:00
syl20bnr 6afa753848 core: remove variable configuration-layer--used-distant-packages
- remove variable configuration-layer--used-distant-packages
- rename function configuration-layer//get-distant-packages to
  configuration-layer//filter-distant-packages to better reflect what it does
- Add argument PREDICATE to configuration-layer//filter-distant-packages
- New cfgl-package methods: cfgl-package-used-p and cfgl-package-distant-p
- Add unit tests
2017-08-12 20:48:35 -04:00
JAremko 2ef230369a Convert new exporter into standalone tool 2017-08-02 09:16:23 +03:00
JAremko 3c03c4893b Use spacemacs-base distro in spacemacs-base test 2017-07-26 14:50:20 +03:00
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