Mercurial > hg > xemacs-beta
view etc/CODING-STANDARDS @ 593:5fd7ba8b56e7
[xemacs-hg @ 2001-05-31 12:45:27 by ben]
xemacs-faq.texi: Major rewrite.
Update all MS Windows info to current.
Redo section 6.1 almost completely.
Incorporate sections 1 and 2 of Hrvoje's FAQ.
etags.el: Fix infloop when going up to the root.
s\cygwin32.h: Don't unilaterally include ntplay, but only when we're compiling
with native sound (look in configure now).
event-msw.c: Fix yet more problems with C-g handling.
Implement debug-mswindows-events.
event-stream.c, events.h, signal.c, sysdep.h:
Rearrange the signal-handling code to eliminate the former
spaghetti logic paths in it. Document clearly what
"low-level" and "high-level" timeouts are. Rename some
functions with unclear names (e.g. "...alarm...") to names
that reflect what they actually do (e.g. "...async_timeout...").
Fix numerous bugs discovered in the process.
console-x.h, event-Xt.c, event-msw.c, frame-x.c:
Hopefully make XEmacs properly maintain the "iconified"
state on frames at all times. This should fix the "can't
delete a frame with C-x 5 0 when there's another iconified
frame out there" bug.
Put a notice in of further changes that should probably
be made to clean up the frame-visibility support.
(especially directed at Jan Vroonhof)
lisp.h, miscplay.c:
Rename SBufbyte to CBufbyte to avoid a misleading name.
Eliminate UChar, which is not used anywhere and contributes
no semantic info. Add a comment about the documentation-only
properties of the char/unsigned char typedefs. Add
SChar_Binary as an explicitly `signed' version of Char_Binary
and put back the `signed' declarations in miscplay.c.
alloc.c:
Use char typedefs.
console-msw.c, device-msw.c, dialog-msw.c, editfns.c, fileio.c, glyphs-eimage.c, menubar-msw.c, ntplay.c, objects-msw.c, realpath.c, redisplay-msw.c, select-msw.c, syswindows.h, win32.c:
Eliminate numerous C++ errors.
frame-msw.c:
Eliminate numerous C++ errors and Mule-ize.
glyphs-msw.c:
Eliminate numerous C++ errors and use char typedefs.
configure.in:
Fix problems detecting both native and Linux sound on Cygwin
when compiled with --with-msw=no.
Rearrange file-coding handling a bit to avoid warning when
compiling with Mule.
configure.in, configure.usage, INSTALL:
Document XEMACS_CC and corresponding compiler option --xemacs-compiler.
Explain how to build xemacs using a C++ compiler.
author | ben |
---|---|
date | Thu, 31 May 2001 12:45:41 +0000 |
parents | 376386a54a3c |
children |
line wrap: on
line source
XEMACS CODING STANDARDS by Ben Wing Copyright (c) 1996 Ben Wing. This file documents the coding standards used in the XEmacs source code. Note that XEmacs follows the GNU coding standards, which are documented separately in ../man/standards.texi. This file only documents standards that are not included in that document; typically this consists of standards that are specifically relevant to the XEmacs code itself. First, a recap of the GNU standards: -- Put a space after every comma. -- Put a space before the parenthesis that begins a function call, macro call, function declaration or definition, or control statement (if, while, switch, for). (DO NOT do this for macro definitions; this is invalid preprocessor syntax.) -- The brace that begins a control statement (if, while, for, switch, do) or a function definition should go on a line by itself. -- In function definitions, put the return type and all other qualifiers on a line before the function name. Thus, the function name is always at the beginning of a line. -- Indentation level is two spaces. (However, the first and following statements of a while/for/if/etc. block are indented four spaces from the while/for/if keyword. The opening and closing braces are indented two spaces.) -- Variable and function names should be all lowercase, with underscores separating words, except for a prefixing tag, which may be in uppercase. Do not use the mixed-case convention (e.g. SetVariableToValue ()) and *especially* do not use Microsoft Hungarian notation (char **rgszRedundantTag). -- preprocessor and enum constants should be all uppercase, and should be prefixed with a tag that groups related constants together. Now, the XEmacs coding standards: **** Specially-prefixed functions/variables: -- All global C variables whose value is constant and is a symbol begin with a capital Q, e.g. Qkey_press_event. (The type will always be Lisp_Object.) -- All other global C variables whose value is a Lisp_Object (this includes variables that forward into Lisp variables plus others like Vselected_console) begin with a capital V. -- No C variables whose value is other than a Lisp_Object should begin with a capital V. (This includes C variables that forward into integer or boolean Lisp variables.) -- All global C variables whose value is a struct Lisp_Subr begin with a capital S. (This only occurs in connection with DEFUN ()). -- All C functions that are Lisp primitives begin with a capital F, and no others should begin this way. **** Functions for manipulating Lisp types: -- Any function that creates an empty or mostly empty Lisp object should begin allocate_(). (*Not* make_().) (Except, of course, for Lisp primitives, which usually begin Fmake_()). -- Any function that converts a pointer into an equivalent Lisp_Object should begin make_(). -- Any function that converts a Lisp_Object into its equivalent pointer and checks the type and validity of the object (e.g. making sure it's not dead) should begin decode_(). -- Any function that looks up a Lisp object (e.g. buffer, face) given a symbol or string should begin get_(). (Except, of course, for Lisp primitives, which usually begin Fget_()). **** Other: -- Any header-file declarations of the sort struct foobar; go into the "types" section of lisp.h.