[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mouse support does not work

From: Aaron Meurer
Subject: Re: Mouse support does not work
Date: Tue, 10 Jan 2012 15:06:47 -0700

On Tue, Jan 10, 2012 at 2:29 PM, Peter Dyballa <> wrote:
> Am 10.1.2012 um 10:18 schrieb Aaron Meurer:
>> I can't get mouse support to work in emacs.  I've tried various
>> things, but neither scrolling nor any kind of clicking or selection
>> does anything.  I'm using iTerm2 in Mac OS X. I believe it should be
>> supported, as mouse support works perfectly in vim.  I've tried M-x
>> mouse-wheel-mode, M-x mouse-sel-mode, and I've tried putting all kinds
>> of things in .emacs as suggested by various sites, but nothing has
>> worked.
> For me not even scrolling in vim/vi works... (could you describe how you 
> achieve this?)

You have to enable it with `set mouse=a`.  But the default .vimrc from
$VIMRUNTIME/vimrc_example.vim enables it.

> The function mouse-wheel-mode is a toggle. If it's off, then you can type C-h 
> k and then operate the mouse wheel or scroll via the trackpad. In the 
> echo-area ("mini-buffer") you can see that GNU Emacs reports having received 
> multiple <mouse-4> or <mouse-5> events. The function mouse-sel-mode is also a 
> toggle – which I think is not very useful (I have it set off).
> In GNU Emacs you have to load the xt-mouse "package":
>        (require 'xt-mouse)
> and then switch that mode on:
>        (xterm-mouse-mode)

Awesome!  That did it. I can scroll, click to move the cursor, and
select.  Right clicking selects from the cursor position (I guess it's
supposed to do that?).  Middle clicking (iTerm2 lets you set three
finger click to middle click) doesn't do anything, though that's
probably because it isn't set to do anything in my tests.  How can I
test this?

Now that this is working, I have some more questions, if you don't mind:

- I have this setting, from customize:

'(mouse-wheel-scroll-amount (quote (1)))

which is supposed to make scrolling go one line at a time.  But it
goes at least two lines at a time. If I change the 1 to 2, it scrolls
by four lines at a time, and so on.  It won't let me enter 0.5.

- I have momentum scrolling enabled, which means that I can "flick"
the scroll, and it will go aways.  But emacs beeps when it is at the
end and cannot scroll any more, which is really annoying in
conjunction with this, as it beeps several times when I "flick" past
the bottom or top.  Is there a way to disable this beeping?

- Is there a way to make scrolling not kill an I-search?

> It will allow you to select windows (buffers) with the mouse cursor by 
> clicking into one and clicking into the menu bar will show you in a buffer 
> the contents of the selected menu and enable you to make a choice. Clicking 
> onto a file name in dired-mode will open that file for editing in a new 
> window (buffer). GNU Emacs will also receive mouse scroll events. In my 
> rather dumb setup the <mouse-4> and <mouse-5> events are mot bound to any 
> function so that I cannot scroll... (and also in a default setup they're not 
> bound to anything)
> This works in xterm – but not in Apple's Terminal. Hopefully if works in 
> iTerm2!

You can enable it in Apple's Terminal with mouseterm
(  I just tested it in emacs, and
it works there too, though the selection isn't as good as in iTerm2
(it doesn't show the selection until after you let go of the mouse).
It's kind of a hack (it uses SIMBL), so use at your own risk (and
anyway, this means that you have to reinstall after each OS update).

Now if I can just get scrolling to work in less...

Aaron Meurer

> --
> Greetings
>  Pete
> War springs from unseen and generally insignificant causes.
>                                – Anonymous

reply via email to

[Prev in Thread] Current Thread [Next in Thread]