Commit graph

52 commits

Author SHA1 Message Date
syl20bnr fb27ede558 Bump year in copyright headers
Happy New Year 2017!
2017-01-05 23:08:17 -05:00
syl20bnr 74fdbb6795 Refactor and simplify company backends declaration
Enabling a company backend for a specific mode was a tedious tasks with code
scattered at different locations, one for local variable definitions, one for
company hook function definitions and another where the backends were pushed to
the local variables (which was problematic, since we ended up pushing the same
backends over and over again with `SPC f e R`, pushes have been replaced by
add-to-list calls in the new macro).

All these steps are now put together at one place with the new macro
spacemacs|add-company-backends, check its docstring for more info on its
arguments.

This macro also allows to define arbitrary buffer local variables to tune
company for specific modes (similar to layer variables via a keyword :variables)

The code related to company backends management has been moved to the
auto-completion layer in the funcs.el file. A nice side effect of this move is
that it enforces correct encapsulation of company backends related code. We can
now easily detect if there is some configuration leakage when the
auto-completion layer is not used. But we loose macro expansion at file loading
time (not sue it is a big concern though).

The function spacemacs|enable-auto-complete was never used so it has been
deleted which led to the deletion of the now empty file core-auto-completion.el.

The example in LAYERS.org regarding auto-completion is now out of date and has
been deleted. An example to setup auto-completion is provided in the README.org
file of the auto-completion layer.
2017-01-02 00:39:04 -05:00
syl20bnr c725823e73 javascript and react: reformat code and move funcs to funcs.el
Some conventional cleanup.
Note that the function `spacemacs/js2-refactor-set-key-bindings` has been
removed since it is not used anywhere.
2017-01-01 22:45:23 -05:00
Corey Grunewald b67118c8ca
Mark tern command as async. Fixes #7591. 2016-12-18 11:44:32 +02:00
Shanavas M 5d8f7bd7c6 Add missing prefices for js2-mode 2016-10-17 20:08:08 +02:00
syl20bnr 317694b160 Define missing jumper handler variables for helm-gtags 2016-09-05 02:38:13 -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
zilongshanren 7a05260136 fix gtags enhancement 2016-08-23 00:08:25 +08:00
Eivind Fonn 5a869764dd Further improve gtags layer
- Add option to disable by default
- Use local-vars hook to allow per-project enable/disable
- Don’t enable helm-gtags-mode (no need)
- Move emacs bindings from helm-gtags-mode-map to ggtags-mode-map
2016-08-22 15:11:25 +02:00
Eivind Fonn 928983da47 Refactor jump to definition
This commit defines:

- spacemacs-default-jump-handlers: a list of functions that can jump to
  definition in ALL modes.

- spacemacs-jump-handlers-MODE: a list of functions that can jump to
  definition in MODE.

- spacemacs-jump-handlers: a buffer-local list of functions that can
  jump to definition. This is made up of the values of the two previous
  variables whenever a given major mode is activated.

- spacemacs/jump-to-definition: a function that tries each function in
  spacemacs-jump-handlers in order, and stops when one of them takes us
  somewhere new.

- spacemacs|define-jump-handlers: a macro that
  * defines spacemacs-jump-handlers-MODE, possibly filled with initial
    functions
  * defines a function that is added to the hook of the given MODE
  * binds “SPC m g g” of that MODE to spacemacs/jump-to-definition

This is an attempt to harmonize all the different approaches to jumping.
Specifically,

- Existing intelligent jump packages that work for only a single mode
  should go to the beginning of spacemacs-jump-handlers-MODE. E.g.
  anaconda for python, ensime for scala, etc.

- Packages like gtags that work for several modes (but potentially not
  all) and which is dumber than the intelligent jumpers should go the
  the END of spacemacs-jump-handlers-MODE.

- Packages like dumb-jump that work for all modes should go to
  spacemacs-default-jump-handlers.

In all cases the order of the jump handlers in each list should be from
most to least intelligent.

