all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wojciech Meyer <wojciech.meyer@googlemail.com>
To: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <871uz6h7vf.fsf@gmail.com> (raw)


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	other threads:[~2011-06-06 23:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06 23:12 Wojciech Meyer [this message]
2011-06-06 23:18 ` How to avoid put-text-property setting buffer modified flag, and messing with the undo history? Lennart Borgman
2011-06-09 14:15 ` Ehud Karni
2011-06-09 15:33   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871uz6h7vf.fsf@gmail.com \
    --to=wojciech.meyer@googlemail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.