From xemacs-m  Tue May 27 11:32:24 1997
Received: from newman.aventail.com (root@newman.aventail.com [199.238.236.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id LAA29934
	for <xemacs-beta@xemacs.org>; Tue, 27 May 1997 11:32:22 -0500 (CDT)
Received: from kramer.in.aventail.com.aventail.com (wmperry@[192.168.1.12])
	by newman.aventail.com (8.8.5/8.8.5) with SMTP id JAA01750
	for <xemacs-beta@xemacs.org>; Tue, 27 May 1997 09:32:24 -0700 (PDT)
Date: Tue, 27 May 1997 09:32:24 -0700 (PDT)
Message-Id: <199705271632.JAA01750@newman.aventail.com>
From: "William M. Perry" <wmperry@aventail.com>
To: xemacs-beta@xemacs.org
Subject: PATCH: GPM support
Errors-to: wmperry@aventail.com
Reply-to: wmperry@aventail.com
X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7</SYF`{vYQ(&RI1&EiH[FvT;J}@f!4kfz
 x_!Y#=y{Uuj9GvUi=cPuajQ(Z42R[wE@{G,sn$qGr5g/wnb*"*ktI+,CD}1Z'wxrM2ag-r0p5I6\nA
 [WJopW_J.WY;

GPM support.  Wow fun.  Motion events still don't work.  If anyone else
could take a look at this, please let me know what you find out.  The
events are actually getting noticed by gpm_handle_event, and I think they
get thrown on the queue correctly, but nothing happens.  *sigh*

-Bill P.

===================================================================
RCS file: ./lisp/prim/mouse.el,v
retrieving revision 1.1
diff -c -r1.1 lisp/prim/mouse.el
*** lisp/prim/mouse.el	1997/05/27 14:52:39	1.1
--- lisp/prim/mouse.el	1997/05/27 14:54:07
***************
*** 47,54 ****
    :type 'boolean
    :group 'mouse)
  
! (defvar mouse-yank-function 'yank	; x11/x-mouse changes this...
    "Function that is called upon by `mouse-yank' to actually insert text.")
  
  
  (defun mouse-select ()
--- 47,61 ----
    :type 'boolean
    :group 'mouse)
  
! (defvar mouse-yank-function 'mouse-consolidated-yank
    "Function that is called upon by `mouse-yank' to actually insert text.")
+ 
+ (defun mouse-consolidated-yank ()
+   (interactive)
+   (case (device-type)
+     (x (x-yank-function))
+     (tty (yank))
+     (otherwise (yank))))
  
  
  (defun mouse-select ()
RCS file: ./src/gpmevent.c,v
retrieving revision 1.1
diff -c -r1.1 gpmevent.c
*** src/gpmevent.c	1997/05/27 14:58:59	1.1
--- src/gpmevent.c	1997/05/27 14:59:21
***************
*** 0 ****
--- 1,113 ----
+ /* William Perry 1997 */
+ 
+ #include <config.h>
+ #include "lisp.h"
+ #include "console-tty.h"
+ #include "device.h"
+ #include "events.h"
+ #include "events-mod.h"
+ #include "process.h"
+ #include "sysdep.h"
+ #include "sysproc.h"		/* select stuff */
+ #include "systime.h"
+ 
+ #ifdef HAVE_GPM
+ #include "gpmevent.h"
+ #include <gpm.h>
+ 
+ #if (!defined(__linux__))	/* possible under xterm */
+ #define KG_SHIFT	0
+ #define KG_CTRL		2
+ #define KG_ALT		3
+ #else
+ #include <linux/keyboard.h> 
+ #endif
+ 
+ extern SELECT_TYPE input_wait_mask, non_fake_input_wait_mask;
+ extern SELECT_TYPE process_only_mask, device_only_mask;
+ void select_filedesc (int fd, Lisp_Object what);
+ 
+ int handle_gpm_read(struct Lisp_Event *event, struct console *con, int fd)
+ {
+   Gpm_Event ev;
+   int modifiers,type,button;
+ 
+   type = -1;
+   button = 1;
+ 
+   if (!Gpm_GetEvent(&ev))
+     return(0);
+   
+   event->timestamp       = 0;
+   event->channel         = CONSOLE_SELECTED_FRAME (con);
+   
+   /* Whow, wouldn't named defines be NICE!?!?! */
+   modifiers = 0;
+ 
+   if (ev.modifiers & 1)   modifiers |= MOD_SHIFT;
+   if (ev.modifiers & 2)   modifiers |= MOD_META;
+   if (ev.modifiers & 4)   modifiers |= MOD_CONTROL;
+   if (ev.modifiers & 8)   modifiers |= MOD_META;
+ 
+   if (ev.type & GPM_DOWN)
+     type = GPM_DOWN;
+   else if (ev.type & GPM_UP)
+     type = GPM_UP;
+   else if (ev.type & GPM_MOVE) {
+     type = GPM_MOVE;
+     GPM_DRAWPOINTER(&ev);
+   }
+ 
+   if (ev.buttons & GPM_B_LEFT)
+     button = 1;
+   else if (ev.buttons & GPM_B_MIDDLE)
+     button = 2;
+   else if (ev.buttons & GPM_B_RIGHT)
+     button = 3;
+ 
+   switch (type) {
+   case GPM_DOWN:
+   case GPM_UP:
+     if (type == GPM_DOWN)
+       event->event_type           = button_press_event;
+     else event->event_type        = button_release_event;
+     event->event.button.x         = ev.x;
+     event->event.button.y         = ev.y;
+     event->event.button.button    = button;
+     event->event.button.modifiers = modifiers;
+     break;
+   case GPM_MOVE:
+     event->event_type             = pointer_motion_event;
+     event->event.motion.x         = ev.x;
+     event->event.motion.y         = ev.y;
+     event->event.motion.modifiers = modifiers;
+   default:
+     return (0);
+   }
+   return (1);
+ }
+ 
+ int connect_to_gpm(struct console *con)
+ {
+   /* Only do this if we are running after dumping and really interactive */
+   if (!noninteractive && initialized) {
+     /* We really only want to do this on a TTY */
+     if (EQ (CONSOLE_TYPE (con), Qtty)) {
+       Gpm_Connect conn;
+ 
+       conn.eventMask = GPM_DOWN|GPM_UP|GPM_MOVE;
+       conn.defaultMask = GPM_MOVE;
+       conn.minMod = 0;
+       conn.maxMod = ((1<<KG_SHIFT)|(1<<KG_ALT)|(1<<KG_CTRL));
+ 
+       if (Gpm_Open (&conn, 0) == -1) {
+ 	CONSOLE_TTY_MOUSE_FD (con) = -1;
+ 	return(0);
+       }
+       set_descriptor_non_blocking (gpm_fd);
+       CONSOLE_TTY_MOUSE_FD (con) = gpm_fd;
+     }
+   }
+ }
+ 
+ #endif
===================================================================
RCS file: ./src/console-tty.c,v
retrieving revision 1.1
diff -c -r1.1 console-tty.c
*** src/console-tty.c	1997/05/27 14:47:29	1.1
--- src/console-tty.c	1997/05/27 14:47:45
***************
*** 127,132 ****
--- 127,137 ----
  #endif /* MULE */
    CONSOLE_TTY_DATA (con)->terminal_type = terminal_type;
    CONSOLE_TTY_DATA (con)->controlling_process = controlling_process;
+ 
+ #ifdef HAVE_GPM
+   connect_to_gpm(con);
+ #endif
+ 
    if (NILP (CONSOLE_NAME (con)))
      CONSOLE_NAME (con) = Ffile_name_nondirectory (tty);
    {
===================================================================
RCS file: ./src/console-tty.h,v
retrieving revision 1.1
diff -c -r1.1 console-tty.h
*** src/console-tty.h	1997/05/27 14:47:55	1.1
--- src/console-tty.h	1997/05/27 14:48:35
***************
*** 41,46 ****
--- 41,49 ----
  struct tty_console
  {
    int infd, outfd;
+ #ifdef HAVE_GPM
+   int mouse_fd;
+ #endif
    Lisp_Object instream, outstream;
    Lisp_Object terminal_type;
    Lisp_Object controlling_process;
***************
*** 197,202 ****
--- 200,208 ----
    unsigned int is_stdio :1;
  };
  
+ #ifdef HAVE_GPM
+ #define CONSOLE_TTY_MOUSE_FD(c) (CONSOLE_TTY_DATA (c)->mouse_fd)
+ #endif
  #define CONSOLE_TTY_DATA(c) CONSOLE_TYPE_DATA (c, tty)
  #define CONSOLE_TTY_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->cursor_x)
  #define CONSOLE_TTY_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->cursor_y)
===================================================================
RCS file: ./src/event-Xt.c,v
retrieving revision 1.1
diff -c -r1.1 event-Xt.c
*** src/event-Xt.c	1997/05/27 14:48:43	1.1
--- src/event-Xt.c	1997/05/27 14:50:10
***************
*** 1729,1734 ****
--- 1729,1737 ----
  {
    Lisp_Object console = Qnil;
    int infd;
+ #ifdef HAVE_GPM
+   int mousefd;
+ #endif
  
    if (CONSOLE_X_P (con))
      return; /* X consoles are automatically selected for when we
***************
*** 1736,1741 ****
--- 1739,1753 ----
    infd = event_stream_unixoid_select_console (con);
    XSETCONSOLE (console, con);
    select_filedesc (infd, console);
+ #ifdef HAVE_GPM
+   /* On a stream device (ie: noninteractive), bad things can happen. */
+   if (EQ (CONSOLE_TYPE (con), Qtty)) {
+     mousefd = CONSOLE_TTY_MOUSE_FD (con);
+     if (mousefd >= 0) {
+       select_filedesc (mousefd, console);
+     }
+   }
+ #endif
  }
  
  static void
***************
*** 1743,1748 ****
--- 1755,1763 ----
  {
    Lisp_Object console = Qnil;
    int infd;
+ #ifdef HAVE_GPM
+   int mousefd;
+ #endif
  
    if (CONSOLE_X_P (con))
      return; /* X consoles are automatically selected for when we
***************
*** 1750,1755 ****
--- 1765,1779 ----
    infd = event_stream_unixoid_unselect_console (con);
    XSETCONSOLE (console, con);
    unselect_filedesc (infd);
+ #ifdef HAVE_GPM
+   /* On a stream device (ie: noninteractive), bad things can happen. */
+   if (EQ (CONSOLE_TYPE (con), Qtty)) {
+     mousefd = CONSOLE_TTY_MOUSE_FD (con);
+     if (mousefd >= 0) {
+       unselect_filedesc (mousefd);
+     }
+   }
+ #endif
  }
  
  /* read an event from a tty, if one is available.  Returns non-zero
===================================================================
RCS file: ./src/frame-tty.c,v
retrieving revision 1.1
diff -c -r1.1 frame-tty.c
*** src/frame-tty.c	1997/05/27 14:51:11	1.1
--- src/frame-tty.c	1997/05/27 14:52:20
***************
*** 31,36 ****
--- 31,40 ----
  #include "console-tty.h"
  #include "frame.h"
  
+ #ifdef HAVE_GPM
+ #include <gpm.h>
+ #endif
+ 
  
  /* Default properties to use when creating frames.  */
  Lisp_Object Vdefault_tty_frame_plist;
***************
*** 82,87 ****
--- 86,118 ----
      call1 (Qinit_post_tty_win, FRAME_CONSOLE (f));
  }
  
+ #ifdef HAVE_GPM
+ static int
+ tty_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y)
+ {
+   Gpm_Event ev;
+   int num_buttons;
+ 
+   num_buttons = Gpm_GetSnapshot(&ev);
+   *x = ev.x;
+   *y = ev.y;
+   *frame = DEVICE_SELECTED_FRAME (d);
+   return (1);
+ }
+ 
+ static void
+ tty_set_mouse_position (struct window *w, int x, int y)
+ {
+   /* XXX
+      I couldn't find any GPM functions that set the mouse position.
+      Mr. Perry had left this function empty; that must be why.
+      karlheg
+   */
+ }
+ 
+ #endif
+ 
+ 
  /* Change from withdrawn state to mapped state. */
  static void
  tty_make_frame_visible (struct frame *f)
***************
*** 170,175 ****
--- 201,210 ----
    CONSOLE_HAS_METHOD (tty, init_frame_1);
    CONSOLE_HAS_METHOD (tty, init_frame_3);
    CONSOLE_HAS_METHOD (tty, after_init_frame);
+ #ifdef HAVE_GPM
+   CONSOLE_HAS_METHOD (tty, get_mouse_position);
+   CONSOLE_HAS_METHOD (tty, set_mouse_position);
+ #endif
    CONSOLE_HAS_METHOD (tty, make_frame_visible);
    CONSOLE_HAS_METHOD (tty, make_frame_invisible);
    CONSOLE_HAS_METHOD (tty, frame_visible_p);
===================================================================
RCS file: ./src/event-unixoid.c,v
retrieving revision 1.1
diff -c -r1.1 event-unixoid.c
*** src/event-unixoid.c	1997/05/27 14:50:17	1.1
--- src/event-unixoid.c	1997/05/27 14:51:05
***************
*** 39,44 ****
--- 39,49 ----
  #include "sysproc.h"		/* select stuff */
  #include "systime.h"
  
+ #ifdef HAVE_GPM
+ #include "gpmevent.h"
+ #include <gpm.h>
+ #endif
+ 
  /* Mask of bits indicating the descriptors that we wait for input on.
     These work as follows:
  
***************
*** 77,82 ****
--- 82,93 ----
    Lisp_Object console = Qnil;
  
    XSETCONSOLE (console, con);
+ 
+ #ifdef HAVE_GPM
+   if (fd == CONSOLE_TTY_MOUSE_FD (con)) {
+     return (handle_gpm_read (event,con,fd));
+   }
+ #endif
  
    nread = read (fd, &ch, 1);
    if (nread <= 0)
===================================================================
RCS file: ./src/gpmevent.h,v
retrieving revision 1.1
diff -c -r1.1 gpmevent.h
*** src/gpmevent.h	1997/05/27 14:59:04	1.1
--- src/gpmevent.h	1997/05/27 14:59:21
***************
*** 0 ****
--- 1,7 ----
+ #ifndef _HAVE_GPM
+ #define _HAVE_GPM
+ 
+ int handle_gpm_read(struct Lisp_Event *event, struct console *con, int fd);
+ int connect_to_gpm(struct console *con);
+ 
+ #endif
===================================================================
RCS file: configure,v
retrieving revision 1.1
diff -c -r1.1 configure
*** configure	1997/05/27 14:57:48	1.1
--- configure	1997/05/27 15:33:50
***************
*** 339,345 ****
  TTY options:
  
  --with-ncurses (*)	Use the ncurses library for tty support.
! --with-gpm (*)		Compile in support for General Purpose Mouse.
  
  
  Additional features:
--- 339,345 ----
  TTY options:
  
  --with-ncurses (*)	Use the ncurses library for tty support.
! --with-gpm (*) 		Compile in support for General Purpose Mouse.
  
  
  Additional features:
***************
*** 8266,8285 ****
  fi
  
  
!     #### Attn: Bill Perry:  Remove next line when GPM support is added
!   test -z "$with_gpm" && with_gpm=no
! 
!   test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
! echo "configure:8275: checking for gpm.h" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8278 "configure"
  #include "confdefs.h"
  #include <gpm.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:8283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 8266,8282 ----
  fi
  
  
!     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
! echo "configure:8272: checking for gpm.h" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8275 "configure"
  #include "confdefs.h"
  #include <gpm.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:8280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 8301,8324 ****
  fi
   }
    test -z "$with_gpm" && { 
! echo $ac_n "checking for connect_to_gpm in -lgpm""... $ac_c" 1>&6
! echo "configure:8306: checking for connect_to_gpm in -lgpm" >&5
! ac_lib_var=`echo gpm'_'connect_to_gpm | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -lgpm "
  cat > conftest.$ac_ext <<EOF
! #line 8311 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
      builtin and then its argument prototype would still apply.  */
! char connect_to_gpm();
  
  int main() {
! connect_to_gpm()
  ; return 0; }
  EOF
! if { (eval echo configure:8322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 8298,8321 ----
  fi
   }
    test -z "$with_gpm" && { 
! echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
! echo "configure:8303: checking for Gpm_Open in -lgpm" >&5
! ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -lgpm "
  cat > conftest.$ac_ext <<EOF
! #line 8308 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
      builtin and then its argument prototype would still apply.  */
! char Gpm_Open();
  
  int main() {
! Gpm_Open()
  ; return 0; }
  EOF
! if { (eval echo configure:8319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 8357,8368 ****
      if test -z "$with_ncurses"; then
      
  echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
! echo "configure:8361: checking for tgetent in -lncurses" >&5
  ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -lncurses "
  cat > conftest.$ac_ext <<EOF
! #line 8366 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 8354,8365 ----
      if test -z "$with_ncurses"; then
      
  echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
! echo "configure:8358: checking for tgetent in -lncurses" >&5
  ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -lncurses "
  cat > conftest.$ac_ext <<EOF
! #line 8363 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 8373,8379 ****
  tgetent()
  ; return 0; }
  EOF
! if { (eval echo configure:8377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 8370,8376 ----
  tgetent()
  ; return 0; }
  EOF
! if { (eval echo configure:8374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 8406,8420 ****
  
      ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
! echo "configure:8410: checking for ncurses/curses.h" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8413 "configure"
  #include "confdefs.h"
  #include <ncurses/curses.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:8418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 8403,8417 ----
  
      ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
! echo "configure:8407: checking for ncurses/curses.h" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8410 "configure"
  #include "confdefs.h"
  #include <ncurses/curses.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:8415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 8436,8450 ****
  
      ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
! echo "configure:8440: checking for ncurses/term.h" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8443 "configure"
  #include "confdefs.h"
  #include <ncurses/term.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:8448: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 8433,8447 ----
  
      ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
! echo "configure:8437: checking for ncurses/term.h" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8440 "configure"
  #include "confdefs.h"
  #include <ncurses/term.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:8445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 8474,8488 ****
        c_switch_site="$c_switch_site -I/usr/include/ncurses"
        ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
! echo "configure:8478: checking for ncurses/curses.h" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8481 "configure"
  #include "confdefs.h"
  #include <ncurses/curses.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:8486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 8471,8485 ----
        c_switch_site="$c_switch_site -I/usr/include/ncurses"
        ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
! echo "configure:8475: checking for ncurses/curses.h" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8478 "configure"
  #include "confdefs.h"
  #include <ncurses/curses.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:8483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 8517,8528 ****
  	for lib in curses termlib termcap; do
  	  
  echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
! echo "configure:8521: checking for tgetent in -l$lib" >&5
  ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -l$lib "
  cat > conftest.$ac_ext <<EOF
! #line 8526 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 8514,8525 ----
  	for lib in curses termlib termcap; do
  	  
  echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
! echo "configure:8518: checking for tgetent in -l$lib" >&5
  ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -l$lib "
  cat > conftest.$ac_ext <<EOF
! #line 8523 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 8533,8539 ****
  tgetent()
  ; return 0; }
  EOF
! if { (eval echo configure:8537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 8530,8536 ----
  tgetent()
  ; return 0; }
  EOF
! if { (eval echo configure:8534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 8564,8575 ****
        else
  	
  echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
! echo "configure:8568: checking for tgetent in -lcurses" >&5
  ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -lcurses "
  cat > conftest.$ac_ext <<EOF
! #line 8573 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 8561,8572 ----
        else
  	
  echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
! echo "configure:8565: checking for tgetent in -lcurses" >&5
  ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -lcurses "
  cat > conftest.$ac_ext <<EOF
! #line 8570 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 8580,8586 ****
  tgetent()
  ; return 0; }
  EOF
! if { (eval echo configure:8584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 8577,8583 ----
  tgetent()
  ; return 0; }
  EOF
! if { (eval echo configure:8581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 8599,8610 ****
    echo "$ac_t""no" 1>&6
  
  echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
! echo "configure:8603: checking for tgetent in -ltermcap" >&5
  ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -ltermcap "
  cat > conftest.$ac_ext <<EOF
! #line 8608 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 8596,8607 ----
    echo "$ac_t""no" 1>&6
  
  echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
! echo "configure:8600: checking for tgetent in -ltermcap" >&5
  ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -ltermcap "
  cat > conftest.$ac_ext <<EOF
! #line 8605 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 8615,8621 ****
  tgetent()
  ; return 0; }
  EOF
! if { (eval echo configure:8619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 8612,8618 ----
  tgetent()
  ; return 0; }
  EOF
! if { (eval echo configure:8616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 8669,8685 ****
  fi 
  
  echo "checking for database support" 1>&6
! echo "configure:8673: checking for database support" >&5
  
  if test "$with_database_gnudbm" != "no"; then
    
  echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
! echo "configure:8678: checking for dbm_open in -lgdbm" >&5
  ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -lgdbm "
  cat > conftest.$ac_ext <<EOF
! #line 8683 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 8666,8682 ----
  fi 
  
  echo "checking for database support" 1>&6
! echo "configure:8670: checking for database support" >&5
  
  if test "$with_database_gnudbm" != "no"; then
    
  echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
! echo "configure:8675: checking for dbm_open in -lgdbm" >&5
  ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -lgdbm "
  cat > conftest.$ac_ext <<EOF
! #line 8680 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 8690,8696 ****
  dbm_open()
  ; return 0; }
  EOF
! if { (eval echo configure:8694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 8687,8693 ----
  dbm_open()
  ; return 0; }
  EOF
! if { (eval echo configure:8691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 8712,8721 ****
  
    if test "$with_database_gnudbm" != "yes"; then
      echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
! echo "configure:8716: checking for dbm_open" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8719 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char dbm_open(); below.  */
--- 8709,8718 ----
  
    if test "$with_database_gnudbm" != "yes"; then
      echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
! echo "configure:8713: checking for dbm_open" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8716 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char dbm_open(); below.  */
***************
*** 8738,8744 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:8742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_func_dbm_open=yes"
  else
--- 8735,8741 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:8739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_func_dbm_open=yes"
  else
***************
*** 8774,8783 ****
  
  if test "$with_database_dbm" != "no"; then
    echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
! echo "configure:8778: checking for dbm_open" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8781 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char dbm_open(); below.  */
--- 8771,8780 ----
  
  if test "$with_database_dbm" != "no"; then
    echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
! echo "configure:8775: checking for dbm_open" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8778 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char dbm_open(); below.  */
***************
*** 8800,8806 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:8804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_func_dbm_open=yes"
  else
--- 8797,8803 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:8801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_func_dbm_open=yes"
  else
***************
*** 8821,8832 ****
    if test "$need_libdbm" != "no"; then
      
  echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
! echo "configure:8825: checking for dbm_open in -ldbm" >&5
  ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -ldbm "
  cat > conftest.$ac_ext <<EOF
! #line 8830 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 8818,8829 ----
    if test "$need_libdbm" != "no"; then
      
  echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
! echo "configure:8822: checking for dbm_open in -ldbm" >&5
  ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -ldbm "
  cat > conftest.$ac_ext <<EOF
! #line 8827 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 8837,8843 ****
  dbm_open()
  ; return 0; }
  EOF
! if { (eval echo configure:8841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 8834,8840 ----
  dbm_open()
  ; return 0; }
  EOF
! if { (eval echo configure:8838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 8874,8883 ****
  
  if test "$with_database_berkdb" != "no"; then
    echo $ac_n "checking for dbopen""... $ac_c" 1>&6
! echo "configure:8878: checking for dbopen" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8881 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char dbopen(); below.  */
--- 8871,8880 ----
  
  if test "$with_database_berkdb" != "no"; then
    echo $ac_n "checking for dbopen""... $ac_c" 1>&6
! echo "configure:8875: checking for dbopen" >&5
  
  cat > conftest.$ac_ext <<EOF
! #line 8878 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char dbopen(); below.  */
***************
*** 8900,8906 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:8904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_func_dbopen=yes"
  else
--- 8897,8903 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:8901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_func_dbopen=yes"
  else
***************
*** 8921,8932 ****
    if test "$need_libdb" != "no"; then
      
  echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
! echo "configure:8925: checking for dbopen in -ldb" >&5
  ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -ldb "
  cat > conftest.$ac_ext <<EOF
! #line 8930 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 8918,8929 ----
    if test "$need_libdb" != "no"; then
      
  echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
! echo "configure:8922: checking for dbopen in -ldb" >&5
  ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -ldb "
  cat > conftest.$ac_ext <<EOF
! #line 8927 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 8937,8943 ****
  dbopen()
  ; return 0; }
  EOF
! if { (eval echo configure:8941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 8934,8940 ----
  dbopen()
  ; return 0; }
  EOF
! if { (eval echo configure:8938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 8961,8967 ****
    if test "$with_database_berkdb" = "yes"; then
      for path in "db/db.h" "db.h"; do
  cat > conftest.$ac_ext <<EOF
! #line 8965 "configure"
  #include "confdefs.h"
  #ifdef HAVE_INTTYPES_H
  #define __BIT_TYPES_DEFINED__
--- 8958,8964 ----
    if test "$with_database_berkdb" = "yes"; then
      for path in "db/db.h" "db.h"; do
  cat > conftest.$ac_ext <<EOF
! #line 8962 "configure"
  #include "confdefs.h"
  #ifdef HAVE_INTTYPES_H
  #define __BIT_TYPES_DEFINED__
***************
*** 8979,8985 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:8983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    db_h_path="$path"; break
  else
--- 8976,8982 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:8980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    db_h_path="$path"; break
  else
***************
*** 9031,9042 ****
  if test "$with_socks" = "yes"; then
    
  echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
! echo "configure:9035: checking for SOCKSinit in -lsocks" >&5
  ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -lsocks "
  cat > conftest.$ac_ext <<EOF
! #line 9040 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 9028,9039 ----
  if test "$with_socks" = "yes"; then
    
  echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
! echo "configure:9032: checking for SOCKSinit in -lsocks" >&5
  ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
  
  xe_check_libs=" -lsocks "
  cat > conftest.$ac_ext <<EOF
! #line 9037 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 9047,9053 ****
  SOCKSinit()
  ; return 0; }
  EOF
! if { (eval echo configure:9051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 9044,9050 ----
  SOCKSinit()
  ; return 0; }
  EOF
! if { (eval echo configure:9048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 9145,9151 ****
  fi
  
  cat > conftest.$ac_ext <<EOF
! #line 9149 "configure"
  #include "confdefs.h"
  
  int main() {
--- 9142,9148 ----
  fi
  
  cat > conftest.$ac_ext <<EOF
! #line 9146 "configure"
  #include "confdefs.h"
  
  int main() {
***************
*** 9155,9161 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:9159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "creating .sbinit"
  ( echo "# For use with Sun WorkShop's Source browser."
--- 9152,9158 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:9156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    echo "creating .sbinit"
  ( echo "# For use with Sun WorkShop's Source browser."
===================================================================
RCS file: configure.in,v
retrieving revision 1.1
diff -c -r1.1 configure.in
*** configure.in	1997/05/27 14:54:49	1.1
--- configure.in	1997/05/27 15:01:58
***************
*** 452,458 ****
  TTY options:
  
  --with-ncurses (*)	Use the ncurses library for tty support.
! --with-gpm (*)		Compile in support for General Purpose Mouse.
  
  
  Additional features:
--- 452,458 ----
  TTY options:
  
  --with-ncurses (*)	Use the ncurses library for tty support.
! --with-gpm (*) 		Compile in support for General Purpose Mouse.
  
  
  Additional features:
***************
*** 2727,2737 ****
     [AC_CHECK_HEADER(termio.h, [AC_DEFINE(HAVE_TERMIO)])])
  
    dnl Autodetect gpm
-   #### Attn: Bill Perry:  Remove next line when GPM support is added
-   test -z "$with_gpm" && with_gpm=no
- 
    test -z "$with_gpm" && { AC_CHECK_HEADER(gpm.h, , with_gpm=no) }
!   test -z "$with_gpm" && { AC_CHECK_LIB(gpm, connect_to_gpm, with_gpm=yes, with_gpm=no) }
    if test "$with_gpm" = "yes"; then
      AC_DEFINE(HAVE_GPM)
      XE_ADD_OBJS(gpmevent.o)
--- 2727,2734 ----
     [AC_CHECK_HEADER(termio.h, [AC_DEFINE(HAVE_TERMIO)])])
  
    dnl Autodetect gpm
    test -z "$with_gpm" && { AC_CHECK_HEADER(gpm.h, , with_gpm=no) }
!   test -z "$with_gpm" && { AC_CHECK_LIB(gpm, Gpm_Open, with_gpm=yes, with_gpm=no) }
    if test "$with_gpm" = "yes"; then
      AC_DEFINE(HAVE_GPM)
      XE_ADD_OBJS(gpmevent.o)
===================================================================
RCS file: ./lisp/x11/x-mouse.el,v
retrieving revision 1.1
diff -c -r1.1 x-mouse.el
*** lisp/x11/x-mouse.el	1997/05/27 14:54:16	1.1
--- lisp/x11/x-mouse.el	1997/05/27 14:54:22
***************
*** 24,31 ****
  ;;(define-key global-map '(shift button2) 'x-mouse-kill)
  (define-key global-map '(control button2) 'x-set-point-and-move-selection)
  
- (setq mouse-yank-function 'x-yank-function)
- 
  (defun x-mouse-kill (event)
    "Kill the text between the point and mouse and copy it to the clipboard and
  to the cut buffer"
--- 24,29 ----

