From: Amos Bird <amosbird@gmail.com>
Cc: help-gnu-emacs@gnu.org
Date: Mon, 23 Oct 2017 01:07:04 +0800
Hi, could you show the elisp code that resolves this? I don't
quite understand how to give a distinct face.
Here, this simple variation of your original recipe will display
the
string in the margin using the 'default' face:
(set-window-margins (get-buffer-window) 20 0)
(setq ovstring (propertize "Hi, there!" 'face 'default))
<<<<<<<<<<<<<<<
(overlay-put (make-overlay (point) (point)) 'before-string
(propertize "."
'display
`((margin left-margin) ,ovstring)))
(hl-line-mode)
The line marked with "<<<<<" is the main part of the solution.