diff options
| author | Richard M. Stallman | 1997-04-01 23:38:01 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-04-01 23:38:01 +0000 |
| commit | 2323275b08fcc2f625e59c940ca4d3ca2d7764d8 (patch) | |
| tree | 4f7f71cf8e3e3837c8ff0c92d50308d448708081 | |
| parent | 4356e9eb88cbb684353c7c05db8d3b6b9018e5bf (diff) | |
| download | emacs-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.texi | 33 |
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 |
| 13 | Instead it gives advice on making effective use of the features described | 13 | it gives advice on making effective use of the features described in the |
| 14 | in the previous chapters. | 14 | previous chapters, and describes conventions Emacs Lisp programmers |
| 15 | should 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 |
| 28 | intended for widespread use: | 29 | code 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 | |||
| 84 | the compiled version of @var{foo} is @emph{used}. | 85 | the compiled version of @var{foo} is @emph{used}. |
| 85 | 86 | ||
| 86 | @item | 87 | @item |
| 87 | If you define a major mode, make sure to run a hook variable using | 88 | When defining a major mode, please follow the major mode |
| 88 | @code{run-hooks}, just as the existing major modes do. @xref{Hooks}. | 89 | conventions. @xref{Major Mode Conventions}. |
| 90 | |||
| 91 | @item | ||
| 92 | When defining a minor mode, please follow the minor mode | ||
| 93 | conventions. @xref{Minor Mode Conventions}. | ||
| 89 | 94 | ||
| 90 | @item | 95 | @item |
| 91 | If the purpose of a function is to tell you whether a certain condition | 96 | If 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 | |||
| 160 | standard names instead. | 165 | standard names instead. |
| 161 | 166 | ||
| 162 | @item | 167 | @item |
| 163 | Redefining an Emacs primitive is an even worse idea. | 168 | Redefining (or advising) an Emacs primitive is discouraged. It may do |
| 164 | It may do the right thing for a particular program, but | 169 | the right thing for a particular program, but there is no telling what |
| 165 | there is no telling what other programs might break as a result. | 170 | other programs might break as a result. |
| 166 | 171 | ||
| 167 | @item | 172 | @item |
| 168 | If a file does replace any of the functions or library programs of | 173 | If a file does replace any of the functions or library programs of |