]> The Customization Library The Customization Library This manual describes how to declare customization groups, variables, and faces. It doesn't contain any examples, but please look at the file cus-edit.el which contains many declarations you can learn from. All the customization declarations can be changes by keyword arguments. Groups, variables, and faces all share these common keywords: :group value should be a customization group.Add symbol to that group. :link value should be a widget type.Add value to the external links for this customization option.Useful widget types include custom-manual, info-link, andurl-link. :load Add value to the files that should be loaded before displayingthis customization option. The value should be either a string, whichshould be a string which will be loaded with load-library unlesspresent in load-history, or a symbol which will be loaded withrequire. :tag Value should be a short string used for identifying the option incustomization menus and buffers. By default the tag will beautomatically created from the options name. Declaring Groups Use defgroup to declare new customization groups. defgroup — Function: defgroup symbol members doc [ keyword value ] ... Declare symbol as a customization group containing members.symbol does not need to be quoted.doc is the group documentation.members should be an alist of the form ((namewidget)...) where name is a symbol and widget is awidget for editing that symbol. Useful widgets arecustom-variable for editing variables, custom-face forediting faces, and custom-group for editing groups.Internally, custom uses the symbol property custom-group to keeptrack of the group members, and group-documentation for thedocumentation string.The following additional keyword's are defined: :prefix value should be a string. If the string is a prefix for the nameof a member of the group, that prefix will be ignored when creating atag for that member. Declaring Variables Use defcustom to declare user editable variables. defcustom — Function: defcustom symbol value doc [ keyword value ] ... Declare symbol as a customizable variable that defaults to value.Neither symbol nor value needs to be quoted.If symbol is not already bound, initialize it to value.doc is the variable documentation.The following additional keyword's are defined: :type value should be a widget type. :options value should be a list of possible members of the specified type.For hooks, this is a list of function names. :initialize value should be a function used to initialize the variable. Ittakes two arguments, the symbol and value given in the defcustom call.Some predefined functions are: custom-initialize-set Use the :set method to initialize the variable. Do notinitialize it if already bound. This is the default :initializemethod. custom-initialize-default Always use set-default to initialize the variable, even if a:set method has been specified. custom-initialize-reset If the variable is already bound, reset it by calling the :setmethod with the value returned by the :get method. custom-initialize-changed Like custom-initialize-reset, but use set-default toinitialize the variable if it is not bound and has not been setalready. :set value should be a function to set the value of the symbol. Ittakes two arguments, the symbol to set and the value to give it. Thedefault is set-default. :get value should be a function to extract the value of symbol. Thefunction takes one argument, a symbol, and should return the currentvalue for that symbol. The default is default-value. :require value should be a feature symbol. Each feature will be requiredwhen the `defcustom' is evaluated, or when Emacs is started if the userhas saved this option. See See section ``Sexp Types'' in The Widget Library, for information aboutwidgets to use together with the :type keyword. Internally, custom uses the symbol property custom-type to keep track of the variables type, standard-value for the program specified default value, saved-value for a value saved by the user, and variable-documentation for the documentation string. Use custom-add-option to specify that a specific function is useful as a member of a hook. custom-add-option — Function: custom-add-option symbol option To the variable symbol add option.If symbol is a hook variable, option should be a hookmember. For other types of variables, the effect is undefined." Declaring Faces Faces are declared with defface. defface — Function: defface face spec doc [ keyword value ] ... Declare face as a customizable face that defaults to spec.face does not need to be quoted.If face has been set with `custom-set-face', set the face attributesas specified by that function, otherwise set the face attributesaccording to spec.doc is the face documentation.spec should be an alist of the form ‘((display atts)...)’.atts is a list of face attributes and their values. The possibleattributes are defined in the variable `custom-face-attributes'.The atts of the first entry in spec where the displaymatches the frame should take effect in that frame. display caneither be the symbol `t', which will match all frames, or an alist ofthe form ‘((req item...)...)’For the display to match a FRAME, the req property of theframe must match one of the item. The following req aredefined: type (the value of (window-system))Should be one of x or tty. class (the frame's color support)Should be one of color, grayscale, or mono. background (what color is used for the background text)Should be one of light or dark. Internally, custom uses the symbol property face-defface-spec forthe program specified default face properties, saved-face forproperties saved by the user, and face-documentation for thedocumentation string. Usage for Package Authors The recommended usage for the author of a typical emacs lisp package is to create one group identifying the package, and make all user options and faces members of that group. If the package has more than around 20 such options, they should be divided into a number of subgroups, with each subgroup being member of the top level group. The top level group for the package should itself be member of one or more of the standard customization groups. There exists a group for each finder keyword. Press C-h p to see a list of finder keywords, and add you group to each of them, using the :group keyword. Utilities These utilities can come in handy when adding customization support. custom-manual — Widget: custom-manual Widget type for specifying the info manual entry for a customizationoption. It takes one argument, an info address. custom-add-to-group — Function: custom-add-to-group group member widget To existing group add a new member of type widget,If there already is an entry for that member, overwrite it. custom-add-link — Function: custom-add-link symbol widget To the custom option symbol add the link widget. custom-add-load — Function: custom-add-load symbol load To the custom option symbol add the dependency load.load should be either a library file name, or a feature name. customize-menu-create — Function: customize-menu-create symbol &optional name Create menu for customization group symbol.If optional name is given, use that as the name of the menu.Otherwise the menu will be named `Customize'.The menu is in a format applicable to easy-menu-define. The Init File Customizations are saved to the file specified by custom-file, as calls to custom-set-variables and custom-set-faces. When you save customizations, the current implementation removes the calls to custom-set-variables and custom-set-faces, and replaces them with code generated on the basis of the current customization state in Emacs. By default custom-file is your .emacs file (for GNU Emacs and older XEmacs) and is custom.el in the same directory as init.el (in XEmacs 21.4 and later). If you use another file, you must explicitly load it yourself. As of XEmacs 21.4.7, when custom-file is present, it is loaded after init.el. This is likely to change in the future, because (1) actions in init.el often would like to depend on customizations for consistent appearance and (2) Custom is quite brutal about enforcing its idea of the correct values at initialization. Wishlist Better support for keyboard operations in the customize buffer. Integrate with w3 so you can get customization buffers with muchbetter formatting. I'm thinking about adding a <custom>name</custom>tag. The latest w3 have some support for this, so come up with aconvincing example. Add an `examples' section, with explained examples of custom typedefinitions. Support selectable color themes. I.e., change many faces by setting onevariable. Support undo using lmi's gnus-undo.el. Make it possible to append to `choice', `radio', and `set' options. Ask whether set or modified variables should be saved inkill-buffer-hook.Ditto for kill-emacs-query-functions. Command to check if there are any customization options thatdoes not belong to an existing group. Optionally disable the point-cursor and instead highlight the selecteditem in XEmacs. This is like the *Completions* buffer in XEmacs.Suggested by Jens Lautenbacher‘<jens@lemming0.lem.uni-karlsruhe.de>’. Explain why it is necessary that all choices have different defaultvalues. Add some direct support for meta variables, i.e. make it possible tospecify that this variable should be reset when that variable ischanged. Add tutorial. Describe the :type syntax in this manual. Find a place is this manual for the following text:Radio vs. ButtonsUse a radio if you can't find a good way to describe the item in thechoice menu text. I.e. it is better to use a radio if you expect theuser would otherwise manually select each item from the choice menu inturn to see what it expands too.Avoid radios if some of the items expands to complex structures.I mostly use radios when most of the items are of typefunction-item or variable-item. Update customize buffers when custom-set-variable orcustom-save-customized is called. Better handling of saved but uninitialized items. Detect when faces have been changed outside customize. Enable mouse help in Emacs by default. Add an easy way to display the standard settings when an item is modified. See if it is feasible to scan files for customization informationinstead of loading them, Add hint message when user push a non-pushable tag.Suggest that the user unhide if hidden, and edit the value directlyotherwise. Use checkboxes and radio buttons in the state menus. Add option to hide ‘[hide]’ for short options. Default, on. Add option to hide ‘[state]’ for options with their standardsettings. There should be a way to specify site defaults for user options. There should be more buffer styles. The default `nested style, the old`outline' style, a `numeric' style with numbers instead of stars, an`empty' style with just the group name, and `compact' with only one lineper item. Newline and tab should be displayed as ‘^J’ and ‘^I’ in theregexp and file widgets. I think this can be done inXEmacs by adding a display table to the face. Use glyphs to draw the customize-browse tree.Add echo and balloon help. You should be able to read the documentationsimply by moving the mouse pointer above the name.Add parent links.Add colors.