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