]> code.delx.au - gnu-emacs/commitdiff
(Coding Conventions): Advise against using eval-after-load in packages.
authorEli Zaretskii <eliz@gnu.org>
Fri, 26 May 2006 19:32:02 +0000 (19:32 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 26 May 2006 19:32:02 +0000 (19:32 +0000)
Add an index entry.

lispref/tips.texi

index 889ac3e6a6da919e6edbc0776c5db8885b169b5d..8447a779ea0dbff6a50273747b93d0cb9ed27814 100644 (file)
@@ -35,6 +35,7 @@ all.
 @node Coding Conventions
 @section Emacs Lisp Coding Conventions
 
+@cindex coding conventions in Emacs Lisp
   Here are conventions that you should follow when writing Emacs Lisp
 code intended for widespread use:
 
@@ -52,9 +53,9 @@ don't postpone it.
 @item
 Since all global variables share the same name space, and all
 functions share another name space, you should choose a short word to
-distinguish your program from other Lisp programs.@footnote{The
+distinguish your program from other Lisp programs@footnote{The
 benefits of a Common Lisp-style package system are considered not to
-outweigh the costs.}  Then take care to begin the names of all global
+outweigh the costs.}.  Then take care to begin the names of all global
 variables, constants, and functions in your program with the chosen
 prefix.  This helps avoid name conflicts.
 
@@ -175,7 +176,17 @@ compatibility issues.
 @item
 Redefining (or advising) an Emacs primitive is discouraged.  It may do
 the right thing for a particular program, but there is no telling what
-other programs might break as a result.
+other programs might break as a result.  In any case, it is a
+maintenance burden because the two packages become highly dependent on
+each other.
+
+@item
+Likewise, avoid using @code{eval-after-load} (@pxref{Hooks for
+Loading}) in libraries and packages.  This feature is meant for
+personal customizations; using it in a Lisp package increases the
+coupling between it and the package mentioned in
+@code{eval-after-load}, and thus makes it harder to maintain the two
+packages independently.
 
 @item
 If a file does replace any of the functions or library programs of