aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2006-05-26 19:32:02 +0000
committerEli Zaretskii2006-05-26 19:32:02 +0000
commit038783e6fc602bb2dc181561f6949389f6484a12 (patch)
tree5967247f356b034a10145a64c109ee5778572370
parent0f7078f033a077cb3a0b7e287cb0d5424d60675e (diff)
downloademacs-038783e6fc602bb2dc181561f6949389f6484a12.tar.gz
emacs-038783e6fc602bb2dc181561f6949389f6484a12.zip
(Coding Conventions): Advise against using eval-after-load in packages.
Add an index entry.
-rw-r--r--lispref/tips.texi17
1 files changed, 14 insertions, 3 deletions
diff --git a/lispref/tips.texi b/lispref/tips.texi
index 889ac3e6a6d..8447a779ea0 100644
--- a/lispref/tips.texi
+++ b/lispref/tips.texi
@@ -35,6 +35,7 @@ all.
35@node Coding Conventions 35@node Coding Conventions
36@section Emacs Lisp Coding Conventions 36@section Emacs Lisp Coding Conventions
37 37
38@cindex coding conventions in Emacs Lisp
38 Here are conventions that you should follow when writing Emacs Lisp 39 Here are conventions that you should follow when writing Emacs Lisp
39code intended for widespread use: 40code intended for widespread use:
40 41
@@ -52,9 +53,9 @@ don't postpone it.
52@item 53@item
53Since all global variables share the same name space, and all 54Since all global variables share the same name space, and all
54functions share another name space, you should choose a short word to 55functions share another name space, you should choose a short word to
55distinguish your program from other Lisp programs.@footnote{The 56distinguish your program from other Lisp programs@footnote{The
56benefits of a Common Lisp-style package system are considered not to 57benefits of a Common Lisp-style package system are considered not to
57outweigh the costs.} Then take care to begin the names of all global 58outweigh the costs.}. Then take care to begin the names of all global
58variables, constants, and functions in your program with the chosen 59variables, constants, and functions in your program with the chosen
59prefix. This helps avoid name conflicts. 60prefix. This helps avoid name conflicts.
60 61
@@ -175,7 +176,17 @@ compatibility issues.
175@item 176@item
176Redefining (or advising) an Emacs primitive is discouraged. It may do 177Redefining (or advising) an Emacs primitive is discouraged. It may do
177the right thing for a particular program, but there is no telling what 178the right thing for a particular program, but there is no telling what
178other programs might break as a result. 179other programs might break as a result. In any case, it is a
180maintenance burden because the two packages become highly dependent on
181each other.
182
183@item
184Likewise, avoid using @code{eval-after-load} (@pxref{Hooks for
185Loading}) in libraries and packages. This feature is meant for
186personal customizations; using it in a Lisp package increases the
187coupling between it and the package mentioned in
188@code{eval-after-load}, and thus makes it harder to maintain the two
189packages independently.
179 190
180@item 191@item
181If a file does replace any of the functions or library programs of 192If a file does replace any of the functions or library programs of