Commit graph

177 commits

Author SHA1 Message Date
syl20bnr dbf1deaa4c c-c++: make it depends on gtags layer only if rtags are enabled 2018-01-11 00:02:02 -05:00
Richard Kim b57789176c fix cut-and-paste error by using correct function name
Use google-make-newline-indent rather than google-set-c-style.
2018-01-09 23:44:43 -05:00
syl20bnr 099872a61a c-c++: fix wrong-type-argument keymapp "q" when rtags support is on 2018-01-08 01:26:28 -05:00
syl20bnr 6932a337ee c-c++: refactor rtags support, key bindings, attempt ggtags fallback
- Move rtags key bindings under `SPC m g` prefix
- Document rtags support and key bindings in README.org
- attempt to implement gtags fallback using
  https://github.com/Andersbakken/rtags#fall-back-to-other-taggers
- make c-c++ layer dependend on gtags layer (gtags layer is automatically
  installed when the c-c++ layer is used)
- sort packages config in packages.el
- use a dolist instead of a function to define rtags key bindings
2018-01-06 02:44:33 -05:00
Alexander Dalshov 7a74ae105a c-c++ rtags: integration with evil 2018-01-06 01:30:59 -05:00
Alexander Dalshov bdcdc66c54 c-c++: add rtags integration 2018-01-06 01:30:59 -05:00
syl20bnr 51fb39aac8 c/c++: use clang-format-buffer and clang-format-region functions 2018-01-06 01:29:45 -05:00
Silver Chan 24e556941b fix problem: c-c++ layer variable
fix problem: c-c++ layer variable:clang-format-region-on-save invalid
2018-01-06 01:29:10 -05:00
Dela Anthonio 1d7198e3a7 c-c++: Fix clang format on save
Resolve #10041

