summaryrefslogtreecommitdiff
path: root/doc/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'doc/emacs')
-rw-r--r--doc/emacs/custom.texi22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index f75512a00e9..24a34552fb6 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -2701,6 +2701,28 @@ function is not defined.
A @code{setq} on a variable which does not exist is generally
harmless, so those do not need a conditional.
+
+@item
+Using @code{use-package} to automatically load and configure a
+package.
+
+@example
+(use-package hi-lock
+ :defer t
+ :init (add-hook 'some-hook 'hi-lock-mode)
+ :config (use-package my-hi-lock)
+ :bind (("M-o l" . highlight-lines-matching-regexp)
+ ("M-o r" . highlight-regexp)
+ ("M-o w" . highlight-phrase)))
+@end example
+
+@noindent
+This will load @code{hi-lock} when some of its commands or variables
+are first used, bind 3 keys to its commands, and additionally load the
+@code{my-hi-lock} package (presumably further customizing
+@code{hi-lock}) after loading @code{hi-lock}. The @code{use-package}
+facility is fully documented in its own manual, @pxref{Top,,,
+use-package, use-package User manual}.
@end itemize
@node Terminal Init