aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorJohn Wiegley2022-11-15 08:26:03 -0800
committerGitHub2022-11-15 08:26:03 -0800
commitcf8ab8b52eae65a108d899e896e1171355122bb7 (patch)
tree1f7f09a99f93707a7d9e2d1ad7955febe8f13c05 /doc/misc
parent9b476ae71c72239e02af4f98bd7eba0cb243bd0a (diff)
parent2efc8698666de67d07c3d7f21464d6378d18adc3 (diff)
downloademacs-cf8ab8b52eae65a108d899e896e1171355122bb7.tar.gz
emacs-cf8ab8b52eae65a108d899e896e1171355122bb7.zip
Merge pull request from skangas/texinfo-wip
GitHub-reference: https://github.com/jwiegley/use-package/issues/1018
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/use-package.texi170
1 files changed, 85 insertions, 85 deletions
diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi
index de6351c592f..573baac89aa 100644
--- a/doc/misc/use-package.texi
+++ b/doc/misc/use-package.texi
@@ -8,7 +8,7 @@
8 8
9@copying 9@copying
10@quotation 10@quotation
11Copyright (C) 2012-2022 John Wiegley <johnw@@newartisans.com> 11Copyright (C) 2012-2022 Free Software Foundation, Inc.
12 12
13You can redistribute this document and/or modify it under the terms 13You can redistribute this document and/or modify it under the terms
14of the GNU General Public License as published by the Free Software 14of the GNU General Public License as published by the Free Software
@@ -31,7 +31,7 @@ General Public License for more details.
31@finalout 31@finalout
32@titlepage 32@titlepage
33@title use-package User Manual 33@title use-package User Manual
34@subtitle for version 2.4.1-81-gb185c6b+1 34@subtitle for version 2.4.1-119-g0be480e+1
35@author John Wiegley 35@author John Wiegley
36@page 36@page
37@vskip 0pt plus 1filll 37@vskip 0pt plus 1filll
@@ -45,9 +45,9 @@ General Public License for more details.
45@top use-package User Manual 45@top use-package User Manual
46 46
47The @code{use-package} macro allows you to isolate package configuration in your 47The @code{use-package} macro allows you to isolate package configuration in your
48@code{.emacs} file in a way that is both performance-oriented and, well, tidy. I 48@code{.emacs} file in a way that is both performance-oriented and, well, tidy. I
49created it because I have over 80 packages that I use in Emacs, and things 49created it because I have over 80 packages that I use in Emacs, and things
50were getting difficult to manage. Yet with this utility my total load time is 50were getting difficult to manage. Yet with this utility my total load time is
51around 2 seconds, with no loss of functionality! 51around 2 seconds, with no loss of functionality!
52 52
53@insertcopying 53@insertcopying
@@ -73,27 +73,27 @@ Installation
73 73
74Keywords 74Keywords
75 75
76* @code{after}:: 76* @code{after}:: @code{:after}.
77* @code{bind-keymap}, @code{bind-keymap*}: @code{bind-keymap} @code{bind-keymap*}. 77* @code{bind-keymap} @code{bind-keymap*}:: @code{:bind-keymap}, @code{:bind-keymap*}.
78* @code{bind}, @code{bind*}: @code{bind} @code{bind*}. 78* @code{bind} @code{bind*}:: @code{:bind}, @code{:bind*}.
79* @code{commands}:: 79* @code{commands}:: @code{:commands}.
80* @code{preface}, @code{init}, @code{config}: @code{preface} @code{init} @code{config}. 80* @code{preface} @code{init} @code{config}:: @code{:preface}, @code{:init}, @code{:config}.
81* @code{custom}:: 81* @code{custom}:: @code{:custom}.
82* @code{custom-face}:: 82* @code{custom-face}:: @code{:custom-face}.
83* @code{defer}, @code{demand}: @code{defer} @code{demand}. 83* @code{defer} @code{demand}:: @code{:defer}, @code{:demand}.
84* @code{defines}, @code{functions}: @code{defines} @code{functions}. 84* @code{defines} @code{functions}:: @code{:defines}, @code{:functions}.
85* @code{diminish}, @code{delight}: @code{diminish} @code{delight}. 85* @code{diminish} @code{delight}:: @code{:diminish}, @code{:delight}.
86* @code{disabled}:: 86* @code{disabled}:: @code{:disabled}.
87* @code{ensure}, @code{pin}: @code{ensure} @code{pin}. 87* @code{ensure} @code{pin}:: @code{:ensure}, @code{:pin}.
88* @code{hook}:: 88* @code{hook}:: @code{:hook}.
89* @code{if}, @code{when}, @code{unless}: @code{if} @code{when} @code{unless}. 89* @code{if} @code{when} @code{unless}:: @code{:if}, @code{:when}, @code{:unless}.
90* @code{load-path}:: 90* @code{load-path}:: @code{:load-path}.
91* @code{mode}, @code{interpreter}: @code{mode} @code{interpreter}. 91* @code{mode} @code{interpreter}:: @code{:mode}, @code{:interpreter}.
92* @code{magic}, @code{magic-fallback}: @code{magic} @code{magic-fallback}. 92* @code{magic} @code{magic-fallback}:: @code{:magic}, @code{:magic-fallback}.
93* @code{no-require}:: 93* @code{no-require}:: @code{:no-require}.
94* @code{requires}:: 94* @code{requires}:: @code{:requires}.
95 95
96@code{:bind}, @code{:bind*} 96@code{bind}, @code{bind*}
97 97
98* Binding to local keymaps:: 98* Binding to local keymaps::
99 99
@@ -105,9 +105,9 @@ Keywords
105@chapter Introduction 105@chapter Introduction
106 106
107The @code{use-package} macro allows you to isolate package configuration in your 107The @code{use-package} macro allows you to isolate package configuration in your
108@code{.emacs} file in a way that is both performance-oriented and, well, tidy. I 108@code{.emacs} file in a way that is both performance-oriented and, well, tidy. I
109created it because I have over 80 packages that I use in Emacs, and things 109created it because I have over 80 packages that I use in Emacs, and things
110were getting difficult to manage. Yet with this utility my total load time is 110were getting difficult to manage. Yet with this utility my total load time is
111around 2 seconds, with no loss of functionality! 111around 2 seconds, with no loss of functionality!
112 112
113More text to come@dots{} 113More text to come@dots{}
@@ -127,10 +127,10 @@ its development repository.
127@node Installing from GNU ELPA 127@node Installing from GNU ELPA
128@section Installing from GNU ELPA 128@section Installing from GNU ELPA
129 129
130use-package is available from GNU ELPA. If you haven't used Emacs' 130use-package is available from GNU ELPA. If you haven't used
131package manager before, then it is high time you familiarize yourself 131Emacs' package manager before, then it is high time you familiarize yourself
132with it by reading the documentation in the Emacs manual, see 132with it by reading the documentation in the Emacs manual, see
133@ref{Packages,,,emacs,}. 133@ref{Packages,,,emacs,}. Then add one of the archives to @code{package-archives}:
134 134
135First, you need to update the local package list using: 135First, you need to update the local package list using:
136 136
@@ -206,7 +206,7 @@ Now see @ref{Post-Installation Tasks}.
206@section Post-Installation Tasks 206@section Post-Installation Tasks
207 207
208After installing use-package you should verify that you are indeed using the 208After installing use-package you should verify that you are indeed using the
209use-package release you think you are using. It's best to restart Emacs before 209use-package release you think you are using. It's best to restart Emacs before
210doing so, to make sure you are not using an outdated value for @code{load-path}. 210doing so, to make sure you are not using an outdated value for @code{load-path}.
211 211
212@example 212@example
@@ -216,7 +216,7 @@ C-h v use-package-version RET
216should display something like 216should display something like
217 217
218@example 218@example
219use-package-version’s value is "2.4.1" 219use-package-version’s value is "2.4.3"
220@end example 220@end example
221 221
222If you are completely new to use-package then see @ref{Getting Started}. 222If you are completely new to use-package then see @ref{Getting Started}.
@@ -226,13 +226,13 @@ If you run into problems, then please see the @ref{Debugging Tools}.
226@node Getting Started 226@node Getting Started
227@chapter Getting Started 227@chapter Getting Started
228 228
229TODO@. For now, see @code{README.md}. 229TODO@. For now, see @code{README.md}.
230 230
231@node Basic Concepts 231@node Basic Concepts
232@chapter Basic Concepts 232@chapter Basic Concepts
233 233
234@code{use-package} was created for few basic reasons, each of which drove the 234@code{use-package} was created for few basic reasons, each of which drove the
235design in various ways. Understanding these reasons may help make some of 235design in various ways. Understanding these reasons may help make some of
236those decisions clearer: 236those decisions clearer:
237 237
238@itemize 238@itemize
@@ -256,7 +256,7 @@ close to a functional Emacs as possible.
256 256
257@item 257@item
258To allow byte-compilation of one's init file so that any warnings or 258To allow byte-compilation of one's init file so that any warnings or
259errors seen are meaningful. In this way, even if byte-compilation is not 259errors seen are meaningful. In this way, even if byte-compilation is not
260used for speed (reason 3), it can still be used as a sanity check. 260used for speed (reason 3), it can still be used as a sanity check.
261@end itemize 261@end itemize
262 262
@@ -267,25 +267,25 @@ used for speed (reason 3), it can still be used as a sanity check.
267@chapter Keywords 267@chapter Keywords
268 268
269@menu 269@menu
270* @code{after}:: 270* @code{after}:: @code{after}.
271* @code{bind-keymap}, @code{bind-keymap*}: @code{bind-keymap} @code{bind-keymap*}. 271* @code{bind-keymap} @code{bind-keymap*}:: @code{:bind-keymap}, @code{:bind-keymap*}.
272* @code{bind}, @code{bind*}: @code{bind} @code{bind*}. 272* @code{bind} @code{bind*}:: @code{bind} @code{:bind*}.
273* @code{commands}:: 273* @code{commands}:: @code{:commands}.
274* @code{preface}, @code{init}, @code{config}: @code{preface} @code{init} @code{config}. 274* @code{preface} @code{init} @code{config}:: @code{:preface}, @code{:init}, @code{:config}.
275* @code{custom}:: 275* @code{custom}:: @code{:custom}.
276* @code{custom-face}:: 276* @code{custom-face}:: @code{:custom-face}.
277* @code{defer}, @code{demand}: @code{defer} @code{demand}. 277* @code{defer} @code{demand}:: @code{:defer}, @code{:demand}.
278* @code{defines}, @code{functions}: @code{defines} @code{functions}. 278* @code{defines} @code{functions}:: @code{:defines}, @code{:functions}.
279* @code{diminish}, @code{delight}: @code{diminish} @code{delight}. 279* @code{diminish} @code{delight}:: @code{:diminish}, @code{:delight}.
280* @code{disabled}:: 280* @code{disabled}:: @code{:disabled}.
281* @code{ensure}, @code{pin}: @code{ensure} @code{pin}. 281* @code{ensure} @code{pin}:: @code{:ensure}, @code{:pin}.
282* @code{hook}:: 282* @code{hook}:: @code{:hook}.
283* @code{if}, @code{when}, @code{unless}: @code{if} @code{when} @code{unless}. 283* @code{if} @code{when} @code{unless}:: @code{:if}, @code{:when}, @code{:unless}.
284* @code{load-path}:: 284* @code{load-path}:: @code{:load-path}.
285* @code{mode}, @code{interpreter}: @code{mode} @code{interpreter}. 285* @code{mode} @code{interpreter}:: @code{:mode}, @code{:interpreter}.
286* @code{magic}, @code{magic-fallback}: @code{magic} @code{magic-fallback}. 286* @code{magic} @code{magic-fallback}:: @code{:magic}, @code{:magic-fallback}.
287* @code{no-require}:: 287* @code{no-require}:: @code{:no-require}.
288* @code{requires}:: 288* @code{requires}:: @code{:requires}.
289@end menu 289@end menu
290 290
291@node @code{after} 291@node @code{after}
@@ -293,8 +293,8 @@ used for speed (reason 3), it can still be used as a sanity check.
293 293
294Sometimes it only makes sense to configure a package after another has been 294Sometimes it only makes sense to configure a package after another has been
295loaded, because certain variables or functions are not in scope until that 295loaded, because certain variables or functions are not in scope until that
296time. This can achieved using an @code{:after} keyword that allows a fairly rich 296time. This can achieved using an @code{:after} keyword that allows a fairly rich
297description of the exact conditions when loading should occur. Here is an 297description of the exact conditions when loading should occur. Here is an
298example: 298example:
299 299
300@lisp 300@lisp
@@ -309,13 +309,13 @@ example:
309@end lisp 309@end lisp
310 310
311In this case, because all of these packages are demand-loaded in the order 311In this case, because all of these packages are demand-loaded in the order
312they occur, the use of @code{:after} is not strictly necessary. By using it, 312they occur, the use of @code{:after} is not strictly necessary. By using it,
313however, the above code becomes order-independent, without an implicit 313however, the above code becomes order-independent, without an implicit
314depedence on the nature of your init file. 314depedence on the nature of your init file.
315 315
316By default, @code{:after (foo bar)} is the same as @code{:after (:all foo bar)}, meaning 316By default, @code{:after (foo bar)} is the same as @code{:after (:all foo bar)}, meaning
317that loading of the given package will not happen until both @code{foo} and @code{bar} 317that loading of the given package will not happen until both @code{foo} and @code{bar}
318have been loaded. Here are some of the other possibilities: 318have been loaded. Here are some of the other possibilities:
319 319
320@lisp 320@lisp
321:after (foo bar) 321:after (foo bar)
@@ -331,7 +331,7 @@ been loaded, or both @code{baz} and @code{quux} have been loaded.
331 331
332@strong{NOTE}: Pay attention if you set @code{use-package-always-defer} to t, and also use 332@strong{NOTE}: Pay attention if you set @code{use-package-always-defer} to t, and also use
333the @code{:after} keyword, as you will need to specify how the declared package is 333the @code{:after} keyword, as you will need to specify how the declared package is
334to be loaded: e.g., by some @code{:bind}. If you're not using one of the mechanisms 334to be loaded: e.g., by some @code{:bind}. If you're not using one of the mechanisms
335that registers autoloads, such as @code{:bind} or @code{:hook}, and your package manager 335that registers autoloads, such as @code{:bind} or @code{:hook}, and your package manager
336does not provide autoloads, it's possible that without adding @code{:demand t} to 336does not provide autoloads, it's possible that without adding @code{:demand t} to
337those declarations, your package will never be loaded. 337those declarations, your package will never be loaded.
@@ -340,14 +340,14 @@ those declarations, your package will never be loaded.
340@section @code{:bind-keymap}, @code{:bind-keymap*} 340@section @code{:bind-keymap}, @code{:bind-keymap*}
341 341
342Normally @code{:bind} expects that commands are functions that will be autoloaded 342Normally @code{:bind} expects that commands are functions that will be autoloaded
343from the given package. However, this does not work if one of those commands 343from the given package. However, this does not work if one of those commands
344is actually a keymap, since keymaps are not functions, and cannot be 344is actually a keymap, since keymaps are not functions, and cannot be
345autoloaded using Emacs' @code{autoload} mechanism. 345autoloaded using Emacs' @code{autoload} mechanism.
346 346
347To handle this case, @code{use-package} offers a special, limited variant of 347To handle this case, @code{use-package} offers a special, limited variant of
348@code{:bind} called @code{:bind-keymap}. The only difference is that the "commands" 348@code{:bind} called @code{:bind-keymap}. The only difference is that the "commands"
349bound to by @code{:bind-keymap} must be keymaps defined in the package, rather than 349bound to by @code{:bind-keymap} must be keymaps defined in the package, rather than
350command functions. This is handled behind the scenes by generating custom code 350command functions. This is handled behind the scenes by generating custom code
351that loads the package containing the keymap, and then re-executes your 351that loads the package containing the keymap, and then re-executes your
352keypress after the first load, to reinterpret that keypress as a prefix key. 352keypress after the first load, to reinterpret that keypress as a prefix key.
353 353
@@ -386,7 +386,7 @@ A more literal way to do the exact same thing is:
386@end lisp 386@end lisp
387 387
388When you use the @code{:commands} keyword, it creates autoloads for those commands 388When you use the @code{:commands} keyword, it creates autoloads for those commands
389and defers loading of the module until they are used. Since the @code{:init} form 389and defers loading of the module until they are used. Since the @code{:init} form
390is always run---even if @code{ace-jump-mode} might not be on your system---remember 390is always run---even if @code{ace-jump-mode} might not be on your system---remember
391to restrict @code{:init} code to only what would succeed either way. 391to restrict @code{:init} code to only what would succeed either way.
392 392
@@ -402,7 +402,7 @@ The @code{:bind} keyword takes either a cons or a list of conses:
402The @code{:commands} keyword likewise takes either a symbol or a list of symbols. 402The @code{:commands} keyword likewise takes either a symbol or a list of symbols.
403 403
404NOTE: Special keys like @code{tab} or @code{F1}-@code{Fn} can be written in square brackets, 404NOTE: Special keys like @code{tab} or @code{F1}-@code{Fn} can be written in square brackets,
405i.e. @code{[tab]} instead of @code{"tab"}. The syntax for the keybindings is similar to 405i.e. @code{[tab]} instead of @code{"tab"}. The syntax for the keybindings is similar to
406the "kbd" syntax: see @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Rebinding.html, the Emacs Manual} for more information. 406the "kbd" syntax: see @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Rebinding.html, the Emacs Manual} for more information.
407 407
408Examples: 408Examples:
@@ -436,7 +436,7 @@ The effect of this statement is to wait until @code{helm} has loaded, and then t
436bind the key @code{C-c h} to @code{helm-execute-persistent-action} within Helm's local 436bind the key @code{C-c h} to @code{helm-execute-persistent-action} within Helm's local
437keymap, @code{helm-mode-map}. 437keymap, @code{helm-mode-map}.
438 438
439Multiple uses of @code{:map} may be specified. Any binding occurring before the 439Multiple uses of @code{:map} may be specified. Any binding occurring before the
440first use of @code{:map} are applied to the global keymap: 440first use of @code{:map} are applied to the global keymap:
441 441
442@lisp 442@lisp
@@ -470,7 +470,7 @@ Here is the simplest @code{use-package} declaration:
470@end lisp 470@end lisp
471 471
472This loads in the package @code{foo}, but only if @code{foo} is available on your 472This loads in the package @code{foo}, but only if @code{foo} is available on your
473system. If not, a warning is logged to the @code{*Messages*} buffer. If it 473system. If not, a warning is logged to the @code{*Messages*} buffer. If it
474succeeds, a message about @code{"Loading foo"} is logged, along with the time it 474succeeds, a message about @code{"Loading foo"} is logged, along with the time it
475took to load, if it took over 0.1 seconds. 475took to load, if it took over 0.1 seconds.
476 476
@@ -544,14 +544,14 @@ The @code{:custom-face} keyword allows customization of package custom faces.
544@node @code{defer} @code{demand} 544@node @code{defer} @code{demand}
545@section @code{:defer}, @code{:demand} 545@section @code{:defer}, @code{:demand}
546 546
547In almost all cases you don't need to manually specify @code{:defer t}. This is 547In almost all cases you don't need to manually specify @code{:defer t}. This is
548implied whenever @code{:bind} or @code{:mode} or @code{:interpreter} is used. Typically, you 548implied whenever @code{:bind} or @code{:mode} or @code{:interpreter} is used. Typically, you
549only need to specify @code{:defer} if you know for a fact that some other package 549only need to specify @code{:defer} if you know for a fact that some other package
550will do something to cause your package to load at the appropriate time, and 550will do something to cause your package to load at the appropriate time, and
551thus you would like to defer loading even though use-package isn't creating 551thus you would like to defer loading even though use-package isn't creating
552any autoloads for you. 552any autoloads for you.
553 553
554You can override package deferral with the @code{:demand} keyword. Thus, even if 554You can override package deferral with the @code{:demand} keyword. Thus, even if
555you use @code{:bind}, using @code{:demand} will force loading to occur immediately and 555you use @code{:bind}, using @code{:demand} will force loading to occur immediately and
556not establish an autoload for the bound key. 556not establish an autoload for the bound key.
557 557
@@ -593,7 +593,7 @@ If you need to silence a missing function warning, you can use @code{:functions}
593@section @code{:diminish}, @code{:delight} 593@section @code{:diminish}, @code{:delight}
594 594
595@code{use-package} also provides built-in support for the diminish and delight 595@code{use-package} also provides built-in support for the diminish and delight
596utilities---if you have them installed. Their purpose is to remove or change 596utilities---if you have them installed. Their purpose is to remove or change
597minor mode strings in your mode-line. 597minor mode strings in your mode-line.
598 598
599@uref{https://github.com/myrjola/diminish.el, diminish} is invoked with the @code{:diminish} keyword, which is passed either a 599@uref{https://github.com/myrjola/diminish.el, diminish} is invoked with the @code{:diminish} keyword, which is passed either a
@@ -612,7 +612,7 @@ package name with "-mode" appended at the end:
612@uref{https://elpa.gnu.org/packages/delight.html, delight} is invoked with the @code{:delight} keyword, which is passed a minor mode 612@uref{https://elpa.gnu.org/packages/delight.html, delight} is invoked with the @code{:delight} keyword, which is passed a minor mode
613symbol, a replacement string or quoted @uref{https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html, mode-line data} (in which case the minor 613symbol, a replacement string or quoted @uref{https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html, mode-line data} (in which case the minor
614mode symbol is guessed to be the package name with "-mode" appended at the 614mode symbol is guessed to be the package name with "-mode" appended at the
615end), both of these, or several lists of both. If no arguments are provided, 615end), both of these, or several lists of both. If no arguments are provided,
616the default mode name is hidden completely. 616the default mode name is hidden completely.
617 617
618@lisp 618@lisp
@@ -654,7 +654,7 @@ from the output entirely, to accelerate startup times.
654@node @code{ensure} @code{pin} 654@node @code{ensure} @code{pin}
655@section @code{:ensure}, @code{:pin} 655@section @code{:ensure}, @code{:pin}
656 656
657You can use @code{use-package} to load packages from ELPA with @code{package.el}. This 657You can use @code{use-package} to load packages from ELPA with @code{package.el}. This
658is particularly useful if you share your @code{.emacs} among several machines; the 658is particularly useful if you share your @code{.emacs} among several machines; the
659relevant packages are downloaded automatically once declared in your @code{.emacs}. 659relevant packages are downloaded automatically once declared in your @code{.emacs}.
660The @code{:ensure} keyword causes the package(s) to be installed automatically if 660The @code{:ensure} keyword causes the package(s) to be installed automatically if
@@ -684,7 +684,7 @@ archives is also a valid use-case.
684By default @code{package.el} prefers @code{melpa} over @code{melpa-stable} due to the 684By default @code{package.el} prefers @code{melpa} over @code{melpa-stable} due to the
685versioning @code{(> evil-20141208.623 evil-1.0.9)}, so even if you are tracking 685versioning @code{(> evil-20141208.623 evil-1.0.9)}, so even if you are tracking
686only a single package from @code{melpa}, you will need to tag all the non-@code{melpa} 686only a single package from @code{melpa}, you will need to tag all the non-@code{melpa}
687packages with the appropriate archive. If this really annoys you, then you can 687packages with the appropriate archive. If this really annoys you, then you can
688set @code{use-package-always-pin} to set a default. 688set @code{use-package-always-pin} to set a default.
689 689
690If you want to manually keep a package updated and ignore upstream updates, 690If you want to manually keep a package updated and ignore upstream updates,
@@ -729,7 +729,7 @@ Example:
729@section @code{:hook} 729@section @code{:hook}
730 730
731The @code{:hook} keyword allows adding functions onto hooks, here only the basename 731The @code{:hook} keyword allows adding functions onto hooks, here only the basename
732of the hook is required. Thus, all of the following are equivalent: 732of the hook is required. Thus, all of the following are equivalent:
733 733
734@lisp 734@lisp
735(use-package ace-jump-mode 735(use-package ace-jump-mode
@@ -804,8 +804,8 @@ the same thing as @code{:if (not foo)}.
804@section @code{:load-path} 804@section @code{:load-path}
805 805
806If your package needs a directory added to the @code{load-path} in order to load, 806If your package needs a directory added to the @code{load-path} in order to load,
807use @code{:load-path}. This takes a symbol, a function, a string or a list of 807use @code{:load-path}. This takes a symbol, a function, a string or a list of
808strings. If the path is relative, it is expanded within 808strings. If the path is relative, it is expanded within
809@code{user-emacs-directory}: 809@code{user-emacs-directory}:
810 810
811@lisp 811@lisp
@@ -816,8 +816,8 @@ strings. If the path is relative, it is expanded within
816 816
817Note that when using a symbol or a function to provide a dynamically generated 817Note that when using a symbol or a function to provide a dynamically generated
818list of paths, you must inform the byte-compiler of this definition so the 818list of paths, you must inform the byte-compiler of this definition so the
819value is available at byte-compilation time. This is done by using the special 819value is available at byte-compilation time. This is done by using the special
820form @code{eval-and-compile} (as opposed to @code{eval-when-compile}). Further, this 820form @code{eval-and-compile} (as opposed to @code{eval-when-compile}). Further, this
821value is fixed at whatever was determined during compilation, to avoid looking 821value is fixed at whatever was determined during compilation, to avoid looking
822up the same information again on each startup: 822up the same information again on each startup:
823 823
@@ -836,7 +836,7 @@ up the same information again on each startup:
836 836
837Similar to @code{:bind}, you can use @code{:mode} and @code{:interpreter} to establish a 837Similar to @code{:bind}, you can use @code{:mode} and @code{:interpreter} to establish a
838deferred binding within the @code{auto-mode-alist} and @code{interpreter-mode-alist} 838deferred binding within the @code{auto-mode-alist} and @code{interpreter-mode-alist}
839variables. The specifier to either keyword can be a cons cell, a list of cons 839variables. The specifier to either keyword can be a cons cell, a list of cons
840cells, or a string or regexp: 840cells, or a string or regexp:
841 841
842@lisp 842@lisp
@@ -875,8 +875,8 @@ This does exactly the same thing as the following:
875 875
876Similar to @code{:mode} and @code{:interpreter}, you can also use @code{:magic} and 876Similar to @code{:mode} and @code{:interpreter}, you can also use @code{:magic} and
877@code{:magic-fallback} to cause certain function to be run if the beginning of a 877@code{:magic-fallback} to cause certain function to be run if the beginning of a
878file matches a given regular expression. The difference between the two is 878file matches a given regular expression. The difference between the two is
879that @code{:magic-fallback} has a lower priority than @code{:mode}. For example: 879that @code{:magic-fallback} has a lower priority than @code{:mode}. For example:
880 880
881@lisp 881@lisp
882(use-package pdf-tools 882(use-package pdf-tools
@@ -895,9 +895,9 @@ string @code{"%PDF"}.
895 895
896Normally, @code{use-package} will load each package at compile time before 896Normally, @code{use-package} will load each package at compile time before
897compiling the configuration, to ensure that any necessary symbols are in scope 897compiling the configuration, to ensure that any necessary symbols are in scope
898to satisfy the byte-compiler. At times this can cause problems, since a 898to satisfy the byte-compiler. At times this can cause problems, since a
899package may have special loading requirements, and all that you want to use 899package may have special loading requirements, and all that you want to use
900@code{use-package} for is to add a configuration to the @code{eval-after-load} hook. In 900@code{use-package} for is to add a configuration to the @code{eval-after-load} hook. In
901such cases, use the @code{:no-require} keyword: 901such cases, use the @code{:no-require} keyword:
902 902
903@lisp 903@lisp
@@ -913,8 +913,8 @@ such cases, use the @code{:no-require} keyword:
913While the @code{:after} keyword delays loading until the dependencies are loaded, 913While the @code{:after} keyword delays loading until the dependencies are loaded,
914the somewhat simpler @code{:requires} keyword simply never loads the package if the 914the somewhat simpler @code{:requires} keyword simply never loads the package if the
915dependencies are not available at the time the @code{use-package} declaration is 915dependencies are not available at the time the @code{use-package} declaration is
916encountered. By "available" in this context it means that @code{foo} is available 916encountered. By "available" in this context it means that @code{foo} is available
917of @code{(featurep 'foo)} evaluates to a non-nil value. For example: 917of @code{(featurep 'foo)} evaluates to a non-nil value. For example:
918 918
919@lisp 919@lisp
920(use-package abbrev 920(use-package abbrev