aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2004-12-05 14:14:50 +0000
committerRichard M. Stallman2004-12-05 14:14:50 +0000
commitbba2a48eb4aef72cd2b3121b697a607af2dde5ad (patch)
treeacc620b1f8ccf91268600df9c72123c40f5876ae
parent99d0c9920d798dcad71e9c7aabca263c59dbf5f8 (diff)
downloademacs-bba2a48eb4aef72cd2b3121b697a607af2dde5ad.tar.gz
emacs-bba2a48eb4aef72cd2b3121b697a607af2dde5ad.zip
(Easy Customization): Move up to section level,
before Variables. Avoid using the term "variable"; say "option". New initial explanation. (Variables): In initial explanation, connect "variable" to the already-explained "user option".
-rw-r--r--man/custom.texi271
1 files changed, 137 insertions, 134 deletions
diff --git a/man/custom.texi b/man/custom.texi
index 6823dc3bfe5..aeddb35b140 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -27,6 +27,8 @@ replay sequences of keys.
27@menu 27@menu
28* Minor Modes:: Each minor mode is one feature you can turn on 28* Minor Modes:: Each minor mode is one feature you can turn on
29 independently of any others. 29 independently of any others.
30* Easy Customization::
31 Convenient way to browse and change user options.
30* Variables:: Many Emacs commands examine Emacs variables 32* Variables:: Many Emacs commands examine Emacs variables
31 to decide what to do; by setting variables, 33 to decide what to do; by setting variables,
32 you can control their functioning. 34 you can control their functioning.
@@ -171,132 +173,28 @@ explicitly ``reactivate'' it, before each command that uses the region.
171The advantage of Transient Mark mode is that Emacs can display the 173The advantage of Transient Mark mode is that Emacs can display the
172region highlighted (currently only when using X). @xref{Mark}. 174region highlighted (currently only when using X). @xref{Mark}.
173 175
174@node Variables
175@section Variables
176@cindex variable
177@cindex option, user
178@cindex user option
179
180 A @dfn{variable} is a Lisp symbol which has a value. The symbol's
181name is also called the name of the variable. A variable name can
182contain any characters that can appear in a file, but conventionally
183variable names consist of words separated by hyphens. A variable can
184have a documentation string which describes what kind of value it should
185have and how the value will be used.
186
187 Lisp allows any variable to have any kind of value, but most variables
188that Emacs uses require a value of a certain type. Often the value should
189always be a string, or should always be a number. Sometimes we say that a
190certain feature is turned on if a variable is ``non-@code{nil},'' meaning
191that if the variable's value is @code{nil}, the feature is off, but the
192feature is on for @emph{any} other value. The conventional value to use to
193turn on the feature---since you have to pick one particular value when you
194set the variable---is @code{t}.
195
196 Emacs uses many Lisp variables for internal record keeping, as any
197Lisp program must, but the most interesting variables for you are the
198ones that exist for the sake of customization. Emacs does not (usually)
199change the values of these variables; instead, you set the values, and
200thereby alter and control the behavior of certain Emacs commands. These
201variables are called @dfn{user options}. Most user options are
202documented in this manual, and appear in the Variable Index
203(@pxref{Variable Index}).
204
205 One example of a variable which is a user option is @code{fill-column}, which
206specifies the position of the right margin (as a number of characters from
207the left margin) to be used by the fill commands (@pxref{Filling}).
208
209@menu
210* Examining:: Examining or setting one variable's value.
211* Easy Customization::
212 Convenient and easy customization of variables.
213* Hooks:: Hook variables let you specify programs for parts
214 of Emacs to run on particular occasions.
215* Locals:: Per-buffer values of variables.
216* File Variables:: How files can specify variable values.
217@end menu
218
219@node Examining
220@subsection Examining and Setting Variables
221@cindex setting variables
222
223@table @kbd
224@item C-h v @var{var} @key{RET}
225Display the value and documentation of variable @var{var}
226(@code{describe-variable}).
227@item M-x set-variable @key{RET} @var{var} @key{RET} @var{value} @key{RET}
228Change the value of variable @var{var} to @var{value}.
229@end table
230
231 To examine the value of a single variable, use @kbd{C-h v}
232(@code{describe-variable}), which reads a variable name using the
233minibuffer, with completion. It displays both the value and the
234documentation of the variable. For example,
235
236@example
237C-h v fill-column @key{RET}
238@end example
239
240@noindent
241displays something like this:
242
243@smallexample
244fill-column's value is 70
245
246Documentation:
247*Column beyond which automatic line-wrapping should happen.
248Automatically becomes buffer-local when set in any fashion.
249@end smallexample
250
251@noindent
252The star at the beginning of the documentation indicates that this
253variable is a user option. @kbd{C-h v} is not restricted to user
254options; it allows any variable name.
255
256@findex set-variable
257 The most convenient way to set a specific user option is with @kbd{M-x
258set-variable}. This reads the variable name with the minibuffer (with
259completion), and then reads a Lisp expression for the new value using
260the minibuffer a second time. For example,
261
262@example
263M-x set-variable @key{RET} fill-column @key{RET} 75 @key{RET}
264@end example
265
266@noindent
267sets @code{fill-column} to 75.
268
269 @kbd{M-x set-variable} is limited to user option variables, but you can
270set any variable with a Lisp expression, using the function @code{setq}.
271Here is a @code{setq} expression to set @code{fill-column}:
272
273@example
274(setq fill-column 75)
275@end example
276
277 To execute an expression like this one, go to the @samp{*scratch*}
278buffer, type in the expression, and then type @kbd{C-j}. @xref{Lisp
279Interaction}.
280
281 Setting variables, like all means of customizing Emacs except where
282otherwise stated, affects only the current Emacs session.
283
284@node Easy Customization 176@node Easy Customization
285@subsection Easy Customization Interface 177@section Easy Customization Interface
178
179@cindex user option
180 Emacs has many @dfn{user options} which have values that you can set
181in order to customize various commands. Most user options are
182documented in this manual. Each user option is actually a Lisp
183variable (@pxref{Variables}), so their names appear in the Variable
184Index (@pxref{Variable Index}).
286 185
287@findex customize 186@findex customize
288@cindex customization buffer 187@cindex customization buffer
289 A convenient way to find the user option variables that you want to 188 You can browse interactively through the the user options and change
290change, and then change them, is with @kbd{M-x customize}. This 189some of them using @kbd{M-x customize}. This command creates a
291command creates a @dfn{customization buffer} with which you can browse 190@dfn{customization buffer}, which offers commands to navigate through
292through the Emacs user options in a logically organized structure, 191a logically organized structure of the Emacs user options; you can
293then edit and set their values. You can also use the customization 192also use it to edit and set their values, and to save settings
294buffer to save settings permanently in your @file{~/.emacs} file 193permanently in your @file{~/.emacs} file (@pxref{Init File}).
295(@pxref{Init File}). 194
296 195 The appearance of the example buffers in this section is typically
297The appearance of the example buffers in the following is typically 196different under a window system, since faces are then used to indicate
298different under a window system where faces can be used to indicate the 197the active fields and other features.
299active fields and other features.
300 198
301@menu 199@menu
302* Groups: Customization Groups. 200* Groups: Customization Groups.
@@ -309,7 +207,7 @@ active fields and other features.
309@end menu 207@end menu
310 208
311@node Customization Groups 209@node Customization Groups
312@subsubsection Customization Groups 210@subsection Customization Groups
313@cindex customization groups 211@cindex customization groups
314 212
315 For customization purposes, user options are organized into 213 For customization purposes, user options are organized into
@@ -389,7 +287,7 @@ that group and its contents, just that option, or just that face.
389This is the way to set values in it. 287This is the way to set values in it.
390 288
391@node Changing an Option 289@node Changing an Option
392@subsubsection Changing an Option 290@subsection Changing an Option
393 291
394 Here is an example of what a user option looks like in the 292 Here is an example of what a user option looks like in the
395customization buffer: 293customization buffer:
@@ -411,7 +309,7 @@ of the option: in the example above, it says you have not changed the
411option yet. The word @samp{[State]} at the beginning of this line is 309option yet. The word @samp{[State]} at the beginning of this line is
412active; you can get a menu of various operations by invoking it with 310active; you can get a menu of various operations by invoking it with
413@kbd{Mouse-1} or @key{RET}. These operations are essential for 311@kbd{Mouse-1} or @key{RET}. These operations are essential for
414customizing the variable. 312customizing the user option.
415 313
416 The line after the @samp{[State]} line displays the beginning of the 314 The line after the @samp{[State]} line displays the beginning of the
417option's documentation string. If there are more lines of 315option's documentation string. If there are more lines of
@@ -430,7 +328,7 @@ change to say that you have edited the value:
430@end smallexample 328@end smallexample
431 329
432@cindex setting option value 330@cindex setting option value
433 Editing the value does not actually set the option variable. To do 331 Editing the value does not actually set the option. To do
434that, you must @dfn{set} the option. To do this, invoke the word 332that, you must @dfn{set} the option. To do this, invoke the word
435@samp{[State]} and choose @samp{Set for Current Session}. 333@samp{[State]} and choose @samp{Set for Current Session}.
436 334
@@ -523,7 +421,7 @@ editable field, use @kbd{C-o} or @kbd{C-q C-j}.
523@dfn{saving} the value changes it for future sessions as well. To 421@dfn{saving} the value changes it for future sessions as well. To
524save the option, invoke @samp{[State]} and select the @samp{Save for 422save the option, invoke @samp{[State]} and select the @samp{Save for
525Future Sessions} operation. This works by writing code so as to set 423Future Sessions} operation. This works by writing code so as to set
526the option variable again each time you start Emacs (@pxref{Saving 424the option again, each time you start Emacs (@pxref{Saving
527Customizations}). 425Customizations}).
528 426
529 You can also restore the option to its standard value by invoking 427 You can also restore the option to its standard value by invoking
@@ -547,8 +445,8 @@ so that you will get the standard value in future Emacs sessions.
547 445
548@item Use Backup Value 446@item Use Backup Value
549This sets the option to a previous value that was set in the 447This sets the option to a previous value that was set in the
550customization buffer in this session. If you customize a variable 448customization buffer in this session. If you customize an option
551and then reset the variable, which discards the customized value, 449and then reset it, which discards the customized value,
552you can get the customized value back again with this operation. 450you can get the customized value back again with this operation.
553@end table 451@end table
554 452
@@ -583,7 +481,7 @@ reset---on each of the items in the buffer that could meaningfully be
583set, saved or reset. 481set, saved or reset.
584 482
585@node Saving Customizations 483@node Saving Customizations
586@subsubsection Saving Customizations 484@subsection Saving Customizations
587 485
588@vindex custom-file 486@vindex custom-file
589 The customization buffer normally saves customizations in 487 The customization buffer normally saves customizations in
@@ -615,7 +513,7 @@ saving customizations from such a session would wipe out all the other
615customizations you might have on your init file. 513customizations you might have on your init file.
616 514
617@node Face Customization 515@node Face Customization
618@subsubsection Customizing Faces 516@subsection Customizing Faces
619@cindex customizing faces 517@cindex customizing faces
620@cindex bold font 518@cindex bold font
621@cindex italic font 519@cindex italic font
@@ -676,7 +574,7 @@ you don't want to change that attribute. Type @samp{none} if you want
676to clear out the attribute. 574to clear out the attribute.
677 575
678@node Specific Customization 576@node Specific Customization
679@subsubsection Customizing Specific Items 577@subsection Customizing Specific Items
680 578
681 Instead of finding the options you want to change by moving down 579 Instead of finding the options you want to change by moving down
682through the structure of groups, you can specify the particular option, 580through the structure of groups, you can specify the particular option,
@@ -704,7 +602,7 @@ have customized but not saved.
704@end table 602@end table
705 603
706@findex customize-option 604@findex customize-option
707 If you want to alter a particular user option variable with the 605 If you want to alter a particular user option with the
708customization buffer, and you know its name, you can use the command 606customization buffer, and you know its name, you can use the command
709@kbd{M-x customize-option} and specify the option name. This sets up 607@kbd{M-x customize-option} and specify the option name. This sets up
710the customization buffer with just one option---the one that you asked 608the customization buffer with just one option---the one that you asked
@@ -719,7 +617,7 @@ on the character after point.
719@findex customize-group 617@findex customize-group
720 You can also set up the customization buffer with a specific group, 618 You can also set up the customization buffer with a specific group,
721using @kbd{M-x customize-group}. The immediate contents of the chosen 619using @kbd{M-x customize-group}. The immediate contents of the chosen
722group, including option variables, faces, and other groups, all appear 620group, including user options, faces, and other groups, all appear
723as well. However, these subgroups' own contents start out hidden. You 621as well. However, these subgroups' own contents start out hidden. You
724can show their contents in the usual way, by invoking @samp{[Show]}. 622can show their contents in the usual way, by invoking @samp{[Show]}.
725 623
@@ -747,6 +645,111 @@ you can use two special commands to revisit your previous changes. Use
747saved. Use @kbd{M-x customize-customized} to look at the options and 645saved. Use @kbd{M-x customize-customized} to look at the options and
748faces that you have set but not saved. 646faces that you have set but not saved.
749 647
648@node Variables
649@section Variables
650@cindex variable
651@cindex option, user
652@cindex user option
653
654 A @dfn{variable} is a Lisp symbol which has a value. The symbol's
655name is also called the name of the variable. A variable name can
656contain any characters that can appear in a file, but conventionally
657variable names consist of words separated by hyphens. A variable can
658have a documentation string which describes what kind of value it should
659have and how the value will be used.
660
661 Lisp allows any variable to have any kind of value, but most variables
662that Emacs uses need a value of a certain type. Often the value should
663always be a string, or should always be a number. Sometimes we say that a
664certain feature is turned on if a variable is ``non-@code{nil},'' meaning
665that if the variable's value is @code{nil}, the feature is off, but the
666feature is on for @emph{any} other value. The conventional value to use to
667turn on the feature---since you have to pick one particular value when you
668set the variable---is @code{t}.
669
670 Emacs uses many Lisp variables for internal record keeping, but the
671most interesting variables for a non-programmer user are the @dfn{user
672options}, the variables that are meant for users to change. Each user
673option that you can set with the customization buffera is, in fact, a
674Lisp variable. Emacs does not (usually) change the values of these
675variables; instead, you set the values, and thereby alter and control
676the behavior of certain Emacs commands. Use of the customization
677buffer is explained above; here we describe other aspects of Emacs
678variables.
679
680@menu
681* Examining:: Examining or setting one variable's value.
682* Hooks:: Hook variables let you specify programs for parts
683 of Emacs to run on particular occasions.
684* Locals:: Per-buffer values of variables.
685* File Variables:: How files can specify variable values.
686@end menu
687
688@node Examining
689@subsection Examining and Setting Variables
690@cindex setting variables
691
692@table @kbd
693@item C-h v @var{var} @key{RET}
694Display the value and documentation of variable @var{var}
695(@code{describe-variable}).
696@item M-x set-variable @key{RET} @var{var} @key{RET} @var{value} @key{RET}
697Change the value of variable @var{var} to @var{value}.
698@end table
699
700 To examine the value of a single variable, use @kbd{C-h v}
701(@code{describe-variable}), which reads a variable name using the
702minibuffer, with completion. It displays both the value and the
703documentation of the variable. For example,
704
705@example
706C-h v fill-column @key{RET}
707@end example
708
709@noindent
710displays something like this:
711
712@smallexample
713fill-column's value is 70
714
715Documentation:
716*Column beyond which automatic line-wrapping should happen.
717Automatically becomes buffer-local when set in any fashion.
718@end smallexample
719
720@noindent
721The star at the beginning of the documentation indicates that this
722variable is a user option. @kbd{C-h v} is not restricted to user
723options; it allows any variable name.
724
725@findex set-variable
726 The most convenient way to set a specific user option is with @kbd{M-x
727set-variable}. This reads the variable name with the minibuffer (with
728completion), and then reads a Lisp expression for the new value using
729the minibuffer a second time. For example,
730
731@example
732M-x set-variable @key{RET} fill-column @key{RET} 75 @key{RET}
733@end example
734
735@noindent
736sets @code{fill-column} to 75.
737
738 @kbd{M-x set-variable} is limited to user option variables, but you can
739set any variable with a Lisp expression, using the function @code{setq}.
740Here is a @code{setq} expression to set @code{fill-column}:
741
742@example
743(setq fill-column 75)
744@end example
745
746 To execute an expression like this one, go to the @samp{*scratch*}
747buffer, type in the expression, and then type @kbd{C-j}. @xref{Lisp
748Interaction}.
749
750 Setting variables, like all means of customizing Emacs except where
751otherwise stated, affects only the current Emacs session.
752
750@node Hooks 753@node Hooks
751@subsection Hooks 754@subsection Hooks
752@cindex hook 755@cindex hook