emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to prevent font-lock from messing with a portion of text?


From: Lennart Borgman (gmail)
Subject: Re: how to prevent font-lock from messing with a portion of text?
Date: Thu, 22 Mar 2007 22:40:08 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

Drew Adams wrote:
Did you try using something like the defmacro `save-buffer-state' that you can find in font-lock.el?

I don't see the connection.


It was merely a guess from my side. I thought that something in the fontification framework was started by the changes you made when you set the face.

Maybe I am also misunderstanding what you are trying to do. However I tried this:

- emacs -Q
- I opened a html file.
- M-x html-mode
- Did some small changes to modify the buffer
- Then I called the function below

 (defun test-mode-face()
  (interactive)
  (my-save-buffer-state nil
      (put-text-property 5 15 'face 'highlight)))

Now the buffer had the face above from 5 - 15. Then I did C-x C-s. That face remained.

If I remove my-save-buffer-state above I never see that highlight face.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]