annotate man/lispref/display.texi @ 280:7df0dd720c89 r21-0b38

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