[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9563: dired-copy-filename-as-kill doesn't copy file names to PRIMARY

From: Chong Yidong
Subject: bug#9563: dired-copy-filename-as-kill doesn't copy file names to PRIMARY selection
Date: Sat, 14 Jul 2012 09:50:02 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Juri Linkov <address@hidden> writes:

> 1. emacs -Q
> 2. Open a shell script, mark a multi-line region with a few commands
>    and copy it with `M-w'.
> 3. Forget it.
> 4. Open a Dired buffer.
> 5. Copy a file name with `M-0 w'.
> 6. Open xterm.
> 7. Paste the copied file name with `S-Insert'.
> Instead of pasting the copied file name it starts executing random
> commands, i.e. if text copied at step 2 contains newlines, it's
> submitted for execution to the shell.
> I think `dired-copy-filename-as-kill' should do the same as
> `deactivate-mark' does with (x-set-selection 'PRIMARY ...)

Hmm, I don't think this is a real issue.  You can come up with similar
scenarios in other applications.

- Select some text in one Firefox window
- In another Firefox window, click and drag some text with the mouse (so
  it's now on the primary selection)
- Re-select the first window and type Control-c
- Click mouse-2 to in an xterm
    => the text from the second window (which still holds the primary
       selection) gets pasted

Granted, Emacs has more ways to "silently" put things on the clipboard
or primary selection, i.e. without having to drag the mouse first.  But
I think it is overstepping the bounds of expectation for us to clobber
the primary selection while putting text in the clipboard, just to
prevent the user from doing something that might or might not be an
error (e.g. the user may really want to paste the primary selection).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]