unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* cut and paste hazard
@ 2004-03-05 22:19 Paul Rubin
  2004-03-10  9:21 ` Andreas Schwab
  2004-03-11 20:19 ` Richard Stallman
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Rubin @ 2004-03-05 22:19 UTC (permalink / raw)


I tried cutting and pasting some text from a web browser window into
an Emacs buffer in a terminal window, and got some weird behavior
(beeping and hard-to-fathon minibuffer error messages) from Emacs on
the paste operation.  It was just a sentence or two of plain text
about a guy from Spain and I couldn't at first understand what was wrong.

It turned out that because the Spanish guy's name contained an
accented character, Emacs interpreted the 8-bit code for that
character as an editing command with the Meta key set.

This is kind of scary--that particular accented string luckily didn't
screw up anything by accident.  It's even a security risk, since I
could imagine being able to maliciously engineer a block of text that
did something nasty when pasted into Emacs.

Unfortunately, at least with Emacs running in a terminal window and
with the paste operation being done externally by the window manager,
I don't see a workaround.  If Emacs is running in an X window, it
should accept 8-bit typein as normal text, and require actual meta key
events to set off editing commands (I don't know if it does this).

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

* Re: cut and paste hazard
  2004-03-05 22:19 cut and paste hazard Paul Rubin
@ 2004-03-10  9:21 ` Andreas Schwab
  2004-03-11 20:19 ` Richard Stallman
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2004-03-10  9:21 UTC (permalink / raw)
  Cc: bug-gnu-emacs

Paul Rubin <phr-2003@nightsong.com> writes:

> Unfortunately, at least with Emacs running in a terminal window and
> with the paste operation being done externally by the window manager,
> I don't see a workaround.

Use set-input-mode with META = 0.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: cut and paste hazard
  2004-03-05 22:19 cut and paste hazard Paul Rubin
  2004-03-10  9:21 ` Andreas Schwab
@ 2004-03-11 20:19 ` Richard Stallman
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Stallman @ 2004-03-11 20:19 UTC (permalink / raw)
  Cc: bug-gnu-emacs

    It turned out that because the Spanish guy's name contained an
    accented character, Emacs interpreted the 8-bit code for that
    character as an editing command with the Meta key set.

Emacs running on a terminal interprets character codes 128-255
as meta keys; it always has.  Is there any way to distinguish
Latin-1 text from meta characters when using an xterm?

      If Emacs is running in an X window, it
    should accept 8-bit typein as normal text, and require actual meta key
    events to set off editing commands (I don't know if it does this).

Emacs already does this, when using its own window.

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

end of thread, other threads:[~2004-03-11 20:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-05 22:19 cut and paste hazard Paul Rubin
2004-03-10  9:21 ` Andreas Schwab
2004-03-11 20:19 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

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

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