all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pascal Bourguignon <pjb@informatimago.com>
Subject: Re: Typing and pasting "special" characters directly in emacs in xterm?
Date: Wed, 11 Oct 2006 01:33:18 +0200	[thread overview]
Message-ID: <87r6xfeog1.fsf@thalassa.informatimago.com> (raw)
In-Reply-To: k9vsv3-npt.ln1@news.ducksburg.com

Adam Funk <a24061@yahoo.com> 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-<MouseLeftDown>
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.

  reply	other threads:[~2006-10-10 23:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-10 16:45 Typing and pasting "special" characters directly in emacs in xterm? Adam Funk
2006-10-10 23:33 ` Pascal Bourguignon [this message]
2006-10-11 10:11   ` Adam Funk
2006-10-12 16:03   ` Adam Funk
2006-10-18  3:45 ` Din

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

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

  git send-email \
    --in-reply-to=87r6xfeog1.fsf@thalassa.informatimago.com \
    --to=pjb@informatimago.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.