help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: how to get subsequent text copies to emacs kill ring?


From: Drew Adams
Subject: RE: how to get subsequent text copies to emacs kill ring?
Date: Thu, 16 May 2013 13:16:03 -0700

> > > 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 via email to

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