Here is a table of text property names that have special built-in meanings. The following sections list a few additional special property names that control filling and property inheritance. All other names have no standard meaning, and you can use them as you like.
Note: the properties
intangible can also cause point to move to
an acceptable place, after each Emacs command. See Adjusting Point.
categoryproperty, we call it the property category of the character. It should be a symbol. The properties of this symbol serve as defaults for the properties of the character.
faceto control the font and color of text. See Faces, for more information.
In the simplest case, the value is a face name. It can also be a list; then each element can be any of these possibilities;
). These are old, deprecated equivalents for
). Please convert code that uses them.
It works to use the latter two forms directly as the value
Font Lock mode (see Font Lock Mode) works in most buffers by
dynamically updating the
face property of characters based on
font-lock-faceproperty is equivalent to the
faceproperty when Font Lock mode is enabled. When Font Lock mode is disabled,
font-lock-facehas no effect.
font-lock-face property is useful for special modes that
implement their own highlighting. See Precalculated Fontification.
mouse-faceis used instead of
facewhen the mouse is on or near the character. For this purpose, “near” means that all text between the character and where the mouse is have the same
nil, Emacs's redisplay routine calls the functions in
fontification-functions(see Auto Faces) to prepare this part of the buffer before it is displayed. It is used internally by the “just in time” font locking code.
help-echoproperty, then when you move the mouse onto that text, Emacs displays that string in the echo area, or in the tooltip window (see Tooltips).
If the value of the
help-echo property is a function, that
function is called with three arguments, window, object and
pos and should return a help string or
none. The first argument, window is the window in which
the help was found. The second, object, is the buffer, overlay or
string which had the
help-echo property. The pos
argument is as follows:
help-echoproperty, and pos is the position in the overlay's buffer.
displayproperty), pos is the position in that string.
If the value of the
help-echo property is neither a function nor
a string, it is evaluated to obtain a help string.
You can alter the way help text is displayed by setting the variable
show-help-function (see Help display).
This feature is used in the mode line and for other active text.
keymapproperty specifies an additional keymap for commands. When this keymap applies, it is used for key lookup before the minor mode keymaps and before the buffer's local map. See Active Keymaps. If the property value is a symbol, the symbol's function definition is used as the keymap.
The property's value for the character before point applies if it is
nil and rear-sticky, and the property's value for the
character after point applies if it is non-
front-sticky. (For mouse clicks, the position of the click is used
instead of the position of point.)
keymapexcept that it specifies a keymap to use instead of the buffer's local map. For most purposes (perhaps all purposes), it is better to use the
syntax-tableproperty overrides what the syntax table says about this particular character. See Syntax Properties.
read-only, then modifying that character is not allowed. Any command that would do so gets an error,
text-read-only. If the property value is a string, that string is used as the error message.
Insertion next to a read-only character is an error if inserting
ordinary text there would inherit the
read-only property due to
stickiness. Thus, you can control permission to insert next to
read-only text by controlling the stickiness. See Sticky Properties.
Since changing properties counts as modifying the buffer, it is not
possible to remove a
read-only property unless you know the
special trick: bind
inhibit-read-only to a non-
and then remove the property. See Read Only Buffers.
invisibleproperty can make a character invisible on the screen. See Invisible Text, for details.
intangibleproperties, then you cannot place point between them. If you try to move point forward into the group, point actually moves to the end of the group. If you try to move point backward into the group, point actually moves to the start of the group.
If consecutive characters have unequal non-
intangible properties, they belong to separate groups; each
group is separately treated as described above.
When the variable
inhibit-point-motion-hooks is non-
intangible property is ignored.
fieldproperty constitute a field. Some motion functions including
beginning-of-linestop moving at a field boundary. See Fields.
cursortext property. In addition, if the value of the
cursorproperty of an overlay string is an integer number, it specifies the number of buffer's character positions associated with the overlay string; this way, Emacs will display the cursor on the character with that property regardless of whether the current buffer position is actually covered by the overlay. Specifically, if the value of the
cursorproperty of a character is the number n, the cursor will be displayed on this character for any buffer position in the range
], where ovpos is the starting buffer position covered by the overlay (see Managing Overlays).
line-spacingtext or overlay property that controls the height of the display line ending with that newline. The property value overrides the default frame line spacing and the buffer local
line-spacingvariable. See Line Height.
line-heighttext or overlay property that controls the total height of the display line ending in that newline. See Line Height.
wrap-prefixproperty, the prefix it defines will be added at display-time to the beginning of every continuation line due to text wrapping (so if lines are truncated, the wrap-prefix is never used). It may be a string, an image, or a stretch-glyph such as used by the
displaytext-property. See Display Property.
A wrap-prefix may also be specified for an entire buffer using the
wrap-prefix buffer-local variable (however, a
wrap-prefix text-property takes precedence over the value of
wrap-prefix variable). See Truncation.
line-prefixproperty, the prefix it defines will be added at display-time to the beginning of every non-continuation line. It may be a string, an image, or a stretch-glyph such as used by the
displaytext-property. See Display Property.
A line-prefix may also be specified for an entire buffer using the
line-prefix buffer-local variable (however, a
line-prefix text-property takes precedence over the value of
line-prefix variable). See Truncation.
modification-hooks, then its value should be a list of functions; modifying that character calls all of those functions. Each function receives two arguments: the beginning and end of the part of the buffer being modified. Note that if a particular modification hook function appears on several characters being modified by a single primitive, you can't predict how many times the function will be called.
If these functions modify the buffer, they should bind
t around doing so, to
avoid confusing the internal mechanism that calls these hooks.
Overlays also support the
modification-hooks property, but the
details are somewhat different (see Overlay Properties).
insert-in-front-hooksproperty of the following character and in the
insert-behind-hooksproperty of the preceding character. These functions receive two arguments, the beginning and end of the inserted text. The functions are called after the actual insertion takes place.
See also Change Hooks, for other hooks that are called
when you change text in a buffer.
point-leftrecord hook functions that report motion of point. Each time point moves, Emacs compares these two property values:
point-leftproperty of the character after the old location, and
point-enteredproperty of the character after the new location.
If these two values differ, each of them is called (if not
with two arguments: the old value of point, and the new one.
The same comparison is made for the characters before the old and new
locations. The result may be to execute two
(which may be the same function) and/or two
functions (which may be the same function). In any case, all the
point-left functions are called first, followed by all the
It is possible with
char-after to examine characters at various
buffer positions without moving point to those positions. Only an
actual change in the value of point runs these hook functions.
When this variable is non-
point-enteredhooks are not run, and the
intangibleproperty has no effect. Do not set this variable globally; bind it with
If this variable is non-
nil, it specifies a function called to display help strings. These may be
help-echoproperties, menu help strings (see Simple Menu Items, see Extended Menu Items), or tool bar help strings (see Tool Bar). The specified function is called with one argument, the help string to display. Tooltip mode (see Tooltips) provides an example.