SXEmacs v22.1.17 is released!
[sxemacs] / info / sppm.texi
1 \input texinfo
2 @c %**start of header
3 @setfilename sppm.info
4 @settitle SXEmacs Policies & Procedures Manual
5 @finalout
6 @setchapternewpage on
7 @c %**end of header
8
9 @c Define a macro or 2 (abbrevs)
10 @macro sy
11 Steve Youngs
12 @end macro
13
14 @macro s
15 Steve
16 @end macro
17
18 @macro syc
19 Copyright @copyright{} 2004 - 2020 @sy{}
20 @end macro
21
22 @macro sye
23 @email{steve@@sxemacs.org, @sy{}}
24 @end macro
25
26 @macro cver
27 22.1.17
28 @end macro
29
30 @macro nver
31 22.1.18
32 @end macro
33
34
35 @set EDITION First
36 @set UPDATED June 13, 2015
37
38 @c Things would be a lot easier if everything supported the `@copying'
39 @c command, I wouldn't have to put in these conditionals.  --SY.
40 @ifnottex
41 @copying
42 This is the SXEmacs Policies & Procedures Manual.
43 It was last updated @value{UPDATED}.
44
45 @syc{}.
46
47 @quotation
48 Permission is granted to copy, distribute and/or modify this document
49 under the terms of the GNU General Public Licence, Version 2.
50
51 Permission is granted to copy and distribute translations of this manual
52 into another language, under the above conditions for modified versions.
53 @end quotation
54
55 @ignore
56 Permission is granted to process this file through Tex and print the
57 results, provided the printed document carries copying permission
58 notice identical to this one except for the removal of this paragraph
59 (this paragraph not being relevant to the printed manual).
60 @end ignore
61 @end copying
62 @end ifnottex
63
64 @dircategory SXEmacs Development
65 @direntry
66 * SPPM::                        SXEmacs Policies & Procedures Manual.
67 @end direntry
68
69 @titlepage
70 @title SXEmacs Policies & Procedures Manual
71 @subtitle @value{EDITION} edition, last updated on @value{UPDATED}.
72 @vskip 0pt plus 1filll
73 @ifnottex
74 @insertcopying
75 @end ifnottex
76 @iftex
77 This is the SXEmacs Policies & Procedures Manual.
78 It was last updated @value{UPDATED}.
79
80 @syc{}.
81
82 @quotation
83 Permission is granted to copy, distribute and/or modify this document
84 under the terms of the GNU General Public Licence, Version 2.
85
86 Permission is granted to copy and distribute translations of this manual
87 into another language, under the above conditions for modified versions.
88 @end quotation
89
90 @ignore
91 Permission is granted to process this file through Tex and print the
92 results, provided the printed document carries copying permission
93 notice identical to this one except for the removal of this paragraph
94 (this paragraph not being relevant to the printed manual).
95 @end ignore
96 @end iftex
97 @author by @sye{}
98 @end titlepage
99 @c Set up the headers and footers for the printed output (postscript).
100 @headings off
101 @everyheading @thischapter @|@| @thispage
102 @everyfooting @thistitle @|@| @syc{}
103
104 @contents
105
106 @node Top, Mission Statement, (dir), (dir)
107
108 @ifinfo
109 This is the @value{EDITION} edition of the @cite{SXEmacs Policies & Procedures Manual}
110 @end ifinfo
111
112 @ifnottex
113 @insertcopying
114 @end ifnottex
115
116 This document, as its name implies, is directed towards anyone who is
117 actively involved (or thinking of becoming actively involved) in the
118 development of @uref{https://www.sxemacs.org/, SXEmacs}.
119
120 @menu
121 * Mission Statement::           Why we do what we do
122 * Online Presence::             Where we make our first impressions
123 * Dispute Resolution::          Arguments can be resolved
124 * Coding Style::                Making sure your code looks like our code
125 * Patches::                     Handling contributed code/docs
126 * Feature Requests::            Dealing with feature requests
127 * Support Requests::            Handling support requests
128 * Bug Reports::                 Dealing with bug reports
129 * Making Releases::             Getting the finished product to the user
130 * New Features::                Getting new stuff into the code base
131 * Compatibility::               With XEmacs and GNU/Emacs
132 * Copyright and Licencing::     We won't accept just any old licence
133 * Developer Recruitment::       How to get new blood
134 * Making/Altering Policies::    Changing or updating this document
135 * Version Control::             How we keep track of the source
136 * Concept Index::               Concept Index
137 @end menu
138
139 @node Mission Statement, Online Presence, Top, Top
140 @chapter SXEmacs Mission Statement
141 @cindex mission statement
142 @cindex motivation
143 @cindex drive
144
145 Our mission is to@dots{}
146
147 @quotation
148 To provide the Open Source community with a text editing and development
149 environment that is based on XEmacs and is 2nd to none in regards to
150 stability, features, and innovation.
151
152 To foster a user and developer friendly project environment.
153
154 And, above all, to have fun doing it.
155 @end quotation
156
157 @node Online Presence, Dispute Resolution, Mission Statement, Top
158 @comment  node-name,  next,  previous,  up
159 @chapter SXEmacs' Online Presence
160 @cindex http
161 @cindex www
162 @cindex web
163 @cindex online
164 @cindex ftp
165 @cindex sxemacs online
166 @cindex online, sxemacs
167
168 The SXEmacs project maintains a number of @dfn{online} services.
169 Including@dots{}
170
171 @itemize @bullet
172 @item
173 @uref{https://www.sxemacs.org/, The SXEmacs Web Site}
174 @item
175 @uref{https://downloads.sxemacs.org/, Release and Snapshot Tarballs}
176 @item
177 @uref{irc://irc.freenode.net/#sxemacs, The SXEmacs IRC channel}
178 @item
179 @uref{https://issues.sxemacs.org/, The SXEmacs Issue Tracker} @ref{Bug Reports}
180 @ref{Feature Requests} @ref{Support Requests}.
181 @item
182 @uref{http://store.sxemacs.org/, SXEmacs Merchandise}
183 @end itemize
184
185 @menu
186 * Web Site::                    Our shop front
187 * Download Site::               Where we keep the tarballs
188 * IRC::                         For those who like to talk about it
189 * Merchandise::                 Got the software@dots{} Get the T-Shirt
190 @end menu
191
192 @node Web Site, Download Site, Online Presence, Online Presence
193 @comment  node-name,  next,  previous,  up
194 @chapter SXEmacs Web Site
195 @cindex web
196 @cindex http
197 @cindex www.sxemacs.org
198
199 The SXEmacs web site content is kept under the same version control
200 system as SXEmacs itself @ref{Version Control}.  That means that
201 anyone can submit changes and updates to the site in the same manner
202 that they would for code submissions to SXEmacs @xref{Patches}.
203
204 There's really not much more to tell about the web site.  It is just
205 your normal run-of-the-mill web site.  And as everyone knows, HTML
206 blows goats so it doesn't get updated anywhere near as often as it
207 should.  We do have a @email{webmaster@@sxemacs.org, Webmaster}, so if
208 you do have any comments about the site, you should direct them there.
209 Or, alternatively, @email{sxemacs-devel@@sxemacs.org, SXEmacs Devel}
210 mailing list.
211
212 @node Download Site, IRC, Web Site, Online Presence
213 @comment  node-name,  next,  previous,  up
214 @chapter SXEmacs Download Site
215 @cindex download
216 @cindex downloads
217 @cindex source code
218 @cindex source
219 @cindex tarball
220
221 @uref{https://downloads.sxemacs.org/releases/, SXEmacs release downloads} is
222 where you'll find release tarballs and release to release patches
223 available for download.
224
225 @uref{https://downloads.sxemacs.org/snapshots/, SXEmacs snapshot downloads}
226 is where you can find snapshot tarballs which are uploaded from time
227 to time.  Please note that these snapshots can sometimes be very
228 unstable.
229
230 If you would like something made available for download at the SXEmacs
231 download site, contact @sye{}.
232
233 @node IRC, Merchandise, Download Site, Online Presence
234 @comment  node-name,  next,  previous,  up
235 @chapter SXEmacs on IRC
236 @cindex irc
237 @cindex talk
238 @cindex chat
239 @cindex support
240
241 Developers official communcation platform is the mailing list provided
242 at sxemacs.org. However, to discuss problems and assist users more
243 efficiently there is an official IRC channel.
244
245 SXEmacs IRC channel @dfn{#sxemacs} is located at freenode (formerly
246 known as OPN). Please use following URI to refer to it:
247
248 @uref{irc://irc.freenode.net/#sxemacs}
249
250 @subheading Various IRC HowTOs
251
252 @itemize @bullet
253 @item
254 Connecting to the network and joining the channel
255
256 Fire up your favourite irc client and use:
257 @code{/server irc.freenode.net} to connect to the network and
258 @code{/join #sxemacs} to join the community.
259 @item
260 HowTo become a respected regular
261
262 Okay, you've decided to be active on IRC and hopefully help other
263 users. You have joined the channel and idle around thirsting for hard
264 problems by helpless users.
265
266 In that case you will have to have a reliable (not-changing) nickname
267 that is linked to your person in order to refer to you.  This will help
268 us in blaming you if you misdirect users with your answers and even help
269 us to praise you if you convinced RMS to switch to SXEmacs ;)
270
271 Therefore, freenode provides a mechanism to eternalise yourself via
272 the nickname you carry. Use @code{/nickserv register <password>}
273 to engrave your nickname for your personal use.
274
275 This nickname is yours from now on. To identify yourself to freenode
276 use @code{/nickserv identify <samepasswordasabove>}
277
278 Your user mode will be changed to @dfn{+e} in case of successful
279 identification.
280
281 Whenever you see unscrupulous people carrying your nickname or your
282 nickname is ghosted because of a reconnection, you can just
283 @code{/nickserv ghost <yournickname> <yourpassword>} to send the
284 other client to oblivion.
285
286 Okay, now that you've registered yourself with freenode, you're
287 nickname can be referred to, independently from whether you are
288 carrying that nick or not. Just do @code{/nickserv info <nickname>}
289 to obtain some information on a nickname you see and like to refer
290 to.
291 @item
292 HowTo to be listed in the channel access list
293
294 There is no influence on this access list on the users and developer's
295 side.  It is merely up to the project lead who has control over it.
296 @item
297 Host cloaks
298
299 The only way to get one is to ask the project lead (SteveYoungs).
300 @item
301 No IRC client
302
303 You don't have an IRC client but still want to shoot the breeze with
304 us on IRC?  Then we have an answer for you@dots{}
305 @uref{https://www.sxemacs.org/irc.html, Chat from the web}.
306 @end itemize
307
308 @node Merchandise,, IRC, Online Presence
309 @comment  node-name,  next,  previous,  up
310 @chapter SXEmacs Merchandise
311 @cindex merchandise
312 @cindex shop
313 @cindex shopping
314 @cindex gift
315 @cindex money
316 @cindex t-shirt
317 @cindex retail therapy
318 @cindex donate
319 @cindex support
320 @cindex donation
321
322 At @uref{http://store.sxemacs.org/, The SXEmacs Store} you will find
323 for sale various cool and sexy goodies sporting the SXEmacs logo.  The
324 proceeds from all purchases go toward covering the costs involved in
325 the upkeep of the SXEmacs project.  Be the first on your street to own
326 a @i{I'm Too Sexy For My Emacs} T-shirt!
327
328 @node Dispute Resolution, Coding Style, Online Presence, Top
329 @comment  node-name,  next,  previous,  up
330 @chapter Dispute Resolution
331 @cindex dispute resolution
332 @cindex resolution, dispute
333 @cindex resolving disputes
334 @cindex disputes, resolving
335 @cindex argue
336 @cindex arguments
337
338 @quotation
339 When two people agree on everything, one of them isn't needed.
340 @end quotation
341
342 I can't remember where that quote comes from so if anyone reading this
343 knows, please let us know so we can give credit where credit is due.
344
345 We are all mature adults and most of the time we don't let our egos get
346 in the way of getting things done.  But human nature being what it is
347 means that from time to time we'll have conflict or disagreements.  In
348 the vast majority of these cases a resolution will come quickly and
349 easily through reasonable discussion.
350
351 This section is for those rare occasions that will be the exception to
352 the above.
353
354 In the event of a unresolvable dispute, the SXEmacs Project Lead,
355 @sye{}, will, at his discretion, take one or more of the following
356 steps@dots{}
357
358 @itemize
359 @item
360 Decide the outcome.
361 @item
362 Call a @dfn{vote} @ref{Voting}.
363 @item
364 Call a @dfn{postponement}.  This will mean that all parties will be
365 asked to stop discussing the matter until some date in the future.  This
366 future date will be given at the time the SXEmacs Project Lead calls the
367 postponement.  The idea here is to give everyone a chance to cool down
368 so that reasonable discussion can continue.
369 @end itemize
370
371 To date, we've not ever had to resort to these.  We tend to sort
372 things out pretty quickly and amicably most of the time.
373
374 @menu
375 * Voting::                      Deciding things via ballot
376 @end menu
377
378 @node Voting,, Dispute Resolution, Dispute Resolution
379 @comment  node-name,  next,  previous,  up
380 @chapter Voting
381 @cindex voting
382 @cindex vote
383 @cindex ballot
384
385 Sometimes things are best decided with a vote.  This section describes
386 how these votes are to be held.
387
388 Who may participate in a vote?  Anyone subscribed to the SXEmacs
389 Developers' mailing list, @email{sxemacs-devel@@sxemacs.org}.
390
391 Who may call a vote?  The SXEmacs Project Lead, @sye{}.  Of course
392 anyone may ask the Project Lead to call a vote.
393
394 @section Mechanics of the Vote
395
396 @enumerate
397 @item
398 The votes will be cast via email on the SXEmacs Developers' mailing
399 list, @email{sxemacs-devel@@sxemacs.org}.
400 @item
401 The @dfn{ballot paper} will have the email subject
402 @dfn{[Vote] Subject of vote}. The body of this email will contain the
403 details of the ballot.  The actual questions or points that make up what
404 is being voted on should be in a form that makes it easy to respond to.
405 In other words they should be either multiple choice or yes/no type
406 questions.
407 @item
408 Each person wishing to participate in the vote will simply reply
409 @emph{once} to this email.  The reply or @dfn{vote} @emph{must} come to
410 the mailing list.
411 @item
412 Anyone wishing to abstain need not do anything.  Just don't reply to the
413 ballot email.
414 @item
415 There will be a time limit restriction on voting on any matter.  This
416 time limit will be a minimum of one calendar week from the time the vote
417 is declared @dfn{open}.  The vote is declared @dfn{open} with the
418 posting of the initial ballot email (with the subject prefix of
419 @dfn{[Vote]}.
420 @end enumerate
421
422
423 @subsection Deciding the Outcome
424
425 As soon as practicable after the vote closes (when the time limit has
426 expired) the SXEmacs Project Lead will tally up all the votes and post
427 the results to the SXEmacs Developers' mailing list,
428 @email{sxemacs-devel@@sxemacs.org}.  This post will have the email
429 subject @dfn{[Vote Results] Subject of vote}.
430
431 The issue will be decided by simple majority.  For a hung vote (no
432 side has a majority) the Project Lead will either decide the outcome,
433 call a postponement, or even call another vote.
434
435 @node Coding Style, Patches, Dispute Resolution, Top
436 @comment  node-name,  next,  previous,  up
437 @chapter Coding Style
438 @cindex coding style
439 @cindex style, coding
440 @cindex style
441 @cindex coding
442
443 SXEmacs has two main programming languages, Emacs Lisp, and C, therefore
444 we need two sets of coding styles.
445
446 @section Coding Style -- Emacs Lisp
447 @cindex emacs lisp coding style
448 @cindex coding style, emacs lisp
449 @cindex lisp coding style
450 @cindex coding style, lisp
451
452 Read @pxref{(lispref)Style Tips}
453
454 Please take particular note of@dots{}
455
456 @quotation
457 Don't make a habit of putting close-parentheses on lines by
458 themselves; Lisp programmers find this disconcerting.  Once in a
459 while, when there is a sequence of many consecutive
460 close-parentheses, it may make sense to split them in one or two
461 significant places.
462 @end quotation
463
464 The only other thing I have to say about lisp coding style is to keep
465 your lines @emph{under} 80 columns in length.
466
467 @subsection Coding Style -- C
468 @cindex C coding style
469 @cindex coding style, C
470
471 @quotation
472 First off, I'd suggest printing out a copy of the GNU coding standards,
473 and NOT read it.  Burn them, it's a great symbolic gesture.
474
475   -- Linus Torvalds
476 @end quotation
477
478 @menu
479 * General C Style::             What you should use everywhere
480 * SXEmacs Specific Style::      Our idiosyncrasies
481 @end menu
482
483 @node General C Style, SXEmacs Specific Style, Coding Style, Coding Style
484 @chapter General C Style
485 @cindex C coding style
486 @cindex coding style, C
487 @cindex general coding style
488 @cindex coding style, general
489
490 SXEmacs C code follows, to a large degree, the coding style of the Linux
491 Kernel source.  Much of this section is a verbatim copy of
492 @file{./Documentation/CodingStyle} from the Linux kernel sources.
493
494 @heading Indentation
495 @cindex indentation
496 @cindex indentation coding style
497 @cindex coding style, indentation
498
499 Tabs are 8 characters, and thus indentations are also 8 characters.
500 There are heretic movements that try to make indentations 4 (or even 2!)
501 characters deep, and that is akin to trying to define the value of PI to
502 be 3.
503
504 Rationale: The whole idea behind indentation is to clearly define where
505 a block of control starts and ends.  Especially when you've been looking
506 at your screen for 20 straight hours, you'll find it a lot easier to see
507 how the indentation works if you have large indentations.
508
509 Now, some people will claim that having 8-character indentations makes
510 the code move too far to the right, and makes it hard to read on a
511 80-character terminal screen.  The answer to that is that if you need
512 more than 3 levels of indentation, you're screwed anyway, and should
513 fix your program.
514
515 In short, 8-char indents make things easier to read, and have the added
516 benefit of warning you when you're nesting your functions too deep.
517 Heed that warning.
518
519 Don't put multiple statements on a single line unless you have something
520 to hide:
521
522 @smallexample
523         if (condition) do_this;
524           do_something_everytime;
525 @end smallexample
526
527 Outside of comments and documentation, spaces are never used for
528 indentation, and the above example is deliberately broken.
529
530 @cindex coding style, whitespace
531 @cindex whitespace
532 Don't leave whitespace at the end of lines.  There is a
533 @file{whitespace.el} which you can get from
534 @uref{http://www.dsmit.com/lisp/}.  Use it.
535
536 @heading Breaking long lines and strings
537 @cindex long lines
538 Coding style is all about readability and maintainability using commonly
539 available tools.
540
541 The limit on the length of lines is 80 columns and this is a hard limit.
542
543 Statements longer than 80 columns will be broken into sensible chunks.
544 Descendants are always substantially shorter than the parent and are placed
545 substantially to the right. The same applies to function headers with a long
546 argument list. Long strings are as well broken into shorter strings.
547
548 @smallexample
549 void
550 fun(int a, int b, int c)
551 @{
552         if (condition)
553                 printf("Warning this is a very very very long printf with "
554                                                 "3 parameters a: %u b: %u "
555                                                 "c: %u \n", a, b, c);
556         else
557                 next_statement;
558 @}
559 @end smallexample
560
561 @heading Placing Braces
562 @cindex braces
563 @cindex coding style, braces
564 The other issue that always comes up in C styling is the placement of
565 braces.  Unlike the indent size, there are few technical reasons to
566 choose one placement strategy over the other, but the preferred way, as
567 shown to us by the prophets Kernighan and Ritchie, is to put the opening
568 brace last on the line, and put the closing brace first, thusly:
569
570 @smallexample
571         if (x is true) @{
572                 we do y
573         @}
574 @end smallexample
575
576 However, there is one special case, namely functions: they have the
577 opening brace at the beginning of the next line, thus:
578
579 @smallexample
580         int function(int x)
581         @{
582                 body of function
583         @}
584 @end smallexample
585
586 Heretic people all over the world have claimed that this inconsistency
587 is@dots{}  well@dots{}  inconsistent, but all right-thinking people know that
588 (a) K&R are @emph{right} and (b) K&R are right.  Besides, functions are
589 special anyway (you can't nest them in C).
590
591 Note that the closing brace is empty on a line of its own, @emph{except}
592 in the cases where it is followed by a continuation of the same statement,
593 ie a "while" in a do-statement or an "else" in an if-statement, like this:
594
595 @smallexample
596         do @{
597                 body of do-loop
598         @} while (condition);
599 @end smallexample
600
601 and
602
603 @smallexample
604         if (x == y) @{
605                 ..
606         @} else if (x > y) @{
607                 ...
608         @} else @{
609                 ....
610         @}
611 @end smallexample
612
613 @heading Naming
614 @cindex naming
615 @cindex coding style, naming
616 C is a Spartan language, and so should your naming be.  Unlike Modula-2
617 and Pascal programmers, C programmers do not use cute names like
618 @var{ThisVariableIsATemporaryCounter}.  A C programmer would call that
619 variable @var{tmp}, which is much easier to write, and not the least more
620 difficult to understand.
621
622 HOWEVER, while mixed-case names are frowned upon, descriptive names for
623 global variables are a must.  To call a global function "foo" is a
624 shooting offense.
625
626 GLOBAL variables (to be used only if you _really_ need them) need to
627 have descriptive names, as do global functions.  If you have a function
628 that counts the number of hidden buffers, you should call that
629 @code{count_hidden_buffers()} or similar, you should @emph{not} call it
630 @code{cntbuf()}.
631
632 Encoding the type of a function into the name (so-called Hungarian
633 notation) is brain damaged - the compiler knows the types anyway and can
634 check those, and it only confuses the programmer.  No wonder MicroSoft
635 makes buggy programs.
636
637 LOCAL variable names should be short, and to the point.  If you have
638 some random integer loop counter, it should probably be called @var{i}.
639 Calling it @var{loop_counter} is non-productive, if there is no chance
640 of it being mis-understood.  Similarly, @var{tmp} can be just about any
641 type of variable that is used to hold a temporary value.
642
643 If you are afraid to mix up your local variable names, you have another
644 problem, which is called the @dfn{function-growth-hormone-imbalance
645 syndrome}.  See next.
646
647 @heading Functions
648 @cindex functions
649 @cindex coding style, functions
650 Functions should be short and sweet, and do just one thing.  They should
651 fit on one or two screenfuls of text (the ISO/ANSI screen size is 80x24,
652 as we all know), and do one thing and do that well.
653
654 A function's return type should be put on a line by itself like this:
655
656 @smallexample
657 int
658 main(int argc, char **argv)
659 @{
660         ...
661         ...
662 @}
663 @end smallexample
664
665 This also helps things like @code{etags}.
666
667 The maximum length of a function is inversely proportional to the
668 complexity and indentation level of that function.  So, if you have a
669 conceptually simple function that is just one long (but simple)
670 case-statement, where you have to do lots of small things for a lot of
671 different cases, it's OK to have a longer function.
672
673 However, if you have a complex function, and you suspect that a
674 less-than-gifted first-year high-school student might not even
675 understand what the function is all about, you should adhere to the
676 maximum limits all the more closely.  Use helper functions with
677 descriptive names (you can ask the compiler to in-line them if you think
678 it's performance-critical, and it will probably do a better job of it
679 than you would have done).
680
681 Another measure of the function is the number of local variables.  They
682 shouldn't exceed 5-10, or you're doing something wrong.  Re-think the
683 function, and split it into smaller pieces.  A human brain can
684 generally easily keep track of about 7 different things, anything more
685 and it gets confused.  You know you're brilliant, but maybe you'd like
686 to understand what you did 2 weeks from now.
687
688 @heading Commenting
689 @cindex commenting
690 @cindex comments
691 @cindex coding style, commenting
692 @cindex coding style, comments
693 Comments are good, but there is also a danger of over-commenting.
694 @emph{NEVER} try to explain @emph{HOW} your code works in a comment:
695 it's much better to write the code so that the @emph{working} is
696 obvious, and it's a waste of time to explain badly written code.
697
698 Generally, you want your comments to tell @emph{WHAT} your code does, not
699 @emph{HOW}.  Also, try to avoid putting comments inside a function body:
700 if the function is so complex that you need to separately comment parts of
701 it, you should probably go back to section on @dfn{Functions} for a while.
702 You can make small comments to note or warn about something particularly
703 clever (or ugly), but try to avoid excess.  Instead, put the comments at
704 the head of the function, telling people what it does, and possibly WHY it
705 does it.
706
707 A comment in C looks like @code{/* a comment */}.  A comment in C++
708 looks like @code{// a comment}.  Don't get them confused and don't
709 @emph{ever} use C++ style comments.
710
711 This style of commenting in C @emph{is} acceptable:
712
713 @smallexample
714 /*
715  * A comment style in C that is quite often used
716  * for multi-line comments.
717  */
718 @end smallexample
719
720
721 @heading Macros
722 @cindex macro
723 @cindex coding style, macros
724 Names of macros defining constants and labels in enums are capitalised.
725
726 @smallexample
727 #define CONSTANT 0x12345
728 @end smallexample
729
730 Enums are preferred when defining several related constants.
731
732 CAPITALISED macro names are appreciated but macros resembling functions
733 may be named in lower case.
734
735 Generally, inline functions are preferable to macros resembling functions.
736
737 Macros with multiple statements should be enclosed in a do - while block:
738
739 @smallexample
740 #define macrofun(a,b,c)                         \
741         do @{                                   \
742                 if (a == 5)                     \
743                         do_this(b,c);           \
744         @} while (0)
745 @end smallexample
746
747 @subheading Things to avoid when using macros:
748 @cindex macro
749 @enumerate
750 @item
751 macros that affect control flow:
752
753 @smallexample
754 #define FOO(x)                                  \
755         do @{                                   \
756                 if (blah(x) < 0)                \
757                         return -EBUGGERED;      \
758         @} while(0)
759 @end smallexample
760
761 is a @emph{very} bad idea.  It looks like a function call but exits the "calling"
762 function; don't break the internal parsers of those who will read the code.
763
764 @item
765 macros that depend on having a local variable with a magic name:
766
767 @smallexample
768 #define FOO(val) bar(index, val)
769 @end smallexample
770
771 might look like a good thing, but it's confusing as hell when one reads the
772 code and it's prone to breakage from seemingly innocent changes.
773
774 @item
775 macros with arguments that are used as l-values: FOO(x) = y; will
776 bite you if somebody e.g. turns FOO into an inline function.
777
778 @item
779 forgetting about precedence: macros defining constants using expressions
780 must enclose the expression in parentheses. Beware of similar issues with
781 macros using parameters.
782
783 @smallexample
784 #define CONSTANT 0x4000
785 #define CONSTEXP (CONSTANT | 3)
786 @end smallexample
787 @end enumerate
788
789 @heading Further Reading
790 @cindex further reading
791 @cindex coding style, further reading
792 @display
793 The C Programming Language, Second Edition
794 by Brian W. Kernighan and Dennis M. Ritchie.
795 Prentice Hall, Inc., 1988.
796 ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).
797 @uref{http://cm.bell-labs.com/cm/cs/cbook/}
798
799 The Practice of Programming
800 by Brian W. Kernighan and Rob Pike.
801 Addison-Wesley, Inc., 1999.
802 ISBN 0-201-61586-X.
803 @uref{http://cm.bell-labs.com/cm/cs/tpop/}
804 @end display
805
806 GNU manuals - where in compliance with K&R and this text - for cpp, gcc,
807 gcc internals and indent, all available from @uref{http://www.gnu.org/}
808
809 WG14 is the international standardization working group for the programming
810 language C, @uref{http://std.dkuug.dk/JTC1/SC22/WG14/}
811
812 @node SXEmacs Specific Style,,General C Style, Coding Style
813
814 @chapter SXEmacs Specific Style
815 @cindex sxemacs specific coding style
816 @cindex coding style, sxemacs specific
817
818 This section was lifted almost word for word from the XEmacs
819 @file{CODING-STANDARDS} by Ben Wing.
820
821 @heading Specially-prefixed functions/variables:
822 @cindex coding style, function prefix
823 @cindex coding style, variable prefix
824 @cindex coding style, functions
825 @cindex coding style, variables
826 @itemize @bullet
827 @item
828 All global C variables whose value is constant and is a symbol begin
829 with a capital Q, e.g. @var{Qkey_press_event}. (The type will always be
830 @dfn{Lisp_Object}.)
831
832 @item
833 All other global C variables whose value is a @dfn{Lisp_Object} (this
834 includes variables that forward into Lisp variables plus others like
835 @var{Vselected_console}) begin with a capital V.
836
837 @item
838 No C variables whose value is other than a @dfn{Lisp_Object} should begin
839 with a capital V. (This includes C variables that forward into
840 integer or boolean Lisp variables.)
841 All global C variables whose value is a struct Lisp_Subr begin with a
842 capital S. (This only occurs in connection with DEFUN ()).
843
844 @item
845 All C functions that are Lisp primitives begin with a capital F,
846 and no others should begin this way.
847 @end itemize
848
849 @heading Functions for manipulating Lisp types:
850 @cindex coding style, functions
851 @itemize @bullet
852 @item
853 Any function that creates an empty or mostly empty Lisp object
854 should begin allocate_(). (*Not* make_().) (Except, of course,
855 for Lisp primitives, which usually begin Fmake_()).
856
857 @item
858 Any function that converts a pointer into an equivalent Lisp_Object
859 should begin make_().
860
861 @item
862 Any function that converts a Lisp_Object into its equivalent pointer
863 and checks the type and validity of the object (e.g. making sure
864 it's not dead) should begin decode_().
865
866 @item
867 Any function that looks up a Lisp object (e.g. buffer, face) given
868 a symbol or string should begin get_(). (Except, of course, for
869 Lisp primitives, which usually begin Fget_()).
870 @end itemize
871
872 @heading Other:
873
874 Any header-file declarations of the sort
875
876 @smallexample
877    struct foobar;
878 @end smallexample
879
880 go into the @dfn{types} section of @file{lisp.h}.
881
882
883 @node Patches, Feature Requests, Coding Style, Top
884 @comment  node-name,  next,  previous,  up
885 @chapter Patches
886 @cindex patches
887 @cindex contributions
888 @cindex diff
889 @cindex patch
890
891 Ideally, the best way to get your patches into the SXEmacs code base is
892 to have @s{} fetch them directly from your git repo.  If, for any
893 reason you are not able to set up a repository with read-only access
894 for (at least) @s{}, that doesn't mean that you can't still contribute
895 your patches and code.
896
897 You can check how to setup a publicly accessible repo at @xref{Setting
898 up a publicly accessible repo}.
899
900 There are a number of different situations and circumstances that you
901 may find yourself in with regards to contributing to the SXEmacs
902 project.  I'll try to cover the main ones here, but please note that
903 they @emph{all} have two things in common@dots{}
904
905 @enumerate
906 @item
907 A diff is always sent to
908 @email{sxemacs-patches@@sxemacs.org, SXEmacs Patches}.
909 @item
910 The diff is always in @dfn{unified} format
911 @code{diff -u oldfile newfile}
912 @end enumerate
913
914 @menu
915 * Sending a patch from a git repo::
916                                 Procedure to send a patch from a git repo,
917                                 be it a publicly accessible one, or just a
918                                 private clone from the master repo.
919 * Vanilla sources (no repo)::   Just the source tree that isn't under
920                                 git control.
921 @end menu
922
923 @node Sending a patch from a git repo, Vanilla sources (no repo), Patches, Patches
924 @comment  node-name,  next,  previous,  up
925 @chapter Sending a patch from a git repo
926 @cindex patches
927 @cindex contributions
928 @cindex diff
929 @cindex patch
930
931 Firstly, if you can set up an accessible remote repo, please do so.
932 You can see how easy it is in section @xref{Setting up a publicly
933 accessible repo}.  It will make things so much easier for everyone.
934 We do understand that there may be some valid reasons why you can't,
935 and that is okay, this section still provides a valid workflow.
936
937 Before you do anything, we recommend that you run the
938 @code{git-for-steve.sh} script which you'll find in the @code{contrib}
939 directory.  It will ensure that some basic git config settings are
940 correct, and set up your ``for-steve'' tracking branch.
941
942 @subheading Preparing a patch from a git repo
943
944 Are you in the right place?  You cloned the SXEmacs sources with
945 @code{git clone https://git.sxemacs.org/sxemacs}.
946
947 Yes?  OK, great, read on.
948
949 Your workflow should run something along these lines@dots{}
950
951 @enumerate
952 @item
953 @code{git pull} from your ``for-steve'' branch to sync up with the main
954 SXEmacs repo.
955 @item
956 @code{git checkout -b mybugfix} to create and checkout a new branch.
957 You can call it whatever you like, just as long as @emph{you} know
958 what it's about. (Yeah, we recommend that you do all your work on
959 branches and keep your master branch as pristine as possible).
960 @item
961 hack hack edit edit fix fix hack
962 @item
963 Test!  If all is good, proceed.  If not, return to the previous step.
964 @item
965 The next step is to commit your changes, and at this point I'd like to
966 note that, although not mandatory, we encourage and prefer it if
967 you sign all of your commits with GnuPG.  This can be easily set up
968 via @code{git config commit.gpgSign true}@footnote{Already done for
969 you if you ran the @code{git-for-steve.sh} script and it found your
970 key}. 
971
972 Depending on how you like to deal with change logs, and if the changes
973 were small and trivial or detailed and large:
974
975 @itemize @bullet
976 @item
977 @code{git commit -sam "Summary of changes"}  For use with small quick
978 changes that don't really warrant verbose logs to document them.
979 @item
980 @code{git commit -sa}  This form will fire up an editor for you to
981 write your change logs in@footnote{You can set which editor to use
982 with @code{git config --global core.editor my_fav_editor}. @s{} has
983 his set to a shell function called @dfn{edit} which fires up gnuclient
984 if SXEmacs is running, or SXEmacs if not.}.
985 @item
986 @code{git commit -saF mylogfile}  Use this form for the times when you
987 have logged your changes as you went to the file @file{mylogfile}.
988 @end itemize
989
990 Please take note, that whichever commit command you use, to
991 @emph{always} use the @code{-s} option to add a @dfn{Signed-off-by}
992 entry to the log.  This will indicate that you played some role in
993 getting the patch into the code base, and, perhaps more importantly,
994 you had permission to do so@footnote{There might be
995 licencing/copyright things to be aware of, especially in the case of
996 working on SXEmacs either for your employer, or during your employer's
997 time.}.
998
999 For patches that you're submitting to the main SXEmacs code base that
1000 have originated from somebody else (maybe you have a small team of
1001 sub-developers working for you), the @dfn{Signed-off-by} entry also
1002 indicates that you have reviewed, tested, and approved the patch.  And
1003 also, the original author has permission to submit it.
1004 @item
1005 @code{git checkout for-steve}  To flip back to your for-steve branch.
1006 @item
1007 @code{git merge mybugfix}  To merge the changes from the
1008 @dfn{mybugfix} branch into your for-steve branch.
1009
1010 At this point everything that was in the @dfn{mybugfix} branch is now
1011 in your for-steve branch, so you no longer need it. You can safely delete
1012 it with @code{git branch -d mybugfix}.
1013
1014 Now if you have a publicly accessible repo, you should do:
1015 @item
1016 @code{git push myremote for-steve}  To push the changes to your publicly
1017 accessible repo, @dfn{myremote}.
1018 @end enumerate
1019
1020 If your repos is private, it is safe to skip the push and just advance
1021 to the next step.
1022
1023 @subheading Patch Submission
1024
1025 @anchor{Patch Submission}
1026 At this point, your changes are ready for @s{} to incorporate into
1027 the main SXEmacs code base.  All you need to do is let him know, and
1028 you can easily do that with the following 2 git commands@footnote{The
1029 @code{git-for-steve.sh} contrib script will set a lot of these for you.}:
1030
1031 @enumerate
1032 @item
1033 @code{git format-patch --add-header="X-Git-Repo: REPO-URL" \@*
1034     --add-header="X-Git-Branch: for-steve" \@*
1035     --subject-prefix="P-Req" --minimal --numbered -o DIR origin/master}
1036 @item
1037 @code{git send-email \@*
1038     --to="SXEmacs Patches <sxemacs-patches@@sxemacs.org>" \@*
1039     --from="$(git config user.name) <$(git config user.email)>" DIR}
1040 @end enumerate
1041
1042 If you not have have a publicly accessible repository, the SXEmacs
1043 developers can't pull in your changesets directly from you.  Instead,
1044 once your patch hits the mailing list and is approved, it will have to
1045 be applied manually to the SXEmacs code base.
1046
1047 You could, in theory, use a post-commit hook, but I'd not recommend
1048 it.  Think about the situation where you are working on something
1049 fairly big.  You'd most likely commit several times before you have
1050 things ready for us.
1051
1052 If you have a publicly accessible repo, be sure to setup automation
1053 like in @xref{Automation}.
1054
1055 @node Vanilla sources (no repo),, Sending a patch from a git repo, Patches
1056 @comment  node-name,  next,  previous,  up
1057 @chapter Vanilla sources (no repo)
1058 @cindex patches
1059 @cindex contributions
1060 @cindex diff
1061 @cindex patch
1062
1063 Are you in the right place?  All you have is a SXEmacs source tarball
1064 and you don't have @file{git} installed.
1065
1066 Yes?  OK, great, read on.
1067
1068 You will have the toughest time of it I'm afraid because you will have
1069 to do everything manually.  But it isn't too bad.  No worse than for any
1070 other project.
1071
1072 Your hacking cycle will look something like this:
1073
1074 @enumerate
1075 @item
1076 Unpack the source tarball somewhere and @emph{don't touch it}.  This
1077 will be your pristine sources.
1078 @item
1079 Make a copy of your pristine sources somewhere else.  This will be your
1080 working tree where you make your changes.
1081 @item
1082 cd into your working tree and hack hack hack
1083 @item
1084 Jump out of your working tree and do:
1085 @code{diff -urNp pristine-tree working-tree > my-sxemacs.diff}
1086
1087 A note of caution here: Please ensure that you are diff'ing clean
1088 trees.  In other words, run @code{make distclean} in your working tree
1089 @emph{before} creating the diff.
1090 @item
1091 Send @file{my-sxemacs.diff} (gzip'd if large) as a MIME attachment
1092 together with a detailed description of your changes to the
1093 @email{sxemacs-patches@@sxemacs.org, SXEmacs Patches} mailing list.
1094 @end enumerate
1095
1096 @node Feature Requests, Support Requests, Patches, Top
1097 @comment  node-name,  next,  previous,  up
1098 @chapter Feature Requests
1099 @cindex request, feature
1100
1101 From time to time someone will wander into the mailing list or our
1102 IRC channel saying something like "ya know, SXEmacs is cool, but it
1103 would truly @emph{rock} if it had @dfn{fooble-klangers}.  How 'bout
1104 it guys?  Can somebody please add @dfn{fooble-klangers} to SXEmacs?".
1105
1106 @emph{That's} a @dfn{Feature Request}.
1107
1108 It doesn't matter what a @dfn{fooble-klanger} is.  It doesn't matter
1109 if having said @dfn{fooble-klanger} would make SXEmacs rock or not.
1110 What @strong{DOES MATTER} is that we acknowledge the request.  And we
1111 acknowledge it quickly.
1112
1113 So how quick is quickly?  Anything greater than 48 hours is @emph{slow}.
1114 We should try to get an initial ack out within 24 hours of the feature
1115 request hitting the mailing list@footnote{All legitimate feature requests
1116 should eventually end up on the @uref{https://issues.sxemacs.org/, SXEmacs
1117 Issue Tracker}.}.  I totally understand that the 24 hour turn-around
1118 won't always be possible.  Often there'll be extenuating circumstances
1119 (I'm writing this right now in the middle of a 2 week period with no
1120 internet connection).
1121
1122 The acknowledgment doesn't need to be anything more than just that, an
1123 acknowledgment.  You don't need to have a 100,000 lines of working
1124 code that proves how much @dfn{fooble-klangers} make or don't make
1125 SXEmacs rock before you let the guy know that he isn't talking to a
1126 brick wall.
1127
1128 A feature request can only end up in one of 3 scenarios...
1129
1130 @enumerate 1
1131 @item
1132 Implemented code.
1133 @item
1134 Discarded idea.
1135 @item
1136 Forgotten about.
1137 @end enumerate
1138
1139 Of those, #3 is @strong{UNACCEPTABLE}!  That means, if you see a
1140 feature request that is more than 48 hours old and hasn't been
1141 acknowledged, it is @strong{YOUR} responsibility to do something about
1142 it.
1143
1144 A feature request on our @uref{https://issues.sxemacs.org/, Issue
1145 Tracker} is a issue that has the @dfn{FeatReq} flag set and the
1146 severity set to @dfn{enhancement}.
1147
1148
1149 @node Support Requests, Bug Reports, Feature Requests, Top
1150 @comment  node-name,  next,  previous,  up
1151 @chapter Support Requests
1152 @cindex request, support
1153
1154 Support requests are a call for help from our users and as such have
1155 @emph{top priority}.  Much of @xref{Feature Requests}, applies equally
1156 here.
1157
1158 Support requests are @emph{everyone's} responsibility, so if you see
1159 one and you think you can help, do so.
1160
1161 @node Bug Reports, Making Releases, Support Requests, Top
1162 @comment  node-name,  next,  previous,  up
1163 @chapter Bug Reports
1164 @cindex report, bug
1165
1166 Bug reports are a @emph{good} thing.  They show that people are using
1167 the code that you spent so much time and effort in writing.  Bug
1168 reports are an opportunity to improve SXEmacs.  Never be scared of bug
1169 reports.  Never get annoyed or upset by bug reports.  Welcome them.
1170 As a matter of fact, worry if you don't see any bug reports.  That
1171 would mean we aren't working hard enough. :-)
1172
1173 All bug reports have to be submitted to our
1174 @uref{https://issues.sxemacs.org/, Issue Tracker}.  So it goes without
1175 saying that you already have an account on our Issue Tracker, and if
1176 you don't, go get one @emph{now}.
1177
1178 Because the Issue Tracker is just that, it @dfn{tracks} issues, all
1179 followups and correspondence concerning a bug @emph{must} be added via
1180 the issue tracker itself.  @emph{DO NOT} follow up to a bug report on
1181 the mailing list.  If a bug report is submitted to the mailing list
1182 initially (because the submitter wasn't aware of our Issue Tracker),
1183 the person submitting the report should be directed to our
1184 @uref{https://issues.sxemacs.org/, Issue Tracker}.  If they are
1185 unwilling or unable to do so, one of us will do so.
1186
1187 If a bug report results in a patch and merge request, the summary of
1188 the patch log should contain the text: "(Closes bug #n)", where `n' is
1189 the number that our Issue Tracker has assigned to that bug.  The bug
1190 should be marked as "fixed" (stating in which revision) on the Issue
1191 Tracker.  It should not be marked "Closed" until just prior to a
1192 release.  Closing bugs is the job and responsibility of the project
1193 lead, or whoever is responsible for making releases.
1194
1195
1196 @node Making Releases, New Features, Bug Reports, Top
1197 @comment  node-name,  next,  previous,  up
1198 @chapter Making Releases
1199 @cindex release
1200
1201 From time to time, at the project lead's discretion, a release
1202 will be made and tarballs created and made available on
1203 @uref{https://downloads.sxemacs.org/releases/, the SXEmacs download site}.
1204
1205 The decision as to @emph{when} to cut a release is generally
1206 influenced by two factors:
1207
1208 @enumerate 1
1209 @item
1210 How stable the code base is currently.
1211 @item
1212 Whether the changes since the last release warrant a new release.
1213 @end enumerate
1214
1215 The minimum number of revisions between releases is one.  The maximum
1216 number of revisions between releases is, well, there is no maximum.
1217
1218 The actual steps involved in cutting a release are:
1219
1220 @itemize @bullet
1221 @item
1222 Finalise things like...
1223 @itemize
1224 @item
1225 Update @file{etc/NEWS}
1226
1227 To get the numbers for the "Developer Stats" section, first get a list
1228 of unique committers for this release with@dots{}
1229
1230 @code{git log --format=full v@cver{}..|grep Author|sort -u}
1231
1232 And then for the number of actual commits for each developer do@dots{}
1233
1234 @code{git log --oneline --no-merges --author=NAME v@cver{}..|wc -l}
1235
1236 @item
1237 Make sure @file{INSTALL}, @file{PROBLEMS} etc are up to date.
1238 @item
1239 Update @file{sxemacs.texi} at@dots{}
1240 @quotation
1241 It corresponds to:
1242   version-string
1243 @end quotation
1244 @item
1245 Update the codename and version in @file{autogen.sh}
1246 @item
1247 Update the versioning macros in this document.
1248 @end itemize
1249 @item
1250 Commit those updates.
1251
1252 @code{git commit -sam "SXEmacs v@nver{} is released!"}
1253 @item
1254 Create a new tag which will be the version number of this release.
1255
1256 @code{git tag -s v@nver{} -m "SXEmacs v@nver{}"}
1257 @item
1258 Push it to the public repo.
1259
1260 @code{git push --tags origin master}
1261 @item
1262 Prepare tarball:
1263
1264 (in the release working directory)
1265
1266 @smallexample
1267 git archive --format=tar \
1268     --prefix=sxemacs-@nver{}/ HEAD | \
1269     (cd ~/upload && tar xf -)
1270 @end smallexample
1271
1272 @item
1273 Clean out the working directory and do autotool preparations.
1274
1275 @smallexample
1276 HAMMER=1 ./autogen.sh
1277 @end smallexample
1278
1279 @item
1280 Copy the autotool files to the exported tree
1281
1282 @smallexample
1283 cp -va libltdl ~/upload/sxemacs-@nver{} &&
1284 for f in $(git ls-files --others -i --exclude-standard); do
1285     cp -va $@{f@} ~/upload/sxemacs-@nver{}/$@{f@}
1286 done
1287 @end smallexample
1288
1289 @item
1290 Add a ChangeLog
1291
1292 @smallexample
1293 git log --stat v@cver{}..v@nver{} > ~/upload/sxemacs-@nver{}/ChangeLog
1294 @end smallexample
1295 @item
1296 Create a diff against the previous version.
1297
1298 @smallexample
1299     git diff v@cver{}..v@nver{} > ~/upload/sxemacs-@cver{}-@nver{}.diff
1300 @end smallexample
1301
1302 @item
1303 Create the tarballs, md5sums, and sigs:
1304
1305 @smallexample
1306 cd ~/upload
1307 for compressor in bzip2 gzip lzma xz; do
1308     $@{compressor@} --keep sxemacs-@cver{}-@nver{}.diff
1309 done &&
1310 for type in bz2 gz lzma xz; do
1311     tar --create --owner=0 --group=0 --auto-compress --file \
1312       sxemacs-@nver{}.tar.$@{type@} sxemacs-@nver{}
1313     md5sum sxemacs-@nver{}.tar.$@{type@} > \
1314       sxemacs-@nver{}.tar.$@{type@}.md5
1315     md5sum sxemacs-@cver{}-@nver{}.diff.$@{type@} > \
1316       sxemacs-@cver{}-@nver{}.diff.$@{type@}.md5
1317     gpg --detach-sign --armor --output \
1318       sxemacs-@nver{}.tar.$@{type@}.asc sxemacs-@nver{}.tar.$@{type@}
1319     gpg --detach-sign --armor --output \
1320       sxemacs-@cver{}-@nver{}.diff.$@{type@}.asc \
1321       sxemacs-@cver{}-@nver{}.diff.$@{type@}
1322 done
1323 @end smallexample
1324 @item
1325 Move the tarballs, diffs, GnuPG sigs, and md5sums to
1326 @uref{https://downloads.sxemacs.org/releases/, SXEmacs Download Site}.
1327
1328 @smallexample
1329 for file in *.@{bz2,gz,lzma,xz,md5,asc@}; do
1330     scp $@{file@} downloads.sxemacs.org:downloads.sxemacs.org/releases
1331 done
1332 @end smallexample
1333
1334 @item
1335 Rename the @file{LATEST-IS-VER} file.
1336 @smallexample
1337 ssh downloads.sxemacs.org \
1338   mv downloads.sxemacs.org/releases/LATEST-IS-@{@cver{},@nver{}@}
1339 @end smallexample
1340
1341 @item
1342 Update www.sxemacs.org:
1343
1344 @itemize
1345 @item
1346 Update @file{download.html}
1347 @item
1348 Add @file{ChangeLog-@nver{}} to the website
1349 @item
1350 Update @file{index.html}
1351 @end itemize
1352
1353 @item
1354 Send a release announcement to @email{sxemacs-devel@@sxemacs.org,
1355 SXEmacs Devel} and comp.emacs.xemacs.
1356
1357 @item
1358 Commit the first patch to the next version, which would be adding a
1359 @file{ChangeLog.d/ChangeLog-@nver}
1360 @end itemize
1361
1362
1363 @node New Features, Compatibility, Making Releases, Top
1364 @comment  node-name,  next,  previous,  up
1365 @chapter New Features
1366 @cindex feature, new
1367
1368 How do you get a new feature into SXEmacs?  It's not hard, but
1369 remember this, we look at any new feature in this order of
1370 priority...
1371
1372 @enumerate 1
1373 @item
1374 Tested working code.
1375 @item
1376 A plan of action with @dfn{Proof of concept} code.
1377 @item
1378 A plan of action with a willingness to write the code.
1379 @item
1380 An idea with a willingness to move it to a real plan and then to
1381 code.
1382 @item
1383 An idea with a willingness to help test any code resulting from it.
1384 @item
1385 ``Hey, wouldn't it be cool if...''
1386 @end enumerate
1387
1388 Don't be disheartened if you aren't a master programmer, quite often
1389 the best new features and ideas come from non-programmers.  All too
1390 often the people writing the code get caught up in what they are doing
1391 and find it hard to see things from @dfn{outside of the box}.  Anyone
1392 can help with ideas and with testing new code and features.
1393
1394 Any new feature begins with an idea, and at @emph{that} point somebody
1395 should post that idea to @email{sxemacs-devel@@sxemacs.org, SXEmacs
1396 Devel}.
1397
1398 @node Compatibility, Copyright and Licencing, New Features, Top
1399 @comment  node-name,  next,  previous,  up
1400 @chapter Compatibility
1401 @cindex compatibility, xemacs
1402 @cindex compatibility, emacs
1403
1404 All I'll say about this is that for the foreseeable future, SXEmacs
1405 will remain 100% backwardly compatible with XEmacs where emacs lisp is
1406 concerned.  An emacs lisp package or library that runs on XEmacs
1407 @emph{will} run on SXEmacs.
1408
1409 If you find a place where this isn't true, you should report it as a
1410 bug, @xref{Bug Reports}.
1411
1412 If you find areas where SXEmacs is incompatible with GNU/Emacs at the
1413 emacs lisp level, that is an issue between GNU/Emacs and XEmacs.  That
1414 doesn't mean that we won't ever port GNU/Emacs things to SXEmacs,
1415 we'll just do it in a way that doesn't break compatibility with XEmacs.
1416
1417 @node Copyright and Licencing, Developer Recruitment, Compatibility, Top
1418 @comment  node-name,  next,  previous,  up
1419 @chapter Copyright and Licencing
1420
1421 SXEmacs is an @dfn{Open Source} project.  Because of that we can only
1422 accept code and contributions that are covered by an Open Source
1423 licence.
1424
1425 We differ from the GNU/Emacs project in that we will accept any
1426 @dfn{OSI} approved Open Source licence, not just the GNU GPL.  That
1427 means that if you are more comfortable with, say, the BSD licence,
1428 that's cool by us.
1429
1430 We also won't ask you to reassign your copyright to anyone else.  If
1431 you want to reassign your copyright to the FSF (for example), you can,
1432 but we won't reject any contributions from you because you haven't.
1433 @footnote{If you contribute code to SXEmacs that you want included in
1434 GNU/Emacs you will have to reassign copyright to the FSF.  Please
1435 understand that that is a GNU/Emacs requirement and @emph{not} a
1436 SXEmacs requirement}
1437
1438 @subheading SXEmacs and your Employer
1439 This is @strong{very} important.  If you write code for SXEmacs either
1440 on your employer's time (while you are at work), or using your
1441 employer's resources (hardware, software, electricity, furniture, etc)
1442 then your employer may have legal copyright of your work.
1443
1444 @strong{PLEASE} be up front with your employer and clear it with them
1445 @strong{before} you write anything for SXEmacs.  It is OK and
1446 perfectly acceptable to submit contributions to SXEmacs that are
1447 copyrighted to your employer, providing (and this is the key) your
1448 employer is willing to release the code under an approved OSI
1449 licence.
1450
1451 Don't overlook or dismiss this.  It is here to safeguard you, your
1452 employer, the SXEmacs project as a whole, and @sy{} personally.
1453
1454 @subheading Documentation Licences
1455 Please don't licence any documentation under the FSF's new @dfn{Free
1456 Documentation Licence}.  This isn't a slight against the FSF or the
1457 GNU project, it is just because it will mean that our documentation
1458 would not be able to be included in XEmacs.  It may even cause
1459 problems going the other way as well (XEmacs to SXEmacs).
1460
1461 For that reason, we'll err on the side of caution.
1462
1463 @node Developer Recruitment, Making/Altering Policies, Copyright and Licencing, Top
1464 @comment  node-name,  next,  previous,  up
1465 @chapter Developer Recruitment
1466 @cindex recruitment
1467
1468 We don't actively try to recruit new developers in any kind of formal
1469 way.  What we do is use SXEmacs for everything everyday and not hide
1470 the fact that we do. :-)  That in itself makes people curious and some
1471 ask about this thing called @dfn{SXEmacs}.  Show them what it is,
1472 point them to the @uref{https://www.sxemacs.org/, web site}, encourage
1473 them to subscribe to @email{sxemacs-devel@@sxemacs.org, SXEmacs
1474 Devel}, and even help them get an account on
1475 @uref{https://issues.sxemacs.org/, Our Issue Tracker}.  And low and
1476 behold!  We have a new developer.
1477
1478 One recruitment tool that we do have is @dfn{sxemacs.org} email
1479 addresses.  If you'd like one, contact @sye{}.  Then you can use that
1480 email address whenever and whereever you like.  Hmm, perhaps not
1481 @emph{everywhere}, it might not look so good if you use it for log in
1482 details to a pr0n site. :-P
1483
1484 @node Making/Altering Policies, Version Control, Developer Recruitment, Top
1485 @comment  node-name,  next,  previous,  up
1486 @chapter Making/Altering Policies
1487 @cindex policies, changing
1488
1489 How do you get these policies and proceedures changed?  Simple.  Just
1490 post to @email{sxemacs-devel@@sxemacs.org, SXEmacs Devel} stating
1491 where what how when and why.  If it is non-controversial and makes
1492 sense, it'll probably be accepted quickly.  If not, there could be
1493 lengthy @dfn{discussions} and possibly even a vote @xref{Voting}.
1494
1495 @sy{} will always have the final word and make the ultimate decision,
1496 but he isn't an immovable force, his mind can be changed and he
1497 @emph{does} listen to what the rest of the project is saying. :-)
1498
1499 @node Version Control, Concept Index, Making/Altering Policies, Top
1500 @comment  node-name,  next,  previous,  up
1501 @chapter Version Control
1502 @cindex version control
1503 @cindex arch
1504 @cindex tla
1505 @cindex git
1506
1507 The SXEmacs Project keeps control of its sources with git, starting
1508 with version 22.1.13.
1509 The main repository is that of the Project Lead (@sy{}).  It is
1510 located at:
1511
1512 @smallexample
1513   https://git.sxemacs.org/sxemacs
1514 @end smallexample
1515
1516 Checking out a copy of SXEmacs is as easy as:
1517
1518 @smallexample
1519   git clone https://git.sxemacs.org/sxemacs
1520 @end smallexample
1521
1522 The chapter on patches @pxref{Patches} will show you how to prepare
1523 and send in your contributions. 
1524
1525 @menu
1526 * Setting up a publicly accessible repo::
1527                                    A git repo that others have read
1528                                    access to .
1529 * Setting up a private repos::     A git repo only you have access to.
1530 * Other Developers' Repositories:: Git repos of regular developers of
1531                                    SXEmacs.
1532 @end menu
1533
1534
1535 @node  Setting up a publicly accessible repo, Setting up a private repos, Version Control, Version Control
1536 @comment  node-name,  next,  previous,  up
1537 @chapter Setting up a publicly accessible repo
1538 @cindex version control
1539 @cindex repo
1540 @cindex git
1541 @cindex contributions
1542
1543 You only need to read this section if you are able to host a publicly
1544 accessible repo somewhere.
1545
1546 Getting everything set up is really very easy.  I think you'll be
1547 quite surprised if you haven't done this sort of thing before.  In the
1548 examples below I'm assuming that you have shell access to your remote
1549 host via ssh@dots{}
1550
1551 @smallexample
1552 user@@localhost ~ $ ssh user@@your.host
1553 user@@host ~ $ mkdir -v sxemacs
1554 user@@host ~ $ cd !$
1555 user@@host ~/sxemacs $ git init --bare
1556 user@@host ~/sxemacs $ echo @dfn{Your Name's SXEmacs Repo} > description
1557 user@@host ~/sxemacs $ exit
1558 user@@localhost ~ $ git clone https://git.sxemacs.org/sxemacs
1559 user@@localhost ~ $ cd sxemacs
1560 user@@localhost ~/sxemacs $ contrib/git-for-steve.sh
1561 @end smallexample
1562
1563 And that's it!  Told you it was easy, didn't I?  All you have to do
1564 now is push your local copy to your remote@dots{}
1565
1566 @smallexample
1567 git push @var{myremote} master
1568 @end smallexample
1569
1570
1571 @section Automation
1572
1573 @anchor{Automation}
1574 The last two commands for patch submission listed in @xref{Patch
1575 Submission}, @code{format-patch} and @code{send-email} are fairly long
1576 and hairy.  You'd no doubt have trouble remembering them.  But, never
1577 fear, git has a few tricks up her sleeve to make your life easier.
1578
1579 @subsection Automating with Hooks
1580
1581 If you are lucky enough to @emph{NOT} be using github@footnote{github
1582 is great and may be the ideal solution for you to host your repo
1583 somewhere, but it is inflexible in that you get no shell access, you
1584 can't set up custom hooks, and you are very limited in what git config
1585 settings you can tweak.} to host your publicly accessible repo you can
1586 set up a @dfn{post-receive} hook to automatically send your pull
1587 requests to the SXEmacs mailing list when you push to it.
1588
1589 @subsection Setting Up The post-receive Hook
1590
1591 Remember: This hook runs from your publicly accessible repo (your
1592 remote), and @emph{NOT} from your local working directory.  It is
1593 called after you push to your remote.
1594
1595 Jump over to your remote now and follow these steps
1596
1597 @enumerate
1598 @item
1599 Take a look in the file
1600 @file{hooks/post-receive.sample}.  At the bottom of that file there is
1601 a commented line, that when uncommented would call another script,
1602 @file{post-receive-email}.  Check that the path is correct, and
1603 uncomment it.
1604 @item
1605 Rename @file{hooks/post-receive.sample} to @file{hooks/post-receive}
1606 @item
1607 Tweak the remote's config with@dots{}
1608
1609 @smallexample
1610 git config hooks.mailinglist \
1611     "SXEmacs Patches <sxemacs-patches@@sxemacs.org>"
1612 git config hooks.envelopesender "Your Name <your@@email>"
1613 git config hooks.emailprefix "[P-Req] "
1614 git config hooks.showrev "git show -C %s; echo"
1615 @end smallexample
1616 @item
1617 @code{echo "Your Name's SXEmacs Repo" > description}
1618 @end enumerate
1619
1620 Take note that the SXEmacs mailing lists will funnel any post from
1621 non-subscribers into the moderation queue.  So make sure that the
1622 address you set @dfn{hooks.envelopesender} to is subscribed to the
1623 patches list.
1624
1625 Also be aware that using this @dfn{post-receive} hook will mean that
1626 every time you push to your publicly accessible repo, a message will be
1627 sent to sxemacs-patches; this includes instances where you merely
1628 are pulling the latest from mainline and mirroring. Hence, the use of
1629 aliases as discussed below may be preferable.  We are looking into
1630 ways of avoiding this sort of annoyance.
1631
1632 @subsection Automating with Aliases
1633
1634 @anchor{Automating with Aliases}
1635 Git allows you to define aliases that will let you do all kinds of
1636 funky things.  Remember those hairy @code{format-patch} and
1637 @code{send-email} commands?
1638
1639 @smallexample
1640 git config alias.sxe-fp 'format-patch --add-header="X-Git-Repo: REPO-URL" \
1641     --subject-prefix="P-Req" --numbered'
1642
1643 git config alias.sxe-sm 'send-email \
1644     --to="SXEmacs Patches <sxemacs-patches@@sxemacs.org>" \
1645     --from="$(git config user.name) <$(git config user.email)>"'
1646 @end smallexample
1647
1648 With those 2 aliases set you can get your pull requests in by
1649 doing@dots{}
1650
1651 @code{git sxe-fp -o DIR origin && git sxe-sm DIR}
1652
1653 @subsection Making Life Even Easier with git config
1654
1655 You can make your life even easier by having git store things in its
1656 config.  In this case, you can store those @code{format-patch} and
1657 @code{send-email} command line options in the repo's config@dots{}
1658
1659 @smallexample
1660 git config format.headers "X-Git-Repo: YOUR-REMOTE-URL"
1661 git config format.subjectprefix "P-Req"
1662 git config format.numbered true
1663
1664 git config sendemail.to \
1665     "SXEmacs Patches <sxemacs-patches@@sxemacs.org>"
1666 git config sendemail.from "Your Name <your@@email>"
1667 @end smallexample
1668
1669 With those settings, the commands: @code{git format-patch -o DIR
1670 origin}, and @code{git send-email DIR} are now equivalent of the
1671 original long hairy ones mentioned further up.
1672
1673 Be careful when setting up aliases and config settings that you only
1674 make them global if you absolutely have to.  All the ones I've shown
1675 here have been repo-specific.
1676
1677 The @file{git-for-steve.sh} script in our @file{contrib} directory is
1678 an easy (and recommended) way to set up your git repo.  It'll make
1679 sure that you have everything set up correctly and in an optimal way.
1680
1681 @node  Setting up a private repos, Other Developers' Repositories, Setting up a publicly accessible repo, Version Control
1682 @comment  node-name,  next,  previous,  up
1683 @chapter Setting up a private repos
1684 @cindex version control
1685 @cindex repo
1686 @cindex git
1687 @cindex contributions
1688
1689 Git makes it as easy to create a private repo as getting a checkout
1690 of the source code. In fact, that is all you have to do.
1691
1692 @smallexample
1693   git clone https://git.sxemacs.org/sxemacs
1694 @end smallexample
1695
1696 You may want to follow some of the steps in @xref{Automating with
1697 Aliases}, to ease your life when sending patches if you plan to
1698 contribute frequently from this repo. Please note that in this case
1699 you should not reference any REPO-URL.
1700
1701 However if you do plan to contribute frequently, we strongly suggest
1702 you configure a publicly accessible repos.
1703
1704 More details at @xref{Setting up a publicly accessible repo}.
1705
1706 @node  Other Developers' Repositories,, Setting up a private repos, Version Control
1707 @comment  node-name,  next,  previous,  up
1708 @chapter Other Developers' Repositories
1709 @cindex version control
1710 @cindex repo
1711 @cindex git
1712 @cindex contributions
1713
1714 As previously mentioned, the master SXEmacs repo is at:
1715 @smallexample
1716   https://git.sxemacs.org/sxemacs
1717 @end smallexample
1718
1719 Some of these repos may not be publicly accessible or may not be
1720 accessible 24/7.
1721
1722 @itemize @bullet
1723 @item
1724 Nelson
1725 http://git.nelsonferreira.com/sxemacs
1726 @item
1727 Horst
1728 http://midcom.steveyoungs.com/oss-vc/sxemacs.git
1729 @item
1730 lg
1731 git://github.com/zevlg/SXEmacs.git
1732 @item
1733 Rudi
1734 git://github.com/rudimeier/sxemacs.git
1735 @item
1736 Aidan
1737 http://bitbucket.org/kehoea/sxemacs/
1738 @item
1739 Sebastian
1740 git://github.com/hroptatyr/sxemacs.git
1741 @end itemize
1742
1743 And of course the main repo (Steve's) is at:
1744
1745 https://git.sxemacs.org/sxemacs
1746 https://git.sxemacs.org/website  (our website is under git too)
1747
1748 @subheading The tla repository for versions upto 22.1.12
1749
1750 The old tla repos at http://arch.sxemacs.org/2010 still exist, and
1751 will remain forever.  If you ever need anything from them just install
1752 @code{tla} and leech them with that.
1753
1754 The reason we are keeping them around indefinitely is because the move
1755 to git meant a loss of history.  There are tools available for
1756 converting a arch repo to git, but they failed to work in our case
1757 because of the cached revisions in our repos.
1758
1759 @node Concept Index,, Version Control, Top
1760 @unnumbered Concept Index
1761 @printindex cp
1762
1763 @bye