aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-03-06 16:52:17 -0500
committerChong Yidong2011-03-06 16:52:17 -0500
commit0b3cecebd530db6eab09aa3338eafc97b03446ff (patch)
tree6e5b230fefff7fc97d177b4f36eb1911e5bc3762
parent2b0787b344da7aff66e36fa35c4b73eddf980e80 (diff)
downloademacs-0b3cecebd530db6eab09aa3338eafc97b03446ff.tar.gz
emacs-0b3cecebd530db6eab09aa3338eafc97b03446ff.zip
Document package archives in the Lisp manual.
* doc/lispref/package.texi: Update index keywords. (Package Archives): New node contents. Document package-x.el.
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/package.texi101
2 files changed, 96 insertions, 10 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 4129b37986f..32d13b57ffd 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12011-03-06 Chong Yidong <cyd@stupidchicken.com>
2
3 * package.texi: Update index keywords.
4 (Package Archives): New node contents. Document package-x.el.
5
12011-03-06 Juanma Barranquero <lekktu@gmail.com> 62011-03-06 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * makefile.w32-in (srcs): Add package.texi. 8 * makefile.w32-in (srcs): Add package.texi.
diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi
index 4de44fe165d..62fbc2a9a07 100644
--- a/doc/lispref/package.texi
+++ b/doc/lispref/package.texi
@@ -5,7 +5,8 @@
5@setfilename ../../info/package 5@setfilename ../../info/package
6@node Packaging, Antinews, System Interface, Top 6@node Packaging, Antinews, System Interface, Top
7@chapter Preparing Lisp code for distribution 7@chapter Preparing Lisp code for distribution
8@cindex packaging 8@cindex package
9@cindex Lisp package
9 10
10 Emacs provides a standard way to distribute Emacs Lisp code to 11 Emacs provides a standard way to distribute Emacs Lisp code to
11users. A @dfn{package} is a collection of one or more files, 12users. A @dfn{package} is a collection of one or more files,
@@ -24,8 +25,11 @@ put it in a @dfn{package archive} for others to download.
24 25
25@node Packaging Basics 26@node Packaging Basics
26@section Packaging Basics 27@section Packaging Basics
27@cindex packaging basics
28@cindex package attributes 28@cindex package attributes
29@cindex package name
30@cindex package version
31@cindex dependencies
32@cindex package dependencies
29 33
30 A package is either a @dfn{simple package} or a @dfn{multi-file 34 A package is either a @dfn{simple package} or a @dfn{multi-file
31package}. A simple package is stored in a package archive as a single 35package}. A simple package is stored in a package archive as a single
@@ -69,6 +73,7 @@ installing this package also automatically installs its dependencies;
69if any dependency cannot be found, the package cannot be installed. 73if any dependency cannot be found, the package cannot be installed.
70@end table 74@end table
71 75
76@cindex content directory, package
72 Installing a package, either via the Package Menu, or via the 77 Installing a package, either via the Package Menu, or via the
73command @code{package-install-file}, creates a subdirectory of 78command @code{package-install-file}, creates a subdirectory of
74@code{package-user-dir} named @file{@var{name}-@var{version}}, where 79@code{package-user-dir} named @file{@var{name}-@var{version}}, where
@@ -78,6 +83,7 @@ package's @dfn{content directory}. It is where Emacs puts the
78package's contents (the single Lisp file for a simple package, or the 83package's contents (the single Lisp file for a simple package, or the
79files extracted from a multi-file package). 84files extracted from a multi-file package).
80 85
86@cindex package autoloads
81 Emacs then searches every Lisp file in the content directory for 87 Emacs then searches every Lisp file in the content directory for
82autoload magic comments (@pxref{Autoload}). These autoload 88autoload magic comments (@pxref{Autoload}). These autoload
83definitions are saved to a file named @file{@var{name}-autoloads.el} 89definitions are saved to a file named @file{@var{name}-autoloads.el}
@@ -98,7 +104,8 @@ typically called to begin using the package.
98 104
99@node Simple Packages 105@node Simple Packages
100@section Simple Packages 106@section Simple Packages
101@cindex single file packages 107@cindex single file package
108@cindex simple package
102 109
103 A simple package consists of a single Emacs Lisp source file. The 110 A simple package consists of a single Emacs Lisp source file. The
104file must conform to the Emacs Lisp library header conventions 111file must conform to the Emacs Lisp library header conventions
@@ -160,7 +167,7 @@ single-file package to a package archive.
160 167
161@node Multi-file Packages 168@node Multi-file Packages
162@section Multi-file Packages 169@section Multi-file Packages
163@cindex multi-file packages 170@cindex multi-file package
164 171
165 A multi-file package is less convenient to create than a single-file 172 A multi-file package is less convenient to create than a single-file
166package, but it offers more features: it can include multiple Emacs 173package, but it offers more features: it can include multiple Emacs
@@ -206,10 +213,10 @@ file is used as the long description.
206 If the content directory contains a file named @file{dir}, this is 213 If the content directory contains a file named @file{dir}, this is
207assumed to be an Info directory file made with @command{install-info}. 214assumed to be an Info directory file made with @command{install-info}.
208@xref{Invoking install-info, Invoking install-info, Invoking 215@xref{Invoking install-info, Invoking install-info, Invoking
209install-info, texinfo, Texinfo}. The Info files listed in this 216install-info, texinfo, Texinfo}. The relevant Info files should also
210directory file should also be present in the content directory. In 217be present in the content directory. In this case, Emacs will
211this case, Emacs will automatically add the content directory to 218automatically add the content directory to @code{Info-directory-list}
212@code{Info-directory-list} when the package is activated. 219when the package is activated.
213 220
214 Do not include any @file{.elc} files in the package. Those are 221 Do not include any @file{.elc} files in the package. Those are
215created when the package is installed. Note that there is no way to 222created when the package is installed. Note that there is no way to
@@ -234,5 +241,79 @@ variable @code{load-file-name} (@pxref{Loading}). Here is an example:
234 241
235@node Package Archives 242@node Package Archives
236@section Creating and Maintaining Package Archives 243@section Creating and Maintaining Package Archives
237 244@cindex package archive
238To be done. 245
246 Via the Package Menu, users may download packages from @dfn{package
247archives}. Such archives are specified by the variable
248@code{package-archives}, whose default value contains a single entry:
249the archive hosted by the GNU project at @url{elpa.gnu.org}. This
250section describes how to set up and maintain a package archive.
251
252@cindex base location, package archive
253@defopt package-archives
254The value of this variable is an alist of package archives recognized
255by the Emacs package manager.
256
257Each alist element corresponds to one archive, and should have the
258form @code{(@var{id} . @var{location})}, where @var{id} is the name of
259the archive (a string) and @var{location} is its @dfn{base location}
260(a string).
261
262If the base location starts with @samp{http:}, it is treated as a HTTP
263URL, and packages are downloaded from this archive via HTTP (as is the
264case for the default GNU archive).
265
266Otherwise, the base location should be a directory name. In this
267case, Emacs retrieves packages from this archive via ordinary file
268access. Such ``local'' archives are mainly useful for testing.
269@end defopt
270
271 A package archive is simply a directory in which the package files,
272and associated files, are stored. If you want the archive to be
273reachable via HTTP, this directory must be accessible to a web server.
274How to accomplish this is beyond the scope of this manual.
275
276 A convenient way to set up and update a package archive is via the
277@code{package-x} library. This is included with Emacs, but not loaded
278by default; type @kbd{M-x load-library @kbd{RET} package-x @kbd{RET}}
279to load it, or add @code{(require 'package-x)} to your init file.
280@xref{Lisp Libraries,, Lisp Libraries, emacs, The GNU Emacs Manual}.
281Once loaded, you can make use of the following:
282
283@defopt package-archive-upload-base
284The value of this variable is the base location of a package archive,
285as a directory name. The commands in the @code{package-x} library
286will use this base location.
287
288The directory name should be absolute. You may specify a remote name,
289such as @file{/ssh:foo@@example.com:/var/www/packages/}, if the
290package archive is on a different machine. @xref{Remote Files,,
291Remote Files, emacs, The GNU Emacs Manual}.
292@end defopt
293
294@deffn Command package-upload-file filename
295This command prompts for @var{filename}, a file name, and uploads that
296file to @code{package-archive-upload-base}. The file must be either a
297simple package (a @file{.el} file) or a multi-file package (a
298@file{.tar} file); otherwise, an error is raised. The package
299attributes are automatically extracted, and the archive's contents
300list is updated with this information.
301
302If @code{package-archive-upload-base} does not specify a valid
303directory, the function prompts interactively for one. If the
304directory does not exist, it is created. The directory need not have
305any initial contents (i.e., you can use this command to populate an
306initially empty archive).
307@end deffn
308
309@deffn Command package-upload-buffer
310This command is similar to @code{package-upload-file}, but instead of
311prompting for a package file, it uploads the contents of the current
312buffer. The current buffer must be visiting a simple package (a
313@file{.el} file) or a multi-file package (a @file{.tar} file);
314otherwise, an error is raised.
315@end deffn
316
317@noindent
318After you create an archive, remember that it is not accessible in the
319Package Menu interface unless it is in @code{package-archives}.