aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorEli Zaretskii2020-05-16 11:54:37 +0300
committerEli Zaretskii2020-05-16 11:54:37 +0300
commitb4937f64cd97ff6bf93538987c014f8ea8ff9d34 (patch)
treec773f38e942395bac82242f1e7a0685130b466a5 /doc
parentefd4e973a4f0c7fe9442b677c6fdeebb347e2b9d (diff)
downloademacs-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.texi32
-rw-r--r--doc/emacs/package.texi32
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
1512It 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
1515way, 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
1514automatically loads the associated library first. For instance, the 1519automatically loads the associated library first. For instance, the
@@ -1538,6 +1543,33 @@ compiled with XEmacs, a modified version of Emacs---they can cause
1538Emacs to crash. Set the variable @code{load-dangerous-libraries} to 1543Emacs 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
1547load it, you may wish to make it available at startup. This is useful
1548when the library defines features that should be available
1549automatically on demand, and manually loading the library is thus
1550inconvenient. In these cases, make sure the library will be loaded by
1551adding 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
1554command 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
1569Lisp files in a directory where Emacs will find it, and also writes
1570the necessary initialization code into your init files, making the
1571above 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
11Emacs 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
13separate Emacs Lisp program, sometimes including other components such 12written by you or provided by someone else. If you want to install
14as an Info manual. 13such a package so it is available in your future Emacs session, you
14need to compile it and put it in a directory where Emacs looks for
15Lisp libraries. @xref{Lisp Libraries}, for more details about this
16manual installation method. Many packages provide installation and
17usage instructions in the large commentary near the beginning of the
18Lisp file; you can use those instructions for installing and
19fine-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
17with a list of all packages. You can install or uninstall packages 22 Packages can also be provided by @dfn{package archives}, which are
18via this buffer. @xref{Package Menu}. 23large collections of Emacs Lisp packages. Each package is a separate
24Emacs Lisp program, sometimes including other components such as an
25Info manual. Emacs includes a facility that lets you easily download
26and install packages from such archives. The rest of this chapter
27describes this facility.
28
29 To list the packages available for installation from package
30archives, type @w{@kbd{M-x list-packages @key{RET}}}. It brings up a
31buffer named @file{*Packages*} with a list of all packages. You can
32install 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
21name of a package, and displays a help buffer describing the 35name of a package, and displays a help buffer describing the
22attributes of the package and the features that it implements. 36attributes 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
25maintained by the Emacs developers and hosted by the GNU project. 39maintained by the Emacs developers and hosted by the GNU project.
26Optionally, you can also download packages from archives maintained by 40Optionally, you can also download packages from archives maintained by
27third parties. @xref{Package Installation}. 41third parties. @xref{Package Installation}.