From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: feature request: text property to prevent font-locking Date: Sun, 31 Aug 2014 21:43:24 +0000 Message-ID: <20140831214324.GB4401@acm.acm> References: <20140830092701.GA3351@acm.acm> <34f3e246-bbfb-4864-83e9-4a0c81d4202e@default> <0f746243-e04c-4d07-ace8-2e54625aaffc@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1409521750 14516 80.91.229.3 (31 Aug 2014 21:49:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Aug 2014 21:49:10 +0000 (UTC) Cc: Drew Adams , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 31 23:49:03 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 1XOCze-0008Ke-9t for ged-emacs-devel@m.gmane.org; Sun, 31 Aug 2014 23:49:02 +0200 Original-Received: from localhost ([::1]:51141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOCzd-0000Ua-Sv for ged-emacs-devel@m.gmane.org; Sun, 31 Aug 2014 17:49:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOCzN-0000UQ-KO for emacs-devel@gnu.org; Sun, 31 Aug 2014 17:48:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOCzI-00074O-3G for emacs-devel@gnu.org; Sun, 31 Aug 2014 17:48:45 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:48153 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOCzH-000746-PG for emacs-devel@gnu.org; Sun, 31 Aug 2014 17:48:40 -0400 Original-Received: (qmail 21305 invoked by uid 3782); 31 Aug 2014 21:48:37 -0000 Original-Received: from acm.muc.de (pD951A53F.dip0.t-ipconnect.de [217.81.165.63]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 31 Aug 2014 23:48:36 +0200 Original-Received: (qmail 6590 invoked by uid 1000); 31 Aug 2014 21:43:24 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 193.149.48.1 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:173936 Archived-At: Hi, All. On Sun, Aug 31, 2014 at 03:57:14PM -0400, Stefan Monnier wrote: > >> By, the way, these kinds of problems are the reason why I suggested > >> adding "planes" to text-properties. > >> It should be relatively easy to implement. > > Sorry, that's too vague for me. But I guess it further confirms that > > I am not missing something simple. > > I suggested that there be several planes of properties, so font-lock > would place its properties in the plane `font-lock' while other packages > can use their own plane. Then you'd separately specify rules for how to > merge the various planes (with rules that can be distinct for each kind > of property). > The merge of properties would not take place during redisplay but > instead would take place when the properties are added/removed. > > > Stefan > I think you mean this: ######################################################################### From: Stefan Monnier To: emacs-devel@gnu.org Date: Mon, 04 Oct 2010 01:37:26 +0200 Subject: Re: Combining face and map stuff > Which reminds me of another thing. I would like to define some > commands > local to a region, which can be done with 'local-map in overlays or > 'keymap in text properties. But can I combine them, too, in possibly > overlapping regions, and get the aggregate keymap? Here's an idea with which I've beeing toying: - rather than have just one set of text-properties per char, make it possible to have several. E.g. font-lock would use its own set of text properties. One way to do that is that a `property' can now be a cons whose car is a "plane" and whose cdr is a property. So for example, the special font-lock-face (which currently gets "mapped" to face' via char-property-alias-alist) would just be `face' because font-lock would use (font-lock . face). A property like `face' would really be equivalent to (nil . face). - then you add property-specific merge functions. I.e. when looking up `face' you'd get the merge of all the `face' properties of the various text-property planes. You'd probably want those merge functions to be written in Elisp and customizable. So merging `keymap' properties becomes easy (well, it may benefit from multiple-keymap inheritance, which is a completely different topic). - now font-lock can erase all the properties of the `font-lock' plane without worrying about erasing properties installed by other packages. - to avoid calling Elisp code to merge things during text-property lookups, the merge would take place in put-text-property (i.e. no need to change the redisplay code at all). - modifying a plane other than the default (nil) one could be considered as "not modifying the buffer" (just like adding/removing overlays). - we could obsolete char-property-alias-alist which is only ever used by/for font-lock-face. - maybe outline-minor-mode could use text-properties rather than overlays to make text invisible (tho it would make it impossible(?) to use outline-minor-mode in an indirect buffer without affecting the base buffer and the other indirect buffers). So it might reduce the need for overlays (which have the disadvantage of being algorithmically slow/costly). Stefan ######################################################################### This might be "relatively simple" to implement, but relative to what, I'm not sure. ;-) -- Alan Mackenzie (Nuremberg, Germany).