Bug 45848 - [misc] Emacs like kill ring
Summary: [misc] Emacs like kill ring
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement with 11 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 119578 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-31 08:32 EST by Thomas Groß CLA
Modified: 2019-11-15 15:05 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Groß CLA 2003-10-31 08:32:57 EST
Hi,

is there a possibility to add to the Eclipse editor the kill-ring functionality
from emacs.

Essentially this work like this:
   - The clipboard keeps a history of the strings copied to it via cut and copy
operations.
   - Each time you paste something, the last entry of the clipboard is pasted in
   - with the M-y (perhaps M-v for non emacs keybindings) you can go backwards
in the clipboard history
   - the currently pasted text gets overwritten with the older text each time
you press M-y
 
    thomas
Comment 1 Felix Berger CLA 2005-03-05 11:14:03 EST
I once did an implementation for swing by replacing the standard text actions 
for the JTextComponents. 
 
The implementation can be found here: 
 
http://cvs.sourceforge.net/viewcvs.py/xnap/xnap3/src/org/xnap/gui/util/EmacsKeyBindings.java?rev=1.4&view=auto 
 
I think the following things are needed: 
 
A global kill-ring list, with a similar function as the clipboard. 
The list has to be updated on each cut/copy/kill line/kill word and paste 
on paste too because the entry that was pasted last has to be moved to the 
beginning of the ring 
The start and end position of the last paste so that this text can be replaced 
by ensuing yank-pop calls. 
 
I'd be happy to provide help since I sorely miss this feature too. 
 
Regards, 
Felix Berger 
Comment 2 Dani Megert CLA 2005-03-08 04:46:42 EST
There are currently no plans to work on this. However, if you provide a patch
and test cases we will be happy to review and release it if it is of high quality.
Comment 3 Dani Megert CLA 2005-08-26 02:41:32 EDT
This is in R3.1 (Word Completion, Alt+/
Comment 4 Felix Berger CLA 2005-08-26 07:17:49 EDT
(In reply to comment #3)   
> This is in R3.1 (Word Completion, Alt+/   
   
The part (Word Completion, Alt+/) is what confuses me a little.   
   
kill-ring means, all text parts that are cut(killed) are stored in a ring-list 
and can be accessed when pasting text later on.   
   
In Emacs you first paste the last cut text using Ctrl-y (the command is called   
yank) and if that's not the text you wanted to paste you (repeatedly) press 
Alt-y or Meta-y (yank-pop) to cycle through the kill-ring. 
 
  
Comment 5 Dani Megert CLA 2005-08-26 08:13:49 EDT
Closed wrong bug.
Comment 6 Mark Feber CLA 2009-06-16 18:42:24 EDT
This behavior is now available in the Emacs+ plugin.
See:
http://www.eclipseplugincentral.com/modules.php?op=modload&name=Web_Links&file=index&req=viewlink&cid=1442

The relevant portion from the doc reads:

Kill Ring Behavior - The kill ring expands the ability to retrieve killed text beyond the most recent kill/copy. The kill ring remembers recent line, region and word deletions (adjacent word deletions - forward or back - are collected into a single entry) as well as balanced expression (S-expression) deletions.  By default, word deletions are not copied to the system clipboard; but balanced expression deletions are.  The length of the kill ring defaults to 30 entries.  These and other kill ring behaviors can be modified on the preferences page.

    * Yank (Ctrl-Y):  Insert the last stretch of killed text
    * Yank-Pop (Alt-Y) or (ESC-Y): Replace a just-yanked stretch of 
      killed text with a different stretch
    * Rotate Yank Pointer (Ctrl-Alt-Y): Rotate the yank pointer in the kill ring

Comment 7 Boris Bokowski CLA 2009-06-22 11:06:43 EDT
*** Bug 119578 has been marked as a duplicate of this bug. ***
Comment 8 Eclipse Webmaster CLA 2019-09-06 16:08:11 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.