[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Overlay before-string property

From: Drew Adams
Subject: RE: Overlay before-string property
Date: Sat, 30 Sep 2006 23:55:54 -0700

    >     > 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

OK, so it seems that is another way to change Miles's code to not get the
face bleeding (or overlay covering or whatever you want to call it, since it
is apparently not stickiness).

The questions I posed are these:

1) Should such a change be made to the Emacs code (Miles's code, which is
likely to be added to Emacs), to prevent this face bleeding? Or is there a
good reason why it is written that way?

2) If that code should remain as it is, is there another way to get the
effect I want (no bleeding), without changing the function definition? IOW,
how can a user prevent the bleeding, without rewriting the function (either
as you suggested or as Stefan suggested)?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]