comparison lispintro/emacs-lisp-intro.texi @ 53099:0d765aaa0e44

In node defvar and asterisk, following suggestions by Juri Linkov <juri@jurta.org>, describe using the set-variable command to set values temporarily and to show a list of variables by using completion.
author Robert J. Chassell <bob@rattlesnake.com>
date Wed, 19 Nov 2003 21:04:04 +0000
parents dcef1d5a5ddb
children ea9bb593b003
comparison
equal deleted inserted replaced
53098:dc99e50c977c 53099:0d765aaa0e44
19 @c clear print-postscript-figures 19 @c clear print-postscript-figures
20 @c --------- 20 @c ---------
21 21
22 @comment %**end of header 22 @comment %**end of header
23 23
24 @set edition-number 2.11 24 @set edition-number 2.12
25 @set update-date 2003 Nov 16 25 @set update-date 2003 Nov 19
26 26
27 @ignore 27 @ignore
28 ## Summary of shell commands to create various output formats: 28 ## Summary of shell commands to create various output formats:
29 29
30 ## Info output 30 ## Info output
8064 In the past, Emacs used the @code{defvar} special form both for 8064 In the past, Emacs used the @code{defvar} special form both for
8065 internal variables that you would not expect a user to change and for 8065 internal variables that you would not expect a user to change and for
8066 variables that you do expect a user to change. Although you can still 8066 variables that you do expect a user to change. Although you can still
8067 use @code{defvar} for user customizable variables, please use 8067 use @code{defvar} for user customizable variables, please use
8068 @code{defcustom} instead, since that special form provides a path into 8068 @code{defcustom} instead, since that special form provides a path into
8069 the Customization commands. (@xref{defcustom, , Setting Variables 8069 the Customization commands. (@xref{defcustom, , Specifying Variables
8070 with @code{defcustom}}.) 8070 using @code{defcustom}}.)
8071 8071
8072 When you specified a variable using the @code{defvar} special form, 8072 When you specified a variable using the @code{defvar} special form,
8073 you could distinguish a readily settable variable from others by 8073 you could distinguish a readily settable variable from others by
8074 typing an asterisk, @samp{*}, in the first column of its documentation 8074 typing an asterisk, @samp{*}, in the first column of its documentation
8075 string. For example: 8075 string. For example:
8080 "*Buffer name for `shell-command' @dots{} error output. 8080 "*Buffer name for `shell-command' @dots{} error output.
8081 @dots{} ") 8081 @dots{} ")
8082 @end group 8082 @end group
8083 @end smallexample 8083 @end smallexample
8084 8084
8085 @ignore 8085 @findex set-variable
8086 @c commented out on 2003 Nov 17, since edit-options no longer described 8086 @noindent
8087 8087 You could (and still can) use the @code{set-variable} command to
8088 @noindent 8088 change the value of @code{shell-command-default-error-buffer}
8089 This means that you could (and still can) use the @code{edit-options} 8089 temporarily. However, options set using @code{set-variable} are set
8090 command to change the value of 8090 only for the duration of your editing session. The new values are not
8091 @code{shell-command-default-error-buffer} temporarily. 8091 saved between sessions. Each time Emacs starts, it reads the original
8092
8093 @findex edit-options
8094 However, options set using @code{edit-options} are set only for the
8095 duration of your editing session. The new values are not saved
8096 between sessions. Each time Emacs starts, it reads the original
8097 value, unless you change the value within your @file{.emacs} file, 8092 value, unless you change the value within your @file{.emacs} file,
8098 either by setting it manually or by using @code{customize}. 8093 either by setting it manually or by using @code{customize}.
8099 @xref{Emacs Initialization, , Your @file{.emacs} File}. 8094 @xref{Emacs Initialization, , Your @file{.emacs} File}.
8100 8095
8101 For me, the major use of the @code{edit-options} command is to suggest 8096 For me, the major use of the @code{set-variable} command is to suggest
8102 variables that I might want to set in my @file{.emacs} file. I urge 8097 variables that I might want to set in my @file{.emacs} file. There
8103 you to look through the list. 8098 are now more than 700 such variables --- far too many to remember
8104 @end ignore 8099 readily. Fortunately, you can press @key{TAB} after calling the
8100 @code{M-x set-variable} command to see the list of variables.
8101 (@xref{Examining, , Examining and Setting Variables, emacs,
8102 The GNU Emacs Manual}.)
8105 8103
8106 @node copy-region-as-kill, cons & search-fwd Review, defvar, Cutting & Storing Text 8104 @node copy-region-as-kill, cons & search-fwd Review, defvar, Cutting & Storing Text
8107 @comment node-name, next, previous, up 8105 @comment node-name, next, previous, up
8108 @section @code{copy-region-as-kill} 8106 @section @code{copy-region-as-kill}
8109 @findex copy-region-as-kill 8107 @findex copy-region-as-kill
14374 @smallexample 14372 @smallexample
14375 (custom-set-variables '(eval-expression-print-length nil)) 14373 (custom-set-variables '(eval-expression-print-length nil))
14376 @end smallexample 14374 @end smallexample
14377 14375
14378 @noindent 14376 @noindent
14379 (@xref{defcustom, , Setting Variables with @code{defcustom}}. 14377 (@xref{defcustom, , Specifying Variables using @code{defcustom}}.)
14380 Then evaluate the @code{lengths-list-file} expression.) 14378 Then evaluate the @code{lengths-list-file} expression.)
14381 14379
14382 @need 1200 14380 @need 1200
14383 The lengths' list for @file{debug.el} takes less than a second to 14381 The lengths' list for @file{debug.el} takes less than a second to
14384 produce and looks like this: 14382 produce and looks like this:
16126 16124
16127 @noindent 16125 @noindent
16128 The name of the variable is @code{text-mode-hook}; it has no default 16126 The name of the variable is @code{text-mode-hook}; it has no default
16129 value; and its documentation string tells you what it does. 16127 value; and its documentation string tells you what it does.
16130 16128
16131 The @code{:type} keyword tells Emacs what kind of data 16129 The @code{:type} keyword tells Emacs the kind of data to which
16132 @code{text-mode-hook} should be set to and how to display the value in 16130 @code{text-mode-hook} should be set and how to display the value in a
16133 a Customization buffer. 16131 Customization buffer.
16134 16132
16135 The @code{:options} keyword specifies a suggested list of values for 16133 The @code{:options} keyword specifies a suggested list of values for
16136 the variable. Currently, you can use @code{:options} only for a hook. 16134 the variable. Currently, you can use @code{:options} only for a hook.
16137 The list is only a suggestion; it is not exclusive; a person who sets 16135 The list is only a suggestion; it is not exclusive; a person who sets
16138 the variable may set it to other values; the list shown following the 16136 the variable may set it to other values; the list shown following the