all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: Emacs-Devel <emacs-devel@gnu.org>
Subject: Re: how to prevent font-lock from messing with a portion of text?
Date: Fri, 23 Mar 2007 18:31:09 +0100	[thread overview]
Message-ID: <46040EDD.8070908@gmail.com> (raw)
In-Reply-To: <EIENLHALHGIMHGDOLMIMCEBEDAAA.drew.adams@oracle.com>

Drew Adams wrote:

> Wrt Lennart's suggestion, BTW: I want to be able to also remove the
> highlighting and then have font-lock treat that text normally again. So,
> nothing that permanently prevents font-lock from fontifying the text would
> be useful here.

I understand that my suggestion does not fit your needs now, but it is 
quite easy to let font-lock take over the fontifying again.


> As a simple example, imagine that you want to be able to use `M-o o'
> (facemenu-set-face) on some text in a font-locked buffer. Currently, `M-o o'
> just tells you that "Font-lock mode will override any faces you set in this
> buffer" - IOW, you're SOL. If you want to see your highlighting, you must
> turn off font-lock. Instead of punting this way, `M-o o' could do what's
> needed to prevent font-lock from interfering - that is, from changing the
> facemenu highlighting.

To do that kind of thing you want you have to change 
font-lock-fontify-region function. However that will not work for all 
modes, only those that uses this. So at the moment you really can not do it.

To temporary set a face like you want to do I think you need to use 
overlays.


> BTW, the doc does not explain anywhere (that I've found) just how the
> activation of `font-lock-face' is controlled by `font-lock-mode'. It says
> only that the mode toggles the activation of the property.

It seems to me that there are indeed things missing in the manual.

  reply	other threads:[~2007-03-23 17:31 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) [this message]
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
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

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

  git send-email \
    --in-reply-to=46040EDD.8070908@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /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.