[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How can I remove effects of text properties in 'before-string
From: |
Eli Zaretskii |
Subject: |
Re: How can I remove effects of text properties in 'before-string |
Date: |
Sun, 22 Oct 2017 20:15:37 +0300 |
> 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.
Re: How can I remove effects of text properties in 'before-string, Emanuel Berg, 2017/10/22