[gnu.emacs] highlighting regions

katz@VENERA.ISI.EDU (12/01/89)

Is there ever going to be highlighting of regions in GNU Emacs?  Does
anyone know of patches to do this either running on any terminal that
supports reverse video or under X?  It seems like it should be easy to
do when running under X.  (I don't really need such things, but some
users here want it).

How hard would this be to hack?

				Alan

handa@etl.go.jp (Kenichi Handa) (12/03/89)

In article <8912010303.AA04365@tardis.isi.edu>
	katz@VENERA.ISI.EDU writes:
|Is there ever going to be highlighting of regions in GNU Emacs?  Does
|anyone know of patches to do this either running on any terminal that
|supports reverse video or under X?  It seems like it should be easy to
|do when running under X.  (I don't really need such things, but some
|users here want it).

I have modified buffer.[ch], dispextern.h, dispnew.h,
xdisp.c, x11term.h and wrote attribute.el for setting
character attributes between two markers.  Once attributes
are set in certain region, characters inserted later in that
region also have the same attribute.  Currently supported
attributes are 'inverse (or to say highlight)' and 'underline'.

My modification is effective only under X.

If there's many requests,  I'll post the patches.

---
Ken'ichi HANDA

PS.  Functions defined in attribute.el:

attribute-on-region:
Sets an charater attribute ATTR within the region on.
Currently supported attributes are 'underline' and 'inverse'.
Called from program, takes two optional arguments FROM and TO.
If FROM or TO is NIL, (point-min) or (point-max) is used instead.
Information of attribute is stored in buffer local variables
underlined-region and inversed-region, but manipulating
these variabels directly may cause serious problems.

attribute-off-region:
Sets an charater attribute ATTR within the region off.
See the function attribute-on-region for more detail.

attribute-get-attribute:
Returns a list of attribute ranges at POS.
An attribute range is a list of three elements, attribute
type, the starting point, and the ending point.
POS is an optional argument and the default is the current point.