Fixes #6619
2016-08-22 15:08:25 +02:00
Shanavas M 83e5d41042 Add "documentation" prefix for js-doc menu 2016-08-17 20:01:43 +02:00
d12frosted c42a08a842
js layer readme minor improvements
- fill paragraphs
- hide url under descriptive text
- fix wording for linters
2016-07-31 13:05:40 +03:00
Steve Dignam a2df27e71a
Add flycheck info to javascript layer README.org
Added info about available flycheck checkers for Javascript.
Also added install info for ESLint.
2016-07-31 13:02:45 +03:00
Christian E. Hopps b22702bc9e Expand gtags use to many more languages 2016-07-17 17:31:59 +02:00
syl20bnr 85ace24553 react: fix tern setup
The init function should be a post-init instead of an init function.
Also simplified the configuratin quite a bit.
2016-06-21 19:04:59 -04:00
syl20bnr 81fbb9a292 Format README files with spacefmt 2016-06-10 00:09:42 -04:00
Jeff Wu e9cb18f2f2 Fix javascript layer refactoring documentation 2016-06-01 21:40:12 -04:00
Eivind Fonn 62fc64f745 core: special toggle API for minor modes 2016-05-31 22:33:44 -04:00
syl20bnr a2de9a63af Use :toggle keyword instead of when forms 2016-05-29 22:39:21 -04:00
sooheon 15e6290151 Make check for company-mode explicit, not implicit
People may have company-mode installed without necessarily using the
auto-completion layer.
2016-05-27 00:32:05 -04:00
Christoph Paulik 4d080a65fb Diminish tern and skewer mode. 2016-05-11 20:47:04 -04:00
Fabien Dubosson a63bf2ab13 Add more information regarding tern on windows 2016-04-28 15:58:12 +02:00
Fabien Dubosson a03aff8fa1 Apply fill-paragraph after previous commit 2016-04-28 15:50:11 +02:00
Liang Zhou d2486e3956 Update tern configuration for windows. 2016-04-28 15:48:38 +02:00
syl20bnr 07852abad5 Format documenation files with doc-fmt tool 2016-04-12 23:31:38 -04:00
syl20bnr fdf74897a3 javascript: remove variable javascript-disable-tern-missing-warning
Just log the warning in the message buffer.
2016-04-07 23:13:25 -04:00
Muneeb Shaikh dc799401f7 javascript: enhance tern binary detection
Fix #4292

If tern binary isn't found, warn the user of missing binary and do not
enable tern package(else it makes emacs unresponsive).
Allow user to disable missing binary warning via configuration layer
variable `javascript-disable-tern-missing-warning`
2016-04-07 23:00:20 -04:00
syl20bnr 173e2a5421 Move all prefix names from config.el to init functions 2016-04-03 00:12:28 -04:00
syl20bnr 3b0c1fd93d Convert org doc files with doc-fmt 2016-03-30 22:59:55 -04:00
syl20bnr 82fdd9a511 Use evil in holy-mode
Motivation

While disabling Evil in holy-mode makes its implementation shorter and
sounds elegant on the paper, in practice it puts a big burden on the
configuration parts which need to know if Evil is enable or not. This is
a bad separation of concerns and the bunch of fixes that we were forced
to do in the past weeks shows this issue. Those fixes were about
removing the knowledge of the activation of Evil by implementing new
dispatching functions to be used by layers, this is cumbersome and makes
Spacemacs layer configuration more subtle which is not good. There was
additional bad consequences of the removal of Evil state like the
impossibility to use Evil lisp state or iedit states, or we would have
been forced to implement a temporary activation of Evil which is
awkward.

Instead I reintroduce Evil as the central piece of Spacemacs design thus
Evil is now re-enabled in holy-mode. It provides the abstraction we need
to isolate editing styles and be able to grow the Spacemacs
configuration coverage sanely. Layers don't need to check whether the
holy mode is active or not and they don't need to know if Evil is
available (it is always available). We also don't need to write
additional dispatching functions, this is the job of Evil, and I think
it provides everything for this. Ideally configuration layer should be
implemented with only Evil in mind and the holy-mode (and hybrid-mode)
should magically make it work for Emacs style users, for instance we can
freely use `evil-insert-state` anywhere in the code without any guard.

