diff options
| author | Chong Yidong | 2011-03-06 16:52:17 -0500 |
|---|---|---|
| committer | Chong Yidong | 2011-03-06 16:52:17 -0500 |
| commit | 0b3cecebd530db6eab09aa3338eafc97b03446ff (patch) | |
| tree | 6e5b230fefff7fc97d177b4f36eb1911e5bc3762 | |
| parent | 2b0787b344da7aff66e36fa35c4b73eddf980e80 (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/package.texi | 101 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-03-06 Juanma Barranquero <lekktu@gmail.com> | 6 | 2011-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 |
| 11 | users. A @dfn{package} is a collection of one or more files, | 12 | users. 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 |
| 31 | package}. A simple package is stored in a package archive as a single | 35 | package}. A simple package is stored in a package archive as a single |
| @@ -69,6 +73,7 @@ installing this package also automatically installs its dependencies; | |||
| 69 | if any dependency cannot be found, the package cannot be installed. | 73 | if 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 |
| 73 | command @code{package-install-file}, creates a subdirectory of | 78 | command @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 | |||
| 78 | package's contents (the single Lisp file for a simple package, or the | 83 | package's contents (the single Lisp file for a simple package, or the |
| 79 | files extracted from a multi-file package). | 84 | files 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 |
| 82 | autoload magic comments (@pxref{Autoload}). These autoload | 88 | autoload magic comments (@pxref{Autoload}). These autoload |
| 83 | definitions are saved to a file named @file{@var{name}-autoloads.el} | 89 | definitions 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 |
| 104 | file must conform to the Emacs Lisp library header conventions | 111 | file 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 |
| 166 | package, but it offers more features: it can include multiple Emacs | 173 | package, 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 |
| 207 | assumed to be an Info directory file made with @command{install-info}. | 214 | assumed 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 |
| 209 | install-info, texinfo, Texinfo}. The Info files listed in this | 216 | install-info, texinfo, Texinfo}. The relevant Info files should also |
| 210 | directory file should also be present in the content directory. In | 217 | be present in the content directory. In this case, Emacs will |
| 211 | this case, Emacs will automatically add the content directory to | 218 | automatically add the content directory to @code{Info-directory-list} |
| 212 | @code{Info-directory-list} when the package is activated. | 219 | when 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 |
| 215 | created when the package is installed. Note that there is no way to | 222 | created 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 | |
| 238 | To be done. | 245 | |
| 246 | Via the Package Menu, users may download packages from @dfn{package | ||
| 247 | archives}. Such archives are specified by the variable | ||
| 248 | @code{package-archives}, whose default value contains a single entry: | ||
| 249 | the archive hosted by the GNU project at @url{elpa.gnu.org}. This | ||
| 250 | section describes how to set up and maintain a package archive. | ||
| 251 | |||
| 252 | @cindex base location, package archive | ||
| 253 | @defopt package-archives | ||
| 254 | The value of this variable is an alist of package archives recognized | ||
| 255 | by the Emacs package manager. | ||
| 256 | |||
| 257 | Each alist element corresponds to one archive, and should have the | ||
| 258 | form @code{(@var{id} . @var{location})}, where @var{id} is the name of | ||
| 259 | the archive (a string) and @var{location} is its @dfn{base location} | ||
| 260 | (a string). | ||
| 261 | |||
| 262 | If the base location starts with @samp{http:}, it is treated as a HTTP | ||
| 263 | URL, and packages are downloaded from this archive via HTTP (as is the | ||
| 264 | case for the default GNU archive). | ||
| 265 | |||
| 266 | Otherwise, the base location should be a directory name. In this | ||
| 267 | case, Emacs retrieves packages from this archive via ordinary file | ||
| 268 | access. 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, | ||
| 272 | and associated files, are stored. If you want the archive to be | ||
| 273 | reachable via HTTP, this directory must be accessible to a web server. | ||
| 274 | How 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 | ||
| 278 | by default; type @kbd{M-x load-library @kbd{RET} package-x @kbd{RET}} | ||
| 279 | to load it, or add @code{(require 'package-x)} to your init file. | ||
| 280 | @xref{Lisp Libraries,, Lisp Libraries, emacs, The GNU Emacs Manual}. | ||
| 281 | Once loaded, you can make use of the following: | ||
| 282 | |||
| 283 | @defopt package-archive-upload-base | ||
| 284 | The value of this variable is the base location of a package archive, | ||
| 285 | as a directory name. The commands in the @code{package-x} library | ||
| 286 | will use this base location. | ||
| 287 | |||
| 288 | The directory name should be absolute. You may specify a remote name, | ||
| 289 | such as @file{/ssh:foo@@example.com:/var/www/packages/}, if the | ||
| 290 | package archive is on a different machine. @xref{Remote Files,, | ||
| 291 | Remote Files, emacs, The GNU Emacs Manual}. | ||
| 292 | @end defopt | ||
| 293 | |||
| 294 | @deffn Command package-upload-file filename | ||
| 295 | This command prompts for @var{filename}, a file name, and uploads that | ||
| 296 | file to @code{package-archive-upload-base}. The file must be either a | ||
| 297 | simple package (a @file{.el} file) or a multi-file package (a | ||
| 298 | @file{.tar} file); otherwise, an error is raised. The package | ||
| 299 | attributes are automatically extracted, and the archive's contents | ||
| 300 | list is updated with this information. | ||
| 301 | |||
| 302 | If @code{package-archive-upload-base} does not specify a valid | ||
| 303 | directory, the function prompts interactively for one. If the | ||
| 304 | directory does not exist, it is created. The directory need not have | ||
| 305 | any initial contents (i.e., you can use this command to populate an | ||
| 306 | initially empty archive). | ||
| 307 | @end deffn | ||
| 308 | |||
| 309 | @deffn Command package-upload-buffer | ||
| 310 | This command is similar to @code{package-upload-file}, but instead of | ||
| 311 | prompting for a package file, it uploads the contents of the current | ||
| 312 | buffer. The current buffer must be visiting a simple package (a | ||
| 313 | @file{.el} file) or a multi-file package (a @file{.tar} file); | ||
| 314 | otherwise, an error is raised. | ||
| 315 | @end deffn | ||
| 316 | |||
| 317 | @noindent | ||
| 318 | After you create an archive, remember that it is not accessible in the | ||
| 319 | Package Menu interface unless it is in @code{package-archives}. | ||