aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-03-12 00:10:08 +0000
committerChong Yidong2009-03-12 00:10:08 +0000
commit0f631634b23efe1d96d9686241d3a85852d07c7a (patch)
treeabcce5f5b0081679048116a6a37b0ecd829e758f
parentf2bbc08cb458a98a4f2ccd396584c0f1937a799a (diff)
downloademacs-0f631634b23efe1d96d9686241d3a85852d07c7a.tar.gz
emacs-0f631634b23efe1d96d9686241d3a85852d07c7a.zip
(Common Keywords): It's not necessary to use :tag
to remove hyphens, as custom-unlispify-tag-name does it automatically. (Variable Definitions): Link to File Local Variables. Document customized-value symbol property. (Customization Types): Move menu to end of node.
-rw-r--r--doc/lispref/customize.texi75
1 files changed, 36 insertions, 39 deletions
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 102fc52776b..01a4feb1fe3 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -40,13 +40,7 @@ display one name.
40Use @var{label}, a string, instead of the item's name, to label the 40Use @var{label}, a string, instead of the item's name, to label the
41item in customization menus and buffers. @strong{Don't use a tag 41item in customization menus and buffers. @strong{Don't use a tag
42which is substantially different from the item's real name; that would 42which is substantially different from the item's real name; that would
43cause confusion.} One legitimate case for use of @code{:tag} is to 43cause confusion.}
44specify a dash where normally a hyphen would be converted to a space:
45
46@example
47(defcustom cursor-in-non-selected-windows @dots{}
48 :tag "Cursor In Non-selected Windows"
49@end example
50 44
51@kindex group@r{, customization keyword} 45@kindex group@r{, customization keyword}
52@item :group @var{group} 46@item :group @var{group}
@@ -266,12 +260,14 @@ turn this feature back on, if someone would like to do the work.
266 Use @code{defcustom} to declare user-customizable variables. 260 Use @code{defcustom} to declare user-customizable variables.
267 261
268@defmac defcustom option standard doc [keyword value]@dots{} 262@defmac defcustom option standard doc [keyword value]@dots{}
269This construct declares @var{option} as a customizable user option 263This macro declares @var{option} as a customizable @dfn{user option}.
270variable. You should not quote @var{option}. The argument @var{doc} 264You should not quote @var{option}.
271specifies the documentation string for the variable. There is no need 265
272to start it with a @samp{*}, because @code{defcustom} automatically 266This causes the function @code{user-variable-p} to return @code{t}
273marks @var{option} as a @dfn{user option} (@pxref{Defining 267when given @var{option} as an argument. @xref{Defining Variables}.
274Variables}). 268The argument @var{doc} specifies the documentation string for the
269variable. (Note that there is no need to start @var{doc} with a
270@samp{*}.)
275 271
276The argument @var{standard} is an expression that specifies the 272The argument @var{standard} is an expression that specifies the
277standard value for @var{option}. Evaluating the @code{defcustom} form 273standard value for @var{option}. Evaluating the @code{defcustom} form
@@ -401,11 +397,13 @@ variables and functions will be defined, so there will not be an error.
401 397
402@item :risky @var{value} 398@item :risky @var{value}
403@kindex risky@r{, @code{defcustom} keyword} 399@kindex risky@r{, @code{defcustom} keyword}
404Set this variable's @code{risky-local-variable} property to @var{value}. 400Set this variable's @code{risky-local-variable} property to
401@var{value} (@pxref{File Local Variables}).
405 402
406@item :safe @var{function} 403@item :safe @var{function}
407@kindex safe@r{, @code{defcustom} keyword} 404@kindex safe@r{, @code{defcustom} keyword}
408Set this variable's @code{safe-local-variable} property to @var{function}. 405Set this variable's @code{safe-local-variable} property to
406@var{function} (@pxref{File Local Variables}).
409 407
410@item :set-after @var{variables} 408@item :set-after @var{variables}
411@kindex set-after@r{, @code{defcustom} keyword} 409@kindex set-after@r{, @code{defcustom} keyword}
@@ -416,11 +414,11 @@ setting this variable until after those others have been handled. Use
416those other variables already have their intended values. 414those other variables already have their intended values.
417@end table 415@end table
418 416
419 The @code{:require} keyword is useful for an option that turns on the 417 It is useful to specify the @code{:require} keyword for an option
420operation of a certain feature. Assuming that the package is coded to 418that ``turns on'' a certain feature. This causes Emacs to load the
421check the value of the option, you still need to arrange for the package 419feature, if it is not already loaded, whenever the option is set.
422to be loaded. You can do that with @code{:require}. @xref{Common 420@xref{Common Keywords}. Here is an example, from the library
423Keywords}. Here is an example, from the library @file{saveplace.el}: 421@file{saveplace.el}:
424 422
425@example 423@example
426(defcustom save-place nil 424(defcustom save-place nil
@@ -454,23 +452,22 @@ of @var{symbol}.
454 452
455Internally, @code{defcustom} uses the symbol property 453Internally, @code{defcustom} uses the symbol property
456@code{standard-value} to record the expression for the standard value, 454@code{standard-value} to record the expression for the standard value,
457and @code{saved-value} to record the value saved by the user with the 455@code{saved-value} to record the value saved by the user with the
458customization buffer. Both properties are actually lists whose car is 456customization buffer, and @code{customized-value} to record the value
459an expression which evaluates to the value. 457set by the user with the customization buffer, but not saved.
458@xref{Property Lists}. These properties are lists, the car of which
459is an expression that evaluates to the value.
460 460
461@defun custom-reevaluate-setting symbol 461@defun custom-reevaluate-setting symbol
462This function re-evaluates the standard value of a user-customizable 462This function re-evaluates the standard value of @var{symbol}, which
463variable declared via @code{defcustom}. (If the variable was 463should be a user option declared via @code{defcustom}. (If the
464customized, this function re-evaluates the saved value instead.) This 464variable was customized, this function re-evaluates the saved value
465is useful for customizable options that are defined before their value 465instead.) This is useful for customizable options that are defined
466could be computed correctly, such as variables defined in packages 466before their value could be computed correctly, such as variables
467that are loaded at dump time, but depend on the run-time information. 467defined in packages that are loaded at dump time, but depend on the
468For example, the value could be a file whose precise name depends on 468run-time information. For example, the value could be a file whose
469the hierarchy of files when Emacs runs, or a name of a program that 469precise name depends on the hierarchy of files when Emacs runs, or a
470needs to be searched at run time. 470name of a program that needs to be searched at run time.
471
472The argument @var{symbol} is the symbol of the variable whose value
473you want to re-evaluate.
474 471
475A good place to put calls to this function is in the function 472A good place to put calls to this function is in the function
476@code{command-line} that is run during startup (@pxref{Startup Summary}) 473@code{command-line} that is run during startup (@pxref{Startup Summary})
@@ -506,12 +503,15 @@ sections. After this symbol come a number of arguments, depending on
506the symbol. Between the type symbol and its arguments, you can 503the symbol. Between the type symbol and its arguments, you can
507optionally write keyword-value pairs (@pxref{Type Keywords}). 504optionally write keyword-value pairs (@pxref{Type Keywords}).
508 505
509 Some of the type symbols do not use any arguments; those are called 506 Some type symbols do not use any arguments; those are called
510@dfn{simple types}. For a simple type, if you do not use any 507@dfn{simple types}. For a simple type, if you do not use any
511keyword-value pairs, you can omit the parentheses around the type 508keyword-value pairs, you can omit the parentheses around the type
512symbol. For example just @code{string} as a customization type is 509symbol. For example just @code{string} as a customization type is
513equivalent to @code{(string)}. 510equivalent to @code{(string)}.
514 511
512 All customization types are implemented as widgets; see @ref{Top, ,
513Introduction, widget, The Emacs Widget Library}, for details.
514
515@menu 515@menu
516* Simple Types:: 516* Simple Types::
517* Composite Types:: 517* Composite Types::
@@ -520,9 +520,6 @@ equivalent to @code{(string)}.
520* Defining New Types:: 520* Defining New Types::
521@end menu 521@end menu
522 522
523All customization types are implemented as widgets; see @ref{Top, ,
524Introduction, widget, The Emacs Widget Library}, for details.
525
526@node Simple Types 523@node Simple Types
527@subsection Simple Types 524@subsection Simple Types
528 525