annotate man/lispref/display.texi @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children 11cf20601dec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 @c -*-texinfo-*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @c This is part of the XEmacs Lisp Reference Manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @c See the file lispref.texi for copying conditions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @setfilename ../../info/display.info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @node Display, Hash Tables, Annotations, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 @chapter Emacs Display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 This chapter describes a number of other features related to the display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 that XEmacs presents to the user.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 * Refresh Screen:: Clearing the screen and redrawing everything on it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 * Truncation:: Folding or wrapping long text lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 * The Echo Area:: Where messages are displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 * Invisible Text:: Hiding part of the buffer text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 * Selective Display:: Hiding part of the buffer text (the old way).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 * Overlay Arrow:: Display of an arrow to indicate position.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 * Temporary Displays:: Displays that go away automatically.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 * Blinking:: How XEmacs shows the matching open parenthesis.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 * Usual Display:: The usual conventions for displaying nonprinting chars.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 * Display Tables:: How to specify other conventions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 * Beeping:: Audible signal to the user.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 @node Refresh Screen
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 @section Refreshing the Screen
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 The function @code{redraw-frame} redisplays the entire contents of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 given frame. @xref{Frames}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 @c Emacs 19 feature
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 @defun redraw-frame frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 This function clears and redisplays frame @var{frame}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 Even more powerful is @code{redraw-display}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 @deffn Command redraw-display &optional device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 This function redraws all frames on @var{device} marked as having their
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 image garbled. @var{device} defaults to the selected device. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 @var{device} is @code{t}, all devices will have their frames checked.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 @end deffn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 Processing user input takes absolute priority over redisplay. If you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 call these functions when input is available, they do nothing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 immediately, but a full redisplay does happen eventually---after all the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 input has been processed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 Normally, suspending and resuming XEmacs also refreshes the screen.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 Some terminal emulators record separate contents for display-oriented
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 programs such as XEmacs and for ordinary sequential display. If you are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 using such a terminal, you might want to inhibit the redisplay on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 resumption. @xref{Suspending XEmacs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 @defvar no-redraw-on-reenter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 @cindex suspend (cf. @code{no-redraw-on-reenter})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 @cindex resume (cf. @code{no-redraw-on-reenter})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 This variable controls whether XEmacs redraws the entire screen after it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 has been suspended and resumed. Non-@code{nil} means yes, @code{nil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 means no.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 @cindex display update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 @cindex update display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 @cindex refresh display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 The above functions do not actually cause the display to be updated;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 rather, they clear out the internal display records that XEmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 maintains, so that the next time the display is updated it will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 redrawn from scratch. Normally this occurs the next time that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 @code{next-event} or @code{sit-for} is called; however, a display update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 will not occur if there is input pending. @xref{Command Loop}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 @deffn Command force-redisplay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 @cindex force redisplay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 This function causes an immediate update of the display in all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 circumstances, whether or not input is pending. (This function does
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 not exist in FSF Emacs.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 @end deffn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 @defun force-cursor-redisplay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 This function causes an immediate update of the cursor on the selected
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 frame. (This function does not exist in FSF Emacs.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 @node Truncation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 @section Truncation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 @cindex line wrapping
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 @cindex continuation lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 @cindex @samp{$} in display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 @cindex @samp{\} in display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 When a line of text extends beyond the right edge of a window, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 line can either be truncated or continued on the next line. When a line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 is truncated, this is normally shown with a @samp{\} in the rightmost
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 column of the window on X displays, and with a @samp{$} on TTY devices.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 When a line is continued or ``wrapped'' onto the next line, this is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 shown with a curved arrow in the rightmost column of the window (or with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 a @samp{\} on TTY devices). The additional screen lines used to display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 a long text line are called @dfn{continuation} lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 Normally, whenever line truncation is in effect for a particular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 window, a horizontal scrollbar is displayed in that window if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 device supports scrollbars. @xref{Scrollbars}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 Note that continuation is different from filling; continuation happens
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 on the screen only, not in the buffer contents, and it breaks a line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 precisely at the right margin, not at a word boundary. @xref{Filling}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 @defopt truncate-lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 This buffer-local variable controls how XEmacs displays lines that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 extend beyond the right edge of the window. If it is non-@code{nil},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 then XEmacs does not display continuation lines; rather each line of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 text occupies exactly one screen line, and a backslash appears at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 edge of any line that extends to or beyond the edge of the window. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 default is @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 If the variable @code{truncate-partial-width-windows} is non-@code{nil},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 then truncation is always used for side-by-side windows (within one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 frame) regardless of the value of @code{truncate-lines}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 @end defopt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 @defopt default-truncate-lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 This variable is the default value for @code{truncate-lines}, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 buffers that do not have local values for it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 @end defopt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 @defopt truncate-partial-width-windows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 This variable controls display of lines that extend beyond the right
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 edge of the window, in side-by-side windows (@pxref{Splitting Windows}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 If it is non-@code{nil}, these lines are truncated; otherwise,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 @code{truncate-lines} says what to do with them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 @end defopt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 The backslash and curved arrow used to indicate truncated or continued
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 lines are only defaults, and can be changed. These images are actually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 glyphs (@pxref{Glyphs}). XEmacs provides a great deal of flexibility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 in how glyphs can be controlled. (This differs from FSF Emacs, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 uses display tables to control these images.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 For details, @ref{Redisplay Glyphs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 @ignore Not yet in XEmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 If your buffer contains @strong{very} long lines, and you use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 continuation to display them, just thinking about them can make Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 redisplay slow. The column computation and indentation functions also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 become slow. Then you might find it advisable to set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 @code{cache-long-line-scans} to @code{t}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 @defvar cache-long-line-scans
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 If this variable is non-@code{nil}, various indentation and motion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 functions, and Emacs redisplay, cache the results of scanning the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 buffer, and consult the cache to avoid rescanning regions of the buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 unless they are modified.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 Turning on the cache slows down processing of short lines somewhat.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 This variable is automatically local in every buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 @node The Echo Area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 @section The Echo Area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 @cindex error display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 @cindex echo area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 The @dfn{echo area} is used for displaying messages made with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 @code{message} primitive, and for echoing keystrokes. It is not the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 same as the minibuffer, despite the fact that the minibuffer appears
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (when active) in the same place on the screen as the echo area. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 @cite{XEmacs Reference Manual} specifies the rules for resolving conflicts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 between the echo area and the minibuffer for use of that screen space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (@pxref{Minibuffer,, The Minibuffer, emacs, The XEmacs Reference Manual}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 Error messages appear in the echo area; see @ref{Errors}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 You can write output in the echo area by using the Lisp printing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 functions with @code{t} as the stream (@pxref{Output Functions}), or as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 @defun message string &rest arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 This function displays a one-line message in the echo area. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 argument @var{string} is similar to a C language @code{printf} control
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 string. See @code{format} in @ref{String Conversion}, for the details
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 on the conversion specifications. @code{message} returns the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 constructed string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 In batch mode, @code{message} prints the message text on the standard
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 error stream, followed by a newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 @c Emacs 19 feature
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 If @var{string} is @code{nil}, @code{message} clears the echo area. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 the minibuffer is active, this brings the minibuffer contents back onto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 the screen immediately.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (message "Minibuffer depth is %d."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (minibuffer-depth))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 @print{} Minibuffer depth is 0.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 @result{} "Minibuffer depth is 0."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ---------- Echo Area ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 Minibuffer depth is 0.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 ---------- Echo Area ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
211 Some of the messages displayed in the echo area are also recorded in the
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
212 @samp{ *Message-Log*} buffer.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
214 @ignore
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 @defopt message-log-max
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 This variable specifies how many lines to keep in the @samp{*Messages*}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 buffer. The value @code{t} means there is no limit on how many lines to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 keep. The value @code{nil} disables message logging entirely. Here's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 how to display a message and prevent it from being logged:
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
220 @defopt log-message-max-size
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
221 This variable specifies how many lines to keep in the @samp{* Message-Log*}
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
222 buffer. The value @code{t} means there is no limit on how many lines to
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
223 keep. The value @code{nil} disables message logging entirely. Here's
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
224 how to display a message and prevent it from being logged:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (let (message-log-max)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (message @dots{}))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 @end defopt
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
231 @end ignore
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
232 @defopt log-message-max-size
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
233 This variable specifies the maximum size of @samp{* Message-Log*}
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
234 buffer.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
235 @end defopt
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 @defvar echo-keystrokes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 This variable determines how much time should elapse before command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 characters echo. Its value must be an integer, which specifies the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 number of seconds to wait before echoing. If the user types a prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 key (such as @kbd{C-x}) and then delays this many seconds before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 continuing, the prefix key is echoed in the echo area. Any subsequent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 characters in the same command will be echoed as well.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 If the value is zero, then command input is not echoed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 @defvar cursor-in-echo-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 This variable controls where the cursor appears when a message is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 displayed in the echo area. If it is non-@code{nil}, then the cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 appears at the end of the message. Otherwise, the cursor appears at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 point---not in the echo area at all.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 The value is normally @code{nil}; Lisp programs bind it to @code{t}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 for brief periods of time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 @node Invisible Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 @section Invisible Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 @cindex invisible text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 You can make characters @dfn{invisible}, so that they do not appear on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 the screen, with the @code{invisible} property. This can be either a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 text property or a property of an overlay.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 In the simplest case, any non-@code{nil} @code{invisible} property makes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 a character invisible. This is the default case---if you don't alter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 the default value of @code{buffer-invisibility-spec}, this is how the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 @code{invisibility} property works. This feature is much like selective
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 display (@pxref{Selective Display}), but more general and cleaner.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 More generally, you can use the variable @code{buffer-invisibility-spec}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 to control which values of the @code{invisible} property make text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 invisible. This permits you to classify the text into different subsets
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 in advance, by giving them different @code{invisible} values, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 subsequently make various subsets visible or invisible by changing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 value of @code{buffer-invisibility-spec}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 Controlling visibility with @code{buffer-invisibility-spec} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 especially useful in a program to display the list of entries in a data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 base. It permits the implementation of convenient filtering commands to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 view just a part of the entries in the data base. Setting this variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 is very fast, much faster than scanning all the text in the buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 looking for properties to change.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 @defvar buffer-invisibility-spec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 This variable specifies which kinds of @code{invisible} properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 actually make a character invisible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 @table @asis
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 @item @code{t}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 A character is invisible if its @code{invisible} property is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 non-@code{nil}. This is the default.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 @item a list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 Each element of the list makes certain characters invisible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 Ultimately, a character is invisible if any of the elements of this list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 applies to it. The list can have two kinds of elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 @item @var{atom}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 A character is invisible if its @code{invisible} propery value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 is @var{atom} or if it is a list with @var{atom} as a member.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 @item (@var{atom} . t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 A character is invisible if its @code{invisible} propery value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 is @var{atom} or if it is a list with @var{atom} as a member.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 Moreover, if this character is at the end of a line and is followed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 by a visible newline, it displays an ellipsis.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 Ordinarily, commands that operate on text or move point do not care
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 whether the text is invisible. However, the user-level line motion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 commands explicitly ignore invisible newlines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 @node Selective Display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 @section Selective Display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 @cindex selective display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 @dfn{Selective display} is a pair of features that hide certain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 lines on the screen.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 The first variant, explicit selective display, is designed for use in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 a Lisp program. The program controls which lines are hidden by altering
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 the text. Outline mode has traditionally used this variant. It has
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 been partially replaced by the invisible text feature (@pxref{Invisible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 Text}); there is a new version of Outline mode which uses that instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 In the second variant, the choice of lines to hide is made
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 automatically based on indentation. This variant is designed to be a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 user-level feature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 The way you control explicit selective display is by replacing a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 newline (control-j) with a carriage return (control-m). The text that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 was formerly a line following that newline is now invisible. Strictly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 speaking, it is temporarily no longer a line at all, since only newlines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 can separate lines; it is now part of the previous line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 Selective display does not directly affect editing commands. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 example, @kbd{C-f} (@code{forward-char}) moves point unhesitatingly into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 invisible text. However, the replacement of newline characters with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 carriage return characters affects some editing commands. For example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 @code{next-line} skips invisible lines, since it searches only for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 newlines. Modes that use selective display can also define commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 that take account of the newlines, or that make parts of the text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 visible or invisible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 When you write a selectively displayed buffer into a file, all the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 control-m's are output as newlines. This means that when you next read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 in the file, it looks OK, with nothing invisible. The selective display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 effect is seen only within XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 @defvar selective-display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 This buffer-local variable enables selective display. This means that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 lines, or portions of lines, may be made invisible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 If the value of @code{selective-display} is @code{t}, then any portion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 of a line that follows a control-m is not displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 If the value of @code{selective-display} is a positive integer, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 lines that start with more than that many columns of indentation are not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 When some portion of a buffer is invisible, the vertical movement
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 commands operate as if that portion did not exist, allowing a single
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 @code{next-line} command to skip any number of invisible lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 However, character movement commands (such as @code{forward-char}) do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 not skip the invisible portion, and it is possible (if tricky) to insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 or delete text in an invisible portion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 In the examples below, we show the @emph{display appearance} of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 buffer @code{foo}, which changes with the value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 @code{selective-display}. The @emph{contents} of the buffer do not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 change.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (setq selective-display nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 @result{} nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 1 on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 2on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 3n this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 3n this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 2on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 1 on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (setq selective-display 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 @result{} 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 1 on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 2on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 2on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 1 on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 @defvar selective-display-ellipses
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 If this buffer-local variable is non-@code{nil}, then XEmacs displays
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 @samp{@dots{}} at the end of a line that is followed by invisible text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 This example is a continuation of the previous one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (setq selective-display-ellipses t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 @result{} t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 1 on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 2on this column ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 2on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 1 on this column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 You can use a display table to substitute other text for the ellipsis
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (@samp{@dots{}}). @xref{Display Tables}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 @node Overlay Arrow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 @section The Overlay Arrow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 @cindex overlay arrow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 The @dfn{overlay arrow} is useful for directing the user's attention
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 to a particular line in a buffer. For example, in the modes used for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 interface to debuggers, the overlay arrow indicates the line of code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 about to be executed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 @defvar overlay-arrow-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 This variable holds the string to display to call attention to a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 particular line, or @code{nil} if the arrow feature is not in use.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 Despite its name, the value of this variable can be either a string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 or a glyph (@pxref{Glyphs}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 @defvar overlay-arrow-position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 This variable holds a marker that indicates where to display the overlay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 arrow. It should point at the beginning of a line. The arrow text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 appears at the beginning of that line, overlaying any text that would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 otherwise appear. Since the arrow is usually short, and the line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 usually begins with indentation, normally nothing significant is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 overwritten.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 The overlay string is displayed only in the buffer that this marker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 points into. Thus, only one buffer can have an overlay arrow at any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 given time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 @c !!! overlay-arrow-position: but the overlay string may remain in the display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 @c of some other buffer until an update is required. This should be fixed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 @c now. Is it?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 You can do the same job by creating an extent with a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 @code{begin-glyph} property. @xref{Extent Properties}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 @node Temporary Displays
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 @section Temporary Displays
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 Temporary displays are used by commands to put output into a buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 and then present it to the user for perusal rather than for editing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 Many of the help commands use this feature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 @defspec with-output-to-temp-buffer buffer-name forms@dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 This function executes @var{forms} while arranging to insert any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 output they print into the buffer named @var{buffer-name}. The buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 is then shown in some window for viewing, displayed but not selected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 The string @var{buffer-name} specifies the temporary buffer, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 need not already exist. The argument must be a string, not a buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 The buffer is erased initially (with no questions asked), and it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 marked as unmodified after @code{with-output-to-temp-buffer} exits.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 @code{with-output-to-temp-buffer} binds @code{standard-output} to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 temporary buffer, then it evaluates the forms in @var{forms}. Output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 using the Lisp output functions within @var{forms} goes by default to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 that buffer (but screen display and messages in the echo area, although
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 they are ``output'' in the general sense of the word, are not affected).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 @xref{Output Functions}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 The value of the last form in @var{forms} is returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 This is the contents of foo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (with-output-to-temp-buffer "foo"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (print 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (print standard-output))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 @result{} #<buffer foo>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 #<buffer foo>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 @end defspec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 @defvar temp-buffer-show-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 If this variable is non-@code{nil}, @code{with-output-to-temp-buffer}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 calls it as a function to do the job of displaying a help buffer. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 function gets one argument, which is the buffer it should display.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 In Emacs versions 18 and earlier, this variable was called
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 @code{temp-buffer-show-hook}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 @defun momentary-string-display string position &optional char message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 This function momentarily displays @var{string} in the current buffer at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 @var{position}. It has no effect on the undo list or on the buffer's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 modification status.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 The momentary display remains until the next input event. If the next
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 input event is @var{char}, @code{momentary-string-display} ignores it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 and returns. Otherwise, that event remains buffered for subsequent use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 as input. Thus, typing @var{char} will simply remove the string from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 the display, while typing (say) @kbd{C-f} will remove the string from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 the display and later (presumably) move point forward. The argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 @var{char} is a space by default.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 The return value of @code{momentary-string-display} is not meaningful.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 You can do the same job in a more general way by creating an extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 with a begin-glyph property. @xref{Extent Properties}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 If @var{message} is non-@code{nil}, it is displayed in the echo area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 while @var{string} is displayed in the buffer. If it is @code{nil}, a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 default message says to type @var{char} to continue.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 In this example, point is initially located at the beginning of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 second line:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 This is the contents of foo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 @point{}Second line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (momentary-string-display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 "**** Important Message! ****"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (point) ?\r
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 "Type RET when done reading")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 @result{} t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 This is the contents of foo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 **** Important Message! ****Second line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 ---------- Buffer: foo ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 ---------- Echo Area ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 Type RET when done reading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 ---------- Echo Area ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 This function works by actually changing the text in the buffer. As a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 result, if you later undo in this buffer, you will see the message come
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 and go.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 @node Blinking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 @section Blinking Parentheses
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 @cindex parenthesis matching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 @cindex blinking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 @cindex balancing parentheses
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 @cindex close parenthesis
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 This section describes the mechanism by which XEmacs shows a matching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 open parenthesis when the user inserts a close parenthesis.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 @vindex blink-paren-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 @defvar blink-paren-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 The value of this variable should be a function (of no arguments) to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 be called whenever a character with close parenthesis syntax is inserted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 The value of @code{blink-paren-function} may be @code{nil}, in which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 case nothing is done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 @quotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 @strong{Please note:} This variable was named @code{blink-paren-hook} in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 older Emacs versions, but since it is not called with the standard
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 convention for hooks, it was renamed to @code{blink-paren-function} in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 version 19.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 @end quotation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 @defvar blink-matching-paren
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 If this variable is @code{nil}, then @code{blink-matching-open} does
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 nothing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 @defvar blink-matching-paren-distance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 This variable specifies the maximum distance to scan for a matching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 parenthesis before giving up.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 @defvar blink-matching-paren-delay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 This variable specifies the number of seconds for the cursor to remain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 at the matching parenthesis. A fraction of a second often gives
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 good results, but the default is 1, which works on all systems.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 @defun blink-matching-open
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 This function is the default value of @code{blink-paren-function}. It
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 assumes that point follows a character with close parenthesis syntax and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 moves the cursor momentarily to the matching opening character. If that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 character is not already on the screen, it displays the character's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 context in the echo area. To avoid long delays, this function does not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 search farther than @code{blink-matching-paren-distance} characters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 Here is an example of calling this function explicitly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 @smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 (defun interactive-blink-matching-open ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 @c Do not break this line! -- rms.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 @c The first line of a doc string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 @c must stand alone.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 "Indicate momentarily the start of sexp before point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (let ((blink-matching-paren-distance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 (buffer-size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 (blink-matching-paren t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 (blink-matching-open)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 @end smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 @node Usual Display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 @section Usual Display Conventions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 The usual display conventions define how to display each character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 code. You can override these conventions by setting up a display table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 (@pxref{Display Tables}). Here are the usual display conventions:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 Character codes 32 through 126 map to glyph codes 32 through 126.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 Normally this means they display as themselves.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 Character code 9 is a horizontal tab. It displays as whitespace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 up to a position determined by @code{tab-width}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 Character code 10 is a newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 All other codes in the range 0 through 31, and code 127, display in one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 of two ways according to the value of @code{ctl-arrow}. If it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 non-@code{nil}, these codes map to sequences of two glyphs, where the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 first glyph is the @sc{ASCII} code for @samp{^}. (A display table can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 specify a glyph to use instead of @samp{^}.) Otherwise, these codes map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 just like the codes in the range 128 to 255.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 Character codes 128 through 255 map to sequences of four glyphs, where
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 the first glyph is the @sc{ASCII} code for @samp{\}, and the others are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 digit characters representing the code in octal. (A display table can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 specify a glyph to use instead of @samp{\}.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 The usual display conventions apply even when there is a display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 table, for any character whose entry in the active display table is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 @code{nil}. Thus, when you set up a display table, you need only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 specify the characters for which you want unusual behavior.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 These variables affect the way certain characters are displayed on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 screen. Since they change the number of columns the characters occupy,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 they also affect the indentation functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 @defopt ctl-arrow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 @cindex control characters in display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 This buffer-local variable controls how control characters are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 displayed. If it is non-@code{nil}, they are displayed as a caret
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 followed by the character: @samp{^A}. If it is @code{nil}, they are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 displayed as a backslash followed by three octal digits: @samp{\001}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 @end defopt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 @c Following may have overfull hbox.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 @defvar default-ctl-arrow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 The value of this variable is the default value for @code{ctl-arrow} in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 buffers that do not override it. @xref{Default Value}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 @defopt tab-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 The value of this variable is the spacing between tab stops used for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 displaying tab characters in Emacs buffers. The default is 8. Note
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 that this feature is completely independent from the user-settable tab
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 stops used by the command @code{tab-to-tab-stop}. @xref{Indent Tabs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 @end defopt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 @node Display Tables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 @section Display Tables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 @cindex display table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 You can use the @dfn{display table} feature to control how all 256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 possible character codes display on the screen. This is useful for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 displaying European languages that have letters not in the @sc{ASCII}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 character set.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 The display table maps each character code into a sequence of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 @dfn{runes}, each rune being an image that takes up one character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 position on the screen. You can also define how to display each rune
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 on your terminal, using the @dfn{rune table}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 * Display Table Format:: What a display table consists of.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 * Active Display Table:: How XEmacs selects a display table to use.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 * Character Descriptors:: Format of an individual element of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 display table.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 @ignore Not yet working in XEmacs?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 * ISO Latin 1:: How to use display tables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 to support the ISO Latin 1 character set.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 @node Display Table Format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 @subsection Display Table Format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 A display table is an array of 256 elements. (In FSF Emacs, a display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 table is 262 elements. The six extra elements specify the truncation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 and continuation glyphs, etc. This method is very kludgey, and in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 XEmacs the variables @code{truncation-glyph}, @code{continuation-glyph},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 etc. are used. @xref{Truncation}.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 @defun make-display-table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 This creates and returns a display table. The table initially has
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 @code{nil} in all elements.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 The 256 elements correspond to character codes; the @var{n}th
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 element says how to display the character code @var{n}. The value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 should be @code{nil}, a string, a glyph, or a vector of strings and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 glyphs (@pxref{Character Descriptors}). If an element is @code{nil},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 it says to display that character according to the usual display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 conventions (@pxref{Usual Display}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 If you use the display table to change the display of newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 characters, the whole buffer will be displayed as one long ``line.''
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 For example, here is how to construct a display table that mimics the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 effect of setting @code{ctl-arrow} to a non-@code{nil} value:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 (setq disptab (make-display-table))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 (let ((i 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 (while (< i 32)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (or (= i ?\t) (= i ?\n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (aset disptab i (concat "^" (char-to-string (+ i 64)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (setq i (1+ i)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (aset disptab 127 "^?"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 @node Active Display Table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 @subsection Active Display Table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 @cindex active display table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 The active display table is controlled by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 @code{current-display-table}. This is a specifier, which means
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 that you can specify separate values for it in individual buffers,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 windows, frames, and devices, as well as a global value. It also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 means that you cannot set this variable using @code{setq}; use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 @code{set-specifier} instead. @xref{Specifiers}. (FSF Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 uses @code{window-display-table}, @code{buffer-display-table},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 @code{standard-display-table}, etc. to control the display table.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 However, specifiers are a cleaner and more powerful way of doing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 the same thing. FSF Emacs also uses a different format for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 the contents of a display table, using additional indirection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 to a ``glyph table'' and such. Note that ``glyph'' has a different
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 meaning in XEmacs.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 Individual faces can also specify an overriding display table;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 this is set using @code{set-face-display-table}. @xref{Faces}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 If no display table can be determined for a particular window,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 then XEmacs uses the usual display conventions. @xref{Usual Display}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 @node Character Descriptors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 @subsection Character Descriptors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 @cindex character descriptor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 Each element of the display-table vector describes how to display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 a particular character and is called a @dfn{character descriptor}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 A character descriptor can be:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 @table @asis
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 @item a string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 Display this particular string wherever the character is to be displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 @item a glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 Display this particular glyph wherever the character is to be displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 @item a vector
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 The vector may contain strings and/or glyphs. Display the elements of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 the vector one after another wherever the character is to be displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 @item @code{nil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 Display according to the standard interpretation (@pxref{Usual Display}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 @ignore Not yet working in XEmacs?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 @node ISO Latin 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 @subsection ISO Latin 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 If you have a terminal that can handle the entire ISO Latin 1 character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 set, you can arrange to use that character set as follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 (require 'disp-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 ;; @r{Set char codes 160--255 to display as themselves.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 ;; @r{(Codes 128--159 are the additional control characters.)}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 (standard-display-8bit 160 255)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 If you are editing buffers written in the ISO Latin 1 character set and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 your terminal doesn't handle anything but @sc{ASCII}, you can load the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 file @file{iso-ascii} to set up a display table that displays the other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 ISO characters as explanatory sequences of @sc{ASCII} characters. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 example, the character ``o with umlaut'' displays as @samp{@{"o@}}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 Some European countries have terminals that don't support ISO Latin 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 but do support the special characters for that country's language. You
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 can define a display table to work one language using such terminals.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 For an example, see @file{lisp/iso-swed.el}, which handles certain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 Swedish terminals.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 You can load the appropriate display table for your terminal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 automatically by writing a terminal-specific Lisp file for the terminal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 type.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 @node Beeping
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 @section Beeping
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 @cindex beeping
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 @cindex bell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 @cindex sound
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 You can make XEmacs ring a bell, play a sound, or blink the screen to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 attract the user's attention. Be conservative about how often you do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 this; frequent bells can become irritating. Also be careful not to use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 beeping alone when signaling an error is appropriate. (@xref{Errors}.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 @defun ding &optional dont-terminate sound device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 @cindex keyboard macro termination
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 This function beeps, or flashes the screen (see @code{visible-bell}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 below). It also terminates any keyboard macro currently executing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 unless @var{dont-terminate} is non-@code{nil}. If @var{sound} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 specified, it should be a symbol specifying which sound to make. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 sound will be played if @code{visible-bell} is @code{nil}. (This only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 works if sound support was compiled into the executable and you are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 running on the console of a Sun SparcStation, SGI, or HP9000s700.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 Otherwise you just get a beep.) The optional third argument specifies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 what device to make the sound on, and defaults to the selected device.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 @defun beep &optional dont-terminate sound device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 This is a synonym for @code{ding}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 @defopt visible-bell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 This variable determines whether XEmacs should flash the screen to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 represent a bell. Non-@code{nil} means yes, @code{nil} means no. On
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 TTY devices, this is effective only if the Termcap entry for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 terminal type has the visible bell flag (@samp{vb}) set.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 @end defopt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 @defvar sound-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 This variable holds an alist associating names with sounds. When
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 @code{beep} or @code{ding} is called with one of the name symbols, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 associated sound will be generated instead of the standard beep.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 Each element of @code{sound-alist} is a list describing a sound. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 first element of the list is the name of the sound being defined.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 Subsequent elements of the list are alternating keyword/value pairs:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 @item sound
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 A string of raw sound data, or the name of another sound to play. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 symbol @code{t} here means use the default X beep.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 @item volume
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 An integer from 0-100, defaulting to @code{bell-volume}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 @item pitch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 If using the default X beep, the pitch (Hz) to generate.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 @item duration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 If using the default X beep, the duration (milliseconds).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 For compatibility, elements of `sound-alist' may also be:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 @code{( sound-name . <sound> )}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 @code{( sound-name <volume> <sound> )}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 You should probably add things to this list by calling the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 @code{load-sound-file}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 Caveats:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 @itemize @minus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 You can only play audio data if running on the console screen of a Sun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 SparcStation, SGI, or HP9000s700.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 The pitch, duration, and volume options are available everywhere, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 many X servers ignore the `pitch' option.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 The following beep-types are used by XEmacs itself:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 @item auto-save-error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 when an auto-save does not succeed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 @item command-error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 when the XEmacs command loop catches an error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 @item undefined-key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 when you type a key that is undefined
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 @item undefined-click
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 when you use an undefined mouse-click combination
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 @item no-completion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 during completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 @item y-or-n-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 when you type something other than 'y' or 'n'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 @item yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 when you type something other than 'yes' or 'no'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 @item default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 used when nothing else is appropriate.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 Other lisp packages may use other beep types, but these are the ones that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 the C kernel of XEmacs uses.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 @defopt bell-volume
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 This variable specifies the default volume for sounds, from 0 to 100.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 @end defopt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 @deffn Command load-default-sounds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 This function loads and installs some sound files as beep-types.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 @end deffn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 @deffn Command load-sound-file filename sound-name &optional volume
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 This function reads in an audio file and adds it to @code{sound-alist}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 The sound file must be in the Sun/NeXT U-LAW format. @var{sound-name}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 should be a symbol, specifying the name of the sound. If @var{volume}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 is specified, the sound will be played at that volume; otherwise, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 value of @var{bell-volume} will be used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 @end deffn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 @defun play-sound sound &optional volume device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 This function plays sound @var{sound}, which should be a symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 mentioned in @code{sound-alist}. If @var{volume} is specified, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 overrides the value (if any) specified in @code{sound-alist}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 @var{device} specifies the device to play the sound on, and defaults
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 to the selected device.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 @deffn Command play-sound-file file &optional volume device
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 This function plays the named sound file at volume @var{volume}, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 defaults to @code{bell-volume}. @var{device} specifies the device to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 play the sound on, and defaults to the selected device.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 @end deffn