annotate man/lispref/display.texi @ 5610:d69ea1ff4ce3

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