unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Strange characters produced by M-x in emacs -nw
@ 2013-09-17 16:51 Harry Putnam
  2013-09-17 17:10 ` Tim Visher
                   ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: Harry Putnam @ 2013-09-17 16:51 UTC (permalink / raw)
  To: help-gnu-emacs

Running recent emacs-24
on Debian Linux

I don't often use emacs -nw any more and just noticed today that I
have some kind of charset or LANG setting problem that is causing
unusual characters to be printed to my files when using the ALT key
for combos like M-x.

(I hope these characters are reproduced in this post)

`M-x' produces   'ø'
`M-Shift + !' produces '¡'
`M-shift + :  produces 'º'

What kind of setting is likely to be causing this?

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

The above problem was uncovered today because I wanted to use
emacs -nw.   But also I wanted to make emacs start in message mode by
passing what ever is necessary to do that from the command line.

emacs -nw -f message-mode file  does not set message-mode although if
I insert text-mode rather than message-mode it will start in text-mode.

How can I cause emacs -nw to start in message-mode from the command
line. 

One further question is how to pass elisp on the command line to be
processed by emacs as it starts.

emacs -nw <Syntax for passing elisp> file




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-17 16:51 Strange characters produced by M-x in emacs -nw Harry Putnam
@ 2013-09-17 17:10 ` Tim Visher
  2013-09-17 17:36 ` Aurélien DESBRIÈRES
  2013-09-17 18:46 ` Peter Dyballa
  2 siblings, 0 replies; 33+ messages in thread
From: Tim Visher @ 2013-09-17 17:10 UTC (permalink / raw)
  To: Harry Putnam; +Cc: emacs

On Tue, Sep 17, 2013 at 12:51 PM, Harry Putnam <reader@newsguy.com> wrote:
> Running recent emacs-24
> on Debian Linux
>
> I don't often use emacs -nw any more and just noticed today that I
> have some kind of charset or LANG setting problem that is causing
> unusual characters to be printed to my files when using the ALT key
> for combos like M-x.
>
> (I hope these characters are reproduced in this post)
>
> `M-x' produces   'ø'
> `M-Shift + !' produces '¡'
> `M-shift + :  produces 'º'
>
> What kind of setting is likely to be causing this?

You're `Alt` key is almost certainly being captured by your terminal
app and translated to a unicode char.

Terminal apps generally have a setting which can translate `Alt` to
`Esc+` or something which should get you the behavior you're looking
for.

In the event that your terminal app or OS doesn't have such a setting,
you can also press the Meta key by hitting `Esc` followed by the key.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-17 16:51 Strange characters produced by M-x in emacs -nw Harry Putnam
  2013-09-17 17:10 ` Tim Visher
@ 2013-09-17 17:36 ` Aurélien DESBRIÈRES
  2013-09-20 16:51   ` Harry Putnam
  2013-09-17 18:46 ` Peter Dyballa
  2 siblings, 1 reply; 33+ messages in thread
From: Aurélien DESBRIÈRES @ 2013-09-17 17:36 UTC (permalink / raw)
  To: Harry Putnam; +Cc: help-gnu-emacs


Harry Putnam <reader@newsguy.com> writes:

> Running recent emacs-24
> on Debian Linux
>
> I don't often use emacs -nw any more and just noticed today that I
> have some kind of charset or LANG setting problem that is causing
> unusual characters to be printed to my files when using the ALT key
> for combos like M-x.
>
> (I hope these characters are reproduced in this post)
>
> `M-x' produces   'ø'
> `M-Shift + !' produces '¡'
> `M-shift + :  produces 'º'
>
> What kind of setting is likely to be causing this?
>
> -------        ---------       ---=---       ---------      --------
>
> The above problem was uncovered today because I wanted to use
> emacs -nw.   But also I wanted to make emacs start in message mode by
> passing what ever is necessary to do that from the command line.
>
> emacs -nw -f message-mode file  does not set message-mode although if
> I insert text-mode rather than message-mode it will start in text-mode.
>
> How can I cause emacs -nw to start in message-mode from the command
> line. 
>
> One further question is how to pass elisp on the command line to be
> processed by emacs as it starts.
>
> emacs -nw <Syntax for passing elisp> file
>
>
>

had


xterm*metaSendsEscape: true


to your ~/.Xresources

should correct your trouble.


-- 
                            ______   __    __  __   __
Aurélien DESBRIÈRES        __       ____  __  __   __
aurelien@replicant.io     __  __   __  ____  __   __
twitter: Think_GNU       __   __  __    __  __   __
Run free! Run GNU.ORG     _____  __    __  _______



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-17 16:51 Strange characters produced by M-x in emacs -nw Harry Putnam
  2013-09-17 17:10 ` Tim Visher
  2013-09-17 17:36 ` Aurélien DESBRIÈRES
@ 2013-09-17 18:46 ` Peter Dyballa
  2013-09-17 19:30   ` Aurélien DESBRIÈRES
                     ` (3 more replies)
  2 siblings, 4 replies; 33+ messages in thread
From: Peter Dyballa @ 2013-09-17 18:46 UTC (permalink / raw)
  To: Harry Putnam; +Cc: help-gnu-emacs


Am 17.09.2013 um 18:51 schrieb Harry Putnam:

> `M-x' produces   'ø'
> `M-Shift + !' produces '¡'
> `M-shift + :  produces 'º'

No! It's not M-x but certainly Alt-x.

--
Greetings

  Pete

Increase the size of your bike by at least *five* inches!




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-17 18:46 ` Peter Dyballa
@ 2013-09-17 19:30   ` Aurélien DESBRIÈRES
  2013-09-17 20:11     ` Peter Dyballa
       [not found]   ` <mailman.2346.1379445532.10748.help-gnu-emacs@gnu.org>
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 33+ messages in thread
From: Aurélien DESBRIÈRES @ 2013-09-17 19:30 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs, Harry Putnam

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 17.09.2013 um 18:51 schrieb Harry Putnam:
>
>> `M-x' produces   'ø'
>> `M-Shift + !' produces '¡'
>> `M-shift + :  produces 'º'
>
> No! It's not M-x but certainly Alt-x.
>
> --
> Greetings
>
>   Pete
>
> Increase the size of your bike by at least *five* inches!
>
>
>

M == Alt

M-x == Alt+x
C-x == Ctrl+x

C-h i == Ctrl + h then hit i

...

-- 
                            ______   __    __  __   __
