all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Drew Adams <drew.adams@oracle.com>, emacs-devel@gnu.org
Subject: Re: feature request: text property to prevent font-locking
Date: Sun, 31 Aug 2014 21:43:24 +0000	[thread overview]
Message-ID: <20140831214324.GB4401@acm.acm> (raw)
In-Reply-To: <jwvbnr0igfr.fsf-monnier+emacs@gnu.org>

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 <monnier@iro.umontreal.ca>
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).



  parent reply	other threads:[~2014-08-31 21:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 21:18 feature request: text property to prevent font-locking Drew Adams
2014-08-30  9:27 ` Alan Mackenzie
2014-08-30 20:15   ` Drew Adams
2014-08-30 21:34     ` Thien-Thi Nguyen
2014-08-31  6:06       ` Drew Adams
2014-08-31 16:11         ` Drew Adams
2014-08-31 12:40     ` Stefan Monnier
2014-08-31 15:30       ` Drew Adams
2014-08-31 19:57         ` Stefan Monnier
2014-08-31 21:07           ` Drew Adams
2014-08-31 21:43           ` Alan Mackenzie [this message]
2014-09-01  1:37             ` Stephen J. Turnbull
2014-09-01 20:45               ` Stefan Monnier
2014-09-02  2:02                 ` Stephen J. Turnbull
2014-09-02  2:33                 ` Richard Stallman
2014-09-02  6:04                   ` David Kastrup
2014-08-31 14:31 ` Wolfgang Jenkner
2014-08-31 16:03   ` Drew Adams

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=20140831214324.GB4401@acm.acm \
    --to=acm@muc.de \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.