Evil is now even more part of Spacemacs, we can really say that
Spacemacs is Emacs+Evil which is now an indivisible pair. Spacemacs
needed this stable API to continue on the right track.

While these changes should be rather transparent to the user, I'm sorry
for this experimental period, I failed to see all the implications of
such a change, I was just excited about the possibility to make Evil
optional. The reality is that Spacemacs has to embrace it and keep its
strong position on being Emacs+Evil at the core.

Implementation

- insert, motion and normal states are forced to emacs state using an
advice on `evil-insert-state`, `evil-motion-state` and
`evil-normal-state` respectively. These functions can be used freely in
the layer configuration.
- A new general hook `spacemacs-editing-style-hook` allow to hook any
code that need to be configured based on the editing style. Functions
hooked to this hook takes the current style as parameter, this
basically generalize the hook used to setup hjkl navigation bindings.
- ESC has been removed from the emacs state map.
- Revert unneeded changes
  - Revert "evil: enter insert-state only from normal-state"
    commit bdd702dfbe.
  - Revert "avoid being evil in deft with emacs editing style"
    commit f3a16f49ed.

Additional changes

All editing style packages have been moved to a layer called
`spacemacs-editing-styles`

Notes

I did not have time to attack hybrid mode, I should be able to do it
later.
2016-03-13 21:16:55 -04:00
Eivind Fonn 4ed7ebe49d Update previous comment 2016-02-27 14:56:42 +01:00
Andrew Cates b6a27e931b fix typo for js2-imenu extras mode 2016-02-27 14:56:21 +01:00
Alejandro Catalina bdd702dfbe evil: enter insert-state only from normal-state 2016-02-23 20:42:59 +01:00
Eivind Fonn e29ac21345 Register all REPLs and make SPC m ' bindings 2016-01-31 23:39:25 -05:00
Eivind Fonn e9f8377b92 Tweak flycheck loading process 2016-01-31 23:04:48 -05:00
syl20bnr ba403b2df1 javascript: improve REPL
- add send region
- add send and focus functions
- add toggle for livid-mode
- lazy start the http server
2016-01-21 11:52:47 -05:00
Daniel Luna c035bca52c Added JS repl via skewer-mode and livid-mode. 2016-01-21 11:52:47 -05:00
Balaji Sivaraman f63a2f4315 Link to official docs for setting config variables in JS layer readme 2016-01-18 00:33:01 -05:00
syl20bnr 046d86800c Clean copyrights and update for year 2016 2016-01-11 21:42:17 -05:00
Fabien Dubosson 36f09b1b77 [doc] Change org wrong quoting -> =…= 2016-01-09 21:56:18 +01:00
Michael Hauser-Raspe f3f6988f0a remove tern port files 2016-01-08 20:59:08 +01:00
syl20bnr cddf18ff1e Update install layer section in REAMDE.org files 2016-01-06 00:21:55 -05:00
Eivind Fonn ac0ba50154 Make flycheck/flyspell hooks more explicit 2015-12-11 02:08:55 -05:00
Eivind Fonn c893383fe4 Fix some documentation bugs
- CSS links
- GIFS in published version
- Unify layer doc titles
- Change emoji layer emojis to an image
2015-12-03 23:50:29 -05:00
Brenton Alker 94ae7b1b40 javascript: Declare prefix for "text" "move" menu 2015-11-27 10:32:51 +01:00
justbur 9befd20a1a layers: Transition to new key bindings functions
Removes dependence on evil-leader centralizing control over the method
of key binding in core-keybindings.el
2015-11-21 18:22:51 +01:00
Eivind Fonn c3866382b2 Documentation update
- Add #+HTML_HEAD_EXTRA options to all org files
- HTMLize published documentation via CSS
2015-11-13 14:23:13 +01:00
Eivind Fonn 13c5b1d24b Convert documentation to publishable format 2015-11-01 23:40:29 -05:00
Robert O'Connor a9716e3f79 add evil-matchit support for js files 2015-10-13 23:48:44 -04:00
Eivind Fonn 56ecd43753 Add variables to opt-in to flycheck/flyspell 2015-10-10 23:18:46 -04:00