From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: changind the iterator environment for display.
Date: Mon, 02 Feb 2009 17:09:13 +0100 [thread overview]
Message-ID: <7c1vugom6u.fsf@pbourguignon.anevia.com> (raw)
In-Reply-To: mailman.6526.1233589604.26697.help-gnu-emacs@gnu.org
"A. Soare" <alinsoar@voila.fr> writes:
> How can I change the color of the display iteratively?
>
> I want to display a line XXXXXXXYYYYYYYZZZZZZZUUUUUUUVVVVVVVWWWWWW
>
> The first part XXXXXXX I want to colorize using the face A
>
> The part YYYYYYYY with face B
>
> and so on.
>
> I tried so:
>
> it.base_face_id = it.face_id = FACE_A;
> display_string (Str1, Qnil, Qnil, 0, 0, &it, 10, 0, 0, -1);
>
> it.base_face_id = it.face_id = FACE_B;
> display_string (Str2, Qnil, Qnil, 0, 0, &it, 10, 0, 0, -1);
>
> it.base_face_id = it.face_id = FACE_C;
> display_string (Str3, Qnil, Qnil, 0, 0, &it, 10, 0, 0, -1);
WTF?
> and it does not changes the colors as I expect to.
>
> One method would be to reset the iterator after every display, and it would work.
>
> Could someone help me?
put:
(font-lock-add-keywords
nil '(("\\(XXXXXXX\\)\\(YYYYYYY\\)\\(ZZZZZZZ\\)\\(UUUUUUU\\)\\(VVVVVVV\\)\\(WWWWWW\\)"
(1 face-a)
(2 face-b)
(3 face-c)
(4 face-d)
(5 face-e)
(6 face-f))))
in your ~/.emacs
You may substitute XXXXXXX by a regular expression matching any XXXXXXX, etc.
(and use the name of actual faces instead of face-a, etc.
--
__Pascal Bourguignon__
next parent reply other threads:[~2009-02-02 16:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.6526.1233589604.26697.help-gnu-emacs@gnu.org>
2009-02-02 16:09 ` Pascal J. Bourguignon [this message]
2009-02-02 16:36 changind the iterator environment for display A. Soare
-- strict thread matches above, loose matches on Subject: below --
2009-02-02 15:46 A. Soare
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7c1vugom6u.fsf@pbourguignon.anevia.com \
--to=pjb@informatimago.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.
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.