annotate lispref/display.texi @ 12721:363b0c8f817d

(with-electric-help): Doc fix.
author Richard M. Stallman <rms@gnu.org>
date Sun, 30 Jul 1995 07:04:58 +0000
parents a6eb5f12b0f3
children 0a9219070022
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 @c -*-texinfo-*-
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2 @c This is part of the GNU Emacs Lisp Reference Manual.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4 @c See the file elisp.texi for copying conditions.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 @setfilename ../info/display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 @node Display, Calendar, System Interface, Top
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 @chapter Emacs Display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 This chapter describes a number of features related to the display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 that Emacs presents to the user.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 @menu
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 * Refresh Screen:: Clearing the screen and redrawing everything on it.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 * Screen Size:: How big is the Emacs screen.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 * Truncation:: Folding or wrapping long text lines.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 * The Echo Area:: Where messages are displayed.
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
17 * Invisible Text:: Hiding part of the buffer text.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
18 * Selective Display:: Hiding part of the buffer text (the old way).
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 * Overlay Arrow:: Display of an arrow to indicate position.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 * Temporary Displays:: Displays that go away automatically.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 * Overlays:: Use overlays to highlight parts of the buffer.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 * Faces:: A face defines a graphics appearance: font, color, etc.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 * Blinking:: How Emacs shows the matching open parenthesis.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 * Inverse Video:: Specifying how the screen looks.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 * Usual Display:: The usual conventions for displaying nonprinting chars.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 * Display Tables:: How to specify other conventions.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 * Beeping:: Audible signal to the user.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 * Window Systems:: Which window system is being used.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 @end menu
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 @node Refresh Screen
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 @section Refreshing the Screen
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 The function @code{redraw-frame} redisplays the entire contents of a
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 given frame. @xref{Frames}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 @c Emacs 19 feature
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 @defun redraw-frame frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 This function clears and redisplays frame @var{frame}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 Even more powerful is @code{redraw-display}:
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 @deffn Command redraw-display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 This function clears and redisplays all visible frames.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 @end deffn
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
48 Processing user input takes absolute priority over redisplay. If you
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
49 call these functions when input is available, they do nothing
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
50 immediately, but a full redisplay does happen eventually---after all the
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
51 input has been processed.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
52
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 Normally, suspending and resuming Emacs also refreshes the screen.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 Some terminal emulators record separate contents for display-oriented
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 programs such as Emacs and for ordinary sequential display. If you are
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 using such a terminal, you might want to inhibit the redisplay on
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
57 resumption.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 @defvar no-redraw-on-reenter
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 @cindex suspend (cf. @code{no-redraw-on-reenter})
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 @cindex resume (cf. @code{no-redraw-on-reenter})
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 This variable controls whether Emacs redraws the entire screen after it
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 has been suspended and resumed. Non-@code{nil} means yes, @code{nil}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 means no.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 @node Screen Size
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 @section Screen Size
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 @cindex size of screen
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 @cindex screen size
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 @cindex display lines
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 @cindex display columns
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 @cindex resize redisplay
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
75 The screen size functions access or specify the height or width of
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 the terminal. When you are using multiple frames, they apply to the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 selected frame (@pxref{Frames}).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 @defun screen-height
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 This function returns the number of lines on the screen that are
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 available for display.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 @example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 (screen-height)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 @result{} 50
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 @end example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 @defun screen-width
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 This function returns the number of columns on the screen that are
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 available for display.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 @example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 (screen-width)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 @result{} 80
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 @end example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 @defun set-screen-height lines &optional not-actual-size
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 This function declares that the terminal can display @var{lines} lines.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 The sizes of existing windows are altered proportionally to fit.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 If @var{not-actual-size} is non-@code{nil}, then Emacs displays
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 @var{lines} lines of output, but does not change its value for the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 actual height of the screen. (Knowing the correct actual size may be
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 necessary for correct cursor positioning.) Using a smaller height than
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 the terminal actually implements may be useful to reproduce behavior
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 observed on a smaller screen, or if the terminal malfunctions when using
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 its whole screen.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 If @var{lines} is different from what it was previously, then the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 entire screen is cleared and redisplayed using the new size.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 This function returns @code{nil}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 @defun set-screen-width columns &optional not-actual-size
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 This function declares that the terminal can display @var{columns}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 columns. The details are as in @code{set-screen-height}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 @node Truncation
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 @section Truncation
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 @cindex line wrapping
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129 @cindex continuation lines
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 @cindex @samp{$} in display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 @cindex @samp{\} in display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 When a line of text extends beyond the right edge of a window, the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 line can either be continued on the next screen line, or truncated to
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 one screen line. The additional screen lines used to display a long
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 text line are called @dfn{continuation} lines. Normally, a @samp{$} in
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 the rightmost column of the window indicates truncation; a @samp{\} on
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 the rightmost column indicates a line that ``wraps'' or is continued
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 onto the next line. (The display table can specify alternative
7086
075343a6b32b *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 6598
diff changeset
140 indicators; see @ref{Display Tables}.)
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 Note that continuation is different from filling; continuation happens
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 on the screen only, not in the buffer contents, and it breaks a line
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 precisely at the right margin, not at a word boundary. @xref{Filling}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 @defopt truncate-lines
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 This buffer-local variable controls how Emacs displays lines that extend
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 beyond the right edge of the window. The default is @code{nil}, which
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 specifies continuation. If the value is non-@code{nil}, then these
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 lines are truncated.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 If the variable @code{truncate-partial-width-windows} is non-@code{nil},
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 then truncation is always used for side-by-side windows (within one
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 frame) regardless of the value of @code{truncate-lines}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 @end defopt
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
157 @defopt default-truncate-lines
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 This variable is the default value for @code{truncate-lines}, for
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 buffers that do not have local values for it.
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
160 @end defopt
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 @defopt truncate-partial-width-windows
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 This variable controls display of lines that extend beyond the right
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 edge of the window, in side-by-side windows (@pxref{Splitting Windows}).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 If it is non-@code{nil}, these lines are truncated; otherwise,
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 @code{truncate-lines} says what to do with them.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 @end defopt
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 You can override the images that indicate continuation or truncation
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 with the display table; see @ref{Display Tables}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
172 If your buffer contains @strong{very} long lines, and you use
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
173 continuation to display them, just thinking about them can make Emacs
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
174 redisplay slow. The column computation and indentation functions also
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
175 become slow. Then you might find it advisable to set
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
176 @code{cache-long-line-scans} to @code{t}.
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
177
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
178 @defvar cache-long-line-scans
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
179 If this variable is non-@code{nil}, various indentation and motion
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
180 functions, and Emacs redisplay, cache the results of scanning the
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
181 buffer, and consult the cache to avoid rescanning regions of the buffer
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
182 unless they are modified.
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
183
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
184 Turning on the cache slows down processing of short lines somewhat.
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
185
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
186 This variable is automatically local in every buffer.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
187 @end defvar
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
188
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 @node The Echo Area
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 @section The Echo Area
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 @cindex error display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 @cindex echo area
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
194 The @dfn{echo area} is used for displaying messages made with the
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 @code{message} primitive, and for echoing keystrokes. It is not the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 same as the minibuffer, despite the fact that the minibuffer appears
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 (when active) in the same place on the screen as the echo area. The
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 @cite{GNU Emacs Manual} specifies the rules for resolving conflicts
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199 between the echo area and the minibuffer for use of that screen space
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 (@pxref{Minibuffer,, The Minibuffer, emacs, The GNU Emacs Manual}).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 Error messages appear in the echo area; see @ref{Errors}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 You can write output in the echo area by using the Lisp printing
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 functions with @code{t} as the stream (@pxref{Output Functions}), or as
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 follows:
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 @defun message string &rest arguments
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
208 This function displays a one-line message in the echo area. The
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 argument @var{string} is similar to a C language @code{printf} control
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 string. See @code{format} in @ref{String Conversion}, for the details
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 on the conversion specifications. @code{message} returns the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 constructed string.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213
7735
7db892210924 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7086
diff changeset
214 In batch mode, @code{message} prints the message text on the standard
7db892210924 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7086
diff changeset
215 error stream, followed by a newline.
7db892210924 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7086
diff changeset
216
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 @c Emacs 19 feature
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 If @var{string} is @code{nil}, @code{message} clears the echo area. If
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 the minibuffer is active, this brings the minibuffer contents back onto
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 the screen immediately.
7735
7db892210924 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7086
diff changeset
221
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 @example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 (message "Minibuffer depth is %d."
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225 (minibuffer-depth))
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 @print{} Minibuffer depth is 0.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 @result{} "Minibuffer depth is 0."
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231 ---------- Echo Area ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 Minibuffer depth is 0.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 ---------- Echo Area ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 @end example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
238 Almost all the messages displayed in the echo area are also recorded
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
239 in the @samp{*Messages*} buffer.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
240
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
241 @defopt message-log-max
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
242 This variable specifies how many lines to keep in the @samp{*Messages*}
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
243 buffer. The value @code{t} means there is no limit on how many lines to
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
244 keep. The value @code{nil} disables message logging entirely. Here's
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
245 how to display a message and prevent it from being logged:
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
246
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
247 @example
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
248 (let (message-log-max)
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
249 (message @dots{}))
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
250 @end example
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
251 @end defopt
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
252
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
253 @defvar echo-keystrokes
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
254 This variable determines how much time should elapse before command
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
255 characters echo. Its value must be an integer, which specifies the
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
256 number of seconds to wait before echoing. If the user types a prefix
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
257 key (such as @kbd{C-x}) and then delays this many seconds before
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
258 continuing, the prefix key is echoed in the echo area. Any subsequent
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
259 characters in the same command will be echoed as well.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
260
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
261 If the value is zero, then command input is not echoed.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
262 @end defvar
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
263
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 @defvar cursor-in-echo-area
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 This variable controls where the cursor appears when a message is
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 displayed in the echo area. If it is non-@code{nil}, then the cursor
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 appears at the end of the message. Otherwise, the cursor appears at
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 point---not in the echo area at all.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 The value is normally @code{nil}; Lisp programs bind it to @code{t}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 for brief periods of time.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
274 @node Invisible Text
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
275 @section Invisible Text
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
276
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
277 @cindex invisible text
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
278 You can make characters @dfn{invisible}, so that they do not appear on
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
279 the screen, with the @code{invisible} property. This can be either a
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
280 text property or a property of an overlay.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
281
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
282 In the simplest case, any non-@code{nil} @code{invisible} property makes
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
283 a character invisible. This is the default case---if you don't alter
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
284 the default value of @code{buffer-invisibility-spec}, this is how the
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
285 @code{invisibility} property works. This feature is much like selective
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
286 display (@pxref{Selective Display}), but more general and cleaner.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
287
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
288 More generally, you can use the variable @code{buffer-invisibility-spec}
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
289 to control which values of the @code{invisible} property make text
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
290 invisible. This permits you to classify the text into different subsets
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
291 in advance, by giving them different @code{invisible} values, and
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
292 subsequently make various subsets visible or invisible by changing the
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
293 value of @code{buffer-invisibility-spec}.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
294
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
295 Controlling visibility with @code{buffer-invisibility-spec} is
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
296 especially useful in a program to display the list of entries in a data
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
297 base. It permits the implementation of convenient filtering commands to
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
298 view just a part of the entries in the data base. Setting this variable
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
299 is very fast, much faster than scanning all the text in the buffer
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
300 looking for properties to change.
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
301
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
302 @defvar buffer-invisibility-spec
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
303 This variable specifies which kinds of @code{invisible} properties
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
304 actually make a character invisible.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
305
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
306 @table @asis
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
307 @item @code{t}
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
308 A character is invisible if its @code{invisible} property is
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
309 non-@code{nil}. This is the default.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
310
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
311 @item a list
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
312 Each element of the list makes certain characters invisible.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
313 Ultimately, a character is invisible if any of the elements of this list
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
314 applies to it. The list can have two kinds of elements:
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
315
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
316 @table @code
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
317 @item @var{atom}
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
318 A character is invisible if its @code{invisible} propery value
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
319 is @var{atom} or if it is a list with @var{atom} as a member.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
320
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
321 @item (@var{atom} . t)
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
322 A character is invisible if its @code{invisible} propery value
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
323 is @var{atom} or if it is a list with @var{atom} as a member.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
324 Moreover, if this character is at the end of a line and is followed
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
325 by a visible newline, it displays an ellipsis.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
326 @end table
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
327 @end table
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
328 @end defvar
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
329
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
330 Ordinarily, commands that operate on text or move point do not care
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
331 whether the text is invisible. However, the user-level line motion
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
332 commands explicitly ignore invisible newlines.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
333
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 @node Selective Display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 @section Selective Display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 @cindex selective display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
338 @dfn{Selective display} is a pair of features that hide certain
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
339 lines on the screen.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341 The first variant, explicit selective display, is designed for use in
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342 a Lisp program. The program controls which lines are hidden by altering
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
343 the text. Outline mode has traditionally used this variant. It has
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
344 been partially replaced by the invisible text feature (@pxref{Invisible
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
345 Text}); there is a new version of Outline mode which uses that instead.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
346
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
347 In the second variant, the choice of lines to hide is made
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
348 automatically based on indentation. This variant is designed to be a
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
349 user-level feature.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351 The way you control explicit selective display is by replacing a
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
352 newline (control-j) with a carriage return (control-m). The text that
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353 was formerly a line following that newline is now invisible. Strictly
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 speaking, it is temporarily no longer a line at all, since only newlines
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 can separate lines; it is now part of the previous line.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 Selective display does not directly affect editing commands. For
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358 example, @kbd{C-f} (@code{forward-char}) moves point unhesitatingly into
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359 invisible text. However, the replacement of newline characters with
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360 carriage return characters affects some editing commands. For example,
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361 @code{next-line} skips invisible lines, since it searches only for
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 newlines. Modes that use selective display can also define commands
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363 that take account of the newlines, or that make parts of the text
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
364 visible or invisible.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
365
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366 When you write a selectively displayed buffer into a file, all the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367 control-m's are output as newlines. This means that when you next read
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368 in the file, it looks OK, with nothing invisible. The selective display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
369 effect is seen only within Emacs.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
370
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
371 @defvar selective-display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372 This buffer-local variable enables selective display. This means that
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 lines, or portions of lines, may be made invisible.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 @itemize @bullet
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 @item
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377 If the value of @code{selective-display} is @code{t}, then any portion
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
378 of a line that follows a control-m is not displayed.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 @item
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
381 If the value of @code{selective-display} is a positive integer, then
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382 lines that start with more than that many columns of indentation are not
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 displayed.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384 @end itemize
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386 When some portion of a buffer is invisible, the vertical movement
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 commands operate as if that portion did not exist, allowing a single
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 @code{next-line} command to skip any number of invisible lines.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389 However, character movement commands (such as @code{forward-char}) do
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390 not skip the invisible portion, and it is possible (if tricky) to insert
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391 or delete text in an invisible portion.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
392
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
393 In the examples below, we show the @emph{display appearance} of the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394 buffer @code{foo}, which changes with the value of
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
395 @code{selective-display}. The @emph{contents} of the buffer do not
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396 change.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398 @example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
399 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
400 (setq selective-display nil)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
401 @result{} nil
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
403 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
404 1 on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
405 2on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
406 3n this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
407 3n this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
408 2on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
409 1 on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
410 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
411 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
412
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414 (setq selective-display 2)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
415 @result{} 2
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
416
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
417 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418 1 on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 2on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420 2on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
421 1 on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
422 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
423 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
424 @end example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
425 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
426
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 @defvar selective-display-ellipses
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
428 If this buffer-local variable is non-@code{nil}, then Emacs displays
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
429 @samp{@dots{}} at the end of a line that is followed by invisible text.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
430 This example is a continuation of the previous one.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
431
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
432 @example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
433 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
434 (setq selective-display-ellipses t)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
435 @result{} t
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
436
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
437 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 1 on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439 2on this column ...
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 2on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 1 on this column
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 @end example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
446 You can use a display table to substitute other text for the ellipsis
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
447 (@samp{@dots{}}). @xref{Display Tables}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450 @node Overlay Arrow
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 @section The Overlay Arrow
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 @cindex overlay arrow
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 The @dfn{overlay arrow} is useful for directing the user's attention
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455 to a particular line in a buffer. For example, in the modes used for
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456 interface to debuggers, the overlay arrow indicates the line of code
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
457 about to be executed.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459 @defvar overlay-arrow-string
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
460 This variable holds the string to display to call attention to a
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
461 particular line, or @code{nil} if the arrow feature is not in use.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
463
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464 @defvar overlay-arrow-position
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
465 This variable holds a marker that indicates where to display the overlay
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
466 arrow. It should point at the beginning of a line. The arrow text
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
467 appears at the beginning of that line, overlaying any text that would
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
468 otherwise appear. Since the arrow is usually short, and the line
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
469 usually begins with indentation, normally nothing significant is
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
470 overwritten.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
471
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
472 The overlay string is displayed only in the buffer that this marker
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
473 points into. Thus, only one buffer can have an overlay arrow at any
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 given time.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475 @c !!! overlay-arrow-position: but the overlay string may remain in the display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
476 @c of some other buffer until an update is required. This should be fixed
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477 @c now. Is it?
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
480 You can do the same job by creating an overlay with a
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
481 @code{before-string} property. @xref{Overlay Properties}.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
482
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 @node Temporary Displays
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484 @section Temporary Displays
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
485
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486 Temporary displays are used by commands to put output into a buffer
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 and then present it to the user for perusal rather than for editing.
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
488 Many of the help commands use this feature.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
490 @defspec with-output-to-temp-buffer buffer-name forms@dots{}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
491 This function executes @var{forms} while arranging to insert any
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
492 output they print into the buffer named @var{buffer-name}. The buffer
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
493 is then shown in some window for viewing, displayed but not selected.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
494
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
495 The string @var{buffer-name} specifies the temporary buffer, which
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
496 need not already exist. The argument must be a string, not a buffer.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
497 The buffer is erased initially (with no questions asked), and it is
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
498 marked as unmodified after @code{with-output-to-temp-buffer} exits.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
499
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
500 @code{with-output-to-temp-buffer} binds @code{standard-output} to the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
501 temporary buffer, then it evaluates the forms in @var{forms}. Output
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
502 using the Lisp output functions within @var{forms} goes by default to
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
503 that buffer (but screen display and messages in the echo area, although
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
504 they are ``output'' in the general sense of the word, are not affected).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
505 @xref{Output Functions}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
506
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
507 The value of the last form in @var{forms} is returned.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
508
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
509 @example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
510 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
511 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
512 This is the contents of foo.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
513 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
514 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
515
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
516 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
517 (with-output-to-temp-buffer "foo"
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
518 (print 20)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
519 (print standard-output))
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
520 @result{} #<buffer foo>
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
521
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
522 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
523 20
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
524
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
525 #<buffer foo>
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
526
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
527 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
528 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
529 @end example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
530 @end defspec
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
531
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
532 @defvar temp-buffer-show-function
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
533 If this variable is non-@code{nil}, @code{with-output-to-temp-buffer}
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
534 calls it as a function to do the job of displaying a help buffer. The
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
535 function gets one argument, which is the buffer it should display.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
536
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
537 In Emacs versions 18 and earlier, this variable was called
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
538 @code{temp-buffer-show-hook}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
539 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
540
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
541 @defun momentary-string-display string position &optional char message
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
542 This function momentarily displays @var{string} in the current buffer at
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
543 @var{position}. It has no effect on the undo list or on the buffer's
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
544 modification status.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
545
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
546 The momentary display remains until the next input event. If the next
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
547 input event is @var{char}, @code{momentary-string-display} ignores it
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
548 and returns. Otherwise, that event remains buffered for subsequent use
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
549 as input. Thus, typing @var{char} will simply remove the string from
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
550 the display, while typing (say) @kbd{C-f} will remove the string from
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
551 the display and later (presumably) move point forward. The argument
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
552 @var{char} is a space by default.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
553
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
554 The return value of @code{momentary-string-display} is not meaningful.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
555
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
556 If the string @var{string} does not contain control characters, you can
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
557 do the same job in a more general way by creating an overlay with a
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
558 @code{before-string} property. @xref{Overlay Properties}.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
559
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
560 If @var{message} is non-@code{nil}, it is displayed in the echo area
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
561 while @var{string} is displayed in the buffer. If it is @code{nil}, a
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
562 default message says to type @var{char} to continue.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
563
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
564 In this example, point is initially located at the beginning of the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
565 second line:
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
566
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
567 @example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
568 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
569 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
570 This is the contents of foo.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
571 @point{}Second line.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
572 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
573 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
574
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
575 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
576 (momentary-string-display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
577 "**** Important Message! ****"
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
578 (point) ?\r
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
579 "Type RET when done reading")
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
580 @result{} t
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
581 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
582
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
584 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
585 This is the contents of foo.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586 **** Important Message! ****Second line.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
587 ---------- Buffer: foo ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
588
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
589 ---------- Echo Area ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
590 Type RET when done reading
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
591 ---------- Echo Area ----------
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
592 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
593 @end example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
594 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
595
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
596 @node Overlays
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
597 @section Overlays
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
598 @cindex overlays
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
599
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
600 You can use @dfn{overlays} to alter the appearance of a buffer's text on
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
601 the screen, for the sake of presentation features. An overlay is an
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
602 object that belongs to a particular buffer, and has a specified
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
603 beginning and end. It also has properties that you can examine and set;
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
604 these affect the display of the text within the overlay.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
605
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
606 @menu
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
607 * Overlay Properties:: How to read and set properties.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
608 What properties do to the screen display.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
609 * Managing Overlays:: Creating, moving, finding overlays.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
610 @end menu
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
611
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
612 @node Overlay Properties
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
613 @subsection Overlay Properties
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
614
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
615 Overlay properties are like text properties in some respects, but the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
616 differences are more important than the similarities. Text properties
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
617 are considered a part of the text; overlays are specifically considered
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
618 not to be part of the text. Thus, copying text between various buffers
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
619 and strings preserves text properties, but does not try to preserve
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
620 overlays. Changing a buffer's text properties marks the buffer as
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
621 modified, while moving an overlay or changing its properties does not.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
622 Unlike text propery changes, overlay changes are not recorded in the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
623 buffer's undo list.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
624
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
625 @table @code
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
626 @item priority
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
627 @kindex priority @r{(overlay property)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
628 This property's value (which should be a nonnegative number) determines
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
629 the priority of the overlay. The priority matters when two or more
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
630 overlays cover the same character and both specify a face for display;
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
631 the one whose @code{priority} value is larger takes priority over the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
632 other, and its face attributes override the face attributes of the lower
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
633 priority overlay.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
634
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
635 Currently, all overlays take priority over text properties. Please
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
636 avoid using negative priority values, as we have not yet decided just
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
637 what they should mean.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
638
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
639 @item window
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
640 @kindex window @r{(overlay property)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
641 If the @code{window} property is non-@code{nil}, then the overlay
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
642 applies only on that window.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
643
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
644 @item category
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
645 @kindex category @r{(overlay property)}
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
646 If an overlay has a @code{category} property, we call it the
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
647 @dfn{category} of the overlay. It should be a symbol. The properties
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
648 of the symbol serve as defaults for the properties of the overlay.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
649
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
650 @item face
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
651 @kindex face @r{(overlay property)}
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
652 This property controls the font and color of text. Its value is a face
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
653 name or a list of face names. @xref{Faces}, for more information. This
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
654 feature may be temporary; in the future, we may replace it with other
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
655 ways of specifying how to display text.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
656
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
657 @item mouse-face
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
658 @kindex mouse-face @r{(overlay property)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
659 This property is used instead of @code{face} when the mouse is within
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
660 the range of the overlay. This feature may be temporary, like
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
661 @code{face}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
662
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
663 @item modification-hooks
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
664 @kindex modification-hooks @r{(overlay property)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
665 This property's value is a list of functions to be called if any
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
666 character within the overlay is changed or if text is inserted strictly
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
667 within the overlay.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
668
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
669 The hook functions are called both before and after each change.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
670 If the functions save the information they receive, and compare notes
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
671 between calls, they can determine exactly what change has been made
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
672 in the buffer text.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
673
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
674 When called before a change, each function receives four arguments: the
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
675 overlay, @code{nil}, and the beginning and end of the text range to be
7086
075343a6b32b *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 6598
diff changeset
676 modified.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
677
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
678 When called after a change, each function receives five arguments: the
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
679 overlay, @code{t}, the beginning and end of the text range just
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
680 modified, and the length of the pre-change text replaced by that range.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
681 (For an insertion, the pre-change length is zero; for a deletion, that
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
682 length is the number of characters deleted, and the post-change
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
683 beginning and end are equal.)
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
684
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
685 @item insert-in-front-hooks
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
686 @kindex insert-in-front-hooks @r{(overlay property)}
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
687 This property's value is a list of functions to be called before and
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
688 after inserting text right at the beginning of the overlay. The calling
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
689 conventions are the same as for the @code{modification-hooks} functions.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
690
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
691 @item insert-behind-hooks
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
692 @kindex insert-behind-hooks @r{(overlay property)}
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
693 This property's value is a list of functions to be called before and
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
694 after inserting text right at the end of the overlay. The calling
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
695 conventions are the same as for the @code{modification-hooks} functions.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
696
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
697 @item invisible
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
698 @kindex invisible @r{(overlay property)}
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
699 The @code{invisible} property can make the text in the overlay
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
700 invisible, which means that it does not appear on the screen.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
701 @xref{Invisible Text}, for details.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
702
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
703 @item intangible
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
704 @kindex intangible @r{(overlay property)}
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
705 The @code{intangible} property on an overlay works just like the
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
706 @code{intangible} text property. @xref{Special Properties}, for details.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
707
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
708 @item before-string
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
709 @kindex before-string @r{(overlay property)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
710 This property's value is a string to add to the display at the beginning
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
711 of the overlay. The string does not appear in the buffer in any
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
712 sense---only on the screen. The string should contain only characters
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
713 that display as a single column---control characters, including tabs or
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
714 newlines, will give strange results.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
715
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
716 @item after-string
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
717 @kindex after-string @r{(overlay property)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
718 This property's value is a string to add to the display at the end of
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
719 the overlay. The string does not appear in the buffer in any
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
720 sense---only on the screen. The string should contain only characters
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
721 that display as a single column---control characters, including tabs or
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
722 newlines, will give strange results.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
723
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
724 @item evaporate
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
725 @kindex evaporate @r{(overlay property)}
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
726 If this property is non-@code{nil}, the overlay is deleted automatically
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
727 if it ever becomes empty (i.e., if it spans no characters).
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
728 @end table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
729
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
730 These are the functions for reading and writing the properties of an
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
731 overlay.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
732
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
733 @defun overlay-get overlay prop
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
734 This function returns the value of property @var{prop} recorded in
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
735 @var{overlay}, if any. If @var{overlay} does not record any value for
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
736 that property, but it does have a @code{category} property which is a
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
737 symbol, that symbol's @var{prop} property is used. Otherwise, the value
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
738 is @code{nil}.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
739 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
740
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
741 @defun overlay-put overlay prop value
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
742 This function sets the value of property @var{prop} recorded in
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
743 @var{overlay} to @var{value}. It returns @var{value}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
744 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
745
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
746 See also the function @code{get-char-property} which checks both
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
747 overlay properties and text properties for a given character.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
748 @xref{Examining Properties}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
749
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
750 @node Managing Overlays
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
751 @subsection Managing Overlays
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
752
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
753 This section describes the functions to create, delete and move
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
754 overlays, and to examine their contents.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
755
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
756 @defun make-overlay start end &optional buffer
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
757 This function creates and returns an overlay that belongs to
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
758 @var{buffer} and ranges from @var{start} to @var{end}. Both @var{start}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
759 and @var{end} must specify buffer positions; they may be integers or
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
760 markers. If @var{buffer} is omitted, the overlay is created in the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
761 current buffer.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
762 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
763
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
764 @defun overlay-start overlay
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
765 This function returns the position at which @var{overlay} starts.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
766 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
767
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
768 @defun overlay-end overlay
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
769 This function returns the position at which @var{overlay} ends.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
770 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
771
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
772 @defun overlay-buffer overlay
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
773 This function returns the buffer that @var{overlay} belongs to.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
774 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
775
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
776 @defun delete-overlay overlay
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
777 This function deletes @var{overlay}. The overlay continues to exist as
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
778 a Lisp object, but ceases to be part of the buffer it belonged to, and
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
779 ceases to have any effect on display.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
780 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
781
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
782 @defun move-overlay overlay start end &optional buffer
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
783 This function moves @var{overlay} to @var{buffer}, and places its bounds
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
784 at @var{start} and @var{end}. Both arguments @var{start} and @var{end}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
785 must specify buffer positions; they may be integers or markers. If
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
786 @var{buffer} is omitted, the overlay stays in the same buffer.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
787
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
788 The return value is @var{overlay}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
789
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
790 This is the only valid way to change the endpoints of an overlay. Do
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
791 not try modifying the markers in the overlay by hand, as that fails to
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
792 update other vital data structures and can cause some overlays to be
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
793 ``lost''.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
794 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
795
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
796 @defun overlays-at pos
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
797 This function returns a list of all the overlays that contain position
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
798 @var{pos} in the current buffer. The list is in no particular order.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
799 An overlay contains position @var{pos} if it begins at or before
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
800 @var{pos}, and ends after @var{pos}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
801 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
802
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
803 @defun next-overlay-change pos
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
804 This function returns the buffer position of the next beginning or end
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
805 of an overlay, after @var{pos}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
806 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
807
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
808 @defun previous-overlay-change pos
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
809 This function returns the buffer position of the previous beginning or
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
810 end of an overlay, before @var{pos}.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
811 @end defun
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
812
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
813 @node Faces
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
814 @section Faces
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
815 @cindex face
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
816
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
817 A @dfn{face} is a named collection of graphical attributes: font,
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
818 foreground color, background color and optional underlining. Faces
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
819 control the display of text on the screen.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
820
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
821 @cindex face id
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
822 Each face has its own @dfn{face id number} which distinguishes faces at
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
823 low levels within Emacs. However, for most purposes, you can refer to
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
824 faces in Lisp programs by their names.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
825
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
826 @defun facep object
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
827 This function returns @code{t} if @var{object} is a face name symbol (or
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
828 if it is a vector of the kind used internally to record face data). It
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
829 returns @code{nil} otherwise.
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
830 @end defun
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
831
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
832 Each face name is meaningful for all frames, and by default it has the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
833 same meaning in all frames. But you can arrange to give a particular
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
834 face name a special meaning in one frame if you wish.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
835
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
836 @menu
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
837 * Standard Faces:: The faces Emacs normally comes with.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
838 * Merging Faces:: How Emacs decides which face to use for a character.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
839 * Face Functions:: How to define and examine faces.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
840 @end menu
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
841
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
842 @node Standard Faces
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
843 @subsection Standard Faces
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
844
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
845 This table lists all the standard faces and their uses.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
846
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
847 @table @code
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
848 @item default
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
849 @kindex default @r{(face name)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
850 This face is used for ordinary text.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
851
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
852 @item modeline
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
853 @kindex modeline @r{(face name)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
854 This face is used for mode lines and menu bars.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
855
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
856 @item region
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
857 @kindex region @r{(face name)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
858 This face is used for highlighting the region in Transient Mark mode.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
859
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
860 @item secondary-selection
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
861 @kindex secondary-selection @r{(face name)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
862 This face is used to show any secondary selection you have made.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
863
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
864 @item highlight
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
865 @kindex highlight @r{(face name)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
866 This face is meant to be used for highlighting for various purposes.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
867
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
868 @item underline
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
869 @kindex underline @r{(face name)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
870 This face underlines text.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
871
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
872 @item bold
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
873 @kindex bold @r{(face name)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
874 This face uses a bold font, if possible. It uses the bold variant of
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
875 the frame's font, if it has one. It's up to you to choose a default
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
876 font that has a bold variant, if you want to use one.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
877
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
878 @item italic
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
879 @kindex italic @r{(face name)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
880 This face uses the italic variant of the frame's font, if it has one.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
881
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
882 @item bold-italic
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
883 @kindex bold-italic @r{(face name)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
884 This face uses the bold italic variant of the frame's font, if it has
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
885 one.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
886 @end table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
887
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
888 @node Merging Faces
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
889 @subsection Merging Faces for Display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
890
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
891 Here are all the ways to specify which face to use for display of text:
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
892
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
893 @itemize @bullet
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
894 @item
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
895 With defaults. Each frame has a @dfn{default face}, whose id number is
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
896 zero, which is used for all text that doesn't somehow specify another
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
897 face.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
898
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
899 @item
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
900 With text properties. A character may have a @code{face} property; if so,
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
901 it is displayed with that face. @xref{Special Properties}.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
902
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
903 If the character has a @code{mouse-face} property, that is used instead
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
904 of the @code{face} property when the mouse is ``near enough'' to the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
905 character.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
906
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
907 @item
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
908 With overlays. An overlay may have @code{face} and @code{mouse-face}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
909 properties too; they apply to all the text covered by the overlay.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
910
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
911 @item
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
912 With a region that is active. In Transient Mark mode, the region is
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
913 highlighted with a particular face (see @code{region-face}, below).
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
914
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
915 @item
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
916 With special glyphs. Each glyph can specify a particular face id
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
917 number. @xref{Glyphs}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
918 @end itemize
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
919
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
920 If these various sources together specify more than one face for a
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
921 particular character, Emacs merges the attributes of the various faces
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
922 specified. The attributes of the faces of special glyphs come first;
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
923 then comes the face for region highlighting, if appropriate;
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
924 then come attributes of faces from overlays, followed by those from text
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
925 properties, and last the default face.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
926
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
927 When multiple overlays cover one character, an overlay with higher
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
928 priority overrides those with lower priority. @xref{Overlays}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
929
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
930 If an attribute such as the font or a color is not specified in any of
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
931 the above ways, the frame's own font or color is used.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
932
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
933 @node Face Functions
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
934 @subsection Functions for Working with Faces
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
935
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
936 The attributes a face can specify include the font, the foreground
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
937 color, the background color, and underlining. The face can also leave
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
938 these unspecified by giving the value @code{nil} for them.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
939
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
940 Here are the primitives for creating and changing faces.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
941
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
942 @defun make-face name
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
943 This function defines a new face named @var{name}, initially with all
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
944 attributes @code{nil}. It does nothing if there is already a face named
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
945 @var{name}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
946 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
947
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
948 @defun face-list
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
949 This function returns a list of all defined face names.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
950 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
951
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
952 @defun copy-face old-face new-name &optional frame new-frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
953 This function defines the face @var{new-name} as a copy of the existing
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
954 face named @var{old-face}. It creates the face @var{new-name} if that
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
955 doesn't already exist.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
956
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
957 If the optional argument @var{frame} is given, this function applies
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
958 only to that frame. Otherwise it applies to each frame individually,
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
959 copying attributes from @var{old-face} in each frame to @var{new-face}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
960 in the same frame.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
961
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
962 If the optional argument @var{new-frame} is given, then @code{copy-face}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
963 copies the attributes of @var{old-face} in @var{frame} to @var{new-name}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
964 in @var{new-frame}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
965 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
966
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
967 You can modify the attributes of an existing face with the following
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
968 functions. If you specify @var{frame}, they affect just that frame;
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
969 otherwise, they affect all frames as well as the defaults that apply to
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
970 new frames.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
971
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
972 @defun set-face-foreground face color &optional frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
973 @defunx set-face-background face color &optional frame
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
974 These functions set the foreground (or background, respectively) color
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
975 of face @var{face} to @var{color}. The argument @var{color} should be a
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
976 string, the name of a color.
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
977
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
978 Certain shades of gray are implemented by stipple patterns on
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
979 black-and-white screens.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
980 @end defun
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
981
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
982 @defun set-face-stipple face pattern &optional frame
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
983 This function sets the background stipple pattern of face @var{face} to
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
984 @var{pattern}. The argument @var{pattern} should be the name of a
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
985 stipple pattern defined by the X server, or @code{nil} meaning don't use
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
986 stipple.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
987
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
988 Normally there is no need to pay attention to stipple patterns, because
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
989 they are used automatically to handle certain shades of gray.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
990 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
991
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
992 @defun set-face-font face font &optional frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
993 This function sets the font of face @var{face}. The argument @var{font}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
994 should be a string.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
995 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
996
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
997 @defun set-face-underline-p face underline-p &optional frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
998 This function sets the underline attribute of face @var{face}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
999 Non-@code{nil} means do underline; @code{nil} means don't.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1000 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1001
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1002 @defun invert-face face &optional frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1003 Swap the foreground and background colors of face @var{face}. If the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1004 face doesn't specify both foreground and background, then its foreground
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
1005 and background are set to the default background and foreground,
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
1006 respectively.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1007 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1008
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1009 These functions examine the attributes of a face. If you don't
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1010 specify @var{frame}, they refer to the default data for new frames.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1011
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1012 @defun face-foreground face &optional frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1013 @defunx face-background face &optional frame
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
1014 These functions return the foreground color (or background color,
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
1015 respectively) of face @var{face}, as a string.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1016 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1017
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1018 @defun face-stipple face &optional frame
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1019 This function returns the name of the background stipple pattern of face
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1020 @var{face}, or @code{nil} if it doesn't have one.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1021 @end defun
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1022
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1023 @defun face-font face &optional frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1024 This function returns the name of the font of face @var{face}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1025 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1026
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1027 @defun face-underline-p face &optional frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1028 This function returns the underline attribute of face @var{face}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1029 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1030
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1031 @defun face-id face
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1032 This function returns the face id number of face @var{face}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1033 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1034
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1035 @defun face-equal face1 face2 &optional frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1036 This returns @code{t} if the faces @var{face1} and @var{face2} have the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1037 same attributes for display.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1038 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1039
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1040 @defun face-differs-from-default-p face &optional frame
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1041 This returns @code{t} if the face @var{face} displays differently from
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1042 the default face. A face is considered to be ``the same'' as the normal
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1043 face if each attribute is either the same as that of the default face or
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1044 @code{nil} (meaning to inherit from the default).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1045 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1046
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1047 @defvar region-face
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1048 This variable's value specifies the face id to use to display characters
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1049 in the region when it is active (in Transient Mark mode only). The face
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1050 thus specified takes precedence over all faces that come from text
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1051 properties and overlays, for characters in the region. @xref{The Mark},
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1052 for more information about Transient Mark mode.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1053
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1054 Normally, the value is the id number of the face named @code{region}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1055 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1056
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1057 @node Blinking
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1058 @section Blinking Parentheses
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1059 @cindex parenthesis matching
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1060 @cindex blinking
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1061 @cindex balancing parentheses
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1062 @cindex close parenthesis
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1063
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1064 This section describes the mechanism by which Emacs shows a matching
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1065 open parenthesis when the user inserts a close parenthesis.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1066
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1067 @vindex blink-paren-hook
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1068 @defvar blink-paren-function
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1069 The value of this variable should be a function (of no arguments) to
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1070 be called whenever a character with close parenthesis syntax is inserted.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1071 The value of @code{blink-paren-function} may be @code{nil}, in which
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1072 case nothing is done.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1073
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1074 @quotation
7735
7db892210924 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7086
diff changeset
1075 @strong{Please note:} This variable was named @code{blink-paren-hook} in
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1076 older Emacs versions, but since it is not called with the standard
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1077 convention for hooks, it was renamed to @code{blink-paren-function} in
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1078 version 19.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1079 @end quotation
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1080 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1081
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1082 @defvar blink-matching-paren
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1083 If this variable is @code{nil}, then @code{blink-matching-open} does
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1084 nothing.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1085 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1086
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1087 @defvar blink-matching-paren-distance
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1088 This variable specifies the maximum distance to scan for a matching
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1089 parenthesis before giving up.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1090 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1091
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1092 @defvar blink-matching-paren-delay
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1093 This variable specifies the number of seconds for the cursor to remain
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1094 at the matching parenthesis. A fraction of a second often gives
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1095 good results, but the default is 1, which works on all systems.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1096 @end defvar
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1097
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1098 @defun blink-matching-open
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1099 This function is the default value of @code{blink-paren-function}. It
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1100 assumes that point follows a character with close parenthesis syntax and
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1101 moves the cursor momentarily to the matching opening character. If that
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1102 character is not already on the screen, it displays the character's
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1103 context in the echo area. To avoid long delays, this function does not
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1104 search farther than @code{blink-matching-paren-distance} characters.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1105
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1106 Here is an example of calling this function explicitly.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1107
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1108 @smallexample
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1109 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1110 (defun interactive-blink-matching-open ()
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1111 @c Do not break this line! -- rms.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1112 @c The first line of a doc string
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1113 @c must stand alone.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1114 "Indicate momentarily the start of sexp before point."
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1115 (interactive)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1116 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1117 @group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1118 (let ((blink-matching-paren-distance
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1119 (buffer-size))
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1120 (blink-matching-paren t))
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1121 (blink-matching-open)))
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1122 @end group
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1123 @end smallexample
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1124 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1125
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1126 @node Inverse Video
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1127 @section Inverse Video
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1128 @cindex Inverse Video
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1129
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1130 @defopt inverse-video
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1131 @cindex highlighting
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1132 This variable controls whether Emacs uses inverse video for all text
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1133 on the screen. Non-@code{nil} means yes, @code{nil} means no. The
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1134 default is @code{nil}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1135 @end defopt
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1136
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1137 @defopt mode-line-inverse-video
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1138 This variable controls the use of inverse video for mode lines. If it
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1139 is non-@code{nil}, then mode lines are displayed in inverse video.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1140 Otherwise, mode lines are displayed normally, just like text. The
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1141 default is @code{t}.
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1142
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1143 For X window frames, this displays mode lines using the face named
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1144 @code{modeline}, which is normally the inverse of the default face
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1145 unless you change it.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1146 @end defopt
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1147
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1148 @node Usual Display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1149 @section Usual Display Conventions
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1150
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1151 The usual display conventions define how to display each character
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1152 code. You can override these conventions by setting up a display table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1153 (@pxref{Display Tables}). Here are the usual display conventions:
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1154
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1155 @itemize @bullet
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1156 @item
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1157 Character codes 32 through 126 map to glyph codes 32 through 126.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1158 Normally this means they display as themselves.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1159
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1160 @item
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1161 Character code 9 is a horizontal tab. It displays as whitespace
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1162 up to a position determined by @code{tab-width}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1163
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1164 @item
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1165 Character code 10 is a newline.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1166
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1167 @item
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1168 All other codes in the range 0 through 31, and code 127, display in one
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
1169 of two ways according to the value of @code{ctl-arrow}. If it is
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1170 non-@code{nil}, these codes map to sequences of two glyphs, where the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1171 first glyph is the @sc{ASCII} code for @samp{^}. (A display table can
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1172 specify a glyph to use instead of @samp{^}.) Otherwise, these codes map
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1173 just like the codes in the range 128 to 255.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1174
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1175 @item
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1176 Character codes 128 through 255 map to sequences of four glyphs, where
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1177 the first glyph is the @sc{ASCII} code for @samp{\}, and the others are
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1178 digit characters representing the code in octal. (A display table can
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1179 specify a glyph to use instead of @samp{\}.)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1180 @end itemize
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1181
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1182 The usual display conventions apply even when there is a display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1183 table, for any character whose entry in the active display table is
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1184 @code{nil}. Thus, when you set up a display table, you need only
12098
a6eb5f12b0f3 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 12067
diff changeset
1185 specify the characters for which you want unusual behavior.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1186
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1187 These variables affect the way certain characters are displayed on the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1188 screen. Since they change the number of columns the characters occupy,
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1189 they also affect the indentation functions.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1190
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1191 @defopt ctl-arrow
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1192 @cindex control characters in display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1193 This buffer-local variable controls how control characters are
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1194 displayed. If it is non-@code{nil}, they are displayed as a caret
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1195 followed by the character: @samp{^A}. If it is @code{nil}, they are
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1196 displayed as a backslash followed by three octal digits: @samp{\001}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1197 @end defopt
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1198
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1199 @c Following may have overfull hbox.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1200 @defvar default-ctl-arrow
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1201 The value of this variable is the default value for @code{ctl-arrow} in
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1202 buffers that do not override it. @xref{Default Value}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1203 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1204
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1205 @defopt tab-width
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1206 The value of this variable is the spacing between tab stops used for
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1207 displaying tab characters in Emacs buffers. The default is 8. Note
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1208 that this feature is completely independent from the user-settable tab
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1209 stops used by the command @code{tab-to-tab-stop}. @xref{Indent Tabs}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1210 @end defopt
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1211
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1212 @node Display Tables
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1213 @section Display Tables
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1214
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1215 @cindex display table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1216 You can use the @dfn{display table} feature to control how all 256
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1217 possible character codes display on the screen. This is useful for
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1218 displaying European languages that have letters not in the @sc{ASCII}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1219 character set.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1220
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1221 The display table maps each character code into a sequence of
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1222 @dfn{glyphs}, each glyph being an image that takes up one character
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1223 position on the screen. You can also define how to display each glyph
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1224 on your terminal, using the @dfn{glyph table}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1225
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1226 @menu
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1227 * Display Table Format:: What a display table consists of.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1228 * Active Display Table:: How Emacs selects a display table to use.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1229 * Glyphs:: How to define a glyph, and what glyphs mean.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1230 * ISO Latin 1:: How to use display tables
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1231 to support the ISO Latin 1 character set.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1232 @end menu
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1233
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1234 @node Display Table Format
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1235 @subsection Display Table Format
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1236
8925
b05788fd41f0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 8096
diff changeset
1237 A display table is actually an array of 262 elements.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1238
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1239 @defun make-display-table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1240 This creates and returns a display table. The table initially has
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1241 @code{nil} in all elements.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1242 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1243
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1244 The first 256 elements correspond to character codes; the @var{n}th
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1245 element says how to display the character code @var{n}. The value
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1246 should be @code{nil} or a vector of glyph values (@pxref{Glyphs}). If
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1247 an element is @code{nil}, it says to display that character according to
12067
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
1248 the usual display conventions (@pxref{Usual Display}).
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
1249
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
1250 If you use the display table to change the display of newline
73dc8205d259 *** empty log message ***
Karl Heuer <kwzh@gnu.org>
parents: 10211
diff changeset
1251 characters, the whole buffer will be displayed as one long ``line.''
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1252
8925
b05788fd41f0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 8096
diff changeset
1253 The remaining six elements of a display table serve special purposes,
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1254 and @code{nil} means use the default stated below.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1255
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1256 @table @asis
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1257 @item 256
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1258 The glyph for the end of a truncated screen line (the default for this
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1259 is @samp{$}). @xref{Glyphs}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1260 @item 257
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1261 The glyph for the end of a continued line (the default is @samp{\}).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1262 @item 258
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1263 The glyph for indicating a character displayed as an octal character
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1264 code (the default is @samp{\}).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1265 @item 259
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1266 The glyph for indicating a control character (the default is @samp{^}).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1267 @item 260
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1268 A vector of glyphs for indicating the presence of invisible lines (the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1269 default is @samp{...}). @xref{Selective Display}.
8925
b05788fd41f0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 8096
diff changeset
1270 @item 261
b05788fd41f0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 8096
diff changeset
1271 The glyph used to draw the border between side-by-side windows (the
b05788fd41f0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 8096
diff changeset
1272 default is @samp{|}). @xref{Splitting Windows}.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1273 @end table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1274
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1275 For example, here is how to construct a display table that mimics the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1276 effect of setting @code{ctl-arrow} to a non-@code{nil} value:
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1277
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1278 @example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1279 (setq disptab (make-display-table))
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1280 (let ((i 0))
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1281 (while (< i 32)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1282 (or (= i ?\t) (= i ?\n)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1283 (aset disptab i (vector ?^ (+ i 64))))
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1284 (setq i (1+ i)))
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1285 (aset disptab 127 (vector ?^ ??)))
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1286 @end example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1287
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1288 @node Active Display Table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1289 @subsection Active Display Table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1290 @cindex active display table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1291
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1292 Each window can specify a display table, and so can each buffer. When
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1293 a buffer @var{b} is displayed in window @var{w}, display uses the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1294 display table for window @var{w} if it has one; otherwise, the display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1295 table for buffer @var{b} if it has one; otherwise, the standard display
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1296 table if any. The display table chosen is called the @dfn{active}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1297 display table.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1298
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1299 @defun window-display-table window
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1300 This function returns @var{window}'s display table, or @code{nil}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1301 if @var{window} does not have an assigned display table.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1302 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1303
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1304 @defun set-window-display-table window table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1305 This function sets the display table of @var{window} to @var{table}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1306 The argument @var{table} should be either a display table or
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1307 @code{nil}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1308 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1309
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1310 @defvar buffer-display-table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1311 This variable is automatically local in all buffers; its value in a
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1312 particular buffer is the display table for that buffer, or @code{nil} if
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1313 the buffer does not have an assigned display table.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1314 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1315
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1316 @defvar standard-display-table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1317 This variable's value is the default display table, used whenever a
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1318 window has no display table and neither does the buffer displayed in
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1319 that window. This variable is @code{nil} by default.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1320 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1321
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1322 If there is no display table to use for a particular window---that is,
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1323 if the window has none, its buffer has none, and
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1324 @code{standard-display-table} has none---then Emacs uses the usual
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1325 display conventions for all character codes in that window. @xref{Usual
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1326 Display}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1327
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1328 @node Glyphs
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1329 @subsection Glyphs
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1330
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1331 @cindex glyph
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1332 A @dfn{glyph} is a generalization of a character; it stands for an
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1333 image that takes up a single character position on the screen. Glyphs
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1334 are represented in Lisp as integers, just as characters are.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1335
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1336 @cindex glyph table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1337 The meaning of each integer, as a glyph, is defined by the glyph
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1338 table, which is the value of the variable @code{glyph-table}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1339
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1340 @defvar glyph-table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1341 The value of this variable is the current glyph table. It should be a
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1342 vector; the @var{g}th element defines glyph code @var{g}. If the value
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1343 is @code{nil} instead of a vector, then all glyphs are simple (see
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1344 below).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1345 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1346
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1347 Here are the possible types of elements in the glyph table:
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1348
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1349 @table @var
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1350 @item string
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1351 Send the characters in @var{string} to the terminal to output
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1352 this glyph. This alternative is available on character terminals,
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1353 but not under X.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1354
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1355 @item integer
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1356 Define this glyph code as an alias for code @var{integer}. You can use
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1357 an alias to specify a face code for the glyph; see below.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1358
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1359 @item @code{nil}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1360 This glyph is simple. On an ordinary terminal, the glyph code mod 256
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1361 is the character to output. With X, the glyph code mod 256 is the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1362 character to output, and the glyph code divided by 256 specifies the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1363 @dfn{face id number} to use while outputting it. @xref{Faces}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1364 @end table
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1365
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1366 If a glyph code is greater than or equal to the length of the glyph
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1367 table, that code is automatically simple.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1368
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1369 @node ISO Latin 1
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1370 @subsection ISO Latin 1
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1371
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1372 If you have a terminal that can handle the entire ISO Latin 1 character
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1373 set, you can arrange to use that character set as follows:
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1374
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1375 @example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1376 (require 'disp-table)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1377 ;; @r{Set char codes 160--255 to display as themselves.}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1378 ;; @r{(Codes 128--159 are the additional control characters.)}
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1379 (standard-display-8bit 160 255)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1380 @end example
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1381
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1382 If you are editing buffers written in the ISO Latin 1 character set and
9009
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
1383 your terminal doesn't handle anything but @sc{ASCII}, you can load the
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
1384 file @file{iso-ascii} to set up a display table that displays the other
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
1385 ISO characters as explanatory sequences of @sc{ASCII} characters. For
7cdfcd5e71ff entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 8925
diff changeset
1386 example, the character ``o with umlaut'' displays as @samp{@{"o@}}.
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1387
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1388 Some European countries have terminals that don't support ISO Latin 1
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1389 but do support the special characters for that country's language. You
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1390 can define a display table to work one language using such terminals.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1391 For an example, see @file{lisp/iso-swed.el}, which handles certain
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1392 Swedish terminals.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1393
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1394 You can load the appropriate display table for your terminal
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1395 automatically by writing a terminal-specific Lisp file for the terminal
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1396 type.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1397
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1398 @node Beeping
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1399 @section Beeping
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1400 @cindex beeping
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1401 @cindex bell
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1402
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1403 You can make Emacs ring a bell (or blink the screen) to attract the
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1404 user's attention. Be conservative about how often you do this; frequent
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1405 bells can become irritating. Also be careful not to use beeping alone
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1406 when signaling an error is appropriate. (@xref{Errors}.)
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1407
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1408 @defun ding &optional dont-terminate
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1409 @cindex keyboard macro termination
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1410 This function beeps, or flashes the screen (see @code{visible-bell} below).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1411 It also terminates any keyboard macro currently executing unless
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1412 @var{dont-terminate} is non-@code{nil}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1413 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1414
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1415 @defun beep &optional dont-terminate
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1416 This is a synonym for @code{ding}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1417 @end defun
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1418
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1419 @defvar visible-bell
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1420 This variable determines whether Emacs should flash the screen to
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1421 represent a bell. Non-@code{nil} means yes, @code{nil} means no. This
10211
0a84a40f16d5 Fix in visible-bell.
Richard M. Stallman <rms@gnu.org>
parents: 9009
diff changeset
1422 is effective under X windows, and on a character-only terminal provided
0a84a40f16d5 Fix in visible-bell.
Richard M. Stallman <rms@gnu.org>
parents: 9009
diff changeset
1423 the terminal's Termcap entry defines the visible bell capability
0a84a40f16d5 Fix in visible-bell.
Richard M. Stallman <rms@gnu.org>
parents: 9009
diff changeset
1424 (@samp{vb}).
6598
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1425 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1426
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1427 @node Window Systems
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1428 @section Window Systems
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1429
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1430 Emacs works with several window systems, most notably the X Window
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1431 System. Both Emacs and X use the term ``window'', but use it
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1432 differently. An Emacs frame is a single window as far as X is
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1433 concerned; the individual Emacs windows are not known to X at all.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1434
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1435 @defvar window-system
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1436 @cindex X Window System
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1437 This variable tells Lisp programs what window system Emacs is running
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1438 under. Its value should be a symbol such as @code{x} (if Emacs is
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1439 running under X) or @code{nil} (if Emacs is running on an ordinary
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1440 terminal).
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1441 @end defvar
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1442
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1443 @defvar window-setup-hook
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1444 This variable is a normal hook which Emacs runs after loading your
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1445 @file{.emacs} file and the default initialization file (if any), after
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1446 loading terminal-specific Lisp code, and after running the hook
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1447 @code{term-setup-hook}.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1448
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1449 This hook is used for internal purposes: setting up communication with
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1450 the window system, and creating the initial window. Users should not
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1451 interfere with it.
db2685239be9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1452 @end defvar