diff options
| author | Chong Yidong | 2009-03-12 00:10:08 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-03-12 00:10:08 +0000 |
| commit | 0f631634b23efe1d96d9686241d3a85852d07c7a (patch) | |
| tree | abcce5f5b0081679048116a6a37b0ecd829e758f | |
| parent | f2bbc08cb458a98a4f2ccd396584c0f1937a799a (diff) | |
| download | emacs-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.texi | 75 |
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. | |||
| 40 | Use @var{label}, a string, instead of the item's name, to label the | 40 | Use @var{label}, a string, instead of the item's name, to label the |
| 41 | item in customization menus and buffers. @strong{Don't use a tag | 41 | item in customization menus and buffers. @strong{Don't use a tag |
| 42 | which is substantially different from the item's real name; that would | 42 | which is substantially different from the item's real name; that would |
| 43 | cause confusion.} One legitimate case for use of @code{:tag} is to | 43 | cause confusion.} |
| 44 | specify 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{} |
| 269 | This construct declares @var{option} as a customizable user option | 263 | This macro declares @var{option} as a customizable @dfn{user option}. |
| 270 | variable. You should not quote @var{option}. The argument @var{doc} | 264 | You should not quote @var{option}. |
| 271 | specifies the documentation string for the variable. There is no need | 265 | |
| 272 | to start it with a @samp{*}, because @code{defcustom} automatically | 266 | This causes the function @code{user-variable-p} to return @code{t} |
| 273 | marks @var{option} as a @dfn{user option} (@pxref{Defining | 267 | when given @var{option} as an argument. @xref{Defining Variables}. |
| 274 | Variables}). | 268 | The argument @var{doc} specifies the documentation string for the |
| 269 | variable. (Note that there is no need to start @var{doc} with a | ||
| 270 | @samp{*}.) | ||
| 275 | 271 | ||
| 276 | The argument @var{standard} is an expression that specifies the | 272 | The argument @var{standard} is an expression that specifies the |
| 277 | standard value for @var{option}. Evaluating the @code{defcustom} form | 273 | standard 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} |
| 404 | Set this variable's @code{risky-local-variable} property to @var{value}. | 400 | Set 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} |
| 408 | Set this variable's @code{safe-local-variable} property to @var{function}. | 405 | Set 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 | |||
| 416 | those other variables already have their intended values. | 414 | those 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 |
| 420 | operation of a certain feature. Assuming that the package is coded to | 418 | that ``turns on'' a certain feature. This causes Emacs to load the |
| 421 | check the value of the option, you still need to arrange for the package | 419 | feature, if it is not already loaded, whenever the option is set. |
| 422 | to be loaded. You can do that with @code{:require}. @xref{Common | 420 | @xref{Common Keywords}. Here is an example, from the library |
| 423 | Keywords}. 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 | ||
| 455 | Internally, @code{defcustom} uses the symbol property | 453 | Internally, @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, |
| 457 | and @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 |
| 458 | customization buffer. Both properties are actually lists whose car is | 456 | customization buffer, and @code{customized-value} to record the value |
| 459 | an expression which evaluates to the value. | 457 | set by the user with the customization buffer, but not saved. |
| 458 | @xref{Property Lists}. These properties are lists, the car of which | ||
| 459 | is an expression that evaluates to the value. | ||
| 460 | 460 | ||
| 461 | @defun custom-reevaluate-setting symbol | 461 | @defun custom-reevaluate-setting symbol |
| 462 | This function re-evaluates the standard value of a user-customizable | 462 | This function re-evaluates the standard value of @var{symbol}, which |
| 463 | variable declared via @code{defcustom}. (If the variable was | 463 | should be a user option declared via @code{defcustom}. (If the |
| 464 | customized, this function re-evaluates the saved value instead.) This | 464 | variable was customized, this function re-evaluates the saved value |
| 465 | is useful for customizable options that are defined before their value | 465 | instead.) This is useful for customizable options that are defined |
| 466 | could be computed correctly, such as variables defined in packages | 466 | before their value could be computed correctly, such as variables |
| 467 | that are loaded at dump time, but depend on the run-time information. | 467 | defined in packages that are loaded at dump time, but depend on the |
| 468 | For example, the value could be a file whose precise name depends on | 468 | run-time information. For example, the value could be a file whose |
| 469 | the hierarchy of files when Emacs runs, or a name of a program that | 469 | precise name depends on the hierarchy of files when Emacs runs, or a |
| 470 | needs to be searched at run time. | 470 | name of a program that needs to be searched at run time. |
| 471 | |||
| 472 | The argument @var{symbol} is the symbol of the variable whose value | ||
| 473 | you want to re-evaluate. | ||
| 474 | 471 | ||
| 475 | A good place to put calls to this function is in the function | 472 | A 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 | |||
| 506 | the symbol. Between the type symbol and its arguments, you can | 503 | the symbol. Between the type symbol and its arguments, you can |
| 507 | optionally write keyword-value pairs (@pxref{Type Keywords}). | 504 | optionally 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 |
| 511 | keyword-value pairs, you can omit the parentheses around the type | 508 | keyword-value pairs, you can omit the parentheses around the type |
| 512 | symbol. For example just @code{string} as a customization type is | 509 | symbol. For example just @code{string} as a customization type is |
| 513 | equivalent to @code{(string)}. | 510 | equivalent to @code{(string)}. |
| 514 | 511 | ||
| 512 | All customization types are implemented as widgets; see @ref{Top, , | ||
| 513 | Introduction, 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 | ||
| 523 | All customization types are implemented as widgets; see @ref{Top, , | ||
| 524 | Introduction, 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 | ||