Aurélien DESBRIÈRES        __       ____  __  __   __
aurelien@replicant.io     __  __   __  ____  __   __
twitter: Think_GNU       __   __  __    __  __   __
Run free! Run GNU.ORG     _____  __    __  _______



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-17 19:30   ` Aurélien DESBRIÈRES
@ 2013-09-17 20:11     ` Peter Dyballa
  2013-09-18  6:14       ` Eli Zaretskii
  0 siblings, 1 reply; 33+ messages in thread
From: Peter Dyballa @ 2013-09-17 20:11 UTC (permalink / raw)
  To: Aurélien DESBRIÈRES; +Cc: help-gnu-emacs, Harry Putnam


Am 17.09.2013 um 21:30 schrieb Aurélien DESBRIÈRES:

> M == Alt

That's just one of many more options. This is UNIX, not Losedos.

--
Greetings

  Pete

The wise man said: "Never argue with an idiot. They bring you down to their level and beat you with experience."




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
       [not found]   ` <mailman.2346.1379445532.10748.help-gnu-emacs@gnu.org>
@ 2013-09-17 20:42     ` Pascal J. Bourguignon
  2013-09-17 21:11       ` Peter Dyballa
       [not found]       ` <mailman.2350.1379452281.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 33+ messages in thread
From: Pascal J. Bourguignon @ 2013-09-17 20:42 UTC (permalink / raw)
  To: help-gnu-emacs

aurelien@replicant.io (Aurélien DESBRIÈRES) writes:

> Peter Dyballa <Peter_Dyballa@Web.DE> writes:
>
>> Am 17.09.2013 um 18:51 schrieb Harry Putnam:
>>
>>> `M-x' produces   'ø'
>>> `M-Shift + !' produces '¡'
>>> `M-shift + :  produces 'º'
>>
>> No! It's not M-x but certainly Alt-x.
>>
>> --
>> Greetings
>>
>>   Pete
>>
>> Increase the size of your bike by at least *five* inches!
>>
>>
>>
>
> M == Alt

That's indeed the problem.

> M-x == Alt+x
> C-x == Ctrl+x
>
> C-h i == Ctrl + h then hit i

To solve it, you have to break the connection between the key Alt and
the emacs modifier M-.

For example, you could have in your ~/.emacs, amongst the rest,
something like (keycode specific to my keyboard):

! …

keycode  37 = Multi_key       
keycode 133 = Alt_L
keycode  64 = Meta_L

keycode  65 = space         space       digitspace          digitspace

keycode 108 = Meta_R
keycode 134 = Mode_switch
keycode 135 = Hyper_R
keycode 105 = Control_R

! …

clear Shift
clear Lock
clear Control
clear Mod1
clear Mod2
clear Mod3
clear Mod4
clear Mod5

! In order of bits: 
add    Shift   = Shift_L     Shift_R
add    Lock    = Caps_Lock
add    Control = Control_L   Control_R
add    Mod1    = Num_Lock
add    Mod2    = Alt_L       Alt_R       Mode_switch
add    Mod3    = Meta_L      Meta_R
add    Mod4    = Super_L     Super_R
add    Mod5    = Hyper_L     Hyper_R     



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


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-17 20:42     ` Pascal J. Bourguignon
@ 2013-09-17 21:11       ` Peter Dyballa
       [not found]       ` <mailman.2350.1379452281.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 33+ messages in thread
From: Peter Dyballa @ 2013-09-17 21:11 UTC (permalink / raw)
  To: Pascal J. Bourguignon; +Cc: help-gnu-emacs


Am 17.09.2013 um 22:42 schrieb Pascal J. Bourguignon:

> For example, you could have in your ~/.emacs

You probably mean ~/.xmodmaprc…

--
Greetings

  Pete

Who the fsck is "General Failure," and why is he reading my disk?




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
       [not found]       ` <mailman.2350.1379452281.10748.help-gnu-emacs@gnu.org>
@ 2013-09-17 23:51         ` Pascal J. Bourguignon
  0 siblings, 0 replies; 33+ messages in thread
From: Pascal J. Bourguignon @ 2013-09-17 23:51 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 17.09.2013 um 22:42 schrieb Pascal J. Bourguignon:
>
>> For example, you could have in your ~/.emacs
>
> You probably mean ~/.xmodmaprc…

yes. ~/.xmodmap ; the habit in gnu.emacs.help… :-)

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


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-17 20:11     ` Peter Dyballa
@ 2013-09-18  6:14       ` Eli Zaretskii
  2013-09-18  8:29         ` Peter Dyballa
  0 siblings, 1 reply; 33+ messages in thread
From: Eli Zaretskii @ 2013-09-18  6:14 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Peter Dyballa <Peter_Dyballa@Web.DE>
> Date: Tue, 17 Sep 2013 22:11:49 +0200
> Cc: help-gnu-emacs@gnu.org, Harry Putnam <reader@newsguy.com>
> 
> > M == Alt
> 
> That's just one of many more options. This is UNIX, not Losedos.

What makes you think Windows doesn't support key remapping?



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-18  6:14       ` Eli Zaretskii
@ 2013-09-18  8:29         ` Peter Dyballa
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Dyballa @ 2013-09-18  8:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


Am 18.09.2013 um 08:14 schrieb Eli Zaretskii:

> What makes you think Windows doesn't support key remapping?

Nothing (I have to use from time to time non-UNIX systems). It was a joke, and also trying to give a hint that there aren't so many things that are certain and much more things can, or must be adjusted.

--
Greetings

  Pete

We have to expect it, otherwise we would be surprised.




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-17 18:46 ` Peter Dyballa
  2013-09-17 19:30   ` Aurélien DESBRIÈRES
       [not found]   ` <mailman.2346.1379445532.10748.help-gnu-emacs@gnu.org>
@ 2013-09-20 16:27   ` Harry Putnam
  2013-09-20 17:28     ` Bob Proulx
       [not found]   ` <mailman.2579.1379695386.10748.help-gnu-emacs@gnu.org>
  3 siblings, 1 reply; 33+ messages in thread
From: Harry Putnam @ 2013-09-20 16:27 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 17.09.2013 um 18:51 schrieb Harry Putnam:
>
>> `M-x' produces   'ø'
>> `M-Shift + !' produces '¡'
>> `M-shift + :  produces 'º'
>
> No! It's not M-x but certainly Alt-x.

Well, yeah if we disregard yrs and and yrs of practice on this list
and even in emacs and gnus manuals

That said, yes, I am referring to the Alt labeled on most common
keyboards... at least in the US.

Let me say to that I do appreciate all posters input on this.. there
appears to be several way to resolve the problem.

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.

Thank you all.




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-17 17:36 ` Aurélien DESBRIÈRES
@ 2013-09-20 16:51   ` Harry Putnam
  2013-09-20 17:04     ` Peter Dyballa
                       ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: Harry Putnam @ 2013-09-20 16:51 UTC (permalink / raw)
  To: help-gnu-emacs

aurelien@replicant.io (Aurélien DESBRIÈRES) writes:

> Harry Putnam <reader@newsguy.com> writes:

