unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Michael Heerdegen'" <michael_heerdegen@web.de>,
	"'Peter Dyballa'" <Peter_Dyballa@web.de>
Cc: 'help-gnu-emacs Help' <help-gnu-emacs@gnu.org>
Subject: RE: how to get subsequent text copies to emacs kill ring?
Date: Thu, 16 May 2013 13:16:03 -0700	[thread overview]
Message-ID: <2D114A341A214863AF76E9C5CC2D145B@us.oracle.com> (raw)
In-Reply-To: <871u967myb.fsf@web.de>

> > > Is it possible???
> >
> > No. GNU Emacs fills its kill-ring with snippets from within. Firefox
> > and X11 have their own cut&paste boards. Both are not
> > synchronised. Maybe xclipboard can be useful for you as an interim
> > storage.
> 
> Having something like that in Emacs indeed would be really useful.
> 
> I think this is not trivial to implement.  Emacs has access to the
> primary selection, but doesn't notice if it changes.  Any ideas?

I have often wished that I could access more items from the Windows clipboard
via the kill ring.  (But see also #6 below, which is a stronger wish.)

However:

1. Dunno whether recuperating the entire MS Windows clipboard (or another
external clipboard) - all entries - is feasible or easily realized.

(The Windows Systems clipboard holds only one entry, but the MS Office clipboard
holds up to 24.  So I guess I should say Office, not Windows, clipboard.)

2. Even if it can be easily realized, sometimes a user might want to pull in all
of the external clipboard entries, and sometimes s?he might want to pull in only
the latest entry.

3. A user option could express a user's general preference for adding to the
kill ring either the whole external clipboard or just its latest entry.

4. But even with such a preference, a user might want to override the preference
on the fly sometimes.

For instance, although I am sometimes annoyed that I cannot get to more than one
external clipboard entry from the kill ring, it is also the case that I would
not _always_ want all of the external clipboard to be prepended to my kill ring.

5. Such overriding could maybe be implemented by adding the external clipboard
entries to a separate Emacs list, which could be used together with the kill
ring.  IOW, add everything external to the separate list, but have `yank' etc.
handle the items on that list according to the user setting (#3), by default.

You would have to have a way to specify override behavior on the fly.  A prefix
key for `yank' already has another meaning, so that cannot be used to flip the
preference behavior (unless we designate a specific prefix, such as plain `C-u
C-u', for that).  An "alternate-yank" key (different from `C-y') could be one
way to get the opposite behavior to the one defined by the option.

6. To change the subject a bit, I find that what annoys me the most is not an
inability to access multiple external clipboard items from Emacs, but an
inability to access the latest external clipboard item after I have copied
something else (from Emacs) onto the kill ring.  IOW, if you want to yank the
externally copied text then you must do so immediately.

For example:

a. I hit `C-c' in a Windows app, copying selected text to the Windows clipboard.

b. In Emacs, I use `C-w' or `M-w' somewhere, adding some Emacs text to the kill
ring.

c. I want to be able to use `C-y M-y' to yank the Windows clipboard item.  Too
late.

I don't have a good answer for this, but it does annoy me from time to time.
Essentially, I have to remember to either (i) not copy or kill anything from
Emacs to the kill ring after I've copied in Windows or (ii) yank the Windows
copy immediately, then undo, then copy/kill text from Emacs etc., then later,
e.g., `C-y M-y...' to yank the Windows copy.




  reply	other threads:[~2013-05-16 20:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 14:59 how to get subsequent text copies to emacs kill ring? Paul K
2013-05-16 15:05 ` Peter Dyballa
     [not found] ` <mailman.25922.1368716751.855.help-gnu-emacs@gnu.org>
2013-05-16 19:18   ` Michael Heerdegen
2013-05-16 20:16     ` Drew Adams [this message]
2013-05-17  0:22       ` Stefan Monnier
2013-05-17  1:38         ` Samuel Wales
2013-05-17  5:00           ` Drew Adams
     [not found]     ` <mailman.25948.1368735385.855.help-gnu-emacs@gnu.org>
2013-05-16 23:06       ` Joost Kremers

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=2D114A341A214863AF76E9C5CC2D145B@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=Peter_Dyballa@web.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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.
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).