The documentation for the 'cursor
overlay property does not discuss methods for altering the type of cursor that is used when point is on a particular overlay: https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html The default overlay cursor type is hollow
.
Is there a way for a user to select the type of cursor that is displayed when point is on a particular overlay? E.g., box
; bar
; (bar . [WIDTH])
; hbar
; (hbar . [WIDTH])
The following example creates an overlay using an xpm image at the end of the current line, which requires an Emacs version that supports xpm images. The test was performed with a default Emacs installation -- i.e., a white buffer background and a black cursor color -- the hollow cursor outline can be easily seen in this example.
(let ((xpm--pilcrow
(propertize " " 'cursor t 'display
`(image :type xpm :mask nil :ascent center :data
"/* XPM */
static char * pilcrow_plain_xpm[] = {
\"11 20 2 1\",
\". c white\",
\"+ c cyan\",
\"...........\",
\"...........\",
\"...........\",
\"...........\",
\"...++++++..\",
\"..++++.+...\",
\"..++++.+...\",
\"..++++.+...\",
\"...+++.+...\",
\".....+.+...\",
\".....+.+...\",
\".....+.+...\",
\".....+.+...\",
\".....+.+...\",
\"...........\",
\"...........\",
\"...........\",
\"...........\",
\"...........\",
\"...........\"};"))))
(overlay-put (make-overlay (point-at-eol) (point-at-eol)) 'after-string xpm--pilcrow))
cursor
property alters that at all since the manual is speaking of completely different behaviour compared to the docstring ofcursor-type
.