[Top][All Lists]

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

Re: elisp q: what functions do I need to *visually* replace string foo w

From: rgb
Subject: Re: elisp q: what functions do I need to *visually* replace string foo with bar
Date: 7 Feb 2007 09:34:04 -0800
User-agent: G2/1.0

On Feb 7, 10:00 am, "Mirko" <address@hidden> wrote:
> Hello group,
> I would like to simplify the looks of my program files (programing
> language is called IDL from ITT Visual Solutions).  In these I have
> many variable references of the type
> *
> I would like emacs to display them (when in font lock mode) with just
> foo, but foo being italicized.
> Could someone please point me to the relevant elisp functions that can
> get me going?
> Thank you,
> Mirko

Making foo italic is pretty easy.
(setq font-lock-defaults
      '((("\\*self\\.\\(\\(?:\\s_\\|\\sw\\)+\\)" 1 my-italic-face))))

But making the reset invisible requires that you put the invisible
on the text which requires you to write a function.

For a quick fix you could just make the text invisible by just giving
it a
a face you make with foreground and background the same...

(setq font-lock-defaults
      '((("\\*self\\.\\(\\(?:\\s_\\|\\sw\\)+\\)" 1 my-italic-face)
        ("\\(\\*self\\.\\)\\(?:\\s_\\|\\sw\\)+" 1 my-invisible-face))

Perhaps someone else has an example of putting properties onto
text under font-lock control....
I don't have one handy.

reply via email to

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