all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How can I make emacs rendering engine highlight a string of characters ?
@ 2007-10-20 16:02 gnuist006
  2007-10-20 17:21 ` How can I make emacs rendering engine highlight a string ofcharacters ? Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gnuist006 @ 2007-10-20 16:02 UTC (permalink / raw)
  To: help-gnu-emacs

How can I make emacs rendering engine highlight a string of
characters ? What are the emacs primitives to highlight, italicize,
bold-font, or such ? Is it correct that the text file is pure text and
emacs renders it according to the settings of its rendering engine? So
what are the primitives of this rendering engine ? Where do we find
other types of primitives ? These primitives are separate from the
lisp portion and they are probably what one would call the graphics
part of the emacs software.

Thanks a lot to the stars who can explain.

gnuist

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: How can I make emacs rendering engine highlight a string ofcharacters ?
  2007-10-20 16:02 How can I make emacs rendering engine highlight a string of characters ? gnuist006
@ 2007-10-20 17:21 ` Drew Adams
  2007-10-20 17:52 ` How can I make emacs rendering engine highlight a string of characters ? Bastien
  2007-10-21  5:59 ` Daniel Pittman
  2 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2007-10-20 17:21 UTC (permalink / raw)
  To: gnuist006, help-gnu-emacs

> How can I make emacs rendering engine highlight a string of
> characters ? What are the emacs primitives to highlight, italicize,
> bold-font, or such ? Is it correct that the text file is pure text and
> emacs renders it according to the settings of its rendering engine? So
> what are the primitives of this rendering engine ? Where do we find
> other types of primitives ? These primitives are separate from the
> lisp portion and they are probably what one would call the graphics
> part of the emacs software.
>
> Thanks a lot to the stars who can explain.

GNU Emacs uses *faces* to highlight text. A face has various attributes such
as foreground and background color, font family, slant (e.g. italic), and
weight (e.g. bold).

There are several ways that highlighting with faces can be done. You will
want to learn about `font-lock' highlighting, `facemenu' highlighting, and
`hilock' highlighting. It's not clear from your description exactly what
you're after.

Open the Emacs manual with `C-h r' (or `C-h i' if pre-Emacs 22, then choose
the Emacs manual), and use `g' to visit at least these sections: `Faces',
`Format Faces', `Font Lock', and `Highlight Interactively' (not necessarily
in that order). For example, once you are in the manual, use `g font lock
RET' (where `RET' means Enter) to visit the `Font Lock' section ("node").

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How can I make emacs rendering engine highlight a string of characters ?
  2007-10-20 16:02 How can I make emacs rendering engine highlight a string of characters ? gnuist006
  2007-10-20 17:21 ` How can I make emacs rendering engine highlight a string ofcharacters ? Drew Adams
@ 2007-10-20 17:52 ` Bastien
  2007-10-21  5:59 ` Daniel Pittman
  2 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2007-10-20 17:52 UTC (permalink / raw)
  To: help-gnu-emacs

gnuist006@gmail.com writes:

> What are the emacs primitives to highlight, italicize, bold-font, or
> such ?

Try C-u C-x = on any character.  It will display relevant information on
the character at point.  This should look like this:

========================================================================
        character: ! (33, #o41, #x21)
preferred charset: ascii (ASCII (ISO646 IRV))
       code point: 0x21
           syntax: . 	which means: punctuation
         category: a:ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0]) l:Latin r:Japanese roman
      buffer code: #x21
        file code: not encodable by coding system utf-8
          display: by this font (glyph code)
     dejavu sans mono:pixelsize=12:foundry=unknown:weight=medium:slant=r:width=normal (#x04)

Character code properties are not shown: customize what to show

There are text properties here:
  auto-composed        t
  face                 myblack
  gnus-face            t
  gnus-number          4883
  gnus-position        t
========================================================================

In the first part, you find information on font and face.  

Here the font is:

     dejavu sans mono:pixelsize=12:foundry=unknown:weight=medium:slant=r:width=normal (#x04)

The face is defined by special text properties.  See the second part -
here, there are two special text properties that are relevant to Emacs
face rendering :

  face                 myblack
  gnus-face            t

More on faces :

  (info "(elisp)Special Properties")

-- 
Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How can I make emacs rendering engine highlight a string of characters ?
  2007-10-20 16:02 How can I make emacs rendering engine highlight a string of characters ? gnuist006
  2007-10-20 17:21 ` How can I make emacs rendering engine highlight a string ofcharacters ? Drew Adams
  2007-10-20 17:52 ` How can I make emacs rendering engine highlight a string of characters ? Bastien
@ 2007-10-21  5:59 ` Daniel Pittman
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Pittman @ 2007-10-21  5:59 UTC (permalink / raw)
  To: help-gnu-emacs

gnuist006@gmail.com writes:

> How can I make emacs rendering engine highlight a string of
> characters?  What are the emacs primitives to highlight, italicize,
> bold-font, or such? 

Other people have answers the "primitives" bit -- faces, etc -- but that
isn't quite the answer you needs.

> Is it correct that the text file is pure text and emacs renders it
> according to the settings of its rendering engine? 

More or less, yes.

> So what are the primitives of this rendering engine? Where do we find
> other types of primitives? These primitives are separate from the
> lisp portion and they are probably what one would call the graphics
> part of the emacs software.

What you /want/ to look at is the "font-lock" stuff.  That is, more or
less, a set of regular expressions that apply faces to text.

See the function `highlight-regexp' and friends for one-shot actions,
and the various info documentation for how the "Font Lock" facility
works.

Regards,
        Daniel
-- 
Daniel Pittman <daniel@cybersource.com.au>           Phone: 03 9621 2377
Level 4, 10 Queen St, Melbourne             Web: http://www.cyber.com.au
Cybersource: Australia's Leading Linux and Open Source Solutions Company

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-10-21  5:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-20 16:02 How can I make emacs rendering engine highlight a string of characters ? gnuist006
2007-10-20 17:21 ` How can I make emacs rendering engine highlight a string ofcharacters ? Drew Adams
2007-10-20 17:52 ` How can I make emacs rendering engine highlight a string of characters ? Bastien
2007-10-21  5:59 ` Daniel Pittman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.