[...]

>> (I hope these characters are reproduced in this post)
>>
>> `M-x' produces   'ø'
>> `M-Shift + !' produces '¡'
>> `M-shift + :  produces 'º'
>>
>> What kind of setting is likely to be causing this?

[...]

Aurélien Wrote
> xterm*metaSendsEscape: true
>
> to your ~/.Xresources
>
> should correct your trouble.

doesn't seem to do a thing here:

grep 'xterm\*meta' ~/.Xresources

  xterm*metaSendsEscape:	true
     
Followed by closing down X and restarting with startx.

but still if I run `emacs -nw' in an xterm:

And try to press Alt-x, I get this:

  `ø'

I haven't worked on the other cures yet, but pretty sure changing
xmodmap will do the job... just wanted to mention that your suggestion
seems not to work here.

Env is: Debian Linux running on PC (an older P4) using
the real xterm... not any of the pretenders.

 xterm -version
XTerm(295)




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 16:51   ` Harry Putnam
@ 2013-09-20 17:04     ` Peter Dyballa
  2013-09-20 18:51     ` Dale Snell
  2013-09-27 22:04     ` Harry Putnam
  2 siblings, 0 replies; 33+ messages in thread
From: Peter Dyballa @ 2013-09-20 17:04 UTC (permalink / raw)
  To: Harry Putnam; +Cc: help-gnu-emacs


Am 20.09.2013 um 18:51 schrieb Harry Putnam:

> And try to press Alt-x, I get this:

Check which modifiers are set!

	xmodmap -pm

--
Greetings

  Pete

A mathematician is a device for turning coffee into theorems.
				– Erdős Pál




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 16:27   ` Harry Putnam
@ 2013-09-20 17:28     ` Bob Proulx
  2013-09-20 20:21       ` Harry Putnam
  2013-09-20 20:22       ` Harry Putnam
  0 siblings, 2 replies; 33+ messages in thread
From: Bob Proulx @ 2013-09-20 17:28 UTC (permalink / raw)
  To: help-gnu-emacs

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?

Check the timestamp to see if the file /etc/default/keyboard has been
updated recently?  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.

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.

A typical configuration line from /etc/default/keyboard might be:

  XKBOPTIONS="lv3:ralt_switch,compose:menu,terminate:ctrl_alt_bksp"

[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.]

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 terminate:ctrl_alt_bksp

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

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.

  Compose e ' -> é
  Compose a " -> ä
  Compose A ` -> À

Or the reverse.  Use whichever makes sense to your brain.

  Compose ' e -> é
  Compose " a -> ä
  Compose ^ a -> â
  Compose , c -> ç

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

Of course you weren't asking how to type in these characters.  You
were reporting that you were typing in these characters, at least for
Alt-x, and wanted to cure it.  I think you somehow acquired a munged
configuration of the above.  That is why I suggested setting the above
and thinking that it would clear the previous munged configuration out
and set it up into something useful.  At least you should get Alt-x
back again.

In the old, old days using US-ASCII Meta would set the high bit and
this enabled emacs to know that it was a meta key.  But today it is
more useful to be able to use latin-1 and utf-8 characters which
require access to the high bit for those characters.  Therefore meta
is pushed into only having the ESC-char encoding available in order to
interoperate with non-ascii characters.

And then after fixing Alt *then* the xterm resource configuration of
XTerm*metaSendsEscape:true will make sense.  However note that I
recommend using "XTerm" like that with that exact case, first two
chars capitalized, over using "xterm" all lower case.  The former
configures the class of programs while the later is only the one
specific program.  And you can turn that on interactively with
Control-LeftMouse drag.

  XTerm*metaSendsEscape:true

With that then running emacs in a terminal I believe will do what you
want it to do.  This is my normal runtime configuration.

Bob



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 16:51   ` Harry Putnam
  2013-09-20 17:04     ` Peter Dyballa
@ 2013-09-20 18:51     ` Dale Snell
  2013-09-20 20:27       ` Harry Putnam
  2013-09-27 22:04     ` Harry Putnam
  2 siblings, 1 reply; 33+ messages in thread
From: Dale Snell @ 2013-09-20 18:51 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, 20 Sep 2013 12:51:55 -0400
Harry Putnam <reader@newsguy.com> wrote:

> aurelien@replicant.io (Aurélien DESBRIÈRES) writes:
> 
> > Harry Putnam <reader@newsguy.com> writes:
> 
> [...]
> 
> >> (I hope these characters are reproduced in this post)
> >>
> >> `M-x' produces   'ø'
> >> `M-Shift + !' produces '¡'
> >> `M-shift + :  produces 'º'
> >>
> >> What kind of setting is likely to be causing this?
> 
> [...]
> 
> Aurélien Wrote
> > xterm*metaSendsEscape: true
> >
> > to your ~/.Xresources
> >
> > should correct your trouble.
> 
> doesn't seem to do a thing here:
> 
> grep 'xterm\*meta' ~/.Xresources
> 
>   xterm*metaSendsEscape:	true
>      
> Followed by closing down X and restarting with startx.
> 
> but still if I run `emacs -nw' in an xterm:
> 
> And try to press Alt-x, I get this:
> 
>   `ø'
> 
> I haven't worked on the other cures yet, but pretty sure changing
> xmodmap will do the job... just wanted to mention that your suggestion
> seems not to work here.
> 
> Env is: Debian Linux running on PC (an older P4) using
> the real xterm... not any of the pretenders.
> 
>  xterm -version
> XTerm(295)

It looks to me like you've got Alt conflated with Meta.  The two
modifiers are NOT the same.  Check .xmodmap / .xmodmaprc to see how X
is set up.  Also, you don't say what desktop manager you're using,
Gnome, LXDE, whatever.  Note that DEs also do keymapping, but
separately from the .xmodmaprc file (and each other).

Just out of curiosity, if you type ESC-x instead of ALT-x, what do you
get?  If things are set up correctly, you should get "M-x " in the
minibuffer, waiting for an extended command.

Anyway, I hope this helps.

--Dale

--
Imagine if every Thursday your shoes exploded if you tied them the usual
way.  This happens to us all the time with computers, and nobody thinks of
complaining.    -- Jeff Raskin



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 17:28     ` Bob Proulx
@ 2013-09-20 20:21       ` Harry Putnam
  2013-09-20 21:08         ` Stefan Monnier
       [not found]         ` <mailman.2606.1379711320.10748.help-gnu-emacs@gnu.org>
  2013-09-20 20:22       ` Harry Putnam
  1 sibling, 2 replies; 33+ messages in thread
From: Harry Putnam @ 2013-09-20 20:21 UTC (permalink / raw)
  To: help-gnu-emacs

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.




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 17:28     ` Bob Proulx
  2013-09-20 20:21       ` Harry Putnam
@ 2013-09-20 20:22       ` Harry Putnam
  1 sibling, 0 replies; 33+ messages in thread
