diff options
| author | Stefan Kangas | 2022-12-12 09:05:53 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2022-12-12 09:05:53 +0100 |
| commit | fcd0b377e0e25b7b68bd51229098edb30972352b (patch) | |
| tree | 372c6ec23588ef8f80d47f408abd4a71f68b702a /doc/misc | |
| parent | b889eced4449555373e53c26c280dffa548dcfc3 (diff) | |
| parent | 06ef030f9363a33646369e8583cbac695810fe80 (diff) | |
| download | emacs-fcd0b377e0e25b7b68bd51229098edb30972352b.tar.gz emacs-fcd0b377e0e25b7b68bd51229098edb30972352b.zip | |
Merge from origin/emacs-29
06ef030f936 use-package.texi: New section "Manual installation"
f4ce6fa7d3e Revert "Revert "Improve last change to xfaces.c" (05ece1e...
b8d2ec920f3 Revert "Improve last change to xfaces.c" (05ece1eb8b)
24c8c28ae61 Do not pare arguments unnecessarily.
9c0d7bb73bb Add automated tests for Eglot
d3669cfe156 Eglot: allow skipping compile-time warnings about LSP int...
04b7e01885d ; project.el: Bump version.
f2876014adb Add customizale faces for tree-sitter explorer
3e349ee1198 Fix error message when installing non-existent package
733cdeabfb9 Don't use diff-mode buffer as a patch when it's visiting ...
87475f4af21 Fix pcase rx patterns using rx-let bindings (bug#59814)
4893a156317 Fix use-package-defaults defcustom type (bug#59941)
074b7e6f4d1 ; * lisp/use-package/bind-key.el: Remove ineffective back...
864ed9dfa1f ; * lisp/progmodes/dockerfile-ts-mode.el: use \' instead ...
9f7e5584a4f * lisp/language/indian.el: Improve Brahmi composition rul...
78ad33bb05f ; Minor cleanup of last change in xfaces.c.
2024ade271d ; Improve docs of relaxing face-font attribute match (bug...
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/use-package.texi | 78 |
1 files changed, 48 insertions, 30 deletions
diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi index 0aa8975f30a..c587d23d74b 100644 --- a/doc/misc/use-package.texi +++ b/doc/misc/use-package.texi | |||
| @@ -248,10 +248,6 @@ packages using the built-in @code{install-package} command, it will do | |||
| 248 | this automatically for you. Packages shipped with Emacs (built-in | 248 | this automatically for you. Packages shipped with Emacs (built-in |
| 249 | packages) are always available. | 249 | packages) are always available. |
| 250 | 250 | ||
| 251 | If you install packages manually, you must make sure they are | ||
| 252 | available on your @code{load-path}. @xref{Lisp Libraries,,, emacs, | ||
| 253 | GNU Emacs Manual}, for details. | ||
| 254 | |||
| 255 | Some packages have more than one library. In those cases, you might | 251 | Some packages have more than one library. In those cases, you might |
| 256 | need more than one @code{use-package} declaration to make sure the | 252 | need more than one @code{use-package} declaration to make sure the |
| 257 | package is properly loaded. For complex configurations, you might | 253 | package is properly loaded. For complex configurations, you might |
| @@ -267,8 +263,7 @@ on Emacs start. @xref{Installing packages}, for details. | |||
| 267 | * Conditional loading:: Loading packages conditionally. | 263 | * Conditional loading:: Loading packages conditionally. |
| 268 | * Loading sequentially:: Loading packages in sequence. | 264 | * Loading sequentially:: Loading packages in sequence. |
| 269 | * Load dependencies:: Don't load without dependencies. | 265 | * Load dependencies:: Don't load without dependencies. |
| 270 | * Load path:: Using a custom @code{load-path}. | 266 | * Manual installation:: Loading manually installed packages. |
| 271 | * Manual autoloads:: Setting up autoloads manually. | ||
| 272 | @end menu | 267 | @end menu |
| 273 | 268 | ||
| 274 | @node Loading basics | 269 | @node Loading basics |
| @@ -623,36 +618,54 @@ As a convenience, a list of such packages may be specified: | |||
| 623 | For more complex logic, such as that supported by @code{:after}, | 618 | For more complex logic, such as that supported by @code{:after}, |
| 624 | simply use @code{:if} and the appropriate Lisp expression. | 619 | simply use @code{:if} and the appropriate Lisp expression. |
| 625 | 620 | ||
| 621 | @node Manual installation | ||
| 622 | @section Manually installed package | ||
| 623 | |||
| 624 | When installing packages manually, without Emacs' built-in package | ||
| 625 | manager (@file{package.el}), it will obviously not help you set up | ||
| 626 | autoloads or add it to your @code{load-path}. You must do it | ||
| 627 | yourself. However, use-package makes this more convenient. | ||
| 628 | |||
| 629 | @menu | ||
| 630 | * Load path:: Using a custom @code{load-path}. | ||
| 631 | * Manual autoloads:: Setting up autoloads manually. | ||
| 632 | @end menu | ||
| 633 | |||
| 626 | @node Load path | 634 | @node Load path |
| 627 | @section Setting a custom @code{load-path} | 635 | @subsection Setting a custom @code{load-path} |
| 628 | @cindex custom @code{load-path} for loading a package | 636 | @cindex custom @code{load-path} for loading a package |
| 629 | @cindex @code{load-path}, add directories for loading a package | 637 | @cindex @code{load-path}, add directories for loading a package |
| 630 | 638 | ||
| 639 | When installing packages manually, you must make sure its libraries | ||
| 640 | are available on your @code{load-path}. @xref{Lisp Libraries,,, | ||
| 641 | emacs, GNU Emacs Manual}, for more details about package loading. | ||
| 642 | |||
| 631 | @findex :load-path | 643 | @findex :load-path |
| 632 | If a package resides in some directory that is not in your | 644 | The @code{:load-path} keyword provides a convenient way to add |
| 633 | @code{load-path}, use the @code{:load-path} keyword to add it. It | 645 | directories to your load path. It takes as argument a symbol, a |
| 634 | takes as argument a symbol, a function, a string or a list of strings. | 646 | function, a string or a list of strings. If a directory is specified |
| 635 | If a directory is specified as a relative file name, it is expanded | 647 | as a relative file name, it is expanded relative to |
| 636 | relative to @code{user-emacs-directory}. | 648 | @code{user-emacs-directory}. |
| 637 | 649 | ||
| 638 | For example: | 650 | For example: |
| 639 | 651 | ||
| 640 | @lisp | 652 | @lisp |
| 641 | @group | 653 | @group |
| 642 | (use-package ess-site | 654 | (use-package org |
| 643 | :load-path "site-lisp/ess/lisp/" | 655 | :load-path "site-lisp/org/lisp/" |
| 644 | :commands R) | 656 | :commands org-mode) |
| 645 | @end group | 657 | @end group |
| 646 | @end lisp | 658 | @end lisp |
| 647 | 659 | ||
| 648 | Note that when using a symbol or a function to provide a dynamically | 660 | When using a symbol or a function to provide a dynamically generated |
| 649 | generated list of directories, you must inform the byte-compiler of this | 661 | list of directories, you must inform the byte-compiler of this |
| 650 | definition so that the value is available at byte-compilation time. | 662 | definition, so that the value is available at byte-compilation time. |
| 651 | This is done by using the special form @code{eval-and-compile} (as | 663 | This is done by using the special form @code{eval-and-compile} (as |
| 652 | opposed to @code{eval-when-compile}, @pxref{Eval During Compile,,, | 664 | opposed to @code{eval-when-compile}, @pxref{Eval During Compile,,, |
| 653 | elisp, GNU Emacs Lisp Reference Manual}). Further, this value is fixed at | 665 | elisp, GNU Emacs Lisp Reference Manual}). Furthermore, this value is |
| 654 | whatever was determined during compilation, to avoid looking up the | 666 | fixed to the value it had during compilation. If the operation is |
| 655 | same information again on each startup. For example: | 667 | costly, you do not have to repeat it again on each startup. For |
| 668 | example: | ||
| 656 | 669 | ||
| 657 | @lisp | 670 | @lisp |
| 658 | @group | 671 | @group |
| @@ -669,20 +682,25 @@ same information again on each startup. For example: | |||
| 669 | @end lisp | 682 | @end lisp |
| 670 | 683 | ||
| 671 | @node Manual autoloads | 684 | @node Manual autoloads |
| 672 | @section Setting up autoloads manually | 685 | @subsection Setting up autoloads manually |
| 686 | |||
| 687 | Packages often document how to set up its autoloads when it is being | ||
| 688 | manually installed. If it does, follow those instructions. | ||
| 689 | Otherwise, you might want to set them up manually. | ||
| 690 | |||
| 673 | @cindex autoloads for packages, setting up manually | 691 | @cindex autoloads for packages, setting up manually |
| 674 | @cindex package autoloads, setting up manually | 692 | @cindex package autoloads, setting up manually |
| 675 | 693 | ||
| 676 | @findex :commands | 694 | @findex :commands |
| 677 | @findex :autoload | 695 | @findex :autoload |
| 678 | To autoload an interactive command, use the @code{:commands} keyword. | 696 | To autoload an interactive command, use the @code{:commands} keyword, |
| 679 | When you use the @code{:commands} keyword, it creates autoloads for | 697 | which takes either a symbol or a list of symbols as its argument. It |
| 680 | those commands (which defers loading of the module until those commands are | 698 | creates autoloads for those commands (which defers loading of the |
| 681 | used). The @code{:commands} keyword takes either a symbol or a list | 699 | module until those commands are used). |
| 682 | of symbols as its argument. | 700 | |
| 683 | 701 | The @code{:autoload} keyword takes the same arguments as | |
| 684 | The @code{:autoload} keyword works like @code{:commands}, but is used | 702 | @code{:commands}, but is used to autoload non-interactive functions. |
| 685 | to autoload non-interactive functions. Here is an example: | 703 | Here is an example: |
| 686 | 704 | ||
| 687 | @lisp | 705 | @lisp |
| 688 | @group | 706 | @group |