From xemacs-m  Wed Mar 26 13:47:52 1997
Received: from jens.metrix.de (jens@jens.metrix.de [194.123.88.124])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id NAA03890
	for <xemacs-beta@xemacs.org>; Wed, 26 Mar 1997 13:47:47 -0600 (CST)
Received: (from jens@localhost) by jens.metrix.de (8.7.6/8.7.3) id UAA00425; Wed, 26 Mar 1997 20:47:14 +0100
To: xemacs-beta@xemacs.org
Subject: Re: treedir wierdness
References: <u9vi6e1new.fsf@neal.ctd.comsat.com>
X-Face: Z[@OB)("ZvE?ev~1b+b!0ZUB.$%rh.9qE>dVf>q}Q/V?%d`J3gd!LR\aAZ8<Hwi]xTA(:*c;i3,?K?+rCy*^b$)a,}E?eo},}x2]5LlJysyoUOK"o[>K)'\Ulb7y-7*.If^;rHl['oa)n_M7E6w+LDKMs"G8_`c)uOS1^}.1|8Ill]7X68X-paeUOpBhz<F`B0?~^2Et~GYfw~/0]H]nx4~C_E/_mp#^7Ixc:
Reply-To: jens@lemming0.lem.uni-karlsruhe.de
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: multipart/mixed;
 boundary="Multipart_Wed_Mar_26_20:47:12_1997-1"
Content-Transfer-Encoding: 7bit
From: Jens Lautenbacher <jens@metrix.de>
Date: 26 Mar 1997 20:47:12 +0100
In-Reply-To: Neal Becker's message of 26 Mar 1997 14:08:39 -0500
Message-ID: <m34tdy3073.fsf@jens.metrix.de>
Lines: 103
X-Mailer: Gnus v5.4.33/XEmacs 19.15(beta103)

--Multipart_Wed_Mar_26_20:47:12_1997-1
Content-Type: text/plain; charset=US-ASCII

Neal Becker <neal@ctd.comsat.com> writes:

> I had 2 windows, 1 above the other.  In the bottom, I did M-x
> treedir.  Now the top window is split into two, side-by-side, with
> BOTH showing the SAME treedir.
treedir is alpha software currently (version is 0.3!). It's more of a
design study than actual useful. I *will* continue on this, but I need
some time for real work currently. Maybe it would be better if you
would mail me directly than posting to the list (but on the other
hand: Who am I that I wouldn't like propaganda for treedir? - even if
it's bug propaganda -)

> BTW: wouldn't it be nice if there was something to grab to drag over
> the divisions between side-by-side windows?
There is something. I havn't written it, and it doesn't work _that_
good, but maybe one can hack this up a bit. I'll include it below.
 
> BTW: wouldn't it be nice if Message mode would stop coloring all the
> lines in my message that have a colon, like the one I just typed?
Yes. It would be very nice.

Here's the drag-on-vertical-bars thingie. I don't know anymore where I have
this from. Maybe if the original author is reading this he could
provide us with the info (and tell if he did something more with it) 

	jtl


--Multipart_Wed_Mar_26_20:47:12_1997-1
Content-Type: application/octet-stream; type=emacs-lisp
Content-Disposition: attachment; filename="mouse-sep.el"
Content-Transfer-Encoding: 7bit

(defvar separator-drag-mouse-button 'button1
  "*The mouse button to overload with horizontal window resize drag behavior.
While this mouse button is pressed in the square where horizontal and vertical
scrollbars meet, you can drag to resize the window, release it to stop.")

(defconst separator-drag-mouse-button-original-command
  (global-key-binding separator-drag-mouse-button)
  "The command run by the global binding of separator-drag-mouse-button.
This is the command that will be run whenever mouse-on-separator-p is nil.")

(defun mouse-on-separator-p (event)
  "t if EVENT in the square below a vertical scrollbar.
This square only exists in windows with horizontal and vertical scrollbars."
  (interactive "e")
  (> (event-x-pixel event)
     (- (nth 2 (window-pixel-edges (event-window event))) 
	(specifier-instance scrollbar-width))))

(defun mouse-drag-separator (event)
  "Resize the current window horizontally by dragging the mouse."
  (interactive "e")
  (if (not (mouse-on-separator-p event))
      (funcall separator-drag-mouse-button-original-command event)
    (or (button-press-event-p event)
	(error "%s must be invoked by a mouse-press" this-command))
    (let ((mouse-down t)
	  (window (event-window event))
	  (def-line-width (face-width 'default))
	  (prior-drag-event-time 0)
	  (delta 0))
      (while mouse-down
	(setq event (next-event event))
	(cond ((motion-event-p event)
	       (if (window-rightmost-p window)
		   (error "can't drag rightmost window"))
	       (cond ((> (- (event-timestamp event) prior-drag-event-time)
			 drag-modeline-event-lag)
		      (setq prior-drag-event-time (event-timestamp event)
			    delta (+ delta
				     (/ (- (event-x-pixel event)
					   (nth 2 (window-pixel-edges window)))
					def-line-width)))
		      (if (= delta 0)
			  nil
			(select-window window)
			(if (>= (+ (window-width window) delta)
				window-min-width)
			    (enlarge-window-horizontally delta))
			(sit-for 0)))))
	      ((button-release-event-p event)
	       (setq mouse-down nil))
	      ((or (button-press-event-p event) (key-press-event-p event))
	       (error ""))
	      (t (dispatch-event event)))))))

(defvar mouse-sep-loaded nil)

(if (not mouse-sep-loaded)
    (progn				; In case someone loads us twice...
      (global-set-key separator-drag-mouse-button 'mouse-drag-separator)
      (setq mouse-sep-loaded t)))

(provide 'mouse-sep)



--Multipart_Wed_Mar_26_20:47:12_1997-1--

