Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 5998 - Context insensitive completion (like in emacs using "Alt+/")
Summary: Context insensitive completion (like in emacs using "Alt+/")
Status: RESOLVED DUPLICATE of bug 11668
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Kai-Uwe Maetzel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 11668
  Show dependency tree
 
Reported: 2001-11-16 08:23 EST by Genady Beryozkin CLA
Modified: 2005-01-11 03:50 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Genady Beryozkin CLA 2001-11-16 08:23:44 EST
I would like to see another EMACS feature (I think I posted it already
here):
 
Text autocompletion: Hitting <ALT+/> (alt+slash) will complete the
current word with all possible completions from
open editors. This feature should be context-less, i.e, ignore its
position and it should be available in all editors
(java, text, etc).


I can use it when I edit some configuration file and I need to complete a class
name from
one of the open editors, or when I write some documentation and have to type
long words
which have nothing to do with java code
Comment 1 Rodrigo Peretti CLA 2001-11-16 08:50:37 EST
Moving to Platform UI.
Comment 2 Johan Walles CLA 2001-11-16 09:23:54 EST
For reference, this function is called "hippie-expand" in Emacs.  Basically it
looks for completions in a couple of different places:

* look for file names on disk
* look for words in the current buffer
* look for words in the clipboard
* look for words in deleted text* look for lisp function names

I don't know the particular order of the search or the exact algorithm used, but
roughly, this is what it does.  If it matters to anybody, I have it bound to
SHIFT-TAB in Emacs, and actually find it quite useful.  Possibly, Eclipse could
use this instead of code completion in any context where code completion is not
available (like comments or non-java buffers).
Comment 3 Lev Epshteyn CLA 2002-03-19 11:20:51 EST
I would venture to say that this option should be made available in the java editor as well. I find 
the emacs auto-completion (even with its lack of context sensitivity) to make me more efficient 
that the current eclipse one. The reason is because emacs automatically inserts the next 
available completion into the buffer, so that if the first suggestion is correct (as is usually 
the case), you just go on editing - without having to shift your eyes to the completion list that 
eclipse drops down for you. And because you are pressing the same key combo over and over again to 
cycle through available completion, instead of  having to move your hand to the arrows to select 
the one you want, emacs is faster even if the correct choice is not the first one it proposes.
Comment 4 Johan Walles CLA 2002-03-19 11:53:12 EST
Lev: To me it sounds as if what you are opposed to is the UI of the context
sensitive completion, not its context sensitivity.  Is that correct?  Would a
more hippie-expand:ish UI for the current context sensitive completion make you
happier?
Comment 5 Lev Epshteyn CLA 2002-03-19 12:18:29 EST
I wouldn't say that I am "opposed" to it, but yes, i believe it is the UI that could use extension. I 
didn't want to file a second bug saying "make autocomp the same as EMACS" :)

I think both 
behaviors are useful. A "visual" autocomp (the way eclipse does it now) is a good way for you to see 
your options when you're not sure what identifier to choose. An emacs ("hippie:is") style of 
completion is useful for when you know exactly what you want to type in, but want a shortcut to doing 
so.

Having both versions of it would be great: Alt-Space for what it already does and Alt-Slash 
for emacs style completion. 
Comment 6 Todd Chambery CLA 2002-04-19 12:40:05 EDT
JEdit has something akin to this feature.  Working in any text file, hitting 
ctrl-b (I think, I reconfigured the mapping to ctrl-space) will provide a 
completion list based on all text in the active buffer.  As was mentioned, this 
is very helpful when writing documentation, or in XML/HTML and that sort of 
thing.
Comment 7 Kai-Uwe Maetzel CLA 2002-06-05 19:42:25 EDT
Post 2.0
Comment 8 Johan Walles CLA 2002-06-06 02:32:54 EDT
This seems like a dupe of bug 11668.  I know this one was first, but the other
one comes with patches.  As I am not allowed to mark it as a duplicate, it'd be
great if somebody with proper permissions could do it.
Comment 9 Tom Hofmann CLA 2005-01-11 03:49:24 EST
reopening to mark as dup.
Comment 10 Tom Hofmann CLA 2005-01-11 03:50:02 EST
closing as dup as requested in comment 8.

*** This bug has been marked as a duplicate of 11668 ***