From: Richard M. Stallman Date: Fri, 5 Jan 1996 06:03:24 +0000 (+0000) Subject: Explain eliminating compiler warnings about undefined variables. X-Git-Tag: emacs-19.34~1832 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6a994023c4e73dfeb72881d915e2ed17396b2792;p=emacs.git Explain eliminating compiler warnings about undefined variables. --- diff --git a/lispref/tips.texi b/lispref/tips.texi index 3d46466832b..c66b71033c2 100644 --- a/lispref/tips.texi +++ b/lispref/tips.texi @@ -245,6 +245,17 @@ Lisp, so please don't use it in your programs. (Emacs uses such names only for program-generated buffers.) The users will find Emacs more coherent if all libraries use the same conventions. +@item +Try to avoid compiler warnings about undefined free variables, by adding +@cdode{defvar} definitions for these variables. + +If you bind a variable in one function, and use it or set it in another +function, the compiler warns about the latter function unless the +variable has a definition. But often these variables have short names, +and it is not clean for Lisp packages to define such variables names. +Therefore, you should rename the variable to start with the name prefix +used for the other functions and variables in your package. + @item Indent each function with @kbd{C-M-q} (@code{indent-sexp}) using the default indentation parameters.