unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Miles Bader" <miles@gnu.org>,
	"Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: Emacs-Devel <emacs-devel@gnu.org>
Subject: RE: how to prevent font-lock from messing with a portion of text?
Date: Mon, 26 Mar 2007 08:56:59 -0700	[thread overview]
Message-ID: <BDEIJAFNGDOAGCJIPKPBAEICCDAA.drew.adams@oracle.com> (raw)
In-Reply-To: <87odmgrv96.fsf@catnip.gol.com>

> > OK, here's another option: don't change anything to font-lock,
> > don't fiddle with it at all, just don't use text-properties to
> > add your special faces. Use overlays instead.
>
> Typical "highlighter" applications seem a bit more suited to overlays
> anyway (e.g., if I copy the text, I don't really expect the highlighting
> to come along...).

You know, you need not read my posts, but if you don't read them, then you
need not reply to them either.

I explicitly stated that my own highlighting library lets you use either
overlays or text properties, and that using overlays is the default
behavior.

Text properties and overlays act differently, and there can be advantages to
each in different contexts. One is not a replacement for the other, whether
for "typical" highlighting or anything else.

> I suppose if there's some reason to use text-properties, "hi-lock.el"
> (in the distribution) could be used as an example of one way to do that.
> [It actually _uses_ font-lock to do the highlighting which seems fairly
> clever -- e.g., if you type more text after having highlighted a phrase,
> the phrase gets automagically highlighted in the new text too!]

I'm well aware of hi-lock, and I use it. There are advantages and
disadvantage to tying user highlighting to the font-lock mechanism. With it,
you cannot view the highlighting without font-lock-mode being on. Here is
one comparison of some different highlighting approaches:
http://www.emacswiki.org/cgi-bin/wiki/HighlightTemporarily.

Nothing wrong with hi-lock. Nothing wrong with facemenu. Different
approaches have different advantages. Why not let highlighting approaches,
such as facemenu, that use the `face' text property independently of whether
font-lock highlighting is on, be able to prevent font lock from erasing
their highlighting?

  reply	other threads:[~2007-03-26 15:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22 16:56 how to prevent font-lock from messing with a portion of text? Drew Adams
2007-03-22 18:35 ` Stefan Monnier
2007-03-22 19:20   ` Drew Adams
2007-03-22 20:09     ` Lennart Borgman (gmail)
2007-03-22 20:49       ` Drew Adams
2007-03-22 21:40         ` Lennart Borgman (gmail)
2007-03-22 21:57     ` Miles Bader
2007-03-23 16:07     ` Stefan Monnier
2007-03-23 17:13       ` Drew Adams
2007-03-23 17:31         ` Lennart Borgman (gmail)
2007-03-23 22:36         ` Stefan Monnier
2007-03-24  1:33           ` Drew Adams
2007-03-24  1:57             ` Lennart Borgman (gmail)
2007-03-24  4:21               ` Stefan Monnier
2007-03-24  8:20                 ` Lennart Borgman (gmail)
2007-03-25  3:11                   ` Stefan Monnier
2007-03-25  3:31                     ` Lennart Borgman (gmail)
2007-03-24  4:20             ` Stefan Monnier
2007-03-26  1:48               ` Drew Adams
2007-03-26  1:59                 ` Lennart Borgman (gmail)
2007-03-26  5:52                   ` Drew Adams
2007-03-26  8:47                     ` Lennart Borgman (gmail)
2007-03-26 14:49                       ` Drew Adams
2007-03-26 13:01                 ` Stefan Monnier
2007-03-26 13:26                   ` Miles Bader
2007-03-26 15:56                     ` Drew Adams [this message]
2007-03-26 15:56                   ` Drew Adams
2007-03-26 19:11                     ` Stefan Monnier
2007-03-26 20:14                       ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BDEIJAFNGDOAGCJIPKPBAEICCDAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=miles@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).