]> code.delx.au - gnu-emacs/blobdiff - lispref/tips.texi
(interactive-form): New function.
[gnu-emacs] / lispref / tips.texi
index ffebf4a3b9ad50dfe8b82ad84fb65e34327dfb19..031f6b411662981866e9204f1ef7e10cf66ad9e9 100644 (file)
@@ -1,9 +1,10 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1995, 1998 Free Software Foundation, Inc. 
+@c Copyright (C) 1990, 1991, 1992, 1993, 1995, 1998, 1999
+@c   Free Software Foundation, Inc. 
 @c See the file elisp.texi for copying conditions.
 @setfilename ../info/tips
-@node Tips, GNU Emacs Internals, Antinews, Top
+@node Tips, GNU Emacs Internals, GPL, Top
 @appendix Tips and Conventions
 @cindex tips
 @cindex standards of coding style
@@ -38,9 +39,10 @@ code intended for widespread use:
 @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.  Then take care to begin the
-names of all global variables, constants, and functions with the chosen
-prefix.  This helps avoid name conflicts.
+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 variables, constants,
+and functions with the chosen prefix.  This helps avoid name conflicts.
 
 This recommendation applies even to names for traditional Lisp
 primitives that are not primitives in Emacs Lisp---even to
@@ -185,6 +187,8 @@ shift key held down.  These events include @kbd{S-mouse-1},
 users.
 
 @item
+@cindex mouse-2
+@cindex references, following
 Special major modes used for read-only text should usually redefine
 @kbd{mouse-2} and @key{RET} to trace some sort of reference in the text.
 Modes such as Dired, Info, Compilation, and Occur redefine it in this
@@ -196,12 +200,28 @@ good to include a command to enable and disable the feature, Provide a
 command named @code{@var{whatever}-mode} which turns the feature on or
 off, and make it autoload (@pxref{Autoload}).  Design the package so
 that simply loading it has no visible effect---that should not enable
-the feature.  Users will request the feature by invoking the command.
+the feature.@footnote{Consider that the package may be loaded
+arbitrarily by Custom for instance.}  Users will request the feature by
+invoking the command.
 
 @item
 It is a bad idea to define aliases for the Emacs primitives.  Use the
 standard names instead.
 
+@item
+If a package needs to define an alias or a new function for
+compatibility with some other version of Emacs, name if with the package
+prefix, not with the raw name with which it occurs in the other version.
+Here is an example from Gnus, which provides many examples of such
+compatibility issues.
+
+@example
+(defalias 'gnus-point-at-bol
+  (if (fboundp 'point-at-bol)
+      'point-at-bol
+    'line-beginning-position))
+@end example
+
 @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
@@ -544,13 +564,13 @@ would be printed (which usually means in lower case), with single-quotes
 around it.  For example: @samp{`lambda'}.  There are two exceptions:
 write @code{t} and @code{nil} without single-quotes.
 @end iftex
-@ifinfo
+@ifnottex
 When a documentation string refers to a Lisp symbol, write it as it
 would be printed (which usually means in lower case), with single-quotes
 around it.  For example: @samp{lambda}.  There are two exceptions: write
 t and nil without single-quotes.  (In this manual, we use a different
 convention, with single-quotes for all symbols.)
-@end ifinfo
+@end ifnottex
 
 Help mode automatically creates a hyperlink when a documentation string
 uses a symbol name inside single quotes, if the symbol has either a