Commit graph

27 commits

Author SHA1 Message Date
syl20bnr 63e1db9923 clojure: move command prefix names and remove some duplicated code 2016-04-03 00:27:44 -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
Fabien Dubosson b9cd9c1cd8 Remove rainbow-delimiters-mode from mode-specific hooks
`spacemacs` now handles `rainbow-delimiters-mode` by adding it to the
`prog-mode-hook`, if wanted by the user. Some layers are adding it on
their own mode-hook, having for effect that `rainbow-delimiters-mode` is
called twice, which disable it.

This commit remove these layer-specific definitions of
`rainbow-delimiters` as it is now handled by the `spacemacs`
distribution. It also takes care of running `prog-mode-hook` in modes
that are not derived from it.

Fixes #3902
2016-03-09 20:23:29 -05:00
Malchevskiy Misha d91d907d5d Fix cider-pop-back function name
Alias `cider-jump-back` was deprecated and then removed from CIDER here: 705133f2bd
2016-03-04 16:06:08 -05:00
Alejandro Catalina Feliú d3833db77b clojure: add clojure-snippets to clojure layer
This will add some nice snippets right out of the box.
2016-03-03 20:54:06 +01:00
Patrik Plihal 097887104f add 'cider-apropos functionalty to clojure layer 2016-02-25 20:31:31 +01:00
mahinshaw 8029222b26 Add mapping for switching between repl connections. 2016-02-23 20:51:07 +01:00
Alejandro Catalina bdd702dfbe evil: enter insert-state only from normal-state 2016-02-23 20:42:59 +01:00
Alejandro Catalina d68542e7da cider: yet another missed occurrence 2016-02-18 23:30:38 -05:00
Alejandro Catalina 7d2181bd47 fix renamed cider-test-run-tests function
The function was renamed in recent commit to cider-test-run-ns-test, see
568263143b (diff-f8e2b8e5fa0f8c5cda946e72ab461994R572)
for more info.
2016-02-16 23:05:05 -05:00
justbur aab007d225 evil-jumper: Remove obsolete package
The functionality is now incorporated into the evil core and this
package has been marked as obsolete.
2016-02-16 21:23:07 -05:00
Eivind Fonn e29ac21345 Register all REPLs and make SPC m ' bindings 2016-01-31 23:39:25 -05:00
Martino Visintin a5fdf43845 substitute align-cljlet with clojure-align
align-cljlet was deprecated in favour of the vertical alignment in the
clojure-mode package.
2016-01-31 23:04:48 -05:00
Ernestas Lisauskas e2be2b9a37 Remove Clojure indentation rules
1. There is a new syntax for the indentation rules.
2. These rules are library specific and not from the core language.
2016-01-18 00:05:42 -05:00
Diego Berrocal 877fc32eb7 Add Align-cljlet function to Clojurescript mode
Derived modes don't inherit evil keybindings from their parents, this is
interesting to note, also it would be so great if we could have a
`set-leader-keys` macro that could take a list of modes as well.
2016-01-03 22:23:13 -05:00
justbur 0b02475772 Use built-in evil functions to set default states
evil-set-initial-state is safer than manually adding and deleting from
the lists, because it knows about all available states and ensures that
the mode only shows up in one list. If it is in multiple list the
initial state depends on which is checked first, which we don't want.
2015-12-21 00:22:18 -05:00
Chris Perkins 57fd8b2504 clojure: use cljr--all-helpers for refactorings
clj-refactor defines a list of all available refactorings, along with
the standard two-letter keybindings. Use it, so that spacemacs will get
any added refactorings for free, with no code-change needed in the
clojure layer.
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 e7fbc84ff0 Remove package guards for evilified
See discussion in #3879
2015-11-21 11:07:14 +01:00
justbur b294461957 evilified-state: Make into local package 2015-11-18 23:35:01 -05:00
person808 c1b6293268 Replace eval-after-load with with-eval-after-load.
We now backport the macro for 24.3 so we can use it everywhere.
2015-10-07 15:51:39 -04:00
immortalin d8b3abfa8f Added keybinding for cider-format-buffer. 2015-10-02 13:40:38 +02:00
Eivind Fonn e8f146acfb Fix cljr-extract-def binding and update README 2015-10-02 13:40:30 +02:00
Markus Bertheau f5ca69f059 Add key binding for cljr-extract-def and prefix declarations for clojure 2015-10-02 13:36:23 +02:00
Benjamin Albrecht 7f0c32a2d0 Add keybinding for cider-jack-in-clojurescript
as described in https://github.com/clojure-emacs/cider#clojurescript-usage
2015-10-02 13:35:48 +02:00
luxbock 7b404f46c6 clojure: various tweaks
- Add missing leader prefixes
- Stop using deprecated cider-jump-to-var (Use cider-find-var instead)
- Add toggle for indentation style in clojure-mode
- Remove cider-debug-defun-at-point in repl leader (It doesn't do
  anything other than messing up the buffer)
- Add spacemacs/cider-display-error-buffer
- Gives faster access to display the last error buffer.
2015-09-13 23:01:15 -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
Renamed from layers/!lang/clojure/packages.el (Browse further)