[Top][All Lists]

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

Re: Info mutilates user overlays.

From: Luc Teirlinck
Subject: Re: Info mutilates user overlays.
Date: Wed, 1 Oct 2003 16:11:11 -0500 (CDT)

Stefan Monnier wrote:

   Please: *how* do you highlight ?
   Did you create some commands similar to what is available under M-g
   but using overlays, or do you add the overlay from a hook, or ...

The user would use some interactive command, say 
`M-x scan-buf-char-property-regions', or a key sequence bound to it.
I have a command `scan-buf-update-char-region-overlays' that updates
_all_ highlighting produced by the previous and similar commands, in
the accessible portion of the current buffer.  (Except that I still
have to make the updating work better for narrowed buffers with
different pieces highlighted differently.)  Maybe just adding the
updating command to the right hook might solve the problem.  I will
take a look whether any hook is automatically called in the given
situation.  Otherwise, the user could call the updating command, if he
wants the highlighting restored.

I keep track of the overlays by giving them a "private"
'scan-buf-char-property-regions property, so I know which overlays
were made by the function and I can delete them as necessary.

The highlighting is actually _meant_ to be temporary (to get an idea
of which text properties are present in the buffer), but it is
somewhat inconvenient if it disappears after, say, quickly following a
reference and then a quick `l' to get back.  As I said though,
updating everything is convenient for the user and could be made
automatic using some hook.

I could set a timer, but in read-only buffers that would lead to a lot
of completely needless deletion and re-creation of overlays, generating
garbage to be collected and it will normally be obvious to the user
when the buffer has changed and needs to be updated.



reply via email to

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