From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Strange characters produced by M-x in emacs -nw Date: Fri, 20 Sep 2013 11:28:47 -0600 Message-ID: <20130920172847.GA30192@hysteria.proulx.com> References: <87r4cnmlxf.fsf@newsguy.com> <5D24468E-2A38-4F4C-AD14-9A1401683124@Web.DE> <8738oz5uh4.fsf@newsguy.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1379698158 25815 80.91.229.3 (20 Sep 2013 17:29:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Sep 2013 17:29:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 20 19:29:22 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VN4W9-00044P-CE for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Sep 2013 19:29:21 +0200 Original-Received: from localhost ([::1]:57134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN4W8-0006z3-Tx for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Sep 2013 13:29:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN4Vo-0006qo-LT for help-gnu-emacs@gnu.org; Fri, 20 Sep 2013 13:29:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN4Ve-0000jE-5A for help-gnu-emacs@gnu.org; Fri, 20 Sep 2013 13:29:00 -0400 Original-Received: from joseki.proulx.com ([216.17.153.58]:51347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN4Vd-0000iu-QL for help-gnu-emacs@gnu.org; Fri, 20 Sep 2013 13:28:50 -0400 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id E80D5211DB for ; Fri, 20 Sep 2013 11:28:47 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id BDF862DC63; Fri, 20 Sep 2013 11:28:47 -0600 (MDT) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <8738oz5uh4.fsf@newsguy.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93474 Archived-At: Harry Putnam wrote: > `M-x' produces '=F8' > `M-Shift + !' produces '=A1' > `M-shift + : produces '=BA' > [...] > 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. >=20 > 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=3D"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 termi= nate: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 ' -> =E9 Compose a " -> =E4 Compose A ` -> =C0 Or the reverse. Use whichever makes sense to your brain. Compose ' e -> =E9 Compose " a -> =E4 Compose ^ a -> =E2 Compose , c -> =E7 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