Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!rutgers!aramis.rutgers.edu!athos.rutgers.edu!gaynor From: gaynor@athos.rutgers.edu (Silver) Newsgroups: comp.editors Subject: Re: why do editors "shrink-wrap" the text? Message-ID: Date: 17 Apr 89 00:57:22 GMT References: <1686@wpi.wpi.edu> <97499@sun.Eng.Sun.COM> <3903@mipos3.intel.com> Distribution: na Organization: Rutgers Univ., New Brunswick, N.J. Lines: 42 > Ack! It doesn't work with the mouse. Afraid to get your hands dirty? The following function does what you want (I think), a trivial change to x-mouse-set-point. ;; Copyright (C) 1987, 1989 Free Software Foundation, Inc. (defun x-mouse-set-point (position &optional force) "Select Emacs window under the mouse, and move point to character nearest the mouse position. If FORCE is non-nil, appropriate whitespace is inserted to ensure that point is moved to the mouse's position." (let* ((relative-coordinate (x-mouse-select position)) (rel-x (car relative-coordinate)) (rel-y (car (cdr relative-coordinate)))) (if relative-coordinate (let ((delta-y (- rel-y (move-to-window-line rel-y))) (delta-x (- rel-x (move-to-column (+ rel-x (current-column)))))) (if force (progn (if (/= delta-y 0) (newline delta-y)) (if (/= delta-x 0) (indent-to-column rel-x)))))))) ;; Suitable for picture-mode. (defun x-mouse-set-point-force (position) "Like x-mouse-set-point, except the no FORCE is supplied - it is always t. So, the point is always moved directly to the mouse." (x-mouse-set-point position t)) Ok, so that's takes care of the function. Now, to bind it to a key... ;; Example binding for x-mouse-set-point-force, to the left button, shifted. (define-key mouse-map x-button-s-left 'x-mouse-set-point-force) > Tacked on is right. Are you saying picture mode is `tacked on' to GNU Emacs? Whadya want, it works... Considering what it does, I'd say it's not bad at all. I mean, it changes one of the basic, hard-coded premises of buffers in Emacs. And although it took a little work and thought, by looking at the code I guess that it wasn't difficult to implement, and it doesn't look difficult to extend. Regards, [Ag] gaynor@rutgers.edu