emacs-devel
[Top][All Lists]
Advanced

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

Re: "Font-lock is limited to text matching" is a myth


From: Stephen J. Turnbull
Subject: Re: "Font-lock is limited to text matching" is a myth
Date: Wed, 12 Aug 2009 00:56:43 +0900

Trimming the CC list, which may be getting close to Mailman's
limit for potential spam....

Miles Bader writes:

 > > I've had the same thought. Just as in aside, overlays seem like a much
 > > better conceptual fit for fontification than text properties do.
 > 
 > Why?

To me, in theory, to the extent that "fontification" means "syntax
highlighting", syntax is almost entirely about position in the token
stream, rather than the text composing the token (even keywords, which
in many languages are a syntax error if they are in the wrong
position).  So, for a very silly example, I could copy the "for" from
a buffer containing a python program "for x in interator:" to the
first "for" in this sentence, and I really don't want the highlighting
coming along with it.  The highlighting should stay where it is, eg if
I substitute "while" for "for".

In practice, this only ever bothers me with Gnus, when I cut and paste
from a Gnus buffer to a message buffer.  (I told you the example was
silly!)  Also, if I use something like pending-delete mode, select a
"for" keyword and overwrite it with "while", for example, IIRC text
properties happen to DTRT.

 > [Aside from the "changing text-properties affect buffer-modified status"

*boggle*





reply via email to

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