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

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

Disabling mouse over highlighting


From: Jay Rogers
Subject: Disabling mouse over highlighting
Date: 08 Feb 2002 17:52:24 -0500

Many users who don't use the mouse while in emacs find the "mouse
over hightlighting" to be annoying.

There should be a way for a user to disable the highlight and/or
the pointer shape change.

Below is a message posted to gnu.emacs.bug back in Aug 1997
requesting the same and providing code to do so for v19.34.

Please consider implementing this for the next version of emacs.

http://groups.google.com/groups?as_umsgid=m0x11MH-0000nlC%40starbug.rydnet.lysator.liu.se&num=50&hl=en

> From: mast@lysator.liu.se (Martin Stjernholm)
> Subject: Being able to turn off mouse highlighting
> Date: 1997/08/20
> Message-ID: <m0x11MH-0000nlC@starbug.rydnet.lysator.liu.se>#1/1
> Sender: bug-gnu-emacs-request@prep.ai.mit.edu
> x-gateway: relay5.UU.NET from bug-gnu-emacs to gnu.emacs.bug; Tue, 19 Aug 
> 1997 23:23:36 EDT
> Newsgroups: gnu.emacs.bug
> 
> 
> 
> 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



reply via email to

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