Download GNU Emacs Manual

Transcript
Chapter 11: Emacs Display
134
before-string
This property’s value is a string to add to the display at the beginning of the
overlay. The string does not appear in the buffer in any sense—only on the
screen.
after-string
This property’s value is a string to add to the display at the end of the overlay.
The string does not appear in the buffer in any sense—only on the screen.
line-prefix
This property specifies a display spec to prepend to each non-continuation line
at display-time. See Section 11.3 [Truncation], page 112.
wrap-prefix
This property specifies a display spec to prepend to each continuation line at
display-time. See Section 11.3 [Truncation], page 112.
evaporate
If this property is non-nil, the overlay is deleted automatically if it becomes
empty (i.e., if its length becomes zero). If you give an empty overlay a non-nil
evaporate property, that deletes it immediately.
local-map
If this property is non-nil, it specifies a keymap for a portion of the text. The
property’s value replaces the buffer’s local map, when the character after point
is within the overlay. See hundefinedi [Active Keymaps], page hundefinedi.
keymap
The keymap property is similar to local-map but overrides the buffer’s local
map (and the map specified by the local-map property) rather than replacing
it.
The local-map and keymap properties do not affect a string displayed by the beforestring, after-string, or display properties. This is only relevant for mouse clicks and
other mouse events that fall on the string, since point is never on the string. To bind
special mouse events for the string, assign it a local-map or keymap text property. See
Section 22.19.4 [Special Properties], page 494.
11.9.3 Searching for Overlays
overlays-at pos
[Function]
This function returns a list of all the overlays that cover the character at position pos
in the current buffer. The list is in no particular order. An overlay contains position
pos if it begins at or before pos, and ends after pos.
To illustrate usage, here is a Lisp function that returns a list of the overlays that
specify property prop for the character at point:
(defun find-overlays-specifying (prop)
(let ((overlays (overlays-at (point)))
found)
(while overlays
(let ((overlay (car overlays)))
(if (overlay-get overlay prop)
(setq found (cons overlay found))))
(setq overlays (cdr overlays)))
found))