1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-26 07:00:35 -08:00

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 77f13edab0.
This commit is contained in:
Jim Porter 2023-05-12 20:11:01 -07:00
parent 6c3fe42bde
commit 7c417b2ae5

View file

@ -2045,23 +2045,27 @@ This section is not yet written.
@node Writing a module @node Writing a module
@section Writing a module @section Writing a module
An Eshell module is defined the same as any other library but one requirement: the An Eshell module is defined the same as any other library but with two
module must define a Customize@footnote{@xref{Customization, , , additional requirements: first, the module's source file should be
elisp, The Emacs Lisp Reference Manual}.} named @file{em-@var{name}.el}; second, the module must define an
group using @code{eshell-defgroup} (in place of @code{defgroup}) with autoloaded Customize group (@pxref{Customization, , , elisp, The Emacs
@code{eshell-module} as the parent group.@footnote{If the module has Lisp Reference Manual}) with @code{eshell-module} as the parent group.
no user-customizable options, then there is no need to define it as an In order to properly autoload this group, you should wrap its
Eshell module.} You also need to load the following as shown: definition with @code{progn} as follows:
@example @example
(eval-when-compile ;;;###autoload
(require 'cl-lib) (progn
(require 'esh-mode) (defgroup eshell-my-module nil
(require 'eshell)) "My module lets you do very cool things in Eshell."
:tag "My module"
(require 'esh-util) :group 'eshell-module))
@end example @end example
Even if you don't have any Customize options in your module, you
should still define the group so that Eshell can include your module
in the Customize interface for @code{eshell-modules-list}.
@node Bugs and ideas @node Bugs and ideas
@chapter Bugs and ideas @chapter Bugs and ideas
@cindex reporting bugs and ideas @cindex reporting bugs and ideas