Mercurial > emacs
comparison lispref/tips.texi @ 52845:1826a112381b
(Library Headers): Clean up Documentation.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 13 Oct 2003 19:29:53 +0000 |
parents | df5527dde8fb |
children | 2fdb8b16bceb |
comparison
equal
deleted
inserted
replaced
52844:d16eccf42b43 | 52845:1826a112381b |
---|---|
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, which will often be constructed as a minor mode. | 213 invoking the command. It is a good idea to define this command |
214 as a minor mode. | |
214 | 215 |
215 @cindex unloading packages | 216 @cindex unloading packages |
216 If your package contains functions which do modify ordinary Emacs | 217 If loading the file adds functions to hooks, define a function |
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 |
218 @code{@var{feature}-unload-hook} where @var{feature} is the name of | 219 the feature the package provides, and make it undo any such changes. |
219 the feature the package provides. This function should undo any such | 220 Using @code{unload-feature} to unload the file will run this function. |
220 changes, e.g.@: by turning off a minor mode, when | 221 @xref{Unloading}. |
221 @findex unload-feature | |
222 @code{unload-feature} is used. | |
223 | 222 |
224 @item | 223 @item |
225 It is a bad idea to define aliases for the Emacs primitives. Use the | 224 It is a bad idea to define aliases for the Emacs primitives. Use the |
226 standard names instead. | 225 standard names instead. |
227 | 226 |
249 standard Emacs, prominent comments at the beginning of the file should | 248 standard Emacs, prominent comments at the beginning of the file should |
250 say which functions are replaced, and how the behavior of the | 249 say which functions are replaced, and how the behavior of the |
251 replacements differs from that of the originals. | 250 replacements differs from that of the originals. |
252 | 251 |
253 @item | 252 @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 | |
254 Please keep the names of your Emacs Lisp source files to 13 characters | 260 Please keep the names of your Emacs Lisp source files to 13 characters |
255 or less. This way, if the files are compiled, the compiled files' names | 261 or less. This way, if the files are compiled, the compiled files' names |
256 will be 14 characters or less, which is short enough to fit on all kinds | 262 will be 14 characters or less, which is short enough to fit on all kinds |
257 of Unix systems. | 263 of Unix systems. |
258 | 264 |
259 @item | 265 @item |
260 @findex next-line | |
261 @findex previous-line | |
262 @findex forward-line | |
263 Don't use @code{next-line} or @code{previous-line} in programs; nearly | 266 Don't use @code{next-line} or @code{previous-line} in programs; nearly |
264 always, @code{forward-line} is more convenient as well as more | 267 always, @code{forward-line} is more convenient as well as more |
265 predictable and robust. @xref{Text Lines}. | 268 predictable and robust. @xref{Text Lines}. |
266 | 269 |
267 @item | 270 @item |
944 @samp{Change Log}, @samp{History} or @samp{Code} comment line. This | 947 @samp{Change Log}, @samp{History} or @samp{Code} comment line. This |
945 text is used by the Finder package, so it should make sense in that | 948 text is used by the Finder package, so it should make sense in that |
946 context. | 949 context. |
947 | 950 |
948 @item ;;; Documentation: | 951 @item ;;; Documentation: |
949 This has been used in some files in place of @samp{;;; Commentary:}, | 952 This was used in some files in place of @samp{;;; Commentary:}, |
950 but @samp{;;; Commentary:} is preferred. | 953 but it is deprecated. |
951 | 954 |
952 @item ;;; Change Log: | 955 @item ;;; Change Log: |
953 This begins change log information stored in the library file (if you | 956 This begins change log information stored in the library file (if you |
954 store the change history there). For Lisp files distributed with Emacs, | 957 store the change history there). For Lisp files distributed with Emacs, |
955 the change history is kept in the file @file{ChangeLog} and not in the | 958 the change history is kept in the file @file{ChangeLog} and not in the |