comparison man/lispref/customize.texi @ 5378:4f0a1f4cc111

Improve support for min-colors req in `defface'. lisp/faces.el (face-spec-set-match-display): Protect against `display-color-cells' returning nil. Delete unreferenced let-binding of `min-colors'. man/lispref/customize.texi (Face Definitions): New node. (Customization): Add entry to menu. (Variable Definitions): Add cross-ref for `defface'. (Customization Types): Fixup Previous link. man/lispref/faces.texi (Faces): Clarify that built-in properties of faces are computed at runtime.
author Stephen J. Turnbull <stephen@xemacs.org>
date Sat, 19 Mar 2011 22:13:14 +0900
parents eed841acc858
children 9fae6227ede5
comparison
equal deleted inserted replaced
5377:eac2e6bd5b2c 5378:4f0a1f4cc111
13 13
14 @menu 14 @menu
15 * Common Keywords:: 15 * Common Keywords::
16 * Group Definitions:: 16 * Group Definitions::
17 * Variable Definitions:: 17 * Variable Definitions::
18 * Face Definitions::
18 * Customization Types:: 19 * Customization Types::
19 * Enabling Behavior:: 20 * Enabling Behavior::
20 @end menu 21 @end menu
21 22
22 @node Common Keywords 23 @node Common Keywords
161 162
162 @node Variable Definitions 163 @node Variable Definitions
163 @section Defining Customization Variables 164 @section Defining Customization Variables
164 165
165 Use @code{defcustom} to declare user-editable variables. 166 Use @code{defcustom} to declare user-editable variables.
167 For face declarations, use @code{defface} instead. @xref{Face Definitions}.
166 168
167 @tindex defcustom 169 @tindex defcustom
168 @defmac defcustom option default doc [keyword value]... 170 @defmac defcustom option default doc [keyword value]...
169 Declare @var{option} as a customizable user option variable. Do not 171 Declare @var{option} as a customizable user option variable. Do not
170 quote @var{option}. The argument @var{doc} specifies the documentation 172 quote @var{option}. The argument @var{doc} specifies the documentation
286 @code{standard-value} to record the expression for the default value, 288 @code{standard-value} to record the expression for the default value,
287 and @code{saved-value} to record the value saved by the user with the 289 and @code{saved-value} to record the value saved by the user with the
288 customization buffer. The @code{saved-value} property is actually a 290 customization buffer. The @code{saved-value} property is actually a
289 list whose car is an expression which evaluates to the value. 291 list whose car is an expression which evaluates to the value.
290 292
291 @node Customization Types, Enabling Behavior, Variable Definitions, Customization 293 @node Face Definitions, Customization Types, Variable Definitions, Customization
294 @section Face Definitions
295
296 Use @code{defface} to declare a new face. Conventions used in
297 specifying properties are similar to those for general customizable
298 variables. @xref{Variable Definitions}.
299
300 @defun defface face spec doc &rest args
301
302 Declare @var{face} as a customizable face that defaults to @var{spec}.
303 @var{face} does not need to be quoted.
304
305 Third argument @var{doc} is the face documentation.
306
307 If @var{face} has been set with `custom-set-face', set the face attributes
308 as specified by that function, otherwise set the face attributes
309 according to @var{spec}.
310
311 The remaining arguments @var{args} are a property list, which has the
312 form
313
314 @var{keyword} @var{value}...
315
316 The following @var{keyword}s are defined:
317
318 @table @code
319 @item :group
320 @var{value} is a customization group. Add @var{face} to that group.
321 @end table
322
323 @var{spec} is an alist of the form ((@var{display} @var{atts})...).
324
325 @var{atts} is a list of face attributes and their values. The possible
326 attributes are defined in the variable `custom-face-attributes'.
327
328 The @var{atts} of the first entry in @var{spec} where the
329 @var{display} matches the frame take effect in that frame.
330 @var{display} can either be the symbol t, which will match all frames,
331 or an alist of the form \((@var{req} @var{item}...)...)
332
333 For @var{display} to match a frame, the @var{req} property of the
334 frame must match one of the @var{item}. The following @var{req} are
335 defined:
336
337 @table @code
338 @item @code{type} (the value of @code{window-system})
339 Should be one of @code{x}, @code{mswindows}, or @code{tty}.
340
341 @code{class} (the frame's color support)
342 Should be one of @code{color}, @code{grayscale}, or @code{mono}.
343
344 @code{min-colors} (the minimum number of colors the frame supports)
345 Should be in integer which is compared to @code{display-color-cells}
346
347 @code{background} (what color is used for the background text)
348 Should be one of @code{light} or @code{dark}.
349 @end table
350 @end defun
351
352
353 @node Customization Types, Enabling Behavior, Face Definitions, Customization
292 @section Customization Types 354 @section Customization Types
293 355
294 When you define a user option with @code{defcustom}, you must specify 356 When you define a user option with @code{defcustom}, you must specify
295 its @dfn{customization type}. That is a Lisp object which describes (1) 357 its @dfn{customization type}. That is a Lisp object which describes (1)
296 which values are legitimate and (2) how to display the value in the 358 which values are legitimate and (2) how to display the value in the