aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-04-01 23:38:01 +0000
committerRichard M. Stallman1997-04-01 23:38:01 +0000
commit2323275b08fcc2f625e59c940ca4d3ca2d7764d8 (patch)
tree4f7f71cf8e3e3837c8ff0c92d50308d448708081
parent4356e9eb88cbb684353c7c05db8d3b6b9018e5bf (diff)
downloademacs-2323275b08fcc2f625e59c940ca4d3ca2d7764d8.tar.gz
emacs-2323275b08fcc2f625e59c940ca4d3ca2d7764d8.zip
(Coding Conventions): Node renamed from Style Tips.
Xref the Major Mode Conventions and Minor Mode Conventions nodes. Other smaller changes in it.
-rw-r--r--lispref/tips.texi33
1 files changed, 19 insertions, 14 deletions
diff --git a/lispref/tips.texi b/lispref/tips.texi
index 1d797fb3ef9..d36ef12a08c 100644
--- a/lispref/tips.texi
+++ b/lispref/tips.texi
@@ -4,28 +4,29 @@
4@c See the file elisp.texi for copying conditions. 4@c See the file elisp.texi for copying conditions.
5@setfilename ../info/tips 5@setfilename ../info/tips
6@node Tips, GNU Emacs Internals, Calendar, Top 6@node Tips, GNU Emacs Internals, Calendar, Top
7@appendix Tips and Standards 7@appendix Tips and Conventions
8@cindex tips 8@cindex tips
9@cindex standards of coding style 9@cindex standards of coding style
10@cindex coding standards 10@cindex coding standards
11 11
12 This chapter describes no additional features of Emacs Lisp. 12 This chapter describes no additional features of Emacs Lisp. Instead
13Instead it gives advice on making effective use of the features described 13it gives advice on making effective use of the features described in the
14in the previous chapters. 14previous chapters, and describes conventions Emacs Lisp programmers
15should follow.
15 16
16@menu 17@menu
17* Style Tips:: Writing clean and robust programs. 18* Coding Conventions:: Conventions for clean and robust programs.
18* Compilation Tips:: Making compiled code run fast. 19* Compilation Tips:: Making compiled code run fast.
19* Documentation Tips:: Writing readable documentation strings. 20* Documentation Tips:: Writing readable documentation strings.
20* Comment Tips:: Conventions for writing comments. 21* Comment Tips:: Conventions for writing comments.
21* Library Headers:: Standard headers for library packages. 22* Library Headers:: Standard headers for library packages.
22@end menu 23@end menu
23 24
24@node Style Tips 25@node Coding Conventions
25@section Writing Clean Lisp Programs 26@section Emacs Lisp Coding Conventions
26 27
27 Here are some tips for avoiding common errors in writing Lisp code 28 Here are conventions that you should follow when writing Emacs Lisp
28intended for widespread use: 29code intended for widespread use:
29 30
30@itemize @bullet 31@itemize @bullet
31@item 32@item
@@ -84,8 +85,12 @@ Using @code{eval-when-compile} avoids loading @var{bar} when
84the compiled version of @var{foo} is @emph{used}. 85the compiled version of @var{foo} is @emph{used}.
85 86
86@item 87@item
87If you define a major mode, make sure to run a hook variable using 88When defining a major mode, please follow the major mode
88@code{run-hooks}, just as the existing major modes do. @xref{Hooks}. 89conventions. @xref{Major Mode Conventions}.
90
91@item
92When defining a minor mode, please follow the minor mode
93conventions. @xref{Minor Mode Conventions}.
89 94
90@item 95@item
91If the purpose of a function is to tell you whether a certain condition 96If the purpose of a function is to tell you whether a certain condition
@@ -160,9 +165,9 @@ It is a bad idea to define aliases for the Emacs primitives. Use the
160standard names instead. 165standard names instead.
161 166
162@item 167@item
163Redefining an Emacs primitive is an even worse idea. 168Redefining (or advising) an Emacs primitive is discouraged. It may do
164It may do the right thing for a particular program, but 169the right thing for a particular program, but there is no telling what
165there is no telling what other programs might break as a result. 170other programs might break as a result.
166 171
167@item 172@item
168If a file does replace any of the functions or library programs of 173If a file does replace any of the functions or library programs of