From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: How to avoid put-text-property setting buffer modified flag, and messing with the undo history? Date: Tue, 7 Jun 2011 01:18:13 +0200 Message-ID: References: <871uz6h7vf.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1307404282 12839 80.91.229.12 (6 Jun 2011 23:51:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2011 23:51:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Wojciech Meyer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 07 01:51: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 1QTjZm-0003Go-5p for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2011 01:51:18 +0200 Original-Received: from localhost ([::1]:46494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTjZl-0006Ho-Be for ged-emacs-devel@m.gmane.org; Mon, 06 Jun 2011 19:51:17 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTj48-0008Lk-PQ for emacs-devel@gnu.org; Mon, 06 Jun 2011 19:18:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QTj47-00035E-9s for emacs-devel@gnu.org; Mon, 06 Jun 2011 19:18:36 -0400 Original-Received: from mail-ey0-f169.google.com ([209.85.215.169]:52516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTj47-00034z-0k for emacs-devel@gnu.org; Mon, 06 Jun 2011 19:18:35 -0400 Original-Received: by eyd9 with SMTP id 9so1753409eyd.0 for ; Mon, 06 Jun 2011 16:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=orvMM28B/gwoPdTsZlGNoLZ93Ic1RjSiVykQXQbNyL4=; b=P/pgmD+DIXgFbpHV/y0Slxf0M2vafgfNDWCcLEXf0fVHd5G42XXL+14wXAqTD1LbcP nbS5n3Xn+xYGZpcra6Hf/TYaZ5QpgEIreCVRQAstoEIUlVqOe8gpQbOeXViEUIik8FIF St371YCxkC2/eL9sPqKTWtZIyC6dk2BeZPy/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=d6MPDFZ6gpcNwuo0VFB5K0C5jKEhNHRY9IiL98ZHKHvrbtvazwFkcZ5X7ClF+qwxVQ rRk4K/d1rTnJzN2YaPVlFKtFVSSuf3nU/f10yShrKmUFAySO5ThvITpm/bQ3ZdP5dof6 hYg7d44eiHyMDceTZXNIQO9vh+GkHIDShLP+k= Original-Received: by 10.213.19.18 with SMTP id y18mr2000422eba.60.1307402313196; Mon, 06 Jun 2011 16:18:33 -0700 (PDT) Original-Received: by 10.213.16.135 with HTTP; Mon, 6 Jun 2011 16:18:13 -0700 (PDT) In-Reply-To: <871uz6h7vf.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.215.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:140249 Archived-At: On Tue, Jun 7, 2011 at 01:12, Wojciech Meyer wrote: > > 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? Please see with-silent-modifications.