spacemacs/layers/+lang/emacs-lisp
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
..
img better-defaults layer: update emacs logo 2016-10-17 13:34:40 +02:00
config.el Refactor and simplify company backends declaration 2017-01-02 00:39:04 -05:00
funcs.el emacs-lisp: fix eval-last-sexp and add SPC m e C 2016-12-24 12:06:17 -05:00
packages.el Refactor and simplify company backends declaration 2017-01-02 00:39:04 -05:00
README.org emacs-lisp: fix eval-last-sexp and add SPC m e C 2016-12-24 12:06:17 -05:00

Emacs Lisp layer

/TakeV/spacemacs/media/commit/74fdbb6795018a93a665fa2c417589cd4cbd51fc/layers/+lang/emacs-lisp/img/emacs.png

Description

This layer gathers all the configuration related to emacs-lisp. This should always be in your dotfile, it is not recommended to uninstall it.

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add emacs-lisp to the existing dotspacemacs-configuration-layers list in this file.

Auto-compile

This layer adds the auto-compile package to automatically keep the byte-compiled version of your Emacs lisp files synced with the uncompiled version on every save. If there are any compiler errors in the file, you will see a counter show up in the mode line. You can hover over these numbers to get a description or view the compiler output with the SPC m c l key binding. To disable the feature use this line in your dotspacemacs/user-config function.

  (remove-hook 'emacs-lisp-mode-hook 'auto-compile-mode)

You can also exclude the auto-compile package.

Working with lisp files (barfage, slurpage & more)

Spacemacs comes with a special lisp-state for working with lisp code that supports slurpage, barfage and more tools you'll likely want when working with lisp.

As this state works the same for all files, the documentation is in global DOCUMENTATION.org. In general, use SPC k to interact with the lisp-state.

Key bindings

Key Binding Description
SPC m g g go to definition of symbol under point
SPC m h h describe symbol at point
SPC m c c byte compile the current file
SPC m c l popup compile-log buffer
SPC m e $ or SPC m e l go to end of current line and evaluate
SPC m e b evaluate current buffer
SPC m e C evaluate current defun or setq
SPC m e e evaluate sexp before point
SPC m e f evaluation current function
SPC m e r evaluate current region
SPC m , toggle lisp state
SPC m t b run tests of current buffer
SPC m t q run ert
SPC m d m open macrostep transient-state

smartparens

If smartparens is used the following additional key bindings are available:

Key Binding Description
SPC m e c evaluate sexp around point
SPC m e s evaluate symbol around point

srefactor

The semantic layer should be installed for these key bindings to become active.

Key Binding Description
SPC m = b format current buffer
SPC m = f format current function
SPC m = o format all on one line
SPC m = s format current sexp