summaryrefslogtreecommitdiff
path: root/devdocs/elisp/group-definitions.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/group-definitions.html
new repository
Diffstat (limited to 'devdocs/elisp/group-definitions.html')
-rw-r--r--devdocs/elisp/group-definitions.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/devdocs/elisp/group-definitions.html b/devdocs/elisp/group-definitions.html
new file mode 100644
index 00000000..c8810107
--- /dev/null
+++ b/devdocs/elisp/group-definitions.html
@@ -0,0 +1,16 @@
+ <h3 class="section">Defining Customization Groups</h3> <p>Each Emacs Lisp package should have one main customization group which contains all the options, faces and other groups in the package. If the package has a small number of options and faces, use just one group and put everything in it. When there are more than twenty or so options and faces, then you should structure them into subgroups, and put the subgroups under the package’s main customization group. It is OK to put some of the options and faces in the package’s main group alongside the subgroups. </p> <p>The package’s main or only group should be a member of one or more of the standard customization groups. (To display the full list of them, use <kbd>M-x customize</kbd>.) Choose one or more of them (but not too many), and add your group to each of them using the <code>:group</code> keyword. </p> <p>The way to declare new customization groups is with <code>defgroup</code>. </p> <dl> <dt id="defgroup">Macro: <strong>defgroup</strong> <em>group members doc [keyword value]…</em>
+</dt> <dd>
+<p>Declare <var>group</var> as a customization group containing <var>members</var>. Do not quote the symbol <var>group</var>. The argument <var>doc</var> specifies the documentation string for the group. </p> <p>The argument <var>members</var> is a list specifying an initial set of customization items to be members of the group. However, most often <var>members</var> is <code>nil</code>, and you specify the group’s members by using the <code>:group</code> keyword when defining those members. </p> <p>If you want to specify group members through <var>members</var>, each element should have the form <code>(<var>name</var> <var>widget</var>)</code>. Here <var>name</var> is a symbol, and <var>widget</var> is a widget type for editing that symbol. Useful widgets are <code>custom-variable</code> for a variable, <code>custom-face</code> for a face, and <code>custom-group</code> for a group. </p> <p>When you introduce a new group into Emacs, use the <code>:version</code> keyword in the <code>defgroup</code>; then you need not use it for the individual members of the group. </p> <p>In addition to the common keywords (see <a href="common-keywords">Common Keywords</a>), you can also use this keyword in <code>defgroup</code>: </p> <dl compact> <dt><code>:prefix <var>prefix</var></code></dt> <dd>
+ <p>If the name of an item in the group starts with <var>prefix</var>, and the customizable variable <code>custom-unlispify-remove-prefixes</code> is non-<code>nil</code>, the item’s tag will omit <var>prefix</var>. A group can have any number of prefixes. </p>
+</dd> </dl> <p>The variables and subgroups of a group are stored in the <code>custom-group</code> property of the group’s symbol. See <a href="symbol-plists">Symbol Plists</a>. The value of that property is a list of pairs whose <code>car</code> is the variable or subgroup symbol and the <code>cdr</code> is either <code>custom-variable</code> or <code>custom-group</code>. </p>
+</dd>
+</dl> <dl> <dt id="custom-unlispify-remove-prefixes">User Option: <strong>custom-unlispify-remove-prefixes</strong>
+</dt> <dd>
+<p>If this variable is non-<code>nil</code>, the prefixes specified by a group’s <code>:prefix</code> keyword are omitted from tag names, whenever the user customizes the group. </p> <p>The default value is <code>nil</code>, i.e., the prefix-discarding feature is disabled. This is because discarding prefixes often leads to confusing names for options and faces. </p>
+</dd>
+</dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 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/Group-Definitions.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Group-Definitions.html</a>
+ </p>
+</div>