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)
...)
category
overlay property is that it causes the value of symbol properties to become properties of an overlay. – Gilles 'SO- stop being evil' Nov 01 '20 at 11:50category
and its use of a symbol and its properties. You might consider putting some such info into the answer itself. Just a suggestion. (+1 for the answer, though.) – Drew Nov 01 '20 at 18:21