diff options
| author | Mauro Aranda | 2025-01-12 15:19:40 -0300 |
|---|---|---|
| committer | Eli Zaretskii | 2025-01-12 21:25:06 +0200 |
| commit | 30e84fc6537e8caf275eecfe0f056fe658e7d2b7 (patch) | |
| tree | 8ab789b22640f24a7d960142f6d2660c5ecc460a /doc | |
| parent | d66b8d4becb6804d3bd912a000dc64ccfdbe6810 (diff) | |
| download | emacs-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.texi | 18 |
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} |
| 1179 | Use @var{tag} (a string) as the tag for the value (or part of the value) | 1179 | Use @var{tag} (a string) as the tag for the value (or part of the value) |
| 1180 | that corresponds to this type. | 1180 | that corresponds to this type. It's important to provide an informative |
| 1181 | tag 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 | |||
| 1346 | being either a string, or a cons-cell whose car and cdr are themselves | 1349 | being either a string, or a cons-cell whose car and cdr are themselves |
| 1347 | both @code{binary-tree-of-string}. Note the reference to the widget | 1350 | both @code{binary-tree-of-string}. Note the reference to the widget |
| 1348 | type we are currently in the process of defining. The @code{:tag} | 1351 | type we are currently in the process of defining. The @code{:tag} |
| 1349 | attribute is a string to name the widget in the user interface, and the | 1352 | is 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} |
| 1351 | indented four spaces relative to the parent node, making the tree | 1354 | widget doesn't have a tag, and in its absence the customization buffer |
| 1352 | structure apparent in the customization buffer. | 1355 | will show the entire widget's value (that is, the value of the user |
| 1356 | option being customized). Since that's almost never a good idea, we | ||
| 1357 | provide 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 | ||
| 1359 | four spaces relative to the parent node, making the tree structure | ||
| 1360 | apparent in the customization buffer. | ||
| 1353 | 1361 | ||
| 1354 | The @code{defcustom} shows how the new widget can be used as an ordinary | 1362 | The @code{defcustom} shows how the new widget can be used as an ordinary |
| 1355 | customization type. | 1363 | customization type. |