Article View: gnu.emacs.help
Article #189059Re: binding mouse buttons
From: Michael A. Patton
Date: Fri, 10 May 1991 13:44
Date: Fri, 10 May 1991 13:44
49 lines
2762 bytes
2762 bytes
From: jay_b@cauchy.leland.stanford.edu (F. Jay Bourland 382P)
Date: 10 May 91 03:17:25 GMT
I couldn't find this in the FAQ (maybe it should be added?). How do
you bind the mouse buttons to new functions.
Definitely sounds like a good idea, but I thought this WAS there
somewhere...
I tried "(define-key mouse-map x-button-s-right 'x-find-file)", but it
didn't work.
This is exactly the right thing. You probably tried it directly in
your .emacs, though, and that doesn't work. The mouse code hasn't
been loaded yet, also you may not want to do this if something other
than X is running (even if you're SURE you'll never do that, when you
do (I didn't say "if") you'll find strange effects and not recognize
that your init file is to blame). Below my signature is the exact
section of my .emacs file that does a similar thing, season to taste.
I tried preceeding with (provide 'x-mouse) but that didn't help.
It probably made things worse, you were telling emacs that the x-mouse
support is already provided, perhaps you meant "(require 'x-mouse)",
that should have worked (but ignores the non-X case).
I'm guessing I have to set some hook here (ie when the
x-mouse.el file is read) but I don't know which one.
See below... The hook is term-setup-hook
__
/| /| /| \ Michael A. Patton, Network Manager
/ | / | /_|__/ Laboratory for Computer Science
/ |/ |/ |atton Massachusetts Institute of Technology
Disclaimer: The opinions expressed above are a figment of the phosphor
on your screen and do not represent the views of MIT, LCS, or MAP. :-)
----------------------------------------------------------------
;; Rearrange mouse buttons a little (if on x display)
(if (eq window-system 'x)
(setq term-setup-hook
'(lambda ()
(define-key mouse-map x-button-c-left 'x-mouse-keep-one-window)
(define-key mouse-map x-button-left 'x-mouse-set-point)
(define-key mouse-map x-button-middle 'x-mouse-set-mark)
)))
Technical Details
Message-ID:
<MAP.91May10154415@gaak.LCS.MIT.Edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!think.com!mintaka!nntp.lcs.mit.edu!mapReferences:
<JAY_B.91May9231725@cauchy.leland.stanford.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103b8b,c2723366479bb879 X-Google-Attributes: gid103b8b,public X-Google-ArrivalTime: 1991-05-11 05:47:08 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!think.com!mintaka!nntp.lcs.mit.edu!map From: MAP@LCS.MIT.Edu (Michael A. Patton) Newsgroups: gnu.emacs.help Subject: Re: binding mouse buttons Message-ID: <MAP.91May10154415@gaak.LCS.MIT.Edu> Date: 10 May 91 13:44:15 GMT References: <JAY_B.91May9231725@cauchy.leland.stanford.edu> Sender: news@mintaka.lcs.mit.edu Organization: MIT Laboratory for Computer Science Lines: 49 In-Reply-To: jay_b@cauchy.leland.stanford.edu's message of 10 May 91 03:17:25 GMT