Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unwanted keybinding translation

11 views
Skip to first unread message

Thorsten Jolitz

unread,
Aug 31, 2012, 5:56:25 PM8/31/12
to help-gn...@gnu.org

Hi List,

I have the following in my .emacs (since the C-M-v keybinding does not
work on the console in my case):

,---------------------------------------------------------
| ; global key for scroll up a window
| (global-set-key (kbd "C-v") 'scroll-up-command)
|
| ; global key for scroll down a window
| (global-set-key (kbd "M-v") 'scroll-down-command)
|
| ; global key for scroll up other window
| (global-set-key (kbd "C-S-v") 'scroll-other-window)
|
| ; global key for scroll down other window
| (global-set-key (kbd "M-S-v") 'scroll-other-window-down)
`---------------------------------------------------------

(I know that C-v and M-v are the defaults, but if I don't redefine theme
here things don't work out at all)

When I do C-h k 'M-V' I get:

,----------------------------------------------------------------------
| M-v (translated from M-V) runs the command scroll-down-command, which
| is an interactive compiled Lisp function in `window.el'.
|
| It is bound to <prior>, M-v.
`----------------------------------------------------------------------

while doing C-h k 'C-V' I get, as expected:

,--------------------------------------------------------------------
| C-S-v runs the command scroll-other-window, which is an interactive
| built-in function in `C source code'.
|
| It is bound to C-S-v, <M-next>, C-M-v, ESC <next>.
`--------------------------------------------------------------------


Why is that so? Is that more or less a random thing if uppercase and
lowercase keybindings are respected?

--
cheers,
Thorsten



Oleksandr Gavenko

unread,
Sep 1, 2012, 3:26:05 AM9/1/12
to help-gn...@gnu.org
On 2012-09-01, Thorsten Jolitz wrote:

> I have the following in my .emacs (since the C-M-v keybinding does not
> work on the console in my case):
>
To debug key sequence translation in console use Expect script:

https://sourceforge.net/u/gavenkoa/utils/ci/tip/tree/misc/keyseq.exp?format=raw

or such C program:

#include <stdlib.h>
#include <stdio.h>

int main()
{
int ch;
while ((ch = getchar()) != EOF) {
if (ch == 27) {
puts("key: \\e");
} else if (ch <= 26) {
printf("hex: ox%02x, key: \\C-%c\n", ch, ch+64);
} else {
printf("hex: ox%02x, key: %c\n", ch, ch);
}
}
return EXIT_SUCCESS;
}

You can switch terminal in raw mode before run C program:

$ stty raw

or press RET after.

--
Best regards!


Thorsten Jolitz

unread,
Sep 1, 2012, 8:45:01 AM9/1/12
to help-gn...@gnu.org
Oleksandr Gavenko <gave...@gmail.com> writes:

> On 2012-09-01, Thorsten Jolitz wrote:
>
>> I have the following in my .emacs (since the C-M-v keybinding does not
>> work on the console in my case):
>>
> To debug key sequence translation in console use Expect script:
>
>https://sourceforge.net/u/gavenkoa/utils/ci/tip/tree/misc/keyseq.exp?format=raw
>
> or such C program:

Thanks, I downloaded the script, looks quite useful, have to try it out.

--
cheers,
Thorsten


0 new messages