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

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

Re: Image overlays using font-lock-add-keywords() and create-image() for


From: Johan Bockgård
Subject: Re: Image overlays using font-lock-add-keywords() and create-image() for more compact code view
Date: Fri, 06 Jun 2008 14:52:39 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux)

Nordlöw <address@hidden> writes:

> I thought the following snippet of code should give me a new more
> compact view of gtk-code.
>
> (defun pretty-gtk ()
>   "Highlight symbols starting with gtk_ using the GIMP Tool Kit (GTK)
> Icon."

    (add-to-list 'char-property-alias-alist '(display pretty))
    (add-to-list 'font-lock-extra-managed-props 'pretty)

>   (font-lock-add-keywords
>    nil
>    `(("\\_<\\(gtk\\)_"
>       (1 '(face nil pretty ,(create-image "~/pnw/images/gtk-logo-rgb-
> cropped-10x13.png")))))))
> (add-hook 'c-mode-common-hook 'pretty-gtk)
>
> It does not show the image overlay, however... What have I missed?

This does not use overlays, BTW.

-- 
Johan Bockgård


reply via email to

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