emacs-devel
[Top][All Lists]
Advanced

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

How to avoid put-text-property setting buffer modified flag, and messing


From: Wojciech Meyer
Subject: How to avoid put-text-property setting buffer modified flag, and messing with the undo history?
Date: Tue, 07 Jun 2011 00:12:36 +0100

Hi,

I'm trying to dynamically color the buffer using text properties. It
works as follows:

1. I send modified buffer contents to the inferior process

2. Along with the contents I send the location information, what portion
of the buffer has been modified, e.g. for the first time I send whole
buffer and notify the inferior process that whole buffer shall be
invalidated.

3. After that inferior process sends back, syntax information in form of
pair range of characters and type of associated token.

4. Since the inferior process uses specials way of parsing (packrat) it
is efficient way of extracting it, and there is no real latency.

5. The language I am writing mode for allows complete redefinition of
syntax, and modifying it on the fly, so I can't use any of the
conventional ways, or even LALR parsing provided by CEDET is not enough
as it can only can approximate the base syntax, and it will not cope
well with this language.

6. For coloring I use text properties, but they change buffer marking it
as modified and altering undo information, and I don't want that.

How would you implement desired behaviour? How to efficiently workaround
this problem? Is there any other way to change faces of the buffer?
Would overlays be a solution?

Thank you,
Wojciech



reply via email to

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