[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This chapter describes a number of other features related to the display that XEmacs presents to the user.
1.1 Refreshing the Screen | Clearing the screen and redrawing everything on it. | |
1.2 Truncation | Folding or wrapping long text lines. | |
1.3 The Echo Area | Where messages are displayed. | |
1.4 Invisible Text | Hiding part of the buffer text. | |
1.5 Selective Display | Hiding part of the buffer text (the old way). | |
1.6 The Overlay Arrow | Display of an arrow to indicate position. | |
1.7 Temporary Displays | Displays that go away automatically. | |
1.8 Blinking Parentheses | How XEmacs shows the matching open parenthesis. | |
1.9 Usual Display Conventions | The usual conventions for displaying nonprinting chars. | |
1.10 Display Tables | How to specify other conventions. | |
1.11 Beeping | Audible signal to the user. |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The function redraw-frame
redisplays the entire contents of a
given frame. @xref{Frames}.
This function clears and redisplays frame frame.
Even more powerful is redraw-display
:
This function redraws all frames on device marked as having their
image garbled. device defaults to the selected device. If
device is t
, all devices will have their frames checked.
Processing user input takes absolute priority over redisplay. If you call these functions when input is available, they do nothing immediately, but a full redisplay does happen eventually—after all the input has been processed.
Normally, suspending and resuming XEmacs also refreshes the screen. Some terminal emulators record separate contents for display-oriented programs such as XEmacs and for ordinary sequential display. If you are using such a terminal, you might want to inhibit the redisplay on resumption. @xref{Suspending XEmacs}.
This variable controls whether XEmacs redraws the entire screen after it
has been suspended and resumed. Non-nil
means yes, nil
means no.
The above functions do not actually cause the display to be updated;
rather, they clear out the internal display records that XEmacs
maintains, so that the next time the display is updated it will be
redrawn from scratch. Normally this occurs the next time that
next-event
or sit-for
is called; however, a display update
will not occur if there is input pending. @xref{Command Loop}.
This function causes an immediate update of the display in all circumstances, whether or not input is pending. (This function does not exist in FSF Emacs.)
This function causes an immediate update of the cursor on the selected frame. (This function does not exist in FSF Emacs.)
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When a line of text extends beyond the right edge of a window, the line can either be truncated or continued on the next line. When a line is truncated, this is normally shown with a ‘\’ in the rightmost column of the window on X displays, and with a ‘$’ on TTY devices. When a line is continued or “wrapped” onto the next line, this is shown with a curved arrow in the rightmost column of the window (or with a ‘\’ on TTY devices). The additional screen lines used to display a long text line are called continuation lines.
Normally, whenever line truncation is in effect for a particular window, a horizontal scrollbar is displayed in that window if the device supports scrollbars. @xref{Scrollbars}.
Note that continuation is different from filling; continuation happens on the screen only, not in the buffer contents, and it breaks a line precisely at the right margin, not at a word boundary. @xref{Filling}.
This buffer-local variable controls how XEmacs displays lines that
extend beyond the right edge of the window. If it is non-nil
,
then XEmacs does not display continuation lines; rather each line of
text occupies exactly one screen line, and a backslash appears at the
edge of any line that extends to or beyond the edge of the window. The
default is nil
.
If the variable truncate-partial-width-windows
is non-nil
,
then truncation is always used for side-by-side windows (within one
frame) regardless of the value of truncate-lines
.
This variable is the default value for truncate-lines
, for
buffers that do not have local values for it.
This variable controls display of lines that extend beyond the right
edge of the window, in side-by-side windows (@pxref{Splitting Windows}).
If it is non-nil
, these lines are truncated; otherwise,
truncate-lines
says what to do with them.
The backslash and curved arrow used to indicate truncated or continued lines are only defaults, and can be changed. These images are actually glyphs (@pxref{Glyphs}). XEmacs provides a great deal of flexibility in how glyphs can be controlled. (This differs from FSF Emacs, which uses display tables to control these images.)
This variable holds the glyph that is displayed at the end of truncated lines.
This variable holds the glyphs that is displayed at the end of wrapped lines.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The echo area is used for displaying messages made with the
message
primitive, and for echoing keystrokes. It is not the
same as the minibuffer, despite the fact that the minibuffer appears
(when active) in the same place on the screen as the echo area. The
XEmacs Reference Manual specifies the rules for resolving conflicts
between the echo area and the minibuffer for use of that screen space
(see The Minibuffer in The XEmacs Reference Manual).
Error messages appear in the echo area; see @ref{Errors}.
You can write output in the echo area by using the Lisp printing
functions with t
as the stream (@pxref{Output Functions}), or as
follows:
This function displays a one-line message in the echo area. The
argument string is similar to a C language printf
control
string. See format
in @ref{String Conversion}, for the details
on the conversion specifications. message
returns the
constructed string.
In batch mode, message
prints the message text on the standard
error stream, followed by a newline.
If string is nil
, message
clears the echo area. If
the minibuffer is active, this brings the minibuffer contents back onto
the screen immediately.
(message "Minibuffer depth is %d." (minibuffer-depth)) -| Minibuffer depth is 0. ⇒ "Minibuffer depth is 0."
---------- Echo Area ---------- Minibuffer depth is 0. ---------- Echo Area ----------
Almost all the messages displayed in the echo area are also recorded in the ‘*Messages*’ buffer.
This variable specifies how many lines to keep in the ‘*Messages*’
buffer. The value t
means there is no limit on how many lines to
keep. The value nil
disables message logging entirely. Here’s
how to display a message and prevent it from being logged:
(let (message-log-max) (message …))
This variable determines how much time should elapse before command characters echo. Its value must be an integer, which specifies the number of seconds to wait before echoing. If the user types a prefix key (such as C-x) and then delays this many seconds before continuing, the prefix key is echoed in the echo area. Any subsequent characters in the same command will be echoed as well.
If the value is zero, then command input is not echoed.
This variable controls where the cursor appears when a message is
displayed in the echo area. If it is non-nil
, then the cursor
appears at the end of the message. Otherwise, the cursor appears at
point—not in the echo area at all.
The value is normally nil
; Lisp programs bind it to t
for brief periods of time.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can make characters invisible, so that they do not appear on
the screen, with the invisible
property. This can be either a
text property or a property of an overlay.
In the simplest case, any non-nil
invisible
property makes
a character invisible. This is the default case—if you don’t alter
the default value of buffer-invisibility-spec
, this is how the
invisibility
property works. This feature is much like selective
display (see section Selective Display), but more general and cleaner.
More generally, you can use the variable buffer-invisibility-spec
to control which values of the invisible
property make text
invisible. This permits you to classify the text into different subsets
in advance, by giving them different invisible
values, and
subsequently make various subsets visible or invisible by changing the
value of buffer-invisibility-spec
.
Controlling visibility with buffer-invisibility-spec
is
especially useful in a program to display the list of entries in a data
base. It permits the implementation of convenient filtering commands to
view just a part of the entries in the data base. Setting this variable
is very fast, much faster than scanning all the text in the buffer
looking for properties to change.
This variable specifies which kinds of invisible
properties
actually make a character invisible.
t
A character is invisible if its invisible
property is
non-nil
. This is the default.
Each element of the list makes certain characters invisible. Ultimately, a character is invisible if any of the elements of this list applies to it. The list can have two kinds of elements:
atom
A character is invisible if its invisible
propery value
is atom or if it is a list with atom as a member.
(atom . t)
A character is invisible if its invisible
propery value
is atom or if it is a list with atom as a member.
Moreover, if this character is at the end of a line and is followed
by a visible newline, it displays an ellipsis.
Ordinarily, commands that operate on text or move point do not care whether the text is invisible. However, the user-level line motion commands explicitly ignore invisible newlines.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Selective display is a pair of features that hide certain lines on the screen.
The first variant, explicit selective display, is designed for use in a Lisp program. The program controls which lines are hidden by altering the text. Outline mode has traditionally used this variant. It has been partially replaced by the invisible text feature (see section Invisible Text); there is a new version of Outline mode which uses that instead.
In the second variant, the choice of lines to hide is made automatically based on indentation. This variant is designed to be a user-level feature.
The way you control explicit selective display is by replacing a newline (control-j) with a carriage return (control-m). The text that was formerly a line following that newline is now invisible. Strictly speaking, it is temporarily no longer a line at all, since only newlines can separate lines; it is now part of the previous line.
Selective display does not directly affect editing commands. For
example, C-f (forward-char
) moves point unhesitatingly into
invisible text. However, the replacement of newline characters with
carriage return characters affects some editing commands. For example,
next-line
skips invisible lines, since it searches only for
newlines. Modes that use selective display can also define commands
that take account of the newlines, or that make parts of the text
visible or invisible.
When you write a selectively displayed buffer into a file, all the control-m’s are output as newlines. This means that when you next read in the file, it looks OK, with nothing invisible. The selective display effect is seen only within XEmacs.
This buffer-local variable enables selective display. This means that lines, or portions of lines, may be made invisible.
selective-display
is t
, then any portion
of a line that follows a control-m is not displayed.
selective-display
is a positive integer, then
lines that start with more than that many columns of indentation are not
displayed.
When some portion of a buffer is invisible, the vertical movement
commands operate as if that portion did not exist, allowing a single
next-line
command to skip any number of invisible lines.
However, character movement commands (such as forward-char
) do
not skip the invisible portion, and it is possible (if tricky) to insert
or delete text in an invisible portion.
In the examples below, we show the display appearance of the
buffer foo
, which changes with the value of
selective-display
. The contents of the buffer do not
change.
(setq selective-display nil) ⇒ nil ---------- Buffer: foo ---------- 1 on this column 2on this column 3n this column 3n this column 2on this column 1 on this column ---------- Buffer: foo ----------
(setq selective-display 2) ⇒ 2 ---------- Buffer: foo ---------- 1 on this column 2on this column 2on this column 1 on this column ---------- Buffer: foo ----------
If this buffer-local variable is non-nil
, then XEmacs displays
‘…’ at the end of a line that is followed by invisible text.
This example is a continuation of the previous one.
(setq selective-display-ellipses t) ⇒ t ---------- Buffer: foo ---------- 1 on this column 2on this column ... 2on this column 1 on this column ---------- Buffer: foo ----------
You can use a display table to substitute other text for the ellipsis (‘…’). See section Display Tables.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The overlay arrow is useful for directing the user’s attention to a particular line in a buffer. For example, in the modes used for interface to debuggers, the overlay arrow indicates the line of code about to be executed.
This variable holds the string to display to call attention to a
particular line, or nil
if the arrow feature is not in use.
Despite its name, the value of this variable can be either a string
or a glyph (@pxref{Glyphs}).
This variable holds a marker that indicates where to display the overlay arrow. It should point at the beginning of a line. The arrow text appears at the beginning of that line, overlaying any text that would otherwise appear. Since the arrow is usually short, and the line usually begins with indentation, normally nothing significant is overwritten.
The overlay string is displayed only in the buffer that this marker points into. Thus, only one buffer can have an overlay arrow at any given time.
You can do the same job by creating an extent with a
begin-glyph
property. @xref{Extent Properties}.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Temporary displays are used by commands to put output into a buffer and then present it to the user for perusal rather than for editing. Many of the help commands use this feature.
This function executes forms while arranging to insert any output they print into the buffer named buffer-name. The buffer is then shown in some window for viewing, displayed but not selected.
The string buffer-name specifies the temporary buffer, which
need not already exist. The argument must be a string, not a buffer.
The buffer is erased initially (with no questions asked), and it is
marked as unmodified after with-output-to-temp-buffer
exits.
with-output-to-temp-buffer
binds standard-output
to the
temporary buffer, then it evaluates the forms in forms. Output
using the Lisp output functions within forms goes by default to
that buffer (but screen display and messages in the echo area, although
they are “output” in the general sense of the word, are not affected).
@xref{Output Functions}.
The value of the last form in forms is returned.
---------- Buffer: foo ---------- This is the contents of foo. ---------- Buffer: foo ----------
(with-output-to-temp-buffer "foo" (print 20) (print standard-output)) ⇒ #<buffer foo> ---------- Buffer: foo ---------- 20 #<buffer foo> ---------- Buffer: foo ----------
If this variable is non-nil
, with-output-to-temp-buffer
calls it as a function to do the job of displaying a help buffer. The
function gets one argument, which is the buffer it should display.
In Emacs versions 18 and earlier, this variable was called
temp-buffer-show-hook
.
This function momentarily displays string in the current buffer at position. It has no effect on the undo list or on the buffer’s modification status.
The momentary display remains until the next input event. If the next
input event is char, momentary-string-display
ignores it
and returns. Otherwise, that event remains buffered for subsequent use
as input. Thus, typing char will simply remove the string from
the display, while typing (say) C-f will remove the string from
the display and later (presumably) move point forward. The argument
char is a space by default.
The return value of momentary-string-display
is not meaningful.
You can do the same job in a more general way by creating an extent with a begin-glyph property. @xref{Extent Properties}.
If message is non-nil
, it is displayed in the echo area
while string is displayed in the buffer. If it is nil
, a
default message says to type char to continue.
In this example, point is initially located at the beginning of the second line:
---------- Buffer: foo ---------- This is the contents of foo. ∗Second line. ---------- Buffer: foo ----------
(momentary-string-display "**** Important Message! ****" (point) ?\r "Type RET when done reading") ⇒ t
---------- Buffer: foo ---------- This is the contents of foo. **** Important Message! ****Second line. ---------- Buffer: foo ---------- ---------- Echo Area ---------- Type RET when done reading ---------- Echo Area ----------
This function works by actually changing the text in the buffer. As a result, if you later undo in this buffer, you will see the message come and go.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes the mechanism by which XEmacs shows a matching open parenthesis when the user inserts a close parenthesis.
The value of this variable should be a function (of no arguments) to
be called whenever a character with close parenthesis syntax is inserted.
The value of blink-paren-function
may be nil
, in which
case nothing is done.
Please note: This variable was named
blink-paren-hook
in older Emacs versions, but since it is not called with the standard convention for hooks, it was renamed toblink-paren-function
in version 19.
If this variable is nil
, then blink-matching-open
does
nothing.
This variable specifies the maximum distance to scan for a matching parenthesis before giving up.
This variable specifies the number of seconds for the cursor to remain at the matching parenthesis. A fraction of a second often gives good results, but the default is 1, which works on all systems.
This function is the default value of blink-paren-function
. It
assumes that point follows a character with close parenthesis syntax and
moves the cursor momentarily to the matching opening character. If that
character is not already on the screen, it displays the character’s
context in the echo area. To avoid long delays, this function does not
search farther than blink-matching-paren-distance
characters.
Here is an example of calling this function explicitly.
(defun interactive-blink-matching-open () "Indicate momentarily the start of sexp before point." (interactive)
(let ((blink-matching-paren-distance (buffer-size)) (blink-matching-paren t)) (blink-matching-open)))
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The usual display conventions define how to display each character code. You can override these conventions by setting up a display table (see section Display Tables). Here are the usual display conventions:
tab-width
.
ctl-arrow
. If it is
non-nil
, these codes map to sequences of two glyphs, where the
first glyph is the ASCII code for ‘^’. (A display table can
specify a glyph to use instead of ‘^’.) Otherwise, these codes map
just like the codes in the range 128 to 255.
The usual display conventions apply even when there is a display
table, for any character whose entry in the active display table is
nil
. Thus, when you set up a display table, you need only
specify the characters for which you want unusual behavior.
These variables affect the way certain characters are displayed on the screen. Since they change the number of columns the characters occupy, they also affect the indentation functions.
This buffer-local variable controls how control characters are
displayed. If it is non-nil
, they are displayed as a caret
followed by the character: ‘^A’. If it is nil
, they are
displayed as a backslash followed by three octal digits: ‘\001’.
The value of this variable is the default value for ctl-arrow
in
buffers that do not override it. @xref{Default Value}.
The value of this variable is the spacing between tab stops used for
displaying tab characters in Emacs buffers. The default is 8. Note
that this feature is completely independent from the user-settable tab
stops used by the command tab-to-tab-stop
. @xref{Indent Tabs}.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can use the display table feature to control how all 256 possible character codes display on the screen. This is useful for displaying European languages that have letters not in the ASCII character set.
The display table maps each character code into a sequence of runes, each rune being an image that takes up one character position on the screen. You can also define how to display each rune on your terminal, using the rune table.
1.10.1 Display Table Format | What a display table consists of. | |
1.10.2 Active Display Table | How XEmacs selects a display table to use. | |
1.10.3 Character Descriptors | Format of an individual element of a display table. |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A display table is an array of 256 elements. (In FSF Emacs, a display
table is 262 elements. The six extra elements specify the truncation
and continuation glyphs, etc. This method is very kludgey, and in
XEmacs the variables truncation-glyph
, continuation-glyph
,
etc. are used. See section Truncation.)
This creates and returns a display table. The table initially has
nil
in all elements.
The 256 elements correspond to character codes; the nth
element says how to display the character code n. The value
should be nil
, a string, a glyph, or a vector of strings and
glyphs (see section Character Descriptors). If an element is nil
,
it says to display that character according to the usual display
conventions (see section Usual Display Conventions).
If you use the display table to change the display of newline characters, the whole buffer will be displayed as one long “line.”
For example, here is how to construct a display table that mimics the
effect of setting ctl-arrow
to a non-nil
value:
(setq disptab (make-display-table)) (let ((i 0)) (while (< i 32) (or (= i ?\t) (= i ?\n) (aset disptab i (concat "^" (char-to-string (+ i 64))))) (setq i (1+ i))) (aset disptab 127 "^?"))
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The active display table is controlled by the variable
current-display-table
. This is a specifier, which means
that you can specify separate values for it in individual buffers,
windows, frames, and devices, as well as a global value. It also
means that you cannot set this variable using setq
; use
set-specifier
instead. @xref{Specifiers}. (FSF Emacs
uses window-display-table
, buffer-display-table
,
standard-display-table
, etc. to control the display table.
However, specifiers are a cleaner and more powerful way of doing
the same thing. FSF Emacs also uses a different format for
the contents of a display table, using additional indirection
to a “glyph table” and such. Note that “glyph” has a different
meaning in XEmacs.)
Individual faces can also specify an overriding display table;
this is set using set-face-display-table
. @xref{Faces}.
If no display table can be determined for a particular window, then XEmacs uses the usual display conventions. See section Usual Display Conventions.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Each element of the display-table vector describes how to display a particular character and is called a character descriptor. A character descriptor can be:
Display this particular string wherever the character is to be displayed.
Display this particular glyph wherever the character is to be displayed.
The vector may contain strings and/or glyphs. Display the elements of the vector one after another wherever the character is to be displayed.
nil
Display according to the standard interpretation (see section Usual Display Conventions).
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can make XEmacs ring a bell, play a sound, or blink the screen to attract the user’s attention. Be conservative about how often you do this; frequent bells can become irritating. Also be careful not to use beeping alone when signaling an error is appropriate. (@xref{Errors}.)
This function beeps, or flashes the screen (see visible-bell
below). It also terminates any keyboard macro currently executing
unless dont-terminate is non-nil
. If sound is
specified, it should be a symbol specifying which sound to make. This
sound will be played if visible-bell
is nil
. (This only
works if sound support was compiled into the executable and you are
running on the console of a Sun SparcStation, SGI, or HP9000s700.
Otherwise you just get a beep.) The optional third argument specifies
what device to make the sound on, and defaults to the selected device.
This is a synonym for ding
.
This variable determines whether XEmacs should flash the screen to
represent a bell. Non-nil
means yes, nil
means no. On
TTY devices, this is effective only if the Termcap entry for the
terminal type has the visible bell flag (‘vb’) set.
This variable holds an alist associating names with sounds. When
beep
or ding
is called with one of the name symbols, the
associated sound will be generated instead of the standard beep.
Each element of sound-alist
is a list describing a sound. The
first element of the list is the name of the sound being defined.
Subsequent elements of the list are alternating keyword/value pairs:
sound
A string of raw sound data, or the name of another sound to play. The
symbol t
here means use the default X beep.
volume
An integer from 0-100, defaulting to bell-volume
.
pitch
If using the default X beep, the pitch (Hz) to generate.
duration
If using the default X beep, the duration (milliseconds).
For compatibility, elements of ‘sound-alist’ may also be:
( sound-name . <sound> )
( sound-name <volume> <sound> )
You should probably add things to this list by calling the function
load-sound-file
.
Caveats:
The following beep-types are used by XEmacs itself:
auto-save-error
when an auto-save does not succeed
command-error
when the XEmacs command loop catches an error
undefined-key
when you type a key that is undefined
undefined-click
when you use an undefined mouse-click combination
no-completion
during completing-read
y-or-n-p
when you type something other than ’y’ or ’n’
yes-or-no-p
when you type something other than ’yes’ or ’no’
default
used when nothing else is appropriate.
Other lisp packages may use other beep types, but these are the ones that the C kernel of XEmacs uses.
This variable specifies the default volume for sounds, from 0 to 100.
This function loads and installs some sound files as beep-types.
This function reads in an audio file and adds it to sound-alist
.
The sound file must be in the Sun/NeXT U-LAW format. sound-name
should be a symbol, specifying the name of the sound. If volume
is specified, the sound will be played at that volume; otherwise, the
value of bell-volume will be used.
This function plays sound sound, which should be a symbol
mentioned in sound-alist
. If volume is specified, it
overrides the value (if any) specified in sound-alist
.
device specifies the device to play the sound on, and defaults
to the selected device.
This function plays the named sound file at volume volume, which
defaults to bell-volume
. device specifies the device to
play the sound on, and defaults to the selected device.
[Top] | [Contents] | [Index] | [ ? ] |
This document was generated on December 6, 2024 using texi2html 5.0.
The buttons in the navigation panels have the following meaning:
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ << ] | FastBack | Beginning of this chapter or previous chapter | 1 |
[ < ] | Back | Previous section in reading order | 1.2.2 |
[ Up ] | Up | Up section | 1.2 |
[ > ] | Forward | Next section in reading order | 1.2.4 |
[ >> ] | FastForward | Next chapter | 2 |
[Top] | Top | Cover (top) of document | |
[Contents] | Contents | Table of contents | |
[Index] | Index | Index | |
[ ? ] | About | About (help) |
where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:
This document was generated on December 6, 2024 using texi2html 5.0.