help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: tutorial on faces ?


From: Drew Adams
Subject: RE: tutorial on faces ?
Date: Thu, 7 Feb 2019 09:54:49 -0800 (PST)

> > I probably should have mentioned this: To highlight
> > parts of a string is one thing - use `propertize'
> > with property `face', for example.
> >
> > To highlight parts of a buffer is something else.
> 
> How is that something else ?

See my previous mails.  Read about font lock.  Look
at some existing code that uses it.

Buffers are not strings.  They don't behave the same
and they're not used the same.  Buffers have a (major)
mode.  Buffers are displayed and redisplayed.

A string is a string.  A message displays a string,
typically ephemerally.  The echo area and minibuffer
are not used like other buffers; in particular, you
typically do not try to use font lock there.

> > You typically use font lock for this.  Font lock
> > periodically updates the highlighting, even as
> > you change buffer contents.  It applies a set of
> > highlighting rules (regexp patterns, for example),
> > in sequence.
> 
> Isn't it something you'd always want ?

See above.  Read more about font lock, and maybe
read more about buffers and strings.

And look at existing code that (1) uses font lock
and (2) uses `message' with propertized strings.



reply via email to

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