unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Jean-Christophe Helary <brandelune@gmail.com>,
	help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: RE: tutorial on faces ?
Date: Thu, 7 Feb 2019 07:44:03 -0800 (PST)	[thread overview]
Message-ID: <a6a3c03f-6aad-46ee-88b9-25bbdbf9639f@default> (raw)
In-Reply-To: <79C3F1E3-45E2-4A59-8AFF-1134F66EB66C@gmail.com>

> >>> And do you want the face highlighting to be
> >>>  automatically reapplied to those parts when
> >>>  the same text is visited anew (in the same
> >>>  mode), e.g. in a new Emacs session or after
> >>>  reverting the buffer?
> >>
> >> I'm not sure I understand the question.
> >
> > Do you want the highlighting to be inherently
> > associated with particular patterns, so that
> > whenever a buffer with those patterns is visited
> > in a particular mode the patterns get highlighted.
> 
> Yes. But I'm not sure I can call (my tweaked) poker.el a "mode". It is
> just a program that outputs strings based on inputs in a dedicated buffer.

The buffer is in a (major) mode.  You typically
define font-lock patterns for a given mode.
You can define your own major mode using
`define-derived-mode'.

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.
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.



  reply	other threads:[~2019-02-07 15:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 13:38 tutorial on faces ? Jean-Christophe Helary
2019-02-06 15:22 ` Drew Adams
2019-02-06 15:32   ` Jean-Christophe Helary
2019-02-06 16:45     ` Drew Adams
2019-02-07  5:47       ` Jean-Christophe Helary
2019-02-07 15:04         ` Drew Adams
2019-02-07 15:15           ` Jean-Christophe Helary
2019-02-07 15:44             ` Drew Adams [this message]
2019-02-07 15:58               ` Jean-Christophe Helary
2019-02-07 17:54                 ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=a6a3c03f-6aad-46ee-88b9-25bbdbf9639f@default \
    --to=drew.adams@oracle.com \
    --cc=brandelune@gmail.com \
    --cc=help-gnu-emacs@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).