From: Harry Putnam @ 2013-09-20 20:22 UTC (permalink / raw)
  To: help-gnu-emacs

Bob Proulx <bob@proulx.com> writes:

> 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?

Before seeing your post, I'd already fired off a post to the debian
users list about this.  Not intentionally making things more difficult
to follow.




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 18:51     ` Dale Snell
@ 2013-09-20 20:27       ` Harry Putnam
  0 siblings, 0 replies; 33+ messages in thread
From: Harry Putnam @ 2013-09-20 20:27 UTC (permalink / raw)
  To: help-gnu-emacs

Dale Snell <ddsnell@frontier.com> writes:

> It looks to me like you've got Alt conflated with Meta.  The two
> modifiers are NOT the same.  Check .xmodmap / .xmodmaprc to see how X
> is set up.  Also, you don't say what desktop manager you're using,
> Gnome, LXDE, whatever.  Note that DEs also do keymapping, but
> separately from the .xmodmaprc file (and each other).

LXDE, 

Before seeing you post I responded to Bob P with some more info from
my setup, including ouput of xmodmap

> Just out of curiosity, if you type ESC-x instead of ALT-x, what do you
> get?  If things are set up correctly, you should get "M-x " in the
> minibuffer, waiting for an extended command.

Well, like always that does the same as what I expect the Alt key to
do, but is so awkward to use, I always do something about it when on a
Solaris variant.  A place where after a fesh install, I've always had
to use ESC to work with emacs.




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 20:21       ` Harry Putnam
@ 2013-09-20 21:08         ` Stefan Monnier
  2013-09-20 22:15           ` Harry Putnam
       [not found]         ` <mailman.2606.1379711320.10748.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 33+ messages in thread
From: Stefan Monnier @ 2013-09-20 21:08 UTC (permalink / raw)
  To: help-gnu-emacs

> | mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)

This might be a source of problems: try to remap your Meta_L key to
Alt_L as follows:

  xmodmap -e 'keysym Meta_L = Alt_L'


-- Stefan




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
       [not found]   ` <mailman.2579.1379695386.10748.help-gnu-emacs@gnu.org>
@ 2013-09-20 21:54     ` Pascal J. Bourguignon
  0 siblings, 0 replies; 33+ messages in thread
From: Pascal J. Bourguignon @ 2013-09-20 21:54 UTC (permalink / raw)
  To: help-gnu-emacs

Harry Putnam <reader@newsguy.com> writes:

> Peter Dyballa <Peter_Dyballa@Web.DE> writes:
>
>> Am 17.09.2013 um 18:51 schrieb Harry Putnam:
>>
>>> `M-x' produces   'ø'
>>> `M-Shift + !' produces '¡'
>>> `M-shift + :  produces 'º'
>>
>> No! It's not M-x but certainly Alt-x.
>
> Well, yeah if we disregard yrs and and yrs of practice on this list
> and even in emacs and gnus manuals

And during all those years, I've typed ESC x to type M-x while I could
type Alt-x!  Oops, Alt-x produces: × not M-x!  Where have the years gone?

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


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
       [not found]         ` <mailman.2606.1379711320.10748.help-gnu-emacs@gnu.org>
@ 2013-09-20 21:55           ` Pascal J. Bourguignon
  2013-09-20 22:16             ` Harry Putnam
  0 siblings, 1 reply; 33+ messages in thread
From: Pascal J. Bourguignon @ 2013-09-20 21:55 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> | mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
>
> This might be a source of problems: try to remap your Meta_L key to
> Alt_L as follows:
>
>   xmodmap -e 'keysym Meta_L = Alt_L'

No, instead map Meta_L to a free keycode!
Don't confuse Alt and Meta Combine them!
Bind A-M-x and others to some useful command!

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


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 21:08         ` Stefan Monnier
@ 2013-09-20 22:15           ` Harry Putnam
  2013-09-21  2:53             ` Stefan Monnier
  0 siblings, 1 reply; 33+ messages in thread
From: Harry Putnam @ 2013-09-20 22:15 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> | mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
>
> This might be a source of problems: try to remap your Meta_L key to
> Alt_L as follows:
>
>   xmodmap -e 'keysym Meta_L = Alt_L'
>

Thanks for jumping in again Stefan, you helped with very similar
problem on a solaris machine a while back.

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




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 21:55           ` Pascal J. Bourguignon
@ 2013-09-20 22:16             ` Harry Putnam
  2013-09-21 10:06               ` Pascal J. Bourguignon
  0 siblings, 1 reply; 33+ messages in thread
From: Harry Putnam @ 2013-09-20 22:16 UTC (permalink / raw)
  To: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>> | mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
>>
>> This might be a source of problems: try to remap your Meta_L key to
>> Alt_L as follows:
>>
>>   xmodmap -e 'keysym Meta_L = Alt_L'
>
> No, instead map Meta_L to a free keycode!
> Don't confuse Alt and Meta Combine them!
> Bind A-M-x and others to some useful command!

What about some examples?




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 22:15           ` Harry Putnam
@ 2013-09-21  2:53             ` Stefan Monnier
  2013-09-21 15:20               ` Harry Putnam
  0 siblings, 1 reply; 33+ messages in thread
From: Stefan Monnier @ 2013-09-21  2:53 UTC (permalink / raw)
  To: help-gnu-emacs

>>> | mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
>> This might be a source of problems: try to remap your Meta_L key to
>> Alt_L as follows:
>> xmodmap -e 'keysym Meta_L = Alt_L'
> Should I see results immediately or does this require a restart of X?

Should be immediate, if it works that is,


        Stefan




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 22:16             ` Harry Putnam
@ 2013-09-21 10:06               ` Pascal J. Bourguignon
  2013-09-21 15:24                 ` Harry Putnam
       [not found]                 ` <mailman.2655.1379777078.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 33+ messages in thread
From: Pascal J. Bourguignon @ 2013-09-21 10:06 UTC (permalink / raw)
  To: help-gnu-emacs

Harry Putnam <reader@newsguy.com> writes:

> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>
>>>> | mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
>>>
>>> This might be a source of problems: try to remap your Meta_L key to
>>> Alt_L as follows:
>>>
>>>   xmodmap -e 'keysym Meta_L = Alt_L'
>>
>> No, instead map Meta_L to a free keycode!
>> Don't confuse Alt and Meta Combine them!
>> Bind A-M-x and others to some useful command!
>
> What about some examples?

Yes, I'm posting my .xmodmap each week…

!
! This is an `xmodmap' input file for the  DasKeyboard 3
!
! Bus 008 Device 005: ID 04d9:2013 Holtek Semiconductor, Inc. 
!
! PC 105 keys, wide Delete, wide Enter.
!


! C- Control
! M- Meta
! S- Shift
! s- super
! H- Hyper

! O- Option
! A- Alt
! W- Window
! G- AltGr

! x, S-x, g-x, g-S-x
!
! ESC         F1   F2   F3   F4     F5   F6   F7   F8     F9   F10  F11  F12    
! `~∞∝ 1!₁¹ 2@₂² 3#₃³ 4$₄⁴ 5%₅⁵ 6^₆⁶ 7₇⁷ 8*₈⁸ 9(₉⁹ 0)₀⁰ -_⊣⊥ =+⊢⊤   Backspace   
! TAB     qQωΩ wW€¢ eEεΕ rRρΡ tTτΤ yYψΨ uUυΥ iIιΙ oOοΟ pPπΠ [{«∀ ]}»∃     \|∖∫
! Control   aAαΑ sSσΣ dDδΔ fFφΦ gGγΓ hHθΘ jJηΗ kKκΚ lLλΛ ;:⊆⎕ '"⊇○     Return
! Shift       zZζΖ xXξΞ cCχΧ vV∇√ bBβΒ nNνΝ mMμΜ ,<≤∧ .>≥∨ /?≠¬         Shift
! Multi_key Alt  Meta   ---- Space DigitSpace ----- Meta ModeSw Hyper Control
! 
! 
! Pause  ∂     CapsLock    Print
! Insert ∈∉   Home ⇒⇔    Prior ≡≢    
! Delete ∅≣   End ∴ ∵     Next ≈≇    
!                                    
!              Up ↑∩                 
!  Left ←⊂    Down ↓∪    Right →⊃    
!
!
!
!
!           NumLock     *          /           -      
!           Home    7   Up    8    Prior 9          
!           Left    4   Begin 5    Right 6     +   
!           End     1   Down  2    Next  3    Ent   
!           Insert  0              Delete .    er      
!
!
!           NumLock     *          /           -      
!           Home    7   Up    8    Prior 9          
!           Left    4   Begin 5    Right 6     +   
!           End     1   Down  2    Next  3    Ent   
!           Insert  0              Delete .    er      
!
!
!
!
!
!


!------------------------------------------------------------
! First line
!------------------------------------------------------------

keycode   9 = Escape

keycode  67 = F1              XF86_Switch_VT_1  F21
keycode  68 = F2              XF86_Switch_VT_2  F22
keycode  69 = F3              XF86_Switch_VT_3  F23
keycode  70 = F4              XF86_Switch_VT_4  F24

keycode  71 = F5              XF86_Switch_VT_5  F25
keycode  72 = F6              XF86_Switch_VT_6  F26
keycode  73 = F7              XF86_Switch_VT_7  F27
keycode  74 = F8              XF86_Switch_VT_8  F28

keycode  75 = F9              XF86_Switch_VT_9  F29
keycode  76 = F10             XF86_Switch_VT_10 F30
keycode  95 = F11             XF86_Switch_VT_11 F31
keycode  96 = F12             XF86_Switch_VT_12 F32

keycode 107 = Pause           Break             F33
keycode  78 = Caps_Lock       Caps_Lock         F34
!keycode 127 = Print           Sys_Req           F35
keycode 127 = Super_R 	      Super_R


!------------------------------------------------------------
! Second line
!------------------------------------------------------------

keycode  49 = grave           asciitilde      infinity          variation
keycode  10 = 1               exclam          onesubscript      onesuperior
keycode  11 = 2               at              twosubscript      twosuperior
keycode  12 = 3               numbersign      threesubscript    threesuperior
keycode  13 = 4               dollar          foursubscript     foursuperior
keycode  14 = 5               percent         fivesubscript     fivesuperior
keycode  15 = 6               asciicircum     sixsubscript      sixsuperior
keycode  16 = 7               ampersand       sevensubscript    sevensuperior
keycode  17 = 8               asterisk        eightsubscript    eightsuperior
keycode  18 = 9               parenleft       ninesubscript     ninesuperior
keycode  19 = 0               parenright      zerosubscript     zerosuperior
keycode  20 = minus           underscore      righttack         downtack
keycode  21 = equal           plus            lefttack          uptack
keycode  22 = BackSpace       BackSpace       BackSpace         BackSpace       


!------------------------------------------------------------
! Third line
!------------------------------------------------------------

keycode  23 = Tab             ISO_Left_Tab

keycode  24 = q               Q             Greek_omega     Greek_OMEGA
keycode  25 = w               W             EuroSign        cent
keycode  26 = e               E             Greek_epsilon   Greek_EPSILON
keycode  27 = r               R             Greek_rho       Greek_RHO
keycode  28 = t               T             Greek_tau       Greek_TAU
keycode  29 = y               Y             Greek_psi       Greek_PSI
keycode  30 = u               U             Greek_upsilon   Greek_UPSILON
keycode  31 = i               I             Greek_iota      Greek_IOTA
keycode  32 = o               O             Greek_omicron   Greek_OMICRON
keycode  33 = p               P             Greek_pi        Greek_PI
keycode  34 = bracketleft     braceleft     guillemotleft   0x1002200
keycode  35 = bracketright    braceright    guillemotright  0x1002203
keycode  51 = backslash       bar           0x1002216       integral


!------------------------------------------------------------
! Fourth line (home row)
!------------------------------------------------------------

keycode  66 = Control_L

keycode  38 = a               A             Greek_alpha     Greek_ALPHA
keycode  39 = s               S             Greek_sigma     Greek_SIGMA
keycode  40 = d               D             Greek_delta     Greek_DELTA
keycode  41 = f               F             Greek_phi       Greek_PHI
keycode  42 = g               G             Greek_gamma     Greek_GAMMA
keycode  43 = h               H             Greek_theta     Greek_THETA
keycode  44 = j               J             Greek_eta       Greek_ETA
keycode  45 = k               K             Greek_kappa     Greek_KAPPA
keycode  46 = l               L             Greek_lamda     Greek_LAMDA
keycode  47 = semicolon       colon         0x1002286       quad            
keycode  48 = apostrophe      quotedbl      0x1002287       circle          

keycode  36 = Return


!------------------------------------------------------------
! Fifth line
!------------------------------------------------------------

keycode  50 = Shift_L

keycode  52 = z               Z         Greek_zeta          Greek_ZETA
keycode  53 = x               X         Greek_xi            Greek_XI
keycode  54 = c               C         Greek_chi           Greek_CHI
keycode  55 = v               V         nabla               radical
keycode  56 = b               B         Greek_beta          Greek_BETA
keycode  57 = n               N         Greek_nu            Greek_NU
keycode  58 = m               M         Greek_mu            Greek_MU
keycode  59 = comma           less      lessthanequal       logicaland
keycode  60 = period          greater   greaterthanequal    logicalor
keycode  61 = slash           question  notequal            notsign

keycode  62 = Shift_R         


!------------------------------------------------------------
! Sixth line
!------------------------------------------------------------

keycode  37 = Multi_key       
keycode 133 = Alt_L
keycode  64 = Meta_L

keycode  65 = space         space       digitspace          digitspace

keycode 108 = Meta_R
keycode 134 = Mode_switch
keycode 135 = Hyper_R
keycode 105 = Control_R


!------------------------------------------------------------
! Home
!------------------------------------------------------------

keycode 118 = Insert    Insert  elementof       notelementof
keycode 119 = Delete    Delete  emptyset        stricteq

keycode 110 = Home      Home    implies         ifonlyif       
keycode 115 = End       End     therefore       because

keycode 112 = Prior     Prior   identical       notidentical
keycode 117 = Next      Next    approxeq        notapproxeq


!------------------------------------------------------------
! Arrows
!------------------------------------------------------------

keycode 111 = Up      Up        uparrow         intersection       
keycode 113 = Left    Left      leftarrow       includedin
keycode 116 = Down    Down      downarrow       union
keycode 114 = Right   Right     rightarrow      includes


!------------------------------------------------------------
! Numerical Keypad
!------------------------------------------------------------

!! ! Second line:
!! !keycode  77 = Num_Lock        Pointer_EnableKeys
!! keycode  77 = Num_Lock        
!! keycode 106 = KP_Multiply     XF86_ClearGrab
!! keycode  63 = KP_Divide       XF86_Ungrab
!! keycode  82 = KP_Subtract     KP_Subtract    0x1002500 0x1002550
!! 
!! ! Third line:
!! keycode  79 = KP_Home         KP_7           0x100250C  0x1002554
!! keycode  80 = KP_Up           KP_8           0x100252C  0x1002566
!! keycode  81 = KP_Prior        KP_9           0x1002510  0x1002557
!! 
!! ! Fourth line:
!! keycode  83 = KP_Left         KP_4           0x100251C  0x1002560
!! keycode  84 = KP_Begin        KP_5           0x100253C  0x100256C
!! keycode  85 = KP_Right        KP_6           0x1002524  0x1002563
!! keycode  86 = KP_Add          KP_Add         0x1002502  0x1002551
!! 
!! ! Fifth line:
!! keycode  87 = KP_End          KP_1           0x1002514  0x100255A
!! keycode  88 = KP_Down         KP_2           0x1002534  0x1002569
!! keycode  89 = KP_Next         KP_3           0x1002518  0x100255D
!! 
!! ! Sixth line:
!! keycode  90 = KP_Insert       KP_0
!! keycode  91 = KP_Delete       KP_Decimal
!! keycode 104 = KP_Enter 



! Second line:
keycode  77 = F13       F13             partialderivative
keycode 106 = F14       F14
keycode  63 = F15       F15 
keycode  82 = F16       F16             0x1002500 0x1002550

! Third line:
keycode  79 = F27       KP_7            0x100250C  0x1002554
keycode  80 = F28       KP_8            0x100252C  0x1002566
keycode  81 = F29       KP_9            0x1002510  0x1002557
                                  
! Fourth line:                    
keycode  83 = F24       KP_4            0x100251C  0x1002560
keycode  84 = F25       KP_5            0x100253C  0x100256C
keycode  85 = F26       KP_6            0x1002524  0x1002563
keycode  86 = F17       F17             0x1002502  0x1002551
                                  
! Fifth line:                     
keycode  87 = F21       KP_1            0x1002514  0x100255A
keycode  88 = F22       KP_2            0x1002534  0x1002569
keycode  89 = F23       KP_3            0x1002518  0x100255D
                                  
! Sixth line:                     
!keycode  90 = F20       KP_0             
keycode  90 = Super_R   Super_R
keycode  91 = F18       KP_Decimal       
keycode 104 = F19       F19

!------------------------------------------------------------
! Modifiers
!------------------------------------------------------------

clear Shift
clear Lock
clear Control
clear Mod1
clear Mod2
clear Mod3
clear Mod4
clear Mod5

!!! In order of bits: 
add    Shift   = Shift_L     Shift_R
add    Lock    = Caps_Lock
add    Control = Control_L   Control_R
add    Mod1    = Num_Lock
add    Mod2    = Alt_L       Alt_R       Mode_switch
add    Mod3    = Meta_L      Meta_R
add    Mod4    = Super_L     Super_R
add    Mod5    = Hyper_L     Hyper_R     




!----------------------------------------------------------------------------
! Multi_key Sequences (»Compose«)
! <URL:http://www.in-ulm.de/~mascheck/X11/compose.txt>
!
! '!' is the comment character for xmodmap(1), thus it's omnipresent here.
!
! See also:
!   MIT:              $SRC/xc/nls/X11/locale/Compose/iso8859-1
!   XFree86:          /usr/X11R6/lib/X11/locale/iso8859-1/Compose
!   Solaris' Openwin: /usr/openwin/include/X11/Suncompose.h
!                     /usr/openwin/lib/locale/*/Compose
!   Irix6:            compose(5)
!
!   <URL:http://www.in-ulm.de/~mascheck/X11/keysyms.txt>
!----------------------------------------------------------------------------
!
! In X11R6, there are even 7bit compose sequences, like for video terminals:
!
! + +        : #
! A A        : @
! ( (        : [
! ) )        : ]
! ( -        : {
! ) -        : }
! / / , / <  : \
! > <space>  : ^
! / ^, V L   : |
! - <space>  : ~
!
!----------------------------------------------------------------------------
! 8bit sequences in rather compressed form:
!
! From: Christian Weisgerber
! Newsgroups: de.comp.os.unix.x11
! Subject: Re: 8 keysym pro keycode !? -- wie benutzen ?
! Message-ID: <869tp8$5d4$1@bigeye.rhein-neckar.de>
!
!    |   no-break space                      ¦  broken bar              ||
!    ­  soft hyphen             --           µ  micro sign              /U
!    ¡  inverted !              !!           ¿  inverted ?              ??
!    ¢  cent sign            C/ or C|        £  pound sign           L- or L=
!    ¤  currency sign        XO or X0        ¥  yen sign             Y- or Y=
!    §  section sign         SO or S! or S0  ¶  pilcrow sign            P!
!    ¨  diaeresis            "" or  "        ¯  macron               _^ or -^
!    ´  acute accent            ''           ¸  cedilla                 ,,
!    ©  copyright sign       CO or C0        ®  registered sign         RO
!    ª  feminine ordinal        A_           º  masculine ordinal       O_
!    «  opening angle brackets  <<           »  closing angle brakets   >>
!    °  degree sign             0^           ¹  superscript 1           1^
!    ²  superscript 2           2^           ³  superscript 3           3^
!    ±  plus or minus sign      +-           ¼  fraction one-quarter    14
!    ½  fraction one-half       12           ¾  fraction three-quarter  34
!    ·  middle dot           .^ or ..        ¬  not sign                -,
!    ×  multiplication sign     xx           ÷  division sign           :-
!    
!    À  A grave                 A`           à  a grave                 a`
!    Á  A acute                 A'           á  a acute                 a'
!    Â  A circumflex            A^           â  a circumflex            a^
!    Ã  A tilde                 A~           ã  a tilde                 a~
!    Ä  A diaeresis             A"           ä  a diaeresis             a"
!    Å  A ring                  A*           å  a ring                  a*
!    Æ  AE ligature             AE           æ  ae ligature             ae
!    
!    Ç  C cedilla               C,           ç  c cedilla               c,
!    
!    È  E grave                 E`           è  e grave                 e`
!    É  E acute                 E'           é  e acute                 e'
!    Ê  E circumflex            E^           ê  e circumflex            e^
!    Ë  E diaeresis             E"           ë  e diaeresis             e"
!    
!    Ì  I grave                 I`           ì  i grave                 i`
!    Í  I acute                 I'           í  i acute                 i'
!    Î  I circumflex            I^           î  i circumflex            i^
!    Ï  I diaeresis             I"           ï  i diaeresis             i"
!    
!    Ð  capital eth             D-           ð  small eth               d-
!    
!    Ñ  N tilde                 N~           ñ  n tilde                 n~
!    
!    Ò  O grave                 O`           ò  o grave                 o`
!    Ó  O acute                 O'           ó  o acute                 o'
!    Ô  O circumflex            O^           ô  o circumflex            o^
!    Õ  O tilde                 O~           õ  o tilde                 o~
!    Ö  O diaeresis             O"           ö  o diaeresis             o"
!    Ø  O slash                 O/           ø  o slash                 o/
!    
!    Ù  U grave                 U`           ù  u grave                 u`
!    Ú  U acute                 U'           ú  u acute                 u'
!    Û  U circumflex            U^           û  u circumflex            u^
!    Ü  U diaeresis             U"           ü  u diaeresis             u"
!    
!    Ý  Y acute                 Y'           ý  y acute                 y'
!    
!    Þ  capital thorn           TH           þ  small thorn             th
!    
!    ß  German small sharp s    ss           ÿ  y diaeresis             y"



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




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-21  2:53             ` Stefan Monnier
@ 2013-09-21 15:20               ` Harry Putnam
  2013-09-21 18:06                 ` Peter Dyballa
  0 siblings, 1 reply; 33+ messages in thread
From: Harry Putnam @ 2013-09-21 15:20 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>>> | mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
>>> This might be a source of problems: try to remap your Meta_L key to
>>> Alt_L as follows:
>>> xmodmap -e 'keysym Meta_L = Alt_L'
>> Should I see results immediately or does this require a restart of X?
>
> Should be immediate, if it works that is,
>

Thanks, it appears not to have any effect, other than changing the
output of `xmodmap' to this:

,----
| 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),  Alt_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)
`----





^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-21 10:06               ` Pascal J. Bourguignon
@ 2013-09-21 15:24                 ` Harry Putnam
       [not found]                 ` <mailman.2655.1379777078.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 33+ messages in thread
From: Harry Putnam @ 2013-09-21 15:24 UTC (permalink / raw)
  To: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> Harry Putnam <reader@newsguy.com> writes:
>
>> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>>
>>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>>
>>>>> | mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
>>>>
>>>> This might be a source of problems: try to remap your Meta_L key to
>>>> Alt_L as follows:
>>>>
>>>>   xmodmap -e 'keysym Meta_L = Alt_L'
>>>
>>> No, instead map Meta_L to a free keycode!
>>> Don't confuse Alt and Meta Combine them!
>>> Bind A-M-x and others to some useful command!
>>
>> What about some examples?
>
> Yes, I'm posting my .xmodmap each week…
>
> !
> ! This is an `xmodmap' input file for the  DasKeyboard 3
> !
> ! Bus 008 Device 005: ID 04d9:2013 Holtek Semiconductor, Inc. 
> !
> ! PC 105 keys, wide Delete, wide Enter.
> !

