From xemacs-m  Sat Aug 30 23:18:28 1997
Received: from bittersweet.inetarena.com (karlheg@bittersweet.inetarena.com [206.129.216.38])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id XAA10371
	for <xemacs-beta@xemacs.org>; Sat, 30 Aug 1997 23:18:26 -0500 (CDT)
Received: (from karlheg@localhost)
	by bittersweet.inetarena.com (8.8.6/8.8.6/Debian/GNU) id VAA03002;
	Sat, 30 Aug 1997 21:17:12 -0700
To: XEmacs Beta <xemacs-beta@xemacs.org>
Subject: [patch] double-click navigation for `info'
X-Face: /Q}=yl}1_v7nP)xXo5XjG8+tl@=uVu7o5u6)f]zN?+<hB!K.m9:[|*p34jVN`O;:XZXVSy>/\R>qDt(t8w!-i{(y0"`jFw^uk8inzO9wXabd'CdjUWfC\GHi:6nO*YC89#-qD>Q4r%9!V"<RYJ=7D#$";q=zML5'!=wvXk^$`6FT=5CMofQX)WUKt0p:OKl.mFOXx/D
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/mixed;
 boundary="Multipart_Sat_Aug_30_21:17:07_1997-1"
Content-Transfer-Encoding: 7bit
From: karlheg@inetarena.com (Karl M. Hegbloom)
Date: 30 Aug 1997 21:17:08 -0700
Message-ID: <87lo1jugu3.fsf@bittersweet.inetarena.com>
Lines: 93
X-Mailer: Gnus v5.4.64/XEmacs 20.3(beta18) - "Bratislava"

--Multipart_Sat_Aug_30_21:17:07_1997-1
Content-Type: text/plain; charset=US-ASCII

 The `gv' GhostScript viewer, (GhostView's descendant), lets you
navigate with double clicks on the page.  You can double-click on the
right side of the page, and turn one page forward, and on the left
side to turn one page back.  I thought that would be good for Info
too, so I implemented it.

 David, why won't `strokes' work in Info, Manual-entries, or W3?  How
do we fix it?

 I should take some time to learn more about this.  I Soon will,
promise.  I'm half way through the `libc' info, and about as far
through `lispref'.


1997-08-30  Karl M. Hegbloom  <Karl M. Hegbloom <karlheg@inetarena.com>>

	* packages/info.el (Info-mouse-track-double-click-hook): Added,
 	and placed an `add-hook' into (Info-mode)


--Multipart_Sat_Aug_30_21:17:07_1997-1
Content-Type: text/plain; charset=US-ASCII

Index: xemacs-20/lisp/packages/info.el
===================================================================
RCS file: /usr/local/cvsroot/xemacs-20/lisp/packages/info.el,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 info.el
--- info.el	1997/08/17 08:47:49	1.1.1.5
+++ info.el	1997/08/31 04:08:03
@@ -2239,6 +2239,40 @@
 	  (and name (nth 1 data))))
     (error nil)))
 
+(defun Info-mouse-track-double-click-hook (event click-count)
+  "Handle double-clicks by turning pages, like the `gv' ghostscript viewer"
+  (if (/= click-count 2)
+      ;; Return nil so any other hooks are performed.
+      nil
+      (let* ((x (event-x-pixel event))
+	     (y (event-y-pixel event))
+	     (w (window-pixel-width (event-window event)))
+	     (h (window-pixel-height (event-window event)))
+	     (w/3 (/ w 3))
+	     (w/2 (/ w 2))
+	     (h/4 (/ h 4)))
+	(cond
+	  ;; In the top 1/4 and inside the middle 1/3
+	  ((and (<= y h/4)
+		(and (>= x w/3) (<= x (+ w/3 w/3))))
+	   (Info-up)
+	   t)
+	  ;; In the lower 3/4 and the right 1/2
+	  ;; OR in the upper 1/4 and the right 1/3
+	  ((or (and (>= y h/4) (>= x w/2))
+	       (and (< y h/4) (>= x (+ w/3 w/3))))
+	   (Info-next)
+	   t)
+	  ;; In the lower 3/4 and the left 1/2
+	  ;; OR in the upper 1/4 and the left 1/3
+	  ((or (and (>= y h/4) (< x w/2))
+	       (and (< y h/4) (<= x w/3)))
+	   (Info-prev)
+	   t)
+	  ;; This shouldn't happen.
+	  (t
+	   (error "event out of bounds: %s %s" x y))))))
+
 (defvar Info-mode-map nil
   "Keymap containing Info commands.")
 (if Info-mode-map
@@ -2385,6 +2419,7 @@
 	    (copy-face 'bold 'info-xref))))
   (make-local-variable 'mouse-track-click-hook)
   (add-hook 'mouse-track-click-hook 'Info-maybe-follow-clicked-node)
+  (add-hook 'mouse-track-click-hook 'Info-mouse-track-double-click-hook)
   ;; #### The console-on-window-system-p check is to allow this to
   ;; work on tty's.  The real problem here is that featurep really
   ;; needs to have some device/console domain knowledge added to it.


--Multipart_Sat_Aug_30_21:17:07_1997-1
Content-Type: text/plain; charset=US-ASCII

mailto:karlheg@inetarena.com (Karl M. Hegbloom)
http://www.inetarena.com/~karlheg
Portland, OR  USA
Debian GNU 1.3.1  Linux 2.0.30+parport AMD K5 PR-133

--Multipart_Sat_Aug_30_21:17:07_1997-1--

