Next: , Previous: , Up: Display   [Contents][Index]


52.5 Invisible Text

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 extent.

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 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.

Variable: buffer-invisibility-spec

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.

a list

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 property value is atom or if it is a list with atom as a member.

(atom . t)

A character is invisible if its invisible property 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. Since this causes a slow-down of these commands it is turned off by default, controlled by the variable line-move-ignore-invisible.


Next: , Previous: , Up: Display   [Contents][Index]