]> code.delx.au - gnu-emacs/blob - CONTRIBUTE
Merge branch 'master' into xwidget
[gnu-emacs] / CONTRIBUTE
1 Copyright (C) 2006-2014 Free Software Foundation, Inc.
2 See end for license conditions.
3
4
5 Contributing to Emacs
6
7 Emacs is a collaborative project and we encourage contributions from
8 anyone and everyone. If you want to contribute in the way that will
9 help us most, we recommend (1) fixing reported bugs and (2)
10 implementing the feature ideas in etc/TODO. However, if you think of
11 new features to add, please suggest them too -- we might like your
12 idea. Porting to new platforms is also useful, when there is a new
13 platform, but that is not common nowadays.
14
15 For documentation on Emacs (to understand how to implement your
16 desired change), refer to:
17
18 - the Emacs Manual
19 http://www.gnu.org/software/emacs/manual/emacs.html
20 (info "(Emacs)Top")
21
22 - the Emacs Lisp Reference Manual
23 http://www.gnu.org/software/emacs/manual/elisp.html
24 (info "(elisp)Top")
25
26 - http://www.gnu.org/software/emacs
27
28 - http://www.emacswiki.org/
29
30 There are many ways to contribute to Emacs:
31
32 - implement a new feature, and submit a patch (see "Submitting
33 Patches" below).
34
35 - answer questions on the Emacs user mailing list
36 https://lists.gnu.org/mailman/listinfo/help-gnu-emacs
37
38 - write documentation, either on the wiki, or in the Emacs source
39 repository (see "Submitting Patches" below)
40
41 - find and report bugs; use M-x report-emacs-bug
42
43 - check if existing bug reports are fixed in newer versions of Emacs
44 http://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=emacs
45
46 - develop a package that works with Emacs, and publish it on your own
47 or in Gnu ELPA (see admin/notes/elpa).
48
49 Here are some style and legal conventions for contributors to Emacs:
50
51
52 * Coding Standards
53
54 Contributed code should follow the GNU Coding Standards
55 (http://www.gnu.org/prep/standards/ - may also be available in info on
56 your system).
57
58 If it doesn't, we'll need to find someone to fix the code before we
59 can use it.
60
61 Emacs has additional style and coding conventions:
62
63 - the "Tips" Appendix in the Emacs Lisp Reference
64 http://www.gnu.org/software/emacs/manual/html_node/elisp/Tips.html
65 (info "(elisp)Tips").
66
67 - Avoid using `defadvice' or `eval-after-load' for Lisp code to be
68 included in Emacs.
69
70 - Remove all trailing whitespace in all source and text files.
71
72 - Emacs has no convention on whether to use tabs in source code;
73 please don't change whitespace in the files you edit.
74
75 - Use ?\s instead of ? in Lisp code for a space character.
76
77 * Copyright Assignment
78
79 The FSF (Free Software Foundation) is the copyright holder for GNU Emacs.
80 The FSF is a nonprofit with a worldwide mission to promote computer
81 user freedom and to defend the rights of all free software users.
82 For general information, see the website http://www.fsf.org/ .
83
84 Generally speaking, for non-trivial contributions to GNU Emacs we
85 require that the copyright be assigned to the FSF. For the reasons
86 behind this, see: http://www.gnu.org/licenses/why-assign.html .
87
88 Copyright assignment is a simple process. Residents of some countries
89 can do it entirely electronically. We can help you get started, and
90 answer any questions you may have (or point you to the people with the
91 answers), at the emacs-devel@gnu.org mailing list.
92
93 (Please note: general discussion about why some GNU projects ask
94 for a copyright assignment is off-topic for emacs-devel.
95 See gnu-misc-discuss instead.)
96
97 A copyright disclaimer is also a possibility, but we prefer an assignment.
98 Note that the disclaimer, like an assignment, involves you sending
99 signed paperwork to the FSF (simply saying "this is in the public domain"
100 is not enough). Also, a disclaimer cannot be applied to future work, it
101 has to be repeated each time you want to send something new.
102
103 We can accept small changes (roughly, fewer than 15 lines) without
104 an assignment. This is a cumulative limit (e.g. three separate 5 line
105 patches) over all your contributions.
106
107 * Getting the Source Code
108
109 The current working version of the Emacs source code is stored in a
110 git repository on the Savannah web site
111 (http://savannah.gnu.org/projects/emacs). It is important to write
112 your patch based on the current working version. If you start from an
113 older version, your patch may be outdated (so that maintainers will
114 have a hard time applying it), or changes in Emacs may have made your
115 patch unnecessary.
116
117 After you have downloaded the repository source, you should read the file
118 INSTALL.REPO for build instructions (they differ to some extent from a
119 normal build).
120
121 * Submitting Patches
122
123 Every patch must have several pieces of information before we
124 can properly evaluate it.
125
126 When you have all these pieces, bundle them up in a mail message and
127 send it to the developers. Sending it to bug-gnu-emacs@gnu.org
128 (which is the bug/feature list) is recommended, because that list
129 is coupled to a tracking system that makes it easier to locate patches.
130 If your patch is not complete and you think it needs more discussion,
131 you might want to send it to emacs-devel@gnu.org instead. If you
132 revise your patch, send it as a followup to the initial topic.
133
134 ** Description
135
136 For bug fixes, a description of the bug and how your patch fixes it.
137
138 For new features, a description of the feature and your implementation.
139
140 ** ChangeLog
141
142 A ChangeLog entry as plaintext (separate from the patch).
143
144 See the existing ChangeLog files for format and content. Note that,
145 unlike some other projects, we do require ChangeLogs for
146 documentation, i.e. Texinfo files.
147
148 Ref: "Change Log Concepts" node of the GNU Coding Standards Info
149 Manual, for how to write good log entries.
150 http://www.gnu.org/prep/standards/html_node/Change-Log-Concepts.html
151
152 When using git, commit messages should use ChangeLog format, with a
153 single short line explaining the change, then an empty line, then
154 unindented ChangeLog entries. (Essentially, a commit message should
155 be a duplicate of what the patch adds to the ChangeLog files. We are
156 planning to automate this better, to avoid the duplication.) You can
157 use the Emacs functions log-edit-add-to-changelog or
158 log-edit-insert-changelog to ease this process.
159
160 ** The patch itself.
161
162 If you are accessing the Emacs repository, make sure your copy is
163 up-to-date (e.g. with 'git pull'). You can commit your changes
164 to a private branch and generate a patch from the master version
165 by using
166 git format-patch master
167 Or you can leave your changes uncommitted and use
168 git diff
169 With no repository, you can use
170 diff -u OLD NEW
171
172 ** Mail format.
173
174 We prefer to get the patches as plain text, either inline (be careful
175 your mail client does not change line breaks) or as MIME attachments.
176
177 ** Please reread your patch before submitting it.
178
179 ** Do not mix changes.
180
181 If you send several unrelated changes together, we will ask you to
182 separate them so we can consider each of the changes by itself.
183
184 ** Do not make formatting changes.
185
186 Making cosmetic formatting changes (indentation, etc) makes it harder
187 to see what you have really changed.
188
189
190 * Supplemental information for Emacs Developers.
191
192 An "Emacs Developer" is someone who contributes a lot of code or
193 documentation to the Emacs repository.
194
195 ** Write access to the Emacs repository.
196
197 Once you become a frequent contributor to Emacs, we can consider
198 giving you write access to the version-control repository. Request
199 access on the emacs-devel@gnu.org mailing list.
200
201 ** Using the Emacs repository
202
203 Emacs uses git for the source code repository.
204
205 See http://www.emacswiki.org/emacs/GitQuickStartForEmacsDevs to get
206 started, and http://www.emacswiki.org/emacs/GitForEmacsDevs for more
207 advanced information.
208
209 Alternately, see admin/notes/git-workflow.
210
211 If committing changes written by someone else, make the ChangeLog
212 entry in their name, not yours. git distinguishes between the author
213 and the committer; use the --author option on the commit command to
214 specify the actual author; the committer defaults to you.
215
216 ** Changelog notes
217
218 - Emacs generally follows the GNU coding standards when it comes to
219 ChangeLogs:
220 http://www.gnu.org/prep/standards/html_node/Change-Logs.html . One
221 exception is that we still sometimes quote `like-this' (as the
222 standards used to recommend) rather than 'like-this' (as they do
223 now), because `...' is so widely used elsewhere in Emacs.
224
225 - There are multiple ChangeLogs in the emacs source; roughly one per
226 high-level directory. The ChangeLog entry for a commit belongs in the
227 lowest ChangeLog that is higher than or at the same level as any file
228 changed by the commit.
229
230 - Preferred form for several entries with the same content:
231
232 * help.el (view-lossage):
233 * kmacro.el (kmacro-edit-lossage):
234 * edmacro.el (edit-kbd-macro): Fix docstring, lossage is now 300 keys.
235
236 (Rather than anything involving "ditto" and suchlike.)
237
238 - In ChangeLog files, there is no standard or recommended way to
239 identify revisions.
240
241 One way to identify revisions is by quoting their summary line.
242 Another is with an action stamp - an RFC3339 date followed by !
243 followed by the committer's email - for example,
244 "2014-01-16T05:43:35Z!esr@thyrsus.com". Often, "my previous commit"
245 will suffice.
246
247 - There is no need to make separate change log entries for files such
248 as NEWS, MAINTAINERS, and FOR-RELEASE, or to indicate regeneration
249 of files such as 'configure'. "There is no need" means you don't
250 have to, but you can if you want to.
251
252 ** branches
253
254 Development normally takes places on the trunk.
255 Sometimes specialized features are developed on separate branches
256 before possibly being merged to the trunk.
257
258 Development is discussed on the emacs-devel mailing list.
259
260 Sometime before the release of a new major version of Emacs a "feature
261 freeze" is imposed on the trunk, to prepare for creating a release
262 branch. No new features may be added to the trunk after this point,
263 until the release branch is created. This freeze is announced on the
264 emacs-devel mailing list, and not anywhere else.
265
266 The trunk branch is named "master" in git; release branches are named
267 "emacs-nn" where "nn" is the major version.
268
269 You must follow emacs-devel to know exactly what kinds of changes are
270 allowed on what branch at any time. Announcements about the freeze
271 (and other important events) will contain "ANNOUNCE" in the subject.
272
273 If you are fixing a bug that exists in the current release, be sure to
274 commit it to the release branch; it will be merged to the master
275 branch later.
276
277 However, if you know that the change will be difficult to merge to the
278 trunk (eg because the trunk code has changed a lot), you can apply the
279 change to both trunk and branch yourself. Indicate in the release
280 branch commit log that there is no need to merge the commit to the
281 trunk; start the commit message with "Backport:". gitmerge.el will
282 then exclude that commit from the merge to trunk.
283
284
285 ** Other process information
286
287 See all the files in admin/notes/* . In particular, see
288 admin/notes/newfile, see admin/notes/repo.
289
290 ** Emacs Mailing lists.
291
292 Discussion about Emacs development takes place on emacs-devel@gnu.org.
293
294 Bug reports and fixes, feature requests and implementations should be
295 sent to bug-gnu-emacs@gnu.org, the bug/feature list. This is coupled
296 to the tracker at http://debbugs.gnu.org .
297
298 You can subscribe to the mailing lists, or see the list archives,
299 by following links from http://savannah.gnu.org/mail/?group=emacs .
300
301 ** Document your changes.
302
303 Any change that matters to end-users should have an entry in etc/NEWS.
304
305 Think about whether your change requires updating the documentation
306 (both manuals and doc-strings). If you know it does not, mark the NEWS
307 entry with "---". If you know that *all* the necessary documentation
308 updates have been made, mark the entry with "+++". Otherwise do not mark it.
309
310 ** Understanding Emacs Internals.
311
312 The best way to understand Emacs Internals is to read the code,
313 but the nodes "Tips" and "GNU Emacs Internals" in the Appendix
314 of the Emacs Lisp Reference Manual may also help.
315
316 The file etc/DEBUG describes how to debug Emacs bugs.
317
318
319 \f
320 This file is part of GNU Emacs.
321
322 GNU Emacs is free software: you can redistribute it and/or modify
323 it under the terms of the GNU General Public License as published by
324 the Free Software Foundation, either version 3 of the License, or
325 (at your option) any later version.
326
327 GNU Emacs is distributed in the hope that it will be useful,
328 but WITHOUT ANY WARRANTY; without even the implied warranty of
329 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
330 GNU General Public License for more details.
331
332 You should have received a copy of the GNU General Public License
333 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
334 \f
335 Local variables:
336 mode: outline
337 paragraph-separate: "[ \f]*$"
338 end: