unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Highlight a word
@ 2003-08-31  9:25 Matthias Teege
  2003-09-01 12:22 ` Felix Natter
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Teege @ 2003-08-31  9:25 UTC (permalink / raw)



Moin,

I've write a function which made some tests on each word in a
buffer or region and returns t or nil. Now I want to highlight the
words where the function returns t.

There is no highlight-region or highlight-word function in
emacs. What is the best way to do somthing like that?

Many thanks
Matthias

-- 
Matthias Teege -- http://www.mteege.de
make world not war
PGP-Key auf Anfrage

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

* Re: Highlight a word
  2003-08-31  9:25 Highlight a word Matthias Teege
@ 2003-09-01 12:22 ` Felix Natter
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Natter @ 2003-09-01 12:22 UTC (permalink / raw)


Matthias Teege <matthias@mteege.de> writes:

> Moin,
>
> I've write a function which made some tests on each word in a
> buffer or region and returns t or nil. Now I want to highlight the
> words where the function returns t.
>
> There is no highlight-region or highlight-word function in
> emacs. What is the best way to do somthing like that?

you can use overlays in GNU Emacs and extents in XEmacs:

i.e. GNU Emacs 20 and above:
(setq ol (make-overlay 1 25))
(overlay-put ol 'face font-lock-keyword-face)
(delete-overlay ol)

example for XEmacs (can't test this):
(setq extent (make-extent nil nil))
(set-extent-face extent po-highlight-face)
(set-extent-endpoints extent 1 25 (current-buffer))

you can find sample code for overlays+extents in po-mode.el
ftp://ftp.gnu.org/gnu/gettext/gettext-0.12.1.tar.gz
(in gettext-0.12.1/gettext-tools/misc/po-mode.el)

-- 
Felix Natter

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

end of thread, other threads:[~2003-09-01 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-31  9:25 Highlight a word Matthias Teege
2003-09-01 12:22 ` Felix Natter

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