From nobutaka@narcissus.pel.sys.hiroshima-u.ac.jp  Sat Dec 18 20:10:53 1999
Return-Path: <nobutaka@narcissus.pel.sys.hiroshima-u.ac.jp>
Received: from narcissus.pel.sys.hiroshima-u.ac.jp (narcissus.pel.sys.hiroshima-u.ac.jp [133.41.37.161])
	by hub.freebsd.org (Postfix) with ESMTP id 6BD4D14BF1
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Dec 1999 20:10:51 -0800 (PST)
	(envelope-from nobutaka@narcissus.pel.sys.hiroshima-u.ac.jp)
Received: (from nobutaka@localhost)
	by narcissus.pel.sys.hiroshima-u.ac.jp (8.9.3/8.9.3) id BAA05626;
	Sun, 19 Dec 1999 01:36:33 +0900 (JST)
	(envelope-from nobutaka)
Message-Id: <199912181636.BAA05626@narcissus.pel.sys.hiroshima-u.ac.jp>
Date: Sun, 19 Dec 1999 01:36:33 +0900 (JST)
From: nobutaka@nobutaka.com
Sender: nobutaka@narcissus.pel.sys.hiroshima-u.ac.jp
Reply-To: nobutaka@nobutaka.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Additional patches for www/w3m
X-Send-Pr-Version: 3.2

>Number:         15556
>Category:       ports
>Synopsis:       Additional patches for www/w3m
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 18 20:20:01 PST 1999
>Closed-Date:    Fri Dec 24 17:40:54 PST 1999
>Last-Modified:  Fri Dec 24 17:41:45 PST 1999
>Originator:     MANTANI Nobutaka
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
Hiroshima University
>Environment:
>Description:

Here are additional patches (patch-al, patch-am) for www/w3m port.

w3m doesn't check whether it is running on xterm or not.
Therefore w3m puts xterm escape sequences when it is running on console.
patch-al fixes this problem.

And patch-am adds support for Home/End/PgUp/PgDn keys on console.

>How-To-Repeat:
>Fix:

diff -urN w3m.old/patches/patch-al w3m/patches/patch-al
--- w3m.old/patches/patch-al	Thu Jan  1 09:00:00 1970
+++ w3m/patches/patch-al	Sat Dec 18 16:55:26 1999
@@ -0,0 +1,55 @@
+--- terms.c.orig	Sat Dec 18 16:46:16 1999
++++ terms.c	Sat Dec 18 16:53:51 1999
+@@ -14,8 +14,8 @@
+ #include <string.h>
+ #ifdef USE_GPM
+ #include <gpm.h>
+-static int is_xterm = 0;
+ #endif
++static int is_xterm = 0;
+ 
+ #ifdef AIX
+ #include <sys/select.h>
+@@ -1471,16 +1471,23 @@
+     gpm_handler = gpm_process_mouse;
+   }
+ #endif
++  char *term;
++
++  if (mouseActive) return;
++  term = getenv("TERM");
++  if (!strncmp(term,"kterm",5) || !strncmp(term,"xterm",5)) {
++    is_xterm = 1;
++  }
+   mouseActive = 1;
+ }
+ 
+ void mouse_end()
+ {
+   if (mouseActive == 0) return;
+-#ifdef USE_GPM
+   if (is_xterm) {
+     XTERM_OFF;
+   }
++#ifdef USE_GPM
+   else
+     Gpm_Close();
+ #endif
+@@ -1491,17 +1498,13 @@
+ {
+   if (!mouseActive)
+     mouse_init();
+-#ifdef USE_GPM
+   if (is_xterm)
+-#endif
+     XTERM_ON;
+ }
+ 
+ void mouse_inactive()
+ {
+-#ifdef USE_GPM
+   if (is_xterm)
+-#endif
+     XTERM_OFF;
+ }
+   
diff -urN w3m.old/patches/patch-am w3m/patches/patch-am
--- w3m.old/patches/patch-am	Thu Jan  1 09:00:00 1970
+++ w3m/patches/patch-am	Sun Dec 19 00:40:32 1999
@@ -0,0 +1,14 @@
+--- keybind.c.orig	Mon Dec  6 15:18:33 1999
++++ keybind.c	Mon Dec  6 15:24:31 1999
+@@ -90,9 +90,9 @@
+ /* 8      9       :       ;       <       =       >       ?        */
+   nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,
+ /* @      A       B       C       D       E       F       G        */
+-  nulcmd, movU,   movD,   movR,   movL,   nulcmd, nulcmd, nulcmd,
++  nulcmd, movU,   movD,   movR,   movL,   nulcmd, goLineL,pgFore,
+ /* H      I       J       K       L       M       N       O        */
+-  nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, mouse,  nulcmd, nulcmd,
++  goLineF,pgBack, nulcmd, nulcmd, nulcmd, mouse,  nulcmd, nulcmd,
+ /* P      Q       R       S       T       U       V       W        */
+   nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,
+ /* X      Y       Z       [       \       ]       ^       _        */

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Fri Dec 24 17:40:54 PST 1999 
State-Changed-Why:  
Committed, thanks! 
>Unformatted:
