help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : Structuring minor mode into subgroups


From: Drew Adams
Subject: RE: [External] : Structuring minor mode into subgroups
Date: Tue, 26 Jan 2021 21:04:53 +0000

> Can someone show me how I may structure the customisations of a minor mode
> into subgroups?

Not sure what you mean, but maybe this will help.

If you do `M-x customize-group Icicles' you see this:

,----
| Parent groups: dabbrev recentf convenience minibuffer
|                completion matching apropos help
| 
| Icicles group: 
|        State : visible group members are all at standard values.
|    Minibuffer input completion and cycling of completion candidates.
|    See also Doc-Part1, Doc-Part2, Description, Download,
|        Other Libraries by Drew, and Send Bug Report.
|
| Subgroups:
| Icicles-Buffers              Preferences related to buffers.
| Icicles-Completions-Display  Preferences related to display of
|                              completion candidates.
| Icicles-Files                Preferences related to files.
| Icicles-Key-Bindings         Preferences related to key bindings.
| Icicles-Key-Completion       Preferences related to key completion.
| Icicles-Matching             Preferences related to matching input
|                              for completion.
| Icicles-Minibuffer-Display   Preferences related to minibuffer
|                              display during completion.
| Icicles-Miscellaneous        Miscellaneous preferences.
| Icicles-Searching            Preferences related to searching.
`----

You can define a subgroup by specifying the group
you want to be its parent as one of _its_ groups.

E.g., the `defgroup' of `Icicles-Matching' has
`:group 'Icicles', which means it's a subgroup
of group `Icicles'.

(defgroup Icicles-Matching nil
  "Icicles preferences related to matching input for completion."
  :prefix "icicle-" :group 'Icicles)

Then, a particular `defcustom' or `defface' can
specify which groups apply to it.  E.g.:

(defcustom icicle-file-sort nil
  "*A sort function for file names, or nil.
Examples of sort functions are `icicle-dirs-first-p',
`icicle-latest-access-first-p', and
`icicle-latest-modification-first-p'.
If nil, then file names are not sorted."
  :type '(choice
          (const :tag "None" nil)
          (function :value icicle-dirs-first-p))
  :group 'Icicles-Files :group 'Icicles-Completions-Display)
  ^^^^^^                ^^^^^^

The groups are defined in file `icicles-face.el'.
https://www.emacswiki.org/emacs/download/icicles-face.el


reply via email to

[Prev in Thread] Current Thread [Next in Thread]