aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/FOR-RELEASE2
-rw-r--r--doc/lispref/ChangeLog13
-rw-r--r--doc/lispref/tips.texi273
3 files changed, 142 insertions, 146 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 8e712f5fcf8..31a2a7ddbf7 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -227,7 +227,7 @@ strings.texi cyd
227symbols.texi cyd 227symbols.texi cyd
228syntax.texi cyd 228syntax.texi cyd
229text.texi 229text.texi
230tips.texi 230tips.texi rgm
231variables.texi cyd 231variables.texi cyd
232windows.texi 232windows.texi
233 233
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 254ad0ae83b..bfd49e82d83 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,16 @@
12012-03-03 Glenn Morris <rgm@gnu.org>
2
3 * tips.texi: Copyedits.
4 (Coding Conventions): Mention autoloads.
5 Combine partially duplicated macro items. Fix xref.
6 Refer to Library Headers for copyright notice.
7 (Programming Tips): edit-options is long-obsolete.
8 (Compilation Tips): Mention loading bytecomp for byte-compile props.
9 (Warning Tips): Mention declare-function.
10 (Documentation Tips): Remove old info.
11 (Comment Tips): Mention comment-dwim, not indent-for-comment.
12 (Library Headers): General update.
13
12012-03-02 Glenn Morris <rgm@gnu.org> 142012-03-02 Glenn Morris <rgm@gnu.org>
2 15
3 * backups.texi (Reverting): Un-duplicate revert-buffer-in-progress-p, 16 * backups.texi (Reverting): Un-duplicate revert-buffer-in-progress-p,
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index ad1f622bfac..5874a848807 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -58,7 +58,7 @@ Separate the prefix from the rest of the name with a hyphen, @samp{-}.
58This practice helps avoid name conflicts, since all global variables 58This practice helps avoid name conflicts, since all global variables
59in Emacs Lisp share the same name space, and all functions share 59in Emacs Lisp share the same name space, and all functions share
60another name space@footnote{The benefits of a Common Lisp-style 60another name space@footnote{The benefits of a Common Lisp-style
61package system are considered not to outweigh the costs.} 61package system are considered not to outweigh the costs.}.
62 62
63Occasionally, for a command name intended for users to use, it is more 63Occasionally, for a command name intended for users to use, it is more
64convenient if some words come before the package's name prefix. And 64convenient if some words come before the package's name prefix. And
@@ -110,6 +110,17 @@ called before the first use of the macro in the file. @xref{Compiling
110Macros}. 110Macros}.
111 111
112@item 112@item
113Avoid loading additional libraries at run time unless they are really
114needed. If your file simply cannot work without some other library,
115then just @code{require} that library at the top-level and be done
116with it. But if your file contains several independent features, and
117only one or two require the extra library, then consider putting
118@code{require} statements inside the relevant functions rather than at
119the top-level. Or use @code{autoload} statements to load the extra
120library when needed. This way people who don't use those aspects of
121your file do not need to load the extra library.
122
123@item
113Please don't require the @code{cl} package of Common Lisp extensions at 124Please don't require the @code{cl} package of Common Lisp extensions at
114run time. Use of this package is optional, and it is not part of the 125run time. Use of this package is optional, and it is not part of the
115standard Emacs namespace. If your package loads @code{cl} at run time, 126standard Emacs namespace. If your package loads @code{cl} at run time,
@@ -194,11 +205,8 @@ replacements differs from that of the originals.
194 205
195@item 206@item
196Constructs that define a function or variable should be macros, 207Constructs that define a function or variable should be macros,
197not functions, and their names should start with @samp{def}. 208not functions, and their names should start with @samp{define-}.
198 209The macro should receive the name to be
199@item
200A macro that defines a function or variable should have a name that
201starts with @samp{define-}. The macro should receive the name to be
202defined as the first argument. That will help various tools find the 210defined as the first argument. That will help various tools find the
203definition automatically. Avoid constructing the names in the macro 211definition automatically. Avoid constructing the names in the macro
204itself, since that would confuse these tools. 212itself, since that would confuse these tools.
@@ -207,7 +215,7 @@ itself, since that would confuse these tools.
207In some other systems there is a convention of choosing variable names 215In some other systems there is a convention of choosing variable names
208that begin and end with @samp{*}. We don't use that convention in Emacs 216that begin and end with @samp{*}. We don't use that convention in Emacs
209Lisp, so please don't use it in your programs. (Emacs uses such names 217Lisp, so please don't use it in your programs. (Emacs uses such names
210only for special-purpose buffers.) The users will find Emacs more 218only for special-purpose buffers.) People will find Emacs more
211coherent if all libraries use the same conventions. 219coherent if all libraries use the same conventions.
212 220
213@item 221@item
@@ -216,7 +224,7 @@ constants, you should make sure Emacs always decodes these characters
216the same way, regardless of the user's settings. The easiest way to 224the same way, regardless of the user's settings. The easiest way to
217do this is to use the coding system @code{utf-8-emacs} (@pxref{Coding 225do this is to use the coding system @code{utf-8-emacs} (@pxref{Coding
218System Basics}), and specify that coding in the @samp{-*-} line or the 226System Basics}), and specify that coding in the @samp{-*-} line or the
219local variables list. @xref{File variables, , Local Variables in 227local variables list. @xref{File Variables, , Local Variables in
220Files, emacs, The GNU Emacs Manual}. 228Files, emacs, The GNU Emacs Manual}.
221 229
222@example 230@example
@@ -224,8 +232,7 @@ Files, emacs, The GNU Emacs Manual}.
224@end example 232@end example
225 233
226@item 234@item
227Indent each function with @kbd{C-M-q} (@code{indent-sexp}) using the 235Indent the file using the default indentation parameters.
228default indentation parameters.
229 236
230@item 237@item
231Don't make a habit of putting close-parentheses on lines by 238Don't make a habit of putting close-parentheses on lines by
@@ -233,29 +240,8 @@ themselves; Lisp programmers find this disconcerting.
233 240
234@item 241@item
235Please put a copyright notice and copying permission notice on the 242Please put a copyright notice and copying permission notice on the
236file if you distribute copies. Use a notice like this one: 243file if you distribute copies. @xref{Library Headers}.
237
238@smallexample
239;; Copyright (C) @var{year} @var{name}
240
241;; This program is free software: you can redistribute it and/or
242;; modify it under the terms of the GNU General Public License as
243;; published by the Free Software Foundation, either version 3 of
244;; the License, or (at your option) any later version.
245 244
246;; This program is distributed in the hope that it will be useful,
247;; but WITHOUT ANY WARRANTY; without even the implied warranty of
248;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
249;; GNU General Public License for more details.
250
251;; You should have received a copy of the GNU General Public License
252;; along with this program. If not, see
253;; <http://www.gnu.org/licenses/>.
254@end smallexample
255
256If you have signed papers to assign the copyright to the Foundation,
257then use @samp{Free Software Foundation, Inc.} as @var{name}.
258Otherwise, use your name. @xref{Library Headers}.
259@end itemize 245@end itemize
260 246
261@node Key Binding Conventions 247@node Key Binding Conventions
@@ -324,11 +310,11 @@ Similarly, don't bind a key sequence ending in @key{C-g}, since that
324is commonly used to cancel a key sequence. 310is commonly used to cancel a key sequence.
325 311
326@item 312@item
327Anything which acts like a temporary mode or state which the user can 313Anything that acts like a temporary mode or state that the user can
328enter and leave should define @kbd{@key{ESC} @key{ESC}} or 314enter and leave should define @kbd{@key{ESC} @key{ESC}} or
329@kbd{@key{ESC} @key{ESC} @key{ESC}} as a way to escape. 315@kbd{@key{ESC} @key{ESC} @key{ESC}} as a way to escape.
330 316
331For a state which accepts ordinary Emacs commands, or more generally any 317For a state that accepts ordinary Emacs commands, or more generally any
332kind of state in which @key{ESC} followed by a function key or arrow key 318kind of state in which @key{ESC} followed by a function key or arrow key
333is potentially meaningful, then you must not define @kbd{@key{ESC} 319is potentially meaningful, then you must not define @kbd{@key{ESC}
334@key{ESC}}, since that would preclude recognizing an escape sequence 320@key{ESC}}, since that would preclude recognizing an escape sequence
@@ -398,8 +384,8 @@ An error message should start with a capital letter but should not end
398with a period. 384with a period.
399 385
400@item 386@item
401A question asked in the minibuffer with @code{y-or-n-p} or 387A question asked in the minibuffer with @code{yes-or-no-p} or
402@code{yes-or-no-p} should start with a capital letter and end with 388@code{y-or-n-p} should start with a capital letter and end with
403@samp{? }. 389@samp{? }.
404 390
405@item 391@item
@@ -457,10 +443,9 @@ to generate such messages.
457 443
458@item 444@item
459Try to avoid using recursive edits. Instead, do what the Rmail @kbd{e} 445Try to avoid using recursive edits. Instead, do what the Rmail @kbd{e}
460command does: use a new local keymap that contains one command defined 446command does: use a new local keymap that contains a command defined
461to switch back to the old local keymap. Or do what the 447to switch back to the old local keymap. Or simply switch to another
462@code{edit-options} command does: switch to another buffer and let the 448buffer and let the user switch back at will. @xref{Recursive Editing}.
463user switch back at will. @xref{Recursive Editing}.
464@end itemize 449@end itemize
465 450
466@node Compilation Tips 451@node Compilation Tips
@@ -515,6 +500,10 @@ compiled specially (@pxref{Array Functions}):
515@end group 500@end group
516@end example 501@end example
517 502
503@noindent
504Note that in this case (and many others), you must first load the
505@file{bytecomp} library, which defines the @code{byte-compile} property.
506
518@item 507@item
519If calling a small function accounts for a substantial part of your 508If calling a small function accounts for a substantial part of your
520program's running time, make the function inline. This eliminates 509program's running time, make the function inline. This eliminates
@@ -541,6 +530,11 @@ Such a definition has no effect except to tell the compiler
541not to warn about uses of the variable @code{foo} in this file. 530not to warn about uses of the variable @code{foo} in this file.
542 531
543@item 532@item
533Similarly, to avoid a compiler warning about an undefined function
534that you know @emph{will} be defined, use a @code{declare-function}
535statement (@pxref{Declaring Functions}).
536
537@item
544If you use many functions and variables from a certain file, you can 538If you use many functions and variables from a certain file, you can
545add a @code{require} for that package to avoid compilation warnings 539add a @code{require} for that package to avoid compilation warnings
546for them. For instance, 540for them. For instance,
@@ -561,8 +555,8 @@ functions and variables in your package.
561 555
562@item 556@item
563The last resort for avoiding a warning, when you want to do something 557The last resort for avoiding a warning, when you want to do something
564that usually is a mistake but it's not a mistake in this one case, 558that is usually a mistake but you know is not a mistake in your usage,
565is to put a call to @code{with-no-warnings} around it. 559is to put it inside @code{with-no-warnings}. @xref{Compiler Errors}.
566@end itemize 560@end itemize
567 561
568@node Documentation Tips 562@node Documentation Tips
@@ -580,11 +574,9 @@ Every command, function, or variable intended for users to know about
580should have a documentation string. 574should have a documentation string.
581 575
582@item 576@item
583An internal variable or subroutine of a Lisp program might as well have 577An internal variable or subroutine of a Lisp program might as well
584a documentation string. In earlier Emacs versions, you could save space 578have a documentation string. Documentation strings take up very
585by using a comment instead of a documentation string, but that is no 579little space in a running Emacs.
586longer the case---documentation strings now take up very little space in
587a running Emacs.
588 580
589@item 581@item
590Format the documentation string so that it fits in an Emacs window on an 582Format the documentation string so that it fits in an Emacs window on an
@@ -595,14 +587,14 @@ or it will look bad in the output of @code{apropos}.
595You can fill the text if that looks good. However, rather than blindly 587You can fill the text if that looks good. However, rather than blindly
596filling the entire documentation string, you can often make it much more 588filling the entire documentation string, you can often make it much more
597readable by choosing certain line breaks with care. Use blank lines 589readable by choosing certain line breaks with care. Use blank lines
598between topics if the documentation string is long. 590between sections if the documentation string is long.
599 591
600@item 592@item
601The first line of the documentation string should consist of one or two 593The first line of the documentation string should consist of one or two
602complete sentences that stand on their own as a summary. @kbd{M-x 594complete sentences that stand on their own as a summary. @kbd{M-x
603apropos} displays just the first line, and if that line's contents don't 595apropos} displays just the first line, and if that line's contents don't
604stand on their own, the result looks bad. In particular, start the 596stand on their own, the result looks bad. In particular, start the
605first line with a capital letter and end with a period. 597first line with a capital letter and end it with a period.
606 598
607For a function, the first line should briefly answer the question, 599For a function, the first line should briefly answer the question,
608``What does this function do?'' For a variable, the first line should 600``What does this function do?'' For a variable, the first line should
@@ -630,7 +622,7 @@ important arguments.
630When a function's documentation string mentions the value of an argument 622When a function's documentation string mentions the value of an argument
631of the function, use the argument name in capital letters as if it were 623of the function, use the argument name in capital letters as if it were
632a name for that value. Thus, the documentation string of the function 624a name for that value. Thus, the documentation string of the function
633@code{eval} refers to its second argument as @samp{FORM}, because the 625@code{eval} refers to its first argument as @samp{FORM}, because the
634actual argument name is @code{form}: 626actual argument name is @code{form}:
635 627
636@example 628@example
@@ -654,7 +646,7 @@ string. If the symbol's name is @code{foo}, write ``foo,'' not
654 646
655This might appear to contradict the policy of writing function 647This might appear to contradict the policy of writing function
656argument values, but there is no real contradiction; the argument 648argument values, but there is no real contradiction; the argument
657@emph{value} is not the same thing as the @emph{symbol} which the 649@emph{value} is not the same thing as the @emph{symbol} that the
658function uses to hold the value. 650function uses to hold the value.
659 651
660If this puts a lower-case letter at the beginning of a sentence 652If this puts a lower-case letter at the beginning of a sentence
@@ -825,8 +817,8 @@ In Dired, visit the file or directory named on this line.
825@end example 817@end example
826 818
827@item 819@item
828When you define a variable that users ought to set interactively, you 820When you define a variable that represents an option users might want
829should use @code{defcustom}. @xref{Defining Variables}. 821to set, use @code{defcustom}. @xref{Defining Variables}.
830 822
831@item 823@item
832The documentation string for a variable that is a yes-or-no flag should 824The documentation string for a variable that is a yes-or-no flag should
@@ -839,19 +831,14 @@ all non-@code{nil} values are equivalent and indicate explicitly what
839@section Tips on Writing Comments 831@section Tips on Writing Comments
840@cindex comments, Lisp convention for 832@cindex comments, Lisp convention for
841 833
842 We recommend these conventions for where to put comments and how to 834 We recommend these conventions for comments:
843indent them:
844 835
845@table @samp 836@table @samp
846@item ; 837@item ;
847Comments that start with a single semicolon, @samp{;}, should all be 838Comments that start with a single semicolon, @samp{;}, should all be
848aligned to the same column on the right of the source code. Such 839aligned to the same column on the right of the source code. Such
849comments usually explain how the code on the same line does its job. In 840comments usually explain how the code on that line does its job.
850Lisp mode and related modes, the @kbd{M-;} (@code{indent-for-comment}) 841For example:
851command automatically inserts such a @samp{;} in the right place, or
852aligns such a comment if it is already present.
853
854This and following examples are taken from the Emacs sources.
855 842
856@smallexample 843@smallexample
857@group 844@group
@@ -873,7 +860,7 @@ at that point. For example:
873(prog1 (setq auto-fill-function 860(prog1 (setq auto-fill-function
874 @dots{} 861 @dots{}
875 @dots{} 862 @dots{}
876 ;; update mode line 863 ;; Update mode line.
877 (force-mode-line-update))) 864 (force-mode-line-update)))
878@end group 865@end group
879@end smallexample 866@end smallexample
@@ -882,17 +869,17 @@ We also normally use two semicolons for comments outside functions.
882 869
883@smallexample 870@smallexample
884@group 871@group
885;; This Lisp code is run in Emacs 872;; This Lisp code is run in Emacs when it is to operate as
886;; when it is to operate as a server 873;; a server for other processes.
887;; for other processes.
888@end group 874@end group
889@end smallexample 875@end smallexample
890 876
891Every function that has no documentation string (presumably one that is 877If a function has no documentation string, it should instead have a
892used only internally within the package it belongs to), should instead 878two-semicolon comment right before the function, explaining what the
893have a two-semicolon comment right before the function, explaining what 879function does and how to call it properly. Explain precisely what
894the function does and how to call it properly. Explain precisely what 880each argument means and how the function interprets its possible
895each argument means and how the function interprets its possible values. 881values. It is much better to convert such comments to documentation
882strings, though.
896 883
897@item ;;; 884@item ;;;
898Comments that start with three semicolons, @samp{;;;}, should start at 885Comments that start with three semicolons, @samp{;;;}, should start at
@@ -903,7 +890,7 @@ semicolons depends on whether the comment should be considered a
903``heading'' by Outline minor mode. By default, comments starting with 890``heading'' by Outline minor mode. By default, comments starting with
904at least three semicolons (followed by a single space and a 891at least three semicolons (followed by a single space and a
905non-whitespace character) are considered headings, comments starting 892non-whitespace character) are considered headings, comments starting
906with two or less are not. 893with two or fewer are not.
907 894
908Another use for triple-semicolon comments is for commenting out lines 895Another use for triple-semicolon comments is for commenting out lines
909within a function. We use three semicolons for this precisely so that 896within a function. We use three semicolons for this precisely so that
@@ -934,11 +921,11 @@ program. For example:
934@end table 921@end table
935 922
936@noindent 923@noindent
937The indentation commands of the Lisp modes in Emacs, such as @kbd{M-;} 924Generally speaking, the @kbd{M-;} (@code{comment-dwim}) command
938(@code{indent-for-comment}) and @key{TAB} (@code{lisp-indent-line}), 925automatically starts a comment of the appropriate type; or indents an
939automatically indent comments according to these conventions, 926existing comment to the right place, depending on the number of
940depending on the number of semicolons. @xref{Comments,, 927semicolons.
941Manipulating Comments, emacs, The GNU Emacs Manual}. 928@xref{Comments,, Manipulating Comments, emacs, The GNU Emacs Manual}.
942 929
943@node Library Headers 930@node Library Headers
944@section Conventional Headers for Emacs Libraries 931@section Conventional Headers for Emacs Libraries
@@ -947,39 +934,28 @@ Manipulating Comments, emacs, The GNU Emacs Manual}.
947 934
948 Emacs has conventions for using special comments in Lisp libraries 935 Emacs has conventions for using special comments in Lisp libraries
949to divide them into sections and give information such as who wrote 936to divide them into sections and give information such as who wrote
950them. This section explains these conventions. 937them. Using a standard format for these items makes it easier for
951 938tools (and people) to extract the relevant information. This section
952 We'll start with an example, a package that is included in the Emacs 939explains these conventions, starting with an example:
953distribution.
954
955 Parts of this example reflect its status as part of Emacs; for
956example, the copyright notice lists the Free Software Foundation as the
957copyright holder, and the copying permission says the file is part of
958Emacs. When you write a package and post it, the copyright holder would
959be you (unless your employer claims to own it instead), and you should
960get the suggested copying permission from the end of the GNU General
961Public License itself. Don't say your file is part of Emacs
962if we haven't installed it in Emacs yet!
963
964 With that warning out of the way, on to the example:
965 940
966@smallexample 941@smallexample
967@group 942@group
968;;; lisp-mnt.el --- minor mode for Emacs Lisp maintainers 943;;; foo.el --- Support for the Foo programming language
969 944
970;; Copyright (C) 1992 Free Software Foundation, Inc. 945;; Copyright (C) 2010-2012 Your Name
971@end group 946@end group
972 947
973;; Author: Eric S. Raymond <esr@@snark.thyrsus.com> 948;; Author: Your Name <yourname@@example.com>
974;; Maintainer: Eric S. Raymond <esr@@snark.thyrsus.com> 949;; Maintainer: Someone Else <someone@@example.com>
975;; Created: 14 Jul 1992 950;; Created: 14 Jul 2010
976;; Version: 1.2
977@group 951@group
978;; Keywords: docs 952;; Keywords: languages
979 953
980;; This file is part of GNU Emacs. 954;; This file is not part of GNU Emacs.
955
956;; This file is free software@dots{}
981@dots{} 957@dots{}
982;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 958;; along with this file. If not, see <http://www.gnu.org/licenses/>.
983@end group 959@end group
984@end smallexample 960@end smallexample
985 961
@@ -990,8 +966,19 @@ if we haven't installed it in Emacs yet!
990@end example 966@end example
991 967
992@noindent 968@noindent
993The description should be complete in one line. If the file 969The description should be contained in one line. If the file
994needs a @samp{-*-} specification, put it after @var{description}. 970needs a @samp{-*-} specification, put it after @var{description}.
971If this would make the first line too long, use a Local Variables
972section at the end of the file.
973
974 The copyright notice usually lists your name (if you wrote the
975file). If you have an employer who claims copyright on your work, you
976might need to list them instead. Do not say that the copyright holder
977is the Free Software Foundation (or that the file is part of GNU
978Emacs) unless your file has been accepted into the Emacs distribution.
979For more information on the form of copyright and license notices, see
980@uref{http://www.gnu.org/licenses/gpl-howto.html, the guide on the GNU
981website}.
995 982
996 After the copyright notice come several @dfn{header comment} lines, 983 After the copyright notice come several @dfn{header comment} lines,
997each beginning with @samp{;; @var{header-name}:}. Here is a table of 984each beginning with @samp{;; @var{header-name}:}. Here is a table of
@@ -999,55 +986,55 @@ the conventional possibilities for @var{header-name}:
999 986
1000@table @samp 987@table @samp
1001@item Author 988@item Author
1002This line states the name and net address of at least the principal 989This line states the name and email address of at least the principal
1003author of the library. 990author of the library. If there are multiple authors, list them on
1004 991continuation lines led by @code{;;} and whitespace (this is easier
1005If there are multiple authors, you can list them on continuation lines 992for tools to parse than having more than one author on one line).
1006led by @code{;;} and a tab character, like this: 993We recommend including a contact email address, of the form
994@samp{<@dots{}>}. For example:
1007 995
1008@smallexample 996@smallexample
1009@group 997@group
1010;; Author: Ashwin Ram <Ram-Ashwin@@cs.yale.edu> 998;; Author: Your Name <yourname@@example.com>
1011;; Dave Sill <de5@@ornl.gov> 999;; Someone Else <someone@@example.com>
1012;; Dave Brennan <brennan@@hal.com> 1000;; Another Person <another@@example.com>
1013;; Eric Raymond <esr@@snark.thyrsus.com>
1014@end group 1001@end group
1015@end smallexample 1002@end smallexample
1016 1003
1017@item Maintainer 1004@item Maintainer
1018This line should contain a single name/address as in the Author line, or 1005This header has the same format as the Author header. It lists the
1019an address only, or the string @samp{FSF}. If there is no maintainer 1006person(s) who currently maintain(s) the file (respond to bug reports,
1020line, the person(s) in the Author field are presumed to be the 1007etc.).
1021maintainers. The example above is mildly bogus because the maintainer
1022line is redundant.
1023
1024The idea behind the @samp{Author} and @samp{Maintainer} lines is to make
1025possible a Lisp function to ``send mail to the maintainer'' without
1026having to mine the name out by hand.
1027 1008
1028Be sure to surround the network address with @samp{<@dots{}>} if 1009If there is no maintainer line, the person(s) in the Author field
1029you include the person's full name as well as the network address. 1010is/are presumed to be the maintainers. Some files in Emacs use
1011@samp{FSF} for the maintainer. This means that the original author is
1012no longer responsible for the file, and that it is maintained as part
1013of Emacs.
1030 1014
1031@item Created 1015@item Created
1032This optional line gives the original creation date of the 1016This optional line gives the original creation date of the file, and
1033file. For historical interest only. 1017is for historical interest only.
1034 1018
1035@item Version 1019@item Version
1036If you wish to record version numbers for the individual Lisp program, put 1020If you wish to record version numbers for the individual Lisp program,
1037them in this line. 1021put them in this line. Lisp files distributed with Emacs generally do
1038 1022not have a @samp{Version} header, since the version number of Emacs
1039@item Adapted-By 1023itself serves the same purpose. If you are distributing a collection
1040In this header line, place the name of the person who adapted the 1024of multiple files, we recommend not writing the version in every file,
1041library for installation (to make it fit the style conventions, for 1025but only the main one.
1042example).
1043 1026
1044@item Keywords 1027@item Keywords
1045This line lists keywords for the @code{finder-by-keyword} help command. 1028This line lists keywords for the @code{finder-by-keyword} help command.
1046Please use that command to see a list of the meaningful keywords. 1029Please use that command to see a list of the meaningful keywords.
1047 1030
1048This field is important; it's how people will find your package when 1031This field is how people will find your package when they're looking
1049they're looking for things by topic area. To separate the keywords, you 1032for things by topic. To separate the keywords, you can use spaces,
1050can use spaces, commas, or both. 1033commas, or both.
1034
1035The name of this field is unfortunate, since people often assume it is
1036the place to write arbitrary keywords that describe their package,
1037rather than just the relevant Finder keywords.
1051 1038
1052@item Package-Version 1039@item Package-Version
1053If @samp{Version} is not suitable for use by the package manager, then 1040If @samp{Version} is not suitable for use by the package manager, then
@@ -1060,7 +1047,7 @@ If this exists, it names packages on which the current package depends
1060for proper operation. @xref{Packaging Basics}. This is used by the 1047for proper operation. @xref{Packaging Basics}. This is used by the
1061package manager both at download time (to ensure that a complete set 1048package manager both at download time (to ensure that a complete set
1062of packages is downloaded) and at activation time (to ensure that a 1049of packages is downloaded) and at activation time (to ensure that a
1063package is activated if and only if all its dependencies have been). 1050package is only activated if all its dependencies have been).
1064 1051
1065Its format is a list of lists. The @code{car} of each sub-list is the 1052Its format is a list of lists. The @code{car} of each sub-list is the
1066name of a package, as a symbol. The @code{cadr} of each sub-list is 1053name of a package, as a symbol. The @code{cadr} of each sub-list is
@@ -1081,8 +1068,8 @@ appropriate. You can also put in header lines with other header
1081names---they have no standard meanings, so they can't do any harm. 1068names---they have no standard meanings, so they can't do any harm.
1082 1069
1083 We use additional stylized comments to subdivide the contents of the 1070 We use additional stylized comments to subdivide the contents of the
1084library file. These should be separated by blank lines from anything 1071library file. These should be separated from anything else by blank
1085else. Here is a table of them: 1072lines. Here is a table of them:
1086 1073
1087@table @samp 1074@table @samp
1088@item ;;; Commentary: 1075@item ;;; Commentary:
@@ -1092,16 +1079,12 @@ It should come right after the copying permissions, terminated by a
1092text is used by the Finder package, so it should make sense in that 1079text is used by the Finder package, so it should make sense in that
1093context. 1080context.
1094 1081
1095@item ;;; Documentation:
1096This was used in some files in place of @samp{;;; Commentary:},
1097but it is deprecated.
1098
1099@item ;;; Change Log: 1082@item ;;; Change Log:
1100This begins change log information stored in the library file (if you 1083This begins an optional log of changes to the file over time. Don't
1101store the change history there). For Lisp files distributed with Emacs, 1084put too much information in this section---it is better to keep the
1102the change history is kept in the file @file{ChangeLog} and not in the 1085detailed logs in a separate @file{ChangeLog} file (as Emacs does),
1103source file at all; these files generally do not have a @samp{;;; Change 1086and/or to use a version control system. @samp{History} is an
1104Log:} line. @samp{History} is an alternative to @samp{Change Log}. 1087alternative to @samp{Change Log}.
1105 1088
1106@item ;;; Code: 1089@item ;;; Code:
1107This begins the actual code of the program. 1090This begins the actual code of the program.