all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Typing and pasting "special" characters directly in emacs in xterm?
@ 2006-10-10 16:45 Adam Funk
  2006-10-10 23:33 ` Pascal Bourguignon
  2006-10-18  3:45 ` Din
  0 siblings, 2 replies; 5+ messages in thread
From: Adam Funk @ 2006-10-10 16:45 UTC (permalink / raw)


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?

Thanks,
Adam

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

* Re: Typing and pasting "special" characters directly in emacs in xterm?
  2006-10-10 16:45 Typing and pasting "special" characters directly in emacs in xterm? Adam Funk
@ 2006-10-10 23:33 ` Pascal Bourguignon
  2006-10-11 10:11   ` Adam Funk
  2006-10-12 16:03   ` Adam Funk
  2006-10-18  3:45 ` Din
  1 sibling, 2 replies; 5+ messages in thread
From: Pascal Bourguignon @ 2006-10-10 23:33 UTC (permalink / raw)


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.

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

* Re: Typing and pasting "special" characters directly in emacs in xterm?
  2006-10-10 23:33 ` Pascal Bourguignon
@ 2006-10-11 10:11   ` Adam Funk
  2006-10-12 16:03   ` Adam Funk
  1 sibling, 0 replies; 5+ messages in thread
From: Adam Funk @ 2006-10-11 10:11 UTC (permalink / raw)


On 2006-10-10, Pascal Bourguignon <pjb@informatimago.com> wrote:

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

OK, now I understand why it's going wrong!


> 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".

I've just tried the second suggestions and I'm still getting the same
results (over ssh and locally).  I'll look at the .Xresources stuff
later.


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

I thought xterm *was* UTF-8 aware --- at least, when I'm typing in it
other than in emacs, the "non-US" characters appear normally.


Thanks very much --- I haven't solved the problem yet but at least now
I have a good idea of what the problem is.

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

* Re: Typing and pasting "special" characters directly in emacs in xterm?
  2006-10-10 23:33 ` Pascal Bourguignon
  2006-10-11 10:11   ` Adam Funk
@ 2006-10-12 16:03   ` Adam Funk
  1 sibling, 0 replies; 5+ messages in thread
From: Adam Funk @ 2006-10-12 16:03 UTC (permalink / raw)


On 2006-10-10, Pascal Bourguignon <pjb@informatimago.com> wrote:

> Mind setting the various LC_* environment variables to indicate the
> encoding you use.

I have these two in my `env` output

LANG=en_GB.UTF-8
LANGUAGE=en_GB:en

but none of the LC_* are set.  `locale` gives this output:

$ locale 
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=


This is the same on the local and remote machines.  Do I need to set
something else?

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

* Re: Typing and pasting "special" characters directly in emacs in xterm?
  2006-10-10 16:45 Typing and pasting "special" characters directly in emacs in xterm? Adam Funk
  2006-10-10 23:33 ` Pascal Bourguignon
@ 2006-10-18  3:45 ` Din
  1 sibling, 0 replies; 5+ messages in thread
From: Din @ 2006-10-18  3:45 UTC (permalink / raw)


Hi Adam,
             I was run into the same problem.  I was able to going
through it by adding

xtrem*eightBitInput:false
xterm*metaSendsEscape:true

to .Xdefaults file. After adding these changes you may need to run

$ xrdb .Xdefaults

thanks,
Dinesh


Adam Funk wrote:
> 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?
> 
> Thanks,
> Adam

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

end of thread, other threads:[~2006-10-18  3:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-10 16:45 Typing and pasting "special" characters directly in emacs in xterm? Adam Funk
2006-10-10 23:33 ` Pascal Bourguignon
2006-10-11 10:11   ` Adam Funk
2006-10-12 16:03   ` Adam Funk
2006-10-18  3:45 ` Din

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.