Use put
to set a property of a symbol. Use get
to retrieve one property and symbol-plist
to retrieve them all. The properties of a symbol are an attribute of it, parallel to its value as a variable (symbol-value
) and its function definition (symbol-function
).
For example, the following snippet causes overlay
to be shown in the default face, but in bold italic when the mouse cursor is over it, because the mouse-face
property of the category applies but the face
property of the category is overridden by the same property on the overlay itself.
(put 'my-category 'face 'bold)
(put 'my-category 'mouse-face 'bold-italic)
(let ((overlay (make-overlay (point) (1+ (point)))))
(overlay-put overlay 'category 'my-category)
(overlay-put overlay 'face 'default)
...)