From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wojciech Meyer Newsgroups: gmane.emacs.devel 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 Message-ID: <871uz6h7vf.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1307402002 2165 80.91.229.12 (6 Jun 2011 23:13:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2011 23:13:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 07 01:13:18 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QTiyy-0007vd-MJ for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2011 01:13:16 +0200 Original-Received: from localhost ([::1]:51622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTiyx-0006uW-1A for ged-emacs-devel@m.gmane.org; Mon, 06 Jun 2011 19:13:15 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTiyV-0006rr-0S for emacs-devel@gnu.org; Mon, 06 Jun 2011 19:12:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QTiyR-00029y-Vy for emacs-devel@gnu.org; Mon, 06 Jun 2011 19:12:46 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:61516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTiyR-00029J-59 for emacs-devel@gnu.org; Mon, 06 Jun 2011 19:12:43 -0400 Original-Received: by wyf19 with SMTP id 19so3967776wyf.0 for ; Mon, 06 Jun 2011 16:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:from:to:subject:date:message-id:mime-version :content-type; bh=JcPs6MMV+YNUKnZU09c2laGHWtu7ptEqBsvELV7UFbE=; b=gHfR0n0jVPZDFGcqrheuOPVZX2H+qZLbSYOCWbWIihqnFl3R3mzNXxjXba6Q1MmSMj DP0QUv+S1numDFhShZiUsFLExlWP8ShoC/oPlTuJzHQwUxkGcSg9fA1tLuDFVY8+Zg4d aXUzCe8V0FrFx8MYP6mME+HrCk6ckl/8CQnWI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type; b=veeHm03rDlFLks+f+sn0eGgGyGxfTnNksI3HXr7gkYbiUjBkSYbTnfbnDmWVRzWAzK +YzugH/xj0gwWdzmbec5DvrgLeF6q66qQJY5wUdt+r8TFIgRB/+0uancj4kUHRPkaECB fCoMsSLOCpWtI1X1tRknYeTzFdJ/yRpAVxgxI= Original-Received: by 10.227.209.205 with SMTP id gh13mr5501648wbb.47.1307401961492; Mon, 06 Jun 2011 16:12:41 -0700 (PDT) Original-Received: from spec-desktop.danmey.org (cpc1-cmbg12-0-0-cust201.5-4.cable.virginmedia.com [86.9.116.202]) by mx.google.com with ESMTPS id fl19sm1295765wbb.32.2011.06.06.16.12.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2011 16:12:40 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:140247 Archived-At: 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