210 |
that simply loading it has no visible effect---that should not enable |
that simply loading it has no visible effect---that should not enable |
211 |
the feature.@footnote{Consider that the package may be loaded |
the feature.@footnote{Consider that the package may be loaded |
212 |
arbitrarily by Custom for instance.} Users will request the feature by |
arbitrarily by Custom for instance.} Users will request the feature by |
213 |
invoking the command, which will often be constructed as a minor mode. |
invoking the command. It is a good idea to define this command |
214 |
|
as a minor mode. |
215 |
|
|
216 |
@cindex unloading packages |
@cindex unloading packages |
217 |
If your package contains functions which do modify ordinary Emacs |
If loading the file adds functions to hooks, define a function |
218 |
behavior, for instance by adding functions to hooks, define a function |
@code{@var{feature}-unload-hook}, where @var{feature} is the name of |
219 |
@code{@var{feature}-unload-hook} where @var{feature} is the name of |
the feature the package provides, and make it undo any such changes. |
220 |
the feature the package provides. This function should undo any such |
Using @code{unload-feature} to unload the file will run this function. |
221 |
changes, e.g.@: by turning off a minor mode, when |
@xref{Unloading}. |
|
@findex unload-feature |
|
|
@code{unload-feature} is used. |
|
222 |
|
|
223 |
@item |
@item |
224 |
It is a bad idea to define aliases for the Emacs primitives. Use the |
It is a bad idea to define aliases for the Emacs primitives. Use the |
250 |
replacements differs from that of the originals. |
replacements differs from that of the originals. |
251 |
|
|
252 |
@item |
@item |
253 |
|
Avoid using macros that define functions and variables with names that |
254 |
|
are constructed. It is best for maintenance wen the name of the |
255 |
|
function or variable being defined is given explicitly in the source |
256 |
|
code, as the second element of the list---as it is when you use |
257 |
|
@code{defun}, @code{defalias}, @code{defvar} and @code{defopt}. |
258 |
|
|
259 |
|
@item |
260 |
Please keep the names of your Emacs Lisp source files to 13 characters |
Please keep the names of your Emacs Lisp source files to 13 characters |
261 |
or less. This way, if the files are compiled, the compiled files' names |
or less. This way, if the files are compiled, the compiled files' names |
262 |
will be 14 characters or less, which is short enough to fit on all kinds |
will be 14 characters or less, which is short enough to fit on all kinds |
263 |
of Unix systems. |
of Unix systems. |
264 |
|
|
265 |
@item |
@item |
|
@findex next-line |
|
|
@findex previous-line |
|
|
@findex forward-line |
|
266 |
Don't use @code{next-line} or @code{previous-line} in programs; nearly |
Don't use @code{next-line} or @code{previous-line} in programs; nearly |
267 |
always, @code{forward-line} is more convenient as well as more |
always, @code{forward-line} is more convenient as well as more |
268 |
predictable and robust. @xref{Text Lines}. |
predictable and robust. @xref{Text Lines}. |
949 |
context. |
context. |
950 |
|
|
951 |
@item ;;; Documentation: |
@item ;;; Documentation: |
952 |
This has been used in some files in place of @samp{;;; Commentary:}, |
This was used in some files in place of @samp{;;; Commentary:}, |
953 |
but @samp{;;; Commentary:} is preferred. |
but it is deprecated. |
954 |
|
|
955 |
@item ;;; Change Log: |
@item ;;; Change Log: |
956 |
This begins change log information stored in the library file (if you |
This begins change log information stored in the library file (if you |