[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Overlay before-string property
From: |
David Kastrup |
Subject: |
Re: Overlay before-string property |
Date: |
Sun, 01 Oct 2006 08:34:22 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
"Drew Adams" <address@hidden> writes:
> > I use this, from Miles Bader's minibuf-depth.el (or whatever
> > it's called now):
> >
> > ;; This function goes on minibuffer-setup-hook
> > (defun minibuf-depth-setup-minibuffer ()
> > "Set up a minibuffer for `minibuffer-indicate-depth-mode'.
> > The prompt should already have been inserted."
> > (when (> (minibuffer-depth) 1)
> > (setq minibuf-depth-overlay
> > (make-overlay (point-min) (1+ (point-min))))
> > (overlay-put minibuf-depth-overlay 'before-string
> > (format "%d) " (minibuffer-depth)))
> > (overlay-put minibuf-depth-overlay 'evaporate t)))
> >
> > Does this have something to do with text-property stickiness? I have
> > not knowingly changed any sticky properties, and the manual seems to
> > say that text is, by default, only rear sticky. The behavior seems
> > to be as if the prompt-string text were front-sticky and the overlay
> > were rear-sticky, IIUC.
>
> You could read the DOC string of make-overlay. It has optional
> arguments.
>
> Thanks, but I don't see how that helps. Perhaps I'm misreading it or
> the text has changed since July (my build), however. It speaks of
> FRONT-ADVANCE and REAR-ADVANCE, but I don't see how that would be
> related to property stickiness. The manual says about the same thing
> as the doc string.
It is related to stickiness, but your description indeed made me do a
wrong guess. This has nothing to do with stickiness, it simply has to
do with the overlay _covering_ the character in question. Use
(make-overlay (point-min) (point-min))
instead. It may be necessary to ise the 'display instead of the
'before-string property for this to work; I don't remember the
details.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum