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

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

Re: Strange characters produced by M-x in emacs -nw


From: Harry Putnam
Subject: Re: Strange characters produced by M-x in emacs -nw
Date: Fri, 20 Sep 2013 16:21:24 -0400
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.0.92 (gnu/linux)

Bob Proulx <bob@proulx.com> writes:

> Harry Putnam wrote:
>> `M-x' produces   'ø'
>> `M-Shift + !' produces '¡'
>> `M-shift + :  produces 'º'
>> [...]
>> That said, yes, I am referring to the Alt labeled on most common
>> keyboards... at least in the US.
>> [...]
>> I'm still puzzled but the way this problem just turned up sort of
>> suddenly. .. I mean I don't often use emacs -nw when in X but it can't
>> have been more that 5-6 mnths since last time.
>> 
>> So something has changed in my environment on my Debian Linux box of
>> several yrs standing.  Possibly an update or something.  I had
>> thoughts of tracking it down... but probably a loosing battle since
>> I'm not sure of when the change occurred.
>
> Almost certainly something with your keyboard mapping has changed.  I
> suspect that the Alt key has been configured as an AltGr key, or a
> compose key, or other such modifier.  It definitely isn't normal for
> Alt-x to produce the special zero character.  Which Alt key is this?
> The left or right Alt key?  Or both?

Both

Perhaps the output of xmodmap will tell you something?
(PS - I have not ~/.xmodmap)

,----
| xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):
| 
| shift       Shift_L (0x32),  Shift_R (0x3e)
| lock        Caps_Lock (0x42)
| control     Control_L (0x25),  Control_R (0x69)
| mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
| mod2        Num_Lock (0x4d)
| mod3      
| mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
| mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)
`----

> Check the timestamp to see if the file /etc/default/keyboard has
> been updated recently?

It is fairly new (Aug 5), but running a diff on it going back as far as
July of 2012... it hasn't changed. It does specify a 105 key keyboard
and mine is 104... but it must have said 105 longer than I have had
this problem.  

I did do a fairly hefty update fairly recently but had been noticing
this problem for a while.

,----
| Content of /etc/defajult/keyboard
| XKBMODEL="pc105"
| XKBLAYOUT="us"
| XKBVARIANT=""
| XKBOPTIONS=""
| 
| BACKSPACE="guess"
`----

Here is something I just recalled; I just remembered, that I did have
to buy a new keyboard recently... but its one of logitech's cheapo
models.. bought at Walmart)

> . . . . . . . . . . This is also managed by the
> keyboard-configuration package in Debian.  You can run
> 'dpkg-reconfigure keyboard-configuration' if you would like to
> re-run the package configuration dialogs.  After reconfiguring any
> custom xmodmap commands such as to remap the control key will need
> to be run again.

I have no custom .xmodmap to worry about, haven't every really noticed
a need for it. Except when I run openindian (a solaris variant) or
Oracle solaris.  Those are not emacs friendly like most linux
distros. 

Should I expect any changes brought about by running the dpkg stuff,
to take effect immediately or do I need to restart X?


> You should decide what keys you would like to use for AltGr and
> Compose.  Thinking about laptops without all of the keys means that
> sometimes compromises must be made to select the best available key
> and sometimes not the best key everywhere.  For example on my laptop
> I use the right Alt for AltGr and right Control for Compose.  But
> the logo key and the menu key are also possible.

I'd never heard of an Altgr key.  And just now googling It appears not
to be something I'd get much out of... also appears to be usually on
the right where my keyboard just says Alt.

I'm probably not thinking clearly but why do I need to decide which
keys I want to use for it?  Is it now a default thing on all keyboards
or something?

> A typical configuration line from /etc/default/keyboard might be:
>
>   XKBOPTIONS="lv3:ralt_switch,compose:menu,terminate:ctrl_alt_bksp"

Mine, which must be default since I've not meddled with it, (unless it
is meddled with during install?)) doesn't have any OPTIONS ... just ""

> [Of course choice of terminate is old-school and has become
> controvercial of late.  I still prefer it.  YMMV.  I will include it
> but if you think it is dangerous then by all means leave it off.]

Once again, I don't know what you are talking about right above.

What is 'Terminate' used in that context?

> Alternatively you can twiddle the mapping directly using the setxkbmap
> command.  I would play with the following interactively and see if it
> solves your problem.
>
>   $ setxkbmap -model pc104 -layout us -option compose:rctrl -option
> 

Should I see results immediately or does this require a restart of X? 

> Or if not try setting the AltGr variant explicitly:
>
>   $ setxkbmap -model pc104 -layout us -variant altgr-intl -option
> compose:rctrl -option terminate:ctrl_alt_bksp

Neither of those has any immediate effect.

> Does that repair your problem with Alt?  (For me I move control and
> other customizations using xmodmap.  Therefore after running the above
> which resets everything note that I load 'xmodmap $HOME/.xmodmap' in
> order to overlay my customizations.)
>
> To see what the Compose key setting is doing try these combinations.
> Do not hold down the Compose key.  It is not a shift or control key
> any longer.  Tap the Compose key.  Nothing will be displayed.  Tap the
> next letter.  Nothing will be displayed.  Tap the final letter.  The
> composed character will be displayed.  One, two, three.  Tap, tap,
> tap.  The letter is displayed after the third keystroke.

First off, what and where is the 'compose' key

>   Compose e ' -> é
>   Compose a " -> ä
>   Compose A ` -> À
>
> Or the reverse.  Use whichever makes sense to your brain.
>
>   Compose ' e -> é
>   Compose " a -> ä
>   Compose ^ a -> â
>   Compose , c -> ç

I don't see any of this happening with any of my keys listed:

Left (going left from space bar):
Ctrl, windows logo  key (left of alt on left side - I've never
known what that does), Alt.

Right (going right from spacebar):

Alt, Windows logo, Key with what looks like an image of a list?, Ctrl

None of those do anything like what you show above.

The only one that does anything on the first tap is the one that looks
like a list, and it makes `9~'

> And if you have loaded the AltGr variant then you can use
> Right-Alt-somekey to produce characters using chords.  AFAIK it is six
> of one and a half dozen of the other.  Personal preference as to which
> you prefer.  Personally I prefer the Compose key.
>
> The entire set of possible combinations is listed in this file.  The
> Compose key there is listed as Multi_key.  To see how to type in any
> particular character look through the file and see the combination.
>
>   /usr/share/X11/locale/en_US.UTF-8/Compose

Well, thanks for that, there are occasions when I want something
unusual... the so called `mid-dot' springs to mind. (Tiny o in center
of the line).

[...] snipped interesting stuff

>
>   XTerm*metaSendsEscape:true

Another poster recommed that... but his was all lowercase, does it matter?

-------        ---------       ---=---       ---------      -------- 

Thanks for all the helpful input.

I'm still working with your suggestions and would appreciate any
further input you might have.  Hopefully some of my meandering will
help you get a better idea of what I have here.




reply via email to

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