diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/customization-types.html | |
new repository
Diffstat (limited to 'devdocs/elisp/customization-types.html')
| -rw-r--r-- | devdocs/elisp/customization-types.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/devdocs/elisp/customization-types.html b/devdocs/elisp/customization-types.html new file mode 100644 index 00000000..093b23c9 --- /dev/null +++ b/devdocs/elisp/customization-types.html @@ -0,0 +1,36 @@ + <h3 class="section">Customization Types</h3> <p>When you define a user option with <code>defcustom</code>, you must specify its <em>customization type</em>. That is a Lisp object which describes (1) which values are legitimate and (2) how to display the value in the customization buffer for editing. </p> <p>You specify the customization type in <code>defcustom</code> with the <code>:type</code> keyword. The argument of <code>:type</code> is evaluated, but only once when the <code>defcustom</code> is executed, so it isn’t useful for the value to vary. Normally we use a quoted constant. For example: </p> <div class="example"> <pre class="example">(defcustom diff-command "diff" + "The command to use to run diff." + :type '(string) + :group 'diff) +</pre> +</div> <p>In general, a customization type is a list whose first element is a symbol, one of the customization type names defined in the following sections. After this symbol come a number of arguments, depending on the symbol. Between the type symbol and its arguments, you can optionally write keyword-value pairs (see <a href="type-keywords">Type Keywords</a>). </p> <p>Some type symbols do not use any arguments; those are called <em>simple types</em>. For a simple type, if you do not use any keyword-value pairs, you can omit the parentheses around the type symbol. For example just <code>string</code> as a customization type is equivalent to <code>(string)</code>. </p> <p>All customization types are implemented as widgets; see <a href="https://www.gnu.org/software/emacs/manual/html_node/widget/index.html#Top">Introduction</a> in <cite>The Emacs Widget Library</cite>, for details. </p> <table class="menu" border="0" cellspacing="0"> <tr> +<td align="left" valign="top">• <a href="simple-types" accesskey="1">Simple Types</a> +</td> +<td> </td> +<td align="left" valign="top">Simple customization types: sexp, integer, etc. </td> +</tr> <tr> +<td align="left" valign="top">• <a href="composite-types" accesskey="2">Composite Types</a> +</td> +<td> </td> +<td align="left" valign="top">Build new types from other types or data. </td> +</tr> <tr> +<td align="left" valign="top">• <a href="splicing-into-lists" accesskey="3">Splicing into Lists</a> +</td> +<td> </td> +<td align="left" valign="top">Splice elements into list with <code>:inline</code>. </td> +</tr> <tr> +<td align="left" valign="top">• <a href="type-keywords" accesskey="4">Type Keywords</a> +</td> +<td> </td> +<td align="left" valign="top">Keyword-argument pairs in a customization type. </td> +</tr> <tr> +<td align="left" valign="top">• <a href="defining-new-types" accesskey="5">Defining New Types</a> +</td> +<td> </td> +<td align="left" valign="top">Give your type a name. </td> +</tr> </table><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Customization-Types.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Customization-Types.html</a> + </p> +</div> |
