Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Being able to turn off mouse highlighting

1 view
Skip to first unread message

Martin Stjernholm

unread,
Aug 20, 1997, 3:00:00 AM8/20/97
to

In GNU Emacs 19.34.1 (i386-debian-linux-gnu, X toolkit) of Sun Aug 17 1997 on starbug
configured using `configure --prefix=/usr --with-pop=yes --with-x=yes --with-x-toolkit=lucid i386-debian-linux'

I miss a feature to be able to better control how mouse highlighting
should be done. I'd like to be able to turn it off altogether, so that
regardless of the face used in a mouse sensitive area, it stays the
same when the mouse pointer is over it, only the pointer shape
changes. I e it isn't enough to set the `highlight' face to the same
as the `default' face.

For this I hacked together a simple patch that defines a new variable
`mouse-highlight', which lets the user control how mouse highlighting
should be done. I don't really know if the patch is good for public
consumption (the w32 parts are totally untested), but it works for me.

/stjernholm


--- src/w32faces.c.orig Thu Jul 4 03:11:33 1996
+++ src/w32faces.c Sat Jan 25 02:50:11 1997
@@ -132,6 +132,8 @@
Lisp_Object Qface, Qmouse_face;
Lisp_Object Qpixmap_spec_p;

+Lisp_Object Vmouse_highlight;
+
int face_name_id_number ( /* FRAME_PTR, Lisp_Object name */ );

struct face *intern_face ( /* FRAME_PTR, struct face * */ );
@@ -1039,6 +1041,13 @@
"Face number to use to highlight the region\n\
The region is highlighted with this face\n\
when Transient Mark mode is enabled and the mark is active.");
+
+ DEFVAR_LISP ("mouse-highlight", &Vmouse_highlight,
+ "*If nil, mouse sensitive highlighting is disabled.\n\
+If t, mouse sensitive areas are highlighted when the pointer is over them.\n\
+If something else then no text highlighting is done, but the pointer may\n\
+still change shape.");
+ Vmouse_highlight = Qt;

defsubr (&Spixmap_spec_p);
defsubr (&Sframe_face_alist);
--- src/w32term.c.orig Thu Aug 22 10:27:23 1996
+++ src/w32term.c Sat Jan 25 02:50:12 1997
@@ -134,6 +134,8 @@

extern Lisp_Object Qface, Qmouse_face;

+extern Lisp_Object Vmouse_highlight;
+
extern int errno;

/* A mask of extra modifier bits to put into every keyboard char. */
@@ -1615,7 +1617,7 @@
FRAME_CURRENT_GLYPHS (f)->glyphs[i] + column,
endcolumn - column,
/* Highlight with mouse face if hl > 0. */
- hl > 0 ? 3 : 0, 0);
+ hl > 0 && EQ (Vmouse_highlight, Qt) ? 3 : 0, 0);
}

/* If we turned the cursor off, turn it back on. */
@@ -1626,7 +1628,7 @@
curs_y = old_curs_y;

/* Change the mouse cursor according to the value of HL. */
- if (hl > 0)
+ if (hl > 0 && ! NILP (Vmouse_highlight))
SetCursor (f->output_data.win32->cross_cursor);
else
SetCursor (f->output_data.win32->text_cursor);
--- src/xfaces.c.orig Thu Aug 22 10:27:24 1996
+++ src/xfaces.c Sat Jan 25 02:50:12 1997
@@ -161,6 +161,8 @@
Lisp_Object Qface, Qmouse_face;
Lisp_Object Qpixmap_spec_p;

+Lisp_Object Vmouse_highlight;
+
int face_name_id_number ( /* FRAME_PTR, Lisp_Object name */ );

struct face *intern_face ( /* FRAME_PTR, struct face * */ );
@@ -1262,6 +1264,13 @@
"Face number to use to highlight the region\n\
The region is highlighted with this face\n\
when Transient Mark mode is enabled and the mark is active.");
+
+ DEFVAR_LISP ("mouse-highlight", &Vmouse_highlight,
+ "*If nil, mouse sensitive highlighting is disabled.\n\
+If t, mouse sensitive areas are highlighted when the pointer is over them.\n\
+If something else then no text highlighting is done, but the pointer may\n\
+still change shape.");
+ Vmouse_highlight = Qt;

#ifdef HAVE_X_WINDOWS
defsubr (&Spixmap_spec_p);
--- src/xterm.c.orig Thu Aug 22 10:27:25 1996
+++ src/xterm.c Sat Jan 25 02:50:12 1997
@@ -239,6 +239,8 @@

extern Lisp_Object Qface, Qmouse_face;

+extern Lisp_Object Vmouse_highlight;
+
extern int errno;

/* A mask of extra modifier bits to put into every keyboard char. */
@@ -2180,7 +2182,7 @@
FRAME_CURRENT_GLYPHS (f)->glyphs[i] + column,
endcolumn - column,
/* Highlight with mouse face if hl > 0. */
- hl > 0 ? 3 : 0, 0);
+ hl > 0 && EQ (Vmouse_highlight, Qt) ? 3 : 0, 0);
}

/* If we turned the cursor off, turn it back on. */
@@ -2191,7 +2193,7 @@
curs_y = old_curs_y;

/* Change the mouse cursor according to the value of HL. */
- if (hl > 0)
+ if (hl > 0 && ! NILP (Vmouse_highlight))
XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
f->output_data.x->cross_cursor);
else

0 new messages