From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: Typing and pasting "special" characters directly in emacs in xterm? Date: Wed, 11 Oct 2006 01:33:18 +0200 Organization: Informatimago Message-ID: <87r6xfeog1.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1160523640 17993 80.91.229.2 (10 Oct 2006 23:40:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Oct 2006 23:40:40 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 11 01:40:36 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GXRD2-00056T-2k for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Oct 2006 01:40:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GXRD1-0001IW-JE for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Oct 2006 19:40:27 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 59 Original-X-Trace: individual.net 8CdD4RUu5KaAsUWxKoX3QQGooQqPxYtNV3j2UOA4gabPUtB5zV Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:/6djee/Xx8kkvLbywuF2V7ZDdPc= Original-Xref: shelby.stanford.edu gnu.emacs.help:142360 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37981 Archived-At: Adam Funk writes: > When I'm running emacs as an X application (i.e. in it's own GUI > window) I have no problem typing £ and composed non-US characters (I > have a UK keyboard and the compose:rwin X option) and using X to copy > text including funny quotation marks (for example) and paste it into > emacs. > > But when I run emacs -nw in xterm or over ssh in an xterm, it tends to > blow up when I do these things: the desired characters don't appear, > the point moves around and sometimes bits of text get deleted. > > (I've tried googling for this but I apparently don't know the right > words to describe this problem.) > > Any suggestions? Since Meta is not an ASCII code, there are two ways to send Meta thru a terminal. The first way is to use escape ESC, to signify that the following character is to be combined with Meta. M-d is transmited as the bytes 27 100 (for ASCII ESC and ASCII d). The second way is to assume a 7-bit ASCII keyboard, and to use the 8th bit to indicate when Meta is pressed. M-d is then transmited as the byte 228 (100 + 8th bit set). Unfortunately, if you have an ISO-8859-1 or ISO-8859-15 keyboard, the byte 228 is the ISO-8859-1/15 character ä. So when you type ä, you send 228, and emacs interprets that as M-d, which will delete the following word. So, you should configure your terminal to send ESC for Meta instead of setting the high bit. Then you can use the high bit to send ISO-8859-15 character codes instead of ASCII+Meta. You can do that editing ~/.Xresources or with Control- in the xterm window to display a menu and select "Meta Sends Escape". Mind setting the various LC_* environment variables to indicate the encoding you use. You can also use a UTF-8 aware terminal, to be able to display and enter characters out of the ISO-8859-15 character set. -- __Pascal Bourguignon__ http://www.informatimago.com/ ATTENTION: Despite any other listing of product contents found herein, the consumer is advised that, in actuality, this product consists of 99.9999999999% empty space.