|
From: | Kevin Rodgers |
Subject: | Re: setnu.el / setnu+.el |
Date: | Tue, 27 Dec 2005 10:01:01 -0700 |
User-agent: | Mozilla Thunderbird 0.9 (X11/20041105) |
Stefan Monnier wrote:
Instead of setting the overlay's before-string property to "...", I tried setting its display property to ((margin left-margin) "...") plus the left-margin-width variable to the length of "...".Yes, the use of the display property for such uses is somewhat odd: you have to use a (dummy) before-string (or after-string) property on an overlay and place the `display' property on that string. The dummy string should have length >= 1. Typically the code looks something like: (let ((ol (make-overlay start end))) ;; start can be equal to end if you want (overlay-put ol 'before-string (propertize " " 'display <the intersting stuff>))) See for instance the code of put-image.
Yes, the way put-image works is well-documented, in both its doc string and the Emacs Lisp manual. But the fact that the display property doesn't work unless it's a text property of an overlay's before- or after-string is not documented. That the display property doesn't work as expected seems to me to be a bug, and it's definitely a documentation bug that the way to get it to work is only described in regards to the put-image function. Thanks, -- Kevin
[Prev in Thread] | Current Thread | [Next in Thread] |