Spacemacs is a volunteer effort. We encourage you to pitch in. The community makes Spacemacs what it is. We have a few guidelines, which we ask all contributors to follow.
You can only consider reading the sections relevant to what you are going to do:
Thanks!
README.org
of the relevant layer(s).If your question is not answered there, then please come into our gitter chat to discuss it with us . We will direct you to a solution, or ask you to open an issue if it is needed.
develop
version of Spacemacs.
develop
branch and trying
to reproduce the bug here. You can also check at the source code to see if
it has been changed/corrected.SPC h d s
(M-m h d s
in Emacs style), which gives the
versions information about your installation.org-mode
, etc…).The license is GPLv3
for all parts specific to Spacemacs, this includes:
For files not belonging to Spacemacs like local packages and libraries, refer to the header file. Those files should not have an empty header, we may not accept code without a proper header file.
Spacemacs is based on conventions, mainly for naming functions, keybindings definition and writing documentation. Please read the CONVENTIONS.org file before your first contribution to get to know them.
Submit your contribution against the develop
branch. You should not use
your master
branch to modify Spacemacs, this branch is considered to be
read-only.
You may want to read our beginner’s guide for Pull Requests.
PR = Pull-Request
develop
develop
before submitting
the PRThose PRs are usually cherry-picked.
Those PRs are merged and explicitly not fast-forwarded.
Write commit messages according to adapted Tim Pope’s guidelines:
This is a model commit message:
Capitalized, short (72 chars or less) summary More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together. Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug." This convention matches up with commit messages generated by commands like git merge and git revert. Further paragraphs come after blank lines. - Bullet points are okay, too - Typically a hyphen or asterisk is used for the bullet, followed by a single space, with blank lines in between, but conventions vary here - Use a hanging indent
Git Commit and Magit provide Emacs mode for Git commit messages, which helps you to comply to these guidelines.
Please read the layers documentation first.
It is recommended to use the configuration-layer/create-layer
command in order
to create a layer, as it will take care of using the files templates and will
also create the file headers correctly.
Contributed configuration layers are stored in the layers/
folder. The
layers/
folder also contains categories prefixed with +
to put your layers
in. For example a layer for a language would go in the layers/+lang/
folder.
Layer with no associated configuration will be rejected. For instance a layer
with just a package and a hook can be easily replaced by the usage of the
variable dotspacemacs-additional-packages
.
The file header for elisp
files should look like the following template:
;;; FILENAME --- NAME Layer packages File for Spacemacs ;; ;; Copyright (c) 2012-2017 Sylvain Benner & Contributors ;; ;; Author: YOUR_NAME <YOUR_EMAIL> ;; URL: https://github.com/syl20bnr/spacemacs ;; ;; This file is not part of GNU Emacs. ;; ;;; License: GPLv3
You should replace FILENAME
by the name of the file (e.g. packages.el
)
and NAME
by the name of the layer you are creating, don’t forget to replace
YOUR_NAME
and YOUR_EMAIL
also. Some files already have a template inside
core/templates/
, so look in there first.
Note that if you use configuration-layer/create-layer
, spacemacs will prepare
files and headers for you, and for free !
In the files header, change the default author name (Sylvain Benner
) to your
name.
If you are contributing to an already existing layer, you should not modify any header file.
Keybindings are an important part of spacemacs.
First if you want to have some personal keybindings, you can freely bind them
inside the SPC o
and SPC m o
prefixes which are reserved for the user. This
can be done from the dotspacemacs/user-config
function of your .spacemacs
file and don’t require any contribution to Spacemacs.
If you think it worth contributing a new key bindings then be sure to read the CONVENTIONS.org file to find the best key bindings, then create a Pull-Request with your changes.
ALWAYS document your new keybindings or keybindings changes inside the
relevant documentation file. It should be the layer’s README.org
file for
layer’s keybindings, or DOCUMENTATION.org
for general Spacemacs key
bindings.
The startup banner is by default the Spacemacs logo but there are also ASCII
banners available in the directory core/banners/
.
If you have some ASCII skills you can submit your artwork!
You are free to choose a reasonable height size but the width size should be around 75 characters.
Tests live in the tests/
folder, with a folder structure corresponding to the
rest of the repository.
To run tests locally, navigate to the relevant subfolder and run make
.
Spacemacs uses Travis CI to perform more comprehensive testing, where each testable layer is enabled in turn.
To add tests for a layer, do the following:
tests/
corresponding to the layer you want to test.dotspacemacs.el
in that folder. It should be a minimal
dotfile that enables the layer in question (and other layers it may depend
on).Makefile
in that folder. It should define three variables.
LOAD_FILES
init.el
.UNIT_TEST_FILES
FUNC_TEST_FILES
See existing tests for examples.
TEST_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
LOAD_FILES = ...
UNIT_TEST_FILES = ...
FUNC_TEST_FILES = ...
include ../../spacemacs.mk
travis/run_build.sh
.This CONTRIBUTING.org
file is partially based on the Rails Contribution
guidelines and Flycheck Contribution guidelines.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。