emacs-devel
[Top][All Lists]
Advanced

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

RE: feature request: text property to prevent font-locking


From: Drew Adams
Subject: RE: feature request: text property to prevent font-locking
Date: Sat, 30 Aug 2014 23:06:56 -0700 (PDT)

>    But since your reply is the only one so far, Alan, I conclude
>    so far that there is no special interest in this -the problem
>    or the proposed solution.
> 
> Maybe it takes a while for answers to arrive.

Yes, maybe. That's why I called the conclusion tentative ("so far").

> As you point out, font-lock must self-gate in some manner,
> especially to avoid doing useless re-work.  Have you looked at
> the source?  A brief dive shows me that
> 
>  ‘font-lock-mode’ docstring mentions
>  ‘font-lock-fontify-buffer’ which calls
>  ‘font-lock-fontify-buffer-function’ which has the value
>  ‘jit-lock-refontify’ (for me), which calls
>  ‘put-text-property’ w/
>  property name ‘fontified’ and
>  property value ‘nil’
> 
> suggesting that property ‘fontified’ w/ non-‘nil’ value is what
> jit-lock must do as testimony of its work.  Now, that took all of
> two minutes.  The next twenty or two-hundred (if i were lucky
> enough to have them available) would be to understand what
> weirdness must mar this simple model.  Maybe you can do that?

I did look into that in the past (and again before my OP message).
And I did try simply setting `fontified' to non-nil, with no luck.

It's quite possible I am missing something simple, which is why
I asked about that.  I still would like to hear that that is the
case, and how.

> Regardless, i like the straightforward ‘font-lock-ignore’ method
> you demo.  It would be nice to have that level of friendliness in
> Emacs (and documented!).

Seems simple to me too.  But maybe there is something simpler
and already available.  After all, font lock was not added
yesterday.  And surely people have tried to use ad hoc
highlighting in a font-locked buffer.

If nothing else, they must have tried `facemenu-set-face'
(`M-o o') and `facemenu-add-face', which are about as old as
font-lock.  But maybe they tried and just gave up when they saw
the unfriendly message "Font-lock mode will override any faces
you set in this buffer", as if that were the final (discouraging)
word.

In any case, it is not the final word.  With the patch I sent
(bug #18367), font-lock no longer prevents you from using `M-o o'
etc.  (If the patch is accepted then that message should of
course be removed.)

That message's presence is another thing that gives me the
impression that I am maybe not missing something: if there were
already a simple way to stop font-lock from overriding facemenu
highlighting then why would we warn people that it does override
it?  Why wouldn't the `facemenu.el' code just DTRT and stop
font-lock's king-of-the-sandbox bullying ;-) for the space of
facemenu's ad hoc highlighting?



reply via email to

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