unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Bob Proulx <bob@proulx.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Strange characters produced by M-x in emacs -nw
Date: Fri, 20 Sep 2013 11:28:47 -0600	[thread overview]
Message-ID: <20130920172847.GA30192@hysteria.proulx.com> (raw)
In-Reply-To: <8738oz5uh4.fsf@newsguy.com>

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



  reply	other threads:[~2013-09-20 17:28 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130920172847.GA30192@hysteria.proulx.com \
    --to=bob@proulx.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).