aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMauro Aranda2025-01-12 15:19:40 -0300
committerEli Zaretskii2025-01-12 21:25:06 +0200
commit30e84fc6537e8caf275eecfe0f056fe658e7d2b7 (patch)
tree8ab789b22640f24a7d960142f6d2660c5ecc460a /doc
parentd66b8d4becb6804d3bd912a000dc64ccfdbe6810 (diff)
downloademacs-30e84fc6537e8caf275eecfe0f056fe658e7d2b7.tar.gz
emacs-30e84fc6537e8caf275eecfe0f056fe658e7d2b7.zip
Emphasize the use of :tag for new customization types
* doc/lispref/customize.texi (Type Keywords): Name important use cases of the :tag keyword. (Defining New Types): Emphasize the use of the :tag keyword when using the lazy widget. (Bug#74409) (cherry picked from commit 99b85e116f09e68e0d5750c9772d0a2489680078)
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/customize.texi18
1 files changed, 13 insertions, 5 deletions
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index abd79227e31..f687acfe1c8 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -1177,7 +1177,10 @@ The symbol's value is used.
1177 1177
1178@item :tag @var{tag} 1178@item :tag @var{tag}
1179Use @var{tag} (a string) as the tag for the value (or part of the value) 1179Use @var{tag} (a string) as the tag for the value (or part of the value)
1180that corresponds to this type. 1180that corresponds to this type. It's important to provide an informative
1181tag for the customization interface, especially if you're using the
1182@code{restricted-sexp} type or if you're defining a new type.
1183@xref{Defining New Types}.
1181 1184
1182@item :doc @var{doc} 1185@item :doc @var{doc}
1183@kindex doc@r{, customization keyword} 1186@kindex doc@r{, customization keyword}
@@ -1346,10 +1349,15 @@ with this widget. Here a @code{binary-tree-of-string} is described as
1346being either a string, or a cons-cell whose car and cdr are themselves 1349being either a string, or a cons-cell whose car and cdr are themselves
1347both @code{binary-tree-of-string}. Note the reference to the widget 1350both @code{binary-tree-of-string}. Note the reference to the widget
1348type we are currently in the process of defining. The @code{:tag} 1351type we are currently in the process of defining. The @code{:tag}
1349attribute is a string to name the widget in the user interface, and the 1352is another important keyword argument because we are using the
1350@code{:offset} argument is there to ensure that child nodes are 1353@code{lazy} widget for our new widget. By default, the @code{lazy}
1351indented four spaces relative to the parent node, making the tree 1354widget doesn't have a tag, and in its absence the customization buffer
1352structure apparent in the customization buffer. 1355will show the entire widget's value (that is, the value of the user
1356option being customized). Since that's almost never a good idea, we
1357provide a string to name the @code{binary-tree-or-string} widget. The
1358@code{:offset} argument is there to ensure that child nodes are indented
1359four spaces relative to the parent node, making the tree structure
1360apparent in the customization buffer.
1353 1361
1354The @code{defcustom} shows how the new widget can be used as an ordinary 1362The @code{defcustom} shows how the new widget can be used as an ordinary
1355customization type. 1363customization type.