Don't mean to sound like an ingrate but that is just plain over my
head. 

What part of that makes the switch you spoke of? Can it be done with
a simple 1-2 line xmodmap command.




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
       [not found]                 ` <mailman.2655.1379777078.10748.help-gnu-emacs@gnu.org>
@ 2013-09-21 16:14                   ` Pascal J. Bourguignon
  2013-09-21 16:55                     ` Harry Putnam
  0 siblings, 1 reply; 33+ messages in thread
From: Pascal J. Bourguignon @ 2013-09-21 16:14 UTC (permalink / raw)
  To: help-gnu-emacs

Harry Putnam <reader@newsguy.com> writes:

> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>
>> Harry Putnam <reader@newsguy.com> writes:
>>
>>> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>>>
>>>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>>>
>>>>>> | mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
>>>>>
>>>>> This might be a source of problems: try to remap your Meta_L key to
>>>>> Alt_L as follows:
>>>>>
>>>>>   xmodmap -e 'keysym Meta_L = Alt_L'
>>>>
>>>> No, instead map Meta_L to a free keycode!
>>>> Don't confuse Alt and Meta Combine them!
>>>> Bind A-M-x and others to some useful command!
>>>
>>> What about some examples?
>>
>> Yes, I'm posting my .xmodmap each week…
>>
>> !
>> ! This is an `xmodmap' input file for the  DasKeyboard 3
>> !
>> ! Bus 008 Device 005: ID 04d9:2013 Holtek Semiconductor, Inc. 
>> !
>> ! PC 105 keys, wide Delete, wide Enter.
>> !
>
> Don't mean to sound like an ingrate but that is just plain over my
> head. 
>
> What part of that makes the switch you spoke of? Can it be done with
> a simple 1-2 line xmodmap command.

Mostly. But since there's a finite number of keys on a keyboard in
general, rebinding a key has consequences and you may want to shift the
old function on a new key etc.

Also, the keycode while often similar from one keyboard to the other,
are often different notably on the modifier keys.

So you will have to use xev(1), to find out the keycodes of the keys you
want to bind to the symbols, then map them to symbols:

keycode  37 = Multi_key       
keycode 133 = Alt_L
keycode  64 = Meta_L

keycode  65 = space         space       digitspace          digitspace

keycode 108 = Meta_R
keycode 134 = Mode_switch
keycode 135 = Hyper_R
keycode 105 = Control_R

! It's on the Print/Sys_Req key:
keycode 127 = Super_R 	      Super_R



