Mercurial > emacs
comparison lispref/tips.texi @ 52785:2c00436e93f7
Package unloading. Index next-line, previous-line, forward-line.
author | Dave Love <fx@gnu.org> |
---|---|
date | Mon, 06 Oct 2003 16:46:25 +0000 |
parents | 00608f913b6f |
children | bd3047570b72 |
comparison
equal
deleted
inserted
replaced
52784:025f7b9061e6 | 52785:2c00436e93f7 |
---|---|
208 command named @code{@var{whatever}-mode} which turns the feature on or | 208 command named @code{@var{whatever}-mode} which turns the feature on or |
209 off, and make it autoload (@pxref{Autoload}). Design the package so | 209 off, and make it autoload (@pxref{Autoload}). Design the package so |
210 that simply loading it has no visible effect---that should not enable | 210 that simply loading it has no visible effect---that should not enable |
211 the feature.@footnote{Consider that the package may be loaded | 211 the feature.@footnote{Consider that the package may be loaded |
212 arbitrarily by Custom for instance.} Users will request the feature by | 212 arbitrarily by Custom for instance.} Users will request the feature by |
213 invoking the command. | 213 invoking the command, which will often be constructed as a minor mode. |
214 | |
215 @cindex unloading packages | |
216 If your package contains functions which do modify oridinary Emacs | |
217 behavior, for instance by adding functions to hooks, define a function | |
218 @code{@var{feature}-unload-hook} where @var{feature} is the name of | |
219 the feature the package provides. This function should undo any such | |
220 changes, e.g.@: by turning off a minor mode, when | |
221 @findex unload-feature | |
222 @code{unload-feature} is used. | |
214 | 223 |
215 @item | 224 @item |
216 It is a bad idea to define aliases for the Emacs primitives. Use the | 225 It is a bad idea to define aliases for the Emacs primitives. Use the |
217 standard names instead. | 226 standard names instead. |
218 | 227 |
246 or less. This way, if the files are compiled, the compiled files' names | 255 or less. This way, if the files are compiled, the compiled files' names |
247 will be 14 characters or less, which is short enough to fit on all kinds | 256 will be 14 characters or less, which is short enough to fit on all kinds |
248 of Unix systems. | 257 of Unix systems. |
249 | 258 |
250 @item | 259 @item |
260 @findex next-line | |
261 @findex previous-line | |
262 @findex forward-line | |
251 Don't use @code{next-line} or @code{previous-line} in programs; nearly | 263 Don't use @code{next-line} or @code{previous-line} in programs; nearly |
252 always, @code{forward-line} is more convenient as well as more | 264 always, @code{forward-line} is more convenient as well as more |
253 predictable and robust. @xref{Text Lines}. | 265 predictable and robust. @xref{Text Lines}. |
254 | 266 |
255 @item | 267 @item |