hws@ICSI.Berkeley.EDU (Heinz Schmidt) (01/17/91)
Archive-name: emacs/epoch/sky-mouse/1991-01-15 Archive-directory: icsi-ftp.berkeley.edu:/pub/ai/sky-mouse/ [128.32.201.55] Original-posting-by: hws@ICSI.Berkeley.EDU (Heinz Schmidt) Original-subject: multiple clicks to extend selections Reposted-by: emv@ox.com (Edward Vielmetti) >Does anyone have modifications to Epoch that >extend the marked region in a mode dependent >way? For example, in lisp mode, a single click >would simply move the point as it does now, >a double click would mark the atom, string, or >sexpression enclosing the mouse pointer, a triple >click would mark the next level of enclosing sexpression >etc. >A really beautiful system would have the following >addtional behaviour: if a modifier key is pressed (shift >or meta or L8 etc) the region selected by the mouse >clicks would be copied to the current point. A different >modifer (or set of modifiers) would move the selected region >to the current point. >I don't have time to go into it myself, though it seems >that it would be a fairly simple addition to the Laprade >patches. Some of this is done in the sky-mouse package (icsi-ftp.berkeley.edu /pub/ai) that I wrote, definitely not all of it. It is based on the thing syntax (epoch-lisp/thing.el). I use it with various language modes including less parentheses oriented languages than Lisp and C. Here is a piece of mode doc that explains how one selects (no multi click support for now) so you may get the idea... You Point To Mouse Hits end of line line comment-start comment to end of line word char word symbol char symbol punctuation char to end of next symbol open paren char group close paren char group whitespace whitespace keyword first char corresponding language construct The keyword first char is a recent thing not yet posted. It is independent of the mouse though, just an extension to thing.el. The mouse is intended as a `syntactic cue', you strike a construct whose syntax is known to Emacs/Epoch and make it highlight, indent, yank itself to the current cursor position etc. It turns out that single characters are large enough to hit them reliably, cf. marking s-expressions in Lisp by pointing to paren's. So why not just simply use a 'spatial/visual' encoding of what the object is to be manipulated and a 'manual/motoric' (modifier/button) encoding for what the tool is that we want to apply? It would be cute if the mouse cursor would also give visual feedback of what the current tool is all about but I didn't come around to add this. Epoch makes this very easy. Here also a short list of key/button bindings from sky-mouse README: C-h z or M-x help-with-mouse documents mouse button as you press C-h Z or M-x help-with-mouse-tutorial puts you an online mouse tutorial much (verbose) like c-h t. Mod Left Middle Right Window manager -- Select Extend Paste olwm -- Select Paste Extend not olwm S Mark Thing Save/Kill/Yank -- C Exit minibuffer Kill to point scroll to point M Toggle Focus Yank to point Warp to point M-S Exec kbd macro -- -- C-M Mark Thing Yank to point Fill or indent C-M-S Help Mouse Help Mouse Help Mouse Only Emacs x-mouse C-S Select buffer menu Help/Info menu -- For yank-to-point to work, one fixes the keyboard focus (toggle-focus) to an Epoch screen with one strike and goes after thing(s) in this or other Epoch screens. Toggle-focus moves the focus when you hit a non-focused window and releases the focus when you hit the focused window. warp-to-point warps the mouse to the cursor in the focus screen. Fill-or-indent uses language mode variables and point context to figure whether this is program or comment (you are most likely not willing to fill a procedure body) so with a single button you get it right (in programming language modes) most of the time. -- Heinz -------------------------------------------------------------------------- Heinz W. Schmidt hws@icsi.berkeley.edu International Computer Science Institute, Berkeley (415) 642-4274 x175 /\\/\\|;; \//\//|-- ... signature building can be addictive ...