diff options
| author | Eli Zaretskii | 2020-05-16 11:54:37 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2020-05-16 11:54:37 +0300 |
| commit | b4937f64cd97ff6bf93538987c014f8ea8ff9d34 (patch) | |
| tree | c773f38e942395bac82242f1e7a0685130b466a5 /doc | |
| parent | efd4e973a4f0c7fe9442b677c6fdeebb347e2b9d (diff) | |
| download | emacs-b4937f64cd97ff6bf93538987c014f8ea8ff9d34.tar.gz emacs-b4937f64cd97ff6bf93538987c014f8ea8ff9d34.zip | |
Improve documentation of manually installing Lisp packages
* doc/emacs/building.texi (Lisp Libraries): Describe how to
manually load packages in the init file. Mention the 'site-lisp'
subdirectory of the default 'load-path'.
* doc/emacs/package.texi (Packages): Describe manual installation
of ELisp packages. Suggested by Jean-Christophe Helary
<jean.christophe.helary@traduction-libre.org>.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/building.texi | 32 | ||||
| -rw-r--r-- | doc/emacs/package.texi | 32 |
2 files changed, 55 insertions, 9 deletions
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index e866eea4a29..fa60ce26621 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi | |||
| @@ -1509,6 +1509,11 @@ putting a line like this in your init file (@pxref{Init File}): | |||
| 1509 | (add-to-list 'load-path "/path/to/my/lisp/library") | 1509 | (add-to-list 'load-path "/path/to/my/lisp/library") |
| 1510 | @end example | 1510 | @end example |
| 1511 | 1511 | ||
| 1512 | It is customary to put locally installed libraries in the | ||
| 1513 | @file{site-lisp} directory that is already in the default value of | ||
| 1514 | @code{load-path}, or in some subdirectory of @file{site-lisp}. This | ||
| 1515 | way, you don't need to modify the default value of @code{load-path}. | ||
| 1516 | |||
| 1512 | @cindex autoload | 1517 | @cindex autoload |
| 1513 | Some commands are @dfn{autoloaded}; when you run them, Emacs | 1518 | Some commands are @dfn{autoloaded}; when you run them, Emacs |
| 1514 | automatically loads the associated library first. For instance, the | 1519 | automatically loads the associated library first. For instance, the |
| @@ -1538,6 +1543,33 @@ compiled with XEmacs, a modified version of Emacs---they can cause | |||
| 1538 | Emacs to crash. Set the variable @code{load-dangerous-libraries} to | 1543 | Emacs to crash. Set the variable @code{load-dangerous-libraries} to |
| 1539 | @code{t} if you want to try loading them. | 1544 | @code{t} if you want to try loading them. |
| 1540 | 1545 | ||
| 1546 | Once you put your library in a directory where Emacs can find and | ||
| 1547 | load it, you may wish to make it available at startup. This is useful | ||
| 1548 | when the library defines features that should be available | ||
| 1549 | automatically on demand, and manually loading the library is thus | ||
| 1550 | inconvenient. In these cases, make sure the library will be loaded by | ||
| 1551 | adding suitable forms to your init file: either @code{load} or | ||
| 1552 | @code{require} (if you always need to load the library at startup), or | ||
| 1553 | @code{autoload} if you need Emacs to load the library when some | ||
| 1554 | command or function is invoked. For example: | ||
| 1555 | |||
| 1556 | @smalllisp | ||
| 1557 | @group | ||
| 1558 | ;; Loads @file{my-shining-package.elc} unconditionally. | ||
| 1559 | (require 'my-shining-package) | ||
| 1560 | @end group | ||
| 1561 | @group | ||
| 1562 | ;; Will load @file{my-shining-package.elc} when @code{my-func} is invoked. | ||
| 1563 | (autoload 'my-func "my-shining-package") | ||
| 1564 | @end group | ||
| 1565 | @end smalllisp | ||
| 1566 | |||
| 1567 | Note that installing a package using @code{package-install} | ||
| 1568 | (@pxref{Package Installation}) takes care of placing the package's | ||
| 1569 | Lisp files in a directory where Emacs will find it, and also writes | ||
| 1570 | the necessary initialization code into your init files, making the | ||
| 1571 | above manual customizations unnecessary. | ||
| 1572 | |||
| 1541 | @node Lisp Eval | 1573 | @node Lisp Eval |
| 1542 | @section Evaluating Emacs Lisp Expressions | 1574 | @section Evaluating Emacs Lisp Expressions |
| 1543 | @cindex Emacs Lisp mode | 1575 | @cindex Emacs Lisp mode |
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 6bf4fc7e10c..517d2b75aa2 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi | |||
| @@ -5,23 +5,37 @@ | |||
| 5 | @node Packages | 5 | @node Packages |
| 6 | @chapter Emacs Lisp Packages | 6 | @chapter Emacs Lisp Packages |
| 7 | @cindex Package | 7 | @cindex Package |
| 8 | @cindex Emacs Lisp package archive | ||
| 9 | @cindex Package archive | 8 | @cindex Package archive |
| 10 | 9 | ||
| 11 | Emacs includes a facility that lets you easily download and install | 10 | Emacs is extended by implementing additional features in |
| 12 | @dfn{packages} that implement additional features. Each package is a | 11 | @dfn{packages}, which are Emacs Lisp libraries. These could be |
| 13 | separate Emacs Lisp program, sometimes including other components such | 12 | written by you or provided by someone else. If you want to install |
| 14 | as an Info manual. | 13 | such a package so it is available in your future Emacs session, you |
| 14 | need to compile it and put it in a directory where Emacs looks for | ||
| 15 | Lisp libraries. @xref{Lisp Libraries}, for more details about this | ||
| 16 | manual installation method. Many packages provide installation and | ||
| 17 | usage instructions in the large commentary near the beginning of the | ||
| 18 | Lisp file; you can use those instructions for installing and | ||
| 19 | fine-tuning your use of the package. | ||
| 15 | 20 | ||
| 16 | @kbd{M-x list-packages} brings up a buffer named @file{*Packages*} | 21 | @cindex Emacs Lisp package archive |
| 17 | with a list of all packages. You can install or uninstall packages | 22 | Packages can also be provided by @dfn{package archives}, which are |
| 18 | via this buffer. @xref{Package Menu}. | 23 | large collections of Emacs Lisp packages. Each package is a separate |
| 24 | Emacs Lisp program, sometimes including other components such as an | ||
| 25 | Info manual. Emacs includes a facility that lets you easily download | ||
| 26 | and install packages from such archives. The rest of this chapter | ||
| 27 | describes this facility. | ||
| 28 | |||
| 29 | To list the packages available for installation from package | ||
| 30 | archives, type @w{@kbd{M-x list-packages @key{RET}}}. It brings up a | ||
| 31 | buffer named @file{*Packages*} with a list of all packages. You can | ||
| 32 | install or uninstall packages via this buffer. @xref{Package Menu}. | ||
| 19 | 33 | ||
| 20 | The command @kbd{C-h P} (@code{describe-package}) prompts for the | 34 | The command @kbd{C-h P} (@code{describe-package}) prompts for the |
| 21 | name of a package, and displays a help buffer describing the | 35 | name of a package, and displays a help buffer describing the |
| 22 | attributes of the package and the features that it implements. | 36 | attributes of the package and the features that it implements. |
| 23 | 37 | ||
| 24 | By default, Emacs downloads packages from a @dfn{package archive} | 38 | By default, Emacs downloads packages from a package archive |
| 25 | maintained by the Emacs developers and hosted by the GNU project. | 39 | maintained by the Emacs developers and hosted by the GNU project. |
| 26 | Optionally, you can also download packages from archives maintained by | 40 | Optionally, you can also download packages from archives maintained by |
| 27 | third parties. @xref{Package Installation}. | 41 | third parties. @xref{Package Installation}. |