views:

1048

answers:

3

I am trying to learn Emacs and trying to find best keyboard layout for me. One thing is really annoying me. I have added following lines to .emacs

(global-set-key "\C-y" 'scroll-up)
(global-set-key "\M-y" 'scroll-down)

And it works but, if I hold Control and press ‘y’ few time it will scroll page down every time bat if I hold Windows key (mapped as Meta) and press ‘y’ few times it will scroll up only first time and for every successive key presses I will get character ‘y’ in the buffer. Can the page up behave like page down ? I want to hold Meta and keep pressing ‘y’ to scroll multiple pages up.

I am using GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2008-05-12 on LENNART-69DE564 (patched). It is Emacs with EmacsW32 patch. Is this problem with this Emacs ? Problem with Meta key ?

I tried original GNU Emacs (not patched) and it works OK with Alt. But my problem is not that I want to scroll without releasing any key. I release key 'y' and press it multiple times but don't want to have to release Meta key. Same problem is described here:

http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/f30f4b75a8b75b10

Problem is not in that I have changed key mapping. It looks like it is a bug in EmacsW32 version. Here is another description of the problem: Unreleased Meta/Win modifier

+3  A: 

Could this be a side affect of using the Windows key as Meta? I'm thinking this because in a non-Emacs situation if you press and hold the Windows key and another key for a short cut (Win+E for Explorer, Win+R for Run dialog, etc.) the desired action only triggers once, not multiple times if you keep holding it down.

I'd try reassigning Meta to Alt and see if the problem persists. If it doesn't, then I'm not sure what other option you have, since likely it's the OS only sending the Windows key press once to the app in focus.

Andy
A: 
  1. Use C-v and M-v.
  2. Don't change C-y, M-y default bindings.
J.F. Sebastian
I can't imagine what emacs would be with C-y mapped to anything other than the default. I use C-y probably hundreds of times a day. Definitely if you want to learn emacs, don't remap C-y.
Bryan Oakley
I am a long time windows user and I am used to x/c/v for cut/copy/paste. I use those keys hundreds of times a day. But it is not problem that I changed the keys it is problem in EmacsW32 and windows key.
Robert Vuković
A: 

You should use the patched EmacsW32 version, if you want the Windows key as Meta.

From the site about the patches:

"Changes that makes it possible to use the window keyboard keys as META in Emacs. Without this patch key sequences like E will always do what they by default does in windows, ie in this case open up Windows Explorer. (This patched is not used by default, you have to turn it on.)"

ahoka
I am using EmacsW32 and I think that this is a bug. With original Emact it is working OK.
Robert Vuković