Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/12/84; site nbs-amrf.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!amdcad!lll-crg!gymble!neurad!nbs-amrf!manheime From: manheime@nbs-amrf.UUCP (Ken Manheimer) Newsgroups: net.emacs Subject: Re: emacs mouse support (an mlisp/gosmacs employment) Message-ID: <112@nbs-amrf.UUCP> Date: Fri, 17-Jan-86 14:31:52 EST Article-I.D.: nbs-amrf.112 Posted: Fri Jan 17 14:31:52 1986 Date-Received: Sun, 19-Jan-86 04:25:58 EST References: <912@mit-eddie.UUCP> <5@emacs.UUCP> Organization: National Bureau of Standards Lines: 74 I've been meaning to post various gadgets and modifications i've developed for the local installation of emacs, which happens to be Unipress' (out of gosling's) Emacs V 2.01. One of the more fun efforts involved employing the fairly rudimentary handles Unipress provided to the Sun mouse (to better effect than the trivial routines provided in ../maclib/D.term/sun.ml with the distribution). The most interesting aspect in this effort, for me, was deciding upon the most suitable functions to implement, given the handles i had. The results are mixed. As with many of the tweaks Unipress provided to incorporate features of the Sun window system within emacs (e.g. dynamic resizing of the emacs session's window), the concepts seem attractive but in practice the gadgets aren't particularly important. On the other hand, i am still pleased with the balance of functionality i wound up with; this may be due to that syndrome wherein programmers are convinced of the aesthetics of their programs regardless of their ultimate practical worth... (And by aesthetics i don't mean the code (goodness no :-) just the, um, tidiness of the set of functions/key mappings.) In any case, i'd like to summarize the functions i provided and, in case anyone is interested in using them, i'll post the mlisp in a separate message. First of all, early on it became clear that i ought to emphasize browsing (as opposed to mutative) functions for the mouse. The main reason for this was in the limitations of the protocols - events are produced only during the downstroke of single keys and no shifts are available. (However, it is possible to do other things, like determine the position of the cursor just after the event, which i used to advantage.) I assigned different functionalities to the three sun mouse buttons, qualified by the region of the Sun window the mouse inhabited (relative to the cursor). Generally, when the mouse is in the same window as the cursor, the action involves absolute positioning wrt the mouse position. Interactions with other windows happen when the mouse and cursor are in different windows during an event, and in two instances the echo line is used as a proportional-positioning (scroll bar) scale when the mouse inhabits it. What follows are the particulars (taken, for times sake, pretty much directly from the mlisp comments): - The left mouse button deals with marks. - The left mouse button sets an anonymous mark at the dot (gosmacs term for cursor position) if the mouse is not in the minibuffer (gosmacs term for the extended-command echo line); otherwise exchanges dot and mark. - The middle mouse button provides cursor positioning, within a window, between buffers, or throughout a buffer. - The middle moves the dot to the mouse if the mouse is within (or on the mode line of) a non-minibuffer buffer; the dot is moved across buffers if necessary (i.e. when the mouse and cursor are in different buffers). When the mouse is in the minibuffer the dot is moved to a position in the current buffer proportional to the position of the mouse on the minibuffer line (first and last character positions in the minibuffer line insured to map to the beginning and end of the buffer). - The right button provides window/buffer scrolling. - The right, when clicked in the same buffer as the cursor, moves the line containing the cursor to the selected line. If the mouse is in another (non-minibuffer) window then the cursor's buffer is swapped into that window and vice-versa (this provides a means for juggling the contents of windows on the screen). If clicked in the minibuffer the current buffer window is moved backward/forward a portion of a page proportional to the distance of the mouse from the minibuffers center, with full left going back and full right going forward a full page. (forward and reverse scrolling up to a page at a time).