[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/emacs-29-eshell-docs d2be413c027 3/9: Correct the Eshell documen
From: |
Jim Porter |
Subject: |
scratch/emacs-29-eshell-docs d2be413c027 3/9: Correct the Eshell documentation about how to write new modules |
Date: |
Wed, 12 Jul 2023 20:06:51 -0400 (EDT) |
branch: scratch/emacs-29-eshell-docs
commit d2be413c0278f10059ff307d63f25dcf30fe6693
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>
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.
---
doc/misc/eshell.texi | 30 +++++++++++++++++-------------
1 file 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.
@node Writing a module
@section Writing a module
-An Eshell module is defined the same as any other library but one requirement:
the
-module must define a Customize@footnote{@xref{Customization, , ,
-elisp, The Emacs Lisp Reference Manual}.}
-group using @code{eshell-defgroup} (in place of @code{defgroup}) with
-@code{eshell-module} as the parent group.@footnote{If the module has
-no user-customizable options, then there is no need to define it as an
-Eshell module.} You also need to load the following as shown:
+An Eshell module is defined the same as any other library but with two
+additional requirements: first, the module's source file should be
+named @file{em-@var{name}.el}; second, the module must define an
+autoloaded Customize group (@pxref{Customization, , , elisp, The Emacs
+Lisp Reference Manual}) with @code{eshell-module} as the parent group.
+In order to properly autoload this group, you should wrap its
+definition with @code{progn} as follows:
@example
-(eval-when-compile
- (require 'cl-lib)
- (require 'esh-mode)
- (require 'eshell))
-
-(require 'esh-util)
+;;;###autoload
+(progn
+(defgroup eshell-my-module nil
+ "My module lets you do very cool things in Eshell."
+ :tag "My module"
+ :group 'eshell-module))
@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
@chapter Bugs and ideas
@cindex reporting bugs and ideas
- branch scratch/emacs-29-eshell-docs created (now afefdfb6a11), Jim Porter, 2023/07/12
- scratch/emacs-29-eshell-docs dce574dfde7 2/9: Restructure Eshell extension modules documentation, Jim Porter, 2023/07/12
- scratch/emacs-29-eshell-docs d2be413c027 3/9: Correct the Eshell documentation about how to write new modules,
Jim Porter <=
- scratch/emacs-29-eshell-docs a3e03964a0d 1/9: ; * doc/misc/eshell.texi (Bugs and ideas): Remove implemented feature., Jim Porter, 2023/07/12
- scratch/emacs-29-eshell-docs b1cda740b8d 8/9: Add documentation about remote access in Eshell, Jim Porter, 2023/07/12
- scratch/emacs-29-eshell-docs d7a30977755 4/9: Document optional Eshell modules, Jim Porter, 2023/07/12
- scratch/emacs-29-eshell-docs 54899c3e1b3 6/9: ; * doc/misc/eshell.texi: Fix typos and clean up unclear wording., Jim Porter, 2023/07/12
- scratch/emacs-29-eshell-docs 1a99a7e4b61 7/9: ; * doc/misc/eshell.texi: Fix last change., Jim Porter, 2023/07/12
- scratch/emacs-29-eshell-docs a1a57f821ea 5/9: Document some missing Eshell commands, Jim Porter, 2023/07/12
- scratch/emacs-29-eshell-docs afefdfb6a11 9/9: ; * doc/misc/eshell.texi (Invocation): Whitespace cleanup., Jim Porter, 2023/07/12