aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Porter2023-05-12 20:11:01 -0700
committerJim Porter2023-07-12 16:38:15 -0700
commitd2be413c0278f10059ff307d63f25dcf30fe6693 (patch)
treed933dfa54652aad3572480f1ab5793eeb763ff31
parentdce574dfde7668d5c40b0e153d9a21773d28208a (diff)
downloademacs-d2be413c0278f10059ff307d63f25dcf30fe6693.tar.gz
emacs-d2be413c0278f10059ff307d63f25dcf30fe6693.zip
Correct the Eshell documentation about how to write new modules
* doc/misc/eshell.texi (Writing a module): Fix the documentation. 'eshell-defgroup' doesn't exist anymore. Do not merge to master. This is a backport of 77f13edab0f.
-rw-r--r--doc/misc/eshell.texi30
1 files changed, 17 insertions, 13 deletions
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index 44eb438cfd9..cff7c594d96 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -2045,23 +2045,27 @@ This section is not yet written.
2045@node Writing a module 2045@node Writing a module
2046@section Writing a module 2046@section Writing a module
2047 2047
2048An Eshell module is defined the same as any other library but one requirement: the 2048An Eshell module is defined the same as any other library but with two
2049module must define a Customize@footnote{@xref{Customization, , , 2049additional requirements: first, the module's source file should be
2050elisp, The Emacs Lisp Reference Manual}.} 2050named @file{em-@var{name}.el}; second, the module must define an
2051group using @code{eshell-defgroup} (in place of @code{defgroup}) with 2051autoloaded Customize group (@pxref{Customization, , , elisp, The Emacs
2052@code{eshell-module} as the parent group.@footnote{If the module has 2052Lisp Reference Manual}) with @code{eshell-module} as the parent group.
2053no user-customizable options, then there is no need to define it as an 2053In order to properly autoload this group, you should wrap its
2054Eshell module.} You also need to load the following as shown: 2054definition with @code{progn} as follows:
2055 2055
2056@example 2056@example
2057(eval-when-compile 2057;;;###autoload
2058 (require 'cl-lib) 2058(progn
2059 (require 'esh-mode) 2059(defgroup eshell-my-module nil
2060 (require 'eshell)) 2060 "My module lets you do very cool things in Eshell."
2061 2061 :tag "My module"
2062(require 'esh-util) 2062 :group 'eshell-module))
2063@end example 2063@end example
2064 2064
2065Even if you don't have any Customize options in your module, you
2066should still define the group so that Eshell can include your module
2067in the Customize interface for @code{eshell-modules-list}.
2068
2065@node Bugs and ideas 2069@node Bugs and ideas
2066@chapter Bugs and ideas 2070@chapter Bugs and ideas
2067@cindex reporting bugs and ideas 2071@cindex reporting bugs and ideas