annotate man/lispref/display.texi @ 999:2a7a4e9be209

[xemacs-hg @ 2002-09-11 21:53:26 by youngs] Update xemacs_extra_name.
author youngs
date Wed, 11 Sep 2002 21:53:26 +0000
parents 1ccc32a20af4
children 1fa8838efe99
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}).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 Error messages appear in the echo area; see @ref{Errors}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 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
176 functions with @code{t} as the stream (@pxref{Output Functions}), or as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 follows:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 @defun message string &rest arguments
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 This function displays a one-line message in the echo area. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 argument @var{string} is similar to a C language @code{printf} control
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 string. See @code{format} in @ref{String Conversion}, for the details
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 on the conversion specifications. @code{message} returns the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 constructed string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 In batch mode, @code{message} prints the message text on the standard
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 error stream, followed by a newline.
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 @c Emacs 19 feature
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 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
191 the minibuffer is active, this brings the minibuffer contents back onto
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 the screen immediately.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 (message "Minibuffer depth is %d."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 (minibuffer-depth))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 @print{} Minibuffer depth is 0.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 @result{} "Minibuffer depth is 0."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 ---------- Echo Area ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 Minibuffer depth is 0.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 ---------- Echo Area ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 In addition to only displaying a message, XEmacs allows you to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 @dfn{label} your messages, giving you fine-grained control of their
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 display. Message label is a symbol denoting the message type. Some
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 standard labels are:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 @item @code{message}---default label used by the @code{message}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 function;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 @item @code{error}---default label used for reporting errors;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 @item @code{progress}---progress indicators like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 @samp{Converting... 45%} (not logged by default);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
224 @item @code{prompt}---prompt-like messages like @samp{Isearch: foo} (not
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 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{command}---helper command messages like @samp{Mark set} (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
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 @item @code{no-log}---messages that should never be logged
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
233 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
234 may access these messages, or remove them as appropriate, via the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 message stack.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 @defun display-message label message &optional frame stdout-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 This function displays @var{message} (a string) labeled as @var{label},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 as described above.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 The @var{frame} argument specifies the frame to whose minibuffer the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 message should be printed. This is currently unimplemented. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 @var{stdout-p} argument is used internally.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 (display-message 'command "Mark set")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 @defun lmessage label string &rest arguments
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 This function displays a message @var{string} with label @var{label}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 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
253 strings and any number of arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 ;; @r{Display a command message.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 (lmessage 'command "Comment column set to %d" comment-column)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 ;; @r{Display a progress message.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 (lmessage 'progress "Fontifying %s... (%d)" buffer percentage)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 ;; @r{Display a message that should not be logged.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 (lmessage 'no-log "Done")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 @defun clear-message &optional label frame stdout-p no-restore
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 This function remove any message with the given @var{label}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 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
276 displayed there.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 If a message remains at the head of the message-stack and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 @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
280 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
281 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
282 message-stack is cleared.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 ;; @r{Show a message, wait for 2 seconds, and restore old minibuffer}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 ;; @r{contents.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 (message "A message")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 @print{} A message
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 @result{} "A Message"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 (lmessage 'my-label "Newsflash! Newsflash!")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 @print{} Newsflash! Newsflash!
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 @result{} "Newsflash! Newsflash!"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 (sit-for 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 (clear-message 'my-label)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 @print{} A message
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 @result{} "A message"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 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
300 you should just use @code{(message nil)}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 @defun current-message &optional frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 This function returns the current message in the echo area, or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 @code{nil}. The @var{frame} argument is currently unused.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 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
309 @samp{ *Message-Log*} buffer. Exactly which messages will be recorded
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 can be tuned using the following variables.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 @defopt log-message-max-size
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 This variable specifies the maximum size of the @samp{ *Message-log*}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 @end defopt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 @defvar log-message-ignore-labels
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 This variable specifies the labels whose messages will not be logged.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 It should be a list of symbols.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 @defvar log-message-ignore-regexps
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 This variable specifies the regular expressions matching messages that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 will not be logged. It should be a list of regular expressions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 Normally, packages that generate messages that might need to be ignored
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 should label them with @code{progress}, @code{prompt}, or @code{no-log},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 so they can be filtered by @code{log-message-ignore-labels}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 @defvar echo-keystrokes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 This variable determines how much time should elapse before command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 characters echo. Its value must be a number, which specifies the number
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 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
335 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
336 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
337 same command will be echoed as well.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 If the value is zero, then command input is not echoed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 @end defvar
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 @defvar cursor-in-echo-area
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 This variable controls where the cursor appears when a message is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 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
345 appears at the end of the message. Otherwise, the cursor appears at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 point---not in the echo area at all.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 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
349 for brief periods of time.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 @node Warnings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 @section Warnings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 XEmacs contains a facility for unified display of various warnings.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 Unlike errors, warnings are displayed in the situations when XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 encounters a problem that is recoverable, but which should be fixed for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 safe future operation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 For example, warnings are printed by the startup code when it encounters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 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
362 other problematic situations. Unlike messages, warnings are displayed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 in a separate buffer, and include an explanatory message that may span
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 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
365
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 (1) (initialization/error) An error has occurred while loading ~/.emacs:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 Symbol's value as variable is void: bogus-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 To ensure normal operation, you should investigate the cause of the error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 in your initialization file and remove it. Use the `-debug-init' option
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 to XEmacs to view a complete error backtrace.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 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
377 a symbol describing what sort of warning this is, such as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 @code{initialization}, @code{resource} or @code{key-mapping}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 The warning priority level specifies how important the warning is. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 recognized warning levels, in increased order of priority, are:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 @code{debug}, @code{info}, @code{notice}, @code{warning}, @code{error},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 @code{critical}, @code{alert} and @code{emergency}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 @defun display-warning class message &optional level
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 This function displays a warning message @var{message} (a string).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 @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
388 list of such symbols. @var{level} describes the warning priority level.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 If unspecified, it default to @code{warning}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 (display-warning 'resource
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 "Bad resource specification encountered:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 something like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 Emacs*foo: bar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 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
400 you use the specifier and/or `set-face-*' functions.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 ---------- Warning buffer ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 (1) (resource/warning) Bad resource specification encountered:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 something like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 Emacs*foo: bar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 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
411 you use the specifier and/or `set-face-*' functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 ---------- Warning buffer ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 @end group
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 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 @defun lwarn class level message &rest args
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 This function displays a formatted labeled warning message. As above,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 @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
420 symbols, and @var{level} should specify the warning priority level
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 (@code{warning} by default).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 Unlike in @code{display-warning}, @var{message} may be a formatted
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424 message, which will be, together with the rest of the arguments, passed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 to @code{format}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 (lwarn 'message-log 'warning
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 "Error caught in `remove-message-hook': %s"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 (error-message-string e))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 @defvar log-warning-minimum-level
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 This variable specifies the minimum level of warnings that should be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 generated. Warnings with level lower than defined by this variable are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 completely ignored, as if they never happened.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 @defvar display-warning-minimum-level
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 This variable specifies the minimum level of warnings that should be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 displayed. Unlike @code{log-warning-minimum-level}, setting this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 function does not suppress warnings entirely---they are still generated
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 in the @samp{*Warnings*} buffer, only they are not displayed by default.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 @defvar log-warning-suppressed-classes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 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
449 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
450 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
451 ignored, as it they never happened.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 @defvar display-warning-suppressed-classes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 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
456 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
457 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
458 displayed. The warning will still logged in the *Warnings* buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 (unless also contained in `log-warning-suppressed-classes'), but the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 buffer will not be automatically popped up.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 @end defvar
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 @node Invisible Text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 @section Invisible Text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 @cindex invisible text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 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
468 the screen, with the @code{invisible} property. This can be either a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 text property or a property of an overlay.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 In the simplest case, any non-@code{nil} @code{invisible} property makes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 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
473 the default value of @code{buffer-invisibility-spec}, this is how the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 @code{invisibility} property works. This feature is much like selective
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 display (@pxref{Selective Display}), but more general and cleaner.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 More generally, you can use the variable @code{buffer-invisibility-spec}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 to control which values of the @code{invisible} property make text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 invisible. This permits you to classify the text into different subsets
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 in advance, by giving them different @code{invisible} values, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 subsequently make various subsets visible or invisible by changing the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 value of @code{buffer-invisibility-spec}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 Controlling visibility with @code{buffer-invisibility-spec} is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 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
486 base. It permits the implementation of convenient filtering commands to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 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
488 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
489 looking for properties to change.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 @defvar buffer-invisibility-spec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 This variable specifies which kinds of @code{invisible} properties
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 actually make a character invisible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 @table @asis
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 @item @code{t}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 A character is invisible if its @code{invisible} property is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 non-@code{nil}. This is the default.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 @item a list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 Each element of the list makes certain characters invisible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 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
503 applies to it. The list can have two kinds of elements:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 @item @var{atom}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 A character is invisible if its @code{invisible} property value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 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
509
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 @item (@var{atom} . t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 A character is invisible if its @code{invisible} property value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 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
513 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
514 by a visible newline, it displays an ellipsis.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 Ordinarily, commands that operate on text or move point do not care
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520 whether the text is invisible. However, the user-level line motion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 commands explicitly ignore invisible newlines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 @node Selective Display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 @section Selective Display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 @cindex selective display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 @dfn{Selective display} is a pair of features that hide certain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 lines on the screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 The first variant, explicit selective display, is designed for use in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 a Lisp program. The program controls which lines are hidden by altering
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 the text. Outline mode has traditionally used this variant. It has
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 been partially replaced by the invisible text feature (@pxref{Invisible
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 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
535
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 In the second variant, the choice of lines to hide is made
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 automatically based on indentation. This variant is designed to be a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 user-level feature.
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 The way you control explicit selective display is by replacing a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 newline (control-j) with a carriage return (control-m). The text that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 was formerly a line following that newline is now invisible. Strictly
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 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
544 can separate lines; it is now part of the previous line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 Selective display does not directly affect editing commands. For
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 example, @kbd{C-f} (@code{forward-char}) moves point unhesitatingly into
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 invisible text. However, the replacement of newline characters with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 carriage return characters affects some editing commands. For example,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 @code{next-line} skips invisible lines, since it searches only for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 newlines. Modes that use selective display can also define commands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 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
553 visible or invisible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 When you write a selectively displayed buffer into a file, all the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556 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
557 in the file, it looks OK, with nothing invisible. The selective display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 effect is seen only within XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 @defvar selective-display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 This buffer-local variable enables selective display. This means that
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
562 lines, or portions of lines, may be made invisible.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 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
567 of a line that follows a control-m is not displayed.
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 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570 If the value of @code{selective-display} is a positive integer, then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571 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
572 displayed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 When some portion of a buffer is invisible, the vertical movement
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 commands operate as if that portion did not exist, allowing a single
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 @code{next-line} command to skip any number of invisible lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 However, character movement commands (such as @code{forward-char}) do
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 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
580 or delete text in an invisible portion.
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 In the examples below, we show the @emph{display appearance} of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
583 buffer @code{foo}, which changes with the value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 @code{selective-display}. The @emph{contents} of the buffer do not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585 change.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 (setq selective-display nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 @result{} nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593 1 on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 2on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 3n this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596 3n this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597 2on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 1 on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600 @end group
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 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 (setq selective-display 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 @result{} 2
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 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 1 on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608 2on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609 2on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610 1 on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
613 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 @defvar selective-display-ellipses
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 If this buffer-local variable is non-@code{nil}, then XEmacs displays
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618 @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
619 This example is a continuation of the previous one.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 (setq selective-display-ellipses t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 @result{} t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 1 on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 2on this column ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 2on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 1 on this column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635 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
636 (@samp{@dots{}}). @xref{Display Tables}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639 @node Overlay Arrow
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640 @section The Overlay Arrow
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641 @cindex overlay arrow
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643 The @dfn{overlay arrow} is useful for directing the user's attention
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 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
645 interface to debuggers, the overlay arrow indicates the line of code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 about to be executed.
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 @defvar overlay-arrow-string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 This variable holds the string to display to call attention to a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 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
651 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
652 or a glyph (@pxref{Glyphs}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 @defvar overlay-arrow-position
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656 This variable holds a marker that indicates where to display the overlay
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 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
658 appears at the beginning of that line, overlaying any text that would
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659 otherwise appear. Since the arrow is usually short, and the line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 usually begins with indentation, normally nothing significant is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 overwritten.
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 The overlay string is displayed only in the buffer that this marker
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664 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
665 given time.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 @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
667 @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
668 @c now. Is it?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 You can do the same job by creating an extent with a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672 @code{begin-glyph} property. @xref{Extent Properties}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674 @node Temporary Displays
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 @section Temporary Displays
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 Temporary displays are used by commands to put output into a buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678 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
679 Many of the help commands use this feature.
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 @defspec with-output-to-temp-buffer buffer-name forms@dots{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682 This function executes @var{forms} while arranging to insert any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 output they print into the buffer named @var{buffer-name}. The buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684 is then shown in some window for viewing, displayed but not selected.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 The string @var{buffer-name} specifies the temporary buffer, which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687 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
688 The buffer is erased initially (with no questions asked), and it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 marked as unmodified after @code{with-output-to-temp-buffer} exits.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
690
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691 @code{with-output-to-temp-buffer} binds @code{standard-output} to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 temporary buffer, then it evaluates the forms in @var{forms}. Output
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693 using the Lisp output functions within @var{forms} goes by default to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694 that buffer (but screen display and messages in the echo area, although
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 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
696 @xref{Output Functions}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698 The value of the last form in @var{forms} is returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
703 This is the contents of foo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 (with-output-to-temp-buffer "foo"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
709 (print 20)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
710 (print standard-output))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711 @result{} #<buffer foo>
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 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
714 20
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 #<buffer foo>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
717
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
718 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
719 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
720 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
721 @end defspec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
722
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
723 @defvar temp-buffer-show-function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724 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
725 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
726 function gets one argument, which is the buffer it should display.
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 In Emacs versions 18 and earlier, this variable was called
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729 @code{temp-buffer-show-hook}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
730 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
732 @defun momentary-string-display string position &optional char message
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
733 This function momentarily displays @var{string} in the current buffer at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
734 @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
735 modification status.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
737 The momentary display remains until the next input event. If the next
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738 input event is @var{char}, @code{momentary-string-display} ignores it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 and returns. Otherwise, that event remains buffered for subsequent use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740 as input. Thus, typing @var{char} will simply remove the string from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741 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
742 the display and later (presumably) move point forward. The argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743 @var{char} is a space by default.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
745 The return value of @code{momentary-string-display} is not meaningful.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747 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
748 with a begin-glyph property. @xref{Extent Properties}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
750 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
751 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
752 default message says to type @var{char} to continue.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754 In this example, point is initially located at the beginning of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
755 second line:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
757 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760 This is the contents of foo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 @point{}Second line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763 @end group
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 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766 (momentary-string-display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
767 "**** Important Message! ****"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
768 (point) ?\r
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
769 "Type RET when done reading")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
770 @result{} t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
771 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
773 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
774 ---------- Buffer: foo ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
775 This is the contents of foo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
776 **** Important Message! ****Second line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777 ---------- Buffer: foo ----------
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 ---------- Echo Area ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 Type RET when done reading
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781 ---------- Echo Area ----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 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
786 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
787 and go.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790 @node Blinking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791 @section Blinking Parentheses
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 @cindex parenthesis matching
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 @cindex blinking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 @cindex balancing parentheses
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
795 @cindex close parenthesis
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
796
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
797 This section describes the mechanism by which XEmacs shows a matching
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798 open parenthesis when the user inserts a close parenthesis.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
799
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
800 @vindex blink-paren-hook
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
801 @defvar blink-paren-function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802 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
803 be called whenever a character with close parenthesis syntax is inserted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804 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
805 case nothing is done.
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 @quotation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
808 @strong{Please note:} This variable was named @code{blink-paren-hook} in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
809 older Emacs versions, but since it is not called with the standard
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
810 convention for hooks, it was renamed to @code{blink-paren-function} in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
811 version 19.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
812 @end quotation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813 @end defvar
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 @defvar blink-matching-paren
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
816 If this variable is @code{nil}, then @code{blink-matching-open} does
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
817 nothing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
820 @defvar blink-matching-paren-distance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
821 This variable specifies the maximum distance to scan for a matching
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
822 parenthesis before giving up.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
823 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
824
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
825 @defvar blink-matching-paren-delay
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
826 This variable specifies the number of seconds for the cursor to remain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
827 at the matching parenthesis. A fraction of a second often gives
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
828 good results, but the default is 1, which works on all systems.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
829 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
830
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
831 @deffn Command blink-matching-open
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
832 This function is the default value of @code{blink-paren-function}. It
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
833 assumes that point follows a character with close parenthesis syntax and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
834 moves the cursor momentarily to the matching opening character. If that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
835 character is not already on the screen, it displays the character's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
836 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
837 search farther than @code{blink-matching-paren-distance} characters.
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 Here is an example of calling this function explicitly.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
840
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
841 @smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
842 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
843 (defun interactive-blink-matching-open ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
844 "Indicate momentarily the start of sexp before point."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
845 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
846 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
847 @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
848 (let ((blink-matching-paren-distance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
849 (buffer-size))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
850 (blink-matching-paren t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
851 (blink-matching-open)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
852 @end group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
853 @end smallexample
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
854 @end deffn
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
855
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
856 @node Usual Display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
857 @section Usual Display Conventions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
858
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
859 The usual display conventions define how to display each character
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
860 code. You can override these conventions by setting up a display table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861 (@pxref{Display Tables}). Here are the usual display conventions:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
862
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
863 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
864 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
865 Character codes 32 through 126 map to glyph codes 32 through 126.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
866 Normally this means they display as themselves.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
867
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
868 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 Character code 9 is a horizontal tab. It displays as whitespace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870 up to a position determined by @code{tab-width}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
871
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873 Character code 10 is a newline.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 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
877 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
878 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
879 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
880 specify a glyph to use instead of @samp{^}.) Otherwise, these codes map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
881 just like the codes in the range 128 to 255.
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 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
884 Character codes 128 through 255 map to sequences of four glyphs, where
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
885 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
886 digit characters representing the code in octal. (A display table can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
887 specify a glyph to use instead of @samp{\}.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
888 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
889
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
890 The usual display conventions apply even when there is a display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
891 table, for any character whose entry in the active display table is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
892 @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
893 specify the characters for which you want unusual behavior.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
894
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
895 These variables affect the way certain characters are displayed on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
896 screen. Since they change the number of columns the characters occupy,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
897 they also affect the indentation functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
898
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
899 @defopt ctl-arrow
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
900 @cindex control characters in display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
901 This buffer-local variable controls how control characters are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
902 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
903 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
904 displayed as a backslash followed by three octal digits: @samp{\001}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
905 @end defopt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
906
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
907 @c Following may have overfull hbox.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
908 @defvar default-ctl-arrow
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
909 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
910 buffers that do not override it. @xref{Default Value}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
911 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
912
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
913 @defopt tab-width
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
914 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
915 displaying tab characters in Emacs buffers. The default is 8. Note
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
916 that this feature is completely independent from the user-settable tab
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
917 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
918 @end defopt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
919
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
920 @node Display Tables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
921 @section Display Tables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
922
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
923 @cindex display table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
924 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
925 possible character codes display on the screen. This is useful for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
926 displaying European languages that have letters not in the @sc{ascii}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
927 character set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
928
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
929 The display table maps each character code into a sequence of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
930 @dfn{runes}, each rune being an image that takes up one character
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
931 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
932 on your terminal, using the @dfn{rune table}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
933
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
934 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
935 * Display Table Format:: What a display table consists of.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
936 * Active Display Table:: How XEmacs selects a display table to use.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
937 * Character Descriptors:: Format of an individual element of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
938 display table.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
939 @end menu
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 @ignore Not yet working in XEmacs?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
942 * ISO Latin 1:: How to use display tables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
943 to support the ISO Latin 1 character set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
944 @end ignore
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
945
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
946 @node Display Table Format
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
947 @subsection Display Table Format
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 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
950 table is 262 elements. The six extra elements specify the truncation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
951 and continuation glyphs, etc. This method is very kludgey, and in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
952 XEmacs the variables @code{truncation-glyph}, @code{continuation-glyph},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
953 etc. are used. @xref{Truncation}.)
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 @defun make-display-table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
956 This creates and returns a display table. The table initially has
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
957 @code{nil} in all elements.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
958 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
960 The 256 elements correspond to character codes; the @var{n}th
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961 element says how to display the character code @var{n}. The value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
962 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
963 glyphs (@pxref{Character Descriptors}). If an element is @code{nil},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
964 it says to display that character according to the usual display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
965 conventions (@pxref{Usual Display}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
966
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
967 If you use the display table to change the display of newline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
968 characters, the whole buffer will be displayed as one long ``line.''
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
969
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
970 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
971 effect of setting @code{ctl-arrow} to a non-@code{nil} value:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974 (setq disptab (make-display-table))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
975 (let ((i 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976 (while (< i 32)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977 (or (= i ?\t) (= i ?\n)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978 (aset disptab i (concat "^" (char-to-string (+ i 64)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
979 (setq i (1+ i)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
980 (aset disptab 127 "^?"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
981 @end example
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 @node Active Display Table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984 @subsection Active Display Table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985 @cindex active display table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
986
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
987 The active display table is controlled by the variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
988 @code{current-display-table}. This is a specifier, which means
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
989 that you can specify separate values for it in individual buffers,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
990 windows, frames, and devices, as well as a global value. It also
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
991 means that you cannot set this variable using @code{setq}; use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
992 @code{set-specifier} instead. @xref{Specifiers}. (FSF Emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
993 uses @code{window-display-table}, @code{buffer-display-table},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
994 @code{standard-display-table}, etc. to control the display table.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
995 However, specifiers are a cleaner and more powerful way of doing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
996 the same thing. FSF Emacs also uses a different format for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
997 the contents of a display table, using additional indirection
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
998 to a ``glyph table'' and such. Note that ``glyph'' has a different
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
999 meaning in XEmacs.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1000
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1001 @defvar current-display-table
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1002
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1003 The display table currently in use. This is a specifier.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1004
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1005 Display tables are used to control how characters are displayed. Each
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1006 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
1007 display tables that apply (obtained by calling @code{specifier-instance}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1008 on @code{current-display-table} and any overriding display tables
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1009 specified in currently active faces). The first entry found that
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1010 matches the character determines how the character is displayed. If
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1011 there is no matching entry, the default display method is
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1012 used. (Non-control characters are displayed as themselves and control
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1013 characters are displayed according to the buffer-local variable
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1014 @code{ctl-arrow}. Control characters are further affected by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1015 @code{control-arrow-glyph} and @code{octal-escape-glyph}.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1016
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1017 Each instantiator in this specifier and the display-table specifiers
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1018 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
1019 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
1020 character. Each display table is one of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1021
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1022 @itemize @bullet
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1023 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1024 A vector, specifying values for characters starting at 0.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1025 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1026 A char table, either of type @code{char} or @code{generic}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1027 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1028 A range table.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1029 @end itemize
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1030
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1031 Each entry in a display table should be one of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1032
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1033 @itemize @bullet
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1034 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1035 nil (this entry is ignored and the search continues).
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1036 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1037 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
1038 the original character, default processing happens, otherwise
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1039 redisplay attempts to display this character directly;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1040 #### At some point recursive display-table lookup will be
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1041 implemented).
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1042 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1043 A string (display each character in the string directly;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1044 #### At some point recursive display-table lookup will be
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1045 implemented).
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1046 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1047 A glyph (display the glyph;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1048 #### At some point recursive display-table lookup will be
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1049 implemented when a string glyph is being processed).
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1050 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1051 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
1052 printf-like spec used to process the character. #### Unfortunately no
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1053 formatting directives other than %% are implemented.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1054 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1055 A vector (each element of the vector is processed recursively;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1056 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
1057
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1058 #### 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
1059 be expanded to include other features, such as referencing characters
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1060 in particular fonts and allowing the character search to continue
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1061 all the way up the chain of specifier instantiators. These features
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1062 are necessary to properly display Unicode characters.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1063 @end itemize
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1064 @end defvar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1065
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1066 Individual faces can also specify an overriding display table;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1067 this is set using @code{set-face-display-table}. @xref{Faces}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1068
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1069 If no display table can be determined for a particular window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1070 then XEmacs uses the usual display conventions. @xref{Usual Display}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1071
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1072 @node Character Descriptors
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1073 @subsection Character Descriptors
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1074
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075 @cindex character descriptor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1076 Each element of the display-table vector describes how to display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1077 a particular character and is called a @dfn{character descriptor}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078 A character descriptor can be:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1079
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 @table @asis
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1081 @item a string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1082 Display this particular string wherever the character is to be displayed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1083
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1084 @item a glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1085 Display this particular glyph wherever the character is to be displayed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1086
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1087 @item a vector
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1088 The vector may contain strings and/or glyphs. Display the elements of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089 the vector one after another wherever the character is to be displayed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1090
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1091 @item @code{nil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092 Display according to the standard interpretation (@pxref{Usual Display}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1093 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1094
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1095 @ignore Not yet working in XEmacs?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1096 @node ISO Latin 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1097 @subsection ISO Latin 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099 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
1100 set, you can arrange to use that character set as follows:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1102 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1103 (require 'disp-table)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1104 ;; @r{Set char codes 160--255 to display as themselves.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1105 ;; @r{(Codes 128--159 are the additional control characters.)}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106 (standard-display-8bit 160 255)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 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
1110 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
1111 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
1112 ISO characters as explanatory sequences of @sc{ascii} characters. For
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1113 example, the character ``o with umlaut'' displays as @samp{@{"o@}}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1115 Some European countries have terminals that don't support ISO Latin 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1116 but do support the special characters for that country's language. You
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1117 can define a display table to work one language using such terminals.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1118 For an example, see @file{lisp/iso-swed.el}, which handles certain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1119 Swedish terminals.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1120
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1121 You can load the appropriate display table for your terminal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1122 automatically by writing a terminal-specific Lisp file for the terminal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 type.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1124 @end ignore
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 @node Beeping
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1127 @section Beeping
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1128 @cindex beeping
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1129 @cindex bell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1130 @cindex sound
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1131
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1132 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
1133 attract the user's attention. Be conservative about how often you do
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134 this; frequent bells can become irritating. Also be careful not to use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1135 beeping alone when signaling an error is appropriate. (@xref{Errors}.)
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 @defun ding &optional dont-terminate sound device
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1138 @cindex keyboard macro termination
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1139 This function beeps, or flashes the screen (see @code{visible-bell}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1140 below). It also terminates any keyboard macro currently executing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1141 unless @var{dont-terminate} is non-@code{nil}. If @var{sound} is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1142 specified, it should be a symbol specifying which sound to make. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1143 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
1144 works if sound support was compiled into the executable and you are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1145 running on the console of a Sun SparcStation, SGI, HP9000s700, or Linux
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1146 PC. Otherwise you just get a beep.) The optional third argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1147 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
1148 device.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1149 @end defun
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 @defun beep &optional dont-terminate sound device
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1152 This is a synonym for @code{ding}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1153 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1154
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1155 @defopt visible-bell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1156 This variable determines whether XEmacs should flash the screen to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1157 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
1158 TTY devices, this is effective only if the Termcap entry for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 terminal type has the visible bell flag (@samp{vb}) set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160 @end defopt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162 @defvar sound-alist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 This variable holds an alist associating names with sounds. When
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164 @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
1165 associated sound will be generated instead of the standard beep.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1166
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1167 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
1168 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
1169 Subsequent elements of the list are alternating keyword/value pairs:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1171 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1172 @item sound
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 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
1174 symbol @code{t} here means use the default X beep.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175 @item volume
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1176 An integer from 0-100, defaulting to @code{bell-volume}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1177 @item pitch
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1178 If using the default X beep, the pitch (Hz) to generate.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179 @item duration
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1180 If using the default X beep, the duration (milliseconds).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1183 For compatibility, elements of `sound-alist' may also be:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187 @code{( sound-name . <sound> )}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1188 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189 @code{( sound-name <volume> <sound> )}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1190 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192 You should probably add things to this list by calling the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1193 @code{load-sound-file}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1194
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 Caveats:
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 @itemize @minus
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1198 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1199 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
1200 SparcStation, SGI, or HP9000s700.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1202 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1203 The pitch, duration, and volume options are available everywhere, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1204 many X servers ignore the `pitch' option.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1205 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1206
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1207 The following beep-types are used by XEmacs itself:
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 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1210 @item auto-save-error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1211 when an auto-save does not succeed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1212 @item command-error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1213 when the XEmacs command loop catches an error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1214 @item undefined-key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 when you type a key that is undefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216 @item undefined-click
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217 when you use an undefined mouse-click combination
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218 @item no-completion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1219 during completing-read
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1220 @item y-or-n-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1221 when you type something other than 'y' or 'n'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1222 @item yes-or-no-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1223 when you type something other than 'yes' or 'no'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1224 @item default
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1225 used when nothing else is appropriate.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228 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
1229 the C kernel of XEmacs uses.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1230 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1231
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1232 @defopt bell-volume
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1233 This variable specifies the default volume for sounds, from 0 to 100.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1234 @end defopt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1236 @deffn Command load-default-sounds
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1237 This function loads and installs some sound files as beep-types.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1238 @end deffn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1239
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1240 @deffn Command load-sound-file filename sound-name &optional volume
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1241 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
1242 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
1243 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
1244 is specified, the sound will be played at that volume; otherwise, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1245 value of @var{bell-volume} will be used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1246 @end deffn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1247
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1248 @defun play-sound sound &optional volume device
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1249 This function plays sound @var{sound}, which should be a symbol
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1250 mentioned in @code{sound-alist}. If @var{volume} is specified, it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1251 overrides the value (if any) specified in @code{sound-alist}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 @var{device} specifies the device to play the sound on, and defaults
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1253 to the selected device.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1254 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1255
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1256 @deffn Command play-sound-file file &optional volume device
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1257 This function plays the named sound file at volume @var{volume}, which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1258 defaults to @code{bell-volume}. @var{device} specifies the device to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259 play the sound on, and defaults to the selected device.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1260 @end deffn