help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: emacs displaying backslash incorrectly


From: Pascal J. Bourguignon
Subject: Re: emacs displaying backslash incorrectly
Date: Wed, 08 Dec 2010 15:27:46 -0000
User-agent: Gnus/5.101 (Gnus v5.10.10) Emacs/23.2 (gnu/linux)

lraae <lcraae@gmail.com> writes:

> Hi, I have a weird problem which I can't seem to find anything about
> on the web: When I type a backslash, emacs displays it as a capital W
> with a double strikethrough.
>
> This is Emacs 23.1.1 on Linux Fedora 12 (2.6.32.19-163.fc12.i686.PAE).
>
> I tried "emacs -q" to run without startup file, but the problem
> remains. This is a school administered computer, so I don't have root
> access.
>
> Hope someone might have an idea how to proceed in solving this.

It may be because your terminal (or X window) is configured to send ₩
(Korean Won) when you type that key.

Or perhaps emacs has a keyboard translation translating \ to ₩.

Or perhaps \ is bound to a function inserting ₩.

Or perhaps you've activated an input method such that when you type \
you get ₩.


Since you get the same with emacs -q, it may be configured so in the
site initialization files.  Try again with emacs -Q to avoid those.


If it's X windows that's sending ₩, you may check first what key code
correspond to you backslash key with xev:

    M-x shell RET xev RET

When typing the backspace key in xev window, you should get something
like the following in the shell buffer:

KeyPress event, serial 27, synthetic NO, window 0x2400001,
    root 0x15e, subw 0x0, time 395774908, (1101,528), root:(1101,528),
    state 0x0, keycode 51 (keysym 0x5c, backslash), same_screen YES,
    XLookupString gives 1 bytes: (5c) "\"
    XmbLookupString gives 1 bytes: (5c) "\"
    XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x2400001,
    root 0x15e, subw 0x0, time 395774972, (1101,528), root:(1101,528),
    state 0x0, keycode 51 (keysym 0x5c, backslash), same_screen YES,
    XLookupString gives 1 bytes: (5c) "\"
    XFilterEvent returns: False

(You may type C-c C-c in the shell buffer to kill xev).


On my keyboard, the keycode of the backslash key is 51 (decimal).   
It is translated to the keysym backslash (#x5c = ascii code for '\'),
which would be what my emacs would receive.

You can check the whole keycode->keysym translation map with:

    M-x shell RET xmodmap -pke RET


To reset the mapping of a key code you can use:

    M-x shell RET xmodmap -e 'keycode  51 = backslash bar'

assuming your backspace key has the keycode 51.


Notice that keycodes depend on the keyboard hardware.

You could keep around various custom xmodmap files, one per keyboard
model you use, and load them with:

    M-x shell RET xmodmap ~/rc/xmodmap-daskeyboard-3 RET

or whatever.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/


reply via email to

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