summaryrefslogtreecommitdiff
path: root/lispref
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-01-05 06:03:24 +0000
committerRichard M. Stallman <rms@gnu.org>1996-01-05 06:03:24 +0000
commit3359ecdb5ab261832ed77347e419149b69b004f7 (patch)
tree9cfca602cfd50402b034b848b7454d9c30537a1c /lispref
parent4712a1739ee00506184a14f7643ee229bd2102b9 (diff)
downloademacs-3359ecdb5ab261832ed77347e419149b69b004f7.tar.gz
Explain eliminating compiler warnings about undefined variables.
Diffstat (limited to 'lispref')
-rw-r--r--lispref/tips.texi11
1 files changed, 11 insertions, 0 deletions
diff --git a/lispref/tips.texi b/lispref/tips.texi
index 3d46466832b..c66b71033c2 100644
--- a/lispref/tips.texi
+++ b/lispref/tips.texi
@@ -246,6 +246,17 @@ 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.