From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: trunk r116426: * lisp/jit-lock.el (jit-lock-mode): Keep it disabled in indirect buffers. Date: Fri, 23 May 2014 09:27:35 -0400 Message-ID: References: <87k39ee7qm.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1400851679 8838 80.91.229.3 (23 May 2014 13:27:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 May 2014 13:27:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Vitalie Spinu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 23 15:27:53 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WnpVp-0000BS-1h for ged-emacs-devel@m.gmane.org; Fri, 23 May 2014 15:27:53 +0200 Original-Received: from localhost ([::1]:43089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnpVo-0005dM-8Y for ged-emacs-devel@m.gmane.org; Fri, 23 May 2014 09:27:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnpVf-0005dF-Jd for emacs-devel@gnu.org; Fri, 23 May 2014 09:27:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnpVY-0002E8-L3 for emacs-devel@gnu.org; Fri, 23 May 2014 09:27:43 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:45122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnpVY-0002Dr-HT for emacs-devel@gnu.org; Fri, 23 May 2014 09:27:36 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVPO+KQe/2dsb2JhbABZgwY7gw/APYEXF3SCJQEBAQECAVYjBQsLNBIUGA0kiAQIDdIMEwSOegeEOASpGYFqgXGBWyE X-IPAS-Result: ArYGAIDvNVPO+KQe/2dsb2JhbABZgwY7gw/APYEXF3SCJQEBAQECAVYjBQsLNBIUGA0kiAQIDdIMEwSOegeEOASpGYFqgXGBWyE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="63854184" Original-Received: from 206-248-164-30.dsl.teksavvy.com (HELO pastel.home) ([206.248.164.30]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 23 May 2014 09:27:35 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 29443600B0; Fri, 23 May 2014 09:27:35 -0400 (EDT) In-Reply-To: <87k39ee7qm.fsf@gmail.com> (Vitalie Spinu's message of "Wed, 21 May 2014 21:51:29 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:172040 Archived-At: > Waste of time or not, it has been done: https://github.com/vitoshka/polymode How 'bout we add it to GNU ELPA? > Only recently I found time to finish the design, but then discovered > that jit-lock was removed. I am piggybacking on jit-lock and its removal > is a real bad luck. The last thing I need right now is to re-implement > jit-lock in indirect buffers. jit-lock support was broken. So if you want it back, we need to fix it. The problem is simple: jit-lock relies on the `fontified' text-property to decide what needs to be (re)fontified. And like all text-properties, this property is shared between the base buffer and the indirect buffers. So when jit-lock is triggered it has to refontify in all buffers that share the same base buffer. And if font-lock is activated in several buffers which share the same base buffer, they'll fight over their shared `face' text-property. A related issue is that after/before-change-functions are currently only run in the current-buffer, even though the changes affect all buffers which share the same base-buffer. I think the right fix is to change the C code such that fontification-functions and after/before-change-functions are always obeyed only in the base buffer. I.e. when displaying an indirect buffer, we'd check the fontification-functions of the base buffer and run jit-lock in that base-buffer. When making changes in an indirect buffer, we'd check after/before-change-functions in the base buffer and run them there. Do you think you could try to write such a patch? Stefan