then you must map the symbols of the modifier keys to the modifier byte:


clear Shift
clear Lock
clear Control
clear Mod1
clear Mod2
clear Mod3
clear Mod4
clear Mod5

!!! In order of bits: 
add    Shift   = Shift_L     Shift_R
add    Lock    = Caps_Lock
add    Control = Control_L   Control_R
add    Mod1    = Num_Lock
add    Mod2    = Alt_L       Alt_R       Mode_switch
add    Mod3    = Meta_L      Meta_R
add    Mod4    = Super_L     Super_R
add    Mod5    = Hyper_L     Hyper_R     

and that's it. Notice how alt and meta are different modifiers.


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


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-21 16:14                   ` Pascal J. Bourguignon
@ 2013-09-21 16:55                     ` Harry Putnam
  0 siblings, 0 replies; 33+ messages in thread
From: Harry Putnam @ 2013-09-21 16:55 UTC (permalink / raw)
  To: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> Mostly. But since there's a finite number of keys on a keyboard in
> general, rebinding a key has consequences and you may want to shift the
> old function on a new key etc.

[...]

Thanks for the walk thru... A good start to play with.




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-21 15:20               ` Harry Putnam
@ 2013-09-21 18:06                 ` Peter Dyballa
  2013-09-21 19:23                   ` W. Greenhouse
  0 siblings, 1 reply; 33+ messages in thread
From: Peter Dyballa @ 2013-09-21 18:06 UTC (permalink / raw)
  To: Harry Putnam; +Cc: help-gnu-emacs


Am 21.09.2013 um 17:20 schrieb Harry Putnam:

> | mod4     Super_L (0x85),Super_R (0x86),Super_L (0xce),Hyper_L (0xcf)

You should not mix modifiers that way! When you press Modifier 4 and another key: Is this s-something or H-something? Or both?

--
Greetings

  Pete

Some day we may discover how to make magnets that can point in any direction.




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-21 18:06                 ` Peter Dyballa
@ 2013-09-21 19:23                   ` W. Greenhouse
  0 siblings, 0 replies; 33+ messages in thread
From: W. Greenhouse @ 2013-09-21 19:23 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Peter Dyballa <Peter_Dyballa-Ebz0p6Y2lXc@public.gmane.org> writes:

> Am 21.09.2013 um 17:20 schrieb Harry Putnam:
>
>> | mod4     Super_L (0x85),Super_R (0x86),Super_L (0xce),Hyper_L (0xcf)
>
> You should not mix modifiers that way! When you press Modifier 4 and
> another key: Is this s-something or H-something? Or both?

FYI, you can clear this problem up with something like the following
~/.Xmodmap directive:

remove Mod4 = Hyper_L

-- 
Yow!  Maybe I should have asked for my Neutron Bomb in PAISLEY --




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: Strange characters produced by M-x in emacs -nw
  2013-09-20 16:51   ` Harry Putnam
  2013-09-20 17:04     ` Peter Dyballa
  2013-09-20 18:51     ` Dale Snell
@ 2013-09-27 22:04     ` Harry Putnam
  2 siblings, 0 replies; 33+ messages in thread
From: Harry Putnam @ 2013-09-27 22:04 UTC (permalink / raw)
  To: help-gnu-emacs

Harry Putnam <reader@newsguy.com> writes:

[...]

> Aurélien Wrote
>> xterm*metaSendsEscape: true
>>
>> to your ~/.Xresources
>>
>> should correct your trouble.
>
> doesn't seem to do a thing here:
>
> grep 'xterm\*meta' ~/.Xresources
>
>   xterm*metaSendsEscape:	true
>      
> Followed by closing down X and restarting with startx.
>
> but still if I run `emacs -nw' in an xterm:
>
> And try to press Alt-x, I get this:
>
>   `ø'

This might be interesting to anyone who followed this thread.

I posted my problem on gmane.comp.freedesktop.xorg.

It resulted in this 2 msg thread.

http://thread.gmane.org/gmane.comp.freedesktop.xorg/49490

Briefly put, Troy K, had this to say:

,----
|   Edit ${HOME}/XTerm and add the following lines:
|   *vt100.altIsNotMeta: true
|   *vt100.altSendsEscape: true
| 
|   Then start a new xterm.
`----

It worked here...  No more mystery char when pressing ALT + <whatever>





^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2013-09-27 22:04 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 16:51 Strange characters produced by M-x in emacs -nw Harry Putnam
2013-09-17 17:10 ` Tim Visher
2013-09-17 17:36 ` Aurélien DESBRIÈRES
2013-09-20 16:51   ` Harry Putnam
2013-09-20 17:04     ` Peter Dyballa
2013-09-20 18:51     ` Dale Snell
2013-09-20 20:27       ` Harry Putnam
2013-09-27 22:04     ` Harry Putnam
2013-09-17 18:46 ` Peter Dyballa
2013-09-17 19:30   ` Aurélien DESBRIÈRES
2013-09-17 20:11     ` Peter Dyballa
2013-09-18  6:14       ` Eli Zaretskii
2013-09-18  8:29         ` Peter Dyballa
     [not found]   ` <mailman.2346.1379445532.10748.help-gnu-emacs@gnu.org>
2013-09-17 20:42     ` Pascal J. Bourguignon
2013-09-17 21:11       ` Peter Dyballa
     [not found]       ` <mailman.2350.1379452281.10748.help-gnu-emacs@gnu.org>
2013-09-17 23:51         ` Pascal J. Bourguignon
2013-09-20 16:27   ` Harry Putnam
2013-09-20 17:28     ` Bob Proulx
2013-09-20 20:21       ` Harry Putnam
2013-09-20 21:08         ` Stefan Monnier
2013-09-20 22:15           ` Harry Putnam
2013-09-21  2:53             ` Stefan Monnier
2013-09-21 15:20               ` Harry Putnam
2013-09-21 18:06                 ` Peter Dyballa
2013-09-21 19:23                   ` W. Greenhouse
     [not found]         ` <mailman.2606.1379711320.10748.help-gnu-emacs@gnu.org>
2013-09-20 21:55           ` Pascal J. Bourguignon
2013-09-20 22:16             ` Harry Putnam
2013-09-21 10:06               ` Pascal J. Bourguignon
2013-09-21 15:24                 ` Harry Putnam
     [not found]                 ` <mailman.2655.1379777078.10748.help-gnu-emacs@gnu.org>
2013-09-21 16:14                   ` Pascal J. Bourguignon
2013-09-21 16:55                     ` Harry Putnam
2013-09-20 20:22       ` Harry Putnam
     [not found]   ` <mailman.2579.1379695386.10748.help-gnu-emacs@gnu.org>
2013-09-20 21:54     ` Pascal J. Bourguignon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).