The spacemacs/clang-format-buffer function doesn't exist. It should be replaced
with clang-format-buffer. This error was introduced in 01ddc98cef.
2018-01-06 01:01:29 -05:00
syl20bnr 326965d4ce Happy New Year 2018! 2018-01-04 02:00:25 -05:00
Fredrik Bergstrand 5ec172d7bd c-c++: Improve the header include auto completion
This change makes the c-c++ layer configure company-c-headers to search for and
list completion alternatives according to the priority list found in 'man gcc'.
If supported, the default system include paths are also fetched from gcc's
configuration instead of being hard coded to "/usr/include" and
"/usr/local/include". This also remedies the problem where the C++ standard
library headers does not show up as completion alternatives without manual
addition of include paths (see #4493, #8655).
2017-12-19 00:31:43 -05:00
Dela Anthonio 01ddc98cef c-c++: Add clang-format functions and key bindings
Solve part of #7628. Additionally, #7629 is no longer needed.

Add support for formatting lines, functions, and buffers with clang-format. Each
function produces a clear message on success.

The README was updated to reflect the usage of the new key bindings. References
to binding clang-format to the tab key were removed.
2017-12-19 00:25:20 -05:00
Evan Klitzke 77ee302f16 enable c++11 mode in company-clang-arguments if c-c++-enable-c++11 is not nil 2017-12-19 00:23:43 -05:00
Evan Klitzke 16fd3e85a4 add an option to use google-c-style 2017-12-19 00:20:00 -05:00
Alexander Dalshov 24827b6f08 c-c++ add option to control cmake-ide package 2017-12-18 23:51:28 -05:00
Richard Kim 7bab83c09e fixed a typo by moving one closing parenthesis 2017-12-18 23:49:13 -05:00
Robbert van der Helm c61ae1a1c1 Add ivy support to the gtags layer
It would be much better to have a single function for each layer that
initializes ggtags, helm-gtags and counsel-gtags for a mode.
2017-12-17 22:03:01 -05:00
smile13241324 d7995b985c Add remark for required project for "open matching file" commands 2017-10-15 11:19:52 -04:00
syl20bnr 7abda1c552 c-c++: minor updates to README.org 2017-08-27 22:18:53 -04:00
Alexander Dalshov 16c5ad8b96 c/c++ cmake-ide: add key bindings description and sample configuration. 2017-08-27 22:16:58 -04:00
Alexander Dalshov 690cf68315 Add cmake-ide to lang/c-c++ layer 2017-08-27 22:16:58 -04:00
J. Patrick Lanigan df7af0ad20 Fix features format in misc README.org's
See #9346
2017-08-22 21:27:13 +03:00
Dela Anthonio 8e3a59dbfd
c-c++: Refactor to reduce duplication
Instead of repeating actions for c-mode and c++-mode and their respective hooks,
let loop through each mode or hook to reduce duplication.
2017-08-01 16:45:12 +03:00
Dela Anthonio 3c8c28c4eb
c-c++: Declare "mg" prefix as "goto"
By convention, the "mg" prefix for all layers is "goto".
2017-07-29 22:00:19 +03:00
Eivind Fonn f4b53d2a4f Rename :depends to :requires 2017-07-03 09:54:53 +02: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 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 6c5a0b2b14 update docs to the new toc-org format 2017-05-22 18:35:37 +03:00
Swaroop C H 80d2a0d99d [docs] Fix parentheses 2017-05-14 22:06:08 -04:00
syl20bnr 7d215cb089 c-c++: move realgud config to c-c++ layer and delete debug layer
For now realug is used only to C and C++ so it makes more sense to add it to
the c-c++ layer for now.
Later if we can generalize the support of realgud for other languages and we
can start a debugger layer.
2017-05-14 13:20:10 -04:00
JAremko f805d0ebd9 Fix spacefmt test on deleted files
Also fix some links
[ci skip]
2017-04-28 23:29:43 -04:00
syl20bnr a7b7e1c168 c-c++: Rename functions with spacemacs- prefix
Respect 80 chars per line
2017-04-09 17:55:50 -04:00
syl20bnr cc61e08b30 Allow usage of dir-local variable for c-c++-enable-clang-format-on-save 2017-04-09 17:50:21 -04:00
Robbert van der Helm 91a2ca456f Add automatic formatting on save for C++ using ClangFormat
This can be enabled by setting both `c-c++-enable-clang-format-on-save` and
`c-c++-enable-clang-support` to `t`.
2017-04-09 17:41:44 -04:00
syl20bnr f45ce1a88e syntax-checking: rename function add-flycheck-hook to enable-flycheck
spacemacs/add-flycheck-hook was not really hooking anything, change the name
to better reflect what it does.
Also changed the push for a add-to-list to avoid duplicates.
2017-03-19 12:40:36 -04:00
Eivind Fonn 3bbeaee2b2 Don’t configure company in init-cmake-mode
This is already taken care of in post-init-company
2017-01-06 12:01:18 +01:00
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
Jacob Lewallen cbb195141c Match entire path after -I for passing to expand-file-name.
Otherwise I was seeing these transformations:

invocation-dir = C:/Some/Directory

-I../another/directory
-IC:/another/directory

Became

-Ic:/Some/Directory./another/directory
-IC:/SOME/DIRECTORY/C:/another/directory
2016-10-17 20:11:49 +02:00
syl20bnr 9066d073b2 Fix (void-variable spacemacs-jump-handlers-....)
Move the variable definitions to config.el and eval-after-load the
key binding on SPC m g g.
2016-09-04 22:31:47 -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
deb0ch 0191a81ad2 fix c-c++/post-init-ycmd: activate ycmd-mode in c files as well.
fix jump to definition refactor
2016-08-24 18:17:31 +02:00
Eivind Fonn 734c87fb24 Don’t break asynchronous jumpers (fix #6898) 2016-08-24 13:11:57 +02: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
deb0ch 9c4a0657d0 activate ycmd-mode in c files as well
ycmd-mode was only activated when entering c++-mode, making syntax
checking unavailable in c-mode, as flycheck-ycmd-mode is hooked to
ycmd-mode.
2016-08-17 20:21:50 +02:00
Christian E. Hopps b22702bc9e Expand gtags use to many more languages 2016-07-17 17:31:59 +02: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
syl20bnr 1f993bddf6 Rename spacemacs-helm and spacemacs-ivy layers to helm and ivy
For ivy users: be sure to update your dotfile by replacing spacemacs-ivy
by ivy
2016-05-15 22:24:27 -04:00
Steven Allen 9f48b951db Fix file extension matching for filenames with newlines
- "\\.ext$" matches both "abc.ext" and "abc.ext\nsomething".
- "\\.ext\\'" matches only "abc.ext".
2016-04-29 22:16:49 -04:00
syl20bnr 3b0c1fd93d Convert org doc files with doc-fmt 2016-03-30 22:59:55 -04:00
syl20bnr 6b5ed8245b c-c++: fix c-c++/post-init-semantic 2016-03-10 23:13:19 -05:00
Eivind Fonn 411be27ed1 Remove enable-semantic-mode function
- No reason to require semantic manually
- Don't set submodes in a hook function (hard to change for user)
2016-03-10 23:13:19 -05:00
Eivind Fonn 0ca02549dc Move srefactor toggle to owning layer 2016-03-10 23:13:19 -05:00
Tu Do ceafd688f3 srefactor requires Emas 24.4 or above, not older 2016-03-10 14:22:06 +01:00
Eivind Fonn cdd404bbeb Use :toggle for srefactor 2016-02-23 20:38:50 +01:00
Magnus Therning 0455f215a0 c-c++: Add notes on related layers.
Signed-off-by: Magnus Therning <magnus@therning.org>
2016-02-23 20:37:16 +01:00
Magnus Therning fe99ad671e c-c++: Remove srefactor from static package list.
It should only be added to the list if emacs version > 24.4.

Signed-off-by: Magnus Therning <magnus@therning.org>
2016-02-23 20:37:16 +01:00
Magnus Therning 6e64e08f06 c-c++: Set paths for C headers from clang.
Signed-off-by: Magnus Therning <magnus@therning.org>
2016-02-23 20:37:16 +01:00
Eivind Fonn f94263919b Fix previous commit 2016-02-04 19:31:47 +01:00
Eivind Fonn 1df4cfe206 Get clang args even if flycheck isn't installed 2016-02-04 14:09:35 +01:00
Eivind Fonn e9f8377b92 Tweak flycheck loading process 2016-01-31 23:04:48 -05:00
fenxian 1ce399d24f Fix key binding part in c-c++/README.org 2016-01-13 00:12:45 -05:00
syl20bnr 046d86800c Clean copyrights and update for year 2016 2016-01-11 21:42:17 -05:00
justbur b0ee301845 layers: Conditionally load helm packages
Only use them when the spacemacs-helm layer is used.
2016-01-09 13:36:03 -05: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 98c07024f9 Fix flycheck clang args loading (zhengyangfeng00) 2015-12-09 12:35:06 +01:00
Eivind Fonn 549219e583 Fix C/C++ flycheck hooks 2015-12-09 12:18:20 +01: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
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
Eivind Fonn 56ecd43753 Add variables to opt-in to flycheck/flyspell 2015-10-10 23:18:46 -04:00
syl20bnr 383b1bec20 Update dotspacemacs/config and dotspacemacs/init occurrences 2015-09-28 02:05:18 -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